]> 4ch.mooo.com Git - 16.git/commitdiff
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
authorsparky4 <sparky4@cock.li>
Thu, 23 Mar 2017 21:46:02 +0000 (16:46 -0500)
committersparky4 <sparky4@cock.li>
Thu, 23 Mar 2017 21:46:02 +0000 (16:46 -0500)
13 files changed:
makefile
src/0.c
src/16.c
src/inputest.c
src/lib/16_in.c
src/lib/16_in.h
src/lib/16_in_o.c [moved from src/lib/16_in_1.c with 83% similarity]
src/lib/16_in_o.h [moved from src/lib/16_in_1.h with 85% similarity]
src/lib/16_tail.c
src/lib/16_tail.h
src/test.c
src/vrstest.c
src/zcroll.c

index eeb4d5aca29d6d49d760abc0882d494dfa59ff07..defcd3fddbab487a593c3b91f6ce4b59d8eaf4ca 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -196,8 +196,7 @@ TESTEXEC = &
        zcroll.exe &
        inputest.exe &
        vrstest.exe &
-       maptest.exe &
-       inntest.exe
+       maptest.exe
 TESTEXEC2 = &
        pcxtest.exe &
        scroll.exe &
diff --git a/src/0.c b/src/0.c
index 28d5ff052871dd9d7c2ff40a7e80c9abfd985809..96d8e7aa0553f5f0061cfd473c3af4fdcb463537 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -101,8 +101,8 @@ int main(int argc,char **argv)
        vrl_lineoffs = vrl1_vgax_genlineoffsets(vrl_header,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r
        if (vrl_lineoffs == NULL) return 1;\r
 \r
-       IN_Startup();\r
-       IN_Default(0,&gvar.player[0],ctrl_Keyboard1);\r
+       IN_Startup(&gvar);\r
+       IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar);\r
        EN_initPlayer(&gvar.player[0], &gvar.video);\r
 \r
        /* setup camera and screen~ */\r
@@ -140,14 +140,14 @@ int main(int argc,char **argv)
 \r
                while(!IN_KeyDown(sc_Escape))\r
                {\r
-                       IN_ReadControl(&gvar.player[0]);\r
-                       if(IN_KeyDown(68)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1); } //f10\r
+                       IN_ReadControl(&gvar.player[0], &gvar);\r
+                       if(IN_KeyDown(68)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1, &gvar); } //f10\r
                        TAIL_PANKEYFUN;\r
                        if(IN_KeyDown(sc_Space) || zerostoppause)       //space\r
                        {\r
                                anim=!anim;\r
                                DRAWCORNERBOXES;\r
-                               if(!zerostoppause) IN_UserInput(1); else zerostoppause=0;\r
+                               if(!zerostoppause) IN_UserInput(1, &gvar); else zerostoppause=0;\r
                        }\r
                        if(IN_KeyDown(sc_R)){\r
                                gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16;\r
@@ -213,7 +213,7 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header
                }\r
        }\r
 \r
-       IN_UserInput(1);\r
+       IN_UserInput(1, &gvar);\r
 \r
 //===========================================================================//\r
 \r
@@ -301,7 +301,7 @@ if(!noanim) {
                }\r
        }\r
 }\r
-       IN_Shutdown();\r
+       IN_Shutdown(&gvar);\r
        VGAmodeX(0, 1, &gvar);\r
        free(vrl_lineoffs);\r
        buffer = NULL;\r
index 4fda90d41c74e9c990b3b6d4d94ba65a7ed9ee6c..af711c37aa1d794319d6f6351b0ab87f0dc9d4d6 100755 (executable)
--- a/src/16.c
+++ b/src/16.c
@@ -37,11 +37,11 @@ main(int argc, char *argv[])
        modexSavePalFile("data/g.pal", gvar.video.palette);\r
        VGAmodeX(1, 1, &gvar);\r
 //     modexPalBlack();        //so player will not see loadings~\r
-       IN_Default(0,&gvar.player[0],ctrl_Joystick);\r
+       IN_Default(0,&gvar.player[0],ctrl_Joystick, &gvar);\r
        //modexprint(&screen, 32, 32, 1, 2, 0, "a", 1);\r
        while(ENGI_QUIT != gvar.engi_stat)\r
        {\r
-               IN_ReadControl(&gvar.player[0]);\r
+               IN_ReadControl(&gvar.player[0], &gvar);\r
                if(IN_KeyDown(sc_Escape)) gvar.engi_stat = ENGI_QUIT;\r
                shinku(&gvar);\r
                _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);\r
index 2b2d564b9e411b7154e8c8a24909e1c5015dab10..56370b7453098636e7485ea9796fd96e01e397f8 100755 (executable)
@@ -34,9 +34,9 @@ main(int argc, char *argv[])
        dbg_testcontrolnoisy=1;\r
        start_timer(&gvar);\r
        //Startup16(&gvar);\r
-       IN_Startup();\r
+       IN_Startup(&gvar);\r
        IN_Default(0,&gvar.player[0],\r
-ctrl_Keyboard1);\r
+ctrl_Keyboard1, &gvar);\r
 //ctrl_Joystick1);\r
        IN_SetControlType(&gvar.player[0],\r
 ctrl_Keyboard1);\r
@@ -52,7 +52,7 @@ ctrl_Keyboard1);
        while(!IN_KeyDown(sc_Escape))\r
        {\r
 //0000         shinkutxt(&gvar);\r
-               IN_ReadControl(&gvar.player[0]);\r
+               IN_ReadControl(&gvar.player[0], &gvar);\r
                switch(gvar.player[0].enti.d)\r
                {\r
                //right movement\r
@@ -104,7 +104,7 @@ ctrl_Keyboard1);
                        //IN_Ack();\r
                }\r
        }\r
-       IN_Shutdown();\r
+       IN_Shutdown(&gvar);\r
                //Shutdown16(&gvar);\r
        //printf("%u\n", in.Keyboard[sc_Escape]);\r
        printf("inputest.exe ");\r
index e7ed19edafbe81620eadfbd47dac839280a916a9..98ecb70d117a330213f9fb00a974dda1463ecbbd 100755 (executable)
@@ -51,7 +51,7 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 \r
 =============================================================================\r
 */\r
-struct inconfig\r
+/*struct inconfig\r
 {\r
        boolean         MousePresent;\r
        boolean         JoysPresent[MaxJoys];\r
@@ -62,9 +62,9 @@ struct inconfig
 \r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
-} inpu;\r
+} inpu;*/\r
 \r
