// 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
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
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
word buttons;\r
\r
Mouse(MButtons);\r
- buttons = _BX;\r
+ buttons = CPURegs.x.bx;\r
return(buttons);\r
}\r
\r
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
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
\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
\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
{\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
\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
{\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
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