OSDN Git Service

no idea why bcexmm.exe is broke w tweaked zcroll.exe a bit also Quit is refined now~
[proj16/16.git] / src / lib / 16_in.c
index 8c0dbc6..9adfe42 100755 (executable)
@@ -38,9 +38,7 @@
 \r
 #include "src/lib/16_in.h"\r
 \r
-#ifdef __DEBUG_InputMgr__\r
-boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;\r
-#endif\r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 \r
 /*\r
 =============================================================================\r
@@ -51,8 +49,8 @@ boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;
 */\r
 struct inconfig\r
 {\r
-       boolean                 MousePresent;\r
-       boolean                 JoysPresent[MaxJoys];\r
+       boolean         MousePresent;\r
+       boolean         JoysPresent[MaxJoys];\r
        boolean         Keyboard[NumCodes];\r
        boolean         Paused;\r
        char            LastASCII;\r
@@ -166,6 +164,7 @@ static      Direction       DirTable[] =            // Quick lookup for total direction
 #endif\r
 \r
 //     Internal routines\r
+\r
 ///////////////////////////////////////////////////////////////////////////\r
 //\r
 //     INL_KeyService() - Handles a keyboard interrupt (key up/down)\r
@@ -245,9 +244,13 @@ static     boolean special;
 void\r
 Mouse(int x)\r
 {\r
-       union REGS CPURegs;\r
-       x = CPURegs.x.ax;\r
-       int86(MouseInt,&CPURegs,&CPURegs);\r
+       //union REGS CPURegs;\r
+       //x = CPURegs.x.ax;\r
+       __asm {\r
+               mov     ax,x\r
+               int     MouseInt\r
+       }\r
+       //int86(MouseInt,&CPURegs,&CPURegs);\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -301,8 +304,7 @@ IN_GetJoyAbs(word joy,word *xp,word *yp)
        yb = 1 << ys;\r
 \r
 // Read the absolute joystick values\r
-       __asm\r
-       {\r
+       __asm {\r
                pushf                           // Save some registers\r
                push    si\r
                push    di\r
@@ -322,8 +324,13 @@ IN_GetJoyAbs(word joy,word *xp,word *yp)
 \r
                push    bp                      // Don't mess up stack frame\r
                mov             bp,MaxJoyValue\r
-\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 loo:\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
                in              al,dx           // Get bits indicating whether all are finished\r
 \r
                dec             bp                      // Check bounding register\r
@@ -340,8 +347,13 @@ loo:
 \r
                add             cl,bl\r
                jnz             loo             // If both bits were 0, drop out\r
-\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 done:\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
                pop             bp\r
 \r
                mov             cl,[xs]         // Get the number of bits to shift\r
@@ -639,9 +651,9 @@ IN_Startup()
 \r
        checkjoys = true;\r
        checkmouse = true;\r
-       for (i = 1;i < __argc;i++)\r
+       for (i = 1;i < _argc;i++)\r
        {\r
-               switch (US_CheckParm(__argv[i],ParmStringsIN))\r
+               switch (US_CheckParm(_argv[i],ParmStringsIN))\r
                {\r
                case 0:\r
                        checkjoys = false;\r
@@ -735,7 +747,7 @@ IN_SetKeyHook(void (*hook)())
 void\r
 IN_ClearKeysDown()\r
 {\r
-       int     i;\r
+       //int   i;\r
 \r
        inpu.LastScan = sc_None;\r
        inpu.LastASCII = key_None;\r
@@ -805,7 +817,9 @@ void near
 IN_ReadControl(int pn,player_t *player)\r
 {\r
                        boolean         realdelta;\r
+#if DEMO0\r
                        byte            dbyte;\r
+#endif\r
                        word            buttons;\r
                        int                     dx,dy;\r
                        Motion          mx,my;\r
@@ -836,7 +850,7 @@ register    KeyboardDef     *def;
                realdelta = false;\r
        }\r
        else if (DemoMode == demo_PlayDone)\r
-               Quit("Demo playback exceeded");\r
+               Quit ("Demo playback exceeded");\r
        else\r
        {\r
 #endif\r
@@ -959,7 +973,7 @@ register    KeyboardDef     *def;
                                DemoOffset += 2;\r
 \r
                        if (DemoOffset >= DemoSize)\r
-                               Quit("Demo buffer overflow");\r
+                               Quit ("Demo buffer overflow");\r
 \r
                        DemoBuffer[DemoOffset] = 1;\r
                        DemoBuffer[DemoOffset + 1] = dbyte;\r