summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/thoop2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/thoop2.cpp')
-rw-r--r--src/mame/drivers/thoop2.cpp64
1 files changed, 35 insertions, 29 deletions
diff --git a/src/mame/drivers/thoop2.cpp b/src/mame/drivers/thoop2.cpp
index 9e62bd48cdb..eb02555da59 100644
--- a/src/mame/drivers/thoop2.cpp
+++ b/src/mame/drivers/thoop2.cpp
@@ -116,35 +116,41 @@ READ8_MEMBER(thoop2_state::shareram_r)
}
-ADDRESS_MAP_START(thoop2_state::mcu_hostmem_map)
- AM_RANGE(0x8000, 0xffff) AM_READWRITE(shareram_r, shareram_w) // confirmed that 0x8000 - 0xffff is a window into 68k shared RAM
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(thoop2_state::thoop2_map)
- AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
- AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(vram_w) AM_SHARE("videoram") /* Video RAM */
- AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */
- AM_RANGE(0x10800c, 0x10800d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) /* INT 6 ACK/Watchdog timer */
- AM_RANGE(0x200000, 0x2007ff) AM_RAM_DEVWRITE("palette", palette_device, write16) AM_SHARE("palette")/* Palette */
- AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */
- AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2")
- AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1")
- AM_RANGE(0x700004, 0x700005) AM_READ_PORT("P1")
- AM_RANGE(0x700006, 0x700007) AM_READ_PORT("P2")
- AM_RANGE(0x700008, 0x700009) AM_READ_PORT("SYSTEM")
- ;map(0x70000a, 0x70000b).select(0x000070).lw8("outlatch_w", [this](address_space &space, offs_t offset, u8 data, u8 mem_mask){ m_outlatch->write_d0(space, offset >> 3, data, mem_mask); }).umask16(0x00ff);
- AM_RANGE(0x70000c, 0x70000d) AM_WRITE8(OKIM6295_bankswitch_w, 0x00ff) /* OKI6295 bankswitch */
- AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) /* OKI6295 data register */
- AM_RANGE(0xfe0000, 0xfe7fff) AM_RAM /* Work RAM */
- AM_RANGE(0xfe8000, 0xfeffff) AM_RAM AM_SHARE("shareram") /* Work RAM (shared with D5002FP) */
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(thoop2_state::oki_map)
- AM_RANGE(0x00000, 0x2ffff) AM_ROM
- AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank")
-ADDRESS_MAP_END
+void thoop2_state::mcu_hostmem_map(address_map &map)
+{
+ map(0x8000, 0xffff).rw(this, FUNC(thoop2_state::shareram_r), FUNC(thoop2_state::shareram_w)); // confirmed that 0x8000 - 0xffff is a window into 68k shared RAM
+}
+
+
+void thoop2_state::thoop2_map(address_map &map)
+{
+ map(0x000000, 0x0fffff).rom(); /* ROM */
+ map(0x100000, 0x101fff).ram().w(this, FUNC(thoop2_state::vram_w)).share("videoram"); /* Video RAM */
+ map(0x108000, 0x108007).writeonly().share("vregs"); /* Video Registers */
+ map(0x10800c, 0x10800d).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); /* INT 6 ACK/Watchdog timer */
+ map(0x200000, 0x2007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");/* Palette */
+ map(0x440000, 0x440fff).ram().share("spriteram"); /* Sprite RAM */
+ map(0x700000, 0x700001).portr("DSW2");
+ map(0x700002, 0x700003).portr("DSW1");
+ map(0x700004, 0x700005).portr("P1");
+ map(0x700006, 0x700007).portr("P2");
+ map(0x700008, 0x700009).portr("SYSTEM");
+ map(0x70000b, 0x70000b).select(0x000070).lw8("outlatch_w",
+ [this](address_space &space, offs_t offset, u8 data, u8 mem_mask) {
+ m_outlatch->write_d0(space, offset >> 3, data, mem_mask);
+ });
+ map(0x70000d, 0x70000d).w(this, FUNC(thoop2_state::OKIM6295_bankswitch_w)); /* OKI6295 bankswitch */
+ map(0x70000f, 0x70000f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); /* OKI6295 data register */
+ map(0xfe0000, 0xfe7fff).ram(); /* Work RAM */
+ map(0xfe8000, 0xfeffff).ram().share("shareram"); /* Work RAM (shared with D5002FP) */
+}
+
+
+void thoop2_state::oki_map(address_map &map)
+{
+ map(0x00000, 0x2ffff).rom();
+ map(0x30000, 0x3ffff).bankr("okibank");
+}
static INPUT_PORTS_START( thoop2 )