summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/timeplt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/timeplt.cpp')
-rw-r--r--src/mame/drivers/timeplt.cpp58
1 files changed, 32 insertions, 26 deletions
diff --git a/src/mame/drivers/timeplt.cpp b/src/mame/drivers/timeplt.cpp
index fedaf34cbb7..b23570161b0 100644
--- a/src/mame/drivers/timeplt.cpp
+++ b/src/mame/drivers/timeplt.cpp
@@ -129,32 +129,38 @@ CUSTOM_INPUT_MEMBER(timeplt_state::chkun_hopper_status_r)
*
*************************************/
-ADDRESS_MAP_START(timeplt_state::timeplt_main_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x5fff) AM_ROM
- AM_RANGE(0xa000, 0xa3ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
- AM_RANGE(0xa400, 0xa7ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
- AM_RANGE(0xa800, 0xafff) AM_RAM
- AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_SHARE("spriteram2")
- AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_READ(scanline_r) AM_DEVWRITE("timeplt_audio", timeplt_audio_device, sound_data_w)
- AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_READ_PORT("DSW1") AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0c9f) AM_READ_PORT("IN0")
- ;map(0xc300, 0xc30f).lw8("mainlatch_w", [this](address_space &space, offs_t offset, u8 data, u8 mem_mask){ m_mainlatch->write_d0(space, offset >> 1, data, mem_mask); });
- AM_RANGE(0xc320, 0xc320) AM_MIRROR(0x0c9f) AM_READ_PORT("IN1")
- AM_RANGE(0xc340, 0xc340) AM_MIRROR(0x0c9f) AM_READ_PORT("IN2")
- AM_RANGE(0xc360, 0xc360) AM_MIRROR(0x0c9f) AM_READ_PORT("DSW0")
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(timeplt_state::psurge_main_map)
- AM_IMPORT_FROM(timeplt_main_map)
- AM_RANGE(0x6004, 0x6004) AM_READ(psurge_protection_r)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(timeplt_state::chkun_main_map)
- AM_IMPORT_FROM(timeplt_main_map)
- AM_RANGE(0x6000, 0x67ff) AM_RAM
-ADDRESS_MAP_END
+void timeplt_state::timeplt_main_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x5fff).rom();
+ map(0xa000, 0xa3ff).ram().w(this, FUNC(timeplt_state::colorram_w)).share("colorram");
+ map(0xa400, 0xa7ff).ram().w(this, FUNC(timeplt_state::videoram_w)).share("videoram");
+ map(0xa800, 0xafff).ram();
+ map(0xb000, 0xb0ff).mirror(0x0b00).ram().share("spriteram");
+ map(0xb400, 0xb4ff).mirror(0x0b00).ram().share("spriteram2");
+ map(0xc000, 0xc000).mirror(0x0cff).r(this, FUNC(timeplt_state::scanline_r)).w("timeplt_audio", FUNC(timeplt_audio_device::sound_data_w));
+ map(0xc200, 0xc200).mirror(0x0cff).portr("DSW1").w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0xc300, 0xc300).mirror(0x0c9f).portr("IN0");
+ map(0xc300, 0xc30f).lw8("mainlatch_w",
+ [this](address_space &space, offs_t offset, u8 data, u8 mem_mask) {
+ m_mainlatch->write_d0(space, offset >> 1, data, mem_mask);
+ });
+ map(0xc320, 0xc320).mirror(0x0c9f).portr("IN1");
+ map(0xc340, 0xc340).mirror(0x0c9f).portr("IN2");
+ map(0xc360, 0xc360).mirror(0x0c9f).portr("DSW0");
+}
+
+void timeplt_state::psurge_main_map(address_map &map)
+{
+ timeplt_main_map(map);
+ map(0x6004, 0x6004).r(this, FUNC(timeplt_state::psurge_protection_r));
+}
+
+void timeplt_state::chkun_main_map(address_map &map)
+{
+ timeplt_main_map(map);
+ map(0x6000, 0x67ff).ram();
+}