]> 4ch.mooo.com Git - 16.git/commitdiff
major changes~ ^^ it works~
authorsparky4 <sparky4@cock.li>
Mon, 29 Jun 2015 07:16:00 +0000 (02:16 -0500)
committersparky4 <sparky4@cock.li>
Mon, 29 Jun 2015 07:16:00 +0000 (02:16 -0500)
modified:   16.LIB
modified:   GFX.LIB
modified:   inputest.exe
modified:   src/inputest.c
modified:   src/lib/16_in.c
modified:   src/lib/16_in.h

16.LIB
GFX.LIB
inputest.exe
src/inputest.c
src/lib/16_in.c
src/lib/16_in.h

diff --git a/16.LIB b/16.LIB
index 4899d50af9a6051789d77e3befb67055b6d227f2..266271d9885120353d2fc3f383cb8f9d8a046de1 100644 (file)
Binary files a/16.LIB and b/16.LIB differ
diff --git a/GFX.LIB b/GFX.LIB
index 8eac230995b237105220429997f900b802b27acf..1ad504e23391d1dc08965a3b2d13fadd4c26cad5 100644 (file)
Binary files a/GFX.LIB and b/GFX.LIB differ
index 52f08c514095d2efa8bf13aeedead497773c618a..91329f9cd34490015f1e145e40c71f670ff06541 100644 (file)
Binary files a/inputest.exe and b/inputest.exe differ
index d4a3d44c50f6150bda75fbf381b1a3a2c0773787..98815cc6ca5a42134a623a98ad3626b03a3ae920 100644 (file)
@@ -28,32 +28,16 @@ void
 main(int argc, char *argv[])\r
 {
        player_t player[MaxPlayers];
-       inconfig in;
-       //word i=0;
 \r
-       in.KbdDefs[0].button0 = 0x1d;
-       in.KbdDefs[0].button1 = 0x38;
-       //in.KbdDefs[0].upleft = 0x47;
-       in.KbdDefs[0].up = 0x48;
-       //in.KbdDefs[0].upright = 0x49;
-       in.KbdDefs[0].left = 0x4b;
-       in.KbdDefs[0].right = 0x4d;
-       //in.KbdDefs[0].downleft = 0x4f;
-       in.KbdDefs[0].down = 0x50;
-       //in.KbdDefs[0].downright = 0x51;
-\r
-       if(IN_Startup(&in))
+       IN_Startup();
+       IN_Default(0,&player,ctrl_Joystick);\r
+       //while(!IN_KeyDown(sc_Escape))
+       while(!IN_KeyDown(sc_Escape))\r
        {
-               IN_Default(0,&player,ctrl_Joystick, &in);\r
-               while(!in.Keyboard[sc_Escape])\r
-               {
-                       IN_ReadControl(0,&player, &in);\r
-                       //printf("%u\n", in.Keyboard[sc_Escape]);
-                       //printf("i=%u\n", i);
-                       printf("");
-                       //i++;\r
-               }
-               IN_Shutdown(&in);
+               IN_ReadControl(0,&player);
+               //printf("%u\n", IN_KeyDown(sc_Escape));
+               //printf("%u\n", IN_qb(sc_Escape));\r
        }
+       IN_Shutdown();
        //printf("%u\n", in.Keyboard[sc_Escape]);\r
 }\r
index 48e62c5237984cbbcf65103e40a6f9c55cf4e240..6d8c1aba9c76e1176e5038574645904547a02653 100644 (file)
 
 #include "src/lib/16_in.h"
 
