|
|
| version 1.1, 2003/10/16 17:58:19 | version 1.4, 2003/12/12 01:04:39 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "i286.h" | #include "cpucore.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "bios.h" | #include "bios.h" |
| Line 12 void bios0x0c(void) { | Line 11 void bios0x0c(void) { |
| UINT16 doff; | UINT16 doff; |
| UINT16 dseg; | UINT16 dseg; |
| BYTE flag; | REG8 flag; |
| BYTE data; | BYTE data; |
| BYTE stat; | BYTE stat; |
| UINT16 pos; | REG16 pos; |
| UINT16 cnt; | REG16 cnt; |
| doff = GETBIOSMEM16(MEMW_RS_CH0_OFST); | doff = GETBIOSMEM16(MEMW_RS_CH0_OFST); |
| dseg = GETBIOSMEM16(MEMW_RS_CH0_SEG); | dseg = GETBIOSMEM16(MEMW_RS_CH0_SEG); |
| Line 66 void bios0x0c(void) { | Line 65 void bios0x0c(void) { |
| i286_memword_write(dseg, pos, (UINT16)((data << 8) | stat)); | i286_memword_write(dseg, pos, (UINT16)((data << 8) | stat)); |
| // 次のポインタをストア | // 次のポインタをストア |
| pos += 2; | pos = (UINT16)(pos + 2); |
| if (pos >= i286_memword_read(dseg, doff + R_TAILP)) { | if (pos >= i286_memword_read(dseg, doff + R_TAILP)) { |
| pos = i286_memword_read(dseg, doff + R_HEADP); | pos = i286_memword_read(dseg, doff + R_HEADP); |
| } | } |
| i286_memword_write(dseg, doff + R_PUTP, pos); | i286_memword_write(dseg, doff + R_PUTP, pos); |
| // カウンタのインクリメント | // カウンタのインクリメント |
| cnt = i286_memword_read(dseg, doff + R_CNT) + 1; | cnt = (UINT16)(i286_memword_read(dseg, doff + R_CNT) + 1); |
| i286_memword_write(dseg, doff + R_CNT, cnt); | i286_memword_write(dseg, doff + R_CNT, cnt); |
| // オーバーフローを見張る | // オーバーフローを見張る |
| Line 90 void bios0x0c(void) { | Line 89 void bios0x0c(void) { |
| } | } |
| else { | else { |
| i286_membyte_write(dseg, doff + R_CMD, | i286_membyte_write(dseg, doff + R_CMD, |
| (BYTE)(i286_membyte_read(dseg, doff + R_CMD) | RFLAG_BOVF)); | (REG8)(i286_membyte_read(dseg, doff + R_CMD) | RFLAG_BOVF)); |
| } | } |
| i286_membyte_write(dseg, doff + R_INT, | i286_membyte_write(dseg, doff + R_INT, |
| (BYTE)(i286_membyte_read(dseg, doff + R_INT) | RINT_INT)); | (REG8)(i286_membyte_read(dseg, doff + R_INT) | RINT_INT)); |
| i286_membyte_write(dseg, doff + R_FLAG, flag); | i286_membyte_write(dseg, doff + R_FLAG, flag); |
| iocore_out8(0x00, 0x20); | iocore_out8(0x00, 0x20); |
| } | } |