]> 4ch.mooo.com Git - 16.git/commitdiff
inputest~
authorsparky4 <sparky4@cock.li>
Sat, 27 Jun 2015 21:48:57 +0000 (16:48 -0500)
committersparky4 <sparky4@cock.li>
Sat, 27 Jun 2015 21:48:57 +0000 (16:48 -0500)
Signed-off-by: sparky4 <sparky4@cock.li>
16.LIB
GFX.LIB
exmmtest.exe
inputest.exe
src/inputest.c
src/lib/16_in.c
src/lib/16_in.h

diff --git a/16.LIB b/16.LIB
index 523265fe9a5ee6712a12e09db3c7ab1da448c0f7..dd1d8950ab2c976f815062fd37d676ac27f8cdfd 100644 (file)
Binary files a/16.LIB and b/16.LIB differ
diff --git a/GFX.LIB b/GFX.LIB
index 1e340935ae68ec5c3d486646cf87a4cd8e6bf904..30582814bf73bc28f0cebb0d5d447ac30285f027 100644 (file)
Binary files a/GFX.LIB and b/GFX.LIB differ
index 04e9e55097c40da4b106e44e8ee753c400aaaace..f949a05e43e3a80173a9fcfef40ad99d796699e3 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index 97ba47cdcff5aa05fbb004dc476011f5d49832a9..ca2b4194f120a86cb85b5b957c5e9f7bfde1b230 100644 (file)
Binary files a/inputest.exe and b/inputest.exe differ
index 7d5777d07ac48940cc0e4cd96f61703a0642bd27..15a1b3a5eb30565f2b0d88a9ee332051f89e28f7 100644 (file)
@@ -1,31 +1,35 @@
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*
-       input test
-*/
-#include "src/lib/16_in.h"
-
-void
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+       input test\r
+*/\r
+#include "src/lib/16_in.h"\r
+\r
+void\r
 main(int argc, char *argv[])\r
-{
-
-}
+{\r
+       ControlInfo control;\r
+       IN_Startup();\r
+       IN_Default(0,ctrl_Keyboard);\r
+       IN_ReadControl(0,&control);\r
+       IN_Shutdown();\r
+}\r
index 34679d9696f52a79c0454501ba624568c255125d..0b2da7d8467b404409692a7d8c0d2420be0f50bb 100644 (file)
@@ -44,7 +44,7 @@
 //     INL_KeyService() - Handles a keyboard interrupt (key up/down)
 //
 ///////////////////////////////////////////////////////////////////////////
-static void interrupt
+void interrupt
 INL_KeyService(void)
 {
 static boolean special;
@@ -112,7 +112,7 @@ static      boolean special;
        outp(0x20,0x20);
 }
 
-static void
+void
 Mouse(int x)
 {
        union REGS CPURegs;
@@ -652,6 +652,7 @@ IN_ReadCursor(CursorInfo *info)
        }
 }
 
+#ifndef DOMO
 ///////////////////////////////////////////////////////////////////////////
 //
 //     IN_ReadControl() - Reads the device associated with the specified
@@ -728,14 +729,14 @@ register  KeyboardDef     *def;
                        type = ctrl_Keyboard1;
                        def = &KbdDefs[type - ctrl_Keyboard];
 
-                       if (Keyboard[def->upleft])
+/*                     if (Keyboard[def->upleft])
                                mx = motion_Left,my = motion_Up;
                        else if (Keyboard[def->upright])
                                mx = motion_Right,my = motion_Up;
                        else if (Keyboard[def->downleft])
                                mx = motion_Left,my = motion_Down;
                        else if (Keyboard[def->downright])
-                               mx = motion_Right,my = motion_Down;
+                               mx = motion_Right,my = motion_Down;*/
 
                        if (Keyboard[def->up])
                                my = motion_Up;
@@ -803,7 +804,7 @@ register    KeyboardDef     *def;
 #endif
 }
 
-#if 0
+#else
 ///////////////////////////////////////////////////////////////////////////
 //
 //     IN_ReadControl() - Reads the device associated with the specified
@@ -853,14 +854,14 @@ register  KeyboardDef     *def;
                case ctrl_Keyboard2:
                        def = &KbdDefs[type - ctrl_Keyboard];
 
-                       if (Keyboard[def->upleft])
+/*                     if (Keyboard[def->upleft])
                                mx = motion_Left,my = motion_Up;
                        else if (Keyboard[def->upright])
                                mx = motion_Right,my = motion_Up;
                        else if (Keyboard[def->downleft])
                                mx = motion_Left,my = motion_Down;
                        else if (Keyboard[def->downright])
-                               mx = motion_Right,my = motion_Down;
+                               mx = motion_Right,my = motion_Down;*/
 
                        if (Keyboard[def->up])
                                my = motion_Up;
index 1e099ee4c591ee310ea6002966829bfb1b8a8d8a..b37a9d5bcf46b821a3b37bca0f1ab3bb5abb0a8d 100644 (file)
 \r
 #ifndef        __16_IN__\r
 #define        __16_IN__\r
-
+\r
 #include "src/lib/lib_head.h"\r
-//#include "src/lib/16_us.h"
+//#include "src/lib/16_us.h"\r
 \r
-#ifdef __DEBUG__\r
+//++++#ifdef   __DEBUG__\r
 #define        __DEBUG_InputMgr__\r
-#endif\r
-
-#define        KeyInt  9       // The keyboard ISR number
-
-// Stuff for the joystick
-#define        JoyScaleMax             32768
-#define        JoyScaleShift   8
-#define        MaxJoyValue             5000
+//++++#endif\r
+\r
+#define DOMO\r
+\r
+#define        KeyInt  9       // The keyboard ISR number\r
+\r
+// Stuff for the joystick\r
+#define        JoyScaleMax             32768\r
+#define        JoyScaleShift   8\r
+#define        MaxJoyValue             5000\r
 \r
 #define        MaxPlayers      4\r
 #define        MaxKbds         2\r
