diff options
Diffstat (limited to 'src/devices/bus/cbus')
-rw-r--r-- | src/devices/bus/cbus/pc9801_118.cpp | 12 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_118.h | 8 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_26.cpp | 6 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_26.h | 4 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_86.cpp | 28 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_86.h | 16 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_amd98.cpp | 8 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_amd98.h | 4 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_cbus.cpp | 7 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_cbus.h | 2 |
10 files changed, 50 insertions, 45 deletions
diff --git a/src/devices/bus/cbus/pc9801_118.cpp b/src/devices/bus/cbus/pc9801_118.cpp index 2a2ec411a18..d298dbb5422 100644 --- a/src/devices/bus/cbus/pc9801_118.cpp +++ b/src/devices/bus/cbus/pc9801_118.cpp @@ -114,7 +114,7 @@ void pc9801_118_device::device_validity_check(validity_checker &valid) const void pc9801_118_device::device_start() { - m_bus->install_io(0xa460, 0xa463, read8_delegate(*this, FUNC(pc9801_118_device::id_r)), write8_delegate(*this, FUNC(pc9801_118_device::ext_w))); + m_bus->install_io(0xa460, 0xa463, read8sm_delegate(*this, FUNC(pc9801_118_device::id_r)), write8sm_delegate(*this, FUNC(pc9801_118_device::ext_w))); save_item(NAME(m_ext_reg)); } @@ -128,7 +128,7 @@ void pc9801_118_device::device_reset() { uint16_t port_base = (ioport("OPN3_DSW")->read() & 1) << 8; m_bus->io_space().unmap_readwrite(0x0088, 0x008b, 0x100); - m_bus->install_io(port_base + 0x0088, port_base + 0x008f, read8_delegate(*this, FUNC(pc9801_118_device::opn3_r)), write8_delegate(*this, FUNC(pc9801_118_device::opn3_w))); + m_bus->install_io(port_base + 0x0088, port_base + 0x008f, read8sm_delegate(*this, FUNC(pc9801_118_device::opn3_r)), write8sm_delegate(*this, FUNC(pc9801_118_device::opn3_w))); m_ext_reg = 1; // TODO: enabled or disabled? } @@ -138,7 +138,7 @@ void pc9801_118_device::device_reset() //************************************************************************** -READ8_MEMBER(pc9801_118_device::opn3_r) +uint8_t pc9801_118_device::opn3_r(offs_t offset) { if(((offset & 5) == 0) || m_ext_reg) return m_opn3->read(offset >> 1); @@ -150,7 +150,7 @@ READ8_MEMBER(pc9801_118_device::opn3_r) } -WRITE8_MEMBER(pc9801_118_device::opn3_w) +void pc9801_118_device::opn3_w(offs_t offset, uint8_t data) { if(((offset & 5) == 0) || m_ext_reg) m_opn3->write(offset >> 1,data); @@ -158,7 +158,7 @@ WRITE8_MEMBER(pc9801_118_device::opn3_w) // printf("PC9801-118: Write to undefined port [%02x] %02x\n",offset+0x188,data); } -READ8_MEMBER( pc9801_118_device::id_r ) +uint8_t pc9801_118_device::id_r(offs_t offset) { if(offset == 0) { @@ -170,7 +170,7 @@ READ8_MEMBER( pc9801_118_device::id_r ) return 0xff; } -WRITE8_MEMBER( pc9801_118_device::ext_w ) +void pc9801_118_device::ext_w(offs_t offset, uint8_t data) { if(offset == 0) { diff --git a/src/devices/bus/cbus/pc9801_118.h b/src/devices/bus/cbus/pc9801_118.h index 491179a478c..0bfe957a960 100644 --- a/src/devices/bus/cbus/pc9801_118.h +++ b/src/devices/bus/cbus/pc9801_118.h @@ -28,10 +28,10 @@ public: // construction/destruction pc9801_118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_READ8_MEMBER(opn3_r); - DECLARE_WRITE8_MEMBER(opn3_w); - DECLARE_READ8_MEMBER(id_r); - DECLARE_WRITE8_MEMBER(ext_w); + uint8_t opn3_r(offs_t offset); + void opn3_w(offs_t offset, uint8_t data); + uint8_t id_r(offs_t offset); + void ext_w(offs_t offset, uint8_t data); protected: // device-level overrides diff --git a/src/devices/bus/cbus/pc9801_26.cpp b/src/devices/bus/cbus/pc9801_26.cpp index 3d70d603665..ad8ef212f27 100644 --- a/src/devices/bus/cbus/pc9801_26.cpp +++ b/src/devices/bus/cbus/pc9801_26.cpp @@ -133,7 +133,7 @@ void pc9801_26_device::device_reset() uint16_t port_base = (ioport("OPN_DSW")->read() & 1) << 8; m_bus->io_space().unmap_readwrite(0x0088, 0x008b, 0x100); - m_bus->install_io(port_base + 0x0088, port_base + 0x008b, read8_delegate(*this, FUNC(pc9801_26_device::opn_r)), write8_delegate(*this, FUNC(pc9801_26_device::opn_w))); + m_bus->install_io(port_base + 0x0088, port_base + 0x008b, read8sm_delegate(*this, FUNC(pc9801_26_device::opn_r)), write8sm_delegate(*this, FUNC(pc9801_26_device::opn_w))); } @@ -142,7 +142,7 @@ void pc9801_26_device::device_reset() //************************************************************************** // TODO: leftover mirrors? Doesn't match to what installs above -READ8_MEMBER(pc9801_26_device::opn_r) +uint8_t pc9801_26_device::opn_r(offs_t offset) { if((offset & 1) == 0) { @@ -156,7 +156,7 @@ READ8_MEMBER(pc9801_26_device::opn_r) } -WRITE8_MEMBER(pc9801_26_device::opn_w) +void pc9801_26_device::opn_w(offs_t offset, uint8_t data) { if((offset & 5) == 0) m_opn->write(offset >> 1, data); diff --git a/src/devices/bus/cbus/pc9801_26.h b/src/devices/bus/cbus/pc9801_26.h index abda3181512..b354d7b9a9e 100644 --- a/src/devices/bus/cbus/pc9801_26.h +++ b/src/devices/bus/cbus/pc9801_26.h @@ -27,8 +27,8 @@ public: // construction/destruction pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_READ8_MEMBER(opn_r); - DECLARE_WRITE8_MEMBER(opn_w); + uint8_t opn_r(offs_t offset); + void opn_w(offs_t offset, uint8_t data); protected: // device-level overrides diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp index ed7012900ee..60a1d89870b 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -169,10 +169,10 @@ void pc9801_86_device::device_validity_check(validity_checker &valid) const void pc9801_86_device::device_start() { m_bus->program_space().install_rom(0xcc000,0xcffff,memregion(this->subtag("sound_bios").c_str())->base()); - m_bus->install_io(0xa460, 0xa463, read8_delegate(*this, FUNC(pc9801_86_device::id_r)), write8_delegate(*this, FUNC(pc9801_86_device::mask_w))); - m_bus->install_io(0xa464, 0xa46f, read8_delegate(*this, FUNC(pc9801_86_device::pcm_r)), write8_delegate(*this, FUNC(pc9801_86_device::pcm_w))); - m_bus->install_io(0xa66c, 0xa66f, read8_delegate(*this, [this](address_space &s, offs_t o, u8 mm){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"), - write8_delegate(*this, [this](address_space &s, offs_t o, u8 d, u8 mm){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w")); + m_bus->install_io(0xa460, 0xa463, read8smo_delegate(*this, FUNC(pc9801_86_device::id_r)), write8smo_delegate(*this, FUNC(pc9801_86_device::mask_w))); + m_bus->install_io(0xa464, 0xa46f, read8sm_delegate(*this, FUNC(pc9801_86_device::pcm_r)), write8sm_delegate(*this, FUNC(pc9801_86_device::pcm_w))); + m_bus->install_io(0xa66c, 0xa66f, read8sm_delegate(*this, [this](offs_t o){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"), + write8sm_delegate(*this, [this](offs_t o, u8 d){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w")); m_dac_timer = timer_alloc(); save_item(NAME(m_count)); @@ -189,7 +189,7 @@ void pc9801_86_device::device_reset() { uint16_t port_base = (ioport("OPNA_DSW")->read() & 1) << 8; m_bus->io_space().unmap_readwrite(0x0088, 0x008f, 0x100); - m_bus->install_io(port_base + 0x0088, port_base + 0x008f, read8_delegate(*this, FUNC(pc9801_86_device::opna_r)), write8_delegate(*this, FUNC(pc9801_86_device::opna_w))); + m_bus->install_io(port_base + 0x0088, port_base + 0x008f, read8sm_delegate(*this, FUNC(pc9801_86_device::opna_r)), write8sm_delegate(*this, FUNC(pc9801_86_device::opna_w))); m_mask = 0; m_head = m_tail = m_count = 0; @@ -207,7 +207,7 @@ void pc9801_86_device::device_reset() //************************************************************************** -READ8_MEMBER(pc9801_86_device::opna_r) +uint8_t pc9801_86_device::opna_r(offs_t offset) { if((offset & 1) == 0) return m_opna->read(offset >> 1); @@ -218,7 +218,7 @@ READ8_MEMBER(pc9801_86_device::opna_r) } } -WRITE8_MEMBER(pc9801_86_device::opna_w) +void pc9801_86_device::opna_w(offs_t offset, uint8_t data) { if((offset & 1) == 0) m_opna->write(offset >> 1,data); @@ -226,17 +226,17 @@ WRITE8_MEMBER(pc9801_86_device::opna_w) logerror("PC9801-86: Write to undefined port [%02x] %02x\n",offset+0x188,data); } -READ8_MEMBER(pc9801_86_device::id_r) +uint8_t pc9801_86_device::id_r() { return 0x40 | m_mask; } -WRITE8_MEMBER(pc9801_86_device::mask_w) +void pc9801_86_device::mask_w(uint8_t data) { m_mask = data & 1; } -READ8_MEMBER(pc9801_86_device::pcm_r) +uint8_t pc9801_86_device::pcm_r(offs_t offset) { if((offset & 1) == 0) { @@ -258,7 +258,7 @@ READ8_MEMBER(pc9801_86_device::pcm_r) return 0xff; } -WRITE8_MEMBER(pc9801_86_device::pcm_w) +void pc9801_86_device::pcm_w(offs_t offset, uint8_t data) { const u32 rate = (25.4_MHz_XTAL).value() / 16; const int divs[8] = {36, 48, 72, 96, 144, 192, 288, 384}; @@ -421,7 +421,7 @@ void pc9801_speakboard_device::device_start() { pc9801_86_device::device_start(); - m_bus->install_io(0x0588, 0x058f, read8_delegate(*this, FUNC(pc9801_speakboard_device::opna_slave_r)), write8_delegate(*this, FUNC(pc9801_speakboard_device::opna_slave_w))); + m_bus->install_io(0x0588, 0x058f, read8sm_delegate(*this, FUNC(pc9801_speakboard_device::opna_slave_r)), write8sm_delegate(*this, FUNC(pc9801_speakboard_device::opna_slave_w))); } void pc9801_speakboard_device::device_reset() @@ -429,7 +429,7 @@ void pc9801_speakboard_device::device_reset() pc9801_86_device::device_reset(); } -READ8_MEMBER(pc9801_speakboard_device::opna_slave_r) +uint8_t pc9801_speakboard_device::opna_slave_r(offs_t offset) { if((offset & 1) == 0) return m_opna_slave->read(offset >> 1); @@ -440,7 +440,7 @@ READ8_MEMBER(pc9801_speakboard_device::opna_slave_r) } } -WRITE8_MEMBER(pc9801_speakboard_device::opna_slave_w) +void pc9801_speakboard_device::opna_slave_w(offs_t offset, uint8_t data) { if((offset & 1) == 0) m_opna_slave->write(offset >> 1,data); diff --git a/src/devices/bus/cbus/pc9801_86.h b/src/devices/bus/cbus/pc9801_86.h index de3b9190aab..ce782cc20d1 100644 --- a/src/devices/bus/cbus/pc9801_86.h +++ b/src/devices/bus/cbus/pc9801_86.h @@ -29,12 +29,12 @@ public: pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); pc9801_86_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - DECLARE_READ8_MEMBER(opna_r); - DECLARE_WRITE8_MEMBER(opna_w); - DECLARE_READ8_MEMBER(id_r); - DECLARE_WRITE8_MEMBER(mask_w); - DECLARE_READ8_MEMBER(pcm_r); - DECLARE_WRITE8_MEMBER(pcm_w); + uint8_t opna_r(offs_t offset); + void opna_w(offs_t offset, uint8_t data); + uint8_t id_r(); + void mask_w(uint8_t data); + uint8_t pcm_r(offs_t offset); + void pcm_w(offs_t offset, uint8_t data); DECLARE_WRITE_LINE_MEMBER(sound_irq); @@ -73,8 +73,8 @@ public: // construction/destruction pc9801_speakboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_READ8_MEMBER(opna_slave_r); - DECLARE_WRITE8_MEMBER(opna_slave_w); + uint8_t opna_slave_r(offs_t offset); + void opna_slave_w(offs_t offset, uint8_t data); protected: virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/devices/bus/cbus/pc9801_amd98.cpp b/src/devices/bus/cbus/pc9801_amd98.cpp index c89e88bc632..a6eeb015c4c 100644 --- a/src/devices/bus/cbus/pc9801_amd98.cpp +++ b/src/devices/bus/cbus/pc9801_amd98.cpp @@ -134,9 +134,9 @@ void pc9801_amd98_device::device_start() void pc9801_amd98_device::device_reset() { - m_bus->install_io(0x00d8, 0x00df, read8_delegate(*this, FUNC(pc9801_amd98_device::read)), write8_delegate(*this, FUNC(pc9801_amd98_device::write))); + m_bus->install_io(0x00d8, 0x00df, read8sm_delegate(*this, FUNC(pc9801_amd98_device::read)), write8sm_delegate(*this, FUNC(pc9801_amd98_device::write))); // Thexder access with following - m_bus->install_io(0x38d8, 0x38df, read8_delegate(*this, FUNC(pc9801_amd98_device::read)), write8_delegate(*this, FUNC(pc9801_amd98_device::write))); + m_bus->install_io(0x38d8, 0x38df, read8sm_delegate(*this, FUNC(pc9801_amd98_device::read)), write8sm_delegate(*this, FUNC(pc9801_amd98_device::write))); } @@ -144,7 +144,7 @@ void pc9801_amd98_device::device_reset() // READ/WRITE HANDLERS //************************************************************************** -READ8_MEMBER(pc9801_amd98_device::read) +uint8_t pc9801_amd98_device::read(offs_t offset) { switch(offset) { @@ -159,7 +159,7 @@ READ8_MEMBER(pc9801_amd98_device::read) return 0xff; } -WRITE8_MEMBER(pc9801_amd98_device::write) +void pc9801_amd98_device::write(offs_t offset, uint8_t data) { switch(offset) { diff --git a/src/devices/bus/cbus/pc9801_amd98.h b/src/devices/bus/cbus/pc9801_amd98.h index f116166fc9e..fa031edbe1b 100644 --- a/src/devices/bus/cbus/pc9801_amd98.h +++ b/src/devices/bus/cbus/pc9801_amd98.h @@ -29,8 +29,8 @@ public: static constexpr feature_type imperfect_features() { return feature::SOUND; } - DECLARE_READ8_MEMBER(read); - DECLARE_WRITE8_MEMBER(write); + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); protected: // device-level overrides diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index 6f8ccb5a6b3..0287404d011 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -95,7 +95,7 @@ void pc9801_slot_device::device_start() // m_card = dynamic_cast<device_pc9801_slot_card_interface *>(get_card_device()); } -void pc9801_slot_device::install_io(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler) +template<typename R, typename W> void pc9801_slot_device::install_io(offs_t start, offs_t end, R rhandler, W whandler) { int buswidth = m_iospace->data_width(); switch(buswidth) @@ -113,3 +113,8 @@ void pc9801_slot_device::install_io(offs_t start, offs_t end, read8_delegate rha fatalerror("PC-9801-26: Bus width %d not supported\n", buswidth); } } + +template void pc9801_slot_device::install_io<read8_delegate, write8_delegate >(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); +template void pc9801_slot_device::install_io<read8s_delegate, write8s_delegate >(offs_t start, offs_t end, read8s_delegate rhandler, write8s_delegate whandler); +template void pc9801_slot_device::install_io<read8sm_delegate, write8sm_delegate >(offs_t start, offs_t end, read8sm_delegate rhandler, write8sm_delegate whandler); +template void pc9801_slot_device::install_io<read8smo_delegate, write8smo_delegate>(offs_t start, offs_t end, read8smo_delegate rhandler, write8smo_delegate whandler); diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h index 22dd80154c3..728aca3e692 100644 --- a/src/devices/bus/cbus/pc9801_cbus.h +++ b/src/devices/bus/cbus/pc9801_cbus.h @@ -111,7 +111,7 @@ public: address_space &program_space() const { return *m_memspace; } address_space &io_space() const { return *m_iospace; } template<int I> void int_w(bool state) { m_int_callback[I](state); } - void install_io(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); + template<typename R, typename W> void install_io(offs_t start, offs_t end, R rhandler, W whandler); protected: // device-level overrides |