diff options
Diffstat (limited to 'src/devices/bus/msx_cart/moonsound.cpp')
-rw-r--r-- | src/devices/bus/msx_cart/moonsound.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/devices/bus/msx_cart/moonsound.cpp b/src/devices/bus/msx_cart/moonsound.cpp index e01498c57bc..d8b1fda9a5e 100644 --- a/src/devices/bus/msx_cart/moonsound.cpp +++ b/src/devices/bus/msx_cart/moonsound.cpp @@ -67,10 +67,13 @@ const tiny_rom_entry *msx_cart_moonsound_device::device_rom_region() const void msx_cart_moonsound_device::device_start() { + m_out_irq_cb.resolve_safe(); + // Install IO read/write handlers - io_space().install_readwrite_handler(0x7e, 0x7f, read8sm_delegate(FUNC(msx_cart_moonsound_device::read_ymf278b_pcm), this), write8sm_delegate(FUNC(msx_cart_moonsound_device::write_ymf278b_pcm), this)); - io_space().install_readwrite_handler(0xc4, 0xc7, read8sm_delegate(FUNC(msx_cart_moonsound_device::read_ymf278b_fm), this), write8sm_delegate(FUNC(msx_cart_moonsound_device::write_ymf278b_fm), this)); - io_space().install_read_handler(0xc0, 0xc0, read8smo_delegate(FUNC(msx_cart_moonsound_device::read_c0), this)); + address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO); + space.install_readwrite_handler(0x7e, 0x7f, read8_delegate(FUNC(msx_cart_moonsound_device::read_ymf278b_pcm), this), write8_delegate(FUNC(msx_cart_moonsound_device::write_ymf278b_pcm), this)); + space.install_readwrite_handler(0xc4, 0xc7, read8_delegate(FUNC(msx_cart_moonsound_device::read_ymf278b_fm), this), write8_delegate(FUNC(msx_cart_moonsound_device::write_ymf278b_fm), this)); + space.install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(msx_cart_moonsound_device::read_c0), this)); } @@ -82,40 +85,40 @@ void msx_cart_moonsound_device::device_reset() WRITE_LINE_MEMBER(msx_cart_moonsound_device::irq_w) { LOG("moonsound: irq state %d\n", state); - irq_out(state); + m_out_irq_cb(state); } -void msx_cart_moonsound_device::write_ymf278b_fm(offs_t offset, uint8_t data) +WRITE8_MEMBER(msx_cart_moonsound_device::write_ymf278b_fm) { LOG("moonsound: write 0x%02x, data 0x%02x\n", 0xc4 + offset, data); - m_ymf278b->write(offset, data); + m_ymf278b->write(space, offset, data); } -uint8_t msx_cart_moonsound_device::read_ymf278b_fm(offs_t offset) +READ8_MEMBER(msx_cart_moonsound_device::read_ymf278b_fm) { LOG("moonsound: read 0x%02x\n", 0xc4 + offset); - return m_ymf278b->read(offset); + return m_ymf278b->read(space, offset); } -void msx_cart_moonsound_device::write_ymf278b_pcm(offs_t offset, uint8_t data) +WRITE8_MEMBER(msx_cart_moonsound_device::write_ymf278b_pcm) { LOG("moonsound: write 0x%02x, data 0x%02x\n", 0x7e + offset, data); - m_ymf278b->write(4 + offset, data); + m_ymf278b->write(space, 4 + offset, data); } -uint8_t msx_cart_moonsound_device::read_ymf278b_pcm(offs_t offset) +READ8_MEMBER(msx_cart_moonsound_device::read_ymf278b_pcm) { LOG("moonsound: read 0x%02x\n", 0x7e + offset); - return m_ymf278b->read(4 + offset); + return m_ymf278b->read(space, 4 + offset); } // For detecting presence of moonsound cartridge -uint8_t msx_cart_moonsound_device::read_c0() +READ8_MEMBER(msx_cart_moonsound_device::read_c0) { LOG("moonsound: read 0xc0\n"); return 0x00; |