summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Michael Zapf <Michael.Zapf@mizapf.de>2018-08-21 00:04:38 +0200
committer Michael Zapf <Michael.Zapf@mizapf.de>2018-08-21 00:04:38 +0200
commit5a2dce71f7cc3109f50226a3803d0117ae5d9c8d (patch)
tree702ebb04653d5627e2a8121594bf34a501e77124 /src/devices
parentf554bd91201aa8e12ec0ef3031571040a1db6f0a (diff)
ti99: Use a config command instead of a subclass. (nw)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/ti99/gromport/gromport.cpp8
-rw-r--r--src/devices/bus/ti99/gromport/gromport.h25
2 files changed, 13 insertions, 20 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);