outportb(0x20,0x20);\r
}\r
\r
-void INL_Mouse(int x)\r
-{\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
//\r
// INL_GetMouseDelta() - Gets the amount that the mouse has moved from the\r
//\r
///////////////////////////////////////////////////////////////////////////\r
static void\r
-INL_GetMouseDelta(int __far*x,int __far*y)\r
+INL_GetMouseDelta(int *x,int *y)\r
{\r
- union REGS CPURegs;\r
Mouse(MDelta);\r
- *x = CPURegs.x.cx;\r
- *y = CPURegs.x.dx;\r
+ *x = _CX;\r
+ *y = _DX;\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
static word\r
INL_GetMouseButtons(void)\r
{\r
- union REGS CPURegs;\r
word buttons;\r
\r
Mouse(MButtons);\r
- buttons = CPURegs.x.bx;\r
+ buttons = _BX;\r
return(buttons);\r
}\r
\r
//\r
///////////////////////////////////////////////////////////////////////////\r
void\r
-IN_GetJoyAbs(word joy,word __far*xp,word __far*yp)\r
+IN_GetJoyAbs(word joy,word *xp,word *yp)\r
{\r
byte xb,yb,\r
xs,ys;\r
// joystick (from +/-127)\r
//\r
///////////////////////////////////////////////////////////////////////////\r
-void INL_GetJoyDelta(word joy,int __far*dx,int __far*dy/*,boolean adaptive*/, global_game_variables_t *gvar)\r
+void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar)\r
{\r
word x,y;\r
word TimeCount = *clockw;\r
//\r
///////////////////////////////////////////////////////////////////////////\r
static void\r
-INL_StartKbd()\r
+INL_StartKbd(void)\r
{\r
INL_KeyHook = NULL; // Clear key hook\r
\r
return(true);\r
}\r
return(false);\r
-#endif\r
+#else\r
byte far *vector;\r
\r
\r
\r
Mouse(MReset);\r
return true;\r
+#endif\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
gvar->in.inst = &inst;\r
\r
gvar->in.IN_Started = true;\r
-\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
#endif\r
switch (type = player->Controls)\r
{\r
- case ctrl_Keyboard1:\r
- case ctrl_Keyboard2:\r
+ case ctrl_Keyboard:\r
def = &(gvar->in.KbdDefs[type - ctrl_Keyboard]);\r
\r
/* if (Keyboard[def->upleft])\r
}\r
else\r
{\r
- dx = mx;// * 127;\r
- dy = my;// * 127;\r
+ dx = mx * 127;\r
+ dy = my * 127;\r
}\r
\r
player->info.x = dx;\r
}\r
#endif\r
#ifdef __DEBUG_InputMgr__\r
+if(dbg_joymousedelta)\r
+{\r
+ {\r
+static int old_dx,old_dy;\r
+static word old_buttons=0;\r
+ if(dx!=old_dx || dy!=old_dy) printf("dx,dy [%d,%d] %d,%d\n", dx, dy, mx, my);\r
+ if(dx!=old_dx) old_dx=dx;\r
+ if(dy!=old_dy) old_dy=dy;\r
+ if(old_buttons!=buttons)\r
+ {\r
+ printf(" buttons={%u,%u,%u,%u}\n", player->info.button0, player->info.button1, player->info.button2, player->info.button3);\r
+ old_buttons=buttons;\r
+ }\r
+ }\r
+}\r
+\r
if(dbg_testcontrolnoisy > 0)\r
if(player->info.dir!=2/*(inst.Keyboard[def->up] || inst.Keyboard[def->down] || inst.Keyboard[def->left] || inst.Keyboard[def->right])*/ || player->enti.q>1)\r
{\r
\r
byte IN_MouseButtons (global_game_variables_t *gvar)\r
{\r
- union REGS CPURegs;\r
if (gvar->in.MousePresent)\r
{\r
Mouse(MButtons);\r
- return CPURegs.x.bx;\r
+ return _BX;\r
}\r
else\r
return 0;\r