summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms7000/tms7000.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms7000/tms7000.h')
-rw-r--r--src/devices/cpu/tms7000/tms7000.h39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/devices/cpu/tms7000/tms7000.h b/src/devices/cpu/tms7000/tms7000.h
index 054d054a7f6..bfcf61350fd 100644
--- a/src/devices/cpu/tms7000/tms7000.h
+++ b/src/devices/cpu/tms7000/tms7000.h
@@ -45,13 +45,17 @@ public:
auto in_porte() { return m_port_in_cb[4].bind(); }
auto out_porte() { return m_port_out_cb[4].bind(); }
- DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { if (!machine().side_effects_disabled()) logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; };
- DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); };
+ // clock divider mask option
+ void set_divide_by_2() { m_divider = 2; }
+ void set_divide_by_4() { m_divider = 4; }
- DECLARE_READ8_MEMBER(tms7000_pf_r);
- DECLARE_WRITE8_MEMBER(tms7000_pf_w);
- DECLARE_READ8_MEMBER(tms7002_pf_r) { return tms7000_pf_r(space, offset + 0x10); }
- DECLARE_WRITE8_MEMBER(tms7002_pf_w) { tms7000_pf_w(space, offset + 0x10, data); }
+ uint8_t tms7000_unmapped_rf_r(offs_t offset) { if (!machine().side_effects_disabled()) logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; };
+ void tms7000_unmapped_rf_w(offs_t offset, uint8_t data) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); };
+
+ uint8_t tms7000_pf_r(offs_t offset);
+ void tms7000_pf_w(offs_t offset, uint8_t data);
+ uint8_t tms7002_pf_r(offs_t offset) { return tms7000_pf_r(offset + 0x10); }
+ void tms7002_pf_w(offs_t offset, uint8_t data) { tms7000_pf_w(offset + 0x10, data); }
bool chip_is_cmos() const { return (m_info_flags & CHIP_IS_CMOS) ? true : false; }
bool chip_is_family_70x0() const { return chip_get_family() == CHIP_FAMILY_70X0; }
@@ -80,8 +84,8 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } // internal /2 divider
- virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } // internal /2 divider
+ virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + m_divider - 1) / 2; }
+ virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * m_divider); }
virtual uint32_t execute_min_cycles() const noexcept override { return 5; }
virtual uint32_t execute_max_cycles() const noexcept override { return 49; }
virtual uint32_t execute_input_lines() const noexcept override { return 2; }
@@ -106,7 +110,8 @@ protected:
devcb_read8::array<5> m_port_in_cb;
devcb_write8::array<5> m_port_out_cb;
- uint32_t m_info_flags;
+ const uint32_t m_info_flags;
+ unsigned m_divider;
address_space *m_program;
memory_access_cache<0, 0, ENDIANNESS_BIG> *m_cache;
@@ -322,17 +327,17 @@ class tms70c46_device : public tms7000_device
public:
tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8_MEMBER(control_r);
- DECLARE_WRITE8_MEMBER(control_w);
+ uint8_t control_r();
+ void control_w(uint8_t data);
- DECLARE_READ8_MEMBER(dockbus_status_r);
- DECLARE_WRITE8_MEMBER(dockbus_status_w);
- DECLARE_READ8_MEMBER(dockbus_data_r);
- DECLARE_WRITE8_MEMBER(dockbus_data_w);
+ uint8_t dockbus_status_r();
+ void dockbus_status_w(uint8_t data);
+ uint8_t dockbus_data_r();
+ void dockbus_data_w(uint8_t data);
// access I/O port E if databus is disabled
- DECLARE_READ8_MEMBER(e_bus_data_r) { return machine().side_effects_disabled() ? 0xff : ((m_control & 0x20) ? 0xff : m_port_in_cb[4]()); }
- DECLARE_WRITE8_MEMBER(e_bus_data_w) { if (~m_control & 0x20) m_port_out_cb[4](data); }
+ uint8_t e_bus_data_r() { return machine().side_effects_disabled() ? 0xff : ((m_control & 0x20) ? 0xff : m_port_in_cb[4]()); }
+ void e_bus_data_w(uint8_t data) { if (~m_control & 0x20) m_port_out_cb[4](data); }
void tms70c46_mem(address_map &map);
protected: