diff options
Diffstat (limited to 'src/mame/drivers/starwars.cpp')
-rw-r--r-- | src/mame/drivers/starwars.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp index 4588de69707..30fe873e876 100644 --- a/src/mame/drivers/starwars.cpp +++ b/src/mame/drivers/starwars.cpp @@ -30,29 +30,27 @@ #include "cpu/m6809/m6809.h" #include "machine/74259.h" +#include "machine/adc0808.h" #include "machine/watchdog.h" #include "video/vector.h" #include "video/avgdvg.h" #include "sound/tms5220.h" -#include "sound/pokey.h" #include "machine/x2212.h" #include "screen.h" #include "speaker.h" -#define MASTER_CLOCK (XTAL(12'096'000)) +#define MASTER_CLOCK (12.096_MHz_XTAL) #define CLOCK_3KHZ (MASTER_CLOCK / 4096) WRITE8_MEMBER(starwars_state::quad_pokeyn_w) { - static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; int pokey_num = (offset >> 3) & ~0x04; int control = (offset & 0x20) >> 2; int pokey_reg = (offset % 8) | control; - pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); - pokey->write(pokey_reg, data); + m_pokey[pokey_num]->write(pokey_reg, data); } /************************************* @@ -138,7 +136,7 @@ void starwars_state::main_map(address_map &map) map(0x4320, 0x433f).portr("IN1"); map(0x4340, 0x435f).portr("DSW0"); map(0x4360, 0x437f).portr("DSW1"); - map(0x4380, 0x439f).r(this, FUNC(starwars_state::starwars_adc_r)); /* a-d control result */ + map(0x4380, 0x439f).r("adc", FUNC(adc0809_device::data_r)); map(0x4400, 0x4400).r(m_mainlatch, FUNC(generic_latch_8_device::read)); map(0x4400, 0x4400).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x4401, 0x4401).r(this, FUNC(starwars_state::starwars_main_ready_flag_r)); @@ -149,7 +147,7 @@ void starwars_state::main_map(address_map &map) map(0x4660, 0x467f).w(this, FUNC(starwars_state::irq_ack_w)); map(0x4680, 0x4687).nopr().mirror(0x0018).w("outlatch", FUNC(ls259_device::write_d7)); map(0x46a0, 0x46bf).w(this, FUNC(starwars_state::starwars_nstore_w)); - map(0x46c0, 0x46c2).w(this, FUNC(starwars_state::starwars_adc_select_w)); + map(0x46c0, 0x46c3).w("adc", FUNC(adc0809_device::address_offset_start_w)); map(0x46e0, 0x46e0).w(this, FUNC(starwars_state::starwars_soundrst_w)); map(0x4700, 0x4707).w(this, FUNC(starwars_state::starwars_math_w)); map(0x4700, 0x4700).r(this, FUNC(starwars_state::starwars_div_reh_r)); @@ -315,6 +313,11 @@ MACHINE_CONFIG_START(starwars_state::starwars) MCFG_CPU_ADD("audiocpu", MC6809E, MASTER_CLOCK / 8) MCFG_CPU_PROGRAM_MAP(sound_map) + MCFG_DEVICE_ADD("adc", ADC0809, MASTER_CLOCK / 16) // custom designated as "157249-120" + MCFG_ADC0808_IN0_CB(IOPORT("STICKY")) // pitch + MCFG_ADC0808_IN1_CB(IOPORT("STICKX")) // yaw + MCFG_ADC0808_IN2_CB(GND) // thrust (unused) + MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK / 8) MCFG_RIOT6532_IN_PA_CB(READ8(starwars_state, r6532_porta_r)) MCFG_RIOT6532_OUT_PA_CB(WRITE8(starwars_state, r6532_porta_w)) |