-//inpu.KbdDefs = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/};\r
+//gvar->in.KbdDefs = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/};\r
 \r
 /*\r
 =============================================================================\r
@@ -79,9 +79,13 @@ extern "C" {
 #endif\r
 \r
 static struct instat {\r
-       boolean         IN_Started;\r
        boolean         CapsLock;\r
        ScanCode        CurCode,LastCode;\r
+\r
+       boolean         Keyboard[NumCodes];\r
+       boolean         Paused;\r
+       char            LastASCII;\r
+       ScanCode        LastScan;\r
 } inst;\r
 \r
 static byte        far ASCIINames[] =          // Unshifted ASCII for scan codes\r
@@ -183,7 +187,7 @@ static      boolean special;
        if (k == 0xe0)          // Special key prefix\r
                special = true;\r
        else if (k == 0xe1)     // Handle Pause key\r
-               inpu.Paused = true;\r
+               inst.Paused = true;\r
        else\r
        {\r
                if (k & 0x80)   // Break code\r
@@ -192,13 +196,13 @@ static    boolean special;
 \r
 // DEBUG - handle special keys: ctl-alt-delete, print scrn\r
 \r
-                       inpu.Keyboard[k] = false;\r
+                       inst.Keyboard[k] = false;\r
                }\r
                else                    // Make code\r
                {\r
                        inst.LastCode = inst.CurCode;\r
-                       inst.CurCode = inpu.LastScan = k;\r
-                       inpu.Keyboard[k] = true;\r
+                       inst.CurCode = inst.LastScan = k;\r
+                       inst.Keyboard[k] = true;\r
 \r
                        if (special)\r
                                c = SpecialNames[k];\r
@@ -210,7 +214,7 @@ static      boolean special;
                                        // DEBUG - make caps lock light work\r
                                }\r
 \r
-                               if (inpu.Keyboard[sc_LShift] || inpu.Keyboard[sc_RShift])       // If shifted\r
+                               if (inst.Keyboard[sc_LShift] || inst.Keyboard[sc_RShift])       // If shifted\r
                                {\r
                                        c = ShiftNames[k];\r
                                        if ((c >= 'A') && (c <= 'Z') && inst.CapsLock)\r
@@ -224,7 +228,7 @@ static      boolean special;
                                }\r
                        }\r
                        if (c)\r
-                               inpu.LastASCII = c;\r
+                               inst.LastASCII = c;\r
                }\r
 \r
                special = false;\r
@@ -233,7 +237,7 @@ static      boolean special;
        if (INL_KeyHook && !special)\r
                INL_KeyHook();\r
 #ifdef __DEBUG_InputMgr__\r
-       if(dbg_testkeyin > 0) printf("%c        %u      [0x%x %u]       %u\n", c, c, k, k, inpu.Keyboard[k]);\r
+       if(dbg_testkeyin > 0) printf("%c        %u      [0x%x %u]       %u\n", c, c, k, k, inst.Keyboard[k]);\r
 #endif\r
        outportb(0x20,0x20);\r
 }\r
@@ -376,7 +380,7 @@ done:
 //             joystick (from +/-127)\r
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
-void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/)\r
+void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar)\r
 {\r
        word            x,y;\r
        word TimeCount = *clockw;\r
@@ -384,7 +388,7 @@ void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/)
 static word    lasttime;\r
 \r
        IN_GetJoyAbs(joy,&x,&y);\r
-       def = inpu.JoyDefs + joy;\r
+       def = gvar->in.JoyDefs + joy;\r
 \r
        if (x < def->threshMinX)\r
        {\r
@@ -493,7 +497,7 @@ IN_GetJoyButtonsDB(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static void\r
-INL_StartKbd(void)\r
+INL_StartKbd(global_game_variables_t *gvar)\r
 {\r
        INL_KeyHook = NULL;     // Clear key hook\r
 \r
@@ -560,11 +564,11 @@ INL_ShutMouse(void)
 //     INL_SetJoyScale() - Sets up scaling values for the specified joystick\r
 //\r
 static void\r
-INL_SetJoyScale(word joy)\r
+INL_SetJoyScale(word joy, global_game_variables_t *gvar)\r
 {\r
        JoystickDef     *def;\r
 \r
-       def = &(inpu.JoyDefs[joy]);\r
+       def = &(gvar->in.JoyDefs[joy]);\r
        def->joyMultXL = JoyScaleMax / (def->threshMinX - def->joyMinX);\r
        def->joyMultXH = JoyScaleMax / (def->joyMaxX - def->threshMaxX);\r
        def->joyMultYL = JoyScaleMax / (def->threshMinY - def->joyMinY);\r
@@ -578,12 +582,12 @@ INL_SetJoyScale(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)\r
+IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, global_game_variables_t *gvar)\r
 {\r
        word            d,r;\r
        JoystickDef     *def;\r
 \r
-       def = &(inpu.JoyDefs[joy]);\r
+       def = &(gvar->in.JoyDefs[joy]);\r
 \r
        def->joyMinX = minx;\r
        def->joyMaxX = maxx;\r
@@ -599,7 +603,7 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)
        def->threshMinY = ((r / 2) - d) + miny;\r
        def->threshMaxY = ((r / 2) + d) + miny;\r
 \r
-       INL_SetJoyScale(joy);\r
+       INL_SetJoyScale(joy, gvar);\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -609,7 +613,7 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static boolean\r
-INL_StartJoy(word joy)\r
+INL_StartJoy(word joy, global_game_variables_t *gvar)\r
 {\r
        word            x,y;\r
 \r
@@ -623,7 +627,7 @@ INL_StartJoy(word joy)
                return(false);\r
        else\r
        {\r
-               IN_SetupJoy(joy,0,x * 2,0,y * 2);\r
+               IN_SetupJoy(joy,0,x * 2,0,y * 2, gvar);\r
                return(true);\r
        }\r
 }\r
@@ -634,9 +638,9 @@ INL_StartJoy(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static void\r
-INL_ShutJoy(word joy)\r
+INL_ShutJoy(word joy, global_game_variables_t *gvar)\r
 {\r
-       inpu.JoysPresent[joy] = false;\r
+       gvar->in.JoysPresent[joy] = false;\r
 }\r
 \r
 //     Public routines\r
@@ -647,12 +651,12 @@ INL_ShutJoy(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_Startup()\r
+IN_Startup(global_game_variables_t *gvar)\r
 {\r
        boolean checkjoys,checkmouse;\r
        word    i;\r
 \r
-       if (inst.IN_Started)\r
+       if (gvar->in.IN_Started)\r
                return;\r
 \r
        checkjoys = true;\r
@@ -670,13 +674,15 @@ IN_Startup()
                }\r
        }\r
 \r
-       INL_StartKbd();\r
-       inpu.MousePresent = checkmouse? INL_StartMouse() : false;\r
+       INL_StartKbd(gvar);\r
+       gvar->in.MousePresent = checkmouse? INL_StartMouse() : false;\r
 \r
        for (i = 0;i < MaxJoys;i++)\r
-               inpu.JoysPresent[i] = checkjoys? INL_StartJoy(i) : false;\r
+               gvar->in.JoysPresent[i] = checkjoys? INL_StartJoy(i, gvar) : false;\r
+\r
+       gvar->in.inst = &inst;\r
 \r
-       inst.IN_Started = true;\r
+       gvar->in.IN_Started = true;\r
 \r
 }\r
 \r
@@ -686,26 +692,26 @@ IN_Startup()
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_Default(boolean gotit,player_t *player,ControlType nt)\r
+IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_t *gvar)\r
 {\r
        int i;\r
        if\r
        (\r
                (!gotit)\r
-       ||      ((nt == ctrl_Joystick1) && !inpu.JoysPresent[0])\r
-       ||      ((nt == ctrl_Joystick2) && !inpu.JoysPresent[1])\r
-       ||      ((nt == ctrl_Mouse) && !inpu.MousePresent)\r
+       ||      ((nt == ctrl_Joystick1) && !gvar->in.JoysPresent[0])\r
+       ||      ((nt == ctrl_Joystick2) && !gvar->in.JoysPresent[1])\r
+       ||      ((nt == ctrl_Mouse) && !gvar->in.MousePresent)\r
        )\r
                nt = ctrl_Keyboard1;\r
-       inpu.KbdDefs[0].button0 = 0x1c;\r
-       inpu.KbdDefs[0].button1 = 0x38;\r
+       gvar->in.KbdDefs[0].button0 = 0x1c;\r
+       gvar->in.KbdDefs[0].button1 = 0x38;\r
        //in.KbdDefs[0].upleft = 0x47;\r
-       inpu.KbdDefs[0].up = 0x48;\r
+       gvar->in.KbdDefs[0].up = 0x48;\r
        //in.KbdDefs[0].upright = 0x49;\r
-       inpu.KbdDefs[0].left = 0x4b;\r
-       inpu.KbdDefs[0].right = 0x4d;\r
+       gvar->in.KbdDefs[0].left = 0x4b;\r
+       gvar->in.KbdDefs[0].right = 0x4d;\r
        //in.KbdDefs[0].downleft = 0x4f;\r
-       inpu.KbdDefs[0].down = 0x50;\r
+       gvar->in.KbdDefs[0].down = 0x50;\r
        //in.KbdDefs[0].downright = 0x51;\r
        IN_SetControlType(player,nt);\r
        for(i=0; i>MaxPlayers;i++)\r
@@ -718,19 +724,19 @@ IN_Default(boolean gotit,player_t *player,ControlType nt)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_Shutdown(void)\r
+IN_Shutdown(global_game_variables_t *gvar)\r
 {\r
        word    i;\r
 \r
-       if (!inst.IN_Started)\r
+       if (!gvar->in.IN_Started)\r
                return;\r
 \r
        INL_ShutMouse();\r
        for (i = 0;i < MaxJoys;i++)\r
-               INL_ShutJoy(i);\r
+               INL_ShutJoy(i, gvar);\r
        INL_ShutKbd();\r
 \r
-       inst.IN_Started = false;\r
+       gvar->in.IN_Started = false;\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -755,9 +761,9 @@ IN_ClearKeysDown(void)
 {\r
        //int   i;\r
 \r
-       inpu.LastScan = sc_None;\r
-       inpu.LastASCII = key_None;\r
-       memset (inpu.Keyboard,0,sizeof(inpu.Keyboard));\r
+       inst.LastScan = sc_None;\r
+       inst.LastASCII = key_None;\r
+       memset (inst.Keyboard,0,sizeof(inst.Keyboard));\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -784,7 +790,7 @@ INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_ReadCursor(CursorInfo *info)\r
+IN_ReadCursor(CursorInfo *info, global_game_variables_t *gvar)\r
 {\r
        word    i,\r
                        buttons;\r
@@ -793,7 +799,7 @@ IN_ReadCursor(CursorInfo *info)
        info->x = info->y = 0;\r
        info->button0 = info->button1 = false;\r
 \r
-       if (inpu.MousePresent)\r
+       if (gvar->in.MousePresent)\r
        {\r
                buttons = INL_GetMouseButtons();\r
                INL_GetMouseDelta(&dx,&dy);\r
@@ -802,11 +808,11 @@ IN_ReadCursor(CursorInfo *info)
 \r
        for (i = 0;i < MaxJoys;i++)\r
        {\r
-               if (!inpu.JoysPresent[i])\r
+               if (!gvar->in.JoysPresent[i])\r
                        continue;\r
 \r
                buttons = INL_GetJoyButtons(i);\r
-               INL_GetJoyDelta(i,&dx,&dy/*,true*/);\r
+               INL_GetJoyDelta(i,&dx,&dy/*,true*/, gvar);\r
                dx /= 64;\r
                dy /= 64;\r
                INL_AdjustCursor(info,buttons,dx,dy);\r
