summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/cosmac/cosmac.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/cosmac/cosmac.h')
-rw-r--r--src/devices/cpu/cosmac/cosmac.h71
1 files changed, 66 insertions, 5 deletions
diff --git a/src/devices/cpu/cosmac/cosmac.h b/src/devices/cpu/cosmac/cosmac.h
index 54e519f44ed..e076d5afe4d 100644
--- a/src/devices/cpu/cosmac/cosmac.h
+++ b/src/devices/cpu/cosmac/cosmac.h
@@ -69,7 +69,7 @@
Type Internal ROM Internal RAM Timer Pin 16 (*)
------------------------------------------------------------------
CDP1802 none none no Vcc
- CDP1803 ? ? ? ?
+ CDP1803 ? ? ? ? does not exist?
CDP1804 2 KB 64 bytes yes ?
CDP1805 none 64 bytes yes _ME
CDP1806 none none yes Vdd
@@ -333,6 +333,16 @@ protected:
void out();
void inp();
+ // extended opcodes
+ void rldi();
+ void rlxa();
+ void rsxd();
+ void rnx();
+ void bci();
+ void bxi();
+ void ldc();
+ void gec();
+
const address_space_config m_program_config;
const address_space_config m_io_config;
@@ -359,6 +369,7 @@ protected:
enum class cosmac_state : u8
{
STATE_0_FETCH = 0,
+ STATE_0_FETCH_2ND,
STATE_1_INIT,
STATE_1_EXECUTE,
STATE_1_EXECUTE_2ND,
@@ -369,7 +380,7 @@ protected:
// internal state
uint16_t m_pc; // fake program counter
- uint8_t m_op; // current opcode
+ uint16_t m_op; // current opcode
uint8_t m_flagsio; // flags storage for state saving
cosmac_state m_state; // state
cosmac_mode m_mode; // control mode
@@ -405,7 +416,8 @@ protected:
// opcode/condition tables
typedef void (cosmac_device::*ophandler)();
- virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) const = 0;
+ virtual cosmac_device::ophandler get_ophandler(uint16_t opcode) const = 0;
+ virtual bool has_extended_opcodes() { return false; }
};
@@ -421,10 +433,11 @@ protected:
// device_disasm_interface overrides
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
- virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) const override;
+ virtual cosmac_device::ophandler get_ophandler(uint16_t opcode) const override;
virtual void output_state_code() override;
+private:
static const ophandler s_opcodetable[256];
};
@@ -438,18 +451,66 @@ public:
cdp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ cdp1802_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device_disasm_interface overrides
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
- virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) const override;
+ virtual cosmac_device::ophandler get_ophandler(uint16_t opcode) const override;
+private:
static const ophandler s_opcodetable[256];
};
+// ======================> cdp1804_device
+
+class cdp1804_device : public cdp1802_device
+{
+public:
+ // construction/destruction
+ cdp1804_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ cdp1804_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual cosmac_device::ophandler get_ophandler(uint16_t opcode) const override;
+ virtual bool has_extended_opcodes() override { return true; }
+
+private:
+ static const ophandler s_opcodetable_ex[256];
+};
+
+
+// ======================> cdp1805_device
+
+class cdp1805_device : public cdp1804_device
+{
+public:
+ // construction/destruction
+ cdp1805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ cdp1805_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+// ======================> cdp1806_device
+
+class cdp1806_device : public cdp1805_device
+{
+public:
+ // construction/destruction
+ cdp1806_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
// device type definition
DECLARE_DEVICE_TYPE(CDP1801, cdp1801_device)
DECLARE_DEVICE_TYPE(CDP1802, cdp1802_device)
+DECLARE_DEVICE_TYPE(CDP1804, cdp1804_device)
+DECLARE_DEVICE_TYPE(CDP1805, cdp1805_device)
+DECLARE_DEVICE_TYPE(CDP1806, cdp1806_device)
#endif // MAME_CPU_COSMAC_COSMAC_H