summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/dynduke.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/dynduke.cpp')
-rw-r--r--src/mame/drivers/dynduke.cpp132
1 files changed, 69 insertions, 63 deletions
diff --git a/src/mame/drivers/dynduke.cpp b/src/mame/drivers/dynduke.cpp
index da9c00c2496..874070a189d 100644
--- a/src/mame/drivers/dynduke.cpp
+++ b/src/mame/drivers/dynduke.cpp
@@ -80,71 +80,77 @@ Also, implemented conditional port for Coin Mode (SW1:1)
/* Memory Maps */
-ADDRESS_MAP_START(dynduke_state::master_map)
- AM_RANGE(0x00000, 0x06fff) AM_RAM
- AM_RANGE(0x07000, 0x07fff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x08000, 0x080ff) AM_RAM AM_SHARE("scroll_ram")
- AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x0b000, 0x0b001) AM_READ_PORT("P1_P2")
- AM_RANGE(0x0b002, 0x0b003) AM_READ_PORT("DSW")
- AM_RANGE(0x0b004, 0x0b005) AM_WRITENOP
- AM_RANGE(0x0b006, 0x0b007) AM_WRITE(control_w)
- AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(text_w) AM_SHARE("videoram")
- AM_RANGE(0x0d000, 0x0d00d) AM_DEVREADWRITE8("seibu_sound", seibu_sound_device, main_r, main_w, 0x00ff)
- AM_RANGE(0xa0000, 0xfffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(dynduke_state::slave_map)
- AM_RANGE(0x00000, 0x05fff) AM_RAM
- AM_RANGE(0x06000, 0x067ff) AM_RAM_WRITE(background_w) AM_SHARE("back_data")
- AM_RANGE(0x06800, 0x06fff) AM_RAM_WRITE(foreground_w) AM_SHARE("fore_data")
- AM_RANGE(0x07000, 0x07fff) AM_RAM_DEVWRITE("palette", palette_device, write16) AM_SHARE("palette")
- AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x0a000, 0x0a001) AM_WRITE(gfxbank_w)
- AM_RANGE(0x0c000, 0x0c001) AM_WRITENOP
- AM_RANGE(0xc0000, 0xfffff) AM_ROM
-ADDRESS_MAP_END
+void dynduke_state::master_map(address_map &map)
+{
+ map(0x00000, 0x06fff).ram();
+ map(0x07000, 0x07fff).ram().share("spriteram");
+ map(0x08000, 0x080ff).ram().share("scroll_ram");
+ map(0x0a000, 0x0afff).ram().share("share1");
+ map(0x0b000, 0x0b001).portr("P1_P2");
+ map(0x0b002, 0x0b003).portr("DSW");
+ map(0x0b004, 0x0b005).nopw();
+ map(0x0b006, 0x0b007).w(this, FUNC(dynduke_state::control_w));
+ map(0x0c000, 0x0c7ff).ram().w(this, FUNC(dynduke_state::text_w)).share("videoram");
+ map(0x0d000, 0x0d00d).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
+ map(0xa0000, 0xfffff).rom();
+}
+
+void dynduke_state::slave_map(address_map &map)
+{
+ map(0x00000, 0x05fff).ram();
+ map(0x06000, 0x067ff).ram().w(this, FUNC(dynduke_state::background_w)).share("back_data");
+ map(0x06800, 0x06fff).ram().w(this, FUNC(dynduke_state::foreground_w)).share("fore_data");
+ map(0x07000, 0x07fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
+ map(0x08000, 0x08fff).ram().share("share1");
+ map(0x0a000, 0x0a001).w(this, FUNC(dynduke_state::gfxbank_w));
+ map(0x0c000, 0x0c001).nopw();
+ map(0xc0000, 0xfffff).rom();
+}
/* Memory map used by DlbDyn - probably an addressing PAL is different */
-ADDRESS_MAP_START(dynduke_state::masterj_map)
- AM_RANGE(0x00000, 0x06fff) AM_RAM
- AM_RANGE(0x07000, 0x07fff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x08000, 0x087ff) AM_RAM_WRITE(text_w) AM_SHARE("videoram")
- AM_RANGE(0x09000, 0x0900d) AM_DEVREADWRITE8("seibu_sound", seibu_sound_device, main_r, main_w, 0x00ff)
- AM_RANGE(0x0c000, 0x0c0ff) AM_RAM AM_SHARE("scroll_ram")
- AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x0f000, 0x0f001) AM_READ_PORT("P1_P2")
- AM_RANGE(0x0f002, 0x0f003) AM_READ_PORT("DSW")
- AM_RANGE(0x0f004, 0x0f005) AM_WRITENOP
- AM_RANGE(0x0f006, 0x0f007) AM_WRITE(control_w)
- AM_RANGE(0xa0000, 0xfffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(dynduke_state::sound_map)
- AM_RANGE(0x0000, 0xffff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
- AM_RANGE(0x2000, 0x27ff) AM_RAM
- AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
- AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
- AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst10_ack_w)
- AM_RANGE(0x4003, 0x4003) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst18_ack_w)
- AM_RANGE(0x4007, 0x4007) AM_DEVWRITE("seibu_sound", seibu_sound_device, bank_w)
- AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, ym_r, ym_w)
- AM_RANGE(0x4010, 0x4011) AM_DEVREAD("seibu_sound", seibu_sound_device, soundlatch_r)
- AM_RANGE(0x4012, 0x4012) AM_DEVREAD("seibu_sound", seibu_sound_device, main_data_pending_r)
- AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
- AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
- AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
- AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(dynduke_state::sound_decrypted_opcodes_map)
- AM_RANGE(0x0000, 0xffff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(dynduke_state::sei80bu_encrypted_full_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("audiocpu", 0)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
-ADDRESS_MAP_END
+void dynduke_state::masterj_map(address_map &map)
+{
+ map(0x00000, 0x06fff).ram();
+ map(0x07000, 0x07fff).ram().share("spriteram");
+ map(0x08000, 0x087ff).ram().w(this, FUNC(dynduke_state::text_w)).share("videoram");
+ map(0x09000, 0x0900d).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
+ map(0x0c000, 0x0c0ff).ram().share("scroll_ram");
+ map(0x0e000, 0x0efff).ram().share("share1");
+ map(0x0f000, 0x0f001).portr("P1_P2");
+ map(0x0f002, 0x0f003).portr("DSW");
+ map(0x0f004, 0x0f005).nopw();
+ map(0x0f006, 0x0f007).w(this, FUNC(dynduke_state::control_w));
+ map(0xa0000, 0xfffff).rom();
+}
+
+void dynduke_state::sound_map(address_map &map)
+{
+ map(0x0000, 0xffff).r("sei80bu", FUNC(sei80bu_device::data_r));
+ map(0x2000, 0x27ff).ram();
+ map(0x4000, 0x4000).w(m_seibu_sound, FUNC(seibu_sound_device::pending_w));
+ map(0x4001, 0x4001).w(m_seibu_sound, FUNC(seibu_sound_device::irq_clear_w));
+ map(0x4002, 0x4002).w(m_seibu_sound, FUNC(seibu_sound_device::rst10_ack_w));
+ map(0x4003, 0x4003).w(m_seibu_sound, FUNC(seibu_sound_device::rst18_ack_w));
+ map(0x4007, 0x4007).w(m_seibu_sound, FUNC(seibu_sound_device::bank_w));
+ map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w));
+ map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r));
+ map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r));
+ map(0x4013, 0x4013).portr("COIN");
+ map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w));
+ map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w));
+ map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
+}
+
+void dynduke_state::sound_decrypted_opcodes_map(address_map &map)
+{
+ map(0x0000, 0xffff).r("sei80bu", FUNC(sei80bu_device::opcode_r));
+}
+
+void dynduke_state::sei80bu_encrypted_full_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom().region("audiocpu", 0);
+ map(0x8000, 0xffff).bankr("seibu_bank1");
+}
/* Input Ports */