src/mame/drivers/karnov.c
| r14715 | r14716 | |
| 756 | 756 | device_set_input_line(device, 7, HOLD_LINE); /* VBL */ |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | | static void sound_irq( device_t *device, int linestate ) |
| 760 | | { |
| 761 | | karnov_state *state = device->machine().driver_data<karnov_state>(); |
| 762 | | device_set_input_line(state->m_audiocpu, 0, linestate); /* IRQ */ |
| 763 | | } |
| 764 | | |
| 765 | 759 | static const ym3526_interface ym3526_config = |
| 766 | 760 | { |
| 767 | | sound_irq |
| 761 | DEVCB_CPU_INPUT_LINE("audiocpu", M6502_IRQ_LINE) |
| 768 | 762 | }; |
| 769 | 763 | |
| 770 | 764 | /************************************* |
src/mame/drivers/snk.c
| r14715 | r14716 | |
| 457 | 457 | |
| 458 | 458 | |
| 459 | 459 | |
| 460 | | static void ymirq_callback_1(device_t *device, int irq) |
| 460 | static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_1 ) |
| 461 | 461 | { |
| 462 | | if (irq) |
| 462 | if (state) |
| 463 | 463 | device->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_ASSERT); |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | | static void ymirq_callback_2(device_t *device, int irq) |
| 466 | static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_2 ) |
| 467 | 467 | { |
| 468 | | if (irq) |
| 468 | if (state) |
| 469 | 469 | device->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_ASSERT); |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | |
| 473 | 473 | static const ym3526_interface ym3526_config_1 = |
| 474 | 474 | { |
| 475 | | ymirq_callback_1 |
| 475 | DEVCB_LINE(ymirq_callback_1) |
| 476 | 476 | }; |
| 477 | 477 | |
| 478 | 478 | static const ym3526_interface ym3526_config_2 = |
| 479 | 479 | { |
| 480 | | ymirq_callback_2 |
| 480 | DEVCB_LINE(ymirq_callback_2) |
| 481 | 481 | }; |
| 482 | 482 | |
| 483 | 483 | static const ym3812_interface ym3812_config_1 = |
src/mame/drivers/missb2.c
| r14715 | r14716 | |
| 407 | 407 | /* Sound Interfaces */ |
| 408 | 408 | |
| 409 | 409 | // Handler called by the 3526 emulator when the internal timers cause an IRQ |
| 410 | | static void irqhandler(device_t *device, int irq) |
| 410 | static WRITE_LINE_DEVICE_HANDLER( irqhandler ) |
| 411 | 411 | { |
| 412 | 412 | logerror("YM3526 firing an IRQ\n"); |
| 413 | 413 | // cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); |
| r14715 | r14716 | |
| 415 | 415 | |
| 416 | 416 | static const ym3526_interface ym3526_config = |
| 417 | 417 | { |
| 418 | | irqhandler |
| 418 | DEVCB_LINE(irqhandler) |
| 419 | 419 | }; |
| 420 | 420 | |
| 421 | 421 | /* Interrupt Generator */ |
src/mame/drivers/fantland.c
| r14715 | r14716 | |
| 1047 | 1047 | MACHINE_CONFIG_END |
| 1048 | 1048 | |
| 1049 | 1049 | |
| 1050 | | |
| 1051 | | static void wheelrun_ym3526_irqhandler( device_t *device, int state ) |
| 1052 | | { |
| 1053 | | fantland_state *driver = device->machine().driver_data<fantland_state>(); |
| 1054 | | device_set_input_line(driver->m_audio_cpu, INPUT_LINE_IRQ0, state); |
| 1055 | | } |
| 1056 | | |
| 1057 | 1050 | static const ym3526_interface wheelrun_ym3526_interface = |
| 1058 | 1051 | { |
| 1059 | | wheelrun_ym3526_irqhandler |
| 1052 | DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0) |
| 1060 | 1053 | }; |
| 1061 | 1054 | |
| 1062 | 1055 | static MACHINE_CONFIG_START( wheelrun, fantland_state ) |
src/mame/drivers/brkthru.c
| r14715 | r14716 | |
| 354 | 354 | * |
| 355 | 355 | *************************************/ |
| 356 | 356 | |
| 357 | | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 358 | | static void irqhandler( device_t *device, int linestate ) |
| 359 | | { |
| 360 | | brkthru_state *state = device->machine().driver_data<brkthru_state>(); |
| 361 | | device_set_input_line(state->m_audiocpu, M6809_IRQ_LINE, linestate); |
| 362 | | } |
| 363 | | |
| 364 | 357 | static const ym3526_interface ym3526_config = |
| 365 | 358 | { |
| 366 | | irqhandler |
| 359 | DEVCB_CPU_INPUT_LINE("audiocpu", M6809_IRQ_LINE) |
| 367 | 360 | }; |
| 368 | 361 | |
| 369 | 362 | |
src/mame/drivers/suna16.c
| r14715 | r14716 | |
| 910 | 910 | Best Of Best |
| 911 | 911 | ***************************************************************************/ |
| 912 | 912 | |
| 913 | | static void bestbest_ym3526_irqhandler(device_t *device, int state) |
| 914 | | { |
| 915 | | cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_IRQ0, state); |
| 916 | | } |
| 917 | | |
| 918 | 913 | static const ym3526_interface bestbest_ym3526_interface = |
| 919 | 914 | { |
| 920 | | bestbest_ym3526_irqhandler |
| 915 | DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0) |
| 921 | 916 | }; |
| 922 | 917 | |
| 923 | 918 | static WRITE8_DEVICE_HANDLER( bestbest_ay8910_port_a_w ) |
src/mame/drivers/exprraid.c
| r14715 | r14716 | |
| 439 | 439 | |
| 440 | 440 | |
| 441 | 441 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 442 | | static void irqhandler( device_t *device, int linestate ) |
| 442 | static WRITE_LINE_DEVICE_HANDLER( irqhandler ) |
| 443 | 443 | { |
| 444 | | exprraid_state *state = device->machine().driver_data<exprraid_state>(); |
| 445 | | device_set_input_line_and_vector(state->m_slave, 0, linestate, 0xff); |
| 444 | exprraid_state *driver_state = device->machine().driver_data<exprraid_state>(); |
| 445 | device_set_input_line_and_vector(driver_state->m_slave, 0, state, 0xff); |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | static const ym3526_interface ym3526_config = |
| 449 | 449 | { |
| 450 | | irqhandler |
| 450 | DEVCB_LINE(irqhandler) |
| 451 | 451 | }; |
| 452 | 452 | |
| 453 | 453 | #if 0 |
src/emu/sound/3526intf.c
| r14715 | r14716 | |
| 30 | 30 | void * chip; |
| 31 | 31 | const ym3526_interface *intf; |
| 32 | 32 | device_t *device; |
| 33 | |
| 34 | devcb_resolved_write_line out_int_func; |
| 33 | 35 | }; |
| 34 | 36 | |
| 35 | 37 | |
| r14715 | r14716 | |
| 45 | 47 | static void IRQHandler(void *param,int irq) |
| 46 | 48 | { |
| 47 | 49 | ym3526_state *info = (ym3526_state *)param; |
| 48 | | if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE); |
| 50 | info->out_int_func(irq ? ASSERT_LINE : CLEAR_LINE); |
| 49 | 51 | } |
| 50 | 52 | /* Timer overflow callback from timer.c */ |
| 51 | 53 | static TIMER_CALLBACK( timer_callback_0 ) |
| r14715 | r14716 | |
| 88 | 90 | |
| 89 | 91 | static DEVICE_START( ym3526 ) |
| 90 | 92 | { |
| 91 | | static const ym3526_interface dummy = { 0 }; |
| 93 | static const ym3526_interface dummy = { DEVCB_NULL }; |
| 92 | 94 | ym3526_state *info = get_safe_token(device); |
| 93 | 95 | int rate = device->clock()/72; |
| 94 | 96 | |
| 95 | 97 | info->intf = device->static_config() ? (const ym3526_interface *)device->static_config() : &dummy; |
| 96 | 98 | info->device = device; |
| 97 | 99 | |
| 100 | // resolve callbacks |
| 101 | info->out_int_func.resolve(info->intf->out_int_func, *device); |
| 102 | |
| 98 | 103 | /* stream system initialize */ |
| 99 | 104 | info->chip = ym3526_init(device,device->clock(),rate); |
| 100 | 105 | assert_always(info->chip != NULL, "Error creating YM3526 chip"); |