summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/hyperspt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/hyperspt.cpp')
-rw-r--r--src/mame/drivers/hyperspt.cpp134
1 files changed, 71 insertions, 63 deletions
diff --git a/src/mame/drivers/hyperspt.cpp b/src/mame/drivers/hyperspt.cpp
index d44ecd5840d..2bb82f78911 100644
--- a/src/mame/drivers/hyperspt.cpp
+++ b/src/mame/drivers/hyperspt.cpp
@@ -52,61 +52,68 @@ WRITE_LINE_MEMBER(hyperspt_state::irq_mask_w)
m_maincpu->set_input_line(0, CLEAR_LINE);
}
-ADDRESS_MAP_START(hyperspt_state::common_map)
- AM_RANGE(0x1000, 0x10bf) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x10c0, 0x10ff) AM_RAM AM_SHARE("scroll") /* Scroll amount */
- AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0x1480, 0x1487) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
- AM_RANGE(0x1500, 0x1500) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
- AM_RANGE(0x1600, 0x1600) AM_READ_PORT("DSW2")
- AM_RANGE(0x1680, 0x1680) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x1683, 0x1683) AM_READ_PORT("DSW1")
- AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x3000, 0x37ff) AM_RAM
- AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0x4000, 0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(hyperspt_state::hyperspt_map)
- AM_IMPORT_FROM(common_map)
- AM_RANGE(0x1681, 0x1681) AM_READ_PORT("P1_P2")
- AM_RANGE(0x1682, 0x1682) AM_READ_PORT("P3_P4")
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(hyperspt_state::roadf_map)
- AM_IMPORT_FROM(common_map)
- AM_RANGE(0x1681, 0x1681) AM_READ_PORT("P1")
- AM_RANGE(0x1682, 0x1682) AM_READ_PORT("P2")
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(hyperspt_state::common_sound_map)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x4000, 0x4fff) AM_RAM
- AM_RANGE(0x6000, 0x6000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x8000, 0x8000) AM_DEVREAD("trackfld_audio", trackfld_audio_device, hyperspt_sh_timer_r)
- AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_byte_interface, write)
- AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
- AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(hyperspt_state::hyperspt_sound_map)
- AM_IMPORT_FROM(common_sound_map)
- AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("vlm", vlm5030_device, data_w) /* speech data */
- AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, hyperspt_sound_w) /* speech and output control */
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(hyperspt_state::roadf_sound_map)
- AM_IMPORT_FROM(common_sound_map)
- AM_RANGE(0xa000, 0xa000) AM_NOP // No VLM
- AM_RANGE(0xc000, 0xdfff) AM_NOP // No VLM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(hyperspt_state::soundb_map)
- AM_IMPORT_FROM(common_sound_map)
- AM_RANGE(0xa000, 0xa000) AM_NOP // No VLM
- AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE("hyprolyb_adpcm", hyprolyb_adpcm_device, write) /* speech and output control */
-ADDRESS_MAP_END
+void hyperspt_state::common_map(address_map &map)
+{
+ map(0x1000, 0x10bf).ram().share("spriteram");
+ map(0x10c0, 0x10ff).ram().share("scroll"); /* Scroll amount */
+ map(0x1400, 0x1400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0x1480, 0x1487).w("mainlatch", FUNC(ls259_device::write_d0));
+ map(0x1500, 0x1500).w("soundlatch", FUNC(generic_latch_8_device::write));
+ map(0x1600, 0x1600).portr("DSW2");
+ map(0x1680, 0x1680).portr("SYSTEM");
+ map(0x1683, 0x1683).portr("DSW1");
+ map(0x2000, 0x27ff).ram().w(this, FUNC(hyperspt_state::videoram_w)).share("videoram");
+ map(0x2800, 0x2fff).ram().w(this, FUNC(hyperspt_state::colorram_w)).share("colorram");
+ map(0x3000, 0x37ff).ram();
+ map(0x3800, 0x3fff).ram().share("nvram");
+ map(0x4000, 0xffff).rom();
+}
+
+void hyperspt_state::hyperspt_map(address_map &map)
+{
+ common_map(map);
+ map(0x1681, 0x1681).portr("P1_P2");
+ map(0x1682, 0x1682).portr("P3_P4");
+}
+
+void hyperspt_state::roadf_map(address_map &map)
+{
+ common_map(map);
+ map(0x1681, 0x1681).portr("P1");
+ map(0x1682, 0x1682).portr("P2");
+}
+
+void hyperspt_state::common_sound_map(address_map &map)
+{
+ map(0x0000, 0x3fff).rom();
+ map(0x4000, 0x4fff).ram();
+ map(0x6000, 0x6000).r("soundlatch", FUNC(generic_latch_8_device::read));
+ map(0x8000, 0x8000).r("trackfld_audio", FUNC(trackfld_audio_device::hyperspt_sh_timer_r));
+ map(0xe000, 0xe000).w("dac", FUNC(dac_byte_interface::write));
+ map(0xe001, 0xe001).w(this, FUNC(hyperspt_state::konami_SN76496_latch_w)); /* Loads the snd command into the snd latch */
+ map(0xe002, 0xe002).w(this, FUNC(hyperspt_state::konami_SN76496_w)); /* This address triggers the SN chip to read the data port. */
+}
+
+void hyperspt_state::hyperspt_sound_map(address_map &map)
+{
+ common_sound_map(map);
+ map(0xa000, 0xa000).w(m_vlm, FUNC(vlm5030_device::data_w)); /* speech data */
+ map(0xc000, 0xdfff).w("trackfld_audio", FUNC(trackfld_audio_device::hyperspt_sound_w)); /* speech and output control */
+}
+
+void hyperspt_state::roadf_sound_map(address_map &map)
+{
+ common_sound_map(map);
+ map(0xa000, 0xa000).noprw(); // No VLM
+ map(0xc000, 0xdfff).noprw(); // No VLM
+}
+
+void hyperspt_state::soundb_map(address_map &map)
+{
+ common_sound_map(map);
+ map(0xa000, 0xa000).noprw(); // No VLM
+ map(0xc000, 0xdfff).w("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::write)); /* speech and output control */
+}
static INPUT_PORTS_START( hyperspt )
PORT_START("SYSTEM")
@@ -343,12 +350,13 @@ MACHINE_CONFIG_START(hyperspt_state::hyperspt)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
-ADDRESS_MAP_START(hyperspt_state::hyprolyb_adpcm_map)
- AM_RANGE(0x0000, 0x007f) AM_RAM
- AM_RANGE(0x1000, 0x1000) AM_DEVREAD("hyprolyb_adpcm", hyprolyb_adpcm_device, data_r)
- AM_RANGE(0x1001, 0x1001) AM_DEVREAD("hyprolyb_adpcm", hyprolyb_adpcm_device, ready_r)
- AM_RANGE(0x1002, 0x1002) AM_DEVWRITE("hyprolyb_adpcm", hyprolyb_adpcm_device, msm_data_w)
- AM_RANGE(0x1003, 0x1003) AM_DEVREAD("hyprolyb_adpcm", hyprolyb_adpcm_device, msm_vck_r)
+void hyperspt_state::hyprolyb_adpcm_map(address_map &map)
+{
+ map(0x0000, 0x007f).ram();
+ map(0x1000, 0x1000).r("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::data_r));
+ map(0x1001, 0x1001).r("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::ready_r));
+ map(0x1002, 0x1002).w("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::msm_data_w));
+ map(0x1003, 0x1003).r("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::msm_vck_r));
// on init:
// $1003 = $00
// $1002 = $FF
@@ -362,8 +370,8 @@ ADDRESS_MAP_START(hyperspt_state::hyprolyb_adpcm_map)
// $1002 & $0f (out) = 5205 data
// $1001 & $80 (in) = sound latch request
// $1000 (in) = sound latch data
- AM_RANGE(0x8000, 0xffff) AM_ROM
-ADDRESS_MAP_END
+ map(0x8000, 0xffff).rom();
+}
MACHINE_CONFIG_START(hyperspt_state::hypersptb)