summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/asteroid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/asteroid.cpp')
-rw-r--r--src/mame/drivers/asteroid.cpp123
1 files changed, 63 insertions, 60 deletions
diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp
index 7ae9185957a..e85b624f99c 100644
--- a/src/mame/drivers/asteroid.cpp
+++ b/src/mame/drivers/asteroid.cpp
@@ -248,66 +248,69 @@ WRITE8_MEMBER(asteroid_state::llander_led_w)
*
*************************************/
-ADDRESS_MAP_START(asteroid_state::asteroid_map)
- ADDRESS_MAP_GLOBAL_MASK(0x7fff)
- AM_RANGE(0x0000, 0x01ff) AM_RAM
- AM_RANGE(0x0200, 0x02ff) AM_RAMBANK("ram1") AM_SHARE("ram1")
- AM_RANGE(0x0300, 0x03ff) AM_RAMBANK("ram2") AM_SHARE("ram2")
- AM_RANGE(0x2000, 0x2007) AM_READ(asteroid_IN0_r) /* IN0 */
- AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r) /* IN1 */
- AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r) /* DSW1 */
- AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("dvg", dvg_device, go_w)
- AM_RANGE(0x3200, 0x3200) AM_WRITE(asteroid_bank_switch_w)
- AM_RANGE(0x3400, 0x3400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
- AM_RANGE(0x3a00, 0x3a00) AM_WRITE(asteroid_thump_w)
- AM_RANGE(0x3c00, 0x3c07) AM_DEVWRITE("audiolatch", ls259_device, write_d7)
- AM_RANGE(0x3e00, 0x3e00) AM_WRITE(asteroid_noise_reset_w)
- AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
- AM_RANGE(0x5000, 0x57ff) AM_ROM /* vector rom */
- AM_RANGE(0x6800, 0x7fff) AM_ROM
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(asteroid_state::astdelux_map)
- ADDRESS_MAP_GLOBAL_MASK(0x7fff)
- AM_RANGE(0x0000, 0x01ff) AM_RAM
- AM_RANGE(0x0200, 0x02ff) AM_RAMBANK("ram1") AM_SHARE("ram1")
- AM_RANGE(0x0300, 0x03ff) AM_RAMBANK("ram2") AM_SHARE("ram2")
- AM_RANGE(0x2000, 0x2007) AM_READ(asteroid_IN0_r) /* IN0 */
- AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r) /* IN1 */
- AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r) /* DSW1 */
- AM_RANGE(0x2c00, 0x2c0f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
- AM_RANGE(0x2c40, 0x2c7f) AM_DEVREAD("earom", atari_vg_earom_device, read)
- AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("dvg", dvg_device, go_w)
- AM_RANGE(0x3200, 0x323f) AM_DEVWRITE("earom", atari_vg_earom_device, write)
- AM_RANGE(0x3400, 0x3400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
- AM_RANGE(0x3a00, 0x3a00) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
- AM_RANGE(0x3c00, 0x3c07) AM_DEVWRITE("audiolatch", ls259_device, write_d7)
- AM_RANGE(0x3e00, 0x3e00) AM_WRITE(asteroid_noise_reset_w)
- AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
- AM_RANGE(0x4800, 0x57ff) AM_ROM /* vector rom */
- AM_RANGE(0x6000, 0x7fff) AM_ROM
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(asteroid_state::llander_map)
- ADDRESS_MAP_GLOBAL_MASK(0x7fff)
- AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x1f00)
- AM_RANGE(0x2000, 0x2000) AM_READ_PORT("IN0")
- AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r) /* IN1 */
- AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r) /* DSW1 */
- AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("THRUST")
- AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("dvg", dvg_device, go_w)
- AM_RANGE(0x3200, 0x3200) AM_WRITE(llander_led_w)
- AM_RANGE(0x3400, 0x3400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0x3c00, 0x3c00) AM_WRITE(llander_sounds_w)
- AM_RANGE(0x3e00, 0x3e00) AM_WRITE(llander_snd_reset_w)
- AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
- AM_RANGE(0x4800, 0x5fff) AM_ROM /* vector rom */
- AM_RANGE(0x6000, 0x7fff) AM_ROM
-ADDRESS_MAP_END
+void asteroid_state::asteroid_map(address_map &map)
+{
+ map.global_mask(0x7fff);
+ map(0x0000, 0x01ff).ram();
+ map(0x0200, 0x02ff).bankrw("ram1").share("ram1");
+ map(0x0300, 0x03ff).bankrw("ram2").share("ram2");
+ map(0x2000, 0x2007).r(this, FUNC(asteroid_state::asteroid_IN0_r)); /* IN0 */
+ map(0x2400, 0x2407).r(this, FUNC(asteroid_state::asteroid_IN1_r)); /* IN1 */
+ map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
+ map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
+ map(0x3200, 0x3200).w(this, FUNC(asteroid_state::asteroid_bank_switch_w));
+ map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0x3600, 0x3600).w(this, FUNC(asteroid_state::asteroid_explode_w));
+ map(0x3a00, 0x3a00).w(this, FUNC(asteroid_state::asteroid_thump_w));
+ map(0x3c00, 0x3c07).w("audiolatch", FUNC(ls259_device::write_d7));
+ map(0x3e00, 0x3e00).w(this, FUNC(asteroid_state::asteroid_noise_reset_w));
+ map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
+ map(0x5000, 0x57ff).rom(); /* vector rom */
+ map(0x6800, 0x7fff).rom();
+}
+
+
+void asteroid_state::astdelux_map(address_map &map)
+{
+ map.global_mask(0x7fff);
+ map(0x0000, 0x01ff).ram();
+ map(0x0200, 0x02ff).bankrw("ram1").share("ram1");
+ map(0x0300, 0x03ff).bankrw("ram2").share("ram2");
+ map(0x2000, 0x2007).r(this, FUNC(asteroid_state::asteroid_IN0_r)); /* IN0 */
+ map(0x2400, 0x2407).r(this, FUNC(asteroid_state::asteroid_IN1_r)); /* IN1 */
+ map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
+ map(0x2c00, 0x2c0f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
+ map(0x2c40, 0x2c7f).r("earom", FUNC(atari_vg_earom_device::read));
+ map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
+ map(0x3200, 0x323f).w("earom", FUNC(atari_vg_earom_device::write));
+ map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0x3600, 0x3600).w(this, FUNC(asteroid_state::asteroid_explode_w));
+ map(0x3a00, 0x3a00).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
+ map(0x3c00, 0x3c07).w("audiolatch", FUNC(ls259_device::write_d7));
+ map(0x3e00, 0x3e00).w(this, FUNC(asteroid_state::asteroid_noise_reset_w));
+ map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
+ map(0x4800, 0x57ff).rom(); /* vector rom */
+ map(0x6000, 0x7fff).rom();
+}
+
+
+void asteroid_state::llander_map(address_map &map)
+{
+ map.global_mask(0x7fff);
+ map(0x0000, 0x00ff).ram().mirror(0x1f00);
+ map(0x2000, 0x2000).portr("IN0");
+ map(0x2400, 0x2407).r(this, FUNC(asteroid_state::asteroid_IN1_r)); /* IN1 */
+ map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
+ map(0x2c00, 0x2c00).portr("THRUST");
+ map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
+ map(0x3200, 0x3200).w(this, FUNC(asteroid_state::llander_led_w));
+ map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0x3c00, 0x3c00).w(this, FUNC(asteroid_state::llander_sounds_w));
+ map(0x3e00, 0x3e00).w(this, FUNC(asteroid_state::llander_snd_reset_w));
+ map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
+ map(0x4800, 0x5fff).rom(); /* vector rom */
+ map(0x6000, 0x7fff).rom();
+}