diff options
Diffstat (limited to 'src/mame/drivers/prehisle.cpp')
-rw-r--r-- | src/mame/drivers/prehisle.cpp | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/src/mame/drivers/prehisle.cpp b/src/mame/drivers/prehisle.cpp index 693cead7ccc..44bdf05a09a 100644 --- a/src/mame/drivers/prehisle.cpp +++ b/src/mame/drivers/prehisle.cpp @@ -30,17 +30,18 @@ WRITE16_MEMBER(prehisle_state::soundcmd_w) /*******************************************************************************/ -ADDRESS_MAP_START(prehisle_state::prehisle_map) - AM_RANGE(0x000000, 0x03ffff) AM_ROM - AM_RANGE(0x070000, 0x073fff) AM_RAM - AM_RANGE(0x090000, 0x0907ff) AM_RAM_WRITE(tx_vram_w) AM_SHARE("tx_vram") - AM_RANGE(0x0a0000, 0x0a07ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(fg_vram_w) AM_SHARE("fg_vram") - AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_DEVWRITE("palette", palette_device, write16) AM_SHARE("palette") - AM_RANGE(0x0e0000, 0x0e00ff) AM_READ(control_r) - AM_RANGE(0x0f0000, 0x0ff0ff) AM_WRITE(control_w) - AM_RANGE(0x0f0070, 0x0ff071) AM_WRITE(soundcmd_w) -ADDRESS_MAP_END +void prehisle_state::prehisle_map(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); + map(0x070000, 0x073fff).ram(); + map(0x090000, 0x0907ff).ram().w(this, FUNC(prehisle_state::tx_vram_w)).share("tx_vram"); + map(0x0a0000, 0x0a07ff).ram().share("spriteram"); + map(0x0b0000, 0x0b3fff).ram().w(this, FUNC(prehisle_state::fg_vram_w)).share("fg_vram"); + map(0x0d0000, 0x0d07ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x0e0000, 0x0e00ff).r(this, FUNC(prehisle_state::control_r)); + map(0x0f0000, 0x0ff0ff).w(this, FUNC(prehisle_state::control_w)); + map(0x0f0070, 0x0ff071).w(this, FUNC(prehisle_state::soundcmd_w)); +} /******************************************************************************/ @@ -56,20 +57,22 @@ WRITE8_MEMBER(prehisle_state::D7759_upd_reset_w) m_upd7759->reset_w(data & 0x80); } -ADDRESS_MAP_START(prehisle_state::prehisle_sound_map) - AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf7ff) AM_RAM - AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) - AM_RANGE(0xf800, 0xf800) AM_WRITENOP // ??? -ADDRESS_MAP_END - -ADDRESS_MAP_START(prehisle_state::prehisle_sound_io_map) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ymsnd", ym3812_device, status_port_r, control_port_w) - AM_RANGE(0x20, 0x20) AM_DEVWRITE("ymsnd", ym3812_device, write_port_w) - AM_RANGE(0x40, 0x40) AM_WRITE(D7759_write_port_0_w) - AM_RANGE(0x80, 0x80) AM_WRITE(D7759_upd_reset_w) -ADDRESS_MAP_END +void prehisle_state::prehisle_sound_map(address_map &map) +{ + map(0x0000, 0xefff).rom(); + map(0xf000, 0xf7ff).ram(); + map(0xf800, 0xf800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xf800, 0xf800).nopw(); // ??? +} + +void prehisle_state::prehisle_sound_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x00).rw("ymsnd", FUNC(ym3812_device::status_port_r), FUNC(ym3812_device::control_port_w)); + map(0x20, 0x20).w("ymsnd", FUNC(ym3812_device::write_port_w)); + map(0x40, 0x40).w(this, FUNC(prehisle_state::D7759_write_port_0_w)); + map(0x80, 0x80).w(this, FUNC(prehisle_state::D7759_upd_reset_w)); +} /******************************************************************************/ |