diff options
author | 2014-05-06 17:37:43 +0000 | |
---|---|---|
committer | 2014-05-06 17:37:43 +0000 | |
commit | da1252459f7578b481e8be16cc701c185e44fc73 (patch) | |
tree | 3c83f920691467be40ee9a63801dd1ab6a4224d4 /src/mess/drivers | |
parent | c407543c9f5ff650f92ab736c0018f2185db7b21 (diff) |
ay8910_device and extended family: converted to devcb2 (nw)
This is easily the commit I ever did that touches the most drivers. I payed extra attention while doing it, stared at the diff really hard to find any errors and did some testing. Obviously I can't test every single game / system, so please report any regression you might find.
Diffstat (limited to 'src/mess/drivers')
38 files changed, 110 insertions, 483 deletions
diff --git a/src/mess/drivers/ace.c b/src/mess/drivers/ace.c index 12eb777e6ad..226417c2fbe 100644 --- a/src/mess/drivers/ace.c +++ b/src/mess/drivers/ace.c @@ -531,21 +531,6 @@ UINT32 ace_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con //************************************************************************** //------------------------------------------------- -// ay8910_interface psg_intf -//------------------------------------------------- - -static const ay8910_interface psg_intf = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - - -//------------------------------------------------- // I8255A interface //------------------------------------------------- @@ -704,7 +689,6 @@ static MACHINE_CONFIG_START( ace, ace_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_ADD(AY8910_TAG, AY8910, XTAL_6_5MHz/2) - MCFG_SOUND_CONFIG(psg_intf) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD(SP0256AL2_TAG, SP0256, XTAL_3MHz) diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c index 149f4808a1f..64e8bcaa124 100644 --- a/src/mess/drivers/amstrad.c +++ b/src/mess/drivers/amstrad.c @@ -745,19 +745,6 @@ static INPUT_PORTS_START( aleste ) INPUT_PORTS_END -/* -------------------- - - ay8910_interface - - --------------------*/ -static const ay8910_interface ay8912_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(amstrad_state, amstrad_psg_porta_read), /* portA read */ - DEVCB_DRIVER_MEMBER(amstrad_state, amstrad_psg_porta_read), /* portB read */ - DEVCB_NULL, /* portA write */ - DEVCB_NULL /* portB write */ -}; - #if 0 static const gfx_layout asic_sprite_layout = @@ -880,7 +867,8 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay", AY8912, XTAL_16MHz / 16) - MCFG_SOUND_CONFIG(ay8912_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portA read */ + MCFG_AY8910_PORT_B_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portB read */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ @@ -975,7 +963,8 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay", AY8912, XTAL_40MHz / 40) - MCFG_SOUND_CONFIG(ay8912_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portA read */ + MCFG_AY8910_PORT_B_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portB read */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ @@ -1051,7 +1040,8 @@ static MACHINE_CONFIG_START( gx4000, amstrad_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay", AY8912, XTAL_40MHz / 40) - MCFG_SOUND_CONFIG(ay8912_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portA read */ + MCFG_AY8910_PORT_B_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portB read */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_FRAGMENT_ADD(cpcplus_cartslot) @@ -1067,7 +1057,8 @@ static MACHINE_CONFIG_DERIVED( aleste, amstrad ) MCFG_MACHINE_RESET_OVERRIDE(amstrad_state,aleste) MCFG_SOUND_REPLACE("ay", AY8912, XTAL_16MHz / 16) - MCFG_SOUND_CONFIG(ay8912_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portA read */ + MCFG_AY8910_PORT_B_READ_CB(READ8(amstrad_state, amstrad_psg_porta_read)) /* portB read */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_PALETTE_MODIFY("palette") diff --git a/src/mess/drivers/aquarius.c b/src/mess/drivers/aquarius.c index c5e1472404c..358337ac8ad 100644 --- a/src/mess/drivers/aquarius.c +++ b/src/mess/drivers/aquarius.c @@ -337,16 +337,6 @@ GFXDECODE_END MACHINE DRIVERS ***************************************************************************/ -static const ay8910_interface aquarius_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_INPUT_PORT("RIGHT"), - DEVCB_INPUT_PORT("LEFT"), - DEVCB_NULL, - DEVCB_NULL -}; - static MACHINE_CONFIG_START( aquarius, aquarius_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz) // ??? @@ -374,7 +364,8 @@ static MACHINE_CONFIG_START( aquarius, aquarius_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, XTAL_3_579545MHz/2) // ??? AY-3-8914 - MCFG_SOUND_CONFIG(aquarius_ay8910_interface) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("RIGHT")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("LEFT")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* cassette */ diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c index 698e6aaf156..8cf77636b80 100644 --- a/src/mess/drivers/atarist.c +++ b/src/mess/drivers/atarist.c @@ -1764,17 +1764,6 @@ WRITE8_MEMBER( st_state::psg_pa_w ) m_centronics->write_strobe(BIT(data, 5)); } -static const ay8910_interface psg_intf = -{ - AY8910_SINGLE_OUTPUT, - { RES_K(1) }, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(st_state, psg_pa_w), - DEVCB_DEVICE_MEMBER("cent_data_out", output_latch_device, write), -}; - - //------------------------------------------------- // ay8910_interface stbook_psg_intf //------------------------------------------------- @@ -1822,19 +1811,6 @@ WRITE8_MEMBER( stbook_state::psg_pa_w ) m_fdc->dden_w(BIT(data, 7)); } -#if 0 -static const ay8910_interface stbook_psg_intf = -{ - AY8910_SINGLE_OUTPUT, - { RES_K(1) }, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(stbook_state, psg_pa_w), - DEVCB_DEVICE_MEMBER("cent_data_out", output_latch_device, write), -}; -#endif - - WRITE_LINE_MEMBER( st_state::ikbd_tx_w ) { m_ikbd_tx = state; @@ -2107,7 +2083,10 @@ static MACHINE_CONFIG_START( st, st_state ) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(YM2149_TAG, YM2149, Y2/16) - MCFG_SOUND_CONFIG(psg_intf) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_RES_LOADS(RES_K(1), 0, 0) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(st_state, psg_pa_w)) + MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) // devices @@ -2194,7 +2173,10 @@ static MACHINE_CONFIG_START( megast, megast_state ) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(YM2149_TAG, YM2149, Y2/16) - MCFG_SOUND_CONFIG(psg_intf) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_RES_LOADS(RES_K(1), 0, 0) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(st_state, psg_pa_w)) + MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) // devices @@ -2283,7 +2265,10 @@ static MACHINE_CONFIG_START( ste, ste_state ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_SOUND_ADD(YM2149_TAG, YM2149, Y2/16) - MCFG_SOUND_CONFIG(psg_intf) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_RES_LOADS(RES_K(1), 0, 0) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(st_state, psg_pa_w)) + MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) MCFG_SOUND_ROUTE(0, "rspeaker", 0.50) /* @@ -2394,7 +2379,10 @@ static MACHINE_CONFIG_START( stbook, stbook_state ) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(YM3439_TAG, YM3439, U517/8) - MCFG_SOUND_CONFIG(stbook_psg_intf) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_RES_LOADS(RES_K(1), 0, 0) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(stbook_state, psg_pa_w)) + MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_DEVICE_ADD(MC68901_TAG, MC68901, U517/8) diff --git a/src/mess/drivers/attache.c b/src/mess/drivers/attache.c index 5c1dfd3039f..c64b7905e06 100644 --- a/src/mess/drivers/attache.c +++ b/src/mess/drivers/attache.c @@ -861,16 +861,6 @@ static INPUT_PORTS_START(attache) INPUT_PORTS_END -static const ay8910_interface ay8912_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, /* portA write */ - DEVCB_NULL /* portB write */ -}; - // IRQ daisy chain = CTC -> SIO -> Expansion static const z80_daisy_config attache_daisy_chain[] = { @@ -952,7 +942,6 @@ static MACHINE_CONFIG_START( attache, attache_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("psg", AY8912, XTAL_8MHz / 4) - MCFG_SOUND_CONFIG(ay8912_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_MSM5832_ADD("rtc",XTAL_32_768kHz) diff --git a/src/mess/drivers/cgc7900.c b/src/mess/drivers/cgc7900.c index 550ceb4d4d5..ed30f5ac999 100644 --- a/src/mess/drivers/cgc7900.c +++ b/src/mess/drivers/cgc7900.c @@ -337,23 +337,6 @@ static INPUT_PORTS_START( cgc7900 ) PORT_BIT( 0x1ff, 0x0c0, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0, 383) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) INPUT_PORTS_END -/*************************************************************************** - DEVICE CONFIGURATION -***************************************************************************/ - -/*------------------------------------------------- - ay8910_interface ay8910_intf --------------------------------------------------*/ - -static const ay8910_interface ay8910_intf = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; /*************************************************************************** MACHINE INITIALIZATION @@ -400,7 +383,6 @@ static MACHINE_CONFIG_START( cgc7900, cgc7900_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(AY8910_TAG, AY8910, XTAL_28_48MHz/16) - MCFG_SOUND_CONFIG(ay8910_intf) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* devices */ diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c index 28c10c3279b..1d2db709a95 100644 --- a/src/mess/drivers/cgenie.c +++ b/src/mess/drivers/cgenie.c @@ -471,17 +471,6 @@ PALETTE_INIT_MEMBER(cgenie_state,cgenienz) palette.set_pen_indirect(i, cgenie_palette[i]); } -static const ay8910_interface cgenie_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(cgenie_state, cgenie_psg_port_a_r), - DEVCB_DRIVER_MEMBER(cgenie_state, cgenie_psg_port_b_r), - DEVCB_DRIVER_MEMBER(cgenie_state, cgenie_psg_port_a_w), - DEVCB_DRIVER_MEMBER(cgenie_state, cgenie_psg_port_b_w) -}; - - // This is currently broken static LEGACY_FLOPPY_OPTIONS_START(cgenie ) LEGACY_FLOPPY_OPTION( cgd, "cgd", "Colour Genie disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, @@ -529,7 +518,10 @@ static MACHINE_CONFIG_START( cgenie_common, cgenie_state ) MCFG_SOUND_ADD("dac", DAC, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, XTAL_17_73447MHz/8) - MCFG_SOUND_CONFIG(cgenie_ay8910_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(cgenie_state, cgenie_psg_port_a_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(cgenie_state, cgenie_psg_port_b_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(cgenie_state, cgenie_psg_port_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(cgenie_state, cgenie_psg_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mess/drivers/dragon.c b/src/mess/drivers/dragon.c index 1011f5c3fa1..c41f1bbcc94 100644 --- a/src/mess/drivers/dragon.c +++ b/src/mess/drivers/dragon.c @@ -225,7 +225,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( dgnalpha, dragon_base, dragon_alpha_state ) // sound hardware MCFG_SOUND_ADD(AY8912_TAG, AY8912, 1000000) - MCFG_SOUND_CONFIG(dragon_alpha_state::ay8912_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(dragon_alpha_state, psg_porta_read)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(dragon_alpha_state, psg_porta_write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) // pia 2 diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c index 06067b70a53..a645fdb9a16 100644 --- a/src/mess/drivers/einstein.c +++ b/src/mess/drivers/einstein.c @@ -665,16 +665,6 @@ INPUT_PORTS_END MACHINE DRIVERS ***************************************************************************/ -static const ay8910_interface einstein_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(einstein_state, einstein_keyboard_data_read), - DEVCB_DRIVER_MEMBER(einstein_state, einstein_keyboard_line_write), - DEVCB_NULL -}; - /* F4 Character Displayer */ static const gfx_layout einstei2_charlayout = { @@ -736,7 +726,8 @@ static MACHINE_CONFIG_START( einstein, einstein_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(IC_I030, AY8910, XTAL_X002 / 4) - MCFG_SOUND_CONFIG(einstein_ay_interface) + MCFG_AY8910_PORT_B_READ_CB(READ8(einstein_state, einstein_keyboard_data_read)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(einstein_state, einstein_keyboard_line_write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) /* printer */ diff --git a/src/mess/drivers/fc100.c b/src/mess/drivers/fc100.c index eff0fe9ad0e..18eb722bb16 100644 --- a/src/mess/drivers/fc100.c +++ b/src/mess/drivers/fc100.c @@ -334,16 +334,6 @@ WRITE8_MEMBER( fc100_state::ay_port_a_w ) } #endif -static const ay8910_interface ay8910_intf = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_INPUT_PORT("JOY0"), - DEVCB_INPUT_PORT("JOY1"), - DEVCB_NULL,//DEVCB_DRIVER_MEMBER(fc100_state, ay_port_a_w), - DEVCB_NULL,//DEVCB_DRIVER_MEMBER(fc100_state, ay_port_b_w) -}; - //******************** VIDEO ********************************** READ8_MEMBER( fc100_state::mc6847_videoram_r ) @@ -547,7 +537,10 @@ static MACHINE_CONFIG_START( fc100, fc100_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("psg", AY8910, XTAL_7_15909MHz/3/2) /* AY-3-8910 - clock not verified */ - MCFG_SOUND_CONFIG(ay8910_intf) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY0")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("JOY1")) + //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fc100_state, ay_port_a_w)) + //MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(fc100_state, ay_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50) /* Devices */ diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c index 6684ae14773..c07394a4cbc 100644 --- a/src/mess/drivers/fm7.c +++ b/src/mess/drivers/fm7.c @@ -1971,26 +1971,6 @@ static const wd17xx_interface fm7_mb8877a_interface = {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; -static const ay8910_interface fm7_psg_intf = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, /* portA read */ - DEVCB_NULL, /* portB read */ - DEVCB_NULL, /* portA write */ - DEVCB_NULL /* portB write */ -}; - -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(fm7_state,fm77av_joy_1_r), - DEVCB_DRIVER_MEMBER(fm7_state,fm77av_joy_2_r), - DEVCB_NULL, /* portA write */ - DEVCB_NULL /* portB write */ -}; - static const floppy_interface fm7_floppy_interface = { FLOPPY_STANDARD_5_25_DSHD, @@ -2012,7 +1992,6 @@ static MACHINE_CONFIG_START( fm7, fm7_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("psg", AY8910, XTAL_4_9152MHz / 4) - MCFG_SOUND_CONFIG(fm7_psg_intf) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 1.00) MCFG_SOUND_ADD("beeper", BEEP, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.50) @@ -2121,7 +2100,8 @@ static MACHINE_CONFIG_START( fm77av, fm7_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ym", YM2203, XTAL_4_9152MHz / 4) MCFG_YM2203_IRQ_HANDLER(WRITELINE(fm7_state, fm77av_fmirq)) - MCFG_YM2203_AY8910_INTF(&ay8910_config) + MCFG_AY8910_PORT_A_READ_CB(READ8(fm7_state, fm77av_joy_1_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(fm7_state, fm77av_joy_2_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",1.0) MCFG_SOUND_ADD("beeper", BEEP, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) diff --git a/src/mess/drivers/galaxy.c b/src/mess/drivers/galaxy.c index 095aa88f956..c6f6c168a35 100644 --- a/src/mess/drivers/galaxy.c +++ b/src/mess/drivers/galaxy.c @@ -144,13 +144,6 @@ static INPUT_PORTS_START( galaxyp ) PORT_INCLUDE( galaxy_common ) INPUT_PORTS_END -static const ay8910_interface galaxy_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL -}; - #define XTAL 6144000 /* F4 Character Displayer */ @@ -242,7 +235,6 @@ static MACHINE_CONFIG_START( galaxyp, galaxy_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8910", AY8910, XTAL/4) - MCFG_SOUND_CONFIG(galaxy_ay_interface) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mess/drivers/intv.c b/src/mess/drivers/intv.c index 13f87f9d723..0e62702dc71 100644 --- a/src/mess/drivers/intv.c +++ b/src/mess/drivers/intv.c @@ -117,26 +117,6 @@ PALETTE_INIT_MEMBER(intv_state, intv) } } -static const ay8910_interface intv_ay8914_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(intv_state, intv_right_control_r), - DEVCB_DRIVER_MEMBER(intv_state, intv_left_control_r), - DEVCB_NULL, - DEVCB_NULL -}; - -static const ay8910_interface intv_ay8914_ecs_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(intv_state, intv_ecs_porta_r), - DEVCB_DRIVER_MEMBER(intv_state, intv_ecs_portb_r), - DEVCB_DRIVER_MEMBER(intv_state, intv_ecs_porta_w), - DEVCB_NULL -}; - /* graphics output */ static const gfx_layout intvkbd_charlayout = @@ -814,7 +794,8 @@ static MACHINE_CONFIG_START( intv, intv_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8914.1", AY8914, XTAL_3_579545MHz/2) - MCFG_SOUND_CONFIG(intv_ay8914_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(intv_state, intv_right_control_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(intv_state, intv_left_control_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) MCFG_SOUND_ADD("sp0256_speech", SP0256, 3120000) @@ -841,7 +822,9 @@ static MACHINE_CONFIG_DERIVED( intvecs, intv ) MCFG_SOFTWARE_LIST_ADD("cart_list_ecs","intvecs") MCFG_SOUND_ADD("ay8914.2", AY8914, XTAL_3_579545MHz/2) - MCFG_SOUND_CONFIG(intv_ay8914_ecs_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(intv_state, intv_ecs_porta_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(intv_state, intv_ecs_portb_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(intv_state, intv_ecs_porta_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) /* cassette */ diff --git a/src/mess/drivers/lola8a.c b/src/mess/drivers/lola8a.c index ae3417b45e5..80170fbf2ac 100644 --- a/src/mess/drivers/lola8a.c +++ b/src/mess/drivers/lola8a.c @@ -257,16 +257,6 @@ WRITE_LINE_MEMBER(lola8a_state::crtc_vsync) m_maincpu->set_input_line(I8085_RST75_LINE, state? ASSERT_LINE : CLEAR_LINE); } -static const ay8910_interface psg_intf = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(lola8a_state, lola8a_port_a_r), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(lola8a_state, lola8a_port_b_w) -}; - static MACHINE_CONFIG_START( lola8a, lola8a_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", I8085A, XTAL_4_9152MHz) @@ -277,7 +267,8 @@ static MACHINE_CONFIG_START( lola8a, lola8a_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(AY8910_TAG, AY8910, XTAL_4_9152MHz / 4) - MCFG_SOUND_CONFIG(psg_intf) + MCFG_AY8910_PORT_A_READ_CB(READ8(lola8a_state, lola8a_port_a_r)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(lola8a_state, lola8a_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",1.0) /* video hardware */ diff --git a/src/mess/drivers/mc1000.c b/src/mess/drivers/mc1000.c index a4e0efc0b56..e386d570c3e 100644 --- a/src/mess/drivers/mc1000.c +++ b/src/mess/drivers/mc1000.c @@ -316,16 +316,6 @@ READ8_MEMBER( mc1000_state::keydata_r ) return data; } -static const ay8910_interface ay8910_intf = -{ - AY8910_SINGLE_OUTPUT, - { RES_K(2.2), 0, 0 }, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(mc1000_state, keydata_r), - DEVCB_DRIVER_MEMBER(mc1000_state, keylatch_w), - DEVCB_NULL -}; - /* Machine Initialization */ void mc1000_state::machine_start() @@ -454,7 +444,10 @@ static MACHINE_CONFIG_START( mc1000, mc1000_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(AY8910_TAG, AY8910, 3579545/2) - MCFG_SOUND_CONFIG(ay8910_intf) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_RES_LOADS(RES_K(2.2), 0, 0) + MCFG_AY8910_PORT_B_READ_CB(READ8(mc1000_state, keydata_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(mc1000_state, keylatch_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* devices */ diff --git a/src/mess/drivers/microtan.c b/src/mess/drivers/microtan.c index 1b7128c9bfa..327b6710b64 100644 --- a/src/mess/drivers/microtan.c +++ b/src/mess/drivers/microtan.c @@ -204,15 +204,6 @@ static GFXDECODE_START( microtan ) GFXDECODE_ENTRY( "gfx2", 0, chunky_layout, 0, 1 ) GFXDECODE_END -static const ay8910_interface microtan_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; static MACHINE_CONFIG_START( microtan, microtan_state ) /* basic machine hardware */ @@ -241,10 +232,8 @@ static MACHINE_CONFIG_START( microtan, microtan_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910.1", AY8910, 1000000) - MCFG_SOUND_CONFIG(microtan_ay8910_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_SOUND_ADD("ay8910.2", AY8910, 1000000) - MCFG_SOUND_CONFIG(microtan_ay8910_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* snapshot/quickload */ diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index 579a4c50b81..21413d0a441 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -1045,16 +1045,6 @@ static INPUT_PORTS_START( msx2kr ) PORT_INCLUDE( msx_dips ) INPUT_PORTS_END -static const ay8910_interface msx_ay8910_interface = -{ - AY8910_SINGLE_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(msx_state, msx_psg_port_a_r), - DEVCB_DRIVER_MEMBER(msx_state, msx_psg_port_b_r), - DEVCB_DRIVER_MEMBER(msx_state, msx_psg_port_a_w), - DEVCB_DRIVER_MEMBER(msx_state, msx_psg_port_b_w) -}; - #define MSX_XBORDER_PIXELS 15 #define MSX_YBORDER_PIXELS 27 #define MSX_TOTAL_XRES_PIXELS 256 + (MSX_XBORDER_PIXELS * 2) @@ -1196,7 +1186,11 @@ static MACHINE_CONFIG_START( msx, msx_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, XTAL_10_738635MHz/3/2) - MCFG_SOUND_CONFIG(msx_ay8910_interface) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_PORT_A_READ_CB(READ8(msx_state, msx_psg_port_a_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(msx_state, msx_psg_port_b_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(msx_state, msx_psg_port_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(msx_state, msx_psg_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MCFG_SOUND_ADD("k051649", K051649, XTAL_10_738635MHz/3/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) @@ -1288,7 +1282,11 @@ static MACHINE_CONFIG_START( msx2, msx_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, XTAL_21_4772MHz/6/2) - MCFG_SOUND_CONFIG(msx_ay8910_interface) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_PORT_A_READ_CB(READ8(msx_state, msx_psg_port_a_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(msx_state, msx_psg_port_b_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(msx_state, msx_psg_port_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(msx_state, msx_psg_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MCFG_SOUND_ADD("k051649", K051649, XTAL_21_4772MHz/6/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) @@ -1356,7 +1354,11 @@ static MACHINE_CONFIG_START( msx2p, msx_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, XTAL_21_4772MHz/6/2) - MCFG_SOUND_CONFIG(msx_ay8910_interface) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_PORT_A_READ_CB(READ8(msx_state, msx_psg_port_a_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(msx_state, msx_psg_port_b_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(msx_state, msx_psg_port_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(msx_state, msx_psg_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MCFG_SOUND_ADD("k051649", K051649, XTAL_21_4772MHz/6/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) diff --git a/src/mess/drivers/multi8.c b/src/mess/drivers/multi8.c index 3c01000b25e..083412eb85a 100644 --- a/src/mess/drivers/multi8.c +++ b/src/mess/drivers/multi8.c @@ -609,17 +609,6 @@ WRITE8_MEMBER( multi8_state::ym2203_porta_w ) m_beeper->set_state((data & 0x08)); } -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(multi8_state, ym2203_porta_w ), - DEVCB_NULL -}; - - void multi8_state::machine_start() { m_p_vram = memregion("vram")->base(); @@ -656,7 +645,7 @@ static MACHINE_CONFIG_START( multi8, multi8_state ) /* Audio */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("aysnd", AY8912, 1500000) //unknown clock / divider - MCFG_SOUND_CONFIG(ay8910_config) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(multi8_state, ym2203_porta_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_SOUND_ADD("beeper", BEEP, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) diff --git a/src/mess/drivers/myvision.c b/src/mess/drivers/myvision.c index f121324384b..9b8506eaf0b 100644 --- a/src/mess/drivers/myvision.c +++ b/src/mess/drivers/myvision.c @@ -214,18 +214,6 @@ WRITE8_MEMBER( myvision_state::ay_port_b_w ) m_column = data; } - -static const ay8910_interface myvision_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_r), - DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_r), - DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_w), - DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_w) -}; - - static MACHINE_CONFIG_START( myvision, myvision_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",Z80, XTAL_10_738635MHz/3) /* Not verified */ @@ -242,7 +230,10 @@ static MACHINE_CONFIG_START( myvision, myvision_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8910", AY8910, XTAL_10_738635MHz/3/2) /* Exact model and clock not verified */ - MCFG_SOUND_CONFIG(myvision_ay8910_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(myvision_state, ay_port_a_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(myvision_state, ay_port_b_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(myvision_state, ay_port_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(myvision_state, ay_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* cartridge */ diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c index 761479f80de..36446977170 100644 --- a/src/mess/drivers/mz2500.c +++ b/src/mess/drivers/mz2500.c @@ -1998,16 +1998,6 @@ WRITE8_MEMBER(mz2500_state::opn_porta_w) m_ym_porta = data; } -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(mz2500_state,opn_porta_r), // read A - DEVCB_INPUT_PORT("DSW1"), // read B - DEVCB_DRIVER_MEMBER(mz2500_state,opn_porta_w), // write A - DEVCB_NULL // write B -}; - PALETTE_INIT_MEMBER(mz2500_state, mz2500) { int i; @@ -2113,7 +2103,9 @@ static MACHINE_CONFIG_START( mz2500, mz2500_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ym", YM2203, 2000000) //unknown clock / divider - MCFG_YM2203_AY8910_INTF(&ay8910_config) + MCFG_AY8910_PORT_A_READ_CB(READ8(mz2500_state, opn_porta_r)) // read A + MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) // read B + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(mz2500_state, opn_porta_w)) // write A MCFG_SOUND_ROUTE(0, "mono", 0.25) MCFG_SOUND_ROUTE(1, "mono", 0.25) MCFG_SOUND_ROUTE(2, "mono", 0.50) diff --git a/src/mess/drivers/oric.c b/src/mess/drivers/oric.c index 6ee1f730fad..6299fc972b7 100644 --- a/src/mess/drivers/oric.c +++ b/src/mess/drivers/oric.c @@ -767,17 +767,6 @@ static INPUT_PORTS_START(telstrat) INPUT_PORTS_END -static const ay8910_interface oric_ay_interface = -{ - AY8910_DISCRETE_OUTPUT, - { 4700, 4700, 4700}, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(oric_state, psg_a_w), - DEVCB_NULL, -}; - - static MACHINE_CONFIG_START( oric, oric_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/12) @@ -798,7 +787,9 @@ static MACHINE_CONFIG_START( oric, oric_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8912", AY8912, XTAL_12MHz/12) - MCFG_SOUND_CONFIG(oric_ay_interface) + MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT) + MCFG_AY8910_RES_LOADS(4700, 4700, 4700) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(oric_state, psg_a_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ diff --git a/src/mess/drivers/orion.c b/src/mess/drivers/orion.c index 2a21555cebb..7382e2083d9 100644 --- a/src/mess/drivers/orion.c +++ b/src/mess/drivers/orion.c @@ -153,12 +153,6 @@ static MACHINE_CONFIG_DERIVED( orion128ms, orion128 ) MCFG_I8255_OUT_PORTC_CB(WRITE8(radio86_state, radio86_8255_portc_w2)) MACHINE_CONFIG_END -static const ay8910_interface orionz80_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL -}; static MACHINE_CONFIG_START( orionz80, orion_state ) MCFG_CPU_ADD("maincpu", Z80, 2500000) @@ -202,7 +196,6 @@ static MACHINE_CONFIG_START( orionz80, orion_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8912", AY8912, 1773400) - MCFG_SOUND_CONFIG(orionz80_ay_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_CASSETTE_ADD( "cassette" ) @@ -278,7 +271,6 @@ static MACHINE_CONFIG_START( orionpro, orion_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8912", AY8912, 1773400) - MCFG_SOUND_CONFIG(orionz80_ay_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c index 644e9670e8b..7aeaf9541a1 100644 --- a/src/mess/drivers/pc6001.c +++ b/src/mess/drivers/pc6001.c @@ -1908,18 +1908,6 @@ READ8_MEMBER(pc6001_state::pc6001_8255_portc_r) return 0x88; } - - -static const ay8910_interface pc6001_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_INPUT_PORT("P1"), - DEVCB_INPUT_PORT("P2"), - DEVCB_NULL, - DEVCB_NULL -}; - UINT8 pc6001_state::check_keyboard_press() { ioport_port *ports[3] = { m_io_key1, m_io_key2, m_io_key3 }; @@ -2343,7 +2331,8 @@ static MACHINE_CONFIG_START( pc6001, pc6001_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8910", AY8910, PC6001_MAIN_CLOCK/4) - MCFG_SOUND_CONFIG(pc6001_ay_interface) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) // MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c index 713dc8be82b..d126ed0d336 100644 --- a/src/mess/drivers/pc8801.c +++ b/src/mess/drivers/pc8801.c @@ -2559,28 +2559,7 @@ READ8_MEMBER(pc8801_state::opn_porta_r) } READ8_MEMBER(pc8801_state::opn_portb_r){ return ioport("OPN_PB")->read(); } -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(pc8801_state,opn_porta_r), - DEVCB_DRIVER_MEMBER(pc8801_state,opn_portb_r), - DEVCB_NULL, - DEVCB_NULL -}; - -static const ay8910_interface single_ay8910_config = -{ - AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(pc8801_state,opn_porta_r), - DEVCB_DRIVER_MEMBER(pc8801_state,opn_portb_r), - DEVCB_NULL, - DEVCB_NULL -}; - /* Cassette Configuration */ - WRITE_LINE_MEMBER( pc8801_state::txdata_callback ) { //m_cass->output( (state) ? 0.8 : -0.8); @@ -2656,12 +2635,15 @@ static MACHINE_CONFIG_START( pc8801, pc8801_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("opn", YM2203, MASTER_CLOCK) MCFG_YM2203_IRQ_HANDLER(WRITELINE(pc8801_state, pc8801_sound_irq)) - MCFG_YM2203_AY8910_INTF(&ay8910_config) + MCFG_AY8910_PORT_A_READ_CB(READ8(pc8801_state, opn_porta_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(pc8801_state, opn_portb_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_ADD("opna", YM2608, MASTER_CLOCK*2) MCFG_YM2608_IRQ_HANDLER(WRITELINE(pc8801_state, pc8801_sound_irq)) - MCFG_YM2608_AY8910_INTF(&single_ay8910_config) + MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT) + MCFG_AY8910_PORT_A_READ_CB(READ8(pc8801_state, opn_porta_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(pc8801_state, opn_portb_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_ADD("beeper", BEEP, 0) diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c index 5b380fee1f4..4f98ce743b9 100644 --- a/src/mess/drivers/pc88va.c +++ b/src/mess/drivers/pc88va.c @@ -1722,17 +1722,6 @@ WRITE_LINE_MEMBER( pc88va_state::fdc_irq ) #endif } - -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - WRITE_LINE_MEMBER(pc88va_state::pc88va_hlda_w) { m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); @@ -1844,7 +1833,6 @@ static MACHINE_CONFIG_START( pc88va, pc88va_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ym", YM2203, 3993600) //unknown clock / divider - MCFG_YM2203_AY8910_INTF(&ay8910_config) MCFG_SOUND_ROUTE(0, "mono", 0.25) MCFG_SOUND_ROUTE(1, "mono", 0.25) MCFG_SOUND_ROUTE(2, "mono", 0.50) diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c index 631fd63eb57..9ae7089b034 100644 --- a/src/mess/drivers/pc9801.c +++ b/src/mess/drivers/pc9801.c @@ -3751,7 +3751,7 @@ static MACHINE_CONFIG_START( pc9801rs, pc9801_state ) MCFG_SPEAKER_STANDARD_MONO("mono") // MCFG_SOUND_ADD("opna", YM2608, MAIN_CLOCK_X1*4) // unknown clock / divider -// MCFG_SOUND_CONFIG(pc98_ym2608_intf) +// MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT) // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_ADD("beeper", BEEP, 0) @@ -3869,7 +3869,7 @@ static MACHINE_CONFIG_START( pc9821, pc9801_state ) MCFG_SPEAKER_STANDARD_MONO("mono") // MCFG_SOUND_ADD("opna", YM2608, MAIN_CLOCK_X1*4) // unknown clock / divider -// MCFG_SOUND_CONFIG(pc98_ym2608_intf) +// MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT) // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_ADD("beeper", BEEP, 0) diff --git a/src/mess/drivers/phc25.c b/src/mess/drivers/phc25.c index d892fac2c3c..1c5bf2ff16d 100644 --- a/src/mess/drivers/phc25.c +++ b/src/mess/drivers/phc25.c @@ -339,18 +339,6 @@ void phc25_state::video_start() m_port40 = 0; } -/* AY-3-8910 Interface */ - -static const ay8910_interface ay8910_intf = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_INPUT_PORT("JOY0"), - DEVCB_INPUT_PORT("JOY1"), - DEVCB_NULL, - DEVCB_NULL -}; - /* Machine Driver */ static MACHINE_CONFIG_START( phc25, phc25_state ) @@ -362,7 +350,8 @@ static MACHINE_CONFIG_START( phc25, phc25_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(AY8910_TAG, AY8910, 1996750) - MCFG_SOUND_CONFIG(ay8910_intf) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY0")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("JOY1")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) diff --git a/src/mess/drivers/rmnimbus.c b/src/mess/drivers/rmnimbus.c index c936c44d9e9..e3ea9d3da06 100644 --- a/src/mess/drivers/rmnimbus.c +++ b/src/mess/drivers/rmnimbus.c @@ -49,19 +49,6 @@ static SLOT_INTERFACE_START(keyboard) SLOT_INTERFACE("rmnkbd", RMNIMBUS_KEYBOARD) SLOT_INTERFACE_END -/* Null port handlers for now, I believe that the IO ports are used for */ -/* the nimbus rompacks */ - -static const ay8910_interface nimbus_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, /* portA read */ - DEVCB_NULL, /* portB read */ - DEVCB_DRIVER_MEMBER(rmnimbus_state, nimbus_sound_ay8910_porta_w), /* portA write */ - DEVCB_DRIVER_MEMBER(rmnimbus_state, nimbus_sound_ay8910_portb_w) /* portB write */ -}; - static ADDRESS_MAP_START(nimbus_mem, AS_PROGRAM, 16, rmnimbus_state ) AM_RANGE( 0x00000, 0x1FFFF ) AM_RAMBANK(RAM_BANK00_TAG) AM_RANGE( 0x20000, 0x3FFFF ) AM_RAMBANK(RAM_BANK01_TAG) @@ -234,7 +221,8 @@ static MACHINE_CONFIG_START( nimbus, rmnimbus_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO(MONO_TAG) MCFG_SOUND_ADD(AY8910_TAG, AY8910, 2000000) - MCFG_SOUND_CONFIG(nimbus_ay8910_interface) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(rmnimbus_state, nimbus_sound_ay8910_porta_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(rmnimbus_state, nimbus_sound_ay8910_portb_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS,MONO_TAG, 0.75) MCFG_SOUND_ADD(MSM5205_TAG, MSM5205, 384000) diff --git a/src/mess/drivers/sbc6510.c b/src/mess/drivers/sbc6510.c index ff72fd8ad2c..d9414f75ca0 100644 --- a/src/mess/drivers/sbc6510.c +++ b/src/mess/drivers/sbc6510.c @@ -241,17 +241,6 @@ READ8_MEMBER( sbc6510_state::psg_b_r ) return 0x7f; } -// Ports A and B connect to the IDE socket -static const ay8910_interface sbc6510_ay_interface = -{ - AY8910_LEGACY_OUTPUT, // flags - AY8910_DEFAULT_LOADS, // channel load in ohms - DEVCB_DRIVER_MEMBER(sbc6510_state, psg_a_r), // port A read - DEVCB_DRIVER_MEMBER(sbc6510_state, psg_b_r), // port B read - DEVCB_NULL, // port A write - DEVCB_NULL // port B write -}; - READ8_MEMBER( sbc6510_state::key_r ) { UINT8 data=0; @@ -313,7 +302,9 @@ static MACHINE_CONFIG_START( sbc6510, sbc6510_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8910", AY8910, XTAL_1MHz) - MCFG_SOUND_CONFIG(sbc6510_ay_interface) + // Ports A and B connect to the IDE socket + MCFG_AY8910_PORT_A_READ_CB(READ8(sbc6510_state, psg_a_r)) // port A read + MCFG_AY8910_PORT_B_READ_CB(READ8(sbc6510_state, psg_b_r)) // port B read MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_DEVICE_ADD("cia6526", MOS6526, XTAL_1MHz) diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c index 09f7dd99952..430ae561043 100644 --- a/src/mess/drivers/spc1000.c +++ b/src/mess/drivers/spc1000.c @@ -287,16 +287,6 @@ READ8_MEMBER( spc1000_state::porta_r ) return data; } -static const ay8910_interface spc1000_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(spc1000_state, porta_r), //portA_r - DEVCB_NULL, // portB_r - DEVCB_NULL, // portA_w - DEVCB_NULL // portB_w -}; - // irq is inverted in emulation, so we need this trampoline WRITE_LINE_MEMBER( spc1000_state::irq_w ) { @@ -333,7 +323,7 @@ static MACHINE_CONFIG_START( spc1000, spc1000_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8910", AY8910, XTAL_4MHz / 1) - MCFG_SOUND_CONFIG(spc1000_ay_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(spc1000_state, porta_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mess/drivers/spec128.c b/src/mess/drivers/spec128.c index 5cdc252c4a3..2e5935bbad0 100644 --- a/src/mess/drivers/spec128.c +++ b/src/mess/drivers/spec128.c @@ -159,13 +159,6 @@ resulting mess can be seen in the F4 viewer display. #include "formats/tzx_cas.h" #include "machine/ram.h" -static const ay8910_interface spectrum_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL -}; - /****************************************************************************************************/ /* Spectrum 128 specific functions */ @@ -310,7 +303,6 @@ MACHINE_CONFIG_DERIVED( spectrum_128, spectrum ) /* sound hardware */ MCFG_SOUND_ADD("ay8912", AY8912, 1773400) - MCFG_SOUND_CONFIG(spectrum_ay_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* internal ram */ diff --git a/src/mess/drivers/sv8000.c b/src/mess/drivers/sv8000.c index 23e3f18ed26..3783110db01 100644 --- a/src/mess/drivers/sv8000.c +++ b/src/mess/drivers/sv8000.c @@ -344,18 +344,6 @@ WRITE8_MEMBER( sv8000_state::ay_port_b_w ) //logerror("ay_port_b_w: %02X\n", data); } - -static const ay8910_interface sv8000_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(sv8000_state, ay_port_a_r), - DEVCB_DRIVER_MEMBER(sv8000_state, ay_port_b_r), - DEVCB_DRIVER_MEMBER(sv8000_state, ay_port_a_w), - DEVCB_DRIVER_MEMBER(sv8000_state, ay_port_b_w) -}; - - READ8_MEMBER( sv8000_state::mc6847_videoram_r ) { if (offset == ~0) return 0xff; @@ -427,7 +415,10 @@ static MACHINE_CONFIG_START( sv8000, sv8000_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay8910", AY8910, XTAL_10_738635MHz/3/2) /* Exact model and clock not verified */ - MCFG_SOUND_CONFIG(sv8000_ay8910_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(sv8000_state, ay_port_a_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(sv8000_state, ay_port_b_r)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(sv8000_state, ay_port_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(sv8000_state, ay_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* cartridge */ diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c index 0af55cfb21d..46cd0b3cc7c 100644 --- a/src/mess/drivers/svi318.c +++ b/src/mess/drivers/svi318.c @@ -250,16 +250,6 @@ static INPUT_PORTS_START( svi328 ) PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad ,") PORT_CODE(KEYCODE_DEL_PAD) INPUT_PORTS_END -static const ay8910_interface svi318_ay8910_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_DRIVER_MEMBER(svi318_state, svi318_psg_port_a_r), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(svi318_state, svi318_psg_port_b_w) -}; - WRITE_LINE_MEMBER(svi318_state::vdp_interrupt) { m_maincpu->set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE)); @@ -316,7 +306,8 @@ static MACHINE_CONFIG_START( svi318, svi318_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, 1789773) - MCFG_SOUND_CONFIG(svi318_ay8910_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(svi318_state, svi318_psg_port_a_r)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(svi318_state, svi318_psg_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) /* printer */ @@ -447,7 +438,8 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay8910", AY8910, 1789773) - MCFG_SOUND_CONFIG(svi318_ay8910_interface) + MCFG_AY8910_PORT_A_READ_CB(READ8(svi318_state, svi318_psg_port_a_r)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(svi318_state, svi318_psg_port_b_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) /* printer */ diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c index 98c8dcc4abd..d357130cabb 100644 --- a/src/mess/drivers/tiki100.c +++ b/src/mess/drivers/tiki100.c @@ -577,16 +577,6 @@ WRITE8_MEMBER( tiki100_state::video_scroll_w ) m_scroll = data; } -static const ay8910_interface ay8910_intf = -{ - AY8910_SINGLE_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(tiki100_state, video_scroll_w), - DEVCB_NULL -}; - /* Z80 Daisy Chain */ static const z80_daisy_config tiki100_daisy_chain[] = @@ -713,7 +703,8 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(AY8912_TAG, AY8912, XTAL_8MHz/4) - MCFG_SOUND_CONFIG(ay8910_intf) + MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tiki100_state, video_scroll_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* internal ram */ diff --git a/src/mess/drivers/timex.c b/src/mess/drivers/timex.c index 85fd38d606b..d64309dbe28 100644 --- a/src/mess/drivers/timex.c +++ b/src/mess/drivers/timex.c @@ -179,13 +179,6 @@ const timex_cart_t *timex_cart_data(void) return &timex_cart; } -static const ay8910_interface spectrum_ay_interface = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL -}; - /****************************************************************************************************/ /* TS2048 specific functions */ @@ -740,7 +733,6 @@ static MACHINE_CONFIG_DERIVED( ts2068, spectrum_128 ) /* sound */ MCFG_SOUND_REPLACE("ay8912", AY8912, XTAL_14_112MHz/8) /* From Schematic; 1.764 MHz */ - MCFG_SOUND_CONFIG(spectrum_ay_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* cartridge */ diff --git a/src/mess/drivers/votrpss.c b/src/mess/drivers/votrpss.c index 80d53ac1f61..99811f4a15d 100644 --- a/src/mess/drivers/votrpss.c +++ b/src/mess/drivers/votrpss.c @@ -235,16 +235,6 @@ WRITE8_MEMBER( votrpss_state::ppi_pc_w ) m_portc = data; } -static const ay8910_interface ay8910_intf = -{ - AY8910_LEGACY_OUTPUT, // flags - AY8910_DEFAULT_LOADS, // channel load in ohms - DEVCB_NULL, // port A read - DEVCB_INPUT_PORT("DSW1"), // port B read - DEVCB_DEVICE_MEMBER("votrax", votrax_sc01_device, write), // port A write - DEVCB_NULL // port B write -}; - WRITE8_MEMBER( votrpss_state::kbd_put ) { m_term_data = data; @@ -273,7 +263,8 @@ static MACHINE_CONFIG_START( votrpss, votrpss_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay", AY8910, XTAL_8MHz/4) /* 2.000 MHz, verified */ - MCFG_SOUND_CONFIG(ay8910_intf) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) // port B read + MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("votrax", votrax_sc01_device, write)) // port A write MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) /* 720 kHz? needs verify */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c index 379cc4eb29d..53058a064a8 100644 --- a/src/mess/drivers/x1.c +++ b/src/mess/drivers/x1.c @@ -2244,23 +2244,6 @@ static const z80_daisy_config x1turbo_daisy[] = /************************************* * - * Sound HW Config - * - *************************************/ - -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_INPUT_PORT("P1"), - DEVCB_INPUT_PORT("P2"), - DEVCB_NULL, - DEVCB_NULL -}; - -// (ym-2151 handler here) -/************************************* - * * Machine Functions * *************************************/ @@ -2518,7 +2501,8 @@ static MACHINE_CONFIG_START( x1, x1_state ) /* TODO:is the AY mono or stereo? Also volume balance isn't right. */ MCFG_SOUND_ADD("ay", AY8910, MAIN_CLOCK/8) - MCFG_SOUND_CONFIG(ay8910_config) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) MCFG_SOUND_ROUTE(1, "lspeaker", 0.5) diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c index fcd53de111f..661f6613bdf 100644 --- a/src/mess/drivers/x1twin.c +++ b/src/mess/drivers/x1twin.c @@ -402,17 +402,6 @@ static const z80_daisy_config x1_daisy[] = { NULL } }; -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_INPUT_PORT("P1"), - DEVCB_INPUT_PORT("P2"), - DEVCB_NULL, - DEVCB_NULL -}; - - static LEGACY_FLOPPY_OPTIONS_START( x1 ) LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, HEADS([2]) @@ -505,7 +494,8 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state ) /* TODO:is the AY mono or stereo? Also volume balance isn't right. */ MCFG_SOUND_ADD("ay", AY8910, MAIN_CLOCK/8) - MCFG_SOUND_CONFIG(ay8910_config) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) MCFG_SOUND_ROUTE(0, "x1_l", 0.25) MCFG_SOUND_ROUTE(0, "x1_r", 0.25) MCFG_SOUND_ROUTE(1, "x1_l", 0.5) |