static READ8_HANDLER( sound_slave_latch_r ) { /* read latch and clear interrupt */ cpunum_set_input_line(3, M6502_IRQ_LINE, CLEAR_LINE); return slave_sound_latch; }
static READ8_HANDLER( tubep_sound_irq_ack ) { cpunum_set_input_line(2, 0, CLEAR_LINE); return 0; }
static WRITE8_HANDLER( mrflea_io_w ){ mrflea_status |= 0x08; // pending command to IO CPU mrflea_io = data; cpunum_set_input_line( 1, 0, HOLD_LINE ); }
static void firqhandler(int irq) { cpunum_set_input_line(Machine, 1, 1, irq ? ASSERT_LINE : CLEAR_LINE); }
static INTERRUPT_GEN( bzone_interrupt ) { if (readinputport(0) & 0x10) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); }
static void irqhandler(int irq) { cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); }
static INTERRUPT_GEN( capbowl_interrupt ) { if (input_port_read_indexed(machine, 4) & 1) /* get status of the F2 key */ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */ }
static WRITE8_HANDLER( megazone_i8039_irq_w ) { cpunum_set_input_line(2, 0, ASSERT_LINE); }
static WRITE8_HANDLER( i8039_irqen_and_status_w ) { if ((data & 0x80) == 0) cpunum_set_input_line(2, 0, CLEAR_LINE); i8039_status = (data & 0x70) >> 4; }
static void ppu_irq( int num, int *ppu_regs ) { cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE ); }
/***************************************************************************** ** apple1_kbd_poll ** ** Keyboard polling handles both ordinary keys and the special RESET ** and CLEAR SCREEN switches. ** ** For ordinary keys, this implements 2-key rollover to reduce the ** chance of missed keypresses. If we press a key and then press a ** second key while the first hasn't been completely released, as ** might happen during rapid typing, only the second key is ** registered; the first key is ignored. ** ** If multiple newly-pressed keys are found, the one closest to the ** end of the input ports list is counted; the others are ignored. *****************************************************************************/ static void apple1_kbd_poll(int dummy) { int port, bit; int key_pressed; UINT32 shiftkeys, ctrlkeys; /* This holds the values of all the input ports for ordinary keys seen during the last scan. */ static UINT32 kbd_last_scan[] = { 0, 0, 0, 0 }; static int reset_flag = 0; /* First we check the RESET and CLEAR SCREEN pushbutton switches. */ /* The RESET switch resets the CPU and the 6820 PIA. */ if (readinputport(5) & 0x0001) { if (!reset_flag) { reset_flag = 1; /* using PULSE_LINE does not allow us to press and hold key */ cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); pia_reset(); } } else if (reset_flag) { /* RESET released--allow the processor to continue. */ reset_flag = 0; cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE); } /* The CLEAR SCREEN switch clears the video hardware. */ if (readinputport(5) & 0x0002) { if (!apple1_vh_clrscrn_pressed) { /* Ignore further video writes, and clear the screen. */ apple1_vh_clrscrn_pressed = 1; apple1_vh_dsp_clr(); } } else if (apple1_vh_clrscrn_pressed) { /* CLEAR SCREEN released--pay attention to video writes again. */ apple1_vh_clrscrn_pressed = 0; } /* Now we scan all the input ports for ordinary keys, recording new keypresses while ignoring keys that were already pressed in the last scan. */ apple1_kbd_data = 0; key_pressed = 0; /* The keyboard strobe line should always be low when a scan starts. */ pia_set_input_ca1(0, 0); shiftkeys = readinputport(4) & 0x0003; ctrlkeys = readinputport(4) & 0x000c; for (port = 0; port < 4; port++) { UINT32 portval = readinputport(port); UINT32 newkeys = portval & ~(kbd_last_scan[port]); if (newkeys) { key_pressed = 1; for (bit = 0; bit < 16; bit++) { if (newkeys & 1) { apple1_kbd_data = (ctrlkeys) ? apple1_control_keymap[port*16 + bit] : (shiftkeys) ? apple1_shifted_keymap[port*16 + bit] : apple1_unshifted_keymap[port*16 + bit]; } newkeys >>= 1; } } kbd_last_scan[port] = portval; } if (key_pressed) { /* The keyboard will pulse its strobe line when a key is pressed. A 10-usec pulse is typical. */ pia_set_input_ca1(0, 1); timer_set(TIME_IN_USEC(10), 0, apple1_kbd_strobe_end); } }
void triplhnt_hit_callback(int code) { triplhnt_hit_code = code; cpunum_set_input_line(0, 0, HOLD_LINE); }
static void TTL74148_3S_cb(void) { cpunum_set_input_line(0, M6502_IRQ_LINE, TTL74148_output_valid_r(TTL74148_3S) ? CLEAR_LINE : ASSERT_LINE); }
static READ8_HANDLER( sound_nmi_to_slave_r ) { /* a read from here triggers an NMI pulse to the slave */ cpunum_set_input_line(3, INPUT_LINE_NMI, PULSE_LINE); return 0xff; }
static WRITE8_HANDLER( talbot_mcu_halt_w ) { data &= 1; cpunum_set_input_line(1, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); }
static WRITE8_HANDLER( spcforce_soundtrigger_w ) { cpunum_set_input_line(1, 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE); }
static void vdp_interrupt (int state) { cpunum_set_input_line(0,0, HOLD_LINE); }
static INTERRUPT_GEN(lethalen_interrupt) { if (K056832_is_IRQ_enabled(0)) cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); }
static void nmi_callback(int param) { if (sound_nmi_enable) cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); else pending_nmi = 1; sound_state &= ~1; }
static WRITE8_HANDLER( sound_irq_w ) { cpunum_set_input_line(machine, 1, 0, HOLD_LINE); }
static WRITE8_HANDLER( capbowl_sndcmd_w ) { cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); soundlatch_w(machine, offset, data); }
static void sound_nmi(void) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); }
static void sfx_sh_7474_callback(void) { /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ /* we need to complement Q bar */ cpunum_set_input_line(2, 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE); }
static void ipu_ctc_interrupt(int state) { cpunum_set_input_line(Machine, 3, 0, state); }
static void sound_irq(int state) { cpunum_set_input_line(1,1,state); /* IRQ 2 */ }
static void irqhandler(int linestate) { cpunum_set_input_line(1,0,linestate); }
static WRITE8_HANDLER( rjammer_soundlatch_w ) { sound_latch = data; cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); }
static void galaxian_7474_9M_1_callback(void) { /* Q goes to the NMI line */ cpunum_set_input_line(0, irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE); }
static INTERRUPT_GEN( witch_main_interrupt ) { cpunum_set_input_line(0,0,ASSERT_LINE); }
static void master_sound_nmi_callback(int param) { /* bit 0 of the sound control determines if the NMI is actually delivered */ if (sound_control & 0x01) cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); }