@@ -824,7 +830,7 @@ IN_ReadCursor(CursorInfo *info)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_ReadControl(player_t *player)\r
+IN_ReadControl(player_t *player, global_game_variables_t *gvar)\r
 {\r
                        boolean         realdelta;\r
 #if DEMO0\r
@@ -868,7 +874,7 @@ register    KeyboardDef     *def;
                {\r
                case ctrl_Keyboard1:\r
                case ctrl_Keyboard2:\r
-                       def = &(inpu.KbdDefs[type - ctrl_Keyboard]);\r
+                       def = &(gvar->in.KbdDefs[type - ctrl_Keyboard]);\r
 \r
 /*                     if (Keyboard[def->upleft])\r
                                mx = motion_Left,my = motion_Up;\r
@@ -881,28 +887,28 @@ register  KeyboardDef     *def;
 //TODO: make this into a function that the joystick AND keyboard can use wwww\r
                        if(DIRECTIONIFELSE)//(player->info.dir == 2)\r
                        {\r
-                       if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
-                               if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]))\r
+                       if(!inst.Keyboard[def->left] && !inst.Keyboard[def->right]){\r
+                               if((inst.Keyboard[def->up] && !inst.Keyboard[def->down]))\r
                                        my = motion_Up;\r
-                               if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up]))\r
+                               if((inst.Keyboard[def->down] && !inst.Keyboard[def->up]))\r
                                        my = motion_Down;\r
-                       }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
-                               if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]))\r
+                       }else if(!inst.Keyboard[def->up] && !inst.Keyboard[def->down]){\r
+                               if((inst.Keyboard[def->left] && !inst.Keyboard[def->right]))\r
                                        mx = motion_Left;\r
-                               if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left]))\r
+                               if((inst.Keyboard[def->right] && !inst.Keyboard[def->left]))\r
                                        mx = motion_Right;\r
                        }else{  //2 keys pressed\r
                                        switch (player->pdir)\r
                                        {\r
                                                case 0:\r
                                                case 4:\r
-                                                       if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right])){ dir = DirTable[1]; }//mx = motion_Left; }\r
-                                                       else if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left])){ dir = DirTable[3]; }//mx = motion_Right; }\r
+                                                       if((inst.Keyboard[def->left] && !inst.Keyboard[def->right])){ dir = DirTable[1]; }//mx = motion_Left; }\r
+                                                       else if((inst.Keyboard[def->right] && !inst.Keyboard[def->left])){ dir = DirTable[3]; }//mx = motion_Right; }\r
                                                break;\r
                                                case 1:\r
                                                case 3:\r
-                                                       if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down])){ dir = DirTable[0]; }//my = motion_Up; }\r
-                                                       else if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up])){ dir = DirTable[4]; }//my = motion_Down; }\r
+                                                       if((inst.Keyboard[def->up] && !inst.Keyboard[def->down])){ dir = DirTable[0]; }//my = motion_Up; }\r
+                                                       else if((inst.Keyboard[def->down] && !inst.Keyboard[def->up])){ dir = DirTable[4]; }//my = motion_Down; }\r
                                                break;\r
                                                default:\r
                                                break;\r
@@ -913,15 +919,15 @@ register  KeyboardDef     *def;
                                }\r
                        }\r
                        //input from player\r
-                       if (inpu.Keyboard[def->button0])\r
+                       if (inst.Keyboard[def->button0])\r
                                buttons += 1 << 0;\r
-                       if (inpu.Keyboard[def->button1])\r
+                       if (inst.Keyboard[def->button1])\r
                                buttons += 1 << 1;\r
                        realdelta = false;\r
                        break;\r
                case ctrl_Joystick1:\r
                case ctrl_Joystick2:\r
-                       INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy/*,false*/);\r
+                       INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy/*,false*/, gvar);\r
                        buttons = INL_GetJoyButtons(type - ctrl_Joystick);\r
                        realdelta = true;\r
                        break;\r
@@ -992,14 +998,14 @@ register  KeyboardDef     *def;
 #endif\r
 #ifdef __DEBUG_InputMgr__\r
 if(dbg_testcontrolnoisy > 0)\r
-if(player->info.dir!=2/*(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])*/ || player->enti.q>1)\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
        //printf("b1=%u b2=%u b3=%u b4=%u       ", player->info.button0, player->info.button1, player->info.button2, player->info.button3);\r
        //printf("q=%d ", player->enti.q);\r
        //printf("cpee=%c ", dirchar(conpee));\r
        printf("pdir=%c d=%c dir=%c ", dirchar(player->pdir), dirchar(player->enti.d), dirchar(player->info.dir));\r
        /*if(realdelta) */printf("dx=%d dy=%d   mx=%d   my=%d", player->info.x, player->info.y, player->info.xaxis, player->info.yaxis);\r
-       //else if(!realdelta) printf("%c%d %c%d %c%d %c%d", dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]);\r
+       //else if(!realdelta) printf("%c%d %c%d %c%d %c%d", dirchar(0), inst.Keyboard[def->up], dirchar(4), inst.Keyboard[def->down], dirchar(1), inst.Keyboard[def->left], dirchar(3), inst.Keyboard[def->right]);\r
        printf("\n");\r
 }\r
 #endif\r
@@ -1112,9 +1118,9 @@ IN_WaitForKey(void)
 {\r
        ScanCode        result;\r
 \r
-       while (!(result = inpu.LastScan))\r
+       while (!(result = inst.LastScan))\r
                ;\r
-       inpu.LastScan = 0;\r
+       inst.LastScan = 0;\r
        return(result);\r
 }\r
 \r
@@ -1129,9 +1135,9 @@ IN_WaitForASCII(void)
 {\r
        char            result;\r
 \r
-       while (!(result = inpu.LastASCII))\r
+       while (!(result = inst.LastASCII))\r
                ;\r
-       inpu.LastASCII = '\0';\r
+       inst.LastASCII = '\0';\r
        return(result);\r
 }\r
 \r
@@ -1144,7 +1150,7 @@ IN_WaitForASCII(void)
 \r
 boolean        btnstate[8];\r
 \r
-void IN_StartAck(void)\r
+void IN_StartAck(global_game_variables_t *gvar)\r
 {\r
        unsigned        i,buttons;\r
 \r
@@ -1155,8 +1161,8 @@ void IN_StartAck(void)
        memset (btnstate,0,sizeof(btnstate));\r
 \r
        buttons = IN_JoyButtons () << 4;\r
-       if (inpu.MousePresent)\r
-               buttons |= IN_MouseButtons ();\r
+       if (gvar->in.MousePresent)\r
+               buttons |= IN_MouseButtons (gvar);\r
 \r
        for (i=0;i<8;i++,buttons>>=1)\r
                if (buttons&1)\r
@@ -1164,19 +1170,19 @@ void IN_StartAck(void)
 }\r
 \r
 \r
-boolean IN_CheckAck (void)\r
+boolean IN_CheckAck (global_game_variables_t *gvar)\r
 {\r
        unsigned        i,buttons;\r
 \r
 //\r
 // see if something has been pressed\r
 //\r
-       if (inpu.LastScan)\r
+       if (inst.LastScan)\r
                return true;\r
 \r
        buttons = IN_JoyButtons () << 4;\r
-       if (inpu.MousePresent)\r
-               buttons |= IN_MouseButtons ();\r
+       if (gvar->in.MousePresent)\r
+               buttons |= IN_MouseButtons (gvar);\r
 \r
        for (i=0;i<8;i++,buttons>>=1)\r
                if ( buttons&1 )\r
@@ -1191,11 +1197,11 @@ boolean IN_CheckAck (void)
 }\r
 \r
 \r
-void IN_Ack (void)\r
+void IN_Ack (global_game_variables_t *gvar)\r
 {\r
-       IN_StartAck ();\r
+       IN_StartAck (gvar);\r
 \r
-       while (!IN_CheckAck ())\r
+       while (!IN_CheckAck (gvar))\r
        ;\r
 }\r
 \r
