summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/1943.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/1943.cpp')
-rw-r--r--src/mame/drivers/1943.cpp70
1 files changed, 36 insertions, 34 deletions
diff --git a/src/mame/drivers/1943.cpp b/src/mame/drivers/1943.cpp
index 9414b112bc1..8049ef0dcda 100644
--- a/src/mame/drivers/1943.cpp
+++ b/src/mame/drivers/1943.cpp
@@ -102,40 +102,42 @@ READ8_MEMBER(_1943_state::_1943b_c007_r)
/* Memory Maps */
-ADDRESS_MAP_START(_1943_state::c1943_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
- AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
- AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P1")
- AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
- AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSWA")
- AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSWB")
- AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
- AM_RANGE(0xc800, 0xc800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
- AM_RANGE(0xc804, 0xc804) AM_WRITE(c1943_c804_w) // ROM bank switch, screen flip
- AM_RANGE(0xc806, 0xc806) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xc807, 0xc807) AM_WRITE(c1943_protection_w)
- AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(c1943_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(c1943_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0xd800, 0xd801) AM_RAM AM_SHARE("scrollx")
- AM_RANGE(0xd802, 0xd802) AM_RAM AM_SHARE("scrolly")
- AM_RANGE(0xd803, 0xd804) AM_RAM AM_SHARE("bgscrollx")
- AM_RANGE(0xd806, 0xd806) AM_WRITE(c1943_d806_w) // sprites, bg1, bg2 enable
- AM_RANGE(0xd808, 0xd808) AM_WRITENOP // ???
- AM_RANGE(0xd868, 0xd868) AM_WRITENOP // ???
- AM_RANGE(0xd888, 0xd888) AM_WRITENOP // ???
- AM_RANGE(0xd8a8, 0xd8a8) AM_WRITENOP // ???
- AM_RANGE(0xe000, 0xefff) AM_RAM
- AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("spriteram")
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(_1943_state::sound_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0xc000, 0xc7ff) AM_RAM
- AM_RANGE(0xc800, 0xc800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ym1", ym2203_device, write)
- AM_RANGE(0xe002, 0xe003) AM_DEVWRITE("ym2", ym2203_device, write)
-ADDRESS_MAP_END
+void _1943_state::c1943_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0xbfff).bankr("bank1");
+ map(0xc000, 0xc000).portr("SYSTEM");
+ map(0xc001, 0xc001).portr("P1");
+ map(0xc002, 0xc002).portr("P2");
+ map(0xc003, 0xc003).portr("DSWA");
+ map(0xc004, 0xc004).portr("DSWB");
+ map(0xc007, 0xc007).r(this, FUNC(_1943_state::c1943_protection_r));
+ map(0xc800, 0xc800).w("soundlatch", FUNC(generic_latch_8_device::write));
+ map(0xc804, 0xc804).w(this, FUNC(_1943_state::c1943_c804_w)); // ROM bank switch, screen flip
+ map(0xc806, 0xc806).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0xc807, 0xc807).w(this, FUNC(_1943_state::c1943_protection_w));
+ map(0xd000, 0xd3ff).ram().w(this, FUNC(_1943_state::c1943_videoram_w)).share("videoram");
+ map(0xd400, 0xd7ff).ram().w(this, FUNC(_1943_state::c1943_colorram_w)).share("colorram");
+ map(0xd800, 0xd801).ram().share("scrollx");
+ map(0xd802, 0xd802).ram().share("scrolly");
+ map(0xd803, 0xd804).ram().share("bgscrollx");
+ map(0xd806, 0xd806).w(this, FUNC(_1943_state::c1943_d806_w)); // sprites, bg1, bg2 enable
+ map(0xd808, 0xd808).nopw(); // ???
+ map(0xd868, 0xd868).nopw(); // ???
+ map(0xd888, 0xd888).nopw(); // ???
+ map(0xd8a8, 0xd8a8).nopw(); // ???
+ map(0xe000, 0xefff).ram();
+ map(0xf000, 0xffff).ram().share("spriteram");
+}
+
+void _1943_state::sound_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0xc000, 0xc7ff).ram();
+ map(0xc800, 0xc800).r("soundlatch", FUNC(generic_latch_8_device::read));
+ map(0xe000, 0xe001).w("ym1", FUNC(ym2203_device::write));
+ map(0xe002, 0xe003).w("ym2", FUNC(ym2203_device::write));
+}
/* Input Ports */