+/*\r
+=============================================================================\r
+\r
+                                       GLOBAL VARIABLES\r
+\r
+=============================================================================\r
+*/
+struct inconfig
+{
+       boolean                 MousePresent;\r
+       boolean                 JoysPresent[MaxJoys];\r
+       boolean                 JoyPadPresent[MaxPads];
+       boolean         Keyboard[NumCodes];\r
+       boolean         Paused;\r
+       char            LastASCII;\r
+       ScanCode        LastScan;
+
+       KeyboardDef     KbdDefs[MaxKbds];// = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/};
+       JoystickDef     JoyDefs[MaxJoys];
+       JoypadDef       JoypadDefs[MaxPads];
+} inpu;
+
+//struct inconfig in;
+
+//inpu.KbdDefs = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/};
+
 /*\r
 =============================================================================\r
 \r
 \r
 =============================================================================\r
 */
+
 #ifdef __cplusplus             /* Function must be declared C style */
 extern "C" {
-#endif\r
+#endif
+\r
+static struct instat {
+       boolean         IN_Started;\r
+       boolean         CapsLock;\r
+       ScanCode        CurCode,LastCode;
+} inst;
+\r
+static void                    (*INL_KeyHook)(void);
+static void interrupt  (*OldKeyVect)(void);
+static char                    *ParmStringsIN[] = {"nojoys","nomouse",nil};
+\r
 static byte        far ASCIINames[] =          // Unshifted ASCII for scan codes\r
                                        {\r
 //      0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F\r
@@ -118,15 +156,7 @@ static     Direction       DirTable[] =            // Quick lookup for total direction
                                                dir_West,               dir_None,       dir_East,\r
                                                //dir_Soutinest,\r
                                                dir_South//,dir_SouthEast\r
-                                       };\r
-
-static boolean         IN_Started;\r
-static boolean         CapsLock;\r
-static ScanCode        CurCode,LastCode;
-\r
-static void                    (*INL_KeyHook)(void);
-static void interrupt  (*OldKeyVect)(void);
-static char                    *ParmStringsIN[] = {"nojoys","nomouse",nil};
+                                       };
 #ifdef __cplusplus
 }
 #endif
@@ -138,7 +168,7 @@ static      char                    *ParmStringsIN[] = {"nojoys","nomouse",nil};
 //
 ///////////////////////////////////////////////////////////////////////////
 void interrupt
-INL_KeyService(inconfig *in)
+INL_KeyService()
 {
 static boolean special;
                byte    k,c;
@@ -153,7 +183,7 @@ static      boolean special;
        if (k == 0xe0)          // Special key prefix
                special = true;
        else if (k == 0xe1)     // Handle Pause key
-               in->Paused = true;
+               inpu.Paused = true;
        else
        {
                if (k & 0x80)   // Break code
@@ -162,13 +192,13 @@ static    boolean special;
 
 // DEBUG - handle special keys: ctl-alt-delete, print scrn
 
-                       in->Keyboard[k] = false;
+                       inpu.Keyboard[k] = false;
                }
                else                    // Make code
                {
-                       LastCode = CurCode;
-                       CurCode = in->LastScan = k;
-                       in->Keyboard[k] = true;
+                       inst.LastCode = inst.CurCode;
+                       inst.CurCode = inpu.LastScan = k;
+                       inpu.Keyboard[k] = true;
 
                        if (special)
                                c = SpecialNames[k];
@@ -176,25 +206,25 @@ static    boolean special;
                        {
                                if (k == sc_CapsLock)
                                {
-                                       CapsLock ^= true;
+                                       inst.CapsLock ^= true;
                                        // DEBUG - make caps lock light work
                                }
 
-                               if (in->Keyboard[sc_LShift] || in->Keyboard[sc_RShift]) // If shifted
+                               if (inpu.Keyboard[sc_LShift] || inpu.Keyboard[sc_RShift])       // If shifted
                                {
                                        c = ShiftNames[k];
-                                       if ((c >= 'A') && (c <= 'Z') && CapsLock)
+                                       if ((c >= 'A') && (c <= 'Z') && inst.CapsLock)
                                                c += 'a' - 'A';
                                }
                                else
                                {
                                        c = ASCIINames[k];
-                                       if ((c >= 'a') && (c <= 'z') && CapsLock)
+                                       if ((c >= 'a') && (c <= 'z') && inst.CapsLock)
                                                c -= 'a' - 'A';
                                }
                        }
                        if (c)
-                               in->LastASCII = c;
+                               inpu.LastASCII = c;
                }
 
                special = false;
@@ -203,7 +233,7 @@ static      boolean special;
        if (INL_KeyHook && !special)
                INL_KeyHook();
        #ifdef TESTKEYIN
-       printf("%c %x %u\n", c, k, in->Keyboard[k]);
+       printf("%c %x %u\n", c, k, inpu.Keyboard[k]);
        #endif
        outp(0x20,0x20);
 }