@@ -1206,19 +1212,19 @@ void IN_Ack (void)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 boolean\r
-IN_IsUserInput()\r
+IN_IsUserInput(global_game_variables_t *gvar)\r
 {\r
        boolean result;\r
        word    i;\r
 \r
-       result = inpu.LastScan;\r
+       result = inst.LastScan;\r
 \r
-       if (inpu.MousePresent)\r
+       if (gvar->in.MousePresent)\r
                if (INL_GetMouseButtons())\r
                        result = true;\r
 \r
        for (i = 0;i < MaxJoys;i++)\r
-               if (inpu.JoysPresent[i])\r
+               if (gvar->in.JoysPresent[i])\r
                        if (INL_GetJoyButtons(i))\r
                                result = true;\r
 \r
@@ -1233,16 +1239,16 @@ IN_IsUserInput()
 //             button up.\r
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
-boolean IN_UserInput(word delay)\r
+boolean IN_UserInput(word delay, global_game_variables_t *gvar)\r
 {\r
        word TimeCount = *clockw;\r
        word    lasttime;\r
 \r
        lasttime = TimeCount;\r
-       IN_StartAck ();\r
+       IN_StartAck (gvar);\r
        do\r
        {\r
-               if (IN_CheckAck())\r
+               if (IN_CheckAck(gvar))\r
                        return true;\r
        } while (TimeCount - lasttime < delay);\r
        return(false);\r
@@ -1258,10 +1264,10 @@ boolean IN_UserInput(word delay)
 ===================\r
 */\r
 \r
-byte   IN_MouseButtons (void)\r
+byte   IN_MouseButtons (global_game_variables_t *gvar)\r
 {\r
        union REGS CPURegs;\r
-       if (inpu.MousePresent)\r
+       if (gvar->in.MousePresent)\r
        {\r
                Mouse(MButtons);\r
                return CPURegs.x.bx;\r
@@ -1293,9 +1299,11 @@ byte     IN_JoyButtons (void)
 boolean IN_KeyDown(byte code)\r
 {\r
 #ifdef __DEBUG_InputMgr__\r
+       if(inst.Keyboard[code])\r
+               printf("IN_KeyDown(%c): %u\n", code, inst.Keyboard[code]);\r
        if(!dbg_nointest)\r
 #endif\r
-       return inpu.Keyboard[code];\r
+       return inst.Keyboard[code];\r
 #ifdef __DEBUG_InputMgr__\r
        else\r
                if(dbg_nointest && kbhit())\r
@@ -1307,23 +1315,23 @@ boolean IN_KeyDown(byte code)
 \r
 void IN_ClearKey(byte code)\r
 {\r
-       inpu.Keyboard[code] = false;\r
-       if(code == inpu.LastScan)\r
-               inpu.LastScan = sc_None;\r
+       inst.Keyboard[code] = false;\r
+       if(code == inst.LastScan)\r
+               inst.LastScan = sc_None;\r
        }\r
 \r
 boolean IN_qb(byte kee)\r
 {\r
 #ifdef __DEBUG_InputMgr__\r
-       if(dbg_testkeyin) printf("%u\n", inpu.Keyboard[kee]);\r
+       if(dbg_testkeyin) if(inst.Keyboard[kee]) printf("IN_qb():       %u\n", inst.Keyboard[kee]);\r
 #endif\r
-       if(inpu.Keyboard[kee]==true) return 1;\r
+       if(inst.Keyboard[kee]==true) return 1;\r
        else return 0;\r
 }\r
 \r
 ScanCode IN_GetLastScan()\r
 {\r
-       return inpu.LastScan;\r
+       return inst.LastScan;\r
 }\r
 \r
 ScanCode IN_GetCurCode()\r
index eb8048bcef255ad9b2fe285e58828e6702f56869..97a560d0e998168a09c4a2d9b88aedb62ff83618 100755 (executable)
@@ -213,34 +213,34 @@ typedef   struct          {
 #endif\r
 \r
 //     Internal routines\r
-extern void            IN_Startup(void),IN_Shutdown(void),\r
-                                       IN_Default(boolean gotit,player_t *player,ControlType nt),\r
+extern void            IN_Startup(global_game_variables_t *gvar),IN_Shutdown(global_game_variables_t *gvar),\r
+                                       IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_t *gvar),\r
                                        IN_SetKeyHook(void (*)()),\r
                                        IN_ClearKeysDown(void),\r
-                                       IN_ReadCursor(CursorInfo *),\r
-                                       IN_ReadControl(player_t *player),\r
+                                       IN_ReadCursor(CursorInfo *, global_game_variables_t *gvar),\r
+                                       IN_ReadControl(player_t *player, global_game_variables_t *gvar),\r
                                        IN_SetControlType(player_t *player,ControlType type),\r
                                        IN_GetJoyAbs(word joy,word *xp,word *yp),\r
                                        IN_SetupJoy(word joy,word minx,word maxx,\r
-                                                               word miny,word maxy),\r
+                                                               word miny,word maxy, global_game_variables_t *gvar),\r
 #if DEMO0\r
                                        IN_StopDemo(void),IN_FreeDemoBuffer(void),\r
 #endif\r
-                                       IN_Ack(void),IN_AckBack(void);\r
-extern boolean         IN_UserInput(word delay);\r
+                                       IN_Ack(global_game_variables_t *gvar),IN_AckBack(void);\r
+extern boolean         IN_UserInput(word delay, global_game_variables_t *gvar);\r
 extern char            IN_WaitForASCII(void);\r
 extern ScanCode        IN_WaitForKey(void);\r
 extern word            IN_GetJoyButtonsDB(word joy);\r
 extern byte            *IN_GetScanName(ScanCode);\r
 \r
 \r
-byte   IN_MouseButtons (void);\r
+byte   IN_MouseButtons (global_game_variables_t *gvar);\r
 byte   IN_JoyButtons (void);\r
 \r
-void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/);\r
-void IN_StartAck(void);\r
-boolean IN_CheckAck (void);\r
-boolean IN_IsUserInput();\r
+void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar);\r
+void IN_StartAck(global_game_variables_t *gvar);\r
+boolean IN_CheckAck (global_game_variables_t *gvar);\r
+boolean IN_IsUserInput(global_game_variables_t *gvar);\r
 #define Mouse(x)         INL_Mouse(x)\r
 //void IN_SetKeyHook(void (*hook)());\r
 #if DEMO0\r
similarity index 83%
rename from src/lib/16_in_1.c
rename to src/lib/16_in_o.c
index 3eb669d344bcd749916bf76042f7784613383211..e7ed19edafbe81620eadfbd47dac839280a916a9 100755 (executable)
@@ -39,7 +39,7 @@
 //     DEBUG - there are more globals\r
 //\r
 \r
-#include "src/lib/16_in_1.h"\r
+#include "src/lib/16_in.h"\r
 #pragma        hdrstop\r
 \r
 static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
@@ -51,7 +51,7 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 \r
 =============================================================================\r
 */\r
-/*struct inconfig\r
+struct inconfig\r
 {\r
        boolean         MousePresent;\r
        boolean         JoysPresent[MaxJoys];\r
@@ -62,9 +62,9 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 \r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
-} inpu;*/\r
+} inpu;\r
 \r
-//gvar->in.KbdDefs = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/};\r
+//inpu.KbdDefs = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/};\r
 \r
 /*\r
 =============================================================================\r
@@ -79,13 +79,9 @@ extern "C" {
 #endif\r
 \r
 static struct instat {\r
+       boolean         IN_Started;\r
        boolean         CapsLock;\r
        ScanCode        CurCode,LastCode;\r
-\r
-       boolean         Keyboard[NumCodes];\r
-       boolean         Paused;\r
-       char            LastASCII;\r
-       ScanCode        LastScan;\r
 } inst;\r
 \r
 static byte        far ASCIINames[] =          // Unshifted ASCII for scan codes\r
@@ -187,7 +183,7 @@ static      boolean special;
        if (k == 0xe0)          // Special key prefix\r
                special = true;\r
        else if (k == 0xe1)     // Handle Pause key\r
-               inst.Paused = true;\r
+               inpu.Paused = true;\r
        else\r
        {\r
                if (k & 0x80)   // Break code\r
@@ -196,13 +192,13 @@ static    boolean special;
 \r
 // DEBUG - handle special keys: ctl-alt-delete, print scrn\r
 \r
-                       inst.Keyboard[k] = false;\r
+                       inpu.Keyboard[k] = false;\r
                }\r
                else                    // Make code\r
                {\r
                        inst.LastCode = inst.CurCode;\r
-                       inst.CurCode = inst.LastScan = k;\r
-                       inst.Keyboard[k] = true;\r
+                       inst.CurCode = inpu.LastScan = k;\r
+                       inpu.Keyboard[k] = true;\r
 \r
                        if (special)\r
                                c = SpecialNames[k];\r
@@ -214,7 +210,7 @@ static      boolean special;
                                        // DEBUG - make caps lock light work\r
                                }\r
 \r
-                               if (inst.Keyboard[sc_LShift] || inst.Keyboard[sc_RShift])       // If shifted\r
+                               if (inpu.Keyboard[sc_LShift] || inpu.Keyboard[sc_RShift])       // If shifted\r
                                {\r
                                        c = ShiftNames[k];\r
                                        if ((c >= 'A') && (c <= 'Z') && inst.CapsLock)\r
@@ -228,7 +224,7 @@ static      boolean special;
                                }\r
                        }\r
                        if (c)\r
-                               inst.LastASCII = c;\r
+                               inpu.LastASCII = c;\r
                }\r
 \r
                special = false;\r
@@ -237,7 +233,7 @@ static      boolean special;
        if (INL_KeyHook && !special)\r
                INL_KeyHook();\r
 #ifdef __DEBUG_InputMgr__\r
-       if(dbg_testkeyin > 0) printf("%c        %u      [0x%x %u]       %u\n", c, c, k, k, inst.Keyboard[k]);\r
+       if(dbg_testkeyin > 0) printf("%c        %u      [0x%x %u]       %u\n", c, c, k, k, inpu.Keyboard[k]);\r
 #endif\r
        outportb(0x20,0x20);\r
 }\r
@@ -380,7 +376,7 @@ done:
 //             joystick (from +/-127)\r
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
-void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar)\r
+void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/)\r
 {\r
        word            x,y;\r
        word TimeCount = *clockw;\r
@@ -388,7 +384,7 @@ void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_
 static word    lasttime;\r
 \r
        IN_GetJoyAbs(joy,&x,&y);\r
-       def = gvar->in.JoyDefs + joy;\r
+       def = inpu.JoyDefs + joy;\r
 \r
        if (x < def->threshMinX)\r
        {\r
@@ -497,7 +493,7 @@ IN_GetJoyButtonsDB(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static void\r
-INL_StartKbd(global_game_variables_t *gvar)\r
+INL_StartKbd(void)\r
 {\r
        INL_KeyHook = NULL;     // Clear key hook\r
 \r
@@ -564,11 +560,11 @@ INL_ShutMouse(void)
 //     INL_SetJoyScale() - Sets up scaling values for the specified joystick\r
 //\r
 static void\r
-INL_SetJoyScale(word joy, global_game_variables_t *gvar)\r
+INL_SetJoyScale(word joy)\r
 {\r
        JoystickDef     *def;\r
 \r
-       def = &(gvar->in.JoyDefs[joy]);\r
+       def = &(inpu.JoyDefs[joy]);\r
        def->joyMultXL = JoyScaleMax / (def->threshMinX - def->joyMinX);\r
        def->joyMultXH = JoyScaleMax / (def->joyMaxX - def->threshMaxX);\r
        def->joyMultYL = JoyScaleMax / (def->threshMinY - def->joyMinY);\r
@@ -582,12 +578,12 @@ INL_SetJoyScale(word joy, global_game_variables_t *gvar)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, global_game_variables_t *gvar)\r
+IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)\r
 {\r
        word            d,r;\r
        JoystickDef     *def;\r
 \r
-       def = &(gvar->in.JoyDefs[joy]);\r
+       def = &(inpu.JoyDefs[joy]);\r
 \r
        def->joyMinX = minx;\r
        def->joyMaxX = maxx;\r
@@ -603,7 +599,7 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, global_game_variab
        def->threshMinY = ((r / 2) - d) + miny;\r
        def->threshMaxY = ((r / 2) + d) + miny;\r
 \r
-       INL_SetJoyScale(joy, gvar);\r
+       INL_SetJoyScale(joy);\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -613,7 +609,7 @@ IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy, global_game_variab
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static boolean\r
-INL_StartJoy(word joy, global_game_variables_t *gvar)\r
+INL_StartJoy(word joy)\r
 {\r
        word            x,y;\r
 \r
@@ -627,7 +623,7 @@ INL_StartJoy(word joy, global_game_variables_t *gvar)
                return(false);\r
        else\r
        {\r
-               IN_SetupJoy(joy,0,x * 2,0,y * 2, gvar);\r
+               IN_SetupJoy(joy,0,x * 2,0,y * 2);\r
                return(true);\r
        }\r
 }\r
@@ -638,9 +634,9 @@ INL_StartJoy(word joy, global_game_variables_t *gvar)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static void\r
-INL_ShutJoy(word joy, global_game_variables_t *gvar)\r
+INL_ShutJoy(word joy)\r
 {\r
-       gvar->in.JoysPresent[joy] = false;\r
+       inpu.JoysPresent[joy] = false;\r
 }\r
 \r
 //     Public routines\r
@@ -651,12 +647,12 @@ INL_ShutJoy(word joy, global_game_variables_t *gvar)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_Startup(global_game_variables_t *gvar)\r
+IN_Startup()\r
 {\r
        boolean checkjoys,checkmouse;\r
        word    i;\r
 \r
-       if (gvar->in.IN_Started)\r
+       if (inst.IN_Started)\r
                return;\r
 \r
        checkjoys = true;\r
@@ -674,15 +670,13 @@ IN_Startup(global_game_variables_t *gvar)
                }\r
        }\r
 \r
-       INL_StartKbd(gvar);\r
-       gvar->in.MousePresent = checkmouse? INL_StartMouse() : false;\r
+       INL_StartKbd();\r
+       inpu.MousePresent = checkmouse? INL_StartMouse() : false;\r
 \r
        for (i = 0;i < MaxJoys;i++)\r
-               gvar->in.JoysPresent[i] = checkjoys? INL_StartJoy(i, gvar) : false;\r
-\r
-       gvar->in.inst = &inst;\r
+               inpu.JoysPresent[i] = checkjoys? INL_StartJoy(i) : false;\r
 \r
-       gvar->in.IN_Started = true;\r
+       inst.IN_Started = true;\r
 \r
 }\r
 \r
@@ -692,26 +686,26 @@ IN_Startup(global_game_variables_t *gvar)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_t *gvar)\r
+IN_Default(boolean gotit,player_t *player,ControlType nt)\r
 {\r
        int i;\r
        if\r
        (\r
                (!gotit)\r
-       ||      ((nt == ctrl_Joystick1) && !gvar->in.JoysPresent[0])\r
-       ||      ((nt == ctrl_Joystick2) && !gvar->in.JoysPresent[1])\r
-       ||      ((nt == ctrl_Mouse) && !gvar->in.MousePresent)\r
+       ||      ((nt == ctrl_Joystick1) && !inpu.JoysPresent[0])\r
+       ||      ((nt == ctrl_Joystick2) && !inpu.JoysPresent[1])\r
+       ||      ((nt == ctrl_Mouse) && !inpu.MousePresent)\r
        )\r
                nt = ctrl_Keyboard1;\r
-       gvar->in.KbdDefs[0].button0 = 0x1c;\r
-       gvar->in.KbdDefs[0].button1 = 0x38;\r
+       inpu.KbdDefs[0].button0 = 0x1c;\r
+       inpu.KbdDefs[0].button1 = 0x38;\r
        //in.KbdDefs[0].upleft = 0x47;\r
-       gvar->in.KbdDefs[0].up = 0x48;\r
+       inpu.KbdDefs[0].up = 0x48;\r
        //in.KbdDefs[0].upright = 0x49;\r
-       gvar->in.KbdDefs[0].left = 0x4b;\r
-       gvar->in.KbdDefs[0].right = 0x4d;\r
+       inpu.KbdDefs[0].left = 0x4b;\r
+       inpu.KbdDefs[0].right = 0x4d;\r
        //in.KbdDefs[0].downleft = 0x4f;\r
-       gvar->in.KbdDefs[0].down = 0x50;\r
+       inpu.KbdDefs[0].down = 0x50;\r
        //in.KbdDefs[0].downright = 0x51;\r
        IN_SetControlType(player,nt);\r
        for(i=0; i>MaxPlayers;i++)\r
@@ -724,19 +718,19 @@ IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_Shutdown(global_game_variables_t *gvar)\r
+IN_Shutdown(void)\r
 {\r
        word    i;\r
 \r
-       if (!gvar->in.IN_Started)\r
+       if (!inst.IN_Started)\r
                return;\r
 \r
        INL_ShutMouse();\r
        for (i = 0;i < MaxJoys;i++)\r
-               INL_ShutJoy(i, gvar);\r
+               INL_ShutJoy(i);\r
        INL_ShutKbd();\r
 \r
-       gvar->in.IN_Started = false;\r
+       inst.IN_Started = false;\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -761,9 +755,9 @@ IN_ClearKeysDown(void)
 {\r
        //int   i;\r
 \r
-       inst.LastScan = sc_None;\r
-       inst.LastASCII = key_None;\r
-       memset (inst.Keyboard,0,sizeof(inst.Keyboard));\r
+       inpu.LastScan = sc_None;\r
+       inpu.LastASCII = key_None;\r
+       memset (inpu.Keyboard,0,sizeof(inpu.Keyboard));\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -790,7 +784,7 @@ INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_ReadCursor(CursorInfo *info, global_game_variables_t *gvar)\r
+IN_ReadCursor(CursorInfo *info)\r
 {\r
        word    i,\r
                        buttons;\r
@@ -799,7 +793,7 @@ IN_ReadCursor(CursorInfo *info, global_game_variables_t *gvar)
        info->x = info->y = 0;\r
        info->button0 = info->button1 = false;\r
 \r
-       if (gvar->in.MousePresent)\r
+       if (inpu.MousePresent)\r
        {\r
                buttons = INL_GetMouseButtons();\r
                INL_GetMouseDelta(&dx,&dy);\r
@@ -808,11 +802,11 @@ IN_ReadCursor(CursorInfo *info, global_game_variables_t *gvar)
 \r
        for (i = 0;i < MaxJoys;i++)\r
        {\r
-               if (!gvar->in.JoysPresent[i])\r
+               if (!inpu.JoysPresent[i])\r
                        continue;\r
 \r
                buttons = INL_GetJoyButtons(i);\r
-               INL_GetJoyDelta(i,&dx,&dy/*,true*/, gvar);\r
+               INL_GetJoyDelta(i,&dx,&dy/*,true*/);\r
                dx /= 64;\r
                dy /= 64;\r
                INL_AdjustCursor(info,buttons,dx,dy);\r
