]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_in.c
16_ca needs huge amounts of work and I should remember what needs to be done soon...
[16.git] / src / lib / 16_in.c
index 98ecb70d117a330213f9fb00a974dda1463ecbbd..c543caf99a958a7d4a484c5c0444ce67bfb16954 100755 (executable)
@@ -78,15 +78,21 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 extern "C" {\r
 #endif\r
 \r
-static struct instat {\r
-       boolean         CapsLock;\r
+/*static struct instat {\r
+       boolean         CapsLock;\r
        ScanCode        CurCode,LastCode;\r
 \r
        boolean         Keyboard[NumCodes];\r
        boolean         Paused;\r
        char            LastASCII;\r
        ScanCode        LastScan;\r
-} inst;\r
+} inst;*/\r
+\r
+//the def stuff is need fix warnings\r
+#ifndef INSTDEFED\r
+#define INSTDEFED\r
+static inst_t inst;\r
+#endif\r
 \r
 static byte        far ASCIINames[] =          // Unshifted ASCII for scan codes\r
                                        {\r
@@ -163,6 +169,7 @@ static      Direction       DirTable[] =            // Quick lookup for total direction
 static void                    (*INL_KeyHook)(void);\r
 static void interrupt  (*OldKeyVect)(void);\r
 static char                    *ParmStringsIN[] = {"nojoys","nomouse",nil};\r
+static void                    INL_StartKbd(void);\r
 \r
 //     Internal routines\r
 \r
@@ -497,7 +504,7 @@ IN_GetJoyButtonsDB(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static void\r
-INL_StartKbd(global_game_variables_t *gvar)\r
+INL_StartKbd()\r
 {\r
        INL_KeyHook = NULL;     // Clear key hook\r
 \r
@@ -674,7 +681,7 @@ IN_Startup(global_game_variables_t *gvar)
                }\r
        }\r
 \r
-       INL_StartKbd(gvar);\r
+       INL_StartKbd();\r
        gvar->in.MousePresent = checkmouse? INL_StartMouse() : false;\r
 \r
        for (i = 0;i < MaxJoys;i++)\r
@@ -1177,8 +1184,13 @@ boolean IN_CheckAck (global_game_variables_t *gvar)
 //\r
 // see if something has been pressed\r
 //\r
-       if (inst.LastScan)\r
-               return true;\r
+       if(!gvar->in.IN_Started)\r
+               getch();\r
+       else\r
+       {\r
+               if (inst.LastScan)\r
+                       return true;\r
+       }\r
 \r
        buttons = IN_JoyButtons () << 4;\r
        if (gvar->in.MousePresent)\r
@@ -1299,8 +1311,8 @@ byte      IN_JoyButtons (void)
 boolean IN_KeyDown(byte code)\r
 {\r
 #ifdef __DEBUG_InputMgr__\r
-       if(inst.Keyboard[code])\r
-               printf("IN_KeyDown(%c): %u\n", code, inst.Keyboard[code]);\r
+//     if(inst.Keyboard[code])\r
+//             printf("IN_KeyDown(%c): %u\n", code, inst.Keyboard[code]);\r
        if(!dbg_nointest)\r
 #endif\r
        return inst.Keyboard[code];\r