#include "src/lib/16_in.h"\r
#include "src/lib/16_tail.h"\r
\r
+#define INPUTEST_JOYSTICKPADTEST\r
+//#define INPUTEST_MOUSETEST\r
+\r
void\r
main(int argc, char *argv[])\r
{\r
#ifdef __DEBUG_InputMgr__\r
dbg_testkeyin=1;\r
dbg_testcontrolnoisy=0;\r
+ dbg_joymousedelta=1;\r
#endif\r
start_timer(&gvar);\r
//Startup16(&gvar);\r
IN_Startup(&gvar);\r
IN_Default(0,&gvar.player[0],\r
-ctrl_Keyboard1, &gvar);\r
-//ctrl_Joystick1);\r
+ #if !defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+ ctrl_Keyboard1\r
+ #endif\r
+ #if defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+ ctrl_Joystick1\r
+ #endif\r
+ #if !defined(INPUTEST_JOYSTICKPADTEST) && defined(INPUTEST_MOUSETEST)\r
+ ctrl_Mouse\r
+ #endif\r
+ , &gvar);\r
IN_SetControlType(&gvar.player[0],\r
-ctrl_Keyboard1);\r
-//ctrl_Joystick1);\r
+ #if !defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+ ctrl_Keyboard1\r
+ #endif\r
+ #if defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+ ctrl_Joystick1\r
+ #endif\r
+ #if !defined(INPUTEST_JOYSTICKPADTEST) && defined(INPUTEST_MOUSETEST)\r
+ ctrl_Mouse\r
+ #endif\r
+ );\r
\r
gvar.player[0].enti.q=1;\r
gvar.player[0].enti.d=2;\r
#ifdef __DEBUG_InputMgr__\r
printf("testkeyin=%u\n", dbg_testkeyin);\r
printf("testcontrolnoisy=%u\n", dbg_testcontrolnoisy);\r
+ printf("dbg_joymousedelta=%u\n", dbg_joymousedelta);\r
#endif\r
+ printf("JoysPresent={%d,%d}\n", gvar.in.JoysPresent[0], gvar.in.JoysPresent[1]);\r
+ printf("MousePresent=%d\n", gvar.in.MousePresent);\r
}\r
boolean dbg_debugca=0;\r
#endif\r
#ifdef __DEBUG_InputMgr__\r
-boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0,dbg_nointest=0;\r
+boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0,dbg_nointest=0,dbg_joymousedelta=0;\r
#endif\r
#ifdef __DEBUG_MAP__\r
boolean dbg_maptext=0;\r
#define __DEBUG__\r
\r
#ifdef __DEBUG__\r
-//#define __DEBUG_InputMgr__\r
+#define __DEBUG_InputMgr__\r
#define __DEBUG_MAP__\r
//#define __DEBUG_2__\r
//#define __DEBUG_CA__\r
extern boolean dbg_debugca;\r
#endif\r
#ifdef __DEBUG_InputMgr__\r
-extern boolean dbg_testkeyin,dbg_testcontrolnoisy,dbg_nointest;\r
+extern boolean dbg_testkeyin,dbg_testcontrolnoisy,dbg_nointest,dbg_joymousedelta;\r
#endif\r
#ifdef __DEBUG_MAP__\r
extern boolean dbg_maptext;\r
\r
void INL_Mouse(int x)\r
{\r
- //union REGS CPURegs;\r
- //x = CPURegs.x.ax;\r
- __asm {\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
+ int86(MouseInt,&CPURegs,&CPURegs);\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
Mouse(MDelta);\r
*x = CPURegs.x.cx;\r
*y = CPURegs.x.dx;\r
+#ifdef __DEBUG_InputMgr__\r
+ if(dbg_joymousedelta)\r
+ {\r
+ printf("mousedelta=[%dx%d]\n", *x, *y);\r
+ }\r
+ #endif\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
static boolean\r
INL_StartMouse(void)\r
{\r
-#if 0\r
+ union REGS CPURegs;\r
if (getvect(MouseInt))\r
{\r
Mouse(MReset);\r
- if (_AX == 0xffff)\r
+ if (/*_AX*/CPURegs.x.ax == 0xffff)\r
return(true);\r
}\r
return(false);\r
-#endif\r
+#if 0\r
byte far *vector;\r
\r
\r
\r
Mouse(MReset);\r
return true;\r
+#endif\r
}\r
\r
///////////////////////////////////////////////////////////////////////////\r
sword conpee;\r
byte dir=DirTable[2];\r
register KeyboardDef *def;\r
+//#ifdef __DEBUG_InputMgr__\r
+//static int old_dx,old_dy;\r
+//#endif\r
\r
dx = dy = 0;\r
mx = my = motion_None;\r
}\r
#endif\r
#ifdef __DEBUG_InputMgr__\r
+/*if(dbg_joymousedelta)\r
+{\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
+}*/\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
#define sc_ForeSlash 0x35 // / ?\r
\r
// Stuff for the mouse\r
-#define MReset 0\r
+//moved to 16_tdef.h\r
+/*#define MReset 0\r
#define MButtons 3\r
#define MDelta 11\r
\r
-#define MouseInt 0x33\r
+#define MouseInt 0x33*/\r
#ifdef DEMO0\r
typedef enum {\r
demo_Off,demo_Record,demo_Playback,demo_PlayDone\r