|
|
| version 1.1.1.1, 2003/10/16 17:57:56 | version 1.5, 2003/11/28 08:01:33 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "i286.h" | #include "i286.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| Line 133 void pic_irq(void) { | Line 132 void pic_irq(void) { |
| else { | else { |
| pry = (char)p->pi[0].pry[p->pi[0].level[p->pi[0].levels - 1]]; | pry = (char)p->pi[0].pry[p->pi[0].level[p->pi[0].levels - 1]]; |
| } | } |
| irq = 0xff; | |
| targetbit = 0; | targetbit = 0; |
| for (bit=1, i=0; bit; bit<<=1, i++) { | for (bit=1, i=0; bit; bit<<=1, i++) { |
| if ((p->pi[0].irr & bit) && | if ((p->pi[0].irr & bit) && |
| Line 171 void pic_irq(void) { | Line 171 void pic_irq(void) { |
| nevent_reset(NEVENT_PICMASK); | nevent_reset(NEVENT_PICMASK); |
| } | } |
| i286_interrupt((BYTE)((p->pi[0].icw[1] & 0xf8) | irq)); | i286_interrupt((BYTE)((p->pi[0].icw[1] & 0xf8) | irq)); |
| // TRACEOUT(("hardware-int %.2x", (p->pi[0].icw[1] & 0xf8) | irq)); | |
| return; | return; |
| } | } |
| if ((!p->pi[0].levels) || | if ((!p->pi[0].levels) || |
| Line 211 void pic_irq(void) { | Line 212 void pic_irq(void) { |
| p->pi[0].irr &= ~(1 << sirq); | p->pi[0].irr &= ~(1 << sirq); |
| p->pi[0].level[p->pi[0].levels++] = sirq; | p->pi[0].level[p->pi[0].levels++] = sirq; |
| } | } |
| // TRACEOUT(("hardware int %.2x", (p->pi[1].icw[1] & 0xf8) | irq)); | // TRACEOUT(("hardware-int %.2x", (p->pi[1].icw[1] & 0xf8) | irq)); |
| i286_interrupt((BYTE)((p->pi[1].icw[1] & 0xf8) | irq)); | i286_interrupt((BYTE)((p->pi[1].icw[1] & 0xf8) | irq)); |
| } | } |
| } | } |
| Line 243 void pic_setirq(BYTE irq) { | Line 244 void pic_setirq(BYTE irq) { |
| if (bit & PIC_SYSTEMTIMER) { | if (bit & PIC_SYSTEMTIMER) { |
| if ((pit.mode[0] & 0x0c) == 0x04) { | if ((pit.mode[0] & 0x0c) == 0x04) { |
| SINT32 cnt; // ver0.29 | SINT32 cnt; // ver0.29 |
| if (pit.value[0].w > 8) { | if (pit.value[0] > 8) { |
| cnt = pc.multiple * pit.value[0].w; | cnt = pc.multiple * pit.value[0]; |
| cnt >>= 2; | cnt >>= 2; |
| } | } |
| else { | else { |
| Line 291 static void IOOUTCALL pic_o00(UINT port, | Line 292 static void IOOUTCALL pic_o00(UINT port, |
| PICITEM picp; | PICITEM picp; |
| BYTE level; | BYTE level; |
| // TRACEOUT(("pic %x %x", port, dat)); | |
| picp = &pic.pi[(port >> 3) & 1]; | picp = &pic.pi[(port >> 3) & 1]; |
| picp->writeicw = 0; | picp->writeicw = 0; |
| switch(dat & 0x18) { | switch(dat & 0x18) { |
| Line 340 static void IOOUTCALL pic_o02(UINT port, | Line 342 static void IOOUTCALL pic_o02(UINT port, |
| PICITEM picp; | PICITEM picp; |
| // TRACEOUT(("pic %x %x", port, dat)); | |
| picp = &pic.pi[(port >> 3) & 1]; | picp = &pic.pi[(port >> 3) & 1]; |
| if (!picp->writeicw) { | if (!picp->writeicw) { |
| picp->imr = dat; | picp->imr = dat; |