From: sparky4 Date: Sat, 27 Jun 2015 22:37:32 +0000 (-0500) Subject: input is funny wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=539c09c7039c5420ed1911c54677c86c370a8b33;p=16.git input is funny wwww Signed-off-by: sparky4 --- diff --git a/16.LIB b/16.LIB index dd1d8950..a0c5426f 100644 Binary files a/16.LIB and b/16.LIB differ diff --git a/inputest.exe b/inputest.exe index ca2b4194..4e470c4d 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/src/inputest.c b/src/inputest.c index 15a1b3a5..8d94fcd3 100644 --- a/src/inputest.c +++ b/src/inputest.c @@ -28,8 +28,14 @@ void main(int argc, char *argv[]) { ControlInfo control; + extern boolean Keyboard[NumCodes]; IN_Startup(); IN_Default(0,ctrl_Keyboard); - IN_ReadControl(0,&control); + while(!IN_qb(sc_Escape)) + { + IN_ReadControl(0,&control); +// printf("%u\n", Keyboard[sc_Escape]); + + } IN_Shutdown(); } diff --git a/src/lib/16_in.c b/src/lib/16_in.c index 0b2da7d8..28d79e71 100644 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -38,7 +38,6 @@ #include "src/lib/16_in.h" // Internal routines - /////////////////////////////////////////////////////////////////////////// // // INL_KeyService() - Handles a keyboard interrupt (key up/down) @@ -48,8 +47,8 @@ void interrupt INL_KeyService(void) { static boolean special; - byte k,c, - temp; + byte k,c; + register byte temp; k = inp(0x60); // Get the scan code @@ -109,6 +108,9 @@ static boolean special; if (INL_KeyHook && !special) INL_KeyHook(); + #ifdef TESTKEYIN + printf("%c %x %u\n", c, k, Keyboard[k]); + #endif outp(0x20,0x20); } @@ -1189,3 +1191,9 @@ IN_UserInput(dword delay,boolean clear) } while (TimeCount - lasttime < delay); return(false); } + +boolean IN_qb(byte kee) +{ + if(Keyboard[kee]==true) return 1; + else return 0; +} diff --git a/src/lib/16_in.h b/src/lib/16_in.h index b37a9d5b..b39e1a5b 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -33,7 +33,8 @@ #define __DEBUG_InputMgr__ //++++#endif -#define DOMO +//#define DOMO +#define TESTKEYIN #define KeyInt 9 // The keyboard ISR number @@ -326,5 +327,6 @@ extern ScanCode IN_WaitForKey(void); extern word IN_GetJoyButtonsDB(word joy); -//static void interrupt INL_KeyService(void); +void interrupt INL_KeyService(void); +boolean IN_qb(byte kee); #endif