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 pia_set_input_cb2 (int which, int data) { struct pia6821 *p = pia + which; /* limit the data to 0 or 1 */ data = data ? 1 : 0; /* CB2 is in input mode */ if (C2_INPUT (p->ctl_b)) { /* the new state has caused a transition */ if (p->in_cb2 ^ data) { /* handle the active transition */ if ((data && C2_LOW_TO_HIGH (p->ctl_b)) || (!data && C2_HIGH_TO_LOW (p->ctl_b))) { /* mark the IRQ */ p->irq_b2 = 1; /* call the IRQ function if enabled */ if (IRQ2_ENABLED (p->ctl_b)) if (p->irq_b_func) p->irq_b_func (); } } } /* set the new value for CA2 */ p->in_cb2 = data; }
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); } }