|
|
| version 1.6, 2003/12/04 16:48:15 | version 1.7, 2003/12/08 00:55:32 |
|---|---|
| Line 4 | Line 4 |
| #include "iocore.h" | #include "iocore.h" |
| static const BYTE joykeytable[12] = { | static const UINT8 joykeytable[12] = { |
| 0x2a, 0x34, | 0x2a, 0x34, |
| 0x29, 0x1c, | 0x29, 0x1c, |
| 0x3c, 0x48, | 0x3c, 0x48, |
| Line 12 static const BYTE joykeytable[12] = { | Line 12 static const BYTE joykeytable[12] = { |
| 0x3d, 0x4b, | 0x3d, 0x4b, |
| 0x3a, 0x43}; | 0x3a, 0x43}; |
| static const BYTE kbexflag[0x80] = { | static const UINT8 kbexflag[0x80] = { |
| // ESC, £±, £², £³, £´, £µ, £¶, £· ; 00h | // ESC, £±, £², £³, £´, £µ, £¶, £· ; 00h |
| 0, 0, 0, 0, 0, 0, 0, 0, | 0, 0, 0, 0, 0, 0, 0, 0, |
| // £¸, £¹, £°, ¡Ý, ¡°, ¡ï, BS, TAB ; 08h | // £¸, £¹, £°, ¡Ý, ¡°, ¡ï, BS, TAB ; 08h |
| Line 72 void keyb_callback(NEVENTITEM item) { | Line 72 void keyb_callback(NEVENTITEM item) { |
| } | } |
| } | } |
| static void keyb_out(BYTE data) { | static void keyb_out(REG8 data) { |
| if (keyb.buffers < KB_BUF) { | if (keyb.buffers < KB_BUF) { |
| keyb.buf[(keyb.pos + keyb.buffers) & KB_BUFMASK] = data; | keyb.buf[(keyb.pos + keyb.buffers) & KB_BUFMASK] = data; |
| Line 89 static void keyb_out(BYTE data) { | Line 89 static void keyb_out(BYTE data) { |
| // ---- | // ---- |
| BYTE keystat[0x80]; | UINT8 keystat[0x80]; |
| void keystat_reset(void) { | void keystat_reset(void) { |
| Line 97 void keystat_reset(void) { | Line 97 void keystat_reset(void) { |
| } | } |
| void keystat_senddata(BYTE data) { | void keystat_senddata(REG8 data) { |
| BYTE key; | REG8 key; |
| BOOL keynochange; | BOOL keynochange; |
| key = data & 0x7f; | key = data & 0x7f; |
| Line 147 void keystat_senddata(BYTE data) { | Line 147 void keystat_senddata(BYTE data) { |
| if (data & 0x80) { // ver0.30 | if (data & 0x80) { // ver0.30 |
| return; | return; |
| } | } |
| keyb_out((BYTE)(data ^ 0x80)); | keyb_out((REG8)(data ^ 0x80)); |
| } | } |
| keyb_out(data); | keyb_out(data); |
| } | } |
| Line 155 void keystat_senddata(BYTE data) { | Line 155 void keystat_senddata(BYTE data) { |
| void keystat_resetcopyhelp(void) { | void keystat_resetcopyhelp(void) { |
| BYTE i; | REG8 i; |
| for (i=0x60; i<0x62; i++) { | for (i=0x60; i<0x62; i++) { |
| if (keystat[i] & 0x80) { | if (keystat[i] & 0x80) { |
| keystat[i] &= 0x7f; | keystat[i] &= 0x7f; |
| keyb_out((BYTE)(i | 0x80)); | keyb_out((REG8)(i | 0x80)); |
| } | } |
| } | } |
| } | } |
| void keystat_allrelease(void) { | void keystat_allrelease(void) { |
| UINT i; | REG8 i; |
| for (i=0; i<0x80; i++) { | for (i=0; i<0x80; i++) { |
| if (keystat[i] & 0x80) { | if (keystat[i] & 0x80) { |
| keystat[i] &= ~0x80; | keystat[i] &= ~0x80; |
| keyb_out((BYTE)(i + 0x80)); | keyb_out((REG8)(i | 0x80)); |
| } | } |
| } | } |
| } | } |
| void keystat_forcerelease(BYTE value) { | void keystat_forcerelease(REG8 value) { |
| if (keystat[value & 0x7f] & 0x80) { | if (keystat[value & 0x7f] & 0x80) { |
| keystat[value & 0x7f] &= ~0x80; | keystat[value & 0x7f] &= ~0x80; |
| keyb_out((BYTE)(value | 0x80)); | keyb_out((REG8)(value | 0x80)); |
| } | } |
| } | } |
| void keystat_resetjoykey(void) { | void keystat_resetjoykey(void) { |
| int i; | int i; |
| BYTE key; | REG8 key; |
| for (i=0; i<12; i++) { | for (i=0; i<12; i++) { |
| key = joykeytable[i]; | key = joykeytable[i]; |
| if (keystat[key] & 0x80) { | if (keystat[key] & 0x80) { |
| keystat[key] &= 0x7f; | keystat[key] &= 0x7f; |
| keyb_out((BYTE)(key | 0x80)); | keyb_out((REG8)(key | 0x80)); |
| } | } |
| } | } |
| } | } |
| Line 203 void keystat_resetjoykey(void) { | Line 203 void keystat_resetjoykey(void) { |
| // ---- | // ---- |
| typedef struct { | typedef struct { |
| BYTE joysync; | UINT8 joysync; |
| BYTE joylast; | UINT8 joylast; |
| BYTE mouselast; | UINT8 mouselast; |
| BYTE padding; | UINT8 padding; |
| BYTE d_up; | UINT8 d_up; |
| BYTE d_dn; | UINT8 d_dn; |
| BYTE d_lt; | UINT8 d_lt; |
| BYTE d_rt; | UINT8 d_rt; |
| } KEYEXT; | } KEYEXT; |
| static KEYEXT keyext; | static KEYEXT keyext; |
| static const BYTE mousedelta[] = {1, 1, 1, 1, | static const UINT8 mousedelta[] = {1, 1, 1, 1, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4}; | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4}; |
| #define MOUSESTEPMAX ((sizeof(mousedelta) / sizeof(BYTE)) - 1) | #define MOUSESTEPMAX ((sizeof(mousedelta) / sizeof(UINT8)) - 1) |
| void keyext_flash(void) { | void keyext_flash(void) { |
| Line 313 BYTE keyext_getmouse(SINT16 *x, SINT16 * | Line 313 BYTE keyext_getmouse(SINT16 *x, SINT16 * |
| // ---- | // ---- |
| static void IOOUTCALL keyb_o41(UINT port, BYTE dat) { | static void IOOUTCALL keyb_o41(UINT port, REG8 dat) { |
| keyb.mode = dat; | keyb.mode = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL keyb_o43(UINT port, BYTE dat) { | static void IOOUTCALL keyb_o43(UINT port, REG8 dat) { |
| if ((!(dat & 0x08)) && (keyb.cmd & 0x08)) { | if ((!(dat & 0x08)) && (keyb.cmd & 0x08)) { |
| keyboard_resetsignal(); | keyboard_resetsignal(); |
| Line 331 static void IOOUTCALL keyb_o43(UINT port | Line 331 static void IOOUTCALL keyb_o43(UINT port |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL keyb_i41(UINT port) { | static REG8 IOINPCALL keyb_i41(UINT port) { |
| (void)port; | (void)port; |
| return(keyb.data); | return(keyb.data); |
| } | } |
| static BYTE IOINPCALL keyb_i43(UINT port) { | static REG8 IOINPCALL keyb_i43(UINT port) { |
| (void)port; | (void)port; |
| return(keyb.status); | return(keyb.status); |
| Line 373 void keyboard_resetsignal(void) { | Line 373 void keyboard_resetsignal(void) { |
| keyboard_reset(); | keyboard_reset(); |
| for (i=0; i<0x80; i++) { | for (i=0; i<0x80; i++) { |
| if (keystat[i]) { | if (keystat[i]) { |
| keyb_out((BYTE)i); | keyb_out((REG8)i); |
| } | } |
| } | } |
| } | } |
| Line 445 void rs232c_midipanic(void) { | Line 445 void rs232c_midipanic(void) { |
| // ---- | // ---- |
| static void IOOUTCALL rs232c_o30(UINT port, BYTE dat) { | static void IOOUTCALL rs232c_o30(UINT port, REG8 dat) { |
| if (cm_rs232c) { | if (cm_rs232c) { |
| cm_rs232c->write(cm_rs232c, dat); | cm_rs232c->write(cm_rs232c, (UINT8)dat); |
| } | } |
| if (sysport.c & 4) { | if (sysport.c & 4) { |
| rs232c.send = 0; | rs232c.send = 0; |
| Line 460 static void IOOUTCALL rs232c_o30(UINT po | Line 460 static void IOOUTCALL rs232c_o30(UINT po |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL rs232c_o32(UINT port, BYTE dat) { | static void IOOUTCALL rs232c_o32(UINT port, REG8 dat) { |
| if (!(dat & 0xfd)) { | if (!(dat & 0xfd)) { |
| rs232c.dummyinst++; | rs232c.dummyinst++; |
| Line 518 static void IOOUTCALL rs232c_o32(UINT po | Line 518 static void IOOUTCALL rs232c_o32(UINT po |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL rs232c_i30(UINT port) { | static REG8 IOINPCALL rs232c_i30(UINT port) { |
| (void)port; | (void)port; |
| return(rs232c.data); | return(rs232c.data); |
| } | } |
| static BYTE IOINPCALL rs232c_i32(UINT port) { | static REG8 IOINPCALL rs232c_i32(UINT port) { |
| if (!(rs232c_stat() & 0x20)) { | if (!(rs232c_stat() & 0x20)) { |
| return(rs232c.result | 0x80); | return(rs232c.result | 0x80); |