Previous 199869 Revisions Next

r22746 Friday 10th May, 2013 at 18:21:22 UTC by smf
modernised the YM2610 interface [smf]
[src/emu/sound]2610intf.c 2610intf.h
[src/mame/drivers]2mindril.c aerofgt.c asuka.c bbusters.c crshrace.c f1gp.c fromanc2.c gstriker.c inufuku.c mcatadv.c metro.c neogeo.c neoprint.c ninjaw.c othunder.c pipedrm.c psikyo.c slapshot.c suprslam.c taito_b.c taito_f2.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c taotaido.c warriorb.c welltris.c wgp.c zn.c

trunk/src/mame/drivers/taito_l.c
r22745r22746
711711   AM_RANGE(0x0000, 0x3fff) AM_ROM
712712   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
713713   AM_RANGE(0xc000, 0xdfff) AM_RAM
714   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
714   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
715715   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
716716   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
717717   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
17841784   MSM5205_S48_4B      /* 8 kHz */
17851785};
17861786
1787static const ym2610_interface ym2610_config =
1788{
1789   DEVCB_DRIVER_LINE_MEMBER(taitol_state,irqhandler)
1790};
1791
17921787static const ym2203_interface ym2203_interface_single =
17931788{
17941789   {
r22745r22746
18971892
18981893   /* sound hardware */
18991894   MCFG_SOUND_REPLACE("ymsnd", YM2610, XTAL_8MHz)      /* verified on pcb (8Mhz OSC is also for the 2nd z80) */
1900   MCFG_SOUND_CONFIG(ym2610_config)
1895   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitol_state, irqhandler))
19011896   MCFG_SOUND_ROUTE(0, "mono", 0.25)
19021897   MCFG_SOUND_ROUTE(1, "mono", 1.0)
19031898   MCFG_SOUND_ROUTE(2, "mono", 1.0)
trunk/src/mame/drivers/gstriker.c
r22745r22746
267267      m_audiocpu->set_input_line(0, CLEAR_LINE);
268268}
269269
270static const ym2610_interface ym2610_config =
271{
272   DEVCB_DRIVER_LINE_MEMBER(gstriker_state,gs_ym2610_irq)
273};
274
275270/*** MEMORY LAYOUTS **********************************************************/
276271
277272
r22745r22746
306301
307302static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, gstriker_state )
308303   ADDRESS_MAP_GLOBAL_MASK(0xff)
309   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
304   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
310305   AM_RANGE(0x04, 0x04) AM_WRITE(gs_sh_bankswitch_w)
311306   AM_RANGE(0x08, 0x08) AM_WRITE(gs_sh_pending_command_clear_w)
312307   AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
r22745r22746
571566   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
572567
573568   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
574   MCFG_SOUND_CONFIG(ym2610_config)
569   MCFG_YM2610_IRQ_HANDLER(WRITELINE(gstriker_state, gs_ym2610_irq))
575570   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
576571   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
577572   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
617612   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
618613
619614   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
620   MCFG_SOUND_CONFIG(ym2610_config)
615   MCFG_YM2610_IRQ_HANDLER(WRITELINE(gstriker_state, gs_ym2610_irq))
621616   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
622617   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
623618   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/aerofgt.c
r22745r22746
383383   ADDRESS_MAP_GLOBAL_MASK(0xff)
384384   AM_RANGE(0x00, 0x00) AM_WRITE(aerofgt_sh_bankswitch_w)
385385   AM_RANGE(0x14, 0x14) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
386   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
386   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
387387ADDRESS_MAP_END
388388
389389static ADDRESS_MAP_START( aerofgt_sound_portmap, AS_IO, 8, aerofgt_state )
390390   ADDRESS_MAP_GLOBAL_MASK(0xff)
391   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
391   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
392392   AM_RANGE(0x04, 0x04) AM_WRITE(aerofgt_sh_bankswitch_w)
393393   AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
394394   AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
r22745r22746
12761276   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
12771277}
12781278
1279static const ym2610_interface ym2610_config =
1280{
1281   DEVCB_DRIVER_LINE_MEMBER(aerofgt_state,irqhandler)
1282};
1283
12841279static const ym3812_interface ym3812_config =
12851280{
12861281   DEVCB_DRIVER_LINE_MEMBER(aerofgt_state,irqhandler)  /* IRQ Line */
r22745r22746
13501345   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
13511346
13521347   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
1353   MCFG_SOUND_CONFIG(ym2610_config)
1348   MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler))
13541349   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
13551350   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
13561351   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
14941489   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
14951490
14961491   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz ) /* verified on pcb */
1497   MCFG_SOUND_CONFIG(ym2610_config)
1492   MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler))
14981493   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
14991494   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
15001495   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
15411536   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
15421537
15431538   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)  /* verified on pcb */
1544   MCFG_SOUND_CONFIG(ym2610_config)
1539   MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler))
15451540   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
15461541   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
15471542   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
15871582   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
15881583
15891584   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)  /* verified on pcb */
1590   MCFG_SOUND_CONFIG(ym2610_config)
1585   MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler))
15911586   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
15921587   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
15931588   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
16341629   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
16351630
16361631   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
1637   MCFG_SOUND_CONFIG(ym2610_config)
1632   MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler))
16381633   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
16391634   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
16401635   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
16781673   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
16791674
16801675   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)  /* verified on pcb */
1681   MCFG_SOUND_CONFIG(ym2610_config)
1676   MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler))
16821677   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
16831678   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
16841679   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/welltris.c
r22745r22746
382382static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, welltris_state )
383383   ADDRESS_MAP_GLOBAL_MASK(0xff)
384384   AM_RANGE(0x00, 0x00) AM_WRITE(welltris_sh_bankswitch_w)
385   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
385   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
386386   AM_RANGE(0x10, 0x10) AM_READ(soundlatch_byte_r)
387387   AM_RANGE(0x18, 0x18) AM_WRITE(pending_command_clear_w)
388388ADDRESS_MAP_END
r22745r22746
676676   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
677677}
678678
679static const ym2610_interface ym2610_config =
680{
681   DEVCB_DRIVER_LINE_MEMBER(welltris_state,irqhandler)
682};
683679
684680
685
686681DRIVER_INIT_MEMBER(welltris_state,welltris)
687682{
688683#if WELLTRIS_4P_HACK
r22745r22746
729724   MCFG_SPEAKER_STANDARD_MONO("mono")
730725
731726   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
732   MCFG_SOUND_CONFIG(ym2610_config)
727   MCFG_YM2610_IRQ_HANDLER(WRITELINE(welltris_state, irqhandler))
733728   MCFG_SOUND_ROUTE(0, "mono", 0.25)
734729   MCFG_SOUND_ROUTE(1, "mono", 0.75)
735730   MCFG_SOUND_ROUTE(2, "mono", 0.75)
trunk/src/mame/drivers/taitoair.c
r22745r22746
412412   AM_RANGE(0x0000, 0x3fff) AM_ROM
413413   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
414414   AM_RANGE(0xc000, 0xdfff) AM_RAM
415   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
415   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
416416   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
417417   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
418418   AM_RANGE(0xe400, 0xe403) AM_WRITENOP        /* pan control */
r22745r22746
631631   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
632632}
633633
634static const ym2610_interface airsys_ym2610_interface =
635{
636   DEVCB_DRIVER_LINE_MEMBER(taitoair_state,irqhandler)
637};
638634
639
640635/************************************************************
641636                MACHINE DRIVERS
642637************************************************************/
r22745r22746
731726   MCFG_SPEAKER_STANDARD_MONO("mono")
732727
733728   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
734   MCFG_SOUND_CONFIG(airsys_ym2610_interface)
729   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoair_state, irqhandler))
735730   MCFG_SOUND_ROUTE(0, "mono", 0.30)
736731   MCFG_SOUND_ROUTE(1, "mono", 0.60)
737732   MCFG_SOUND_ROUTE(2, "mono", 0.60)
trunk/src/mame/drivers/neogeo.c
r22745r22746
11271127static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, neogeo_state )
11281128   /*AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, audio_cpu_clear_nmi_w);*/  /* may not and NMI clear */
11291129   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r)
1130   AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1130   AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
11311131   AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */
11321132   AM_RANGE(0x08, 0x08) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_f000_f7ff_r)
11331133   AM_RANGE(0x09, 0x09) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_e000_efff_r)
r22745r22746
11411141
11421142/*************************************
11431143 *
1144 *  Audio interface
1145 *
1146 *************************************/
1147
1148static const ym2610_interface ym2610_config =
1149{
1150   DEVCB_DRIVER_LINE_MEMBER(neogeo_state,audio_cpu_irq)
1151};
1152
1153
1154
1155/*************************************
1156 *
11571144 *  Standard Neo-Geo DIPs and
11581145 *  input port definition
11591146 *
r22745r22746
13781365   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
13791366
13801367   MCFG_SOUND_ADD("ymsnd", YM2610, NEOGEO_YM2610_CLOCK)
1381   MCFG_SOUND_CONFIG(ym2610_config)
1368   MCFG_YM2610_IRQ_HANDLER(WRITELINE(neogeo_state, audio_cpu_irq))
13821369   MCFG_SOUND_ROUTE(0, "lspeaker",  0.60)
13831370   MCFG_SOUND_ROUTE(0, "rspeaker", 0.60)
13841371   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/fromanc2.c
r22745r22746
293293   ADDRESS_MAP_GLOBAL_MASK(0xff)
294294   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_WRITENOP     // snd cmd (1P) / ?
295295   AM_RANGE(0x04, 0x04) AM_READ(soundlatch2_byte_r)                // snd cmd (2P)
296   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
296   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
297297   AM_RANGE(0x0c, 0x0c) AM_READ(fromanc2_sndcpu_nmi_clr)
298298ADDRESS_MAP_END
299299
r22745r22746
476476   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
477477}
478478
479static const ym2610_interface ym2610_config =
480{
481   DEVCB_DRIVER_LINE_MEMBER(fromanc2_state,irqhandler)
482};
483479
484
485480/*************************************
486481 *
487482 *  Machine driver
r22745r22746
566561   MCFG_SPEAKER_STANDARD_MONO("mono")
567562
568563   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
569   MCFG_SOUND_CONFIG(ym2610_config)
564   MCFG_YM2610_IRQ_HANDLER(WRITELINE(fromanc2_state, irqhandler))
570565   MCFG_SOUND_ROUTE(0, "mono", 0.50)
571566   MCFG_SOUND_ROUTE(1, "mono", 0.75)
572567   MCFG_SOUND_ROUTE(2, "mono", 0.75)
r22745r22746
616611   MCFG_SPEAKER_STANDARD_MONO("mono")
617612
618613   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
619   MCFG_SOUND_CONFIG(ym2610_config)
614   MCFG_YM2610_IRQ_HANDLER(WRITELINE(fromanc2_state, irqhandler))
620615   MCFG_SOUND_ROUTE(0, "mono", 0.50)
621616   MCFG_SOUND_ROUTE(1, "mono", 0.75)
622617   MCFG_SOUND_ROUTE(2, "mono", 0.75)
r22745r22746
663658   MCFG_SPEAKER_STANDARD_MONO("mono")
664659
665660   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
666   MCFG_SOUND_CONFIG(ym2610_config)
661   MCFG_YM2610_IRQ_HANDLER(WRITELINE(fromanc2_state, irqhandler))
667662   MCFG_SOUND_ROUTE(0, "mono", 0.50)
668663   MCFG_SOUND_ROUTE(1, "mono", 0.75)
669664   MCFG_SOUND_ROUTE(2, "mono", 0.75)
trunk/src/mame/drivers/slapshot.c
r22745r22746
313313   AM_RANGE(0x0000, 0x3fff) AM_ROM
314314   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
315315   AM_RANGE(0xc000, 0xdfff) AM_RAM
316   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
316   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
317317   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
318318   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
319319   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
481481   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
482482}
483483
484static const ym2610_interface ym2610_config =
485{
486   DEVCB_DRIVER_LINE_MEMBER(slapshot_state,irqhandler)
487};
488484
489
490485/***********************************************************
491486                 MACHINE DRIVERS
492487***********************************************************/
r22745r22746
557552   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
558553
559554   MCFG_SOUND_ADD("ymsnd", YM2610B, 16000000/2)
560   MCFG_SOUND_CONFIG(ym2610_config)
555   MCFG_YM2610_IRQ_HANDLER(WRITELINE(slapshot_state, irqhandler))
561556   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
562557   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
563558   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
603598   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
604599
605600   MCFG_SOUND_ADD("ymsnd", YM2610B, 16000000/2)
606   MCFG_SOUND_CONFIG(ym2610_config)
601   MCFG_YM2610_IRQ_HANDLER(WRITELINE(slapshot_state, irqhandler))
607602   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
608603   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
609604   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/inufuku.c
r22745r22746
176176   ADDRESS_MAP_GLOBAL_MASK(0xff)
177177   AM_RANGE(0x00, 0x00) AM_WRITE(inufuku_soundrombank_w)
178178   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
179   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
179   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
180180ADDRESS_MAP_END
181181
182182/******************************************************************************
r22745r22746
325325   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
326326}
327327
328static const ym2610_interface ym2610_config =
329{
330   DEVCB_DRIVER_LINE_MEMBER(inufuku_state,irqhandler)
331};
332328
333
334329/******************************************************************************
335330
336331    Machine driver
r22745r22746
405400   MCFG_SPEAKER_STANDARD_MONO("mono")
406401
407402   MCFG_SOUND_ADD("ymsnd", YM2610, 32000000/4)
408   MCFG_SOUND_CONFIG(ym2610_config)
403   MCFG_YM2610_IRQ_HANDLER(WRITELINE(inufuku_state, irqhandler))
409404   MCFG_SOUND_ROUTE(0, "mono", 0.50)
410405   MCFG_SOUND_ROUTE(1, "mono", 0.75)
411406   MCFG_SOUND_ROUTE(2, "mono", 0.75)
trunk/src/mame/drivers/taito_f2.c
r22745r22746
11541154   AM_RANGE(0x0000, 0x3fff) AM_ROM
11551155   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
11561156   AM_RANGE(0xc000, 0xdfff) AM_RAM
1157   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1157   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
11581158   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
11591159   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
11601160   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
28072807   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
28082808}
28092809
2810static const ym2610_interface ym2610_config =
2811{
2812   DEVCB_DRIVER_LINE_MEMBER(taitof2_state,irqhandler)
2813};
28142810
2815
28162811WRITE8_MEMBER(taitof2_state::cameltrya_porta_w)
28172812{
28182813   // Implement //
r22745r22746
30483043   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
30493044
30503045   MCFG_SOUND_ADD("ymsnd", YM2610, 24000000/3) /* Was 16000000/2, but only a 24Mhz OSC */
3051   MCFG_SOUND_CONFIG(ym2610_config)
3046   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitof2_state, irqhandler))
30523047   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
30533048   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
30543049   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/taito_x.c
r22745r22746
498498   AM_RANGE(0x0000, 0x3fff) AM_ROM
499499   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
500500   AM_RANGE(0xc000, 0xdfff) AM_RAM
501   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
501   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
502502   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
503503   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
504504   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
797797   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
798798}
799799
800static const ym2610_interface ym2610_config =
801{
802   DEVCB_DRIVER_LINE_MEMBER(taitox_state,irqhandler)
803};
804
805800MACHINE_START_MEMBER(taitox_state,taitox)
806801{
807802   m_banknum = -1;
r22745r22746
851846   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
852847
853848   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2)   /* verified on pcb */
854   MCFG_SOUND_CONFIG(ym2610_config)
849   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitox_state, irqhandler))
855850   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
856851   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
857852   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
933928   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
934929
935930   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
936   MCFG_SOUND_CONFIG(ym2610_config)
931   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitox_state, irqhandler))
937932   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
938933   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
939934   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
975970   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
976971
977972   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
978   MCFG_SOUND_CONFIG(ym2610_config)
973   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitox_state, irqhandler))
979974   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
980975   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
981976   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/asuka.c
r22745r22746
375375   AM_RANGE(0x0000, 0x3fff) AM_ROM
376376   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
377377   AM_RANGE(0xc000, 0xdfff) AM_RAM
378   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
378   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
379379   AM_RANGE(0xe200, 0xe200) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
380380   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
381381   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
767767   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
768768}
769769
770static const ym2610_interface ym2610_config =
771{
772   DEVCB_DRIVER_LINE_MEMBER(asuka_state,irqhandler)
773};
774770
775
776771static const msm5205_interface msm5205_config =
777772{
778773   DEVCB_DRIVER_LINE_MEMBER(asuka_state,asuka_msm5205_vck),  /* VCK function */
r22745r22746
906901   MCFG_SPEAKER_STANDARD_MONO("mono")
907902
908903   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
909   MCFG_SOUND_CONFIG(ym2610_config)
904   MCFG_YM2610_IRQ_HANDLER(WRITELINE(asuka_state, irqhandler))
910905   MCFG_SOUND_ROUTE(0, "mono", 0.25)
911906   MCFG_SOUND_ROUTE(1, "mono", 1.0)
912907   MCFG_SOUND_ROUTE(2, "mono", 1.0)
trunk/src/mame/drivers/f1gp.c
r22745r22746
152152   AM_RANGE(0x00, 0x00) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp
153153   AM_RANGE(0x0c, 0x0c) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp2
154154   AM_RANGE(0x14, 0x14) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
155   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
155   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
156156ADDRESS_MAP_END
157157
158158WRITE16_MEMBER(f1gp_state::f1gpb_misc_w)
r22745r22746
395395   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
396396}
397397
398static const ym2610_interface ym2610_config =
399{
400   DEVCB_DRIVER_LINE_MEMBER(f1gp_state,irqhandler)
401};
402
403398static const k053936_interface f1gp_k053936_intf =
404399{
405400   1, -58, -2  /* wrap, xoff, yoff */
r22745r22746
486481   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
487482
488483   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)
489   MCFG_SOUND_CONFIG(ym2610_config)
484   MCFG_YM2610_IRQ_HANDLER(WRITELINE(f1gp_state, irqhandler))
490485   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
491486   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
492487   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/psikyo.c
r22745r22746
409409
410410static ADDRESS_MAP_START( sngkace_sound_io_map, AS_IO, 8, psikyo_state )
411411   ADDRESS_MAP_GLOBAL_MASK(0xff)
412   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
412   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
413413   AM_RANGE(0x04, 0x04) AM_WRITE(sngkace_sound_bankswitch_w)
414414   AM_RANGE(0x08, 0x08) AM_READ(psikyo_soundlatch_r)
415415   AM_RANGE(0x0c, 0x0c) AM_WRITE(psikyo_clear_nmi_w)
r22745r22746
434434static ADDRESS_MAP_START( gunbird_sound_io_map, AS_IO, 8, psikyo_state )
435435   ADDRESS_MAP_GLOBAL_MASK(0xff)
436436   AM_RANGE(0x00, 0x00) AM_WRITE(gunbird_sound_bankswitch_w)
437   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
437   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
438438   AM_RANGE(0x08, 0x08) AM_READ(psikyo_soundlatch_r)
439439   AM_RANGE(0x0c, 0x0c) AM_WRITE(psikyo_clear_nmi_w)
440440ADDRESS_MAP_END
r22745r22746
10301030***************************************************************************/
10311031
10321032
1033static const ym2610_interface sngkace_ym2610_interface =
1034{
1035   DEVCB_DRIVER_LINE_MEMBER(psikyo_state,sound_irq)
1036};
1037
10381033static MACHINE_CONFIG_START( sngkace, psikyo_state )
10391034
10401035   /* basic machine hardware */
r22745r22746
10651060   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
10661061
10671062   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_32MHz/4) /* verified on pcb */
1068   MCFG_SOUND_CONFIG(sngkace_ym2610_interface)
1063   MCFG_YM2610_IRQ_HANDLER(WRITELINE(psikyo_state, sound_irq))
10691064   MCFG_SOUND_ROUTE(0, "lspeaker",  1.2)
10701065   MCFG_SOUND_ROUTE(0, "rspeaker", 1.2)
10711066   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
10791074***************************************************************************/
10801075
10811076
1082static const ym2610_interface gunbird_ym2610_interface =
1083{
1084   DEVCB_DRIVER_LINE_MEMBER(psikyo_state,sound_irq)   /* irq */
1085};
1086
10871077static MACHINE_CONFIG_START( gunbird, psikyo_state )
10881078
10891079   /* basic machine hardware */
r22745r22746
11141104   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
11151105
11161106   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
1117   MCFG_SOUND_CONFIG(gunbird_ym2610_interface)
1107   MCFG_YM2610_IRQ_HANDLER(WRITELINE(psikyo_state, sound_irq))
11181108   MCFG_SOUND_ROUTE(0, "lspeaker",  1.2)
11191109   MCFG_SOUND_ROUTE(0, "rspeaker", 1.2)
11201110   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/taito_z.c
r22745r22746
15881588   AM_RANGE(0x110000, 0x113fff) AM_RAM AM_SHARE("share1")
15891589   AM_RANGE(0x400000, 0x400007) AM_WRITE(spacegun_pancontrol)  /* pan */
15901590//  AM_RANGE(0x40000a, 0x40000b) AM_READ(taitoz_unknown_r)  // ???
1591   AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2610_r, ym2610_w, 0x00ff)
1591   AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8("ymsnd", ym2610_device, read, write, 0x00ff)
15921592   AM_RANGE(0x60000c, 0x60000d) AM_NOP // interrupt controller?
15931593   AM_RANGE(0x60000e, 0x60000f) AM_NOP
15941594   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
r22745r22746
16811681   AM_RANGE(0x20c000, 0x20ffff) AM_RAM
16821682   AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_SHARE("share1")
16831683   AM_RANGE(0x800000, 0x80000f) AM_READWRITE(spacegun_input_bypass_r, spacegun_output_bypass_w)
1684   AM_RANGE(0xc00000, 0xc00007) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2610_r, ym2610_w, 0x00ff)
1684   AM_RANGE(0xc00000, 0xc00007) AM_DEVREADWRITE8("ymsnd", ym2610_device, read, write, 0x00ff)
16851685   AM_RANGE(0xc0000c, 0xc0000d) AM_NOP // interrupt controller?
16861686   AM_RANGE(0xc0000e, 0xc0000f) AM_NOP
16871687   AM_RANGE(0xc20000, 0xc20007) AM_WRITE(spacegun_pancontrol)  /* pan */
r22745r22746
17451745   AM_RANGE(0x0000, 0x3fff) AM_ROM
17461746   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
17471747   AM_RANGE(0xc000, 0xdfff) AM_RAM
1748   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1748   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
17491749   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
17501750   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
17511751   AM_RANGE(0xe400, 0xe403) AM_WRITE(taitoz_pancontrol) /* pan */
r22745r22746
29112911//  m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
29122912}
29132913
2914static const ym2610_interface ym2610_config =
2915{
2916   DEVCB_DRIVER_LINE_MEMBER(taitoz_state,irqhandler)
2917};
29182914
2919static const ym2610_interface ym2610_interfaceb =
2920{
2921   DEVCB_DRIVER_LINE_MEMBER(taitoz_state,irqhandlerb)
2922};
2923
2924
29252915/***********************************************************
29262916                      MACHINE DRIVERS
29272917
r22745r22746
31013091   MCFG_SPEAKER_ADD("subwoofer", 0.0, 0.0, 1.0)
31023092
31033093   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3104   MCFG_SOUND_CONFIG(ym2610_config)
3094   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
31053095   MCFG_SOUND_ROUTE(0, "subwoofer", 0.20)
31063096   MCFG_SOUND_ROUTE(1, "2610.1.l", 2.0)
31073097   MCFG_SOUND_ROUTE(1, "2610.1.r", 2.0)
r22745r22746
31633153   MCFG_SPEAKER_ADD("subwoofer", 0.0, 0.0, 1.0)
31643154
31653155   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3166   MCFG_SOUND_CONFIG(ym2610_config)
3156   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
31673157   MCFG_SOUND_ROUTE(0, "subwoofer", 0.20)
31683158   MCFG_SOUND_ROUTE(1, "2610.1.l", 1.0)
31693159   MCFG_SOUND_ROUTE(1, "2610.1.r", 1.0)
r22745r22746
32253215   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
32263216
32273217   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3228   MCFG_SOUND_CONFIG(ym2610_config)
3218   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
32293219   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
32303220   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
32313221   MCFG_SOUND_ROUTE(1, "2610.1.l", 20.0)
r22745r22746
32843274   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
32853275
32863276   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3287   MCFG_SOUND_CONFIG(ym2610_interfaceb)
3277   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandlerb))
32883278   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
32893279   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
32903280   MCFG_SOUND_ROUTE(1, "2610.1.l", 28.0)
r22745r22746
33553345   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
33563346
33573347   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3358   MCFG_SOUND_CONFIG(ym2610_config)
3348   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
33593349   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
33603350   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
33613351   MCFG_SOUND_ROUTE(1, "2610.1.l", 2.0)
r22745r22746
34203410   MCFG_SPEAKER_ADD("subwoofer", 0.0, 0.0, 1.0)
34213411
34223412   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3423   MCFG_SOUND_CONFIG(ym2610_config)
3413   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
34243414   MCFG_SOUND_ROUTE(0, "subwoofer", 0.20)
34253415   MCFG_SOUND_ROUTE(1, "2610.1.l", 2.0)
34263416   MCFG_SOUND_ROUTE(1, "2610.1.r", 2.0)
r22745r22746
34823472   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
34833473
34843474   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3485   MCFG_SOUND_CONFIG(ym2610_config)
3475   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
34863476   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
34873477   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
34883478   MCFG_SOUND_ROUTE(1, "2610.1.l", 2.0)
r22745r22746
35413531   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
35423532
35433533   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
3544   MCFG_SOUND_CONFIG(ym2610_interfaceb)
3534   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandlerb))
35453535   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
35463536   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
35473537   MCFG_SOUND_ROUTE(1, "2610.1.l", 8.0)
r22745r22746
36033593   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
36043594
36053595   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_32MHz/4)
3606   MCFG_SOUND_CONFIG(ym2610_config)
3596   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
36073597   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
36083598   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
36093599   MCFG_SOUND_ROUTE(1, "2610.1.l", 8.0)
r22745r22746
36653655   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
36663656
36673657   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_32MHz/4)
3668   MCFG_SOUND_CONFIG(ym2610_config)
3658   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoz_state, irqhandler))
36693659   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
36703660   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
36713661   MCFG_SOUND_ROUTE(1, "2610.1.l", 8.0)
trunk/src/mame/drivers/wgp.c
r22745r22746
670670   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")   /* Fallthrough */
671671   AM_RANGE(0x0000, 0x7fff) AM_ROM
672672   AM_RANGE(0xc000, 0xdfff) AM_RAM
673   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
673   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
674674   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
675675   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
676676   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
893893   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
894894}
895895
896static const ym2610_interface ym2610_config =
897{
898   DEVCB_DRIVER_LINE_MEMBER(wgp_state,irqhandler)
899};
900896
901
902897/***********************************************************
903898                      MACHINE DRIVERS
904899
r22745r22746
10101005   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
10111006
10121007   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
1013   MCFG_SOUND_CONFIG(ym2610_config)
1008   MCFG_YM2610_IRQ_HANDLER(WRITELINE(wgp_state, irqhandler))
10141009   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
10151010   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
10161011   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/zn.c
r22745r22746
11661166   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")   /* Fallthrough */
11671167   AM_RANGE(0x0000, 0x7fff) AM_ROM
11681168   AM_RANGE(0xc000, 0xdfff) AM_RAM
1169   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1169   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
11701170   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
11711171   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
11721172   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
11811181   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
11821182}
11831183
1184static const ym2610_interface ym2610_config =
1185{
1186   DEVCB_DRIVER_LINE_MEMBER(zn_state,irqhandler)
1187};
1188
11891184static const tc0140syt_interface coh1000ta_tc0140syt_intf =
11901185{
11911186   "maincpu", "audiocpu"
r22745r22746
11991194   MCFG_NVRAM_ADD_0FILL("eeprom1")
12001195
12011196   MCFG_SOUND_ADD("ymsnd", YM2610B, 16000000/2)
1202   MCFG_SOUND_CONFIG(ym2610_config)
1197   MCFG_YM2610_IRQ_HANDLER(WRITELINE(zn_state, irqhandler))
12031198   MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
12041199   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
12051200   MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
trunk/src/mame/drivers/bbusters.c
r22745r22746
377377
378378static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, bbusters_state )
379379   ADDRESS_MAP_GLOBAL_MASK(0xff)
380   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
380   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
381381   AM_RANGE(0xc0, 0xc1) AM_WRITENOP /* -> Main CPU */
382382ADDRESS_MAP_END
383383
r22745r22746
648648   DEVCB_DRIVER_LINE_MEMBER(bbusters_state,sound_irq)
649649};
650650
651static const ym2610_interface ym2610_config =
652{
653   DEVCB_DRIVER_LINE_MEMBER(bbusters_state,sound_irq)
654};
655
656651/******************************************************************************/
657652
658653void bbusters_state::screen_eof_bbuster(screen_device &screen, bool state)
r22745r22746
694689   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
695690
696691   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
697   MCFG_SOUND_CONFIG(ym2610_config)
692   MCFG_YM2610_IRQ_HANDLER(WRITELINE(bbusters_state, sound_irq))
698693   MCFG_SOUND_ROUTE(0, "lspeaker",  1.0)
699694   MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
700695   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/suprslam.c
r22745r22746
156156   ADDRESS_MAP_GLOBAL_MASK(0xff)
157157   AM_RANGE(0x00, 0x00) AM_WRITE(suprslam_sh_bankswitch_w)
158158   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
159   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
159   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
160160ADDRESS_MAP_END
161161
162162/*** INPUT PORTS *************************************************************/
r22745r22746
281281   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
282282}
283283
284static const ym2610_interface ym2610_config =
285{
286   DEVCB_DRIVER_LINE_MEMBER(suprslam_state,irqhandler)
287};
288
289284/*** MACHINE DRIVER **********************************************************/
290285
291286static const k053936_interface suprslam_k053936_intf =
r22745r22746
340335   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
341336
342337   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
343   MCFG_SOUND_CONFIG(ym2610_config)
338   MCFG_YM2610_IRQ_HANDLER(WRITELINE(suprslam_state, irqhandler))
344339   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
345340   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
346341   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/neoprint.c
r22745r22746
335335static ADDRESS_MAP_START( neoprint_audio_io_map, AS_IO, 8, neoprint_state )
336336   /*AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, audio_cpu_clear_nmi_w);*/  /* may not and NMI clear */
337337   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r) AM_WRITENOP
338   AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
338   AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
339339//  AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */
340340//  AM_RANGE(0x08, 0x08) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_f000_f7ff_r)
341341//  AM_RANGE(0x09, 0x09) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_e000_efff_r)
r22745r22746
458458   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
459459}
460460
461static const ym2610_interface ym2610_config =
462{
463   DEVCB_DRIVER_LINE_MEMBER(neoprint_state,audio_cpu_irq)
464};
465461
466
467462static MACHINE_CONFIG_START( neoprint, neoprint_state )
468463   MCFG_CPU_ADD("maincpu", M68000, 12000000)
469464   MCFG_CPU_PROGRAM_MAP(neoprint_map)
r22745r22746
492487   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
493488
494489   MCFG_SOUND_ADD("ymsnd", YM2610, 24000000 / 3)
495   MCFG_SOUND_CONFIG(ym2610_config)
490   MCFG_YM2610_IRQ_HANDLER(WRITELINE(neoprint_state, audio_cpu_irq))
496491   MCFG_SOUND_ROUTE(0, "lspeaker",  0.60)
497492   MCFG_SOUND_ROUTE(0, "rspeaker", 0.60)
498493   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
534529   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
535530
536531   MCFG_SOUND_ADD("ymsnd", YM2610, 24000000 / 3)
537   MCFG_SOUND_CONFIG(ym2610_config)
532   MCFG_YM2610_IRQ_HANDLER(WRITELINE(neoprint_state, audio_cpu_irq))
538533   MCFG_SOUND_ROUTE(0, "lspeaker",  0.60)
539534   MCFG_SOUND_ROUTE(0, "rspeaker", 0.60)
540535   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/pipedrm.c
r22745r22746
324324   AM_RANGE(0x04, 0x04) AM_WRITE(sound_bankswitch_w)
325325   AM_RANGE(0x16, 0x16) AM_READ(sound_command_r)
326326   AM_RANGE(0x17, 0x17) AM_WRITE(pending_command_clear_w)
327   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
327   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
328328ADDRESS_MAP_END
329329
330330
r22745r22746
592592};
593593
594594
595static const ym2610_interface ym2610_config =
596{
597   DEVCB_DRIVER_LINE_MEMBER(pipedrm_state,irqhandler)
598};
599595
600
601
602596/*************************************
603597 *
604598 *  Machine driver
r22745r22746
683677   MCFG_SPEAKER_STANDARD_MONO("mono")
684678
685679   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
686   MCFG_SOUND_CONFIG(ym2610_config)
680   MCFG_YM2610_IRQ_HANDLER(WRITELINE(pipedrm_state, irqhandler))
687681   MCFG_SOUND_ROUTE(0, "mono", 0.50)
688682   MCFG_SOUND_ROUTE(1, "mono", 1.0)
689683   MCFG_SOUND_ROUTE(2, "mono", 1.0)
trunk/src/mame/drivers/metro.c
r22745r22746
16091609   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
16101610}
16111611
1612static const ym2610_interface blzntrnd_ym2610_interface =
1613{
1614   DEVCB_DRIVER_LINE_MEMBER(metro_state,blzntrnd_irqhandler)
1615};
1616
16171612static ADDRESS_MAP_START( blzntrnd_sound_map, AS_PROGRAM, 8, metro_state )
16181613   AM_RANGE(0x0000, 0x7fff) AM_ROM
16191614   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
r22745r22746
16241619   ADDRESS_MAP_GLOBAL_MASK(0xff)
16251620   AM_RANGE(0x00, 0x00) AM_WRITE(blzntrnd_sh_bankswitch_w)
16261621   AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) AM_WRITENOP
1627   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
1622   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
16281623ADDRESS_MAP_END
16291624
16301625static ADDRESS_MAP_START( blzntrnd_map, AS_PROGRAM, 16, metro_state )
r22745r22746
44384433   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
44394434
44404435   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2)
4441   MCFG_SOUND_CONFIG(blzntrnd_ym2610_interface)
4436   MCFG_YM2610_IRQ_HANDLER(WRITELINE(metro_state, blzntrnd_irqhandler))
44424437   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
44434438   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
44444439   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r22745r22746
44854480   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
44864481
44874482   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2)
4488   MCFG_SOUND_CONFIG(blzntrnd_ym2610_interface)
4483   MCFG_YM2610_IRQ_HANDLER(WRITELINE(metro_state, blzntrnd_irqhandler))
44894484   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
44904485   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
44914486   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/warriorb.c
r22745r22746
258258   AM_RANGE(0x0000, 0x3fff) AM_ROM
259259   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
260260   AM_RANGE(0xc000, 0xdfff) AM_RAM
261   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
261   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
262262   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
263263   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
264264   AM_RANGE(0xe400, 0xe403) AM_WRITE(warriorb_pancontrol) /* pan */
r22745r22746
424424   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
425425}
426426
427static const ym2610_interface ym2610_config =
428{
429   DEVCB_DRIVER_LINE_MEMBER(warriorb_state,irqhandler)
430};
431
432427/***********************************************************
433428                       MACHINE DRIVERS
434429***********************************************************/
r22745r22746
561556   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
562557
563558   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
564   MCFG_SOUND_CONFIG(ym2610_config)
559   MCFG_YM2610_IRQ_HANDLER(WRITELINE(warriorb_state, irqhandler))
565560   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
566561   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
567562   MCFG_SOUND_ROUTE(1, "2610.1.l", 1.0)
r22745r22746
624619   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
625620
626621   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
627   MCFG_SOUND_CONFIG(ym2610_config)
622   MCFG_YM2610_IRQ_HANDLER(WRITELINE(warriorb_state, irqhandler))
628623   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
629624   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
630625   MCFG_SOUND_ROUTE(1, "2610.1.l", 1.0)
trunk/src/mame/drivers/taito_b.c
r22745r22746
734734   AM_RANGE(0x0000, 0x3fff) AM_ROM
735735   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
736736   AM_RANGE(0xc000, 0xdfff) AM_RAM
737   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
737   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
738738   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
739739   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
740740   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
r22745r22746
18951895   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
18961896}
18971897
1898static const ym2610_interface ym2610_config =
1899{
1900   DEVCB_DRIVER_LINE_MEMBER(taitob_state,irqhandler)
1901};
1902
19031898static const ym2203_interface ym2203_config =
19041899{
19051900   {
r22745r22746
20492044   MCFG_SPEAKER_STANDARD_MONO("mono")
20502045
20512046   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2052   MCFG_SOUND_CONFIG(ym2610_config)
2047   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
20532048   MCFG_SOUND_ROUTE(0, "mono", 0.25)
20542049   MCFG_SOUND_ROUTE(1, "mono", 1.0)
20552050   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
20932088   MCFG_SPEAKER_STANDARD_MONO("mono")
20942089
20952090   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2096   MCFG_SOUND_CONFIG(ym2610_config)
2091   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
20972092   MCFG_SOUND_ROUTE(0, "mono", 0.25)
20982093   MCFG_SOUND_ROUTE(1, "mono", 1.0)
20992094   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
21372132   MCFG_SPEAKER_STANDARD_MONO("mono")
21382133
21392134   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2140   MCFG_SOUND_CONFIG(ym2610_config)
2135   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
21412136   MCFG_SOUND_ROUTE(0, "mono", 0.25)
21422137   MCFG_SOUND_ROUTE(1, "mono", 1.0)
21432138   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
21812176   MCFG_SPEAKER_STANDARD_MONO("mono")
21822177
21832178   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2184   MCFG_SOUND_CONFIG(ym2610_config)
2179   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
21852180   MCFG_SOUND_ROUTE(0, "mono", 0.25)
21862181   MCFG_SOUND_ROUTE(1, "mono", 1.0)
21872182   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
23172312   MCFG_SPEAKER_STANDARD_MONO("mono")
23182313
23192314   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2)   /* verified on pcb */
2320   MCFG_SOUND_CONFIG(ym2610_config)
2315   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
23212316   MCFG_SOUND_ROUTE(0, "mono", 0.25)
23222317   MCFG_SOUND_ROUTE(1, "mono", 1.0)
23232318   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
23612356   MCFG_SPEAKER_STANDARD_MONO("mono")
23622357
23632358   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2)   /* verified on pcb */
2364   MCFG_SOUND_CONFIG(ym2610_config)
2359   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
23652360   MCFG_SOUND_ROUTE(0, "mono", 0.25)
23662361   MCFG_SOUND_ROUTE(1, "mono", 1.0)
23672362   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
24082403   MCFG_SPEAKER_STANDARD_MONO("mono")
24092404
24102405   MCFG_SOUND_ADD("ymsnd", YM2610B, 8000000)
2411   MCFG_SOUND_CONFIG(ym2610_config)
2406   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
24122407   MCFG_SOUND_ROUTE(0, "mono", 0.25)
24132408   MCFG_SOUND_ROUTE(1, "mono", 1.0)
24142409   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
24562451   MCFG_SPEAKER_STANDARD_MONO("mono")
24572452
24582453   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2459   MCFG_SOUND_CONFIG(ym2610_config)
2454   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
24602455   MCFG_SOUND_ROUTE(0, "mono", 0.25)
24612456   MCFG_SOUND_ROUTE(1, "mono", 1.0)
24622457   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
25002495   MCFG_SPEAKER_STANDARD_MONO("mono")
25012496
25022497   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2503   MCFG_SOUND_CONFIG(ym2610_config)
2498   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
25042499   MCFG_SOUND_ROUTE(0, "mono", 0.25)
25052500   MCFG_SOUND_ROUTE(1, "mono", 1.0)
25062501   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
25482543   MCFG_SPEAKER_STANDARD_MONO("mono")
25492544
25502545   MCFG_SOUND_ADD("ymsnd", YM2610B, 8000000)
2551   MCFG_SOUND_CONFIG(ym2610_config)
2546   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
25522547   MCFG_SOUND_ROUTE(0, "mono", 0.25)
25532548   MCFG_SOUND_ROUTE(1, "mono", 1.0)
25542549   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
26842679   MCFG_SPEAKER_STANDARD_MONO("mono")
26852680
26862681   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2687   MCFG_SOUND_CONFIG(ym2610_config)
2682   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
26882683   MCFG_SOUND_ROUTE(0, "mono", 0.25)
26892684   MCFG_SOUND_ROUTE(1, "mono", 1.0)
26902685   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
27282723   MCFG_SPEAKER_STANDARD_MONO("mono")
27292724
27302725   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2731   MCFG_SOUND_CONFIG(ym2610_config)
2726   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
27322727   MCFG_SOUND_ROUTE(0, "mono", 0.25)
27332728   MCFG_SOUND_ROUTE(1, "mono", 1.0)
27342729   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
27812776   MCFG_SPEAKER_STANDARD_MONO("mono")
27822777
27832778   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
2784   MCFG_SOUND_CONFIG(ym2610_config)
2779   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
27852780   MCFG_SOUND_ROUTE(0, "mono", 0.25)
27862781   MCFG_SOUND_ROUTE(1, "mono", 1.0)
27872782   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
28322827   MCFG_SPEAKER_STANDARD_MONO("mono")
28332828
28342829   MCFG_SOUND_ADD("ymsnd", YM2610B, 8000000)
2835   MCFG_SOUND_CONFIG(ym2610_config)
2830   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
28362831   MCFG_SOUND_ROUTE(0, "mono", 0.25)
28372832   MCFG_SOUND_ROUTE(1, "mono", 1.0)
28382833   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
28842879   MCFG_SPEAKER_STANDARD_MONO("mono")
28852880
28862881   MCFG_SOUND_ADD("ymsnd", YM2610B, 8000000)
2887   MCFG_SOUND_CONFIG(ym2610_config)
2882   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler))
28882883   MCFG_SOUND_ROUTE(0, "mono", 0.25)
28892884   MCFG_SOUND_ROUTE(1, "mono", 1.0)
28902885   MCFG_SOUND_ROUTE(2, "mono", 1.0)
trunk/src/mame/drivers/ninjaw.c
r22745r22746
488488   AM_RANGE(0x0000, 0x3fff) AM_ROM
489489   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
490490   AM_RANGE(0xc000, 0xdfff) AM_RAM
491   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
491   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
492492   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
493493   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r,tc0140syt_slave_comm_w)
494494   AM_RANGE(0xe400, 0xe403) AM_WRITE(ninjaw_pancontrol) /* pan */
r22745r22746
640640   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
641641}
642642
643static const ym2610_interface ym2610_config =
644{
645   DEVCB_DRIVER_LINE_MEMBER(ninjaw_state,irqhandler)
646};
647643
648
649644/**************************************************************
650645                 SUBWOOFER (SOUND)
651646**************************************************************/
r22745r22746
869864   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
870865
871866   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
872   MCFG_SOUND_CONFIG(ym2610_config)
867   MCFG_YM2610_IRQ_HANDLER(WRITELINE(ninjaw_state, irqhandler))
873868   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
874869   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
875870   MCFG_SOUND_ROUTE(1, "2610.1.l", 1.0)
r22745r22746
949944   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
950945
951946   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
952   MCFG_SOUND_CONFIG(ym2610_config)
947   MCFG_YM2610_IRQ_HANDLER(WRITELINE(ninjaw_state, irqhandler))
953948   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
954949   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
955950   MCFG_SOUND_ROUTE(1, "2610.1.l", 1.0)
trunk/src/mame/drivers/othunder.c
r22745r22746
465465   AM_RANGE(0x0000, 0x3fff) AM_ROM
466466   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
467467   AM_RANGE(0xc000, 0xdfff) AM_RAM
468   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
468   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
469469   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
470470   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
471471   AM_RANGE(0xe400, 0xe403) AM_WRITE(othunder_TC0310FAM_w) /* pan */
r22745r22746
623623   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
624624}
625625
626static const ym2610_interface ym2610_config =
627{
628   DEVCB_DRIVER_LINE_MEMBER(othunder_state,irqhandler)
629};
630626
631627
632
633628/***********************************************************
634629                 MACHINE DRIVERS
635630***********************************************************/
r22745r22746
713708   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
714709
715710   MCFG_SOUND_ADD("ymsnd", YM2610, 16000000/2)
716   MCFG_SOUND_CONFIG(ym2610_config)
711   MCFG_YM2610_IRQ_HANDLER(WRITELINE(othunder_state, irqhandler))
717712   MCFG_SOUND_ROUTE(0, "2610.0l", 0.25)
718713   MCFG_SOUND_ROUTE(0, "2610.0r", 0.25)
719714   MCFG_SOUND_ROUTE(1, "2610.1l", 1.0)
trunk/src/mame/drivers/mcatadv.c
r22745r22746
213213   AM_RANGE(0x0000, 0x3fff) AM_ROM                     // ROM
214214   AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank1")                // ROM
215215   AM_RANGE(0xc000, 0xdfff) AM_RAM                     // RAM
216   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
216   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
217217   AM_RANGE(0xf000, 0xf000) AM_WRITE(mcatadv_sound_bw_w)
218218ADDRESS_MAP_END
219219
r22745r22746
231231
232232static ADDRESS_MAP_START( nost_sound_io_map, AS_IO, 8, mcatadv_state )
233233   ADDRESS_MAP_GLOBAL_MASK(0xff)
234   AM_RANGE(0x00, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym2610_w)
235   AM_RANGE(0x04, 0x07) AM_DEVREAD_LEGACY("ymsnd", ym2610_r)
234   AM_RANGE(0x00, 0x03) AM_DEVWRITE("ymsnd", ym2610_device, write)
235   AM_RANGE(0x04, 0x07) AM_DEVREAD("ymsnd", ym2610_device, read)
236236   AM_RANGE(0x40, 0x40) AM_WRITE(mcatadv_sound_bw_w)
237237   AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w)
238238ADDRESS_MAP_END
r22745r22746
417417   m_soundcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
418418}
419419
420static const ym2610_interface mcatadv_ym2610_interface =
421{
422   DEVCB_DRIVER_LINE_MEMBER(mcatadv_state,sound_irq)   /* irq */
423};
424420
425
426421void mcatadv_state::machine_start()
427422{
428423   UINT8 *ROM = memregion("soundcpu")->base();
r22745r22746
466461   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
467462
468463   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2) /* verified on pcb */
469   MCFG_SOUND_CONFIG(mcatadv_ym2610_interface)
464   MCFG_YM2610_IRQ_HANDLER(WRITELINE(mcatadv_state, sound_irq))
470465   MCFG_SOUND_ROUTE(0, "lspeaker",  0.32)
471466   MCFG_SOUND_ROUTE(0, "rspeaker", 0.32)
472467   MCFG_SOUND_ROUTE(1, "lspeaker",  0.5)
trunk/src/mame/drivers/2mindril.c
r22745r22746
211211   AM_RANGE(0x460010, 0x46001f) AM_WRITE(f3_control_1_w)
212212   AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram")
213213   AM_RANGE(0x502022, 0x502023) AM_WRITENOP //countinously switches between 0 and 2
214   AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2610_r, ym2610_w, 0x00ff)
214   AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8("ymsnd", ym2610_device, read, write, 0x00ff)
215215   AM_RANGE(0x60000c, 0x60000d) AM_READWRITE(drill_irq_r,drill_irq_w)
216216   AM_RANGE(0x60000e, 0x60000f) AM_RAM // unknown purpose, zeroed at start-up and nothing else
217217   AM_RANGE(0x700000, 0x70000f) AM_READWRITE(drill_io_r,drill_io_w) AM_SHARE("iodata") // i/o
r22745r22746
415415//  m_maincpu->set_input_line(5, state ? ASSERT_LINE : CLEAR_LINE);
416416}
417417
418static const ym2610_interface ym2610_config =
419{
420   DEVCB_DRIVER_LINE_MEMBER(_2mindril_state,irqhandler)
421};
422418
423
424419MACHINE_START_MEMBER(_2mindril_state,drill)
425420{
426421   save_item(NAME(m_defender_sensor));
r22745r22746
460455   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
461456
462457   MCFG_SOUND_ADD("ymsnd", YM2610B, 16000000/2)
463   MCFG_SOUND_CONFIG(ym2610_config)
458   MCFG_YM2610_IRQ_HANDLER(WRITELINE(_2mindril_state, irqhandler))
464459   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
465460   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
466461   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/taotaido.c
r22745r22746
137137
138138static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, taotaido_state )
139139   ADDRESS_MAP_GLOBAL_MASK(0xff)
140   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
140   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
141141   AM_RANGE(0x04, 0x04) AM_WRITE(taotaido_sh_bankswitch_w)
142142   AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
143143   AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
r22745r22746
325325   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
326326}
327327
328static const ym2610_interface ym2610_config =
329{
330   DEVCB_DRIVER_LINE_MEMBER(taotaido_state,irqhandler)
331};
332328
333329
334
335330static MACHINE_CONFIG_START( taotaido, taotaido_state )
336331   MCFG_CPU_ADD("maincpu", M68000, 32000000/2)
337332   MCFG_CPU_PROGRAM_MAP(main_map)
r22745r22746
362357   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
363358
364359   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
365   MCFG_SOUND_CONFIG(ym2610_config)
360   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taotaido_state, irqhandler))
366361   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
367362   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
368363   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/crshrace.c
r22745r22746
214214   ADDRESS_MAP_GLOBAL_MASK(0xff)
215215   AM_RANGE(0x00, 0x00) AM_WRITE(crshrace_sh_bankswitch_w)
216216   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
217   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
217   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
218218ADDRESS_MAP_END
219219
220220
r22745r22746
425425   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
426426}
427427
428static const ym2610_interface ym2610_config =
429{
430   DEVCB_DRIVER_LINE_MEMBER(crshrace_state,irqhandler)
431};
432
433428static const k053936_interface crshrace_k053936_intf =
434429{
435430   1, -48, -21 /* wrap, xoff, yoff */
r22745r22746
491486   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
492487
493488   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
494   MCFG_SOUND_CONFIG(ym2610_config)
489   MCFG_YM2610_IRQ_HANDLER(WRITELINE(crshrace_state, irqhandler))
495490   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
496491   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
497492   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
trunk/src/mame/drivers/taito_h.c
r22745r22746
161161   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
162162}
163163
164static const ym2610_interface ym2610_config =
165{
166   DEVCB_DRIVER_LINE_MEMBER(taitoh_state,irqhandler)
167};
168164
169
170165/***************************************************************************
171166
172167  Memory Handler(s)
r22745r22746
283278   AM_RANGE(0x0000, 0x3fff) AM_ROM
284279   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
285280   AM_RANGE(0xc000, 0xdfff) AM_RAM
286   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
281   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
287282   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
288283   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
289284   AM_RANGE(0xe400, 0xe403) AM_WRITENOP        /* pan control */
r22745r22746
587582   MCFG_SPEAKER_STANDARD_MONO("mono")
588583
589584   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)
590   MCFG_SOUND_CONFIG(ym2610_config)
585   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoh_state, irqhandler))
591586   MCFG_SOUND_ROUTE(0, "mono", 0.25)
592587   MCFG_SOUND_ROUTE(1, "mono", 1.0)
593588   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
628623   MCFG_SPEAKER_STANDARD_MONO("mono")
629624
630625   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)
631   MCFG_SOUND_CONFIG(ym2610_config)
626   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoh_state, irqhandler))
632627   MCFG_SOUND_ROUTE(0, "mono", 0.25)
633628   MCFG_SOUND_ROUTE(1, "mono", 1.0)
634629   MCFG_SOUND_ROUTE(2, "mono", 1.0)
r22745r22746
669664   MCFG_SPEAKER_STANDARD_MONO("mono")
670665
671666   MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)
672   MCFG_SOUND_CONFIG(ym2610_config)
667   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitoh_state, irqhandler))
673668   MCFG_SOUND_ROUTE(0, "mono", 0.25)
674669   MCFG_SOUND_ROUTE(1, "mono", 1.0)
675670   MCFG_SOUND_ROUTE(2, "mono", 1.0)
trunk/src/emu/sound/2610intf.c
r22745r22746
1616#include "2610intf.h"
1717#include "fm.h"
1818
19struct ym2610_state
20{
21   sound_stream *  stream;
22   emu_timer *     timer[2];
23   void *          chip;
24   void *          psg;
25   const ym2610_interface *intf;
26   device_t *device;
27   devcb_resolved_write_line irqhandler;
28};
29
30
31INLINE ym2610_state *get_safe_token(device_t *device)
32{
33   assert(device != NULL);
34   assert(device->type() == YM2610 || device->type() == YM2610B);
35   return (ym2610_state *)downcast<ym2610_device *>(device)->token();
36}
37
38
3919static void psg_set_clock(void *param, int clock)
4020{
41   ym2610_state *info = (ym2610_state *)param;
42   ay8910_set_clock_ym(info->psg, clock);
21   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
22   ay8910_set_clock_ym(ym2610->_psg(), clock);
4323}
4424
4525static void psg_write(void *param, int address, int data)
4626{
47   ym2610_state *info = (ym2610_state *)param;
48   ay8910_write_ym(info->psg, address, data);
27   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
28   ay8910_write_ym(ym2610->_psg(), address, data);
4929}
5030
5131static int psg_read(void *param)
5232{
53   ym2610_state *info = (ym2610_state *)param;
54   return ay8910_read_ym(info->psg);
33   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
34   return ay8910_read_ym(ym2610->_psg());
5535}
5636
5737static void psg_reset(void *param)
5838{
59   ym2610_state *info = (ym2610_state *)param;
60   ay8910_reset_ym(info->psg);
39   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
40   ay8910_reset_ym(ym2610->_psg());
6141}
6242
6343static const ssg_callbacks psgintf =
r22745r22746
6848   psg_reset
6949};
7050
51void *ym2610_device::_psg()
52{
53   return m_psg;
54}
55
7156/*------------------------- TM2610 -------------------------------*/
7257/* IRQ Handler */
7358static void IRQHandler(void *param,int irq)
7459{
75   ym2610_state *info = (ym2610_state *)param;
76   if (!info->irqhandler.isnull())
77      info->irqhandler(irq);
60   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
61   ym2610->_IRQHandler(irq);
7862}
7963
80/* Timer overflow callback from timer.c */
81static TIMER_CALLBACK( timer_callback_0 )
64void ym2610_device::_IRQHandler(int irq)
8265{
83   ym2610_state *info = (ym2610_state *)ptr;
84   ym2610_timer_over(info->chip,0);
66   if (!m_irq_handler.isnull())
67      m_irq_handler(irq);
8568}
8669
87static TIMER_CALLBACK( timer_callback_1 )
70/* Timer overflow callback from timer.c */
71void ym2610_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
8872{
89   ym2610_state *info = (ym2610_state *)ptr;
90   ym2610_timer_over(info->chip,1);
73   switch(id)
74   {
75   case 0:
76      ym2610_timer_over(m_chip,0);
77      break;
78
79   case 1:
80      ym2610_timer_over(m_chip,1);
81      break;
82   }
9183}
9284
9385static void timer_handler(void *param,int c,int count,int clock)
9486{
95   ym2610_state *info = (ym2610_state *)param;
87   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
88   ym2610->_timer_handler(c, count, clock);
89}
90
91void ym2610_device::_timer_handler(int c,int count,int clock)
92{
9693   if( count == 0 )
9794   {   /* Reset FM Timer */
98      info->timer[c]->enable(false);
95      m_timer[c]->enable(false);
9996   }
10097   else
10198   {   /* Start FM Timer */
10299      attotime period = attotime::from_hz(clock) * count;
103100
104      if (!info->timer[c]->enable(true))
105         info->timer[c]->adjust(period);
101      if (!m_timer[c]->enable(true))
102         m_timer[c]->adjust(period);
106103   }
107104}
108105
109106/* update request from fm.c */
110107void ym2610_update_request(void *param)
111108{
112   ym2610_state *info = (ym2610_state *)param;
113   info->stream->update();
109   ym2610_device *ym2610 = downcast<ym2610_device *>(param);
110   ym2610->_ym2610_update_request();
114111}
115112
113void ym2610_device::_ym2610_update_request()
114{
115   m_stream->update();
116}
116117
117static STREAM_UPDATE( ym2610_stream_update )
118//-------------------------------------------------
119//  sound_stream_update - handle a stream update
120//-------------------------------------------------
121
122void ym2610_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
118123{
119   ym2610_state *info = (ym2610_state *)param;
120   ym2610_update_one(info->chip, outputs, samples);
124   ym2610_update_one(m_chip, outputs, samples);
121125}
122126
123static STREAM_UPDATE( ym2610b_stream_update )
127//-------------------------------------------------
128//  sound_stream_update - handle a stream update
129//-------------------------------------------------
130
131void ym2610b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
124132{
125   ym2610_state *info = (ym2610_state *)param;
126   ym2610b_update_one(info->chip, outputs, samples);
133   ym2610b_update_one(m_chip, outputs, samples);
127134}
128135
129136
130static void ym2610_intf_postload(ym2610_state *info)
137void ym2610_device::device_post_load()
131138{
132   ym2610_postload(info->chip);
139   ym2610_postload(m_chip);
133140}
134141
135142
136static DEVICE_START( ym2610 )
143//-------------------------------------------------
144//  device_start - device-specific startup
145//-------------------------------------------------
146
147void ym2610_device::device_start()
137148{
138   static const ym2610_interface generic_2610 = { DEVCB_NULL };
139149   static const ay8910_interface generic_ay8910 =
140150   {
141151      AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
142152      AY8910_DEFAULT_LOADS,
143153      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
144154   };
145   const ym2610_interface *intf = device->static_config() ? (const ym2610_interface *)device->static_config() : &generic_2610;
146   int rate = device->clock()/72;
155   
156   int rate = clock()/72;
147157   void *pcmbufa,*pcmbufb;
148158   int  pcmsizea,pcmsizeb;
149   ym2610_state *info = get_safe_token(device);
150159   astring name;
151   device_type type = device->type();
152160
153   info->intf = intf;
154   info->device = device;
155   info->irqhandler.resolve(intf->irqhandler, *device);
156   info->psg = ay8910_start_ym(NULL, device->type(), device, device->clock(), &generic_ay8910);
157   assert_always(info->psg != NULL, "Error creating YM2610/AY8910 chip");
161   m_irq_handler.resolve();
162   m_psg = ay8910_start_ym(NULL, type(), this, clock(), &generic_ay8910);
163   assert_always(m_psg != NULL, "Error creating YM2610/AY8910 chip");
158164
159165   /* Timer Handler set */
160   info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
161   info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
166   m_timer[0] = timer_alloc(0);
167   m_timer[1] = timer_alloc(1);
162168
163169   /* stream system initialize */
164   info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
170   m_stream = machine().sound().stream_alloc(*this,0,2,rate);
165171   /* setup adpcm buffers */
166   pcmbufa  = *device->region();
167   pcmsizea = device->region()->bytes();
168   name.printf("%s.deltat", device->tag());
169   pcmbufb  = (void *)(device->machine().root_device().memregion(name)->base());
170   pcmsizeb = device->machine().root_device().memregion(name)->bytes();
172   pcmbufa  = *region();
173   pcmsizea = region()->bytes();
174   name.printf("%s.deltat", tag());
175   pcmbufb  = (void *)(machine().root_device().memregion(name)->base());
176   pcmsizeb = machine().root_device().memregion(name)->bytes();
171177   if (pcmbufb == NULL || pcmsizeb == 0)
172178   {
173179      pcmbufb = pcmbufa;
r22745r22746
175181   }
176182
177183   /**** initialize YM2610 ****/
178   info->chip = ym2610_init(info,device,device->clock(),rate,
184   m_chip = ym2610_init(this,this,clock(),rate,
179185               pcmbufa,pcmsizea,pcmbufb,pcmsizeb,
180186               timer_handler,IRQHandler,&psgintf);
181   assert_always(info->chip != NULL, "Error creating YM2610 chip");
182
183   device->machine().save().register_postload(save_prepost_delegate(FUNC(ym2610_intf_postload), info));
187   assert_always(m_chip != NULL, "Error creating YM2610 chip");
184188}
185189
186static DEVICE_STOP( ym2610 )
190//-------------------------------------------------
191//  device_stop - device-specific stop
192//-------------------------------------------------
193
194void ym2610_device::device_stop()
187195{
188   ym2610_state *info = get_safe_token(device);
189   ym2610_shutdown(info->chip);
190   ay8910_stop_ym(info->psg);
196   ym2610_shutdown(m_chip);
197   ay8910_stop_ym(m_psg);
191198}
192199
193static DEVICE_RESET( ym2610 )
200//-------------------------------------------------
201//  device_reset - device-specific reset
202//-------------------------------------------------
203
204void ym2610_device::device_reset()
194205{
195   ym2610_state *info = get_safe_token(device);
196   ym2610_reset_chip(info->chip);
206   ym2610_reset_chip(m_chip);
197207}
198208
199209
200READ8_DEVICE_HANDLER( ym2610_r )
210READ8_MEMBER( ym2610_device::read )
201211{
202   ym2610_state *info = get_safe_token(device);
203   return ym2610_read(info->chip, offset & 3);
212   return ym2610_read(m_chip, offset & 3);
204213}
205214
206WRITE8_DEVICE_HANDLER( ym2610_w )
215WRITE8_MEMBER( ym2610_device::write )
207216{
208   ym2610_state *info = get_safe_token(device);
209   ym2610_write(info->chip, offset & 3, data);
217   ym2610_write(m_chip, offset & 3, data);
210218}
211219
212220
213READ8_DEVICE_HANDLER( ym2610_status_port_a_r ) { return ym2610_r(device, space, 0); }
214READ8_DEVICE_HANDLER( ym2610_status_port_b_r ) { return ym2610_r(device, space, 2); }
215READ8_DEVICE_HANDLER( ym2610_read_port_r ) { return ym2610_r(device, space, 1); }
216
217WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w ) { ym2610_w(device, space, 0, data); }
218WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w ) { ym2610_w(device, space, 2, data); }
219WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w ) { ym2610_w(device, space, 1, data); }
220WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w ) { ym2610_w(device, space, 3, data); }
221
222221const device_type YM2610 = &device_creator<ym2610_device>;
223222
224223ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
225224   : device_t(mconfig, YM2610, "YM2610", tag, owner, clock),
226      device_sound_interface(mconfig, *this)
225      device_sound_interface(mconfig, *this),
226      m_irq_handler(*this)
227227{
228   m_token = global_alloc_clear(ym2610_state);
229228}
229
230230ym2610_device::ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
231231   : device_t(mconfig, type, name, tag, owner, clock),
232      device_sound_interface(mconfig, *this)
232      device_sound_interface(mconfig, *this),
233      m_irq_handler(*this)
233234{
234   m_token = global_alloc_clear(ym2610_state);
235235}
236236
237237//-------------------------------------------------
r22745r22746
244244{
245245}
246246
247//-------------------------------------------------
248//  device_start - device-specific startup
249//-------------------------------------------------
250
251void ym2610_device::device_start()
252{
253   DEVICE_START_NAME( ym2610 )(this);
254}
255
256//-------------------------------------------------
257//  device_reset - device-specific reset
258//-------------------------------------------------
259
260void ym2610_device::device_reset()
261{
262   DEVICE_RESET_NAME( ym2610 )(this);
263}
264
265//-------------------------------------------------
266//  device_stop - device-specific stop
267//-------------------------------------------------
268
269void ym2610_device::device_stop()
270{
271   DEVICE_STOP_NAME( ym2610 )(this);
272}
273
274//-------------------------------------------------
275//  sound_stream_update - handle a stream update
276//-------------------------------------------------
277
278void ym2610_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
279{
280   // should never get here
281   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
282}
283
284
285247const device_type YM2610B = &device_creator<ym2610b_device>;
286248
287249ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
288250   : ym2610_device(mconfig, YM2610B, "YM2610B", tag, owner, clock)
289251{
290252}
291
292//-------------------------------------------------
293//  sound_stream_update - handle a stream update
294//-------------------------------------------------
295
296void ym2610b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
297{
298   // should never get here
299   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
300}
trunk/src/emu/sound/2610intf.h
r22745r22746
33#ifndef __2610INTF_H__
44#define __2610INTF_H__
55
6#include "devlegcy.h"
6#include "emu.h"
77#include "fm.h"
88
9
109void ym2610_update_request(void *param);
1110
12struct ym2610_interface
13{
14   devcb_write_line irqhandler; /* IRQ handler for the YM2610 */
15};
11#define MCFG_YM2610_IRQ_HANDLER(_devcb) \
12   devcb = &ym2610_device::set_irq_handler(*device, DEVCB2_##_devcb);
1613
17DECLARE_READ8_DEVICE_HANDLER( ym2610_r );
18DECLARE_WRITE8_DEVICE_HANDLER( ym2610_w );
19
20DECLARE_READ8_DEVICE_HANDLER( ym2610_status_port_a_r );
21DECLARE_READ8_DEVICE_HANDLER( ym2610_status_port_b_r );
22DECLARE_READ8_DEVICE_HANDLER( ym2610_read_port_r );
23
24DECLARE_WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w );
25DECLARE_WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w );
26DECLARE_WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
27DECLARE_WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
28
29
3014class ym2610_device : public device_t,
3115                           public device_sound_interface
3216{
3317public:
3418   ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3519   ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
36   ~ym2610_device() { global_free(m_token); }
3720
38   // access to legacy token
39   void *token() const { assert(m_token != NULL); return m_token; }
21   // static configuration helpers
22   template<class _Object> static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast<ym2610_device &>(device).m_irq_handler.set_callback(object); }
23
24   DECLARE_READ8_MEMBER( read );
25   DECLARE_WRITE8_MEMBER( write );
26
27   void *_psg();
28   void _IRQHandler(int irq);
29   void _timer_handler(int c,int count,int clock);
30   void _ym2610_update_request();
31
4032protected:
4133   // device-level overrides
4234   virtual void device_config_complete();
4335   virtual void device_start();
36   virtual void device_post_load();
4437   virtual void device_stop();
4538   virtual void device_reset();
4639
40   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
41   
4742   // sound stream update overrides
4843   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
44
45   void *          m_chip;
46
4947private:
5048   // internal state
51   void *m_token;
49   sound_stream *  m_stream;
50   emu_timer *     m_timer[2];
51   void *          m_psg;
52   devcb2_write_line m_irq_handler;
5253};
5354
5455extern const device_type YM2610;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team