summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/neogeocd.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2018-03-13 07:36:43 +0100
committer Olivier Galibert <galibert@pobox.com>2018-03-14 14:07:14 +0100
commit115bb9936c5cd3faf955d7eb1e251a94e4744b7b (patch)
treef0230f547f6c750f9974c61479eef28cbe4ad571 /src/mame/drivers/neogeocd.cpp
parentf155992daab88ad024cec995428a67108218b51d (diff)
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/neogeocd.cpp')
-rw-r--r--src/mame/drivers/neogeocd.cpp76
1 files changed, 40 insertions, 36 deletions
diff --git a/src/mame/drivers/neogeocd.cpp b/src/mame/drivers/neogeocd.cpp
index 59a0f0e4a2d..d27770be1ab 100644
--- a/src/mame/drivers/neogeocd.cpp
+++ b/src/mame/drivers/neogeocd.cpp
@@ -889,31 +889,33 @@ MACHINE_RESET_MEMBER(ngcd_state,neocd)
*
*************************************/
-ADDRESS_MAP_START(ngcd_state::neocd_main_map)
+void ngcd_state::neocd_main_map(address_map &map)
+{
// AM_RANGE(0x000000, 0x00007f) AM_READ_BANK("vectors") // writes will fall through to area below
- AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_REGION("maincpu", 0x00000)
- AM_RANGE(0x000000, 0x00007f) AM_READ(banked_vectors_r)
-
- AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01fffe) AM_DEVREAD8("ctrl1", neogeo_control_port_device, ctrl_r, 0xff00)
- AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("AUDIO") AM_WRITE8(audio_command_w, 0xff00)
- AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_DEVREAD8("ctrl2", neogeo_control_port_device, ctrl_r, 0xff00)
- AM_RANGE(0x360000, 0x37ffff) AM_READ(unmapped_r)
- AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ(aes_in2_r)
- AM_RANGE(0x380000, 0x38007f) AM_MIRROR(0x01ff80) AM_WRITE8(io_control_w, 0x00ff)
- AM_RANGE(0x3a0000, 0x3a001f) AM_MIRROR(0x01ffe0) AM_READ(unmapped_r)
- AM_RANGE(0x3a0000, 0x3a001f) AM_MIRROR(0x01ffe0) AM_DEVWRITE8("systemlatch", hc259_device, write_a3, 0x00ff)
- AM_RANGE(0x3c0000, 0x3c0007) AM_MIRROR(0x01fff8) AM_READ(video_register_r)
- AM_RANGE(0x3c0000, 0x3c000f) AM_MIRROR(0x01fff0) AM_WRITE(video_register_w)
- AM_RANGE(0x3e0000, 0x3fffff) AM_READ(unmapped_r)
- AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(paletteram_r, paletteram_w)
- AM_RANGE(0x800000, 0x803fff) AM_READWRITE(neocd_memcard_r, neocd_memcard_w)
- AM_RANGE(0xc00000, 0xc7ffff) AM_MIRROR(0x080000) AM_ROM AM_REGION("mainbios", 0)
- AM_RANGE(0xd00000, 0xdfffff) AM_READ(unmapped_r)
- AM_RANGE(0xe00000, 0xefffff) AM_READWRITE8(neocd_transfer_r,neocd_transfer_w, 0xffff)
- AM_RANGE(0xf00000, 0xfeffff) AM_READ(unmapped_r)
- AM_RANGE(0xff0000, 0xff01ff) AM_READWRITE(neocd_control_r, neocd_control_w) // CDROM / DMA
- AM_RANGE(0xff0200, 0xffffff) AM_READ(unmapped_r)
-ADDRESS_MAP_END
+ map(0x000000, 0x1fffff).ram().region("maincpu", 0x00000);
+ map(0x000000, 0x00007f).r(this, FUNC(ngcd_state::banked_vectors_r));
+
+ map(0x300000, 0x300000).mirror(0x01fffe).r(m_ctrl1, FUNC(neogeo_control_port_device::ctrl_r));
+ map(0x320000, 0x320001).mirror(0x01fffe).portr("AUDIO");
+ map(0x320000, 0x320000).mirror(0x01fffe).w(this, FUNC(ngcd_state::audio_command_w));
+ map(0x340000, 0x340000).mirror(0x01fffe).r(m_ctrl2, FUNC(neogeo_control_port_device::ctrl_r));
+ map(0x360000, 0x37ffff).r(this, FUNC(ngcd_state::unmapped_r));
+ map(0x380000, 0x380001).mirror(0x01fffe).r(this, FUNC(ngcd_state::aes_in2_r));
+ map(0x380000, 0x38007f).mirror(0x01ff80).w(this, FUNC(ngcd_state::io_control_w)).umask16(0x00ff);
+ map(0x3a0000, 0x3a001f).mirror(0x01ffe0).r(this, FUNC(ngcd_state::unmapped_r));
+ map(0x3a0000, 0x3a001f).mirror(0x01ffe0).w("systemlatch", FUNC(hc259_device::write_a3)).umask16(0x00ff);
+ map(0x3c0000, 0x3c0007).mirror(0x01fff8).r(this, FUNC(ngcd_state::video_register_r));
+ map(0x3c0000, 0x3c000f).mirror(0x01fff0).w(this, FUNC(ngcd_state::video_register_w));
+ map(0x3e0000, 0x3fffff).r(this, FUNC(ngcd_state::unmapped_r));
+ map(0x400000, 0x401fff).mirror(0x3fe000).rw(this, FUNC(ngcd_state::paletteram_r), FUNC(ngcd_state::paletteram_w));
+ map(0x800000, 0x803fff).rw(this, FUNC(ngcd_state::neocd_memcard_r), FUNC(ngcd_state::neocd_memcard_w));
+ map(0xc00000, 0xc7ffff).mirror(0x080000).rom().region("mainbios", 0);
+ map(0xd00000, 0xdfffff).r(this, FUNC(ngcd_state::unmapped_r));
+ map(0xe00000, 0xefffff).rw(this, FUNC(ngcd_state::neocd_transfer_r), FUNC(ngcd_state::neocd_transfer_w));
+ map(0xf00000, 0xfeffff).r(this, FUNC(ngcd_state::unmapped_r));
+ map(0xff0000, 0xff01ff).rw(this, FUNC(ngcd_state::neocd_control_r), FUNC(ngcd_state::neocd_control_w)); // CDROM / DMA
+ map(0xff0200, 0xffffff).r(this, FUNC(ngcd_state::unmapped_r));
+}
/*************************************
@@ -923,24 +925,26 @@ ADDRESS_MAP_END
*************************************/
-ADDRESS_MAP_START(ngcd_state::neocd_audio_map)
- AM_RANGE(0x0000, 0xffff) AM_RAM AM_REGION("audiocpu", 0x00000)
-ADDRESS_MAP_END
+void ngcd_state::neocd_audio_map(address_map &map)
+{
+ map(0x0000, 0xffff).ram().region("audiocpu", 0x00000);
+}
-ADDRESS_MAP_START(ngcd_state::neocd_audio_io_map)
- AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
- AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
- AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) AM_SELECT(0x0010) AM_WRITE(audio_cpu_enable_nmi_w)
+void ngcd_state::neocd_audio_io_map(address_map &map)
+{
+ map(0x00, 0x00).mirror(0xff00).r(this, FUNC(ngcd_state::audio_command_r)).w(m_soundlatch, FUNC(generic_latch_8_device::clear_w));
+ map(0x04, 0x07).mirror(0xff00).rw(m_ym, FUNC(ym2610_device::read), FUNC(ym2610_device::write));
+ map(0x08, 0x08).mirror(0xff00).select(0x0010).w(this, FUNC(ngcd_state::audio_cpu_enable_nmi_w));
// banking reads are actually NOP on NeoCD? but some games still access them
// AM_RANGE(0x08, 0x0b) AM_MIRROR(0x00f0) AM_SELECT(0xff00) AM_READ(audio_cpu_bank_select_r)
- AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
+ map(0x0c, 0x0c).mirror(0xff00).w(m_soundlatch2, FUNC(generic_latch_8_device::write));
// ??
- AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_WRITENOP
- AM_RANGE(0xc0, 0xc0) AM_MIRROR(0xff00) AM_WRITENOP
- AM_RANGE(0xc1, 0xc1) AM_MIRROR(0xff00) AM_WRITENOP
-ADDRESS_MAP_END
+ map(0x80, 0x80).mirror(0xff00).nopw();
+ map(0xc0, 0xc0).mirror(0xff00).nopw();
+ map(0xc1, 0xc1).mirror(0xff00).nopw();
+}
/*************************************