--- np2/io/pic.c 2004/01/29 00:27:29 1.12 +++ np2/io/pic.c 2004/03/05 04:39:59 1.15 @@ -15,7 +15,7 @@ static const _PICITEM def_slave = { 0, {0, 0, 0, 0, 0, 0, 0, 0}, {7, 6, 5, 4, 3, 2, 1, 0}, {0, 0x10, 0x07, 0}, - 0x70, 0, 0, 0, + 0x71, 0, 0, 0, 0, 0, 0, 0}; @@ -275,10 +275,6 @@ static void IOOUTCALL pic_o00(UINT port, } } -#if defined(TRACE) -extern int piccnt; -#endif - static void IOOUTCALL pic_o02(UINT port, REG8 dat) { PICITEM picp; @@ -286,21 +282,16 @@ static void IOOUTCALL pic_o02(UINT port, // TRACEOUT(("pic %x %x", port, dat)); picp = &pic.pi[(port >> 3) & 1]; if (!picp->writeicw) { -#if 1 // マスクのセットだけなら nevent_forceexit()をコールしない - if ((CPU_isDI) || ((picp->imr & dat) == picp->imr)) { - picp->imr = dat; - return; - } +#if 1 + UINT8 set; + set = picp->imr & (~dat); // リセットされたビットは割り込みある? - if (!(picp->irr & (picp->imr & (~dat)))) { + if ((CPU_isDI) || (!(picp->irr & set))) { picp->imr = dat; return; } #endif picp->imr = dat; -#if defined(TRACE) - piccnt++; -#endif } else { picp->icw[picp->writeicw] = dat;