summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mario.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/mario.cpp
parentf155992daab88ad024cec995428a67108218b51d (diff)
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/mario.cpp')
-rw-r--r--src/mame/drivers/mario.cpp71
1 files changed, 37 insertions, 34 deletions
diff --git a/src/mame/drivers/mario.cpp b/src/mame/drivers/mario.cpp
index 3712ce1d68d..829ea517a34 100644
--- a/src/mame/drivers/mario.cpp
+++ b/src/mame/drivers/mario.cpp
@@ -141,40 +141,43 @@ WRITE_LINE_MEMBER(mario_state::coin_counter_2_w)
*
*************************************/
-ADDRESS_MAP_START(mario_state::mario_map)
- AM_RANGE(0x0000, 0x5fff) AM_ROM
- AM_RANGE(0x6000, 0x6fff) AM_RAM
- AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */
- AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(mario_sh1_w) /* Mario run sample */
- AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(mario_sh2_w) /* Luigi run sample */
- AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
- AM_RANGE(0x7e00, 0x7e00) AM_WRITE(mario_sh_tuneselect_w)
- AM_RANGE(0x7e80, 0x7e87) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
- AM_RANGE(0x7f00, 0x7f07) AM_WRITE(mario_sh3_w) /* Sound port */
- AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */
- AM_RANGE(0xf000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(mario_state::masao_map)
- AM_RANGE(0x0000, 0x5fff) AM_ROM
- AM_RANGE(0x6000, 0x6fff) AM_RAM
- AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */
- AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0")
- AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1")
- AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
- AM_RANGE(0x7e00, 0x7e00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
- AM_RANGE(0x7e80, 0x7e87) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
- AM_RANGE(0x7f00, 0x7f00) AM_WRITE(masao_sh_irqtrigger_w)
- AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */
- AM_RANGE(0xf000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(mario_state::mario_io_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("z80dma", z80dma_device, read, write) /* dma controller */
-ADDRESS_MAP_END
+void mario_state::mario_map(address_map &map)
+{
+ map(0x0000, 0x5fff).rom();
+ map(0x6000, 0x6fff).ram();
+ map(0x7000, 0x73ff).ram().share("spriteram"); /* physical sprite ram */
+ map(0x7400, 0x77ff).ram().w(this, FUNC(mario_state::mario_videoram_w)).share("videoram");
+ map(0x7c00, 0x7c00).portr("IN0").w(this, FUNC(mario_state::mario_sh1_w)); /* Mario run sample */
+ map(0x7c80, 0x7c80).portr("IN1").w(this, FUNC(mario_state::mario_sh2_w)); /* Luigi run sample */
+ map(0x7d00, 0x7d00).w(this, FUNC(mario_state::mario_scroll_w));
+ map(0x7e00, 0x7e00).w(this, FUNC(mario_state::mario_sh_tuneselect_w));
+ map(0x7e80, 0x7e87).w("mainlatch", FUNC(ls259_device::write_d0));
+ map(0x7f00, 0x7f07).w(this, FUNC(mario_state::mario_sh3_w)); /* Sound port */
+ map(0x7f80, 0x7f80).portr("DSW"); /* DSW */
+ map(0xf000, 0xffff).rom();
+}
+
+void mario_state::masao_map(address_map &map)
+{
+ map(0x0000, 0x5fff).rom();
+ map(0x6000, 0x6fff).ram();
+ map(0x7000, 0x73ff).ram().share("spriteram"); /* physical sprite ram */
+ map(0x7400, 0x77ff).ram().w(this, FUNC(mario_state::mario_videoram_w)).share("videoram");
+ map(0x7c00, 0x7c00).portr("IN0");
+ map(0x7c80, 0x7c80).portr("IN1");
+ map(0x7d00, 0x7d00).w(this, FUNC(mario_state::mario_scroll_w));
+ map(0x7e00, 0x7e00).w(m_soundlatch, FUNC(generic_latch_8_device::write));
+ map(0x7e80, 0x7e87).w("mainlatch", FUNC(ls259_device::write_d0));
+ map(0x7f00, 0x7f00).w(this, FUNC(mario_state::masao_sh_irqtrigger_w));
+ map(0x7f80, 0x7f80).portr("DSW"); /* DSW */
+ map(0xf000, 0xffff).rom();
+}
+
+void mario_state::mario_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).rw(m_z80dma, FUNC(z80dma_device::read), FUNC(z80dma_device::write)); /* dma controller */
+}
/*************************************