@@ -138,7 +140,7 @@ typedef     byte            ScanCode;
 #ifdef DEMO0\r
 typedef        enum            {\r
                                                demo_Off,demo_Record,demo_Playback,demo_PlayDone\r
-                                       } Demo;
+                                       } Demo;\r
 #endif\r
 typedef        enum            {\r
                                                ctrl_None,                              // MDM (GAMERS EDGE) - added\r
@@ -154,10 +156,10 @@ typedef   enum            {
                                                motion_Right = 1,motion_Down = 1\r
                                        } Motion;\r
 typedef        enum            {\r
-                                               dir_North,dir_NorthEast,\r
-                                               dir_East,dir_SouthEast,\r
-                                               dir_South,dir_SouthWest,\r
-                                               dir_West,dir_NorthWest,\r
+                                               dir_North,//dir_NorthEast,\r
+                                               dir_East,//dir_SouthEast,\r
+                                               dir_South,//dir_SouthWest,\r
+                                               dir_West,//dir_NorthWest,\r
                                                dir_None\r
                                        } Direction;\r
 typedef        struct          {\r
@@ -167,11 +169,17 @@ typedef   struct          {
                                                Direction       dir;\r
                                        } CursorInfo;\r
 typedef        CursorInfo      ControlInfo;\r
+\r
 typedef        struct          {\r
                                                ScanCode        button0,button1,\r
-                                                                       upleft,         up,             upright,\r
+                                                                       //upleft,\r
+                                                                       up,\r
+                                                                       //upright,\r
                                                                        left,                           right,\r
-                                                                       downleft,       down,   downright;\r
+                                                                       //downleft,\r
+                                                                       down\r
+                                                                       //,downright\r
+                                                                       ;\r
                                        } KeyboardDef;\r
 typedef        struct          {\r
                                                word            joyMinX,joyMinY,\r
@@ -197,9 +205,9 @@ static boolean                      JoysPresent[MaxJoys];
 static boolean                 JoyPadPresent;\r
 \r
 \r
-//     Global variables
-               static boolean JoystickCalibrated=false;                // MDM (GAMERS EDGE) - added
-               static ControlType ControlTypeUsed;                             // MDM (GAMERS EDGE) - added
+//     Global variables\r
+               static boolean JoystickCalibrated=false;                // MDM (GAMERS EDGE) - added\r
+               static ControlType ControlTypeUsed;                             // MDM (GAMERS EDGE) - added\r
 \r
                static boolean          Keyboard[NumCodes];\r
                static boolean          Paused;\r
@@ -210,16 +218,16 @@ static boolean                    JoyPadPresent;
                static JoystickDef      JoyDefs[MaxJoys];\r
                static ControlType      Controls[MaxPlayers];\r
 \r
-               static dword    MouseDownCount;
+               static dword    MouseDownCount;\r
 \r
 #ifdef DEMO0\r
                static Demo             DemoMode = demo_Off;\r
                static byte /*_seg*/    *DemoBuffer;\r
-               static word             DemoOffset,DemoSize;
-#endif
-
-extern dword far* clockdw;
-
+               static word             DemoOffset,DemoSize;\r
+#endif\r
+\r
+extern dword far* clockdw;\r
+\r
 /*\r
 =============================================================================\r
 \r
@@ -271,9 +279,12 @@ static     ScanCode        CurCode,LastCode;
 \r
 static Direction       DirTable[] =            // Quick lookup for total direction\r
                                        {\r
-                                               dir_NorthWest,  dir_North,      dir_NorthEast,\r
+                                               //dir_NorthWest,\r
+                                               dir_North,\r
+                                               //dir_NorthEast,\r
                                                dir_West,               dir_None,       dir_East,\r
-                                               dir_SouthWest,  dir_South,      dir_SouthEast\r
+                                               //dir_SouthWest,\r
+                                               dir_South//,dir_SouthEast\r
                                        };\r
 \r
 static void                    (*INL_KeyHook)(void);\r
@@ -296,22 +307,24 @@ extern    void            IN_Startup(void),IN_Shutdown(void),
                                        IN_SetControlType(int,ControlType),\r
                                        IN_GetJoyAbs(word joy,word *xp,word *yp),\r
                                        IN_SetupJoy(word joy,word minx,word maxx,\r
-                                                               word miny,word maxy),
+                                                               word miny,word maxy),\r
+                                       Mouse(int x),\r
 #ifdef DEMO0\r
                                        IN_StartDemoPlayback(byte __segment *buffer,word bufsize),\r
-                                       IN_StopDemo(void),IN_FreeDemoBuffer(void),
+                                       IN_StopDemo(void),IN_FreeDemoBuffer(void),\r
 #endif\r
                                        IN_Ack(void),IN_AckBack(void);\r
 extern boolean         IN_UserInput(dword delay,boolean clear),\r
-                                       IN_IsUserInput(void)
+                                       IN_IsUserInput(void)\r
 #ifdef DEMO0\r
-                                       , IN_StartDemoRecord(word bufsize)
-#endif
+                                       , IN_StartDemoRecord(word bufsize)\r
+#endif\r
 ;\r
 extern byte            *IN_GetScanName(ScanCode);\r
 extern char            IN_WaitForASCII(void);\r
 extern ScanCode        IN_WaitForKey(void);\r
-extern word            IN_GetJoyButtonsDB(word joy);
-
+extern word            IN_GetJoyButtonsDB(word joy);\r
+\r
+\r
 //static void interrupt INL_KeyService(void);\r
 #endif\r