/* Returns nonzero if an interrupt is pending on the given VIA/IRQ combination.  */
int via_irq_pending(int irq)
/* Returns nonzero if an interrupt is pending on the given VIA/IRQ combination.  */
int via_irq_pending(int irq)
{
	int irq_src	= IRQ_SRC(irq);
	int irq_idx	= IRQ_IDX(irq);
	int irq_bit	= 1 << irq_idx;
	if (irq_src == 1) {
		return via1[vIFR] & irq_bit;
	} else if (irq_src == 2) {
		return via2[gIFR] & irq_bit;
	} else if (irq_src == 7) {
		return ~via2[gBufA] & irq_bit;
	}
	return 0;
}