]> 4ch.mooo.com Git - 16.git/blobdiff - 16/cawat/16_in.c
wwww
[16.git] / 16 / cawat / 16_in.c
index 67e02e29f9ea347bbafcf455856742b9c5456015..4d3598d736da6767fdb8ad82e38fba6b41044123 100644 (file)
@@ -35,7 +35,7 @@
 //     DEBUG - there are more globals\r
 //\r
 \r
-//#include "ID_HEADS.H"
+//#include "ID_HEADS.H"\r
 #include "16_in.h"\r
 //#pragma      hdrstop\r
 \r
@@ -222,6 +222,13 @@ static     boolean special;
        outp(0x20,0x20);\r
 }\r
 \r
+static void\r
+Mouse(int x)\r
+{\r
+       x = CPURegs.x.ax;\r
+       int86(MouseInt,&CPURegs,&CPURegs);\r
+}\r
+\r
 ///////////////////////////////////////////////////////////////////////////\r
 //\r
 //     INL_GetMouseDelta() - Gets the amount that the mouse has moved from the\r
@@ -232,8 +239,8 @@ static void
 INL_GetMouseDelta(int *x,int *y)\r
 {\r
        Mouse(MDelta);\r
-       *x = _CX;\r
-       *y = _DX;\r
+       *x = CPURegs.x.cx;\r
+       *y = CPURegs.x.dx;\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -248,7 +255,7 @@ INL_GetMouseButtons(void)
        word    buttons;\r
 \r
        Mouse(MButtons);\r
-       buttons = _BX;\r
+       buttons = CPURegs.x.bx;\r
        return(buttons);\r
 }\r
 \r
@@ -270,8 +277,8 @@ IN_GetJoyAbs(word joy,word *xp,word *yp)
        ys = joy? 3 : 1;                // Do the same for y axis\r
        yb = 1 << ys;\r
 \r
-// Read the absolute joystick values
-       __asm
+// Read the absolute joystick values\r
+       __asm\r
        {\r
                pushf                           // Save some registers\r
                push    si\r
@@ -289,7 +296,7 @@ IN_GetJoyAbs(word joy,word *xp,word *yp)
                xor             si,si           // Clear count registers\r
                xor             di,di\r
                xor             bh,bh           // Clear high byte of bx for later\r
-
+\r
                push    bp                      // Don't mess up stack frame\r
                mov             bp,MaxJoyValue\r
 \r
@@ -313,7 +320,7 @@ loop:
 \r
 done:\r
      pop               bp\r
-
+\r
                mov             cl,[xs]         // Get the number of bits to shift\r
                shr             si,cl           //  and shift the count that many times\r
 \r
@@ -322,10 +329,10 @@ done:
 \r
                mov             [x],si          // Store the values into the variables\r
                mov             [y],di\r
-
+\r
                pop             di\r
                pop             si\r
-               popf                            // Restore the registers
+               popf                            // Restore the registers\r
        }\r
 \r
        *xp = x;\r
@@ -443,10 +450,10 @@ IN_GetJoyButtonsDB(word joy)
        {\r
                result1 = INL_GetJoyButtons(joy);\r
                lasttime = TimeCount;\r
-               while (TimeCount == lasttime)\r
+               while(TimeCount == lasttime)\r
                        ;\r
                result2 = INL_GetJoyButtons(joy);\r
-       } while (result1 != result2);\r
+       } while(result1 != result2);\r
        return(result1);\r
 }\r
 \r
@@ -462,8 +469,8 @@ INL_StartKbd(void)
 \r
        IN_ClearKeysDown();\r
 \r
-       OldKeyVect = getvect(KeyInt);\r
-       setvect(KeyInt,INL_KeyService);\r
+       OldKeyVect = _dos_getvect(KeyInt);\r
+       _dos_setvect(KeyInt,INL_KeyService);\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -476,7 +483,7 @@ INL_ShutKbd(void)
 {\r
        poke(0x40,0x17,peek(0x40,0x17) & 0xfaf0);       // Clear ctrl/alt/shift flags\r
 \r
-       setvect(KeyInt,OldKeyVect);\r
+       _dos_setvect(KeyInt,OldKeyVect);\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -487,10 +494,10 @@ INL_ShutKbd(void)
 static boolean\r
 INL_StartMouse(void)\r
 {\r
-       if (getvect(MouseInt))\r
+       if(_dos_getvect(MouseInt))\r
        {\r
                Mouse(MReset);\r
-               if (_AX == 0xffff)\r
+               if(CPURegs.x.ax == 0xffff)\r
                        return(true);\r
        }\r
        return(false);\r