diff options
author | 2019-03-09 09:30:28 -0500 | |
---|---|---|
committer | 2019-03-09 09:30:28 -0500 | |
commit | dfa1c468564e18833a93979681201a89cd733f0a (patch) | |
tree | e3ddcb7b7eb5e9a41dec0b213170247958e72cdf | |
parent | 7ae027684361152b513a96c01ac190853d8fd050 (diff) |
svi318, bus/svi318: Simplify read/write handlers; minor driver cleanup (nw)
23 files changed, 114 insertions, 129 deletions
diff --git a/src/devices/bus/svi3x8/expander/expander.cpp b/src/devices/bus/svi3x8/expander/expander.cpp index 481789516ff..e9653827fcf 100644 --- a/src/devices/bus/svi3x8/expander/expander.cpp +++ b/src/devices/bus/svi3x8/expander/expander.cpp @@ -80,38 +80,38 @@ void svi_expander_device::device_reset() // host to module interface //------------------------------------------------- -READ8_MEMBER( svi_expander_device::mreq_r ) +uint8_t svi_expander_device::mreq_r(offs_t offset) { romdis_w(1); ramdis_w(1); if (m_module) - return m_module->mreq_r(space, offset); + return m_module->mreq_r(offset); return 0xff; } -WRITE8_MEMBER( svi_expander_device::mreq_w ) +void svi_expander_device::mreq_w(offs_t offset, uint8_t data) { romdis_w(1); ramdis_w(1); if (m_module) - m_module->mreq_w(space, offset, data); + m_module->mreq_w(offset, data); } -READ8_MEMBER( svi_expander_device::iorq_r ) +uint8_t svi_expander_device::iorq_r(offs_t offset) { if (m_module) - return m_module->iorq_r(space, offset); + return m_module->iorq_r(offset); return 0xff; } -WRITE8_MEMBER( svi_expander_device::iorq_w ) +void svi_expander_device::iorq_w(offs_t offset, uint8_t data) { if (m_module) - m_module->iorq_w(space, offset, data); + m_module->iorq_w(offset, data); } WRITE_LINE_MEMBER( svi_expander_device::bk21_w ) diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h index b832fece8dd..cc7e75f6332 100644 --- a/src/devices/bus/svi3x8/expander/expander.h +++ b/src/devices/bus/svi3x8/expander/expander.h @@ -81,14 +81,14 @@ public: DECLARE_WRITE_LINE_MEMBER( ctrl1_w ) { m_ctrl1_handler(state); } DECLARE_WRITE_LINE_MEMBER( ctrl2_w ) { m_ctrl2_handler(state); } - DECLARE_READ8_MEMBER( excs_r ) { return m_excsr_handler(space, offset); } - DECLARE_WRITE8_MEMBER( excs_w ) { m_excsw_handler(space, offset, data); } + uint8_t excs_r(offs_t offset) { return m_excsr_handler(offset); } + void excs_w(offs_t offset, uint8_t data) { m_excsw_handler(offset, data); } // called from host - DECLARE_READ8_MEMBER( mreq_r ); - DECLARE_WRITE8_MEMBER( mreq_w ); - DECLARE_READ8_MEMBER( iorq_r ); - DECLARE_WRITE8_MEMBER( iorq_w ); + uint8_t mreq_r(offs_t offset); + void mreq_w(offs_t offset, uint8_t data); + uint8_t iorq_r(offs_t offset); + void iorq_w(offs_t offset, uint8_t data); DECLARE_WRITE_LINE_MEMBER( bk21_w ); DECLARE_WRITE_LINE_MEMBER( bk22_w ); @@ -121,10 +121,10 @@ public: // construction/destruction virtual ~device_svi_expander_interface(); - virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; } - virtual DECLARE_WRITE8_MEMBER( mreq_w ) { } - virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; } - virtual DECLARE_WRITE8_MEMBER( iorq_w ) { } + virtual uint8_t mreq_r(offs_t offset) { return 0xff; } + virtual void mreq_w(offs_t offset, uint8_t data) { } + virtual uint8_t iorq_r(offs_t offset) { return 0xff; } + virtual void iorq_w(offs_t offset, uint8_t data) { } virtual void bk21_w(int state) { } virtual void bk22_w(int state) { } diff --git a/src/devices/bus/svi3x8/expander/sv601.cpp b/src/devices/bus/svi3x8/expander/sv601.cpp index cf112d800dc..aec81c79ae6 100644 --- a/src/devices/bus/svi3x8/expander/sv601.cpp +++ b/src/devices/bus/svi3x8/expander/sv601.cpp @@ -68,10 +68,10 @@ WRITE_LINE_MEMBER( sv601_device::int_w ) { m_expander->int_w(state); } WRITE_LINE_MEMBER( sv601_device::romdis_w ) { m_expander->romdis_w(state); } WRITE_LINE_MEMBER( sv601_device::ramdis_w ) { m_expander->ramdis_w(state); } -READ8_MEMBER( sv601_device::mreq_r ) { return m_slotbus->mreq_r(space, offset); } -WRITE8_MEMBER( sv601_device::mreq_w ) { m_slotbus->mreq_w(space, offset, data); } -READ8_MEMBER( sv601_device::iorq_r ) { return m_slotbus->iorq_r(space, offset); } -WRITE8_MEMBER( sv601_device::iorq_w ) { m_slotbus->iorq_w(space, offset, data); } +uint8_t sv601_device::mreq_r(offs_t offset) { return m_slotbus->mreq_r(offset); } +void sv601_device::mreq_w(offs_t offset, uint8_t data) { m_slotbus->mreq_w(offset, data); } +uint8_t sv601_device::iorq_r(offs_t offset) { return m_slotbus->iorq_r(offset); } +void sv601_device::iorq_w(offs_t offset, uint8_t data) { m_slotbus->iorq_w(offset, data); } void sv601_device::bk21_w(int state) { m_slotbus->bk21_w(state); } void sv601_device::bk22_w(int state) { m_slotbus->bk22_w(state); } diff --git a/src/devices/bus/svi3x8/expander/sv601.h b/src/devices/bus/svi3x8/expander/sv601.h index 7918bc82441..692191a7ea9 100644 --- a/src/devices/bus/svi3x8/expander/sv601.h +++ b/src/devices/bus/svi3x8/expander/sv601.h @@ -33,10 +33,10 @@ public: WRITE_LINE_MEMBER( ramdis_w ); // from host - virtual DECLARE_READ8_MEMBER( mreq_r ) override; - virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual void mreq_w(offs_t offset, uint8_t data) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; virtual void bk21_w(int state) override; virtual void bk22_w(int state) override; diff --git a/src/devices/bus/svi3x8/expander/sv602.cpp b/src/devices/bus/svi3x8/expander/sv602.cpp index d4d288437bf..25624a83e9a 100644 --- a/src/devices/bus/svi3x8/expander/sv602.cpp +++ b/src/devices/bus/svi3x8/expander/sv602.cpp @@ -62,10 +62,10 @@ WRITE_LINE_MEMBER( sv602_device::int_w ) { m_expander->int_w(state); } WRITE_LINE_MEMBER( sv602_device::romdis_w ) { m_expander->romdis_w(state); } WRITE_LINE_MEMBER( sv602_device::ramdis_w ) { m_expander->ramdis_w(state); } -READ8_MEMBER( sv602_device::mreq_r ) { return m_slotbus->mreq_r(space, offset); } -WRITE8_MEMBER( sv602_device::mreq_w ) { m_slotbus->mreq_w(space, offset, data); } -READ8_MEMBER( sv602_device::iorq_r ) { return m_slotbus->iorq_r(space, offset); } -WRITE8_MEMBER( sv602_device::iorq_w ) { m_slotbus->iorq_w(space, offset, data); } +uint8_t sv602_device::mreq_r(offs_t offset) { return m_slotbus->mreq_r(offset); } +void sv602_device::mreq_w(offs_t offset, uint8_t data) { m_slotbus->mreq_w(offset, data); } +uint8_t sv602_device::iorq_r(offs_t offset) { return m_slotbus->iorq_r(offset); } +void sv602_device::iorq_w(offs_t offset, uint8_t data) { m_slotbus->iorq_w(offset, data); } void sv602_device::bk21_w(int state) { m_slotbus->bk21_w(state); } void sv602_device::bk22_w(int state) { m_slotbus->bk22_w(state); } diff --git a/src/devices/bus/svi3x8/expander/sv602.h b/src/devices/bus/svi3x8/expander/sv602.h index bb59b93c7ee..607d1cf6c17 100644 --- a/src/devices/bus/svi3x8/expander/sv602.h +++ b/src/devices/bus/svi3x8/expander/sv602.h @@ -28,10 +28,10 @@ public: sv602_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // from host - virtual DECLARE_READ8_MEMBER( mreq_r ) override; - virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual void mreq_w(offs_t offset, uint8_t data) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; virtual void bk21_w(int state) override; virtual void bk22_w(int state) override; diff --git a/src/devices/bus/svi3x8/expander/sv603.cpp b/src/devices/bus/svi3x8/expander/sv603.cpp index 8e20f785089..e32fb2ac5d3 100644 --- a/src/devices/bus/svi3x8/expander/sv603.cpp +++ b/src/devices/bus/svi3x8/expander/sv603.cpp @@ -104,7 +104,7 @@ void sv603_device::device_reset() // IMPLEMENTATION //************************************************************************** -READ8_MEMBER( sv603_device::mreq_r ) +uint8_t sv603_device::mreq_r(offs_t offset) { m_expander->romdis_w(0); @@ -120,23 +120,23 @@ READ8_MEMBER( sv603_device::mreq_r ) return 0xff; } -WRITE8_MEMBER( sv603_device::mreq_w ) +void sv603_device::mreq_w(offs_t offset, uint8_t data) { m_expander->romdis_w(0); } -READ8_MEMBER( sv603_device::iorq_r ) +uint8_t sv603_device::iorq_r(offs_t offset) { if (offset >= 0xa0 && offset <= 0xbf) - return m_expander->excs_r(space, offset); + return m_expander->excs_r(offset); return 0xff; } -WRITE8_MEMBER( sv603_device::iorq_w ) +void sv603_device::iorq_w(offs_t offset, uint8_t data) { if (offset >= 0xa0 && offset <= 0xbf) - m_expander->excs_w(space, offset, data); + m_expander->excs_w(offset, data); if (offset >= 0xe0 && offset <= 0xff) m_snd->write(data); diff --git a/src/devices/bus/svi3x8/expander/sv603.h b/src/devices/bus/svi3x8/expander/sv603.h index 57d16521c17..c317873d74e 100644 --- a/src/devices/bus/svi3x8/expander/sv603.h +++ b/src/devices/bus/svi3x8/expander/sv603.h @@ -30,10 +30,10 @@ public: sv603_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // from host - virtual DECLARE_READ8_MEMBER( mreq_r ) override; - virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual void mreq_w(offs_t offset, uint8_t data) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cartridge); diff --git a/src/devices/bus/svi3x8/slot/slot.cpp b/src/devices/bus/svi3x8/slot/slot.cpp index ca7f578b17c..eb2137ce629 100644 --- a/src/devices/bus/svi3x8/slot/slot.cpp +++ b/src/devices/bus/svi3x8/slot/slot.cpp @@ -71,14 +71,14 @@ void svi_slot_bus_device::add_card(device_svi_slot_interface *card) // mreq_r - memory read from slot //------------------------------------------------- -READ8_MEMBER( svi_slot_bus_device::mreq_r ) +uint8_t svi_slot_bus_device::mreq_r(offs_t offset) { device_svi_slot_interface *entry = m_dev.first(); uint8_t data = 0xff; while (entry) { - data &= entry->mreq_r(space, offset); + data &= entry->mreq_r(offset); entry = entry->next(); } @@ -89,13 +89,13 @@ READ8_MEMBER( svi_slot_bus_device::mreq_r ) // mreq_w - memory write to slot //------------------------------------------------- -WRITE8_MEMBER( svi_slot_bus_device::mreq_w ) +void svi_slot_bus_device::mreq_w(offs_t offset, uint8_t data) { device_svi_slot_interface *entry = m_dev.first(); while (entry) { - entry->mreq_w(space, offset, data); + entry->mreq_w(offset, data); entry = entry->next(); } } @@ -104,14 +104,14 @@ WRITE8_MEMBER( svi_slot_bus_device::mreq_w ) // iorq_r - memory read from slot //------------------------------------------------- -READ8_MEMBER( svi_slot_bus_device::iorq_r ) +uint8_t svi_slot_bus_device::iorq_r(offs_t offset) { device_svi_slot_interface *entry = m_dev.first(); uint8_t data = 0xff; while (entry) { - data &= entry->iorq_r(space, offset); + data &= entry->iorq_r(offset); entry = entry->next(); } @@ -122,13 +122,13 @@ READ8_MEMBER( svi_slot_bus_device::iorq_r ) // iorq_w - memory write to slot //------------------------------------------------- -WRITE8_MEMBER( svi_slot_bus_device::iorq_w ) +void svi_slot_bus_device::iorq_w(offs_t offset, uint8_t data) { device_svi_slot_interface *entry = m_dev.first(); while (entry) { - entry->iorq_w(space, offset, data); + entry->iorq_w(offset, data); entry = entry->next(); } } diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h index f27c023edab..756f17658fd 100644 --- a/src/devices/bus/svi3x8/slot/slot.h +++ b/src/devices/bus/svi3x8/slot/slot.h @@ -75,10 +75,10 @@ public: DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); }; // from host - DECLARE_READ8_MEMBER( mreq_r ); - DECLARE_WRITE8_MEMBER( mreq_w ); - DECLARE_READ8_MEMBER( iorq_r ); - DECLARE_WRITE8_MEMBER( iorq_w ); + uint8_t mreq_r(offs_t offset); + void mreq_w(offs_t offset, uint8_t data); + uint8_t iorq_r(offs_t offset); + void iorq_w(offs_t offset, uint8_t data); DECLARE_WRITE_LINE_MEMBER( bk21_w ); DECLARE_WRITE_LINE_MEMBER( bk22_w ); @@ -143,10 +143,10 @@ public: device_svi_slot_interface *next() const { return m_next; } - virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; } - virtual DECLARE_WRITE8_MEMBER( mreq_w ) { } - virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; } - virtual DECLARE_WRITE8_MEMBER( iorq_w ) { } + virtual uint8_t mreq_r(offs_t offset) { return 0xff; } + virtual void mreq_w(offs_t offset, uint8_t data) { } + virtual uint8_t iorq_r(offs_t offset) { return 0xff; } + virtual void iorq_w(offs_t offset, uint8_t data) { } virtual DECLARE_WRITE_LINE_MEMBER( bk21_w ) { } virtual DECLARE_WRITE_LINE_MEMBER( bk22_w ) { } diff --git a/src/devices/bus/svi3x8/slot/sv801.cpp b/src/devices/bus/svi3x8/slot/sv801.cpp index 48881ffc9e1..9d73b62aec1 100644 --- a/src/devices/bus/svi3x8/slot/sv801.cpp +++ b/src/devices/bus/svi3x8/slot/sv801.cpp @@ -97,7 +97,7 @@ WRITE_LINE_MEMBER( sv801_device::drq_w ) m_drq = state; } -WRITE8_MEMBER( sv801_device::motor_w ) +void sv801_device::motor_w(uint8_t data) { m_floppy = nullptr; @@ -112,7 +112,7 @@ WRITE8_MEMBER( sv801_device::motor_w ) m_floppy1->get_device()->mon_w(!BIT(data, 3)); } -READ8_MEMBER( sv801_device::iorq_r ) +uint8_t sv801_device::iorq_r(offs_t offset) { switch (offset) { @@ -126,7 +126,7 @@ READ8_MEMBER( sv801_device::iorq_r ) return 0xff; } -WRITE8_MEMBER( sv801_device::iorq_w ) +void sv801_device::iorq_w(offs_t offset, uint8_t data) { switch (offset) { @@ -134,7 +134,7 @@ WRITE8_MEMBER( sv801_device::iorq_w ) case 0x31: m_fdc->track_w(data); break; case 0x32: m_fdc->sector_w(data); break; case 0x33: m_fdc->data_w(data); break; - case 0x34: motor_w(space, 0, data); break; + case 0x34: motor_w(data); break; case 0x38: m_fdc->dden_w(BIT(data, 0)); if (m_floppy) diff --git a/src/devices/bus/svi3x8/slot/sv801.h b/src/devices/bus/svi3x8/slot/sv801.h index 38dea1e55d0..29c2014b872 100644 --- a/src/devices/bus/svi3x8/slot/sv801.h +++ b/src/devices/bus/svi3x8/slot/sv801.h @@ -28,8 +28,8 @@ public: // construction/destruction sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; protected: virtual void device_add_mconfig(machine_config &config) override; @@ -37,7 +37,7 @@ protected: virtual void device_reset() override; private: - DECLARE_WRITE8_MEMBER( motor_w ); + void motor_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( intrq_w ); DECLARE_WRITE_LINE_MEMBER( drq_w ); diff --git a/src/devices/bus/svi3x8/slot/sv802.cpp b/src/devices/bus/svi3x8/slot/sv802.cpp index 38c23fe416c..909ed2fa712 100644 --- a/src/devices/bus/svi3x8/slot/sv802.cpp +++ b/src/devices/bus/svi3x8/slot/sv802.cpp @@ -62,7 +62,7 @@ void sv802_device::device_start() // IMPLEMENTATION //************************************************************************** -READ8_MEMBER( sv802_device::iorq_r ) +uint8_t sv802_device::iorq_r(offs_t offset) { if (offset == 0x12) return 0xfe | m_busy; @@ -70,7 +70,7 @@ READ8_MEMBER( sv802_device::iorq_r ) return 0xff; } -WRITE8_MEMBER( sv802_device::iorq_w ) +void sv802_device::iorq_w(offs_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/svi3x8/slot/sv802.h b/src/devices/bus/svi3x8/slot/sv802.h index 2a06329c966..aabea33bbaf 100644 --- a/src/devices/bus/svi3x8/slot/sv802.h +++ b/src/devices/bus/svi3x8/slot/sv802.h @@ -28,8 +28,8 @@ public: // construction/destruction sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; protected: virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/devices/bus/svi3x8/slot/sv803.cpp b/src/devices/bus/svi3x8/slot/sv803.cpp index db79801530c..6adc07fd193 100644 --- a/src/devices/bus/svi3x8/slot/sv803.cpp +++ b/src/devices/bus/svi3x8/slot/sv803.cpp @@ -56,7 +56,7 @@ void sv803_device::device_reset() // IMPLEMENTATION //************************************************************************** -READ8_MEMBER( sv803_device::mreq_r ) +uint8_t sv803_device::mreq_r(offs_t offset) { if (offset >= 0x8000 && offset <= 0xbfff) return m_ram[offset - 0x8000]; @@ -64,7 +64,7 @@ READ8_MEMBER( sv803_device::mreq_r ) return 0xff; } -WRITE8_MEMBER( sv803_device::mreq_w ) +void sv803_device::mreq_w(offs_t offset, uint8_t data) { if (offset >= 0x8000 && offset <= 0xbfff) m_ram[offset - 0x8000] = data; diff --git a/src/devices/bus/svi3x8/slot/sv803.h b/src/devices/bus/svi3x8/slot/sv803.h index 6fd1d2b635a..8cae18acf64 100644 --- a/src/devices/bus/svi3x8/slot/sv803.h +++ b/src/devices/bus/svi3x8/slot/sv803.h @@ -26,8 +26,8 @@ public: // construction/destruction sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual DECLARE_READ8_MEMBER( mreq_r ) override; - virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual void mreq_w(offs_t offset, uint8_t data) override; protected: virtual void device_start() override; diff --git a/src/devices/bus/svi3x8/slot/sv805.cpp b/src/devices/bus/svi3x8/slot/sv805.cpp index bc4dc77c19f..cdcaee6f167 100644 --- a/src/devices/bus/svi3x8/slot/sv805.cpp +++ b/src/devices/bus/svi3x8/slot/sv805.cpp @@ -65,7 +65,7 @@ void sv805_device::device_start() // IMPLEMENTATION //************************************************************************** -READ8_MEMBER( sv805_device::iorq_r ) +uint8_t sv805_device::iorq_r(offs_t offset) { switch (offset) { @@ -77,13 +77,13 @@ READ8_MEMBER( sv805_device::iorq_r ) case 0x2d: case 0x2e: case 0x2f: - return m_uart->ins8250_r(space, offset & 0x07); + return m_uart->ins8250_r(machine().dummy_space(), offset & 0x07); } return 0xff; } -WRITE8_MEMBER( sv805_device::iorq_w ) +void sv805_device::iorq_w(offs_t offset, uint8_t data) { switch (offset) { @@ -95,7 +95,7 @@ WRITE8_MEMBER( sv805_device::iorq_w ) case 0x2d: case 0x2e: case 0x2f: - m_uart->ins8250_w(space, offset & 0x07, data); + m_uart->ins8250_w(machine().dummy_space(), offset & 0x07, data); } } diff --git a/src/devices/bus/svi3x8/slot/sv805.h b/src/devices/bus/svi3x8/slot/sv805.h index 3a6f350a490..892dc23b432 100644 --- a/src/devices/bus/svi3x8/slot/sv805.h +++ b/src/devices/bus/svi3x8/slot/sv805.h @@ -28,8 +28,8 @@ public: // construction/destruction sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; protected: virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/devices/bus/svi3x8/slot/sv806.cpp b/src/devices/bus/svi3x8/slot/sv806.cpp index 58518bd3fa7..aed4fb80bda 100644 --- a/src/devices/bus/svi3x8/slot/sv806.cpp +++ b/src/devices/bus/svi3x8/slot/sv806.cpp @@ -114,7 +114,7 @@ MC6845_UPDATE_ROW( sv806_device::crtc_update_row ) } } -READ8_MEMBER( sv806_device::mreq_r ) +uint8_t sv806_device::mreq_r(offs_t offset) { if (offset >= 0xf000 && m_ram_enabled) { @@ -125,7 +125,7 @@ READ8_MEMBER( sv806_device::mreq_r ) return 0xff; } -WRITE8_MEMBER( sv806_device::mreq_w ) +void sv806_device::mreq_w(offs_t offset, uint8_t data) { if (offset >= 0xf000 && m_ram_enabled) { @@ -134,7 +134,7 @@ WRITE8_MEMBER( sv806_device::mreq_w ) } } -READ8_MEMBER( sv806_device::iorq_r ) +uint8_t sv806_device::iorq_r(offs_t offset) { if (offset == 0x51) return m_crtc->register_r(); @@ -142,7 +142,7 @@ READ8_MEMBER( sv806_device::iorq_r ) return 0xff; } -WRITE8_MEMBER( sv806_device::iorq_w ) +void sv806_device::iorq_w(offs_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/svi3x8/slot/sv806.h b/src/devices/bus/svi3x8/slot/sv806.h index 868117b8565..e6af5071c56 100644 --- a/src/devices/bus/svi3x8/slot/sv806.h +++ b/src/devices/bus/svi3x8/slot/sv806.h @@ -28,10 +28,10 @@ public: // construction/destruction sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual DECLARE_READ8_MEMBER( mreq_r ) override; - virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; - virtual DECLARE_READ8_MEMBER( iorq_r ) override; - virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual void mreq_w(offs_t offset, uint8_t data) override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; protected: virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/svi3x8/slot/sv807.cpp b/src/devices/bus/svi3x8/slot/sv807.cpp index 6ea6a77a6bc..281b7845c64 100644 --- a/src/devices/bus/svi3x8/slot/sv807.cpp +++ b/src/devices/bus/svi3x8/slot/sv807.cpp @@ -118,7 +118,7 @@ void sv807_device::device_reset() // test setup: S2 = enabled (22), S3 = enabled (31) -READ8_MEMBER( sv807_device::mreq_r ) +uint8_t sv807_device::mreq_r(offs_t offset) { if ((BK21_ACTIVE || BK31_ACTIVE) && offset < 0x8000) { @@ -135,7 +135,7 @@ READ8_MEMBER( sv807_device::mreq_r ) return 0xff; } -WRITE8_MEMBER( sv807_device::mreq_w ) +void sv807_device::mreq_w(offs_t offset, uint8_t data) { if ((BK21_ACTIVE || BK31_ACTIVE) && offset < 0x8000) { diff --git a/src/devices/bus/svi3x8/slot/sv807.h b/src/devices/bus/svi3x8/slot/sv807.h index e3f12201d37..8d12befff79 100644 --- a/src/devices/bus/svi3x8/slot/sv807.h +++ b/src/devices/bus/svi3x8/slot/sv807.h @@ -29,8 +29,8 @@ public: // optional information overrides virtual ioport_constructor device_input_ports() const override; - virtual DECLARE_READ8_MEMBER( mreq_r ) override; - virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual void mreq_w(offs_t offset, uint8_t data) override; virtual void bk21_w(int state) override; virtual void bk22_w(int state) override; diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp index bf345e1345b..3a7d60fb647 100644 --- a/src/mame/drivers/svi318.cpp +++ b/src/mame/drivers/svi318.cpp @@ -63,6 +63,7 @@ public: m_expander(*this, "exp"), m_keyboard(*this, "KEY.%u", 0), m_buttons(*this, "BUTTONS"), + m_led_caps_lock(*this, "led_caps_lock"), m_intvdp(0), m_intexp(0), m_romdis(1), m_ramdis(1), m_cart(1), m_bk21(1), @@ -78,14 +79,14 @@ public: void svi328p(machine_config &config); private: - DECLARE_READ8_MEMBER( ppi_port_a_r ); - DECLARE_READ8_MEMBER( ppi_port_b_r ); - DECLARE_WRITE8_MEMBER( ppi_port_c_w ); - DECLARE_WRITE8_MEMBER( bank_w ); + uint8_t ppi_port_a_r(); + uint8_t ppi_port_b_r(); + void ppi_port_c_w(uint8_t data); + void bank_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( intvdp_w ); - READ8_MEMBER( mreq_r ); - WRITE8_MEMBER( mreq_w ); + uint8_t mreq_r(offs_t offset); + void mreq_w(offs_t offset, uint8_t data); // from expander bus DECLARE_WRITE_LINE_MEMBER( intexp_w ); @@ -93,9 +94,6 @@ private: DECLARE_WRITE_LINE_MEMBER( ramdis_w ); DECLARE_WRITE_LINE_MEMBER( ctrl1_w ); - DECLARE_READ8_MEMBER( excs_r ); - DECLARE_WRITE8_MEMBER( excs_w ); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cartridge); void svi3x8_io(address_map &map); @@ -116,6 +114,7 @@ private: required_device<svi_expander_device> m_expander; required_ioport_array<16> m_keyboard; required_ioport m_buttons; + output_finder<> m_led_caps_lock; int m_intvdp; int m_intexp; @@ -340,6 +339,8 @@ WRITE_LINE_MEMBER( svi3x8_state::intvdp_w ) void svi3x8_state::machine_start() { + m_led_caps_lock.resolve(); + // register for save states save_item(NAME(m_intvdp)); save_item(NAME(m_intexp)); @@ -369,7 +370,7 @@ void svi3x8_state::machine_reset() ctrl1_w(1); } -READ8_MEMBER( svi3x8_state::mreq_r ) +uint8_t svi3x8_state::mreq_r(offs_t offset) { // ctrl1 inverts a15 if (m_ctrl1 == 0) @@ -378,7 +379,7 @@ READ8_MEMBER( svi3x8_state::mreq_r ) if (CCS1 || CCS2 || CCS3 || CCS4) return m_cart_rom->read_rom(offset); - uint8_t data = m_expander->mreq_r(space, offset); + uint8_t data = m_expander->mreq_r(offset); if (ROMCS) data = m_basic->as_u8(offset); @@ -392,7 +393,7 @@ READ8_MEMBER( svi3x8_state::mreq_r ) return data; } -WRITE8_MEMBER( svi3x8_state::mreq_w ) +void svi3x8_state::mreq_w(offs_t offset, uint8_t data) { // ctrl1 inverts a15 if (m_ctrl1 == 0) @@ -401,7 +402,7 @@ WRITE8_MEMBER( svi3x8_state::mreq_w ) if (CCS1 || CCS2 || CCS3 || CCS4) return; - m_expander->mreq_w(space, offset, data); + m_expander->mreq_w(offset, data); if (m_bk21 == 0 && IS_SVI328 && offset < 0x8000) m_ram->write(offset, data); @@ -410,7 +411,7 @@ WRITE8_MEMBER( svi3x8_state::mreq_w ) m_ram->write(IS_SVI328 ? offset : offset - 0xc000, data); } -WRITE8_MEMBER( svi3x8_state::bank_w ) +void svi3x8_state::bank_w(uint8_t data) { logerror("bank_w: %02x\n", data); @@ -425,10 +426,10 @@ WRITE8_MEMBER( svi3x8_state::bank_w ) m_rom2 = BIT(data, 6); m_rom3 = BIT(data, 7); - output().set_value("led_caps_lock", BIT(data, 5)); + m_led_caps_lock = BIT(data, 5); } -READ8_MEMBER( svi3x8_state::ppi_port_a_r ) +uint8_t svi3x8_state::ppi_port_a_r() { uint8_t data = 0x3f; @@ -444,13 +445,13 @@ READ8_MEMBER( svi3x8_state::ppi_port_a_r ) return data; } -READ8_MEMBER( svi3x8_state::ppi_port_b_r ) +uint8_t svi3x8_state::ppi_port_b_r() { // bit 0-7, keyboard data return m_keyboard[m_keyboard_row]->read(); } -WRITE8_MEMBER( svi3x8_state::ppi_port_c_w ) +void svi3x8_state::ppi_port_c_w(uint8_t data) { // bit 0-3, keyboard row m_keyboard_row = data & 0x0f; @@ -492,22 +493,6 @@ WRITE_LINE_MEMBER( svi3x8_state::ctrl1_w ) m_io->set_bank(m_ctrl1); } -READ8_MEMBER( svi3x8_state::excs_r ) -{ - if (offset & 1) - return m_vdp->register_read(); - else - return m_vdp->vram_read(); -} - -WRITE8_MEMBER( svi3x8_state::excs_w ) -{ - if (offset & 1) - m_vdp->register_write(data); - else - m_vdp->vram_write(data); -} - //************************************************************************** // CARTRIDGE @@ -571,8 +556,8 @@ MACHINE_CONFIG_START(svi3x8_state::svi318) m_expander->romdis_handler().set(FUNC(svi3x8_state::romdis_w)); m_expander->ramdis_handler().set(FUNC(svi3x8_state::ramdis_w)); m_expander->ctrl1_handler().set(FUNC(svi3x8_state::ctrl1_w)); - m_expander->excsr_handler().set(FUNC(svi3x8_state::excs_r)); - m_expander->excsw_handler().set(FUNC(svi3x8_state::excs_w)); + m_expander->excsr_handler().set(m_vdp, FUNC(tms9928a_device::read)); + m_expander->excsw_handler().set(m_vdp, FUNC(tms9928a_device::write)); MACHINE_CONFIG_END void svi3x8_state::svi318p(machine_config &config) |