summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/upd7810/upd7810.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/upd7810/upd7810.h')
-rw-r--r--src/devices/cpu/upd7810/upd7810.h73
1 files changed, 40 insertions, 33 deletions
diff --git a/src/devices/cpu/upd7810/upd7810.h b/src/devices/cpu/upd7810/upd7810.h
index 1eb39a2b975..294c38fa102 100644
--- a/src/devices/cpu/upd7810/upd7810.h
+++ b/src/devices/cpu/upd7810/upd7810.h
@@ -49,14 +49,14 @@ public:
auto co1_func() { return m_co1_func.bind(); }
auto txd_func() { return m_txd_func.bind(); }
auto rxd_func() { return m_rxd_func.bind(); }
- auto an0_func() { return m_an0_func.bind(); }
- auto an1_func() { return m_an1_func.bind(); }
- auto an2_func() { return m_an2_func.bind(); }
- auto an3_func() { return m_an3_func.bind(); }
- auto an4_func() { return m_an4_func.bind(); }
- auto an5_func() { return m_an5_func.bind(); }
- auto an6_func() { return m_an6_func.bind(); }
- auto an7_func() { return m_an7_func.bind(); }
+ auto an0_func() { return m_an_func[0].bind(); }
+ auto an1_func() { return m_an_func[1].bind(); }
+ auto an2_func() { return m_an_func[2].bind(); }
+ auto an3_func() { return m_an_func[3].bind(); }
+ auto an4_func() { return m_an_func[4].bind(); }
+ auto an5_func() { return m_an_func[5].bind(); }
+ auto an6_func() { return m_an_func[6].bind(); }
+ auto an7_func() { return m_an_func[7].bind(); }
auto pa_in_cb() { return m_pa_in_cb.bind(); }
auto pb_in_cb() { return m_pb_in_cb.bind(); }
@@ -83,10 +83,13 @@ public:
void pd_w(uint8_t data, uint8_t mem_mask = ~0);
void pf_w(uint8_t data, uint8_t mem_mask = ~0);
+ void sck_w(int state);
+
protected:
void upd_internal_128_ram_map(address_map &map);
void upd_internal_256_ram_map(address_map &map);
- void upd_internal_4096_rom_map(address_map &map);
+ void upd_internal_4096_rom_128_ram_map(address_map &map);
+ void upd_internal_4096_rom_256_ram_map(address_map &map);
// flags
enum
@@ -104,7 +107,7 @@ protected:
// IRR flags
enum
{
- INTNMI = 0x0001,
+ INTFNMI = 0x0001,
INTFT0 = 0x0002,
INTFT1 = 0x0004,
INTF1 = 0x0008,
@@ -155,12 +158,14 @@ protected:
// device_disasm_interface overrides
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+ void update_sio(int cycles);
virtual void handle_timers(int cycles);
virtual void upd7810_take_irq();
void upd7810_handle_timer0(int cycles, int clkdiv);
void upd7810_handle_timer1(int cycles, int clkdiv);
+ void upd7810_to_output_change(int state);
void upd7810_co0_output_change();
void upd7810_co1_output_change();
@@ -169,14 +174,7 @@ protected:
devcb_write_line m_co1_func;
devcb_write_line m_txd_func;
devcb_read_line m_rxd_func;
- devcb_read8 m_an0_func;
- devcb_read8 m_an1_func;
- devcb_read8 m_an2_func;
- devcb_read8 m_an3_func;
- devcb_read8 m_an4_func;
- devcb_read8 m_an5_func;
- devcb_read8 m_an6_func;
- devcb_read8 m_an7_func;
+ devcb_read8::array<8> m_an_func;
devcb_read8 m_pa_in_cb;
devcb_read8 m_pb_in_cb;
@@ -238,6 +236,7 @@ protected:
static const struct opcode_s s_opXX_78c06[256];
address_space_config m_program_config;
+ memory_view m_ram_view;
PAIR m_ppc; /* previous program counter */
PAIR m_pc; /* program counter */
@@ -293,10 +292,7 @@ protected:
uint8_t m_pc_pullups;
uint8_t m_pd_pullups;
uint8_t m_pf_pullups;
- uint8_t m_cr0; /* analog digital conversion register 0 */
- uint8_t m_cr1; /* analog digital conversion register 1 */
- uint8_t m_cr2; /* analog digital conversion register 2 */
- uint8_t m_cr3; /* analog digital conversion register 3 */
+ uint8_t m_cr[4]; /* analog digital conversion registers */
uint8_t m_txb; /* transmitter buffer */
uint8_t m_rxb; /* receiver buffer */
uint8_t m_txd; /* port C control line states */
@@ -343,8 +339,8 @@ protected:
const struct opcode_s *m_op64;
const struct opcode_s *m_op70;
const struct opcode_s *m_op74;
- address_space *m_program;
- memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_cache;
+ memory_access<16, 0, 0, ENDIANNESS_LITTLE>::cache m_opcodes;
+ memory_access<16, 0, 0, ENDIANNESS_LITTLE>::specific m_program;
int m_icount;
uint8_t RP(offs_t port);
@@ -1343,14 +1339,6 @@ protected:
void STAX_H_xx();
void JR();
void CALT_7801();
- void DCR_A_7801();
- void DCR_B_7801();
- void DCR_C_7801();
- void DCRW_wa_7801();
- void INR_A_7801();
- void INR_B_7801();
- void INR_C_7801();
- void INRW_wa_7801();
void IN();
void OUT();
void MOV_A_S();
@@ -1379,6 +1367,22 @@ protected:
};
+class upd7811_device : public upd7810_device
+{
+public:
+ // construction/destruction
+ upd7811_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+class upd78c11_device : public upd78c10_device
+{
+public:
+ // construction/destruction
+ upd78c11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
class upd7807_device : public upd7810_device
{
public:
@@ -1398,6 +1402,7 @@ public:
upd7801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ virtual void device_start() override;
virtual void device_reset() override;
virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; }
virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); }
@@ -1416,7 +1421,7 @@ public:
upd78c05_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
- upd78c05_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ upd78c05_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map);
virtual void device_start() override;
virtual void device_reset() override;
@@ -1439,6 +1444,8 @@ public:
DECLARE_DEVICE_TYPE(UPD7810, upd7810_device)
DECLARE_DEVICE_TYPE(UPD78C10, upd78c10_device)
+DECLARE_DEVICE_TYPE(UPD7811, upd7811_device)
+DECLARE_DEVICE_TYPE(UPD78C11, upd78c11_device)
DECLARE_DEVICE_TYPE(UPD7807, upd7807_device)
DECLARE_DEVICE_TYPE(UPD7801, upd7801_device)
DECLARE_DEVICE_TYPE(UPD78C05, upd78c05_device)