]> 4ch.mooo.com Git - 16.git/commitdiff
tired i will work on joy stick stuff later
authorsparky4 <sparky4@cock.li>
Fri, 22 Sep 2017 23:38:12 +0000 (18:38 -0500)
committersparky4 <sparky4@cock.li>
Fri, 22 Sep 2017 23:38:12 +0000 (18:38 -0500)
src/inputest.c
src/lib/16_dbg.c
src/lib/16_dbg.h
src/lib/16_in.c
src/lib/16_in.h

index d802ab522b5aa7e004baa88fd5d917c6dc9f8dce..83619cb6c605fbce229c376198725a4fc4c5b158 100755 (executable)
@@ -25,6 +25,9 @@
 #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
@@ -32,16 +35,33 @@ main(int argc, char *argv[])
 #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
@@ -112,5 +132,8 @@ ctrl_Keyboard1);
 #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
index 5ab4c5dd2dd922ebcd7a6ae2174214a7b5645f78..854615b0fb3b02c3db97325c873f09a00518da30 100755 (executable)
@@ -33,7 +33,7 @@ boolean dbg_debugpm=0;
 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
index 37c269631297cc39a02a1c1185e6a54dcda283a3..a500b9b211c64c12fb65a11f4ae2f79ee4bd8e37 100755 (executable)
@@ -30,7 +30,7 @@
 #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
@@ -54,7 +54,7 @@ extern boolean dbg_debugpm;
 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
index c543caf99a958a7d4a484c5c0444ce67bfb16954..9dd9d7816b7ba043cccccfca9d0ab9c46faf2694 100755 (executable)
@@ -251,13 +251,13 @@ static    boolean special;
 \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
@@ -273,6 +273,12 @@ INL_GetMouseDelta(int *x,int *y)
        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
@@ -535,15 +541,15 @@ INL_ShutKbd(void)
 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
@@ -555,6 +561,7 @@ INL_StartMouse(void)
 \r
        Mouse(MReset);\r
        return true;\r
+#endif\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -850,6 +857,9 @@ IN_ReadControl(player_t *player, global_game_variables_t *gvar)
                        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
@@ -1004,6 +1014,13 @@ register KeyboardDef     *def;
        }\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
index c2b4b622ca1ef45acaf9477ac8dff43c6ccdbdcf..84100aeca43b7ff5f02bc0fcac332a4c0e8de83c 100755 (executable)
 #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