]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_in.h
converting
[16.git] / src / lib / 16_in.h
index b157446f76a864943e9c4fb8a1268fa32e09183b..2d15828ee4b98045bdbc5cb7467148403c30bd92 100644 (file)
@@ -46,7 +46,8 @@
 \r
 #define        MaxPlayers      4\r
 #define        MaxKbds         2\r
-#define        MaxJoys         2\r
+#define        MaxJoys         2
+#define        MaxPads         2\r
 #define        NumCodes        128\r
 \r
 typedef        byte            ScanCode;\r
@@ -166,8 +167,8 @@ typedef     enum            {
 typedef        enum            {\r
                                                dir_North,//dir_NorthEast,\r
                                                dir_East,//dir_SouthEast,\r
-                                               dir_South,//dir_SouthWest,\r
-                                               dir_West,//dir_NorthWest,\r
+                                               dir_South,//dir_Soutinest,\r
+                                               dir_West,//dir_Nortinest,\r
                                                dir_None\r
                                        } Direction;\r
 typedef        struct          {\r
@@ -196,11 +197,36 @@ typedef   struct          {
                                                                        joyMultXL,joyMultYL,\r
                                                                        joyMultXH,joyMultYH;\r
                                        } JoystickDef;
+typedef        struct
+{
+       boolean w;\r
+} JoypadDef;
+
+typedef        struct
+{
+       CursorInfo      info;
+       ControlType     Controls;
+} player_t;
 
-/*typedef      struct
+typedef        struct
 {
-       CursorInfo;
-}      ControlInfo;*/\r
+       boolean                 MousePresent;\r
+       boolean                 JoysPresent[MaxJoys];\r
+       boolean                 JoyPadPresent[MaxPads];
+       boolean         Keyboard[NumCodes];\r
+       boolean         Paused;\r
+       char            LastASCII;\r
+       ScanCode        LastScan;
+
+       boolean         IN_Started;\r
+       boolean         CapsLock;\r
+       ScanCode        CurCode,LastCode;
+
+       KeyboardDef     KbdDefs[MaxKbds];
+       JoystickDef     JoyDefs[MaxJoys];
+       JoypadDef       JoypadDefs[MaxPads];
+} inconfig;
+\r
 /*\r
 =============================================================================\r
 \r
@@ -212,25 +238,25 @@ typedef   struct          {
 //\r
 // configuration variables\r
 //\r
-static boolean                 MousePresent;\r
-static boolean                 JoysPresent[MaxJoys];\r
-static boolean                 JoyPadPresent;\r
+//static boolean                       MousePresent;\r
+//static boolean                       JoysPresent[MaxJoys];\r
+//static boolean                       JoyPadPresent[MaxPads];\r
 \r
 //     Global variables\r
 //             extern boolean JoystickCalibrated;              // MDM (GAMERS EDGE) - added\r
 //             extern ControlType ControlTypeUsed;                             // MDM (GAMERS EDGE) - added\r
 \r
-               extern boolean          Keyboard[NumCodes];\r
-               extern boolean          Paused;\r
-               extern char             LastASCII;\r
-               extern ScanCode LastScan;\r
+               //extern boolean                Keyboard[NumCodes];\r
+               //extern boolean                Paused;\r
+               //extern char           LastASCII;\r
+               //extern ScanCode       LastScan;\r
 \r
                //extern KeyboardDef    KbdDefs[];
-               static KeyboardDef      KbdDefs[MaxKbds] = {0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51};\r
-               extern JoystickDef      JoyDefs[MaxJoys];\r
-               extern ControlType      Controls[MaxPlayers];\r
+               //static KeyboardDef    KbdDefs[MaxKbds] = {0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51};\r
+               //extern JoystickDef    JoyDefs[MaxJoys];\r
+               //extern ControlType    Controls[MaxPlayers];\r
 \r
-               extern dword    MouseDownCount;\r
+               //extern dword  MouseDownCount;\r
 \r
 #ifdef DEMO0\r
                static Demo             DemoMode = demo_Off;\r
@@ -309,17 +335,13 @@ static    byte        far ASCIINames[] =          // Unshifted ASCII for scan codes
        "Down","Left","Right",""\r
                                        };
 \r
-static boolean         IN_Started;\r
-static boolean         CapsLock;\r
-static ScanCode        CurCode,LastCode;\r
-\r
 static Direction       DirTable[] =            // Quick lookup for total direction\r
                                        {\r
-                                               //dir_NorthWest,\r
+                                               //dir_Nortinest,\r
                                                dir_North,\r
                                                //dir_NorthEast,\r
                                                dir_West,               dir_None,       dir_East,\r
-                                               //dir_SouthWest,\r
+                                               //dir_Soutinest,\r
                                                dir_South//,dir_SouthEast\r
                                        };\r
 \r
@@ -333,7 +355,7 @@ static      char                    *ParmStringsIN[] = {"nojoys","nomouse",nil};
 #define        IN_ClearKey(code)       {Keyboard[code] = false; if (code == LastScan) LastScan = sc_None;}\r
 
 //     Internal routines
-void interrupt INL_KeyService(void);
+void interrupt INL_KeyService(inconfig *in);
 void Mouse(int x);
 //static void INL_GetMouseDelta(int *x,int *y);
 //static word INL_GetMouseButtons(void);
@@ -346,18 +368,18 @@ word IN_GetJoyButtonsDB(word joy);
 //static boolean INL_StartMouse(void);
 //static void INL_ShutMouse(void);
 //static void INL_SetJoyScale(word joy);
-void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy);
+void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, inconfig *in);
 //static boolean INL_StartJoy(word joy);
 //static void INL_ShutJoy(word joy);
-void IN_Startup(void);
-void IN_Default(boolean gotit,ControlType in);
-void IN_Shutdown(void);
+void IN_Startup(inconfig *in);
+void IN_Default(boolean gotit,player_t *player,ControlType nt, inconfig *in);
+void IN_Shutdown(inconfig *in);
 void IN_SetKeyHook(void (*hook)());
-void IN_ClearKeysDown(void);
+void IN_ClearKeysDown(inconfig *in);
 //static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);
 void IN_ReadCursor(CursorInfo *info);
-void IN_ReadControl(int player,CursorInfo *info);
-void IN_SetControlType(int player,ControlType type);
+void IN_ReadControl(int playnum,player_t *player);
+void IN_SetControlType(word playnum,player_t *player,ControlType type);
 #if DEMO0
 boolean IN_StartDemoRecord(word bufsize);
 void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize);
@@ -371,7 +393,6 @@ void IN_AckBack(void);
 void IN_Ack(void);
 boolean IN_IsUserInput(void);
 boolean IN_UserInput(dword delay,boolean clear);
-
 \r
 /*extern       void            IN_Startup(void),IN_Shutdown(void),\r
                                        IN_Default(boolean gotit,ControlType in),\r
@@ -400,7 +421,5 @@ extern      char            IN_WaitForASCII(void);
 extern ScanCode        IN_WaitForKey(void);\r
 extern word            IN_GetJoyButtonsDB(word joy);*/\r
 \r
-\r
-void interrupt INL_KeyService(void);\r
 boolean IN_qb(byte kee);\r
 #endif\r