summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/galaxia.cpp
diff options
context:
space:
mode:
authorGravatarGravatar Olivier Galibert <galibert@pobox.com>2018-03-13 07:36:43 +0100
committerGravatarGravatar Olivier Galibert <galibert@pobox.com>2018-03-14 14:07:14 +0100
commit115bb9936c5cd3faf955d7eb1e251a94e4744b7b (patch)
treef0230f547f6c750f9974c61479eef28cbe4ad571 /src/mame/drivers/galaxia.cpp
parentf155992daab88ad024cec995428a67108218b51d (diff)
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/galaxia.cpp')
-rw-r--r--src/mame/drivers/galaxia.cpp74
1 files changed, 39 insertions, 35 deletions
diff --git a/src/mame/drivers/galaxia.cpp b/src/mame/drivers/galaxia.cpp
index 05f09383f48..4cc2db75004 100644
--- a/src/mame/drivers/galaxia.cpp
+++ b/src/mame/drivers/galaxia.cpp
@@ -131,41 +131,45 @@ READ8_MEMBER(galaxia_state::galaxia_collision_clear)
return 0xff;
}
-ADDRESS_MAP_START(galaxia_state::galaxia_mem_map)
- AM_RANGE(0x0000, 0x13ff) AM_ROM
- AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("bullet_ram")
- AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, read_data, write_data)
- AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, read_data, write_data)
- AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_2", s2636_device, read_data, write_data)
- AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE(galaxia_video_w) AM_SHARE("video_ram")
- AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
- AM_RANGE(0x2000, 0x33ff) AM_ROM
- AM_RANGE(0x7214, 0x7214) AM_READ_PORT("IN0")
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(galaxia_state::astrowar_mem_map)
- AM_RANGE(0x0000, 0x13ff) AM_ROM
- AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM
- AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, read_data, write_data)
- AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE(galaxia_video_w) AM_SHARE("video_ram")
- AM_RANGE(0x1c00, 0x1cff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("bullet_ram")
- AM_RANGE(0x2000, 0x33ff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(galaxia_state::galaxia_io_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00, 0x00) AM_WRITE(galaxia_scroll_w) AM_READ_PORT("IN0")
- AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
- AM_RANGE(0x05, 0x05) AM_READNOP
- AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW0")
- AM_RANGE(0x07, 0x07) AM_READ_PORT("DSW1")
- AM_RANGE(0xac, 0xac) AM_READNOP
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(galaxia_state::galaxia_data_map)
- AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READWRITE(galaxia_collision_r, galaxia_ctrlport_w)
- AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE(galaxia_collision_clear, galaxia_dataport_w)
-ADDRESS_MAP_END
+void galaxia_state::galaxia_mem_map(address_map &map)
+{
+ map(0x0000, 0x13ff).rom();
+ map(0x1400, 0x14ff).mirror(0x6000).ram().share("bullet_ram");
+ map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636_0, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data));
+ map(0x1600, 0x16ff).mirror(0x6000).rw(m_s2636_1, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data));
+ map(0x1700, 0x17ff).mirror(0x6000).rw(m_s2636_2, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data));
+ map(0x1800, 0x1bff).mirror(0x6000).r(this, FUNC(galaxia_state::cvs_video_or_color_ram_r)).w(this, FUNC(galaxia_state::galaxia_video_w)).share("video_ram");
+ map(0x1c00, 0x1fff).mirror(0x6000).ram();
+ map(0x2000, 0x33ff).rom();
+ map(0x7214, 0x7214).portr("IN0");
+}
+
+void galaxia_state::astrowar_mem_map(address_map &map)
+{
+ map(0x0000, 0x13ff).rom();
+ map(0x1400, 0x14ff).mirror(0x6000).ram();
+ map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636_0, FUNC(s2636_device::read_data), FUNC(s2636_device::write_data));
+ map(0x1800, 0x1bff).mirror(0x6000).r(this, FUNC(galaxia_state::cvs_video_or_color_ram_r)).w(this, FUNC(galaxia_state::galaxia_video_w)).share("video_ram");
+ map(0x1c00, 0x1cff).mirror(0x6000).ram().share("bullet_ram");
+ map(0x2000, 0x33ff).rom();
+}
+
+void galaxia_state::galaxia_io_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00, 0x00).w(this, FUNC(galaxia_state::galaxia_scroll_w)).portr("IN0");
+ map(0x02, 0x02).portr("IN1");
+ map(0x05, 0x05).nopr();
+ map(0x06, 0x06).portr("DSW0");
+ map(0x07, 0x07).portr("DSW1");
+ map(0xac, 0xac).nopr();
+}
+
+void galaxia_state::galaxia_data_map(address_map &map)
+{
+ map(S2650_CTRL_PORT, S2650_CTRL_PORT).rw(this, FUNC(galaxia_state::galaxia_collision_r), FUNC(galaxia_state::galaxia_ctrlport_w));
+ map(S2650_DATA_PORT, S2650_DATA_PORT).rw(this, FUNC(galaxia_state::galaxia_collision_clear), FUNC(galaxia_state::galaxia_dataport_w));
+}
/***************************************************************************