summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/cntsteer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/cntsteer.cpp')
-rw-r--r--src/mame/drivers/cntsteer.cpp121
1 files changed, 63 insertions, 58 deletions
diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp
index f7d4c1d7795..bd0f0a71fc7 100644
--- a/src/mame/drivers/cntsteer.cpp
+++ b/src/mame/drivers/cntsteer.cpp
@@ -579,54 +579,58 @@ READ8_MEMBER(cntsteer_state::cntsteer_adx_r)
/***************************************************************************/
-ADDRESS_MAP_START(cntsteer_state::gekitsui_cpu1_map)
- AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1000, 0x11ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x1200, 0x1fff) AM_RAM
- AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_SHARE("videoram")
- AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_SHARE("colorram")
- AM_RANGE(0x3000, 0x3003) AM_WRITE(zerotrgt_ctrl_w)
- AM_RANGE(0x8000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(cntsteer_state::gekitsui_cpu2_map)
- AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2")
- AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0")
- AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2")
- AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1")
- AM_RANGE(0x3003, 0x3003) AM_READ_PORT("COINS")
- AM_RANGE(0x3000, 0x3004) AM_WRITE(zerotrgt_vregs_w)
- AM_RANGE(0x3005, 0x3005) AM_WRITE(gekitsui_sub_irq_ack)
- AM_RANGE(0x3007, 0x3007) AM_WRITE(cntsteer_sound_w)
- AM_RANGE(0x4000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(cntsteer_state::cntsteer_cpu1_map)
- AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1000, 0x11ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_SHARE("videoram")
- AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_SHARE("colorram")
- AM_RANGE(0x3000, 0x3000) AM_WRITE(cntsteer_sub_nmi_w)
- AM_RANGE(0x3001, 0x3001) AM_WRITE(cntsteer_sub_irq_w)
- AM_RANGE(0x8000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(cntsteer_state::cntsteer_cpu2_map)
- AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2")
- AM_RANGE(0x2000, 0x2fff) AM_READWRITE(cntsteer_background_mirror_r,cntsteer_background_w)
- AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0")
- AM_RANGE(0x3001, 0x3001) AM_READ(cntsteer_adx_r)
- AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1")
- AM_RANGE(0x3003, 0x3003) AM_READ_PORT("COINS")
- AM_RANGE(0x3000, 0x3004) AM_WRITE(cntsteer_vregs_w)
- AM_RANGE(0x3005, 0x3005) AM_WRITE(gekitsui_sub_irq_ack)
- AM_RANGE(0x3006, 0x3006) AM_WRITE(cntsteer_main_irq_w)
- AM_RANGE(0x3007, 0x3007) AM_WRITE(cntsteer_sound_w)
- AM_RANGE(0x3007, 0x3007) AM_READNOP //m6809 bug.
- AM_RANGE(0x4000, 0xffff) AM_ROM
-ADDRESS_MAP_END
+void cntsteer_state::gekitsui_cpu1_map(address_map &map)
+{
+ map(0x0000, 0x0fff).ram().share("share1");
+ map(0x1000, 0x11ff).ram().share("spriteram");
+ map(0x1200, 0x1fff).ram();
+ map(0x2000, 0x23ff).ram().w(this, FUNC(cntsteer_state::cntsteer_foreground_vram_w)).share("videoram");
+ map(0x2400, 0x27ff).ram().w(this, FUNC(cntsteer_state::cntsteer_foreground_attr_w)).share("colorram");
+ map(0x3000, 0x3003).w(this, FUNC(cntsteer_state::zerotrgt_ctrl_w));
+ map(0x8000, 0xffff).rom();
+}
+
+void cntsteer_state::gekitsui_cpu2_map(address_map &map)
+{
+ map(0x0000, 0x0fff).ram().share("share1");
+ map(0x1000, 0x1fff).ram().w(this, FUNC(cntsteer_state::cntsteer_background_w)).share("videoram2");
+ map(0x3000, 0x3000).portr("DSW0");
+ map(0x3001, 0x3001).portr("P2");
+ map(0x3002, 0x3002).portr("P1");
+ map(0x3003, 0x3003).portr("COINS");
+ map(0x3000, 0x3004).w(this, FUNC(cntsteer_state::zerotrgt_vregs_w));
+ map(0x3005, 0x3005).w(this, FUNC(cntsteer_state::gekitsui_sub_irq_ack));
+ map(0x3007, 0x3007).w(this, FUNC(cntsteer_state::cntsteer_sound_w));
+ map(0x4000, 0xffff).rom();
+}
+
+void cntsteer_state::cntsteer_cpu1_map(address_map &map)
+{
+ map(0x0000, 0x0fff).ram().share("share1");
+ map(0x1000, 0x11ff).ram().share("spriteram");
+ map(0x2000, 0x23ff).ram().w(this, FUNC(cntsteer_state::cntsteer_foreground_vram_w)).share("videoram");
+ map(0x2400, 0x27ff).ram().w(this, FUNC(cntsteer_state::cntsteer_foreground_attr_w)).share("colorram");
+ map(0x3000, 0x3000).w(this, FUNC(cntsteer_state::cntsteer_sub_nmi_w));
+ map(0x3001, 0x3001).w(this, FUNC(cntsteer_state::cntsteer_sub_irq_w));
+ map(0x8000, 0xffff).rom();
+}
+
+void cntsteer_state::cntsteer_cpu2_map(address_map &map)
+{
+ map(0x0000, 0x0fff).ram().share("share1");
+ map(0x1000, 0x1fff).ram().w(this, FUNC(cntsteer_state::cntsteer_background_w)).share("videoram2");
+ map(0x2000, 0x2fff).rw(this, FUNC(cntsteer_state::cntsteer_background_mirror_r), FUNC(cntsteer_state::cntsteer_background_w));
+ map(0x3000, 0x3000).portr("DSW0");
+ map(0x3001, 0x3001).r(this, FUNC(cntsteer_state::cntsteer_adx_r));
+ map(0x3002, 0x3002).portr("P1");
+ map(0x3003, 0x3003).portr("COINS");
+ map(0x3000, 0x3004).w(this, FUNC(cntsteer_state::cntsteer_vregs_w));
+ map(0x3005, 0x3005).w(this, FUNC(cntsteer_state::gekitsui_sub_irq_ack));
+ map(0x3006, 0x3006).w(this, FUNC(cntsteer_state::cntsteer_main_irq_w));
+ map(0x3007, 0x3007).w(this, FUNC(cntsteer_state::cntsteer_sound_w));
+ map(0x3007, 0x3007).nopr(); //m6809 bug.
+ map(0x4000, 0xffff).rom();
+}
/***************************************************************************/
@@ -652,17 +656,18 @@ INTERRUPT_GEN_MEMBER(cntsteer_state::sound_interrupt)
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
-ADDRESS_MAP_START(cntsteer_state::sound_map)
- AM_RANGE(0x0000, 0x01ff) AM_RAM
+void cntsteer_state::sound_map(address_map &map)
+{
+ map(0x0000, 0x01ff).ram();
// AM_RANGE(0x1000, 0x1000) AM_WRITE(nmiack_w)
- AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_device, data_w)
- AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
- AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, data_w)
- AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w)
- AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0xd000, 0xd000) AM_WRITE(nmimask_w)
- AM_RANGE(0xe000, 0xffff) AM_ROM
-ADDRESS_MAP_END
+ map(0x2000, 0x2000).w("ay1", FUNC(ay8910_device::data_w));
+ map(0x4000, 0x4000).w("ay1", FUNC(ay8910_device::address_w));
+ map(0x6000, 0x6000).w("ay2", FUNC(ay8910_device::data_w));
+ map(0x8000, 0x8000).w("ay2", FUNC(ay8910_device::address_w));
+ map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
+ map(0xd000, 0xd000).w(this, FUNC(cntsteer_state::nmimask_w));
+ map(0xe000, 0xffff).rom();
+}
/***************************************************************************/