static void update_6821_interrupts(pia6821 p) { int new_state; /* start with IRQ A */ new_state = 0; if ((p.irq_a1 != 0 && IRQ1_ENABLED(p.ctl_a)) || (p.irq_a2 != 0 && IRQ2_ENABLED(p.ctl_a))) new_state = 1; if (new_state != p.irq_a_state) { p.irq_a_state = (byte)new_state; if (p.intf.irq_a_func != null) update_shared_irq_handler(p.intf.irq_a_func); } /* then do IRQ B */ new_state = 0; if ((p.irq_b1 != 0 && IRQ1_ENABLED(p.ctl_b)) || (p.irq_b2 != 0 && IRQ2_ENABLED(p.ctl_b))) new_state = 1; if (new_state != p.irq_b_state) { p.irq_b_state = (byte)new_state; if (p.intf.irq_b_func != null) update_shared_irq_handler(p.intf.irq_b_func); } }
public static void pia_unconfig() { for (int i = 0; i < MAX_PIA; i++) pia[i] = new pia6821(); }
public static void pia_reset() { /* zap each structure, preserving the interface and swizzle */ for (int i = 0; i < MAX_PIA; i++) { pia6821_interface intf = pia[i].intf; byte addr = pia[i].addr; pia[i] = new pia6821(); pia[i].intf = intf; pia[i].addr = addr; } }