PIC fixes. OAKCDROM.SYS works again.
This commit is contained in:
parent
536b95576b
commit
f48b0cf7b8
1 changed files with 16 additions and 7 deletions
17
src/pic.c
17
src/pic.c
|
|
@ -9,11 +9,15 @@ int pic_intpending;
|
|||
|
||||
void pic_updatepending()
|
||||
{
|
||||
if ((pic2.pend&~pic2.mask)&~pic2.mask2)
|
||||
pic.pend |= (1 << 2);
|
||||
else
|
||||
pic.pend &= ~(1 << 2);
|
||||
pic_intpending = (pic.pend & ~pic.mask) & ~pic.mask2;
|
||||
if (!((pic.mask | pic.mask2) & (1 << 2)))
|
||||
pic_intpending |= ((pic2.pend&~pic2.mask)&~pic2.mask2);
|
||||
/* pclog("pic_intpending = %i %02X %02X %02X %02X\n", pic_intpending, pic.ins, pic.pend, pic.mask, pic.mask2);
|
||||
pclog(" %02X %02X %02X %02X\n", pic_intpending, pic2.ins, pic2.pend, pic2.mask, pic2.mask2);*/
|
||||
pclog(" %02X %02X %02X %02X %i %i\n", pic2.ins, pic2.pend, pic2.mask, pic2.mask2, ((pic.mask | pic.mask2) & (1 << 2)), ((pic2.pend&~pic2.mask)&~pic2.mask2));*/
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -281,13 +285,18 @@ void picintc(uint16_t num)
|
|||
while (!(num & (1 << c))) c++;
|
||||
// pclog("INTC %04X %i\n", num, c);
|
||||
pic_current[c]=0;
|
||||
#if 0
|
||||
if (num>0xFF) pic2.pend&=~(num>>8);
|
||||
|
||||
if (num > 0xff)
|
||||
{
|
||||
pic2.pend &= ~(num >> 8);
|
||||
if (!((pic2.pend&~pic2.mask)&~pic2.mask2))
|
||||
pic.pend &= ~(1 << 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
pic.pend&=~num;
|
||||
}
|
||||
#endif
|
||||
pic_updatepending();
|
||||
}
|
||||
|
||||
uint8_t picinterrupt()
|
||||
|
|
|
|||
Loading…
Reference in a new issue