void C6821::UpdateInterrupts() { BYTE byNewState; // start with IRQ A byNewState = 0; if ( ( IRQ1( m_byCTLA ) && IRQ1_ENABLED( m_byCTLA ) ) || ( IRQ2( m_byCTLA ) && IRQ2_ENABLED( m_byCTLA ) ) ) byNewState = 1; if ( byNewState != m_byIRQAState ) { m_byIRQAState = byNewState; PIA_W_CALLBACK( m_stOutIRQA, m_byIRQAState ); } /* then do IRQ B */ byNewState = 0; if ( ( IRQ1( m_byCTLB ) && IRQ1_ENABLED( m_byCTLB ) ) || ( IRQ2( m_byCTLB ) && IRQ2_ENABLED( m_byCTLB ) ) ) byNewState = 1; if ( byNewState != m_byIRQBState ) { m_byIRQBState = byNewState; PIA_W_CALLBACK( m_stOutIRQB, m_byIRQBState ); } }
void pia6821_device::update_interrupts() { // start with IRQ A int new_state = (m_irq_a1 && IRQ1_ENABLED(m_ctl_a)) || (m_irq_a2 && IRQ2_ENABLED(m_ctl_a)); if (new_state != m_irq_a_state) { m_irq_a_state = new_state; m_irq_a_func(m_irq_a_state); } // then do IRQ B new_state = (m_irq_b1 && IRQ1_ENABLED(m_ctl_b)) || (m_irq_b2 && IRQ2_ENABLED(m_ctl_b)); if (new_state != m_irq_b_state) { m_irq_b_state = new_state; m_irq_b_func(m_irq_b_state); } }
static void update_6821_interrupts(struct pia6821 *p) { int new_state; /* start with IRQ A */ new_state = 0; if ((p->irq_a1 && IRQ1_ENABLED(p->ctl_a)) || (p->irq_a2 && IRQ2_ENABLED(p->ctl_a))) new_state = 1; if (new_state != p->irq_a_state) { p->irq_a_state = new_state; if (p->intf->irq_a_func) update_shared_irq_handler(p->intf->irq_a_func); } /* then do IRQ B */ new_state = 0; if ((p->irq_b1 && IRQ1_ENABLED(p->ctl_b)) || (p->irq_b2 && IRQ2_ENABLED(p->ctl_b))) new_state = 1; if (new_state != p->irq_b_state) { p->irq_b_state = new_state; if (p->intf->irq_b_func) update_shared_irq_handler(p->intf->irq_b_func); } }
static void update_interrupts(const device_config *device) { pia6821_state *p = get_token(device); int new_state; /* start with IRQ A */ new_state = (p->irq_a1 && IRQ1_ENABLED(p->ctl_a)) || (p->irq_a2 && IRQ2_ENABLED(p->ctl_a)); if (new_state != p->irq_a_state) { p->irq_a_state = new_state; devcb_call_write_line(&p->irq_a_func, p->irq_a_state); } /* then do IRQ B */ new_state = (p->irq_b1 && IRQ1_ENABLED(p->ctl_b)) || (p->irq_b2 && IRQ2_ENABLED(p->ctl_b)); if (new_state != p->irq_b_state) { p->irq_b_state = new_state; devcb_call_write_line(&p->irq_b_func, p->irq_b_state); } }
void pia_set_input_cb1 (int which, int data) { struct pia6821 *p = pia + which; /* limit the data to 0 or 1 */ data = data ? 1 : 0; /* the new state has caused a transition */ if (p->in_cb1 ^ data) { /* handle the active transition */ if ((data && C1_LOW_TO_HIGH (p->ctl_b)) || (!data && C1_HIGH_TO_LOW (p->ctl_b))) { /* mark the IRQ */ p->irq_b1 = 1; /* call the IRQ function if enabled */ if (IRQ1_ENABLED (p->ctl_b)) if (p->irq_b_func) p->irq_b_func (); /* CB2 is configured as output and in write strobe mode and cleared by a CA1 transition */ if (C2_OUTPUT (p->ctl_b) && C2_STROBE_MODE (p->ctl_b) && STROBE_C1_RESET (p->ctl_b)) { /* the IRQ1 flag must have also been cleared */ if (!p->irq_b1) { /* call the CB2 output function */ if (!p->out_cb2) if (p->out_cb2_func) p->out_cb2_func (0, 1); /* clear CB2 */ p->out_cb2 = 1; } } } } /* set the new value for CB1 */ p->in_cb1 = data; }