|
|
| version 1.6, 2003/11/21 06:51:11 | version 1.7, 2003/11/24 07:40:02 |
|---|---|
| Line 44 static void setsystimerevent(BOOL absolu | Line 44 static void setsystimerevent(BOOL absolu |
| void systimer(NEVENTITEM item) { | void systimer(NEVENTITEM item) { |
| if (pit.intr[0]) { | |
| pit.intr[0] = 0; | |
| pic_setirq(0); | |
| // TRACEOUT(("int-08 [%.2x]", pit.mode[0])); | |
| } | |
| if (item->flag & NEVENT_SETEVENT) { | if (item->flag & NEVENT_SETEVENT) { |
| if (pit.intr[0]) { | |
| pit.intr[0] = 0; | |
| pic_setirq(0); | |
| // TRACEOUT(("int-08 [%.2x]", pit.mode[0])); | |
| } | |
| if ((pit.mode[0] & 0x0c) == 0x04) { | if ((pit.mode[0] & 0x0c) == 0x04) { |
| // レートジェネレータ | // レートジェネレータ |
| pit.intr[0] = 1; | pit.intr[0] = 1; |
| setsystimerevent(NEVENT_RELATIVE); | |
| } | |
| else { | |
| nevent_set(NEVENT_ITIMER, pc.multiple << 16, | |
| systimer, NEVENT_RELATIVE); | |
| } | } |
| setsystimerevent(NEVENT_RELATIVE); | |
| } | } |
| } | } |
| Line 119 void rs232ctimer(NEVENTITEM item) { | Line 123 void rs232ctimer(NEVENTITEM item) { |
| rs232c_callback(); | rs232c_callback(); |
| } | } |
| // --------------------------------------------------------------------------- | // --------------------------------------------------------------------------- |
| static UINT16 itimer_latch(int ch) { | static UINT16 itimer_latch(int ch) { |
| Line 143 static UINT16 itimer_latch(int ch) { | Line 148 static UINT16 itimer_latch(int ch) { |
| return(0); | return(0); |
| } | } |
| void itimer_setflag(int ch, BYTE value) { | void itimer_setflag(int ch, BYTE value) { |
| pit.flag[ch] = 0; | pit.flag[ch] = 0; |
| Line 217 BYTE itimer_getcount(int ch) { | Line 221 BYTE itimer_getcount(int ch) { |
| // system timer | // system timer |
| static void IOOUTCALL pit_o71(UINT port, BYTE dat) { | static void IOOUTCALL pit_o71(UINT port, BYTE dat) { |
| // TRACEOUT(("pic o71: %x [%.4x %.4x]", dat, I286_CS, I286_IP)); | TRACEOUT(("pic o71: %x [%.4x %.4x]", dat, I286_CS, I286_IP)); |
| if (itimer_setcount(0, dat)) { | if (itimer_setcount(0, dat)) { |
| return; | return; |
| } | } |
| Line 265 static void IOOUTCALL pit_o77(UINT port, | Line 269 static void IOOUTCALL pit_o77(UINT port, |
| itimer_setflag(ch, dat); | itimer_setflag(ch, dat); |
| if (ch == 0) { // 書込みで itimerのirrがリセットされる… | if (ch == 0) { // 書込みで itimerのirrがリセットされる… |
| pic.pi[0].irr &= (~1); | pic.pi[0].irr &= (~1); |
| // if (dat & 0x30) { // 一応ラッチ時は割り込みをセットしない | if (dat & 0x30) { // 一応ラッチ時は割り込みをセットしない |
| pit.intr[0] = 1; | pit.intr[0] = 1; |
| // setsystimerevent(NEVENT_ABSOLUTE); | // setsystimerevent(NEVENT_ABSOLUTE); |
| // } | } |
| } | } |
| if (ch == 1) { | if (ch == 1) { |
| beep_modeset(); | beep_modeset(); |
| Line 279 static void IOOUTCALL pit_o77(UINT port, | Line 283 static void IOOUTCALL pit_o77(UINT port, |
| static BYTE IOINPCALL pit_i71(UINT port) { | static BYTE IOINPCALL pit_i71(UINT port) { |
| if (port == 0x71) { | |
| BYTE x; | |
| x = itimer_getcount((port >> 1) & 3); | |
| // TRACEOUT(("pic i71 %x [%.4x %.4x]", x, I286_CS, I286_IP)); | |
| return(x); | |
| } | |
| return(itimer_getcount((port >> 1) & 3)); | return(itimer_getcount((port >> 1) & 3)); |
| } | } |