@@ -830,7 +824,7 @@ IN_ReadCursor(CursorInfo *info, global_game_variables_t *gvar)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
-IN_ReadControl(player_t *player, global_game_variables_t *gvar)\r
+IN_ReadControl(player_t *player)\r
 {\r
                        boolean         realdelta;\r
 #if DEMO0\r
@@ -874,7 +868,7 @@ register    KeyboardDef     *def;
                {\r
                case ctrl_Keyboard1:\r
                case ctrl_Keyboard2:\r
-                       def = &(gvar->in.KbdDefs[type - ctrl_Keyboard]);\r
+                       def = &(inpu.KbdDefs[type - ctrl_Keyboard]);\r
 \r
 /*                     if (Keyboard[def->upleft])\r
                                mx = motion_Left,my = motion_Up;\r
@@ -887,28 +881,28 @@ register  KeyboardDef     *def;
 //TODO: make this into a function that the joystick AND keyboard can use wwww\r
                        if(DIRECTIONIFELSE)//(player->info.dir == 2)\r
                        {\r
-                       if(!inst.Keyboard[def->left] && !inst.Keyboard[def->right]){\r
-                               if((inst.Keyboard[def->up] && !inst.Keyboard[def->down]))\r
+                       if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
+                               if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]))\r
                                        my = motion_Up;\r
-                               if((inst.Keyboard[def->down] && !inst.Keyboard[def->up]))\r
+                               if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up]))\r
                                        my = motion_Down;\r
-                       }else if(!inst.Keyboard[def->up] && !inst.Keyboard[def->down]){\r
-                               if((inst.Keyboard[def->left] && !inst.Keyboard[def->right]))\r
+                       }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
+                               if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]))\r
                                        mx = motion_Left;\r
-                               if((inst.Keyboard[def->right] && !inst.Keyboard[def->left]))\r
+                               if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left]))\r
                                        mx = motion_Right;\r
                        }else{  //2 keys pressed\r
                                        switch (player->pdir)\r
                                        {\r
                                                case 0:\r
                                                case 4:\r
-                                                       if((inst.Keyboard[def->left] && !inst.Keyboard[def->right])){ dir = DirTable[1]; }//mx = motion_Left; }\r
-                                                       else if((inst.Keyboard[def->right] && !inst.Keyboard[def->left])){ dir = DirTable[3]; }//mx = motion_Right; }\r
+                                                       if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right])){ dir = DirTable[1]; }//mx = motion_Left; }\r
+                                                       else if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left])){ dir = DirTable[3]; }//mx = motion_Right; }\r
                                                break;\r
                                                case 1:\r
                                                case 3:\r
-                                                       if((inst.Keyboard[def->up] && !inst.Keyboard[def->down])){ dir = DirTable[0]; }//my = motion_Up; }\r
-                                                       else if((inst.Keyboard[def->down] && !inst.Keyboard[def->up])){ dir = DirTable[4]; }//my = motion_Down; }\r
+                                                       if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down])){ dir = DirTable[0]; }//my = motion_Up; }\r
+                                                       else if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up])){ dir = DirTable[4]; }//my = motion_Down; }\r
                                                break;\r
                                                default:\r
                                                break;\r
@@ -919,15 +913,15 @@ register  KeyboardDef     *def;
                                }\r
                        }\r
                        //input from player\r
-                       if (inst.Keyboard[def->button0])\r
+                       if (inpu.Keyboard[def->button0])\r
                                buttons += 1 << 0;\r
-                       if (inst.Keyboard[def->button1])\r
+                       if (inpu.Keyboard[def->button1])\r
                                buttons += 1 << 1;\r
                        realdelta = false;\r
                        break;\r
                case ctrl_Joystick1:\r
                case ctrl_Joystick2:\r
-                       INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy/*,false*/, gvar);\r
+                       INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy/*,false*/);\r
                        buttons = INL_GetJoyButtons(type - ctrl_Joystick);\r
                        realdelta = true;\r
                        break;\r
