diff options
author | 2015-08-30 14:35:45 +0200 | |
---|---|---|
committer | 2015-08-30 14:35:45 +0200 | |
commit | 35ab28d865cad0c9c7f330b74c80ead1cc663162 (patch) | |
tree | 0417d798ca5e3974f7c7e25bed3c25aeed03c72b /src/emu/cpu | |
parent | 3c44b770526c90c6a07aed4a9904c815948d0138 (diff) | |
parent | 28287d2970c436de2b1de9ed30270c25f1349fc1 (diff) |
Merge pull request #297 from shattered/_9fcddd8
Add skeleton support for K1801VM2 (as clone of T11) and skeleton driver dvk_kcgd that uses it [shattered]
Diffstat (limited to 'src/emu/cpu')
-rw-r--r-- | src/emu/cpu/t11/t11.c | 43 | ||||
-rw-r--r-- | src/emu/cpu/t11/t11.h | 16 |
2 files changed, 59 insertions, 0 deletions
diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c index 211bbd1f071..97f53e74b34 100644 --- a/src/emu/cpu/t11/t11.c +++ b/src/emu/cpu/t11/t11.c @@ -36,8 +36,24 @@ 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) : cpu_device(mconfig, T11, "T11", tag, owner, clock, "t11", __FILE__) , 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; } +void k1801vm2_device::device_reset() +{ + t11_device::device_reset(); + + PC = RWORD(c_initial_mode); + PSW = RWORD(c_initial_mode+2); +} /************************************* diff --git a/src/emu/cpu/t11/t11.h b/src/emu/cpu/t11/t11.h index d5c8c38fb56..c5044a7ad96 100644 --- a/src/emu/cpu/t11/t11.h +++ b/src/emu/cpu/t11/t11.h @@ -37,6 +37,7 @@ class t11_device : public cpu_device public: // construction/destruction 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 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); }; +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 K1801VM2; #endif /* __T11_H__ */ |