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