diff options
Diffstat (limited to 'src/mame/drivers/thunderx.cpp')
-rw-r--r-- | src/mame/drivers/thunderx.cpp | 121 |
1 files changed, 64 insertions, 57 deletions
diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp index 4b352ffea0c..741243b114c 100644 --- a/src/mame/drivers/thunderx.cpp +++ b/src/mame/drivers/thunderx.cpp @@ -402,63 +402,70 @@ WRITE8_MEMBER(thunderx_state::k052109_051960_w) /***************************************************************************/ -ADDRESS_MAP_START(thunderx_state::scontra_map) - AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w) /* video RAM + sprite RAM */ - - AM_RANGE(0x1f80, 0x1f80) AM_WRITE(scontra_bankswitch_w) /* bankswitch control + coin counters */ - AM_RANGE(0x1f84, 0x1f84) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) - AM_RANGE(0x1f88, 0x1f88) AM_WRITE(sh_irqtrigger_w) /* cause interrupt on audio CPU */ - AM_RANGE(0x1f8c, 0x1f8c) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) - AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM") - AM_RANGE(0x1f91, 0x1f91) AM_READ_PORT("P1") - AM_RANGE(0x1f92, 0x1f92) AM_READ_PORT("P2") - AM_RANGE(0x1f93, 0x1f93) AM_READ_PORT("DSW3") - AM_RANGE(0x1f94, 0x1f94) AM_READ_PORT("DSW1") - AM_RANGE(0x1f95, 0x1f95) AM_READ_PORT("DSW2") - AM_RANGE(0x1f98, 0x1f98) AM_READWRITE(_1f98_r, scontra_1f98_w) - - AM_RANGE(0x4000, 0x57ff) AM_RAM - AM_RANGE(0x5800, 0x5fff) AM_DEVICE("bank5800", address_map_bank_device, amap8) /* palette + work RAM + PMC */ - AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank") - AM_RANGE(0x8000, 0xffff) AM_ROM -ADDRESS_MAP_END - -ADDRESS_MAP_START(thunderx_state::thunderx_map) - AM_IMPORT_FROM(scontra_map) - AM_RANGE(0x1f80, 0x1f80) AM_WRITE(thunderx_videobank_w) - AM_RANGE(0x1f98, 0x1f98) AM_READWRITE(_1f98_r, thunderx_1f98_w) /* registers */ -ADDRESS_MAP_END - -ADDRESS_MAP_START(thunderx_state::gbusters_map) - AM_IMPORT_FROM(scontra_map) - AM_RANGE(0x1f80, 0x1f80) AM_WRITE(gbusters_videobank_w) -ADDRESS_MAP_END - - -ADDRESS_MAP_START(thunderx_state::scontra_bank5800_map) - AM_RANGE(0x0000, 0x07ff) AM_RAM_DEVWRITE("palette", palette_device, write8) AM_SHARE("palette") - AM_RANGE(0x0800, 0x0fff) AM_RAM -ADDRESS_MAP_END - -ADDRESS_MAP_START(thunderx_state::thunderx_bank5800_map) - AM_RANGE(0x0000, 0x07ff) AM_RAM_DEVWRITE("palette", palette_device, write8) AM_SHARE("palette") - AM_RANGE(0x0800, 0x0fff) AM_RAM - AM_RANGE(0x1000, 0x17ff) AM_READWRITE(pmc_r, pmc_w) AM_SHARE("pmcram") -ADDRESS_MAP_END - - -ADDRESS_MAP_START(thunderx_state::thunderx_sound_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) - AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) -ADDRESS_MAP_END - -ADDRESS_MAP_START(thunderx_state::scontra_sound_map) - AM_IMPORT_FROM(thunderx_sound_map) - AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) - AM_RANGE(0xf000, 0xf000) AM_WRITE(k007232_bankswitch_w) -ADDRESS_MAP_END +void thunderx_state::scontra_map(address_map &map) +{ + map(0x0000, 0x3fff).rw(this, FUNC(thunderx_state::k052109_051960_r), FUNC(thunderx_state::k052109_051960_w)); /* video RAM + sprite RAM */ + + map(0x1f80, 0x1f80).w(this, FUNC(thunderx_state::scontra_bankswitch_w)); /* bankswitch control + coin counters */ + map(0x1f84, 0x1f84).w("soundlatch", FUNC(generic_latch_8_device::write)); + map(0x1f88, 0x1f88).w(this, FUNC(thunderx_state::sh_irqtrigger_w)); /* cause interrupt on audio CPU */ + map(0x1f8c, 0x1f8c).w("watchdog", FUNC(watchdog_timer_device::reset_w)); + map(0x1f90, 0x1f90).portr("SYSTEM"); + map(0x1f91, 0x1f91).portr("P1"); + map(0x1f92, 0x1f92).portr("P2"); + map(0x1f93, 0x1f93).portr("DSW3"); + map(0x1f94, 0x1f94).portr("DSW1"); + map(0x1f95, 0x1f95).portr("DSW2"); + map(0x1f98, 0x1f98).rw(this, FUNC(thunderx_state::_1f98_r), FUNC(thunderx_state::scontra_1f98_w)); + + map(0x4000, 0x57ff).ram(); + map(0x5800, 0x5fff).m(m_bank5800, FUNC(address_map_bank_device::amap8)); /* palette + work RAM + PMC */ + map(0x6000, 0x7fff).bankr("rombank"); + map(0x8000, 0xffff).rom(); +} + +void thunderx_state::thunderx_map(address_map &map) +{ + scontra_map(map); + map(0x1f80, 0x1f80).w(this, FUNC(thunderx_state::thunderx_videobank_w)); + map(0x1f98, 0x1f98).rw(this, FUNC(thunderx_state::_1f98_r), FUNC(thunderx_state::thunderx_1f98_w)); /* registers */ +} + +void thunderx_state::gbusters_map(address_map &map) +{ + scontra_map(map); + map(0x1f80, 0x1f80).w(this, FUNC(thunderx_state::gbusters_videobank_w)); +} + + +void thunderx_state::scontra_bank5800_map(address_map &map) +{ + map(0x0000, 0x07ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + map(0x0800, 0x0fff).ram(); +} + +void thunderx_state::thunderx_bank5800_map(address_map &map) +{ + map(0x0000, 0x07ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); + map(0x0800, 0x0fff).ram(); + map(0x1000, 0x17ff).rw(this, FUNC(thunderx_state::pmc_r), FUNC(thunderx_state::pmc_w)).share("pmcram"); +} + + +void thunderx_state::thunderx_sound_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x87ff).ram(); + map(0xa000, 0xa000).r("soundlatch", FUNC(generic_latch_8_device::read)); + map(0xc000, 0xc001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); +} + +void thunderx_state::scontra_sound_map(address_map &map) +{ + thunderx_sound_map(map); + map(0xb000, 0xb00d).rw(m_k007232, FUNC(k007232_device::read), FUNC(k007232_device::write)); + map(0xf000, 0xf000).w(this, FUNC(thunderx_state::k007232_bankswitch_w)); +} /*************************************************************************** |