@@ -998,14 +992,14 @@ register  KeyboardDef     *def;
 #endif\r
 #ifdef __DEBUG_InputMgr__\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
+if(player->info.dir!=2/*(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])*/ || player->enti.q>1)\r
 {\r
        //printf("b1=%u b2=%u b3=%u b4=%u       ", player->info.button0, player->info.button1, player->info.button2, player->info.button3);\r
        //printf("q=%d ", player->enti.q);\r
        //printf("cpee=%c ", dirchar(conpee));\r
        printf("pdir=%c d=%c dir=%c ", dirchar(player->pdir), dirchar(player->enti.d), dirchar(player->info.dir));\r
        /*if(realdelta) */printf("dx=%d dy=%d   mx=%d   my=%d", player->info.x, player->info.y, player->info.xaxis, player->info.yaxis);\r
-       //else if(!realdelta) printf("%c%d %c%d %c%d %c%d", dirchar(0), inst.Keyboard[def->up], dirchar(4), inst.Keyboard[def->down], dirchar(1), inst.Keyboard[def->left], dirchar(3), inst.Keyboard[def->right]);\r
+       //else if(!realdelta) printf("%c%d %c%d %c%d %c%d", dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]);\r
        printf("\n");\r
 }\r
 #endif\r
@@ -1118,9 +1112,9 @@ IN_WaitForKey(void)
 {\r
        ScanCode        result;\r
 \r
-       while (!(result = inst.LastScan))\r
+       while (!(result = inpu.LastScan))\r
                ;\r
-       inst.LastScan = 0;\r
+       inpu.LastScan = 0;\r
        return(result);\r
 }\r
 \r
@@ -1135,9 +1129,9 @@ IN_WaitForASCII(void)
 {\r
        char            result;\r
 \r
-       while (!(result = inst.LastASCII))\r
+       while (!(result = inpu.LastASCII))\r
                ;\r
-       inst.LastASCII = '\0';\r
+       inpu.LastASCII = '\0';\r
        return(result);\r
 }\r
 \r
@@ -1150,7 +1144,7 @@ IN_WaitForASCII(void)
 \r
 boolean        btnstate[8];\r
 \r
-void IN_StartAck(global_game_variables_t *gvar)\r
+void IN_StartAck(void)\r
 {\r
        unsigned        i,buttons;\r
 \r
@@ -1161,8 +1155,8 @@ void IN_StartAck(global_game_variables_t *gvar)
        memset (btnstate,0,sizeof(btnstate));\r
 \r
        buttons = IN_JoyButtons () << 4;\r
-       if (gvar->in.MousePresent)\r
-               buttons |= IN_MouseButtons (gvar);\r
+       if (inpu.MousePresent)\r
+               buttons |= IN_MouseButtons ();\r
 \r
        for (i=0;i<8;i++,buttons>>=1)\r
                if (buttons&1)\r
@@ -1170,19 +1164,19 @@ void IN_StartAck(global_game_variables_t *gvar)
 }\r
 \r
 \r
