|
|
| version 1.1.1.1, 2003/10/16 17:58:19 | version 1.7, 2004/04/01 13:19:00 |
|---|---|
| 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 18 void bios0x09_init(void) { | Line 17 void bios0x09_init(void) { |
| SETBIOSMEM16(MEMW_KB_BUF_HEAD, 0x0502); | SETBIOSMEM16(MEMW_KB_BUF_HEAD, 0x0502); |
| SETBIOSMEM16(MEMW_KB_BUF_TAIL, 0x0502); | SETBIOSMEM16(MEMW_KB_BUF_TAIL, 0x0502); |
| SETBIOSMEM16(MEMW_KB_CODE_OFF, 0x0e00); | SETBIOSMEM16(MEMW_KB_CODE_OFF, 0x0e00); |
| SETBIOSMEM16(MEMW_KB_CODE_SEG, 0xfd00); | SETBIOSMEM16(MEMW_KB_CODE_SEG, 0xfd80); |
| keyboard_resetsignal(); | |
| } | } |
| static void updateshiftkey(void) { | static void updateshiftkey(void) { |
| BYTE shiftsts; | UINT8 shiftsts; |
| UINT base; | UINT base; |
| shiftsts = mem[MEMB_SHIFT_STS]; | shiftsts = mem[MEMB_SHIFT_STS]; |
| mem[0xa3ff6] &= 0x3f; // KEYBOARD LED | mem[0xa3ff6] &= 0x3f; // KEYBOARD LED |
| mem[0xa3ff6] |= (BYTE)(shiftsts << 5); | mem[0xa3ff6] |= (UINT8)(shiftsts << 5); |
| if (shiftsts & 0x10) { | if (shiftsts & 0x10) { |
| base = 7; | base = 7; |
| } | } |
| Line 55 void bios0x09(void) { | Line 53 void bios0x09(void) { |
| UINT32 base; | UINT32 base; |
| UINT kbbuftail; | UINT kbbuftail; |
| key = iocore_inp8(0x41); | key = CPU_AL; |
| pos = (key & 0x7f) >> 3; | pos = (key & 0x7f) >> 3; |
| bit = 1 << (key & 7); | bit = 1 << (key & 7); |
| if (!(key & 0x80)) { | if (!(key & 0x80)) { |
| mem[0x0052a + pos] |= bit; | mem[0x0052a + pos] |= bit; |
| code = 0xffff; | code = 0xffff; |
| base = GETBIOSMEM16(MEMW_KB_SHIFT_TBL); | base = GETBIOSMEM16(MEMW_KB_SHIFT_TBL); |
| base += 0xfd000; | base += 0xfd800; |
| if (key <= 0x51) { | if (key <= 0x51) { |
| if ((key == 0x51) || (key == 0x35) || (key == 0x3e)) { | if ((key == 0x51) || (key == 0x35) || (key == 0x3e)) { |
| code = mem[base + key] << 8; | code = mem[base + key] << 8; |
| Line 87 void bios0x09(void) { | Line 85 void bios0x09(void) { |
| } | } |
| else { | else { |
| if (key == 0x60) { | if (key == 0x60) { |
| i286_interrupt(6); | // CPU_INTERRUPT(6, -1); |
| } | } |
| else if (key == 0x61) { | else if (key == 0x61) { |
| i286_interrupt(5); | // CPU_INTERRUPT(5, -1); |
| } | } |
| else if (key < 0x70) { | else if (key < 0x70) { |
| code = mem[base + key - 0x0c] << 8; | code = mem[base + key - 0x0c] << 8; |
| Line 123 void bios0x09(void) { | Line 121 void bios0x09(void) { |
| updateshiftkey(); | updateshiftkey(); |
| } | } |
| } | } |
| iocore_out8(0x00, 0x20); | |
| } | } |