summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/rollrace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/rollrace.cpp')
-rw-r--r--src/mame/drivers/rollrace.cpp62
1 files changed, 32 insertions, 30 deletions
diff --git a/src/mame/drivers/rollrace.cpp b/src/mame/drivers/rollrace.cpp
index d008efa9219..63796fa993b 100644
--- a/src/mame/drivers/rollrace.cpp
+++ b/src/mame/drivers/rollrace.cpp
@@ -64,36 +64,38 @@ WRITE_LINE_MEMBER(rollrace_state::coin_counter_2_w)
machine().bookkeeping().coin_counter_w(1, state);
}
-ADDRESS_MAP_START(rollrace_state::rollrace_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x9fff) AM_ROM /* only rollace2 */
- AM_RANGE(0xc000, 0xcfff) AM_RAM
- AM_RANGE(0xd806, 0xd806) AM_READNOP /* looks like a watchdog, bit4 checked*/
- AM_RANGE(0xd900, 0xd900) AM_READWRITE(fake_d800_r,fake_d800_w) /* protection ??*/
- AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(vram_w) AM_SHARE("videoram")
- AM_RANGE(0xe400, 0xe47f) AM_RAM_WRITE(cram_w) AM_SHARE("colorram")
- AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
- AM_RANGE(0xec00, 0xec0f) AM_NOP /* Analog sound effects ?? ec00 sound enable ?*/
- AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0xf400, 0xf400) AM_WRITE(backgroundcolor_w)
- AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1")
- AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2") AM_WRITE(bkgpen_w)
- AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM") AM_WRITE(backgroundpage_w)
- AM_RANGE(0xf803, 0xf803) AM_WRITE(flipy_w)
- AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DSW1")
- AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW2")
- AM_RANGE(0xfc00, 0xfc07) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(rollrace_state::rollrace_sound_map)
- AM_RANGE(0x0000, 0x0fff) AM_ROM
- AM_RANGE(0x2000, 0x2fff) AM_RAM
- AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(sound_nmi_mask_w)
- AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
- AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
- AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
-ADDRESS_MAP_END
+void rollrace_state::rollrace_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0x9fff).rom(); /* only rollace2 */
+ map(0xc000, 0xcfff).ram();
+ map(0xd806, 0xd806).nopr(); /* looks like a watchdog, bit4 checked*/
+ map(0xd900, 0xd900).rw(this, FUNC(rollrace_state::fake_d800_r), FUNC(rollrace_state::fake_d800_w)); /* protection ??*/
+ map(0xe000, 0xe3ff).ram().w(this, FUNC(rollrace_state::vram_w)).share("videoram");
+ map(0xe400, 0xe47f).ram().w(this, FUNC(rollrace_state::cram_w)).share("colorram");
+ map(0xe800, 0xe800).w("soundlatch", FUNC(generic_latch_8_device::write));
+ map(0xec00, 0xec0f).noprw(); /* Analog sound effects ?? ec00 sound enable ?*/
+ map(0xf000, 0xf0ff).ram().share("spriteram");
+ map(0xf400, 0xf400).w(this, FUNC(rollrace_state::backgroundcolor_w));
+ map(0xf800, 0xf800).portr("P1");
+ map(0xf801, 0xf801).portr("P2").w(this, FUNC(rollrace_state::bkgpen_w));
+ map(0xf802, 0xf802).portr("SYSTEM").w(this, FUNC(rollrace_state::backgroundpage_w));
+ map(0xf803, 0xf803).w(this, FUNC(rollrace_state::flipy_w));
+ map(0xf804, 0xf804).portr("DSW1");
+ map(0xf805, 0xf805).portr("DSW2");
+ map(0xfc00, 0xfc07).w("mainlatch", FUNC(ls259_device::write_d0));
+}
+
+
+void rollrace_state::rollrace_sound_map(address_map &map)
+{
+ map(0x0000, 0x0fff).rom();
+ map(0x2000, 0x2fff).ram();
+ map(0x3000, 0x3000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(this, FUNC(rollrace_state::sound_nmi_mask_w));
+ map(0x4000, 0x4001).w("ay1", FUNC(ay8910_device::address_data_w));
+ map(0x5000, 0x5001).w("ay2", FUNC(ay8910_device::address_data_w));
+ map(0x6000, 0x6001).w("ay3", FUNC(ay8910_device::address_data_w));
+}
static INPUT_PORTS_START( rollrace )