-boolean IN_CheckAck (global_game_variables_t *gvar)\r
+boolean IN_CheckAck (void)\r
 {\r
        unsigned        i,buttons;\r
 \r
 //\r
 // see if something has been pressed\r
 //\r
-       if (inst.LastScan)\r
+       if (inpu.LastScan)\r
                return true;\r
 \r
        buttons = IN_JoyButtons () << 4;\r
-       if (gvar->in.MousePresent)\r
-               buttons |= IN_MouseButtons (gvar);\r
+       if (inpu.MousePresent)\r
+               buttons |= IN_MouseButtons ();\r
 \r
        for (i=0;i<8;i++,buttons>>=1)\r
                if ( buttons&1 )\r
@@ -1197,11 +1191,11 @@ boolean IN_CheckAck (global_game_variables_t *gvar)
 }\r
 \r
 \r
-void IN_Ack (global_game_variables_t *gvar)\r
+void IN_Ack (void)\r
 {\r
-       IN_StartAck (gvar);\r
+       IN_StartAck ();\r
 \r
-       while (!IN_CheckAck (gvar))\r
+       while (!IN_CheckAck ())\r
        ;\r
 }\r
 \r
@@ -1212,19 +1206,19 @@ void IN_Ack (global_game_variables_t *gvar)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 boolean\r
-IN_IsUserInput(global_game_variables_t *gvar)\r
+IN_IsUserInput()\r
 {\r
        boolean result;\r
        word    i;\r
 \r
-       result = inst.LastScan;\r
+       result = inpu.LastScan;\r
 \r
-       if (gvar->in.MousePresent)\r
+       if (inpu.MousePresent)\r
                if (INL_GetMouseButtons())\r
                        result = true;\r
 \r
        for (i = 0;i < MaxJoys;i++)\r
-               if (gvar->in.JoysPresent[i])\r
+               if (inpu.JoysPresent[i])\r
                        if (INL_GetJoyButtons(i))\r
                                result = true;\r
 \r
@@ -1239,16 +1233,16 @@ IN_IsUserInput(global_game_variables_t *gvar)
 //             button up.\r
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
-boolean IN_UserInput(word delay, global_game_variables_t *gvar)\r
+boolean IN_UserInput(word delay)\r
 {\r
        word TimeCount = *clockw;\r
        word    lasttime;\r
 \r
        lasttime = TimeCount;\r
-       IN_StartAck (gvar);\r
+       IN_StartAck ();\r
        do\r
        {\r
-               if (IN_CheckAck(gvar))\r
+               if (IN_CheckAck())\r
                        return true;\r
        } while (TimeCount - lasttime < delay);\r
        return(false);\r
@@ -1264,10 +1258,10 @@ boolean IN_UserInput(word delay, global_game_variables_t *gvar)
 ===================\r
 */\r
 \r
-byte   IN_MouseButtons (global_game_variables_t *gvar)\r
+byte   IN_MouseButtons (void)\r
 {\r
        union REGS CPURegs;\r
-       if (gvar->in.MousePresent)\r
+       if (inpu.MousePresent)\r
        {\r
                Mouse(MButtons);\r
                return CPURegs.x.bx;\r
@@ -1299,11 +1293,9 @@ byte     IN_JoyButtons (void)
 boolean IN_KeyDown(byte code)\r
 {\r
 #ifdef __DEBUG_InputMgr__\r
-       if(inst.Keyboard[code])\r
-               printf("IN_KeyDown(%c): %u\n", code, inst.Keyboard[code]);\r
        if(!dbg_nointest)\r
 #endif\r
-       return inst.Keyboard[code];\r
+       return inpu.Keyboard[code];\r
 #ifdef __DEBUG_InputMgr__\r
        else\r
                if(dbg_nointest && kbhit())\r
@@ -1315,23 +1307,23 @@ boolean IN_KeyDown(byte code)
 \r
 void IN_ClearKey(byte code)\r
 {\r
-       inst.Keyboard[code] = false;\r
-       if(code == inst.LastScan)\r
-               inst.LastScan = sc_None;\r
+       inpu.Keyboard[code] = false;\r
+       if(code == inpu.LastScan)\r
+               inpu.LastScan = sc_None;\r
        }\r
 \r
 boolean IN_qb(byte kee)\r
 {\r
 #ifdef __DEBUG_InputMgr__\r
-       if(dbg_testkeyin) if(inst.Keyboard[kee]) printf("IN_qb():       %u\n", inst.Keyboard[kee]);\r
+       if(dbg_testkeyin) printf("%u\n", inpu.Keyboard[kee]);\r
 #endif\r
-       if(inst.Keyboard[kee]==true) return 1;\r
+       if(inpu.Keyboard[kee]==true) return 1;\r
        else return 0;\r
 }\r
 \r
 ScanCode IN_GetLastScan()\r
 {\r
-       return inst.LastScan;\r
+       return inpu.LastScan;\r
 }\r
 \r
 ScanCode IN_GetCurCode()\r
similarity index 85%
rename from src/lib/16_in_1.h
rename to src/lib/16_in_o.h
index 97a560d0e998168a09c4a2d9b88aedb62ff83618..eb8048bcef255ad9b2fe285e58828e6702f56869 100755 (executable)
@@ -213,34 +213,34 @@ typedef   struct          {
 #endif\r
 \r
 //     Internal routines\r
-extern void            IN_Startup(global_game_variables_t *gvar),IN_Shutdown(global_game_variables_t *gvar),\r
-                                       IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_t *gvar),\r
+extern void            IN_Startup(void),IN_Shutdown(void),\r
+                                       IN_Default(boolean gotit,player_t *player,ControlType nt),\r
                                        IN_SetKeyHook(void (*)()),\r
                                        IN_ClearKeysDown(void),\r
-                                       IN_ReadCursor(CursorInfo *, global_game_variables_t *gvar),\r
-                                       IN_ReadControl(player_t *player, global_game_variables_t *gvar),\r
+                                       IN_ReadCursor(CursorInfo *),\r
+                                       IN_ReadControl(player_t *player),\r
                                        IN_SetControlType(player_t *player,ControlType type),\r
                                        IN_GetJoyAbs(word joy,word *xp,word *yp),\r
                                        IN_SetupJoy(word joy,word minx,word maxx,\r
-                                                               word miny,word maxy, global_game_variables_t *gvar),\r
+                                                               word miny,word maxy),\r
 #if DEMO0\r
                                        IN_StopDemo(void),IN_FreeDemoBuffer(void),\r
 #endif\r
-                                       IN_Ack(global_game_variables_t *gvar),IN_AckBack(void);\r
-extern boolean         IN_UserInput(word delay, global_game_variables_t *gvar);\r
+                                       IN_Ack(void),IN_AckBack(void);\r
+extern boolean         IN_UserInput(word delay);\r
 extern char            IN_WaitForASCII(void);\r
 extern ScanCode        IN_WaitForKey(void);\r
 extern word            IN_GetJoyButtonsDB(word joy);\r
 extern byte            *IN_GetScanName(ScanCode);\r
 \r
 \r
-byte   IN_MouseButtons (global_game_variables_t *gvar);\r
+byte   IN_MouseButtons (void);\r
 byte   IN_JoyButtons (void);\r
 \r
-void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_variables_t *gvar);\r
-void IN_StartAck(global_game_variables_t *gvar);\r
-boolean IN_CheckAck (global_game_variables_t *gvar);\r
-boolean IN_IsUserInput(global_game_variables_t *gvar);\r
+void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/);\r
+void IN_StartAck(void);\r
+boolean IN_CheckAck (void);\r
+boolean IN_IsUserInput();\r
 #define Mouse(x)         INL_Mouse(x)\r
 //void IN_SetKeyHook(void (*hook)());\r
 #if DEMO0\r
index 557c4968930439d4c1efb3d89e8a87a70589d1d4..7b5fdcb4de0c44ea65d8a5809290383c367d39d7 100755 (executable)
@@ -79,7 +79,7 @@ void Startup16(global_game_variables_t *gvar)
 #ifdef __DEBUG_InputMgr__\r
        if(!dbg_nointest)\r
 #endif\r
-       IN_Startup();\r
+       IN_Startup(gvar);\r
 #endif\r
 #ifdef __16_PM__\r
        PM_Startup(gvar);\r
@@ -110,7 +110,7 @@ void Shutdown16(global_game_variables_t *gvar)
 #ifdef __DEBUG_InputMgr__\r
        if(!dbg_nointest)\r
 #endif\r
-       IN_Shutdown();\r
+       IN_Shutdown(gvar);\r
 #endif\r
        CA_Shutdown(gvar);\r
        MM_Shutdown(gvar);\r
index 6bd889fddd4b1b77447c0b72b4f51ccdb932380b..3e1a455f846ea5dd8d8caca369096a01948f806b 100755 (executable)
 #include "src/lib/testpatt.h"\r
 \r
 #define TAIL_FUNCTIONKEYFUNCTIONS \\r
-       if(IN_KeyDown(88)){ panswitch=!panswitch;                                                       IN_UserInput(1); } \\r
+       if(IN_KeyDown(88)){ panswitch=!panswitch;                                                       IN_UserInput(1, &gvar); } \\r
        TAIL_FUNCTIONKEYFUNCTIONS0EXE\r
 \r
 #define TAIL_FUNCTIONKEYFUNCTIONS0EXE \\r
-       if(IN_KeyDown(sc_F4)){ turboXT(12);                                                                     IN_UserInput(1); } \\r
-       if(IN_KeyDown(87/*sc_F11*/)){ pagedelayrendermap=!pagedelayrendermap;           IN_UserInput(1); } \\r
-       if(IN_KeyDown(68/*sc_F10*/)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;         IN_UserInput(1); } \\r
-       if(IN_KeyDown(sc_F9)){ pagenorendermap=!pagenorendermap;                                IN_UserInput(1); } \\r
-       if(IN_KeyDown(sc_F8)){ gvar.video.bgps=!gvar.video.bgps;                                        IN_UserInput(1); } \\r
-       if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&gvar.mv, 0, 1);                                               IN_UserInput(1); } \\r
-       if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&gvar.mv, 0, 0);                                               IN_UserInput(1); } \\r
-       if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss;                                           IN_UserInput(1); } \\r
-       if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]);                                  IN_UserInput(1); }\r
+       if(IN_KeyDown(sc_F4)){ turboXT(12);                                                                     IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(87/*sc_F11*/)){ pagedelayrendermap=!pagedelayrendermap;           IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(68/*sc_F10*/)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;         IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(sc_F9)){ pagenorendermap=!pagenorendermap;                                IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(sc_F8)){ gvar.video.bgps=!gvar.video.bgps;                                        IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&gvar.mv, 0, 1);                                               IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&gvar.mv, 0, 0);                                               IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss;                                           IN_UserInput(1, &gvar); } \\r
+       if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]);                                  IN_UserInput(1, &gvar); }\r
 \r
 #define TAIL_PANKEYFUN \\r
        TAIL_PANKEYFUNZC \\r
        if(IN_KeyDown(sc_X)){ TESTBG12 } \\r
        if(IN_KeyDown(sc_C)){ TESTBG34 } \\r
        if(IN_KeyDown(sc_V)) VL_PatternDraw(&gvar.video, 0, 1, 1); \\r
