diff options
author | 2018-08-21 00:04:38 +0200 | |
---|---|---|
committer | 2018-08-21 00:04:38 +0200 | |
commit | 5a2dce71f7cc3109f50226a3803d0117ae5d9c8d (patch) | |
tree | 702ebb04653d5627e2a8121594bf34a501e77124 | |
parent | f554bd91201aa8e12ec0ef3031571040a1db6f0a (diff) |
ti99: Use a config command instead of a subclass. (nw)
-rw-r--r-- | src/devices/bus/ti99/gromport/gromport.cpp | 8 | ||||
-rw-r--r-- | src/devices/bus/ti99/gromport/gromport.h | 25 | ||||
-rw-r--r-- | src/mame/drivers/ti99_8.cpp | 2 |
3 files changed, 14 insertions, 21 deletions
diff --git a/src/devices/bus/ti99/gromport/gromport.cpp b/src/devices/bus/ti99/gromport/gromport.cpp index 7b2cc23d72a..085b1186c9b 100644 --- a/src/devices/bus/ti99/gromport/gromport.cpp +++ b/src/devices/bus/ti99/gromport/gromport.cpp @@ -131,7 +131,8 @@ gromport_device::gromport_device(const machine_config &mconfig, const char *tag, m_connector(nullptr), m_reset_on_insert(true), m_console_ready(*this), - m_console_reset(*this) + m_console_reset(*this), + m_mask(0x1fff) { } /* @@ -140,9 +141,10 @@ gromport_device::gromport_device(const machine_config &mconfig, const char *tag, */ READ8Z_MEMBER(gromport_device::readz) { + logerror("mask = %04x\n", m_mask); if (m_connector != nullptr) { - m_connector->readz(space, offset & get_mask(), value); + m_connector->readz(space, offset & m_mask, value); if (m_romgq) LOGMASKED(LOG_READ, "Read %04x -> %02x\n", offset | 0x6000, *value); } } @@ -156,7 +158,7 @@ WRITE8_MEMBER(gromport_device::write) if (m_connector != nullptr) { if (m_romgq) LOGMASKED(LOG_WRITE, "Write %04x <- %02x\n", offset | 0x6000, data); - m_connector->write(space, offset & get_mask(), data); + m_connector->write(space, offset & m_mask, data); } } diff --git a/src/devices/bus/ti99/gromport/gromport.h b/src/devices/bus/ti99/gromport/gromport.h index 60875befc0d..8d5c61ce78d 100644 --- a/src/devices/bus/ti99/gromport/gromport.h +++ b/src/devices/bus/ti99/gromport/gromport.h @@ -54,12 +54,14 @@ public: auto ready_cb() { return m_console_ready.bind(); } auto reset_cb() { return m_console_reset.bind(); } + // Configure for 16K ROM space (TI-99/8 only) + gromport_device& extend() { m_mask = 0x3fff; return *this; } + protected: - virtual void device_start() override; - virtual void device_reset() override; - virtual void device_config_complete() override; - virtual ioport_constructor device_input_ports() const override; - virtual const int get_mask() { return 0x1fff; } + void device_start() override; + void device_reset() override; + void device_config_complete() override; + ioport_constructor device_input_ports() const override; private: cartridge_connector_device* m_connector; @@ -67,17 +69,7 @@ private: devcb_write_line m_console_ready; devcb_write_line m_console_reset; int m_romgq; -}; - -// Special subclass for 99/8 -class gromport8_device : public gromport_device -{ -public: - template <typename U> - gromport8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, U &&opts, const char *dflt) - : gromport_device(mconfig, tag, owner, clock, opts, dflt) { }; -protected: - const int get_mask() override { return 0x3fff; } + int m_mask; }; class cartridge_connector_device : public device_t @@ -112,7 +104,6 @@ protected: } } } // end namespace bus::ti99::gromport DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT, bus::ti99::gromport, gromport_device) -DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT8, bus::ti99::gromport, gromport8_device) void ti99_gromport_options(device_slot_interface &device); void ti99_gromport_options_998(device_slot_interface &device); diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index dd5813ae53e..1a27469c2e2 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -768,7 +768,7 @@ void ti99_8_state::ti99_8(machine_config& config) m_mainboard->hold_cb().set(FUNC(ti99_8_state::cpu_hold)); // Cartridge port - TI99_GROMPORT8(config, m_gromport, 0, ti99_gromport_options_998, "single"); + TI99_GROMPORT(config, m_gromport, 0, ti99_gromport_options_998, "single").extend(); m_gromport->ready_cb().set(TI998_MAINBOARD_TAG, FUNC(mainboard8_device::system_grom_ready)); m_gromport->reset_cb().set(FUNC(ti99_8_state::console_reset)); |