diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index 06ecc23236c..eb32354230a 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -87,9 +87,9 @@ #define VERBOSE 1 #define VERBOSE_SOUND 0 -#define VERBOSE_TIMER 0 -#define VERBOSE_POLY 1 -#define VERBOSE_RAND 1 +#define VERBOSE_TIMER 1 +#define VERBOSE_POLY 0 +#define VERBOSE_RAND 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) @@ -457,26 +457,6 @@ static void rand_init(UINT8 *rng, int size, int left, int right, int add) } -#if 0 -static void rand_init_old(UINT8 *rng, int size, int left, int right, int add) -{ - int mask = (1 << size) - 1; - int i, x = 0; - - LOG_RAND(("rand %d\n", size)); - for( i = 0; i < mask; i++ ) - { - if (size == 17) - *rng = x >> 6; /* use bits 6..13 */ - else - *rng = x; /* use bits 0..7 */ - LOG_RAND(("%05x: %02x\n", x, *rng)); - rng++; - /* calculate next bit */ - x = ((x << left) + (x >> right) + add) & mask; - } -} -#endif static void register_for_save(pokey_state *chip, device_t *device) { @@ -1271,10 +1251,11 @@ DEVICE_GET_INFO( pokey ) } } +#ifdef OLDDEVICE_FOR_MESS DEFINE_LEGACY_SOUND_DEVICE(POKEY, pokey); - +#endif @@ -1481,6 +1462,18 @@ void pokeyn_device::device_timer(emu_timer &timer, device_timer_id id, int param (m_interrupt_cb)(this, IRQ_SEROC); } } + else if (id == 5) + { + /* serin_ready */ + if( m_IRQEN & IRQ_SERIN ) + { + /* set the enabled timer irq status bits */ + m_IRQST |= IRQ_SERIN; + /* call back an application supplied function to handle the interrupt */ + if( m_interrupt_cb ) + (m_interrupt_cb)(this, IRQ_SERIN); + } + } else assert_always(FALSE, "Unknown id in pokey_device::device_timer"); } @@ -1612,6 +1605,11 @@ void pokeyn_device::sound_stream_update(sound_stream &stream, stream_sample_t ** //------------------------------------------------- READ8_MEMBER( pokeyn_device::read ) +{ + return read(offset); +} + +UINT8 pokeyn_device::read(offs_t offset) { int data = 0, pot; UINT32 adjust = 0; @@ -1741,10 +1739,10 @@ READ8_MEMBER( pokeyn_device::read ) WRITE8_MEMBER( pokeyn_device::write ) { - write_cmd(offset, data); + write(offset, data); } -void pokeyn_device::write_cmd(int offset, UINT8 data) +void pokeyn_device::write(offs_t offset, UINT8 data) { int ch_mask = 0, new_val; @@ -1977,8 +1975,8 @@ void pokeyn_device::write_cmd(int offset, UINT8 data) m_SKCTL = data; if( !(data & SK_RESET) ) { - write_cmd(IRQEN_C, 0); - write_cmd(SKREST_C, 0); + write(IRQEN_C, 0); + write(SKREST_C, 0); } break; } @@ -2071,6 +2069,57 @@ void pokeyn_device::write_cmd(int offset, UINT8 data) } } +void pokeyn_device::serin_ready(int after) +{ + timer_set(m_clock_period * after, 5, 0); +} + +void pokeyn_device::break_w(int shift) +{ + if( shift ) /* shift code ? */ + m_SKSTAT |= SK_SHIFT; + else + m_SKSTAT &= ~SK_SHIFT; + /* check if the break IRQ is enabled */ + if( m_IRQEN & IRQ_BREAK ) + { + /* set break IRQ status and call back the interrupt handler */ + m_IRQST |= IRQ_BREAK; + if( m_interrupt_cb ) + (*m_interrupt_cb)(this, IRQ_BREAK); + } +} + +void pokeyn_device::kbcode_w(int kbcode, int make) +{ + /* make code ? */ + if( make ) + { + m_KBCODE = kbcode; + m_SKSTAT |= SK_KEYBD; + if( kbcode & 0x40 ) /* shift code ? */ + m_SKSTAT |= SK_SHIFT; + else + m_SKSTAT &= ~SK_SHIFT; + + if( m_IRQEN & IRQ_KEYBD ) + { + /* last interrupt not acknowledged ? */ + if( m_IRQST & IRQ_KEYBD ) + m_SKSTAT |= SK_KBERR; + m_IRQST |= IRQ_KEYBD; + if( m_interrupt_cb ) + (*m_interrupt_cb)(this, IRQ_KEYBD); + } + } + else + { + m_KBCODE = kbcode; + m_SKSTAT &= ~SK_KEYBD; + } +} + + //------------------------------------------------- // private stuff @@ -2220,3 +2269,31 @@ void pokeyn_device::poly_init_9_17(UINT32 *poly, int size) } } + +//------------------------------------------------- +// Quad Pokey support - should be in game drivers, really +//------------------------------------------------- + + +READ8_HANDLER( quad_pokeyn_r ) +{ + 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; + pokeyn_device *pokey = space->machine().device(devname[pokey_num]); + + return pokey->read(pokey_reg); +} + +WRITE8_HANDLER( 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; + pokeyn_device *pokey = space->machine().device(devname[pokey_num]); + + pokey->write(pokey_reg, data); +} + diff --git a/src/emu/sound/pokey.h b/src/emu/sound/pokey.h index e9ec2fcd64e..0755fe6422e 100644 --- a/src/emu/sound/pokey.h +++ b/src/emu/sound/pokey.h @@ -21,6 +21,11 @@ #include "devlegcy.h" +/* uncomment the line below for MESS to avoid breaking compile + * please migrate as soon as possible to new device so that we can get rid of the legacy */ + +//#define OLDDEVICE_FOR_MESS 1 + /* CONSTANT DEFINITIONS */ /* POKEY WRITE LOGICALS */ @@ -78,7 +83,7 @@ struct _pokey_interface void (*interrupt_cb)(device_t *device, int mask); }; - +#ifdef OLDDEVICE_FOR_MESS READ8_DEVICE_HANDLER( pokey_r ); WRITE8_DEVICE_HANDLER( pokey_w ); @@ -92,11 +97,12 @@ void pokey_kbcode_w (device_t *device, int kbcode, int make); DECLARE_LEGACY_SOUND_DEVICE(POKEY, pokey); +#endif + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** - // ======================> pokey_device class pokeyn_device : public device_t, @@ -109,6 +115,13 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); + UINT8 read(offs_t offset); + void write(offs_t offset, UINT8 data); + + void serin_ready(int after); + void break_w(int shift); + void kbcode_w(int kbcode, int make); + protected: // device-level overrides virtual void device_start(); @@ -132,9 +145,6 @@ private: inline void inc_chan(int ch); inline int check_borrow(int ch); void pokey_potgo(void); - void write_cmd(int offset, UINT8 data); - - // internal state sound_stream* m_stream; @@ -192,4 +202,9 @@ private: extern const device_type POKEYN; +/* fix me: eventually this should be a single device with pokey subdevices */ +READ8_HANDLER( quad_pokeyn_r ); +WRITE8_HANDLER( quad_pokeyn_w ); + + #endif /* __POKEY_H__ */ diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c index c6ba04b31ae..bfec28f33b3 100644 --- a/src/mame/audio/atarijsa.c +++ b/src/mame/audio/atarijsa.c @@ -57,7 +57,7 @@ static cpu_device *jsacpu; static const char *test_port; static UINT16 test_mask; -static pokey_device *pokey; +static pokeyn_device *pokey; static ym2151_device *ym2151; static device_t *tms5220; static okim6295_device *oki6295; @@ -140,14 +140,14 @@ void atarijsa_init(running_machine &machine, const char *testport, int testmask) /* determine which sound hardware is installed */ tms5220 = machine.device("tms"); ym2151 = machine.device("ymsnd"); - pokey = machine.device("pokey"); + pokey = machine.device("pokey"); oki6295 = machine.device("adpcm"); oki6295_l = machine.device("adpcml"); oki6295_r = machine.device("adpcmr"); /* install POKEY memory handlers */ if (pokey != NULL) - jsacpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*pokey, 0x2c00, 0x2c0f, FUNC(pokey_r), FUNC(pokey_w)); + jsacpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2c00, 0x2c0f, read8_delegate(FUNC(pokeyn_device::read),pokey), write8_delegate(FUNC(pokeyn_device::write),pokey)); init_save_state(machine); atarijsa_reset(); @@ -839,7 +839,7 @@ MACHINE_CONFIG_DERIVED( jsa_i_stereo_pokey, jsa_i_stereo ) /* basic machine hardware */ /* sound hardware */ - MCFG_SOUND_ADD("pokey", POKEY, JSA_MASTER_CLOCK/2) + MCFG_SOUND_ADD("pokey", POKEYN, JSA_MASTER_CLOCK/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40) MACHINE_CONFIG_END diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c index b0d46e3496a..94c5d010c3a 100644 --- a/src/mame/audio/jedi.c +++ b/src/mame/audio/jedi.c @@ -170,10 +170,10 @@ WRITE8_MEMBER(jedi_state::speech_reset_w) static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, jedi_state ) AM_RANGE(0x0000, 0x07ff) AM_RAM - AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) - AM_RANGE(0x0810, 0x081f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) - AM_RANGE(0x0820, 0x082f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey3", pokey_r, pokey_w) - AM_RANGE(0x0830, 0x083f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey4", pokey_r, pokey_w) + AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) + AM_RANGE(0x0810, 0x081f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) + AM_RANGE(0x0820, 0x082f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey3", pokeyn_device, read, write) + AM_RANGE(0x0830, 0x083f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey4", pokeyn_device, read, write) AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE(irq_ack_w) AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x00ff) AM_READNOP AM_WRITEONLY AM_SHARE("speech_data") AM_RANGE(0x1200, 0x13ff) AM_READNOP AM_WRITE(speech_strobe_w) @@ -205,18 +205,18 @@ MACHINE_CONFIG_FRAGMENT( jedi_audio ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_ADD("pokey1", POKEY, JEDI_POKEY_CLOCK) + MCFG_SOUND_ADD("pokey1", POKEYN, JEDI_POKEY_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) - MCFG_SOUND_ADD("pokey2", POKEY, JEDI_POKEY_CLOCK) + MCFG_SOUND_ADD("pokey2", POKEYN, JEDI_POKEY_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) - MCFG_SOUND_ADD("pokey3", POKEY, JEDI_POKEY_CLOCK) + MCFG_SOUND_ADD("pokey3", POKEYN, JEDI_POKEY_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) - MCFG_SOUND_ADD("pokey4", POKEY, JEDI_POKEY_CLOCK) + MCFG_SOUND_ADD("pokey4", POKEYN, JEDI_POKEY_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) MCFG_SOUND_ADD("tms", TMS5220, JEDI_TMS5220_CLOCK) diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c index e82f1ccaa5b..b570262baec 100644 --- a/src/mame/drivers/asteroid.c +++ b/src/mame/drivers/asteroid.c @@ -263,7 +263,7 @@ static ADDRESS_MAP_START( astdelux_map, AS_PROGRAM, 8, asteroid_state ) 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_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0x2c00, 0x2c0f) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0x2c40, 0x2c7f) AM_DEVREAD("earom", atari_vg_earom_device, read) AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w) AM_RANGE(0x3200, 0x323f) AM_DEVWRITE("earom", atari_vg_earom_device, write) @@ -657,7 +657,7 @@ static MACHINE_CONFIG_DERIVED( astdelux, asteroid ) MCFG_SOUND_CONFIG_DISCRETE(astdelux) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_SOUND_ADD("pokey", POKEY, MASTER_CLOCK/8) + MCFG_SOUND_ADD("pokey", POKEYN, MASTER_CLOCK/8) MCFG_SOUND_CONFIG(pokey_config) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c index 331993de7d9..05706303f9e 100644 --- a/src/mame/drivers/atarisy1.c +++ b/src/mame/drivers/atarisy1.c @@ -504,7 +504,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, atarisy1_state ) AM_RANGE(0x1810, 0x1810) AM_READWRITE_LEGACY(atarigen_6502_sound_r, atarigen_6502_sound_w) AM_RANGE(0x1820, 0x1820) AM_READ(switch_6502_r) AM_RANGE(0x1824, 0x1825) AM_WRITE(led_w) - AM_RANGE(0x1870, 0x187f) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0x1870, 0x187f) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0x4000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -795,7 +795,7 @@ static MACHINE_CONFIG_START( atarisy1, atarisy1_state ) MCFG_SOUND_ROUTE(0, "lspeaker", 0.80) MCFG_SOUND_ROUTE(1, "rspeaker", 0.80) - MCFG_SOUND_ADD("pokey", POKEY, ATARI_CLOCK_14MHz/8) + MCFG_SOUND_ADD("pokey", POKEYN, ATARI_CLOCK_14MHz/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40) diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c index 8ac4ebba715..a6092b1bb2b 100644 --- a/src/mame/drivers/atarisy2.c +++ b/src/mame/drivers/atarisy2.c @@ -818,9 +818,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, atarisy2_state ) AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM AM_RANGE(0x1000, 0x17ff) AM_MIRROR(0x2000) AM_RAM AM_SHARE("eeprom") - AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x2780) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) + AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x2780) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) AM_RANGE(0x1810, 0x1813) AM_MIRROR(0x278c) AM_READ(leta_r) - AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x2780) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x2780) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x1840, 0x1840) AM_MIRROR(0x278f) AM_READ(switch_6502_r) AM_RANGE(0x1850, 0x1851) AM_MIRROR(0x278e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) AM_RANGE(0x1860, 0x1860) AM_MIRROR(0x278f) AM_READ(sound_6502_r) @@ -1276,11 +1276,11 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state ) MCFG_SOUND_ROUTE(0, "lspeaker", 0.60) MCFG_SOUND_ROUTE(1, "rspeaker", 0.60) - MCFG_SOUND_ADD("pokey1", POKEY, SOUND_CLOCK/8) + MCFG_SOUND_ADD("pokey1", POKEYN, SOUND_CLOCK/8) MCFG_SOUND_CONFIG(pokey_interface_1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.35) - MCFG_SOUND_ADD("pokey2", POKEY, SOUND_CLOCK/8) + MCFG_SOUND_ADD("pokey2", POKEYN, SOUND_CLOCK/8) MCFG_SOUND_CONFIG(pokey_interface_2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.35) diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c index ab6087225b4..ed8562902a8 100644 --- a/src/mame/drivers/atetris.c +++ b/src/mame/drivers/atetris.c @@ -203,8 +203,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, atetris_state ) AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_SHARE("videoram") AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram") - AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) - AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) + AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_WRITE(watchdog_reset_w) AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE(nvram_enable_w) AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(irq_ack_w) @@ -358,11 +358,11 @@ static MACHINE_CONFIG_START( atetris, atetris_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/8) + MCFG_SOUND_ADD("pokey1", POKEYN, MASTER_CLOCK/8) MCFG_SOUND_CONFIG(pokey_interface_1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/8) + MCFG_SOUND_ADD("pokey2", POKEYN, MASTER_CLOCK/8) MCFG_SOUND_CONFIG(pokey_interface_2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/bartop52.c b/src/mame/drivers/bartop52.c index c5caed12c2d..76ceaeaaa27 100644 --- a/src/mame/drivers/bartop52.c +++ b/src/mame/drivers/bartop52.c @@ -37,7 +37,7 @@ static ADDRESS_MAP_START(a5200_mem, AS_PROGRAM, 8, bartop52_state ) AM_RANGE(0x4000, 0xbfff) AM_ROM AM_RANGE(0xc000, 0xc0ff) AM_READWRITE_LEGACY(atari_gtia_r, atari_gtia_w) AM_RANGE(0xd400, 0xd5ff) AM_READWRITE_LEGACY(atari_antic_r, atari_antic_w) - AM_RANGE(0xe800, 0xe8ff) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0xe800, 0xe8ff) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0xf800, 0xffff) AM_ROM ADDRESS_MAP_END @@ -137,7 +137,7 @@ static MACHINE_CONFIG_START( a5200, bartop52_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT) + MCFG_SOUND_ADD("pokey", POKEYN, FREQ_17_EXACT) MCFG_SOUND_CONFIG(atari_pokey_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c index fc82de21902..52b17f309b5 100644 --- a/src/mame/drivers/bwidow.c +++ b/src/mame/drivers/bwidow.c @@ -369,8 +369,8 @@ static ADDRESS_MAP_START( bwidow_map, AS_PROGRAM, 8, bwidow_state ) AM_RANGE(0x0000, 0x07ff) AM_RAM AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE_LEGACY(&avgdvg_vectorram) AM_SIZE_LEGACY(&avgdvg_vectorram_size) AM_REGION("maincpu", 0x2000) AM_RANGE(0x2800, 0x5fff) AM_ROM - AM_RANGE(0x6000, 0x67ff) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) - AM_RANGE(0x6800, 0x6fff) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x6000, 0x67ff) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) + AM_RANGE(0x6800, 0x6fff) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x7000, 0x7000) AM_DEVREAD("earom", atari_vg_earom_device, read) AM_RANGE(0x7800, 0x7800) AM_READ_PORT("IN0") AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN3") @@ -399,8 +399,8 @@ static ADDRESS_MAP_START( spacduel_map, AS_PROGRAM, 8, bwidow_state ) AM_RANGE(0x0e00, 0x0e00) AM_WRITE(irq_ack_w) /* interrupt acknowledge */ AM_RANGE(0x0e80, 0x0e80) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w) AM_RANGE(0x0f00, 0x0f3f) AM_DEVWRITE("earom", atari_vg_earom_device, write) - AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) - AM_RANGE(0x1400, 0x140f) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) + AM_RANGE(0x1400, 0x140f) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE_LEGACY(&avgdvg_vectorram) AM_SIZE_LEGACY(&avgdvg_vectorram_size) AM_REGION("maincpu", 0x2000) AM_RANGE(0x2800, 0x3fff) AM_ROM AM_RANGE(0x4000, 0xffff) AM_ROM @@ -744,11 +744,11 @@ static MACHINE_CONFIG_START( bwidow, bwidow_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK / 8) + MCFG_SOUND_ADD("pokey1", POKEYN, MASTER_CLOCK / 8) MCFG_SOUND_CONFIG(pokey_interface_1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK / 8) + MCFG_SOUND_ADD("pokey2", POKEYN, MASTER_CLOCK / 8) MCFG_SOUND_CONFIG(pokey_interface_2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c index 8cbac5cd484..d04fb950d2c 100644 --- a/src/mame/drivers/centiped.c +++ b/src/mame/drivers/centiped.c @@ -692,7 +692,7 @@ static ADDRESS_MAP_START( centiped_map, AS_PROGRAM, 8, centiped_state ) AM_RANGE(0x0c01, 0x0c01) AM_READ_PORT("IN1") /* IN1 */ AM_RANGE(0x0c02, 0x0c02) AM_READ(centiped_IN2_r) /* IN2 */ AM_RANGE(0x0c03, 0x0c03) AM_READ_PORT("IN3") /* IN3 */ - AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0x1400, 0x140f) AM_WRITE(centiped_paletteram_w) AM_SHARE("paletteram") AM_RANGE(0x1600, 0x163f) AM_DEVWRITE("earom",atari_vg_earom_device, write) AM_RANGE(0x1680, 0x1680) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w) @@ -743,8 +743,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( milliped_map, AS_PROGRAM, 8, centiped_state ) ADDRESS_MAP_GLOBAL_MASK(0x7fff) AM_RANGE(0x0000, 0x03ff) AM_RAM - AM_RANGE(0x0400, 0x040f) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) - AM_RANGE(0x0800, 0x080f) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x0400, 0x040f) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) + AM_RANGE(0x0800, 0x080f) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(centiped_videoram_w) AM_SHARE("videoram") AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x2000, 0x2000) AM_READ(centiped_IN0_r) @@ -782,7 +782,7 @@ static ADDRESS_MAP_START( warlords_map, AS_PROGRAM, 8, centiped_state ) AM_RANGE(0x0801, 0x0801) AM_READ_PORT("DSW2") /* DSW2 */ AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("IN0") /* IN0 */ AM_RANGE(0x0c01, 0x0c01) AM_READ_PORT("IN1") /* IN1 */ - AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0x1800, 0x1800) AM_WRITE(irq_ack_w) AM_RANGE(0x1c00, 0x1c02) AM_WRITE(coin_count_w) AM_RANGE(0x1c03, 0x1c06) AM_WRITE(led_w) @@ -801,8 +801,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( mazeinv_map, AS_PROGRAM, 8, centiped_state ) ADDRESS_MAP_GLOBAL_MASK(0x7fff) AM_RANGE(0x0000, 0x03ff) AM_RAM - AM_RANGE(0x0400, 0x040f) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) - AM_RANGE(0x0800, 0x080f) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x0400, 0x040f) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) + AM_RANGE(0x0800, 0x080f) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(centiped_videoram_w) AM_SHARE("videoram") AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x2000, 0x2000) AM_READ_PORT("IN0") @@ -1622,7 +1622,7 @@ static MACHINE_CONFIG_START( centiped, centiped_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey", POKEY, 12096000/8) + MCFG_SOUND_ADD("pokey", POKEYN, 12096000/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -1677,11 +1677,11 @@ static MACHINE_CONFIG_DERIVED( milliped, centiped ) MCFG_SCREEN_UPDATE_STATIC(milliped) /* sound hardware */ - MCFG_SOUND_REPLACE("pokey", POKEY, 12096000/8) + MCFG_SOUND_REPLACE("pokey", POKEYN, 12096000/8) MCFG_SOUND_CONFIG(milliped_pokey_interface_1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_ADD("pokey2", POKEY, 12096000/8) + MCFG_SOUND_ADD("pokey2", POKEYN, 12096000/8) MCFG_SOUND_CONFIG(milliped_pokey_interface_2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END @@ -1703,7 +1703,7 @@ static MACHINE_CONFIG_DERIVED( warlords, centiped ) MCFG_SCREEN_UPDATE_STATIC(warlords) /* sound hardware */ - MCFG_SOUND_REPLACE("pokey", POKEY, 12096000/8) + MCFG_SOUND_REPLACE("pokey", POKEYN, 12096000/8) MCFG_SOUND_CONFIG(warlords_pokey_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/cloak.c b/src/mame/drivers/cloak.c index cbf212c3cff..38334228f74 100644 --- a/src/mame/drivers/cloak.c +++ b/src/mame/drivers/cloak.c @@ -167,8 +167,8 @@ static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, cloak_state ) AM_RANGE(0x0000, 0x03ff) AM_RAM AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(cloak_videoram_w) AM_SHARE("videoram") AM_RANGE(0x0800, 0x0fff) AM_RAM AM_SHARE("share1") - AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) /* DSW0 also */ - AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) /* DSW1 also */ + AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) /* DSW0 also */ + AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) /* DSW1 also */ AM_RANGE(0x2000, 0x2000) AM_READ_PORT("P1") AM_RANGE(0x2200, 0x2200) AM_READ_PORT("P2") AM_RANGE(0x2400, 0x2400) AM_READ_PORT("SYSTEM") @@ -359,11 +359,11 @@ static MACHINE_CONFIG_START( cloak, cloak_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, XTAL_10MHz/8) /* Accurate to recording */ + MCFG_SOUND_ADD("pokey1", POKEYN, XTAL_10MHz/8) /* Accurate to recording */ MCFG_SOUND_CONFIG(pokey_interface_1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_ADD("pokey2", POKEY, XTAL_10MHz/8) /* Accurate to recording */ + MCFG_SOUND_ADD("pokey2", POKEYN, XTAL_10MHz/8) /* Accurate to recording */ MCFG_SOUND_CONFIG(pokey_interface_2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c index 4a929ff3a4e..d2c02b98d09 100644 --- a/src/mame/drivers/cloud9.c +++ b/src/mame/drivers/cloud9.c @@ -280,8 +280,8 @@ static ADDRESS_MAP_START( cloud9_map, AS_PROGRAM, 8, cloud9_state ) AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x007e) AM_READ_PORT("IN0") AM_RANGE(0x5801, 0x5801) AM_MIRROR(0x007e) AM_READ_PORT("IN1") AM_RANGE(0x5900, 0x5903) AM_MIRROR(0x007c) AM_READ(leta_r) - AM_RANGE(0x5a00, 0x5a0f) AM_MIRROR(0x00f0) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) - AM_RANGE(0x5b00, 0x5b0f) AM_MIRROR(0x00f0) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) + AM_RANGE(0x5a00, 0x5a0f) AM_MIRROR(0x00f0) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) + AM_RANGE(0x5b00, 0x5b0f) AM_MIRROR(0x00f0) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) AM_RANGE(0x5c00, 0x5cff) AM_MIRROR(0x0300) AM_DEVREADWRITE("nvram", x2212_device, read, write) AM_RANGE(0x6000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -447,10 +447,10 @@ static MACHINE_CONFIG_START( cloud9, cloud9_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/8) + MCFG_SOUND_ADD("pokey1", POKEYN, MASTER_CLOCK/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/8) + MCFG_SOUND_ADD("pokey2", POKEYN, MASTER_CLOCK/8) MCFG_SOUND_CONFIG(pokey_config) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c index 8c9bcaf11cf..1ee93bd1cc5 100644 --- a/src/mame/drivers/firefox.c +++ b/src/mame/drivers/firefox.c @@ -550,10 +550,10 @@ static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, firefox_state ) AM_RANGE(0x0880, 0x089f) AM_MIRROR(0x07e0) AM_DEVREADWRITE_LEGACY("riot",riot6532_r, riot6532_w) AM_RANGE(0x1000, 0x1000) AM_READ(main_to_sound_r) AM_RANGE(0x1800, 0x1800) AM_WRITE(sound_to_main_w) - AM_RANGE(0x2000, 0x200f) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) - AM_RANGE(0x2800, 0x280f) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) - AM_RANGE(0x3000, 0x300f) AM_DEVREADWRITE_LEGACY("pokey3", pokey_r, pokey_w) - AM_RANGE(0x3800, 0x380f) AM_DEVREADWRITE_LEGACY("pokey4", pokey_r, pokey_w) + AM_RANGE(0x2000, 0x200f) AM_DEVREADWRITE("pokey1", pokeyn_device, read, write) + AM_RANGE(0x2800, 0x280f) AM_DEVREADWRITE("pokey2", pokeyn_device, read, write) + AM_RANGE(0x3000, 0x300f) AM_DEVREADWRITE("pokey3", pokeyn_device, read, write) + AM_RANGE(0x3800, 0x380f) AM_DEVREADWRITE("pokey4", pokeyn_device, read, write) AM_RANGE(0x8000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -727,19 +727,19 @@ static MACHINE_CONFIG_START( firefox, firefox_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_ADD("pokey1", POKEY, MASTER_XTAL/8) + MCFG_SOUND_ADD("pokey1", POKEYN, MASTER_XTAL/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) - MCFG_SOUND_ADD("pokey2", POKEY, MASTER_XTAL/8) + MCFG_SOUND_ADD("pokey2", POKEYN, MASTER_XTAL/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) - MCFG_SOUND_ADD("pokey3", POKEY, MASTER_XTAL/8) + MCFG_SOUND_ADD("pokey3", POKEYN, MASTER_XTAL/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) - MCFG_SOUND_ADD("pokey4", POKEY, MASTER_XTAL/8) + MCFG_SOUND_ADD("pokey4", POKEYN, MASTER_XTAL/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c index 187f7bba387..c0dae4da925 100644 --- a/src/mame/drivers/foodf.c +++ b/src/mame/drivers/foodf.c @@ -221,9 +221,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, foodf_state ) AM_RANGE(0x950000, 0x9501ff) AM_MIRROR(0x023e00) AM_WRITE(foodf_paletteram_w) AM_SHARE("paletteram") AM_RANGE(0x954000, 0x954001) AM_MIRROR(0x023ffe) AM_WRITE(nvram_recall_w) AM_RANGE(0x958000, 0x958001) AM_MIRROR(0x023ffe) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) - AM_RANGE(0xa40000, 0xa4001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8_LEGACY("pokey2", pokey_r, pokey_w, 0x00ff) - AM_RANGE(0xa80000, 0xa8001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8_LEGACY("pokey1", pokey_r, pokey_w, 0x00ff) - AM_RANGE(0xac0000, 0xac001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8_LEGACY("pokey3", pokey_r, pokey_w, 0x00ff) + AM_RANGE(0xa40000, 0xa4001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8("pokey2", pokeyn_device, read, write, 0x00ff) + AM_RANGE(0xa80000, 0xa8001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8("pokey1", pokeyn_device, read, write, 0x00ff) + AM_RANGE(0xac0000, 0xac001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8("pokey3", pokeyn_device, read, write, 0x00ff) ADDRESS_MAP_END @@ -380,14 +380,14 @@ static MACHINE_CONFIG_START( foodf, foodf_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK/2/10) + MCFG_SOUND_ADD("pokey1", POKEYN, MASTER_CLOCK/2/10) MCFG_SOUND_CONFIG(pokey_config) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK/2/10) + MCFG_SOUND_ADD("pokey2", POKEYN, MASTER_CLOCK/2/10) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - MCFG_SOUND_ADD("pokey3", POKEY, MASTER_CLOCK/2/10) + MCFG_SOUND_ADD("pokey3", POKEYN, MASTER_CLOCK/2/10) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) MACHINE_CONFIG_END diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c index 9ebf2acb90a..1121dd249fb 100644 --- a/src/mame/drivers/gauntlet.c +++ b/src/mame/drivers/gauntlet.c @@ -348,7 +348,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gauntlet_state ) AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ_LEGACY(atarigen_6502_sound_r) AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w) AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w) - AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) AM_RANGE(0x1820, 0x182f) AM_MIRROR(0x27c0) AM_DEVWRITE_LEGACY("tms", tms5220_data_w) AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w) @@ -545,7 +545,7 @@ static MACHINE_CONFIG_START( gauntlet, gauntlet_state ) MCFG_SOUND_ROUTE(1, "lspeaker", 0.48) MCFG_SOUND_ROUTE(0, "rspeaker", 0.48) - MCFG_SOUND_ADD("pokey", POKEY, ATARI_CLOCK_14MHz/8) + MCFG_SOUND_ADD("pokey", POKEYN, ATARI_CLOCK_14MHz/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.32) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.32) diff --git a/src/mame/drivers/irobot.c b/src/mame/drivers/irobot.c index b504b1ec14b..7271e3ccf03 100644 --- a/src/mame/drivers/irobot.c +++ b/src/mame/drivers/irobot.c @@ -137,7 +137,7 @@ static ADDRESS_MAP_START( irobot_map, AS_PROGRAM, 8, irobot_state ) AM_RANGE(0x11c0, 0x11c0) AM_WRITE(irobot_rom_banksel_w) AM_RANGE(0x1200, 0x12ff) AM_RAM_WRITE(irobot_nvram_w) AM_SHARE("nvram") AM_RANGE(0x1300, 0x13ff) AM_READ(irobot_control_r) - AM_RANGE(0x1400, 0x143f) AM_READWRITE_LEGACY(quad_pokey_r, quad_pokey_w) + AM_RANGE(0x1400, 0x143f) AM_READWRITE_LEGACY(quad_pokeyn_r, quad_pokeyn_w) AM_RANGE(0x1800, 0x18ff) AM_WRITE(irobot_paletteram_w) AM_RANGE(0x1900, 0x19ff) AM_WRITEONLY /* Watchdog reset */ AM_RANGE(0x1a00, 0x1a00) AM_WRITE(irobot_clearfirq_w) @@ -317,17 +317,17 @@ static MACHINE_CONFIG_START( irobot, irobot_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MAIN_CLOCK/8) + MCFG_SOUND_ADD("pokey1", POKEYN, MAIN_CLOCK/8) MCFG_SOUND_CONFIG(pokey_config) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("pokey2", POKEY, MAIN_CLOCK/8) + MCFG_SOUND_ADD("pokey2", POKEYN, MAIN_CLOCK/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("pokey3", POKEY, MAIN_CLOCK/8) + MCFG_SOUND_ADD("pokey3", POKEYN, MAIN_CLOCK/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("pokey4", POKEY, MAIN_CLOCK/8) + MCFG_SOUND_ADD("pokey4", POKEYN, MAIN_CLOCK/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c index 1b9bd6a8588..19a6de326ab 100644 --- a/src/mame/drivers/maxaflex.c +++ b/src/mame/drivers/maxaflex.c @@ -275,7 +275,7 @@ static ADDRESS_MAP_START(a600xl_mem, AS_PROGRAM, 8, maxaflex_state ) AM_RANGE(0xc000, 0xcfff) AM_ROM /* OS */ AM_RANGE(0xd000, 0xd0ff) AM_READWRITE_LEGACY(atari_gtia_r, atari_gtia_w) AM_RANGE(0xd100, 0xd1ff) AM_NOP - AM_RANGE(0xd200, 0xd2ff) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) + AM_RANGE(0xd200, 0xd2ff) AM_DEVREADWRITE("pokey", pokeyn_device, read, write) AM_RANGE(0xd300, 0xd3ff) AM_DEVREADWRITE("pia", pia6821_device, read_alt, write_alt) AM_RANGE(0xd400, 0xd4ff) AM_READWRITE_LEGACY(atari_antic_r, atari_antic_w) AM_RANGE(0xd500, 0xd7ff) AM_NOP @@ -427,7 +427,7 @@ static MACHINE_CONFIG_START( a600xl, maxaflex_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT) + MCFG_SOUND_ADD("pokey", POKEYN, FREQ_17_EXACT) MCFG_SOUND_CONFIG(pokey_config) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c index 1662a16c838..b9b6ef89702 100644 --- a/src/mame/drivers/mhavoc.c +++ b/src/mame/drivers/mhavoc.c @@ -206,9 +206,9 @@ READ8_MEMBER(mhavoc_state::dual_pokey_r) int pokey_reg = (offset % 8) | control; if (pokey_num == 0) - return pokey_r(machine().device("pokey1"), pokey_reg); + return machine().device("pokey1")->read(pokey_reg); else - return pokey_r(machine().device("pokey2"), pokey_reg); + return machine().device("pokey2")->read(pokey_reg); } @@ -219,9 +219,9 @@ WRITE8_MEMBER(mhavoc_state::dual_pokey_w) int pokey_reg = (offset % 8) | control; if (pokey_num == 0) - pokey_w(machine().device("pokey1"), pokey_reg, data); + machine().device("pokey1")->write(pokey_reg, data); else - pokey_w(machine().device("pokey2"), pokey_reg, data); + machine().device("pokey2")->write(pokey_reg, data); } @@ -265,7 +265,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( gamma_map, AS_PROGRAM, 8, mhavoc_state ) AM_RANGE(0x0000, 0x07ff) AM_RAM /* Program RAM (2K) */ AM_RANGE(0x0800, 0x0fff) AM_RAM AM_MIRROR (0x1800) - AM_RANGE(0x2000, 0x203f) AM_READWRITE_LEGACY(quad_pokey_r, quad_pokey_w) /* Quad Pokey read */ + AM_RANGE(0x2000, 0x203f) AM_READWRITE_LEGACY(quad_pokeyn_r, quad_pokeyn_w) /* Quad Pokey read */ AM_RANGE(0x2800, 0x2800) AM_READ_PORT("IN1") /* Gamma Input Port */ AM_RANGE(0x3000, 0x3000) AM_READ(mhavoc_alpha_r) /* Alpha Comm. Read Port*/ AM_RANGE(0x3800, 0x3803) AM_READ_PORT("DIAL") /* Roller Controller Input*/ @@ -499,17 +499,17 @@ static MACHINE_CONFIG_START( mhavoc, mhavoc_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MHAVOC_CLOCK_1_25M) + MCFG_SOUND_ADD("pokey1", POKEYN, MHAVOC_CLOCK_1_25M) MCFG_SOUND_CONFIG(pokey_config) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("pokey2", POKEY, MHAVOC_CLOCK_1_25M) + MCFG_SOUND_ADD("pokey2", POKEYN, MHAVOC_CLOCK_1_25M) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("pokey3", POKEY, MHAVOC_CLOCK_1_25M) + MCFG_SOUND_ADD("pokey3", POKEYN, MHAVOC_CLOCK_1_25M) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("pokey4", POKEY, MHAVOC_CLOCK_1_25M) + MCFG_SOUND_ADD("pokey4", POKEYN, MHAVOC_CLOCK_1_25M) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END @@ -532,10 +532,10 @@ static MACHINE_CONFIG_DERIVED( alphaone, mhavoc ) MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 500) /* sound hardware */ - MCFG_SOUND_REPLACE("pokey1", POKEY, MHAVOC_CLOCK_1_25M) + MCFG_SOUND_REPLACE("pokey1", POKEYN, MHAVOC_CLOCK_1_25M) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_REPLACE("pokey2", POKEY, MHAVOC_CLOCK_1_25M) + MCFG_SOUND_REPLACE("pokey2", POKEYN, MHAVOC_CLOCK_1_25M) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_DEVICE_REMOVE("pokey3") diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c index 0d929de0111..bb6a4158c53 100644 --- a/src/mame/drivers/starwars.c +++ b/src/mame/drivers/starwars.c @@ -193,7 +193,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, starwars_state ) AM_RANGE(0x0800, 0x0fff) AM_READ(starwars_sin_r) /* SIN Read */ AM_RANGE(0x1000, 0x107f) AM_RAM /* 6532 ram */ AM_RANGE(0x1080, 0x109f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) - AM_RANGE(0x1800, 0x183f) AM_WRITE_LEGACY(quad_pokey_w) + AM_RANGE(0x1800, 0x183f) AM_WRITE_LEGACY(quad_pokeyn_w) AM_RANGE(0x2000, 0x27ff) AM_RAM /* program RAM */ AM_RANGE(0x4000, 0x7fff) AM_ROM /* sound roms */ AM_RANGE(0xb000, 0xffff) AM_ROM /* more sound roms */ @@ -344,16 +344,16 @@ static MACHINE_CONFIG_START( starwars, starwars_state ) MCFG_SOUND_START(starwars) MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK / 8) + MCFG_SOUND_ADD("pokey1", POKEYN, MASTER_CLOCK / 8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) - MCFG_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK / 8) + MCFG_SOUND_ADD("pokey2", POKEYN, MASTER_CLOCK / 8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) - MCFG_SOUND_ADD("pokey3", POKEY, MASTER_CLOCK / 8) + MCFG_SOUND_ADD("pokey3", POKEYN, MASTER_CLOCK / 8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) - MCFG_SOUND_ADD("pokey4", POKEY, MASTER_CLOCK / 8) + MCFG_SOUND_ADD("pokey4", POKEYN, MASTER_CLOCK / 8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) MCFG_SOUND_ADD("tms", TMS5220, MASTER_CLOCK/2/9) diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c index 654e0d23c2d..52b8fd561a6 100644 --- a/src/mame/machine/atari.c +++ b/src/mame/machine/atari.c @@ -159,7 +159,7 @@ static int atari_last; void a800_handle_keyboard(running_machine &machine) { - device_t *pokey = machine.device("pokey"); + pokeyn_device *pokey = machine.device("pokey"); int atari_code, count, ipt, i; static const char *const tag[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", @@ -198,18 +198,18 @@ void a800_handle_keyboard(running_machine &machine) if( (atari_code & 0x3f) == AKEY_BREAK ) { - pokey_break_w(pokey, atari_code & 0x40); + pokey->break_w(atari_code & 0x40); return; } - pokey_kbcode_w(pokey, atari_code, 1); + pokey->kbcode_w(atari_code, 1); return; } } } /* remove key pressed status bit from skstat */ - pokey_kbcode_w(pokey, AKEY_NONE, 0); + pokey->kbcode_w(AKEY_NONE, 0); atari_last = AKEY_NONE; } @@ -244,7 +244,7 @@ void a800_handle_keyboard(running_machine &machine) void a5200_handle_keypads(running_machine &machine) { - device_t *pokey = machine.device("pokey"); + pokeyn_device *pokey = downcast(machine.device("pokey")); int atari_code, count, ipt, i; static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" }; @@ -270,11 +270,11 @@ void a5200_handle_keypads(running_machine &machine) if( atari_code == 0 ) { - pokey_break_w(pokey, atari_code & 0x40); + pokey->break_w(atari_code & 0x40); return; } - pokey_kbcode_w(pokey, (atari_code << 1) | 0x21, 1); + pokey->kbcode_w((atari_code << 1) | 0x21, 1); return; } @@ -285,16 +285,16 @@ void a5200_handle_keypads(running_machine &machine) { if (atari_last == 0xfe) return; - pokey_kbcode_w(pokey, 0x61, 1); + pokey->kbcode_w(0x61, 1); //pokey_break_w(pokey, 0x40); atari_last = 0xfe; return; } else if (atari_last == 0xfe) - pokey_kbcode_w(pokey, 0x21, 1); + pokey->kbcode_w(0x21, 1); /* remove key pressed status bit from skstat */ - pokey_kbcode_w(pokey, 0xff, 0); + pokey->kbcode_w(0xff, 0); atari_last = 0xff; } @@ -308,8 +308,8 @@ void a5200_handle_keypads(running_machine &machine) static void pokey_reset(running_machine &machine) { - device_t *pokey = machine.device("pokey"); - pokey_w(pokey,15,0); + pokeyn_device *pokey = downcast(machine.device("pokey")); + pokey->write(15,0); atari_last = 0xff; } diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index e10a1a8f366..da42b666f05 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -863,7 +863,7 @@ void atarigen_set_ym2413_vol(running_machine &machine, int volume) void atarigen_set_pokey_vol(running_machine &machine, int volume) { - atarigen_set_vol(machine, volume, POKEY); + atarigen_set_vol(machine, volume, POKEYN); } void atarigen_set_tms5220_vol(running_machine &machine, int volume)