void pic8259_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { /* check the various IRQs */ for (int n = 0, irq = m_prio; n < 8; n++, irq = (irq + 1) & 7) { uint8_t mask = 1 << irq; /* is this IRQ in service and not cascading and sfnm? */ if ((m_isr & mask) && !(m_master && m_cascade && m_nested && (m_slave & mask))) { if (LOG_GENERAL) { logerror("pic8259_timerproc() %s: PIC IRQ #%d still in service\n", tag(), irq); } break; } /* is this IRQ pending and enabled? */ if ((m_state == STATE_READY) && (m_irr & mask) && !(m_imr & mask)) { if (LOG_GENERAL) { logerror("pic8259_timerproc() %s: PIC triggering IRQ #%d\n", tag(), irq); } m_out_int_func(1); return; } // if sfnm and in-service don't continue if((m_isr & mask) && m_master && m_cascade && m_nested && (m_slave & mask)) break; } m_out_int_func(0); }
void z80sti_device::check_interrupts() { if (m_ipr & m_imr) { m_out_int_func(ASSERT_LINE); } else { m_out_int_func(CLEAR_LINE); } }
void msm6242_device::rtc_timer_callback() { static const UINT8 dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; int dpm_count; m_tick++; if(m_irq_flag == 1 && m_irq_type == 0 && ((m_tick % 0x200) == 0)) // 1/64 of second { if ( !m_out_int_func.isnull() ) m_out_int_func( ASSERT_LINE ); } if(m_tick & 0x8000) // 32,768 KHz == 0x8000 ticks { m_tick = 0; m_rtc.sec++; if(m_irq_flag == 1 && m_irq_type == 1) // 1 second clock if ( !m_out_int_func.isnull() ) m_out_int_func(ASSERT_LINE); if(m_rtc.sec >= 60) { m_rtc.min++; m_rtc.sec = 0; if(m_irq_flag == 1 && m_irq_type == 2) // 1 minute clock if ( !m_out_int_func.isnull() ) m_out_int_func(ASSERT_LINE); } if(m_rtc.min >= 60) { m_rtc.hour++; m_rtc.min = 0; if(m_irq_flag == 1 && m_irq_type == 3) // 1 hour clock if ( !m_out_int_func.isnull() ) m_out_int_func(ASSERT_LINE); } if(m_rtc.hour >= 24) { m_rtc.day++; m_rtc.wday++; m_rtc.hour = 0; } if(m_rtc.wday >= 6) { m_rtc.wday = 1; } /* TODO: crude leap year support */ dpm_count = (m_rtc.month)-1; if(((m_rtc.year % 4) == 0) && m_rtc.month == 2) { if((m_rtc.day) >= dpm[dpm_count]+1+1) { m_rtc.month++; m_rtc.day = 0x01; } } else if(m_rtc.day >= dpm[dpm_count]+1) { m_rtc.month++; m_rtc.day = 0x01; } if(m_rtc.month >= 0x13) { m_rtc.year++; m_rtc.month = 1; } if(m_rtc.year >= 100) { m_rtc.year = 0; } //1900-1999 possible timeframe } }
inline void i8214_device::trigger_interrupt(int level) { if (LOG) logerror("I8214 '%s' Interrupt Level %u\n", tag(), level); m_a = level; // disable interrupts m_int_dis = 1; // disable next level group m_out_enlg_func(0); // toggle interrupt line m_out_int_func(ASSERT_LINE); m_out_int_func(CLEAR_LINE); }
inline void upd3301_device::set_interrupt(int state) { if (LOG) logerror("UPD3301 '%s' Interrupt: %u\n", tag(), state); m_out_int_func(state); if (!state) { m_status &= ~(STATUS_N | STATUS_E); } }
void cdp1864_device::device_reset() { m_int_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_INT_START, 0)); m_efx_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START, 0)); m_dma_timer->adjust(m_cpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START)); m_disp = 0; m_dmaout = 0; m_out_int_func(CLEAR_LINE); m_out_dmao_func(CLEAR_LINE); m_out_efx_func(CLEAR_LINE); }
void pic8259_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { int irq; UINT8 mask; /* check the various IRQs */ for (irq = 0; irq < IRQ_COUNT; irq++) { mask = 1 << irq; /* is this IRQ in service? */ if (m_isr & mask) { if (LOG_GENERAL) { logerror("pic8259_timerproc(): PIC IRQ #%d still in service\n", irq); } break; } /* is this IRQ pending and enabled? */ if ((m_state == STATE_READY) && (m_irr & mask) && !(m_imr & mask)) { if (LOG_GENERAL) { logerror("pic8259_timerproc(): PIC triggering IRQ #%d\n", irq); } if (!BIT(m_ocw3, 2)) { m_out_int_func(1); } return; } } if (!BIT(m_ocw3, 2)) { m_out_int_func(0); } }
inline void crt9007_device::trigger_interrupt(int line) { if (INTERRUPT_ENABLE & line) { int status = m_status; m_status |= STATUS_INTERRUPT_PENDING | line; if (!(status & STATUS_INTERRUPT_PENDING)) { if (LOG) logerror("CRT9007 '%s' INT 1\n", tag()); m_out_int_func(ASSERT_LINE); } } }
/* ints will continue to be set for as long as there are ints pending */ void ins8250_uart_device::update_interrupt() { int state; /* if any bits are set and are enabled */ if (((m_int_pending & m_regs.ier) & 0x0f) != 0) { /* trigger next highest priority int */ /* set int */ state = 1; m_regs.iir &= ~(0x08|0x04|0x02); /* highest to lowest */ if (m_regs.ier & m_int_pending & COM_INT_PENDING_RECEIVER_LINE_STATUS) m_regs.iir |=0x04|0x02; else if (m_regs.ier & m_int_pending & COM_INT_PENDING_RECEIVED_DATA_AVAILABLE) { m_regs.iir |=0x04; if ((m_int_pending & COM_INT_PENDING_CHAR_TIMEOUT) == 0x11) m_regs.iir |= 0x08; } else if (m_regs.ier & m_int_pending & COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY) m_regs.iir |=0x02; /* int pending */ m_regs.iir &= ~0x01; } else { /* clear int */ state = 0; /* no ints pending */ m_regs.iir |= 0x01; /* priority level */ m_regs.iir &= ~(0x08|0x04|0x02); } /* set or clear the int */ m_out_int_func(state); }
void crt9007_device::device_reset() { m_disp = 0; m_vs = 0; m_cblank = 0; // HS = 1 m_out_hs_func(1); // VS = 1 m_out_vs_func(1); // CBLANK = 1 m_out_cblank_func(0); // CURS = 0 m_out_curs_func(0); // VLT = 0 m_out_vlt_func(0); // DRB = 1 m_out_drb_func(1); // INT = 0 m_out_int_func(CLEAR_LINE); // 28 (DMAR) = 0 m_out_dmar_func(CLEAR_LINE); // 29 (WBEN) = 0 // 30 (SLG) = 0 m_out_slg_func(0); // 31 (SLD) = 0 m_out_sld_func(0); // 32 (LPSTB) = 0 }
void cdp1864_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { int scanline = m_screen->vpos(); switch (id) { case TIMER_INT: if (scanline == CDP1864_SCANLINE_INT_START) { if (m_disp) { m_out_int_func(ASSERT_LINE); } m_int_timer->adjust(m_screen->time_until_pos( CDP1864_SCANLINE_INT_END, 0)); } else { if (m_disp) { m_out_int_func(CLEAR_LINE); } m_int_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_INT_START, 0)); } break; case TIMER_EFX: switch (scanline) { case CDP1864_SCANLINE_EFX_TOP_START: m_out_efx_func(ASSERT_LINE); m_efx_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_END, 0)); break; case CDP1864_SCANLINE_EFX_TOP_END: m_out_efx_func(CLEAR_LINE); m_efx_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_EFX_BOTTOM_START, 0)); break; case CDP1864_SCANLINE_EFX_BOTTOM_START: m_out_efx_func(ASSERT_LINE); m_efx_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_EFX_BOTTOM_END, 0)); break; case CDP1864_SCANLINE_EFX_BOTTOM_END: m_out_efx_func(CLEAR_LINE); m_efx_timer->adjust(m_screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START, 0)); break; } break; case TIMER_DMA: if (m_dmaout) { if (m_disp) { if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) { m_out_dmao_func(CLEAR_LINE); } } m_dma_timer->adjust(m_cpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT)); m_dmaout = 0; } else { if (m_disp) { if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) { m_out_dmao_func(ASSERT_LINE); } } m_dma_timer->adjust(m_cpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE)); m_dmaout = 1; } break; } }
void z80dart_device::check_interrupts() { int state = (z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE; m_out_int_func(state); }
void msm6242_device::device_reset() { if ( !m_out_int_func.isnull() ) m_out_int_func( CLEAR_LINE ); }