summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/docastle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/docastle.cpp')
-rw-r--r--src/mame/drivers/docastle.cpp153
1 files changed, 80 insertions, 73 deletions
diff --git a/src/mame/drivers/docastle.cpp b/src/mame/drivers/docastle.cpp
index 9be86dd759d..e7ecfb0e410 100644
--- a/src/mame/drivers/docastle.cpp
+++ b/src/mame/drivers/docastle.cpp
@@ -220,79 +220,86 @@ WRITE8_MEMBER(docastle_state::idsoccer_adpcm_w)
}
/* Memory Maps */
-ADDRESS_MAP_START(docastle_state::docastle_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x97ff) AM_RAM
- AM_RANGE(0x9800, 0x99ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w)
- AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0xe000, 0xe000) AM_WRITE(docastle_nmitrigger_w)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(docastle_state::docastle_map2)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared1_r, docastle_shared0_w)
- AM_RANGE(0xc000, 0xc007) AM_SELECT(0x0080) AM_READWRITE(inputs_flipscreen_r, flipscreen_w)
- AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("sn1", sn76489a_device, write)
- AM_RANGE(0xe400, 0xe400) AM_DEVWRITE("sn2", sn76489a_device, write)
- AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("sn3", sn76489a_device, write)
- AM_RANGE(0xec00, 0xec00) AM_DEVWRITE("sn4", sn76489a_device, write)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(docastle_state::docastle_map3)
- AM_RANGE(0x0000, 0x00ff) AM_ROM
- AM_RANGE(0x4000, 0x47ff) AM_RAM
- AM_RANGE(0x8000, 0x8008) AM_READ(docastle_shared1_r) // ???
- AM_RANGE(0xc003, 0xc003) AM_NOP // EP according to schematics
- AM_RANGE(0xc432, 0xc435) AM_NOP // ???
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(docastle_state::docastle_io_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVWRITE("crtc", mc6845_device, address_w)
- AM_RANGE(0x02, 0x02) AM_DEVWRITE("crtc", mc6845_device, register_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(docastle_state::dorunrun_map)
- AM_RANGE(0x0000, 0x1fff) AM_ROM
- AM_RANGE(0x2000, 0x37ff) AM_RAM
- AM_RANGE(0x3800, 0x39ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x4000, 0x9fff) AM_ROM
- AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w)
- AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xb000, 0xb3ff) AM_RAM_WRITE(docastle_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0xb400, 0xb7ff) AM_RAM_WRITE(docastle_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0xb800, 0xb800) AM_WRITE(docastle_nmitrigger_w)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(docastle_state::dorunrun_map2)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("sn1", sn76489a_device, write)
- AM_RANGE(0xa400, 0xa400) AM_DEVWRITE("sn2", sn76489a_device, write)
- AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("sn3", sn76489a_device, write)
- AM_RANGE(0xac00, 0xac00) AM_DEVWRITE("sn4", sn76489a_device, write)
- AM_RANGE(0xc000, 0xc007) AM_SELECT(0x0080) AM_READWRITE(inputs_flipscreen_r, flipscreen_w)
- AM_RANGE(0xe000, 0xe008) AM_READWRITE(docastle_shared1_r, docastle_shared0_w)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(docastle_state::idsoccer_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x4000, 0x57ff) AM_RAM
- AM_RANGE(0x5800, 0x59ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x6000, 0x9fff) AM_ROM
- AM_RANGE(0xa000, 0xa008) AM_READWRITE(docastle_shared0_r, docastle_shared1_w)
- AM_RANGE(0xa800, 0xa800) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0xb400, 0xb7ff) AM_MIRROR(0x0800) AM_RAM_WRITE(docastle_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0xc000, 0xc000) AM_READWRITE(idsoccer_adpcm_status_r, idsoccer_adpcm_w)
- AM_RANGE(0xe000, 0xe000) AM_WRITE(docastle_nmitrigger_w)
-ADDRESS_MAP_END
+void docastle_state::docastle_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0x97ff).ram();
+ map(0x9800, 0x99ff).ram().share("spriteram");
+ map(0xa000, 0xa008).rw(this, FUNC(docastle_state::docastle_shared0_r), FUNC(docastle_state::docastle_shared1_w));
+ map(0xa800, 0xa800).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0xb000, 0xb3ff).mirror(0x0800).ram().w(this, FUNC(docastle_state::docastle_videoram_w)).share("videoram");
+ map(0xb400, 0xb7ff).mirror(0x0800).ram().w(this, FUNC(docastle_state::docastle_colorram_w)).share("colorram");
+ map(0xe000, 0xe000).w(this, FUNC(docastle_state::docastle_nmitrigger_w));
+}
+
+void docastle_state::docastle_map2(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x8000, 0x87ff).ram();
+ map(0xa000, 0xa008).rw(this, FUNC(docastle_state::docastle_shared1_r), FUNC(docastle_state::docastle_shared0_w));
+ map(0xc000, 0xc007).select(0x0080).rw(this, FUNC(docastle_state::inputs_flipscreen_r), FUNC(docastle_state::flipscreen_w));
+ map(0xe000, 0xe000).w("sn1", FUNC(sn76489a_device::write));
+ map(0xe400, 0xe400).w("sn2", FUNC(sn76489a_device::write));
+ map(0xe800, 0xe800).w("sn3", FUNC(sn76489a_device::write));
+ map(0xec00, 0xec00).w("sn4", FUNC(sn76489a_device::write));
+}
+
+void docastle_state::docastle_map3(address_map &map)
+{
+ map(0x0000, 0x00ff).rom();
+ map(0x4000, 0x47ff).ram();
+ map(0x8000, 0x8008).r(this, FUNC(docastle_state::docastle_shared1_r)); // ???
+ map(0xc003, 0xc003).noprw(); // EP according to schematics
+ map(0xc432, 0xc435).noprw(); // ???
+}
+
+void docastle_state::docastle_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).w(m_crtc, FUNC(mc6845_device::address_w));
+ map(0x02, 0x02).w(m_crtc, FUNC(mc6845_device::register_w));
+}
+
+
+void docastle_state::dorunrun_map(address_map &map)
+{
+ map(0x0000, 0x1fff).rom();
+ map(0x2000, 0x37ff).ram();
+ map(0x3800, 0x39ff).ram().share("spriteram");
+ map(0x4000, 0x9fff).rom();
+ map(0xa000, 0xa008).rw(this, FUNC(docastle_state::docastle_shared0_r), FUNC(docastle_state::docastle_shared1_w));
+ map(0xa800, 0xa800).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0xb000, 0xb3ff).ram().w(this, FUNC(docastle_state::docastle_videoram_w)).share("videoram");
+ map(0xb400, 0xb7ff).ram().w(this, FUNC(docastle_state::docastle_colorram_w)).share("colorram");
+ map(0xb800, 0xb800).w(this, FUNC(docastle_state::docastle_nmitrigger_w));
+}
+
+void docastle_state::dorunrun_map2(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x8000, 0x87ff).ram();
+ map(0xa000, 0xa000).w("sn1", FUNC(sn76489a_device::write));
+ map(0xa400, 0xa400).w("sn2", FUNC(sn76489a_device::write));
+ map(0xa800, 0xa800).w("sn3", FUNC(sn76489a_device::write));
+ map(0xac00, 0xac00).w("sn4", FUNC(sn76489a_device::write));
+ map(0xc000, 0xc007).select(0x0080).rw(this, FUNC(docastle_state::inputs_flipscreen_r), FUNC(docastle_state::flipscreen_w));
+ map(0xe000, 0xe008).rw(this, FUNC(docastle_state::docastle_shared1_r), FUNC(docastle_state::docastle_shared0_w));
+}
+
+
+void docastle_state::idsoccer_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x4000, 0x57ff).ram();
+ map(0x5800, 0x59ff).ram().share("spriteram");
+ map(0x6000, 0x9fff).rom();
+ map(0xa000, 0xa008).rw(this, FUNC(docastle_state::docastle_shared0_r), FUNC(docastle_state::docastle_shared1_w));
+ map(0xa800, 0xa800).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0xb000, 0xb3ff).mirror(0x0800).ram().w(this, FUNC(docastle_state::docastle_videoram_w)).share("videoram");
+ map(0xb400, 0xb7ff).mirror(0x0800).ram().w(this, FUNC(docastle_state::docastle_colorram_w)).share("colorram");
+ map(0xc000, 0xc000).rw(this, FUNC(docastle_state::idsoccer_adpcm_status_r), FUNC(docastle_state::idsoccer_adpcm_w));
+ map(0xe000, 0xe000).w(this, FUNC(docastle_state::docastle_nmitrigger_w));
+}
/* Input Ports */