/* Cause or clear CIA interrupts, return old interrupt status.  */
unsigned char cia_set_irq(struct ciabase *base, unsigned char mask)
/* Cause or clear CIA interrupts, return old interrupt status.  */
unsigned char cia_set_irq(struct ciabase *base, unsigned char mask)
{
	unsigned char old;
	old = (base->icr_data |= base->cia->icr);
	if (mask & CIA_ICR_SETCLR)
		base->icr_data |= mask;
	else
		base->icr_data &= ~mask;
	if (base->icr_data & base->icr_mask)
		amiga_custom.intreq = IF_SETCLR | base->int_mask;
	return old & base->icr_mask;
}