summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/astrocde.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/astrocde.cpp
parentf155992daab88ad024cec995428a67108218b51d (diff)
Address maps macros removal, pass 1 [O. Galibert]
Diffstat (limited to 'src/mame/drivers/astrocde.cpp')
-rw-r--r--src/mame/drivers/astrocde.cpp275
1 files changed, 146 insertions, 129 deletions
diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp
index a18cf450e4d..38739a06440 100644
--- a/src/mame/drivers/astrocde.cpp
+++ b/src/mame/drivers/astrocde.cpp
@@ -530,88 +530,98 @@ CUSTOM_INPUT_MEMBER( astrocde_state::votrax_speech_status_r )
*
*************************************/
-ADDRESS_MAP_START(astrocde_state::seawolf2_map)
- AM_RANGE(0x0000, 0x1fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0xc000, 0xc3ff) AM_RAM
-ADDRESS_MAP_END
+void astrocde_state::seawolf2_map(address_map &map)
+{
+ map(0x0000, 0x1fff).rom();
+ map(0x0000, 0x3fff).w(this, FUNC(astrocde_state::astrocade_funcgen_w));
+ map(0x4000, 0x7fff).ram().share("videoram");
+ map(0xc000, 0xc3ff).ram();
+}
-ADDRESS_MAP_START(astrocde_state::ebases_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_RAM AM_SHARE("videoram")
-ADDRESS_MAP_END
+void astrocde_state::ebases_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x0000, 0x3fff).w(this, FUNC(astrocde_state::astrocade_funcgen_w));
+ map(0x4000, 0x7fff).ram().share("videoram");
+}
-ADDRESS_MAP_START(astrocde_state::spacezap_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0xd000, 0xd03f) AM_READWRITE(protected_ram_r, protected_ram_w) AM_SHARE("protected_ram")
- AM_RANGE(0xd040, 0xd7ff) AM_RAM
-ADDRESS_MAP_END
+void astrocde_state::spacezap_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x0000, 0x3fff).w(this, FUNC(astrocde_state::astrocade_funcgen_w));
+ map(0x4000, 0x7fff).ram().share("videoram");
+ map(0xd000, 0xd03f).rw(this, FUNC(astrocde_state::protected_ram_r), FUNC(astrocde_state::protected_ram_w)).share("protected_ram");
+ map(0xd040, 0xd7ff).ram();
+}
-ADDRESS_MAP_START(astrocde_state::wow_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0x8000, 0xcfff) AM_ROM
- AM_RANGE(0xd000, 0xd03f) AM_READWRITE(protected_ram_r, protected_ram_w) AM_SHARE("protected_ram")
- AM_RANGE(0xd040, 0xdfff) AM_RAM
-ADDRESS_MAP_END
+void astrocde_state::wow_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x0000, 0x3fff).w(this, FUNC(astrocde_state::astrocade_funcgen_w));
+ map(0x4000, 0x7fff).ram().share("videoram");
+ map(0x8000, 0xcfff).rom();
+ map(0xd000, 0xd03f).rw(this, FUNC(astrocde_state::protected_ram_r), FUNC(astrocde_state::protected_ram_w)).share("protected_ram");
+ map(0xd040, 0xdfff).ram();
+}
-ADDRESS_MAP_START(astrocde_state::robby_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0x8000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(protected_ram_r, protected_ram_w) AM_SHARE("protected_ram")
- AM_RANGE(0xe800, 0xffff) AM_RAM
-ADDRESS_MAP_END
+void astrocde_state::robby_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x0000, 0x3fff).w(this, FUNC(astrocde_state::astrocade_funcgen_w));
+ map(0x4000, 0x7fff).ram().share("videoram");
+ map(0x8000, 0xdfff).rom();
+ map(0xe000, 0xe7ff).ram().share("nvram");
+ map(0xe000, 0xe1ff).rw(this, FUNC(astrocde_state::protected_ram_r), FUNC(astrocde_state::protected_ram_w)).share("protected_ram");
+ map(0xe800, 0xffff).ram();
+}
-ADDRESS_MAP_START(astrocde_state::demndrgn_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_DEVREAD("bank4000", address_map_bank_device, read8) AM_WRITE(profpac_videoram_w)
- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank8000")
- AM_RANGE(0xc000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0xe800, 0xffff) AM_RAM
-ADDRESS_MAP_END
+void astrocde_state::demndrgn_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x0000, 0x3fff).w(this, FUNC(astrocde_state::astrocade_funcgen_w));
+ map(0x4000, 0x7fff).r(m_bank4000, FUNC(address_map_bank_device::read8)).w(this, FUNC(astrocde_state::profpac_videoram_w));
+ map(0x8000, 0xbfff).bankr("bank8000");
+ map(0xc000, 0xdfff).rom();
+ map(0xe000, 0xe7ff).ram().share("nvram");
+ map(0xe800, 0xffff).ram();
+}
-ADDRESS_MAP_START(astrocde_state::profpac_map)
- AM_IMPORT_FROM(demndrgn_map)
- AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(protected_ram_r, protected_ram_w) AM_SHARE("protected_ram")
-ADDRESS_MAP_END
+void astrocde_state::profpac_map(address_map &map)
+{
+ demndrgn_map(map);
+ map(0xe000, 0xe1ff).rw(this, FUNC(astrocde_state::protected_ram_r), FUNC(astrocde_state::protected_ram_w)).share("protected_ram");
+}
-ADDRESS_MAP_START(astrocde_state::bank4000_map)
- AM_RANGE(0x0000, 0x3fff) AM_READ(profpac_videoram_r)
- AM_RANGE(0x4000, 0x7fff) AM_ROM AM_REGION("banks", 0x08000)
- AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("banks", 0x10000)
- AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("banks", 0x18000)
-ADDRESS_MAP_END
+void astrocde_state::bank4000_map(address_map &map)
+{
+ map(0x0000, 0x3fff).r(this, FUNC(astrocde_state::profpac_videoram_r));
+ map(0x4000, 0x7fff).rom().region("banks", 0x08000);
+ map(0x8000, 0xbfff).rom().region("banks", 0x10000);
+ map(0xc000, 0xffff).rom().region("banks", 0x18000);
+}
-ADDRESS_MAP_START(astrocde_state::profpac_bank4000_map)
- AM_IMPORT_FROM(bank4000_map)
- AM_RANGE(0x10000, 0xaffff) AM_ROM AM_REGION("epromboard", 0)
- AM_RANGE(0xb0000, 0xb3fff) AM_READNOP
-ADDRESS_MAP_END
+void astrocde_state::profpac_bank4000_map(address_map &map)
+{
+ bank4000_map(map);
+ map(0x10000, 0xaffff).rom().region("epromboard", 0);
+ map(0xb0000, 0xb3fff).nopr();
+}
-ADDRESS_MAP_START(astrocde_state::tenpin_sub_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0xc000, 0xc7ff) AM_RAM
-ADDRESS_MAP_END
+void astrocde_state::tenpin_sub_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x8000, 0x87ff).ram();
+ map(0xc000, 0xc7ff).ram();
+}
@@ -621,71 +631,78 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(astrocde_state::port_map)
- AM_RANGE(0x0000, 0x0019) AM_SELECT(0xff00) AM_READWRITE(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(astrocde_state::port_map_mono_pattern)
- AM_RANGE(0x0000, 0x0019) AM_SELECT(0xff00) AM_READWRITE(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
- AM_RANGE(0x0078, 0x007e) AM_MIRROR(0xff00) AM_WRITE(astrocade_pattern_board_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(astrocde_state::port_map_stereo_pattern)
- AM_RANGE(0x0000, 0x0019) AM_SELECT(0xff00) AM_READWRITE(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
- AM_RANGE(0x0050, 0x0058) AM_SELECT(0xff00) AM_DEVWRITE("astrocade2", astrocade_device, astrocade_sound_w)
- AM_RANGE(0x0078, 0x007e) AM_MIRROR(0xff00) AM_WRITE(astrocade_pattern_board_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(astrocde_state::port_map_16col_pattern)
- AM_RANGE(0x0000, 0x0019) AM_SELECT(0xff00) AM_READWRITE(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
- AM_RANGE(0x0050, 0x0058) AM_SELECT(0xff00) AM_DEVWRITE("astrocade2", astrocade_device, astrocade_sound_w)
- AM_RANGE(0x0078, 0x007e) AM_MIRROR(0xff00) AM_WRITE(astrocade_pattern_board_w)
- AM_RANGE(0x00bf, 0x00bf) AM_MIRROR(0xff00) AM_WRITE(profpac_page_select_w)
- AM_RANGE(0x00c3, 0x00c3) AM_MIRROR(0xff00) AM_READ(profpac_intercept_r)
- AM_RANGE(0x00c0, 0x00c5) AM_MIRROR(0xff00) AM_WRITE(profpac_screenram_ctrl_w)
- AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE(profpac_banksw_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(astrocde_state::port_map_16col_pattern_nosound)
- AM_RANGE(0x0000, 0x0019) AM_SELECT(0xff00) AM_READWRITE(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
- AM_RANGE(0x0078, 0x007e) AM_MIRROR(0xff00) AM_WRITE(astrocade_pattern_board_w)
- AM_RANGE(0x00bf, 0x00bf) AM_MIRROR(0xff00) AM_WRITE(profpac_page_select_w)
- AM_RANGE(0x00c3, 0x00c3) AM_MIRROR(0xff00) AM_READ(profpac_intercept_r)
- AM_RANGE(0x00c0, 0x00c5) AM_MIRROR(0xff00) AM_WRITE(profpac_screenram_ctrl_w)
- AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE(demndrgn_banksw_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(astrocde_state::port_map_16col_pattern_tenpindx)
- AM_IMPORT_FROM(port_map_16col_pattern_nosound)
- AM_RANGE(0x0060, 0x0060) AM_MIRROR(0xff00) AM_READ_PORT("P60")
- AM_RANGE(0x0061, 0x0061) AM_MIRROR(0xff00) AM_READ_PORT("P61")
- AM_RANGE(0x0062, 0x0062) AM_MIRROR(0xff00) AM_READ_PORT("P62")
- AM_RANGE(0x0063, 0x0063) AM_MIRROR(0xff00) AM_READ_PORT("P63")
- AM_RANGE(0x0064, 0x0064) AM_MIRROR(0xff00) AM_READ_PORT("P64")
- AM_RANGE(0x0065, 0x0066) AM_MIRROR(0xff00) AM_WRITE(tenpindx_lamp_w)
- AM_RANGE(0x0067, 0x0067) AM_MIRROR(0xff00) AM_WRITE(tenpindx_counter_w)
- AM_RANGE(0x0068, 0x0068) AM_MIRROR(0xff00) AM_WRITE(tenpindx_lights_w)
- AM_RANGE(0x0097, 0x0097) AM_MIRROR(0xff00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(astrocde_state::tenpin_sub_io_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
- AM_RANGE(0x97, 0x97) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x98, 0x98) AM_DEVWRITE("aysnd", ay8910_device, address_w)
- AM_RANGE(0x98, 0x98) AM_DEVREAD("aysnd", ay8910_device, data_r)
- AM_RANGE(0x9a, 0x9a) AM_DEVWRITE("aysnd", ay8910_device, data_w)
-ADDRESS_MAP_END
+void astrocde_state::port_map(address_map &map)
+{
+ map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w));
+}
+
+
+void astrocde_state::port_map_mono_pattern(address_map &map)
+{
+ map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w));
+ map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w));
+ map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w));
+}
+
+
+void astrocde_state::port_map_stereo_pattern(address_map &map)
+{
+ map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w));
+ map(0x0050, 0x0058).select(0xff00).w("astrocade2", FUNC(astrocade_device::astrocade_sound_w));
+ map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w));
+ map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w));
+}
+
+
+void astrocde_state::port_map_16col_pattern(address_map &map)
+{
+ map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w));
+ map(0x0050, 0x0058).select(0xff00).w("astrocade2", FUNC(astrocade_device::astrocade_sound_w));
+ map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w));
+ map(0x00bf, 0x00bf).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_page_select_w));
+ map(0x00c3, 0x00c3).mirror(0xff00).r(this, FUNC(astrocde_state::profpac_intercept_r));
+ map(0x00c0, 0x00c5).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_screenram_ctrl_w));
+ map(0x00f3, 0x00f3).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_banksw_w));
+ map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w));
+}
+
+
+void astrocde_state::port_map_16col_pattern_nosound(address_map &map)
+{
+ map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w));
+ map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w));
+ map(0x00bf, 0x00bf).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_page_select_w));
+ map(0x00c3, 0x00c3).mirror(0xff00).r(this, FUNC(astrocde_state::profpac_intercept_r));
+ map(0x00c0, 0x00c5).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_screenram_ctrl_w));
+ map(0x00f3, 0x00f3).mirror(0xff00).w(this, FUNC(astrocde_state::demndrgn_banksw_w));
+ map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w));
+}
+
+
+void astrocde_state::port_map_16col_pattern_tenpindx(address_map &map)
+{
+ port_map_16col_pattern_nosound(map);
+ map(0x0060, 0x0060).mirror(0xff00).portr("P60");
+ map(0x0061, 0x0061).mirror(0xff00).portr("P61");
+ map(0x0062, 0x0062).mirror(0xff00).portr("P62");
+ map(0x0063, 0x0063).mirror(0xff00).portr("P63");
+ map(0x0064, 0x0064).mirror(0xff00).portr("P64");
+ map(0x0065, 0x0066).mirror(0xff00).w(this, FUNC(astrocde_state::tenpindx_lamp_w));
+ map(0x0067, 0x0067).mirror(0xff00).w(this, FUNC(astrocde_state::tenpindx_counter_w));
+ map(0x0068, 0x0068).mirror(0xff00).w(this, FUNC(astrocde_state::tenpindx_lights_w));
+ map(0x0097, 0x0097).mirror(0xff00).w(m_soundlatch, FUNC(generic_latch_8_device::write));
+}
+
+
+void astrocde_state::tenpin_sub_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x90, 0x93).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write));
+ map(0x97, 0x97).r(m_soundlatch, FUNC(generic_latch_8_device::read));
+ map(0x98, 0x98).w("aysnd", FUNC(ay8910_device::address_w));
+ map(0x98, 0x98).r("aysnd", FUNC(ay8910_device::data_r));
+ map(0x9a, 0x9a).w("aysnd", FUNC(ay8910_device::data_w));
+}