@@ -335,7 +365,7 @@ done:
 //
 ///////////////////////////////////////////////////////////////////////////
 static void
-INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive, inconfig *in)
+INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive)
 {
        word            x,y;
        dword   time;
@@ -344,7 +374,7 @@ INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive, inconfig *in)
 static dword   lasttime;
 
        IN_GetJoyAbs(joy,&x,&y);
-       def = in->JoyDefs + joy;
+       def = inpu.JoyDefs + joy;
 
        if (x < def->threshMinX)
        {
@@ -453,11 +483,11 @@ IN_GetJoyButtonsDB(word joy)
 //
 ///////////////////////////////////////////////////////////////////////////
 static void
-INL_StartKbd(inconfig *in)
+INL_StartKbd()
 {
        INL_KeyHook = 0;        // Clear key hook
 
-       IN_ClearKeysDown(in);
+       IN_ClearKeysDown();
 
        OldKeyVect = _dos_getvect(KeyInt);
        _dos_setvect(KeyInt,INL_KeyService);
@@ -508,11 +538,11 @@ INL_ShutMouse(void)
 //     INL_SetJoyScale() - Sets up scaling values for the specified joystick
 //
 static void
-INL_SetJoyScale(word joy, inconfig *in)
+INL_SetJoyScale(word joy)
 {
        JoystickDef     *def;
 
-       def = &(in->JoyDefs[joy]);
+       def = &(inpu.JoyDefs[joy]);
        def->joyMultXL = JoyScaleMax / (def->threshMinX - def->joyMinX);
        def->joyMultXH = JoyScaleMax / (def->joyMaxX - def->threshMaxX);
        def->joyMultYL = JoyScaleMax / (def->threshMinY - def->joyMinY);
@@ -526,12 +556,12 @@ INL_SetJoyScale(word joy, inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, inconfig *in)
+IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)
 {
        word            d,r;
        JoystickDef     *def;
 
-       def = &(in->JoyDefs[joy]);
+       def = &(inpu.JoyDefs[joy]);
 
        def->joyMinX = minx;
        def->joyMaxX = maxx;
@@ -547,7 +577,7 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, inconfig *in)
        def->threshMinY = ((r / 2) - d) + miny;
        def->threshMaxY = ((r / 2) + d) + miny;
 
-       INL_SetJoyScale(joy, in);
+       INL_SetJoyScale(joy);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -557,7 +587,7 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 static boolean
-INL_StartJoy(word joy, inconfig *in)
+INL_StartJoy(word joy)
 {
        word            x,y;
 
@@ -571,7 +601,7 @@ INL_StartJoy(word joy, inconfig *in)
                return(false);
        else
        {
-               IN_SetupJoy(joy,0,x * 2,0,y * 2, in);
+               IN_SetupJoy(joy,0,x * 2,0,y * 2);
                return(true);
        }
 }
@@ -582,9 +612,9 @@ INL_StartJoy(word joy, inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 static void
-INL_ShutJoy(word joy, inconfig *in)
+INL_ShutJoy(word joy)
 {
-       in->JoysPresent[joy] = false;
+       inpu.JoysPresent[joy] = false;
 }
 
 //     Public routines
@@ -594,16 +624,14 @@ INL_ShutJoy(word joy, inconfig *in)
 //     IN_Startup() - Starts up the Input Mgr
 //
 ///////////////////////////////////////////////////////////////////////////
-boolean
-IN_Startup(inconfig *in)
+void
+IN_Startup()
 {
        boolean checkjoys,checkmouse;
        word    i;
 
-       if (IN_Started)
-       {
-               return false;
-       }
+       if (inst.IN_Started)
+               return;
 
        checkjoys = true;
        checkmouse = true;
@@ -620,14 +648,13 @@ IN_Startup(inconfig *in)
                }
        }
 
-       INL_StartKbd(in);
-       in->MousePresent = checkmouse? INL_StartMouse() : false;
+       INL_StartKbd();
+       inpu.MousePresent = checkmouse? INL_StartMouse() : false;
 
        for (i = 0;i < MaxJoys;i++)
-               in->JoysPresent[i] = checkjoys? INL_StartJoy(i, in) : false;
+               inpu.JoysPresent[i] = checkjoys? INL_StartJoy(i) : false;
 
-       IN_Started = true;
-       return true;
+       inst.IN_Started = true;
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -636,16 +663,16 @@ IN_Startup(inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_Default(boolean gotit,player_t *player,ControlType nt, inconfig *in)
+IN_Default(boolean gotit,player_t *player,ControlType nt)
 {
        if
        (
                (!gotit)
-       ||      ((nt == ctrl_Joystick1) && !in->JoysPresent[0])
-       ||      ((nt == ctrl_Joystick2) && !in->JoysPresent[1])
-       ||      ((nt == ctrl_Mouse) && !in->MousePresent)
-       ||      ((nt == ctrl_Joypad1) && !in->JoyPadPresent[0])
-       ||      ((nt == ctrl_Joypad2) && !in->JoyPadPresent[1])
+       ||      ((nt == ctrl_Joystick1) && !inpu.JoysPresent[0])
+       ||      ((nt == ctrl_Joystick2) && !inpu.JoysPresent[1])
+       ||      ((nt == ctrl_Mouse) && !inpu.MousePresent)
+       ||      ((nt == ctrl_Joypad1) && !inpu.JoyPadPresent[0])
+       ||      ((nt == ctrl_Joypad2) && !inpu.JoyPadPresent[1])
        )
                nt = ctrl_Keyboard1;
        IN_SetControlType(0,player,nt);
@@ -656,23 +683,20 @@ IN_Default(boolean gotit,player_t *player,ControlType nt, inconfig *in)
 //     IN_Shutdown() - Shuts down the Input Mgr
 //
 ///////////////////////////////////////////////////////////////////////////
-boolean
-IN_Shutdown(inconfig *in)
+void
+IN_Shutdown()
 {
        word    i;
 
-       if (!IN_Started)
-       {
-               return false;
-       }
+       if (!inst.IN_Started)
+               return;
 
        INL_ShutMouse();
        for (i = 0;i < MaxJoys;i++)
-               INL_ShutJoy(i, in);
+               INL_ShutJoy(i);
        INL_ShutKbd();
 
-       IN_Started = false;
-       return true;
+       inst.IN_Started = false;
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -693,13 +717,13 @@ IN_SetKeyHook(void (*hook)())
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_ClearKeysDown(inconfig *in)
+IN_ClearKeysDown()
 {
        int     i;
 
-       in->LastScan = sc_None;
-       in->LastASCII = key_None;
-       memset (in->Keyboard,0,sizeof(in->Keyboard));
+       inpu.LastScan = sc_None;
+       inpu.LastASCII = key_None;
+       memset (inpu.Keyboard,0,sizeof(inpu.Keyboard));
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -726,7 +750,7 @@ INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy)
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_ReadCursor(CursorInfo *info, inconfig *in)
+IN_ReadCursor(CursorInfo *info)
 {
        word    i,
                        buttons;
@@ -735,7 +759,7 @@ IN_ReadCursor(CursorInfo *info, inconfig *in)
        info->x = info->y = 0;
        info->button0 = info->button1 = false;
 
-       if (in->MousePresent)
+       if (inpu.MousePresent)
        {
                buttons = INL_GetMouseButtons();
                INL_GetMouseDelta(&dx,&dy);
@@ -744,11 +768,11 @@ IN_ReadCursor(CursorInfo *info, inconfig *in)
 
        for (i = 0;i < MaxJoys;i++)
        {
-               if (!in->JoysPresent[i])
+               if (!inpu.JoysPresent[i])
                        continue;
 
                buttons = INL_GetJoyButtons(i);
-               INL_GetJoyDelta(i,&dx,&dy,true, in);
+               INL_GetJoyDelta(i,&dx,&dy,true);
                dx /= 64;
                dy /= 64;
                INL_AdjustCursor(info,buttons,dx,dy);
@@ -762,7 +786,7 @@ IN_ReadCursor(CursorInfo *info, inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_ReadControl(int playnum,player_t *player, inconfig *in)
+IN_ReadControl(int playnum,player_t *player)
 {
                        boolean         realdelta;
                        byte            dbyte;
@@ -802,7 +826,7 @@ register    KeyboardDef     *def;
                {
                case ctrl_Keyboard1:
                case ctrl_Keyboard2:
-                       def = &(in->KbdDefs[type - ctrl_Keyboard]);
+                       def = &(inpu.KbdDefs[type - ctrl_Keyboard]);
 
 /*                     if (Keyboard[def->upleft])
                                mx = motion_Left,my = motion_Up;
@@ -813,25 +837,25 @@ register  KeyboardDef     *def;
                        else if (Keyboard[def->downright])
                                mx = motion_Right,my = motion_Down;*/
 
-                       if (in->Keyboard[def->up])
+                       if (inpu.Keyboard[def->up])
                                my = motion_Up;
-                       else if (in->Keyboard[def->down])
+                       else if (inpu.Keyboard[def->down])
                                my = motion_Down;
 
-                       if (in->Keyboard[def->left])
+                       if (inpu.Keyboard[def->left])
                                mx = motion_Left;
-                       else if (in->Keyboard[def->right])
+                       else if (inpu.Keyboard[def->right])
                                mx = motion_Right;
 
-                       if (in->Keyboard[def->button0])
+                       if (inpu.Keyboard[def->button0])
                                buttons += 1 << 0;
-                       if (in->Keyboard[def->button1])
+                       if (inpu.Keyboard[def->button1])
                                buttons += 1 << 1;
                        realdelta = false;
                        break;
                case ctrl_Joystick1:
                case ctrl_Joystick2:
-                       INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy,false, in);
+                       INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy,false);
                        buttons = INL_GetJoyButtons(type - ctrl_Joystick);
                        realdelta = true;
                        break;
@@ -1000,13 +1024,13 @@ IN_GetScanName(ScanCode scan)
 //
 ///////////////////////////////////////////////////////////////////////////
 ScanCode
-IN_WaitForKey(inconfig *in)
+IN_WaitForKey()
 {
        ScanCode        result;
 
-       while (!(result = in->LastScan))
+       while (!(result = inpu.LastScan))
                ;
-       in->LastScan = 0;
+       inpu.LastScan = 0;
        return(result);
 }
 
@@ -1017,13 +1041,13 @@ IN_WaitForKey(inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 char
-IN_WaitForASCII(inconfig *in)
+IN_WaitForASCII()
 {
        char            result;
 
-       while (!(result = in->LastASCII))
+       while (!(result = inpu.LastASCII))
                ;
-       in->LastASCII = '\0';
+       inpu.LastASCII = '\0';
        return(result);
 }
 
@@ -1033,13 +1057,13 @@ IN_WaitForASCII(inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_AckBack(inconfig *in)
+IN_AckBack()
 {
        word    i;
 
-       while (!in->LastScan)
+       while (!inpu.LastScan)
        {
-               if (in->MousePresent)
+               if (inpu.MousePresent)
                {
                        if (INL_GetMouseButtons())
                        {
@@ -1051,7 +1075,7 @@ IN_AckBack(inconfig *in)
 
                for (i = 0;i < MaxJoys;i++)
                {
-                       if (in->JoysPresent[i])
+                       if (inpu.JoysPresent[i])
                        {
                                if (IN_GetJoyButtonsDB(i))
                                {
@@ -1063,8 +1087,8 @@ IN_AckBack(inconfig *in)
                }
        }
 
-       IN_ClearKey(in->LastScan, in);
-       in->LastScan = sc_None;
+       IN_ClearKey(inpu.LastScan);
+       inpu.LastScan = sc_None;
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -1073,22 +1097,22 @@ IN_AckBack(inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 void
-IN_Ack(inconfig *in)
+IN_Ack()
 {
        word    i;
 
-       IN_ClearKey(in->LastScan, in);
-       in->LastScan = sc_None;
+       IN_ClearKey(inpu.LastScan);
+       inpu.LastScan = sc_None;
 
-       if (in->MousePresent)
+       if (inpu.MousePresent)
                while (INL_GetMouseButtons())
                                        ;
        for (i = 0;i < MaxJoys;i++)
-               if (in->JoysPresent[i])
+               if (inpu.JoysPresent[i])
                        while (IN_GetJoyButtonsDB(i))
                                ;
 
-       IN_AckBack(in);
+       IN_AckBack();
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -1098,19 +1122,19 @@ IN_Ack(inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 boolean
-IN_IsUserInput(inconfig *in)
+IN_IsUserInput()
 {
        boolean result;
        word    i;
 
-       result = in->LastScan;
+       result = inpu.LastScan;
 
-       if (in->MousePresent)
+       if (inpu.MousePresent)
                if (INL_GetMouseButtons())
                        result = true;
 
        for (i = 0;i < MaxJoys;i++)
-               if (in->JoysPresent[i])
+               if (inpu.JoysPresent[i])
                        if (INL_GetJoyButtons(i))
                                result = true;
 
@@ -1126,7 +1150,7 @@ IN_IsUserInput(inconfig *in)
 //
 ///////////////////////////////////////////////////////////////////////////
 boolean
-IN_UserInput(dword delay,boolean clear, inconfig *in)
+IN_UserInput(dword delay,boolean clear)
 {
        dword TimeCount = *clockdw;
        dword   lasttime;
@@ -1134,24 +1158,31 @@ IN_UserInput(dword delay,boolean clear, inconfig *in)
        lasttime = TimeCount;
        do
        {
-               if (IN_IsUserInput(in))
+               if (IN_IsUserInput())
                {
                        if (clear)
-                               IN_AckBack(in);
+                               IN_AckBack();
                        return(true);
                }
        } while (TimeCount - lasttime < delay);
        return(false);
 }
 
-boolean IN_KeyDown(byte code, inconfig *in)
+boolean IN_KeyDown(byte code)
 {
-       return in->Keyboard[(code)];
+       return inpu.Keyboard[code];
 }
 \r
-void IN_ClearKey(byte code, inconfig *in)
+void IN_ClearKey(byte code)
 {
-       in->Keyboard[code] = false;
-       if(code == in->LastScan)
-               in->LastScan = sc_None;
+       inpu.Keyboard[code] = false;
+       if(code == inpu.LastScan)
+               inpu.LastScan = sc_None;
        }
+
+boolean IN_qb(byte kee)
+{
+       printf("%u\n", inpu.Keyboard[kee]);
+       if(inpu.Keyboard[kee]==true) return 1;
+       else return 0;
+}
index f14e8178027bf40b2e1187b03081ae940046ec63..352d87b27974c1c9fee96dd28a1ef1cb7ccf49c5 100644 (file)
@@ -208,69 +208,56 @@ typedef   struct
        ControlType     Controls;
 } player_t;
 
-typedef        struct
-{
-       boolean                 MousePresent;\r
-       boolean                 JoysPresent[MaxJoys];\r
-       boolean                 JoyPadPresent[MaxPads];
-       boolean         Keyboard[NumCodes];\r
-       boolean         Paused;\r
-       char            LastASCII;\r
-       ScanCode        LastScan;
-
-       KeyboardDef     KbdDefs[MaxKbds];
-       JoystickDef     JoyDefs[MaxJoys];
-       JoypadDef       JoypadDefs[MaxPads];
-} inconfig;
-
 #ifdef DEMO0\r
                static Demo             DemoMode = demo_Off;\r
                static byte /*_seg*/    *DemoBuffer;\r
                static word             DemoOffset,DemoSize;\r
 #endif\r
-\r
+
+//extern struct inconfig in;
 extern dword far* clockdw;\r
 \r
 //     Internal routines
-void interrupt INL_KeyService(inconfig *in);
-void Mouse(int x);
+extern void interrupt INL_KeyService();
+extern void Mouse(int x);
 //static void INL_GetMouseDelta(int *x,int *y);
 //static word INL_GetMouseButtons(void);
-void IN_GetJoyAbs(word joy,word *xp,word *yp);
+extern void IN_GetJoyAbs(word joy,word *xp,word *yp);
 //static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive);
 //static word INL_GetJoyButtons(word joy);
-word IN_GetJoyButtonsDB(word joy);
+extern word IN_GetJoyButtonsDB(word joy);
 //static void INL_StartKbd(void);
 //static void INL_ShutKbd(void);
 //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, inconfig *in);
+extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy);
 //static boolean INL_StartJoy(word joy);
 //static void INL_ShutJoy(word joy);
-boolean IN_Startup(inconfig *in);
-void IN_Default(boolean gotit,player_t *player,ControlType nt, inconfig *in);
-boolean IN_Shutdown(inconfig *in);
-void IN_SetKeyHook(void (*hook)());
-void IN_ClearKeysDown(inconfig *in);
+extern void IN_Startup();
+extern void IN_Default(boolean gotit,player_t *player,ControlType nt);
+extern void IN_Shutdown();
+extern void IN_SetKeyHook(void (*hook)());
+extern void IN_ClearKeysDown();
 //static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);
-void IN_ReadCursor(CursorInfo *info, inconfig *in);
-void IN_ReadControl(int playnum,player_t *player, inconfig *in);
-void IN_SetControlType(word playnum,player_t *player,ControlType type);
+extern void IN_ReadCursor(CursorInfo *info);
+extern void IN_ReadControl(int playnum,player_t *player);
+extern 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);
-void IN_StopDemo(void);
-void IN_FreeDemoBuffer(void);
+extern boolean IN_StartDemoRecord(word bufsize);
+extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize);
+extern void IN_StopDemo(void);
+extern void IN_FreeDemoBuffer(void);
 #endif
-byte *IN_GetScanName(ScanCode scan);
-ScanCode IN_WaitForKey(inconfig *in);
-char IN_WaitForASCII(inconfig *in);
-void IN_AckBack(inconfig *in);
-void IN_Ack(inconfig *in);
-boolean IN_IsUserInput(inconfig *in);
-boolean IN_UserInput(dword delay,boolean clear, inconfig *in);
-boolean IN_KeyDown(byte code, inconfig *in);
-void IN_ClearKey(byte code, inconfig *in);
+extern byte *IN_GetScanName(ScanCode scan);
+extern ScanCode IN_WaitForKey();
+extern char IN_WaitForASCII();
+extern void IN_AckBack();
+extern void IN_Ack();
+extern boolean IN_IsUserInput();
+extern boolean IN_UserInput(dword delay,boolean clear);
+extern boolean IN_KeyDown(byte code);
+extern void IN_ClearKey(byte code);
+extern boolean IN_qb(byte kee);
 \r
 #endif\r