diff options
author | 2018-03-13 07:36:43 +0100 | |
---|---|---|
committer | 2018-03-14 14:07:14 +0100 | |
commit | 115bb9936c5cd3faf955d7eb1e251a94e4744b7b (patch) | |
tree | f0230f547f6c750f9974c61479eef28cbe4ad571 /src/mame/drivers/fromance.cpp | |
parent | f155992daab88ad024cec995428a67108218b51d (diff) |
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/fromance.cpp')
-rw-r--r-- | src/mame/drivers/fromance.cpp | 155 |
1 files changed, 81 insertions, 74 deletions
diff --git a/src/mame/drivers/fromance.cpp b/src/mame/drivers/fromance.cpp index 27132a50be6..1e0552d506a 100644 --- a/src/mame/drivers/fromance.cpp +++ b/src/mame/drivers/fromance.cpp @@ -225,28 +225,30 @@ WRITE8_MEMBER(fromance_state::fromance_coinctr_w) * *************************************/ -ADDRESS_MAP_START(fromance_state::nekkyoku_main_map) - AM_RANGE(0x0000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xdfff) AM_RAM - AM_RANGE(0xf000, 0xf000) AM_READ_PORT("SERVICE") AM_WRITE(fromance_portselect_w) - AM_RANGE(0xf001, 0xf001) AM_READ(fromance_keymatrix_r) AM_WRITENOP - AM_RANGE(0xf002, 0xf002) AM_READ_PORT("COIN") AM_WRITE(fromance_coinctr_w) - AM_RANGE(0xf003, 0xf003) AM_READ(fromance_busycheck_main_r) AM_DEVWRITE("sublatch", generic_latch_8_device, write) - AM_RANGE(0xf004, 0xf004) AM_READ_PORT("DSW2") - AM_RANGE(0xf005, 0xf005) AM_READ_PORT("DSW1") -ADDRESS_MAP_END - -ADDRESS_MAP_START(fromance_state::fromance_main_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0xc000, 0xdfff) AM_RAM - AM_RANGE(0x9e89, 0x9e89) AM_READNOP // unknown (idolmj) - AM_RANGE(0xe000, 0xe000) AM_READ_PORT("SERVICE") AM_WRITE(fromance_portselect_w) - AM_RANGE(0xe001, 0xe001) AM_READ(fromance_keymatrix_r) - AM_RANGE(0xe002, 0xe002) AM_READ_PORT("COIN") AM_WRITE(fromance_coinctr_w) - AM_RANGE(0xe003, 0xe003) AM_READ(fromance_busycheck_main_r) AM_DEVWRITE("sublatch", generic_latch_8_device, write) - AM_RANGE(0xe004, 0xe004) AM_READ_PORT("DSW2") - AM_RANGE(0xe005, 0xe005) AM_READ_PORT("DSW1") -ADDRESS_MAP_END +void fromance_state::nekkyoku_main_map(address_map &map) +{ + map(0x0000, 0xbfff).rom(); + map(0xc000, 0xdfff).ram(); + map(0xf000, 0xf000).portr("SERVICE").w(this, FUNC(fromance_state::fromance_portselect_w)); + map(0xf001, 0xf001).r(this, FUNC(fromance_state::fromance_keymatrix_r)).nopw(); + map(0xf002, 0xf002).portr("COIN").w(this, FUNC(fromance_state::fromance_coinctr_w)); + map(0xf003, 0xf003).r(this, FUNC(fromance_state::fromance_busycheck_main_r)).w(m_sublatch, FUNC(generic_latch_8_device::write)); + map(0xf004, 0xf004).portr("DSW2"); + map(0xf005, 0xf005).portr("DSW1"); +} + +void fromance_state::fromance_main_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0xc000, 0xdfff).ram(); + map(0x9e89, 0x9e89).nopr(); // unknown (idolmj) + map(0xe000, 0xe000).portr("SERVICE").w(this, FUNC(fromance_state::fromance_portselect_w)); + map(0xe001, 0xe001).r(this, FUNC(fromance_state::fromance_keymatrix_r)); + map(0xe002, 0xe002).portr("COIN").w(this, FUNC(fromance_state::fromance_coinctr_w)); + map(0xe003, 0xe003).r(this, FUNC(fromance_state::fromance_busycheck_main_r)).w(m_sublatch, FUNC(generic_latch_8_device::write)); + map(0xe004, 0xe004).portr("DSW2"); + map(0xe005, 0xe005).portr("DSW1"); +} @@ -256,21 +258,23 @@ ADDRESS_MAP_END * *************************************/ -ADDRESS_MAP_START(fromance_state::nekkyoku_sub_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") - AM_RANGE(0xc000, 0xefff) AM_READWRITE(fromance_videoram_r, fromance_videoram_w) - AM_RANGE(0xf000, 0xf7ff) AM_RAM - AM_RANGE(0xf800, 0xffff) AM_READWRITE(fromance_paletteram_r, fromance_paletteram_w) -ADDRESS_MAP_END +void fromance_state::nekkyoku_sub_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xbfff).bankr("bank1"); + map(0xc000, 0xefff).rw(this, FUNC(fromance_state::fromance_videoram_r), FUNC(fromance_state::fromance_videoram_w)); + map(0xf000, 0xf7ff).ram(); + map(0xf800, 0xffff).rw(this, FUNC(fromance_state::fromance_paletteram_r), FUNC(fromance_state::fromance_paletteram_w)); +} -ADDRESS_MAP_START(fromance_state::fromance_sub_map) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") - AM_RANGE(0xc000, 0xc7ff) AM_RAM - AM_RANGE(0xc800, 0xcfff) AM_READWRITE(fromance_paletteram_r, fromance_paletteram_w) - AM_RANGE(0xd000, 0xffff) AM_READWRITE(fromance_videoram_r, fromance_videoram_w) -ADDRESS_MAP_END +void fromance_state::fromance_sub_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xbfff).bankr("bank1"); + map(0xc000, 0xc7ff).ram(); + map(0xc800, 0xcfff).rw(this, FUNC(fromance_state::fromance_paletteram_r), FUNC(fromance_state::fromance_paletteram_w)); + map(0xd000, 0xffff).rw(this, FUNC(fromance_state::fromance_videoram_r), FUNC(fromance_state::fromance_videoram_w)); +} @@ -280,44 +284,47 @@ ADDRESS_MAP_END * *************************************/ -ADDRESS_MAP_START(fromance_state::nekkyoku_sub_io_map) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x10, 0x11) AM_DEVWRITE("gga", vsystem_gga_device, write) - AM_RANGE(0x12, 0x12) AM_READNOP // unknown - AM_RANGE(0xe0, 0xe0) AM_WRITE(fromance_rombank_w) - AM_RANGE(0xe1, 0xe1) AM_READ(fromance_busycheck_sub_r) AM_WRITE(fromance_gfxreg_w) - AM_RANGE(0xe2, 0xe5) AM_WRITE(fromance_scroll_w) - AM_RANGE(0xe6, 0xe6) AM_DEVREADWRITE("sublatch", generic_latch_8_device, read, acknowledge_w) - AM_RANGE(0xe7, 0xe7) AM_WRITE(fromance_adpcm_reset_w) - AM_RANGE(0xe8, 0xe8) AM_WRITE(fromance_adpcm_w) - AM_RANGE(0xe9, 0xea) AM_DEVWRITE("aysnd", ay8910_device, data_address_w) -ADDRESS_MAP_END - -ADDRESS_MAP_START(fromance_state::idolmj_sub_io_map) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x10, 0x11) AM_DEVWRITE("gga", vsystem_gga_device, write) - AM_RANGE(0x12, 0x12) AM_READNOP // unknown - AM_RANGE(0x20, 0x20) AM_WRITE(fromance_rombank_w) - AM_RANGE(0x21, 0x21) AM_READ(fromance_busycheck_sub_r) AM_WRITE(fromance_gfxreg_w) - AM_RANGE(0x22, 0x25) AM_WRITE(fromance_scroll_w) - AM_RANGE(0x26, 0x26) AM_DEVREADWRITE("sublatch", generic_latch_8_device, read, acknowledge_w) - AM_RANGE(0x27, 0x27) AM_WRITE(fromance_adpcm_reset_w) - AM_RANGE(0x28, 0x28) AM_WRITE(fromance_adpcm_w) - AM_RANGE(0x29, 0x2a) AM_DEVWRITE("aysnd", ym2149_device, data_address_w) -ADDRESS_MAP_END - -ADDRESS_MAP_START(fromance_state::fromance_sub_io_map) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x10, 0x11) AM_DEVWRITE("gga", vsystem_gga_device, write) - AM_RANGE(0x12, 0x12) AM_READNOP // unknown - AM_RANGE(0x20, 0x20) AM_WRITE(fromance_rombank_w) - AM_RANGE(0x21, 0x21) AM_READ(fromance_busycheck_sub_r) AM_WRITE(fromance_gfxreg_w) - AM_RANGE(0x22, 0x25) AM_WRITE(fromance_scroll_w) - AM_RANGE(0x26, 0x26) AM_DEVREADWRITE("sublatch", generic_latch_8_device, read, acknowledge_w) - AM_RANGE(0x27, 0x27) AM_WRITE(fromance_adpcm_reset_w) - AM_RANGE(0x28, 0x28) AM_WRITE(fromance_adpcm_w) - AM_RANGE(0x2a, 0x2b) AM_DEVWRITE("ymsnd", ym2413_device, write) -ADDRESS_MAP_END +void fromance_state::nekkyoku_sub_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x10, 0x11).w(m_gga, FUNC(vsystem_gga_device::write)); + map(0x12, 0x12).nopr(); // unknown + map(0xe0, 0xe0).w(this, FUNC(fromance_state::fromance_rombank_w)); + map(0xe1, 0xe1).r(this, FUNC(fromance_state::fromance_busycheck_sub_r)).w(this, FUNC(fromance_state::fromance_gfxreg_w)); + map(0xe2, 0xe5).w(this, FUNC(fromance_state::fromance_scroll_w)); + map(0xe6, 0xe6).rw(m_sublatch, FUNC(generic_latch_8_device::read), FUNC(generic_latch_8_device::acknowledge_w)); + map(0xe7, 0xe7).w(this, FUNC(fromance_state::fromance_adpcm_reset_w)); + map(0xe8, 0xe8).w(this, FUNC(fromance_state::fromance_adpcm_w)); + map(0xe9, 0xea).w("aysnd", FUNC(ay8910_device::data_address_w)); +} + +void fromance_state::idolmj_sub_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x10, 0x11).w(m_gga, FUNC(vsystem_gga_device::write)); + map(0x12, 0x12).nopr(); // unknown + map(0x20, 0x20).w(this, FUNC(fromance_state::fromance_rombank_w)); + map(0x21, 0x21).r(this, FUNC(fromance_state::fromance_busycheck_sub_r)).w(this, FUNC(fromance_state::fromance_gfxreg_w)); + map(0x22, 0x25).w(this, FUNC(fromance_state::fromance_scroll_w)); + map(0x26, 0x26).rw(m_sublatch, FUNC(generic_latch_8_device::read), FUNC(generic_latch_8_device::acknowledge_w)); + map(0x27, 0x27).w(this, FUNC(fromance_state::fromance_adpcm_reset_w)); + map(0x28, 0x28).w(this, FUNC(fromance_state::fromance_adpcm_w)); + map(0x29, 0x2a).w("aysnd", FUNC(ym2149_device::data_address_w)); +} + +void fromance_state::fromance_sub_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x10, 0x11).w(m_gga, FUNC(vsystem_gga_device::write)); + map(0x12, 0x12).nopr(); // unknown + map(0x20, 0x20).w(this, FUNC(fromance_state::fromance_rombank_w)); + map(0x21, 0x21).r(this, FUNC(fromance_state::fromance_busycheck_sub_r)).w(this, FUNC(fromance_state::fromance_gfxreg_w)); + map(0x22, 0x25).w(this, FUNC(fromance_state::fromance_scroll_w)); + map(0x26, 0x26).rw(m_sublatch, FUNC(generic_latch_8_device::read), FUNC(generic_latch_8_device::acknowledge_w)); + map(0x27, 0x27).w(this, FUNC(fromance_state::fromance_adpcm_reset_w)); + map(0x28, 0x28).w(this, FUNC(fromance_state::fromance_adpcm_w)); + map(0x2a, 0x2b).w("ymsnd", FUNC(ym2413_device::write)); +} /************************************* |