mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Add skeleton support for K1801VM2 (as clone of T11), change relevant drivers to use it.
This commit is contained in:
parent
3c44b77052
commit
ae053d119a
@ -36,8 +36,24 @@
|
|||||||
|
|
||||||
|
|
||||||
const device_type T11 = &device_creator<t11_device>;
|
const device_type T11 = &device_creator<t11_device>;
|
||||||
|
const device_type K1801VM2 = &device_creator<k1801vm2_device>;
|
||||||
|
|
||||||
|
|
||||||
|
k1801vm2_device::k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||||
|
: t11_device(mconfig, K1801VM2, "K1801VM2", tag, owner, clock, "k1801vm2", __FILE__)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
t11_device::t11_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||||
|
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
|
||||||
|
, m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0)
|
||||||
|
, c_initial_mode(0)
|
||||||
|
{
|
||||||
|
m_is_octal = true;
|
||||||
|
memset(m_reg, 0x00, sizeof(m_reg));
|
||||||
|
memset(&m_psw, 0x00, sizeof(m_psw));
|
||||||
|
}
|
||||||
|
|
||||||
t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||||
: cpu_device(mconfig, T11, "T11", tag, owner, clock, "t11", __FILE__)
|
: cpu_device(mconfig, T11, "T11", tag, owner, clock, "t11", __FILE__)
|
||||||
, m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0)
|
, m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0)
|
||||||
@ -294,6 +310,26 @@ void t11_device::state_string_export(const device_state_entry &entry, std::strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void k1801vm2_device::state_string_export(const device_state_entry &entry, std::string &str)
|
||||||
|
{
|
||||||
|
switch (entry.index())
|
||||||
|
{
|
||||||
|
case STATE_GENFLAGS:
|
||||||
|
strprintf(str, "%c%c%c%c%c%c%c%c%c",
|
||||||
|
m_psw.b.l & 0x100 ? 'H':'.',
|
||||||
|
m_psw.b.l & 0x80 ? 'P':'.',
|
||||||
|
m_psw.b.l & 0x40 ? '?':'.',
|
||||||
|
m_psw.b.l & 0x20 ? '?':'.',
|
||||||
|
m_psw.b.l & 0x10 ? 'T':'.',
|
||||||
|
m_psw.b.l & 0x08 ? 'N':'.',
|
||||||
|
m_psw.b.l & 0x04 ? 'Z':'.',
|
||||||
|
m_psw.b.l & 0x02 ? 'V':'.',
|
||||||
|
m_psw.b.l & 0x01 ? 'C':'.'
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
*
|
*
|
||||||
@ -326,6 +362,13 @@ void t11_device::device_reset()
|
|||||||
m_wait_state = 0;
|
m_wait_state = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void k1801vm2_device::device_reset()
|
||||||
|
{
|
||||||
|
t11_device::device_reset();
|
||||||
|
|
||||||
|
PC = RWORD(c_initial_mode);
|
||||||
|
PSW = RWORD(c_initial_mode+2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
|
@ -37,6 +37,7 @@ class t11_device : public cpu_device
|
|||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
t11_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
|
t11_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
|
||||||
|
t11_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||||
|
|
||||||
// static configuration helpers
|
// static configuration helpers
|
||||||
static void set_initial_mode(device_t &device, const UINT16 mode) { downcast<t11_device &>(device).c_initial_mode = mode; }
|
static void set_initial_mode(device_t &device, const UINT16 mode) { downcast<t11_device &>(device).c_initial_mode = mode; }
|
||||||
@ -1133,8 +1134,23 @@ private:
|
|||||||
void sub_ixd_ixd(UINT16 op);
|
void sub_ixd_ixd(UINT16 op);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class k1801vm2_device : public t11_device
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// device-level overrides
|
||||||
|
virtual void device_reset();
|
||||||
|
|
||||||
|
// device_state_interface overrides
|
||||||
|
void state_string_export(const device_state_entry &entry, std::string &str);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
extern const device_type T11;
|
extern const device_type T11;
|
||||||
|
extern const device_type K1801VM2;
|
||||||
|
|
||||||
|
|
||||||
#endif /* __T11_H__ */
|
#endif /* __T11_H__ */
|
||||||
|
@ -63,8 +63,8 @@ UINT32 mk85_state::screen_update_mk85(screen_device &screen, bitmap_ind16 &bitma
|
|||||||
|
|
||||||
static MACHINE_CONFIG_START( mk85, mk85_state )
|
static MACHINE_CONFIG_START( mk85, mk85_state )
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD("maincpu",T11, XTAL_4MHz)
|
MCFG_CPU_ADD("maincpu", K1801VM2, XTAL_4MHz)
|
||||||
MCFG_T11_INITIAL_MODE(5 << 13) /* start from 0000 */
|
MCFG_T11_INITIAL_MODE(0)
|
||||||
MCFG_CPU_PROGRAM_MAP(mk85_mem)
|
MCFG_CPU_PROGRAM_MAP(mk85_mem)
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@ UINT32 mk90_state::screen_update_mk90(screen_device &screen, bitmap_ind16 &bitma
|
|||||||
|
|
||||||
static MACHINE_CONFIG_START( mk90, mk90_state )
|
static MACHINE_CONFIG_START( mk90, mk90_state )
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD("maincpu",T11, XTAL_4MHz)
|
MCFG_CPU_ADD("maincpu", K1801VM2, XTAL_4MHz)
|
||||||
MCFG_T11_INITIAL_MODE(0xf600)
|
MCFG_T11_INITIAL_MODE(0x8000)
|
||||||
MCFG_CPU_PROGRAM_MAP(mk90_mem)
|
MCFG_CPU_PROGRAM_MAP(mk90_mem)
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,12 +58,12 @@ UINT32 uknc_state::screen_update_uknc(screen_device &screen, bitmap_ind16 &bitma
|
|||||||
|
|
||||||
static MACHINE_CONFIG_START( uknc, uknc_state )
|
static MACHINE_CONFIG_START( uknc, uknc_state )
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD("maincpu", T11, 8000000)
|
MCFG_CPU_ADD("maincpu", K1801VM2, 8000000)
|
||||||
MCFG_T11_INITIAL_MODE(0x36ff) /* initial mode word has DAL15,14,11,8 pulled low */
|
MCFG_T11_INITIAL_MODE(0x8000)
|
||||||
MCFG_CPU_PROGRAM_MAP(uknc_mem)
|
MCFG_CPU_PROGRAM_MAP(uknc_mem)
|
||||||
|
|
||||||
MCFG_CPU_ADD("subcpu", T11, 6000000)
|
MCFG_CPU_ADD("subcpu", K1801VM2, 6000000)
|
||||||
MCFG_T11_INITIAL_MODE(0x36ff) /* initial mode word has DAL15,14,11,8 pulled low */
|
MCFG_T11_INITIAL_MODE(0x8000)
|
||||||
MCFG_CPU_PROGRAM_MAP(uknc_sub_mem)
|
MCFG_CPU_PROGRAM_MAP(uknc_sub_mem)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user