summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/stargame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/stargame.cpp')
-rw-r--r--src/mame/drivers/stargame.cpp70
1 files changed, 37 insertions, 33 deletions
diff --git a/src/mame/drivers/stargame.cpp b/src/mame/drivers/stargame.cpp
index 46a2ebd0f46..274540a2c82 100644
--- a/src/mame/drivers/stargame.cpp
+++ b/src/mame/drivers/stargame.cpp
@@ -43,39 +43,43 @@ private:
required_device<z80ctc_device> m_ctc;
};
-ADDRESS_MAP_START(stargame_state::maincpu_map)
- AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x7800) AM_RAM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(stargame_state::maincpu_io)
- ADDRESS_MAP_UNMAP_HIGH
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_MIRROR(0x09) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // CSON - command to the sound cpu - NMI to sound cpu
- AM_RANGE(0x10, 0x1f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0x20, 0x2f) // CSW2 - input lines: P0 to D4; P1 to D5; DAPRI to D6; TEST to D7
- AM_RANGE(0x30, 0x3f) // CSW1 - input lines
- AM_RANGE(0x40, 0x4f) // CDIG - score display
- AM_RANGE(0x50, 0x5f) // CDRIV
- AM_RANGE(0x60, 0x67) AM_DEVWRITE("mainlatch", ls259_device, write_d0) // CPOR
- AM_RANGE(0x68, 0x69) AM_MIRROR(0x06) // CPOR : 68=CKPRI; 69=CKDIS
- AM_RANGE(0x70, 0x73) AM_MIRROR(0x0c) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(stargame_state::audiocpu_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x4000, 0x4001) AM_MIRROR(0x3ffe) AM_DEVREADWRITE("mea8000", mea8000_device, read, write)
- AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM
- AM_RANGE(0xc000, 0xdfff) AM_WRITE(rint_w) // RINT - turn off interrupt of the audiocpu
- AM_RANGE(0xe000, 0xffff) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, acknowledge_w) // COMAND - acknowledge NMI and read the sound command
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(stargame_state::audiocpu_io)
- ADDRESS_MAP_GLOBAL_MASK(0x01)
- AM_RANGE(0x00, 0x00) AM_DEVREAD("ay", ay8910_device, data_r)
- AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay", ay8910_device, data_address_w)
-ADDRESS_MAP_END
+void stargame_state::maincpu_map(address_map &map)
+{
+ map(0x0000, 0x3fff).mirror(0x4000).rom();
+ map(0x8000, 0x87ff).mirror(0x7800).ram();
+}
+
+void stargame_state::maincpu_io(address_map &map)
+{
+ map.unmap_value_high();
+ map.global_mask(0xff);
+ map(0x00, 0x00).mirror(0x09).w("soundlatch", FUNC(generic_latch_8_device::write)); // CSON - command to the sound cpu - NMI to sound cpu
+ map(0x10, 0x1f).w("watchdog", FUNC(watchdog_timer_device::reset_w));
+ map(0x20, 0x2f); // CSW2 - input lines: P0 to D4; P1 to D5; DAPRI to D6; TEST to D7
+ map(0x30, 0x3f); // CSW1 - input lines
+ map(0x40, 0x4f); // CDIG - score display
+ map(0x50, 0x5f); // CDRIV
+ map(0x60, 0x67).w("mainlatch", FUNC(ls259_device::write_d0)); // CPOR
+ map(0x68, 0x69).mirror(0x06); // CPOR : 68=CKPRI; 69=CKDIS
+ map(0x70, 0x73).mirror(0x0c).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write));
+}
+
+void stargame_state::audiocpu_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x3fff).rom();
+ map(0x4000, 0x4001).mirror(0x3ffe).rw("mea8000", FUNC(mea8000_device::read), FUNC(mea8000_device::write));
+ map(0x8000, 0x87ff).mirror(0x3800).ram();
+ map(0xc000, 0xdfff).w(this, FUNC(stargame_state::rint_w)); // RINT - turn off interrupt of the audiocpu
+ map(0xe000, 0xffff).rw("soundlatch", FUNC(generic_latch_8_device::read), FUNC(generic_latch_8_device::acknowledge_w)); // COMAND - acknowledge NMI and read the sound command
+}
+
+void stargame_state::audiocpu_io(address_map &map)
+{
+ map.global_mask(0x01);
+ map(0x00, 0x00).r("ay", FUNC(ay8910_device::data_r));
+ map(0x01, 0x01).w("ay", FUNC(ay8910_device::data_address_w));
+}
static INPUT_PORTS_START( stargame )
INPUT_PORTS_END