X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_in.c;h=9dd9d7816b7ba043cccccfca9d0ab9c46faf2694;hb=fd22359b3cf8abccf814365b79906b15a98c8e4e;hp=eb71b1aecc95e7ac66bcb9aed521adfcda36a15b;hpb=40f6a462ab3580c79bc91e86da49fa5ed37a853c;p=16.git diff --git a/src/lib/16_in.c b/src/lib/16_in.c index eb71b1ae..9dd9d781 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -251,13 +251,13 @@ static boolean special; void INL_Mouse(int x) { - //union REGS CPURegs; - //x = CPURegs.x.ax; - __asm { + union REGS CPURegs; + x = CPURegs.x.ax; +/*_=_= __asm { mov ax,x int MouseInt - } - //int86(MouseInt,&CPURegs,&CPURegs); + }*/ + int86(MouseInt,&CPURegs,&CPURegs); } /////////////////////////////////////////////////////////////////////////// @@ -267,12 +267,18 @@ void INL_Mouse(int x) // /////////////////////////////////////////////////////////////////////////// static void -INL_GetMouseDelta(int __far*x,int __far*y) +INL_GetMouseDelta(int *x,int *y) { union REGS CPURegs; Mouse(MDelta); *x = CPURegs.x.cx; *y = CPURegs.x.dx; +#ifdef __DEBUG_InputMgr__ + if(dbg_joymousedelta) + { + printf("mousedelta=[%dx%d]\n", *x, *y); + } + #endif } /////////////////////////////////////////////////////////////////////////// @@ -298,7 +304,7 @@ INL_GetMouseButtons(void) // /////////////////////////////////////////////////////////////////////////// void -IN_GetJoyAbs(word joy,word __far*xp,word __far*yp) +IN_GetJoyAbs(word joy,word *xp,word *yp) { byte xb,yb, xs,ys; @@ -387,7 +393,7 @@ done: // joystick (from +/-127) // /////////////////////////////////////////////////////////////////////////// -void INL_GetJoyDelta(word joy,int __far*dx,int __far*dy/*,boolean adaptive*/, global_game_variables_t *gvar) +void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar) { word x,y; word TimeCount = *clockw; @@ -535,15 +541,15 @@ INL_ShutKbd(void) static boolean INL_StartMouse(void) { -#if 0 + union REGS CPURegs; if (getvect(MouseInt)) { Mouse(MReset); - if (_AX == 0xffff) + if (/*_AX*/CPURegs.x.ax == 0xffff) return(true); } return(false); -#endif +#if 0 byte far *vector; @@ -555,6 +561,7 @@ INL_StartMouse(void) Mouse(MReset); return true; +#endif } /////////////////////////////////////////////////////////////////////////// @@ -850,6 +857,9 @@ IN_ReadControl(player_t *player, global_game_variables_t *gvar) sword conpee; byte dir=DirTable[2]; register KeyboardDef *def; +//#ifdef __DEBUG_InputMgr__ +//static int old_dx,old_dy; +//#endif dx = dy = 0; mx = my = motion_None; @@ -1004,6 +1014,13 @@ register KeyboardDef *def; } #endif #ifdef __DEBUG_InputMgr__ +/*if(dbg_joymousedelta) +{ + if(dx!=old_dx || dy!=old_dy) printf("dx,dy [%d,%d] %d,%d\n", dx, dy, mx, my); + if(dx!=old_dx) old_dx=dx; + if(dy!=old_dy) old_dy=dy; +}*/ + if(dbg_testcontrolnoisy > 0) 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) {