summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu
diff options
context:
space:
mode:
author Sergey Svishchev <shattered@users.sourceforge.net>2014-11-25 21:39:00 +0300
committer Sergey Svishchev <shattered@users.sourceforge.net>2015-08-30 15:06:06 +0300
commitae053d119aadb1a0b2a41186935f7c874838c0e5 (patch)
tree13f2bad489a286305fb5f5ad9ac7f0bef1fc37f0 /src/emu/cpu
parent3c44b770526c90c6a07aed4a9904c815948d0138 (diff)
Add skeleton support for K1801VM2 (as clone of T11), change relevant drivers to use it.
Diffstat (limited to 'src/emu/cpu')
-rw-r--r--src/emu/cpu/t11/t11.c43
-rw-r--r--src/emu/cpu/t11/t11.h16
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__ */