static TIMER_CALLBACK(internal_timer_int) { compis_state *state = machine.driver_data<compis_state>(); int which = param; struct timer_state *t = &state->m_i186.timer[which]; if (LOG_TIMER) logerror("Hit interrupt callback for timer %d\n", which); /* set the max count bit */ t->control |= 0x0020; /* request an interrupt */ if (t->control & 0x2000) { state->m_i186.intr.status |= 0x01 << which; update_interrupt_state(machine); if (LOG_TIMER) logerror(" Generating timer interrupt\n"); } /* if we're continuous, reset */ if (t->control & 0x0001) { int count = t->maxA ? t->maxA : 0x10000; t->int_timer->adjust(attotime::from_hz(2000000) * count, which); if (LOG_TIMER) logerror(" Repriming interrupt\n"); } else t->int_timer->adjust(attotime::never, which); }
void z80sio_device::z80daisy_irq_reti() { // loop over all interrupt sources for (int irqsource = 0; irqsource < 8; irqsource++) { int inum = k_int_priority[irqsource]; // find the first channel with an IEO pending if (m_int_state[inum] & Z80_DAISY_IEO) { VPRINTF(("sio IRQReti %d\n", inum)); // clear the IEO state and update the IRQs m_int_state[inum] &= ~Z80_DAISY_IEO; update_interrupt_state(); return; } } logerror("z80sio_irq_reti: failed to find an interrupt to clear IEO on!\n"); }
int z80sio_device::z80daisy_irq_ack() { // loop over all interrupt sources for (int irqsource = 0; irqsource < 8; irqsource++) { int inum = k_int_priority[irqsource]; // find the first channel with an interrupt requested if (m_int_state[inum] & Z80_DAISY_INT) { VPRINTF(("sio IRQAck %d\n", inum)); // clear interrupt, switch to the IEO state, and update the IRQs m_int_state[inum] = Z80_DAISY_IEO; update_interrupt_state(); return m_channel[1].m_regs[2] + inum * 2; } } logerror("z80sio_irq_ack: failed to find an interrupt to ack!\n"); return m_channel[1].m_regs[2]; }
static TIMER_CALLBACK(dma_timer_callback) { compis_state *state = machine.driver_data<compis_state>(); int which = param; struct dma_state *d = &state->m_i186.dma[which]; /* force an update and see if we're really done */ //stream_update(dma_stream, 0); /* complete the status update */ d->control &= ~0x0002; d->source += d->count; d->count = 0; /* check for interrupt generation */ if (d->control & 0x0100) { if (LOG_DMA) logerror("DMA%d timer callback - requesting interrupt: count = %04X, source = %04X\n", which, d->count, d->source); state->m_i186.intr.request |= 0x04 << which; update_interrupt_state(machine); } }