-       if(IN_KeyDown(sc_I)){ dbg_maptext=!dbg_maptext; IN_UserInput(1); }\r
+       if(IN_KeyDown(sc_I)){ dbg_maptext=!dbg_maptext; IN_UserInput(1, &gvar); }\r
 /*     if(IN_KeyDown(sc_PgDn)){ \\r
                rotateR(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
-               VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1); } \\r
+               VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1, &gvar); } \\r
        if(IN_KeyDown(sc_PgUp)){ \\r
                rotateL(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
-               VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1); }*/\r
+               VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1, &gvar); }*/\r
 \r
 void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
 void Shutdown16(global_game_variables_t *gvar);\r
index a4a7f4891991fbcbd4d56185476cd2f494c9d350..785e011097eb0b4a6ded5f978463ab193dcf766b 100755 (executable)
@@ -100,7 +100,7 @@ void main(int argc, char *argv[])
        //====modexPalBlack();\r
 \r
        //IN_Startup();\r
-       IN_Default(0,&gvar.player[0],ctrl_Keyboard1);\r
+       IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar);\r
        EN_initPlayer(&gvar.player[0], &gvar.video);\r
 \r
        VGAmodeX(1, 1, &gvar);\r
@@ -149,7 +149,7 @@ void main(int argc, char *argv[])
        startclk = *clockw;\r
        while(!IN_KeyDown(sc_Escape))\r
        {\r
-               IN_ReadControl(&gvar.player[0]);\r
+               IN_ReadControl(&gvar.player[0], &gvar);\r
                ZC_panPageManual(&gvar.mv, &gvar.player, 0);\r
 //                     if(IN_KeyDown(sc_5)){ modexClearRegion(&gvar.video.page[1],  gvar.video.page[1].sw, 16, 8, 4, 45); }\r
 //                     if(IN_KeyDown(sc_4)){\r
@@ -170,9 +170,9 @@ void main(int argc, char *argv[])
                        }\r
 //                     if(i>PAL_SIZE) i=0;\r
                }//9*/\r
-               if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.sp]); IN_UserInput(1); }//p\r
-               if(IN_KeyDown(sc_I)){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1); }//i\r
-               if(IN_KeyDown(sc_O)){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1); }//o\r
+               if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//p\r
+               if(IN_KeyDown(sc_I)){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//i\r
+               if(IN_KeyDown(sc_O)){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1, &gvar); }//o\r
                //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
                ZC_ShowMV(&gvar.mv, 0, 0);\r
        }\r
index 69ee777aa07db73990e8dbf0e454509e8d24dc39..166a10e0e0ad68ef2eb5fc8c50ab0cd8613fc498 100755 (executable)
@@ -145,9 +145,9 @@ void main()
                        break;\r
                }\r
                TAIL_FUNCTIONKEYDRAWJUNKNOMV\r
-               if(IN_KeyDown(sc_F7)){ VL_ShowPage(&gvar.video.page[0], 1, 1);                                                  IN_UserInput(1); }\r
-               if(IN_KeyDown(sc_F6)){ VL_ShowPage(&gvar.video.page[0], 1, 0);                                                  IN_UserInput(1); }\r
-               if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[0]);  IN_UserInput(1); } //p\r
+               if(IN_KeyDown(sc_F7)){ VL_ShowPage(&gvar.video.page[0], 1, 1);                                                  IN_UserInput(1, &gvar); }\r
+               if(IN_KeyDown(sc_F6)){ VL_ShowPage(&gvar.video.page[0], 1, 0);                                                  IN_UserInput(1, &gvar); }\r
+               if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[0]);  IN_UserInput(1, &gvar); } //p\r
        }\r
        VGAmodeX(0, 1, &gvar);\r
        MM_ShowMemory(&gvar);\r
index b7e2b7302bb59dd03be3a77432f5db41b5233f98..888a00341c67bed7dffab102e30475518044f91a 100755 (executable)
@@ -87,7 +87,7 @@ void main(int argc, char *argv[])
        VRS_LoadVRS(bakapee1, &gvar.player[0].enti, &gvar);\r
 \r
        // input!\r
-       IN_Default(0, &gvar.player[0],ctrl_Keyboard1);\r
+       IN_Default(0, &gvar.player[0],ctrl_Keyboard1, &gvar);\r
 \r
        // save the palette\r
 #ifdef FADE\r
@@ -155,7 +155,7 @@ void main(int argc, char *argv[])
                //when gvar.player[0].tx or gvar.player[0].ty == 0 or gvar.player[0].tx == 20 or gvar.player[0].ty == 15 then stop because that is edge of map and you do not want to walk of the map\r
 \r
                //gvar.player movement\r
-               IN_ReadControl(&gvar.player[0]);\r
+               IN_ReadControl(&gvar.player[0], &gvar);\r
                if(!panswitch){\r
                        //ZC_walk2(gvar.player[0].ent, mv);\r
                        ZC_walk(&gvar.mv, &gvar.player, 0);\r
@@ -178,7 +178,7 @@ void main(int argc, char *argv[])
                if(gvar.player[0].enti.q == (TILEWH/(gvar.player[0].enti.speed))+1 && gvar.player[0].info.dir != 2 && (gvar.player[0].enti.triggerx == 5 && gvar.player[0].enti.triggery == 5)){ gvar.player[0].enti.hp--; }\r
                //debugging binds!\r
 \r
-               if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1); } //o\r
+               if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1, &gvar); } //o\r
                if(IN_KeyDown(22)){ modexPalUpdate0(&gvar.video.palette); } //u\r
 \r
                TAIL_FUNCTIONKEYFUNCTIONS\r
@@ -203,7 +203,7 @@ void main(int argc, char *argv[])
                        VL_LoadPalFile(bakapee1p, &gvar.video.palette);\r
                }//JK\r
 #ifdef FADE\r
-               if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1); }\r
+               if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1, &gvar); }\r
 #endif\r
                if(IN_KeyDown(sc_R)){ modexPalOverscan(rand()%56); } //r\r
 \r