summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/thepit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/thepit.cpp')
-rw-r--r--src/mame/drivers/thepit.cpp127
1 files changed, 66 insertions, 61 deletions
diff --git a/src/mame/drivers/thepit.cpp b/src/mame/drivers/thepit.cpp
index f014168a1ab..93b9794c79f 100644
--- a/src/mame/drivers/thepit.cpp
+++ b/src/mame/drivers/thepit.cpp
@@ -206,67 +206,72 @@ WRITE_LINE_MEMBER(thepit_state::nmi_mask_w)
}
-ADDRESS_MAP_START(thepit_state::thepit_main_map)
- AM_RANGE(0x0000, 0x4fff) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("attributesram")
- AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x9860, 0x98ff) AM_RAM
- AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics
- AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
- AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
- AM_RANGE(0xb000, 0xb007) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
- AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(thepit_state::desertdan_main_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("attributesram")
- AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x9860, 0x98ff) AM_RAM
- AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics
- AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
- AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
- AM_RANGE(0xb000, 0xb007) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
- AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(thepit_state::intrepid_main_map)
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x8c00, 0x8fff) AM_READ(intrepid_colorram_mirror_r) AM_WRITE(colorram_w) /* mirror for intrepi2 */
- AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("attributesram")
- AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x9860, 0x98ff) AM_RAM
- AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
- AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
- AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
- AM_RANGE(0xb000, 0xb007) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
- AM_RANGE(0xb800, 0xb800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(thepit_state::audio_map)
- AM_RANGE(0x0000, 0x1fff) AM_ROM
- AM_RANGE(0x3800, 0x3bff) AM_RAM
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(thepit_state::audio_io_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
- AM_RANGE(0x8c, 0x8d) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
- AM_RANGE(0x8d, 0x8d) AM_DEVREAD("ay2", ay8910_device, data_r)
- AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
- AM_RANGE(0x8f, 0x8f) AM_DEVREAD("ay1", ay8910_device, data_r)
-ADDRESS_MAP_END
+void thepit_state::thepit_main_map(address_map &map)
+{
+ map(0x0000, 0x4fff).rom();
+ map(0x8000, 0x87ff).ram();
+ map(0x8800, 0x8bff).mirror(0x0400).ram().w(this, FUNC(thepit_state::colorram_w)).share("colorram");
+ map(0x9000, 0x93ff).mirror(0x0400).ram().w(this, FUNC(thepit_state::videoram_w)).share("videoram");
+ map(0x9800, 0x983f).mirror(0x0700).ram().share("attributesram");
+ map(0x9840, 0x985f).ram().share("spriteram");
+ map(0x9860, 0x98ff).ram();
+ map(0xa000, 0xa000).r(this, FUNC(thepit_state::input_port_0_r)).nopw(); // Not hooked up according to the schematics
+ map(0xa800, 0xa800).portr("IN1");
+ map(0xb000, 0xb000).portr("DSW");
+ map(0xb000, 0xb007).w("mainlatch", FUNC(ls259_device::write_d0));
+ map(0xb800, 0xb800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write));
+}
+
+void thepit_state::desertdan_main_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0x87ff).ram();
+ map(0x8800, 0x8bff).mirror(0x0400).ram().w(this, FUNC(thepit_state::colorram_w)).share("colorram");
+ map(0x9000, 0x93ff).mirror(0x0400).ram().w(this, FUNC(thepit_state::videoram_w)).share("videoram");
+ map(0x9800, 0x983f).mirror(0x0700).ram().share("attributesram");
+ map(0x9840, 0x985f).ram().share("spriteram");
+ map(0x9860, 0x98ff).ram();
+ map(0xa000, 0xa000).r(this, FUNC(thepit_state::input_port_0_r)).nopw(); // Not hooked up according to the schematics
+ map(0xa800, 0xa800).portr("IN1");
+ map(0xb000, 0xb000).portr("DSW");
+ map(0xb000, 0xb007).w("mainlatch", FUNC(ls259_device::write_d0));
+ map(0xb800, 0xb800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write));
+}
+
+void thepit_state::intrepid_main_map(address_map &map)
+{
+ map(0x0000, 0x7fff).rom();
+ map(0x8000, 0x87ff).ram();
+ map(0x8c00, 0x8fff).r(this, FUNC(thepit_state::intrepid_colorram_mirror_r)).w(this, FUNC(thepit_state::colorram_w)); /* mirror for intrepi2 */
+ map(0x9000, 0x93ff).ram().w(this, FUNC(thepit_state::videoram_w)).share("videoram");
+ map(0x9400, 0x97ff).ram().w(this, FUNC(thepit_state::colorram_w)).share("colorram");
+ map(0x9800, 0x983f).mirror(0x0700).ram().share("attributesram");
+ map(0x9840, 0x985f).ram().share("spriteram");
+ map(0x9860, 0x98ff).ram();
+ map(0xa000, 0xa000).r(this, FUNC(thepit_state::input_port_0_r));
+ map(0xa800, 0xa800).portr("IN1");
+ map(0xb000, 0xb000).portr("DSW");
+ map(0xb000, 0xb007).w("mainlatch", FUNC(ls259_device::write_d0));
+ map(0xb800, 0xb800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write));
+}
+
+
+void thepit_state::audio_map(address_map &map)
+{
+ map(0x0000, 0x1fff).rom();
+ map(0x3800, 0x3bff).ram();
+}
+
+
+void thepit_state::audio_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).w("soundlatch", FUNC(generic_latch_8_device::clear_w));
+ map(0x8c, 0x8d).w("ay2", FUNC(ay8910_device::address_data_w));
+ map(0x8d, 0x8d).r("ay2", FUNC(ay8910_device::data_r));
+ map(0x8e, 0x8f).w("ay1", FUNC(ay8910_device::address_data_w));
+ map(0x8f, 0x8f).r("ay1", FUNC(ay8910_device::data_r));
+}
static INPUT_PORTS_START( in0_real)