]> 4ch.mooo.com Git - 16.git/commitdiff
MOUSE WORKS NOW! i should continue on the other stuff in p16 such as showmemory funct...
authorsparky4 <sparky4@cock.li>
Fri, 29 Sep 2017 19:04:51 +0000 (14:04 -0500)
committersparky4 <sparky4@cock.li>
Fri, 29 Sep 2017 19:04:51 +0000 (14:04 -0500)
15 files changed:
bcexmm.dsk
bcexmm.exe
bcexmm.prj
src/inputest.c
src/lib/16_head.c
src/lib/16_head.h
src/lib/16_in.c
src/lib/16_in.h
src/lib/16_pm.c
src/lib/16_tail.c
src/lib/16_tail.h
src/lib/16_tail_.c
src/lib/doslib
src/sdtest.c
src/xcroll.c

index 4848bb948adf7eca991e83753459b95d5d504089..3c5be5eab1e6b8f797c818dfb020a3a540213454 100755 (executable)
Binary files a/bcexmm.dsk and b/bcexmm.dsk differ
index c103df59f4d82ccf02d48d5993977ac364f3db2e..ddd979ba50b15fdb2d2f6da8088ebabe2d0dd001 100755 (executable)
Binary files a/bcexmm.exe and b/bcexmm.exe differ
index 13dcb52b81cf73bb44e27376d15d8a869ca6d5dc..b0e8fded4e76aa77039bdf048b5c7183485d2828 100755 (executable)
Binary files a/bcexmm.prj and b/bcexmm.prj differ
index 83619cb6c605fbce229c376198725a4fc4c5b158..e74d10c7027b57dee4341a6f752cce88e38e8719 100755 (executable)
 #include "src/lib/16_in.h"\r
 #include "src/lib/16_tail.h"\r
 \r
-#define INPUTEST_JOYSTICKPADTEST\r
-//#define INPUTEST_MOUSETEST\r
+//#define INPUTEST_JOYSTICKPADTEST\r
+#define INPUTEST_MOUSETEST\r
 \r
 void\r
 main(int argc, char *argv[])\r
 {\r
        static global_game_variables_t gvar;\r
 #ifdef __DEBUG_InputMgr__\r
-       dbg_testkeyin=1;\r
-       dbg_testcontrolnoisy=0;\r
-       dbg_joymousedelta=1;\r
+       dbg_testkeyin=0;\r
+       dbg_testcontrolnoisy=1;\r
+       dbg_joymousedelta=0;\r
 #endif\r
        start_timer(&gvar);\r
        //Startup16(&gvar);\r
index b371d10907ca3c7d8f2ec4cc20fb71a0489d4d3f..25be7dab7d387519ee252e031a5deefef6506c93 100755 (executable)
 \r
 #include "src/lib/16_head.h"\r
 \r
+//cpu reg stuff for _AX, _BX, _CX, _DX\r
+#ifdef __WATCOMC__\r
+union regs CPURegs;\r
+#endif\r
+\r
 // big global status text buffer\r
 char global_temp_status_text[512];\r
 char global_temp_status_text2[512];\r
index 8c5d5381699677454c15d591c9aa703c2d271600..2d18e0af7017831a4781eb824f1b5f139af88ed9 100755 (executable)
@@ -161,8 +161,8 @@ extern      int                     profilehandle,debughandle;      //make it into game global
 #define        nil     ((void *)0)\r
 \r
 #ifdef __WATCOMC__\r
-//#define _FCORELEFT 0x90000UL+16UL\r
-/*static union REGS CPURegs;\r
+//----#define _FCORELEFT 0x90000UL+16UL\r
+extern union REGS CPURegs;\r
 \r
 #define _AX CPURegs.x.ax\r
 #define _BX CPURegs.x.bx\r
@@ -180,7 +180,7 @@ extern      int                     profilehandle,debughandle;      //make it into game global
 #define _DH CPURegs.h.dh\r
 #define _DL CPURegs.h.dl\r
 \r
-#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);*/\r
+#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);\r
 \r
 \r
 typedef union REGPACK  regs_t;\r
index 9dd9d7816b7ba043cccccfca9d0ab9c46faf2694..bdd3d0fe47554db0db169cbe3b761b4f2fec9e96 100755 (executable)
@@ -249,17 +249,6 @@ static     boolean special;
        outportb(0x20,0x20);\r
 }\r
 \r
-void INL_Mouse(int x)\r
-{\r
-       union REGS CPURegs;\r
-       x = CPURegs.x.ax;\r
-/*_=_= __asm {\r
-               mov     ax,x\r
-               int     MouseInt\r
-       }*/\r
-       int86(MouseInt,&CPURegs,&CPURegs);\r
-}\r
-\r
 ///////////////////////////////////////////////////////////////////////////\r
 //\r
 //     INL_GetMouseDelta() - Gets the amount that the mouse has moved from the\r
@@ -269,16 +258,9 @@ void INL_Mouse(int x)
 static void\r
 INL_GetMouseDelta(int *x,int *y)\r
 {\r
-       union REGS CPURegs;\r
        Mouse(MDelta);\r
-       *x = CPURegs.x.cx;\r
-       *y = CPURegs.x.dx;\r
-#ifdef __DEBUG_InputMgr__\r
-       if(dbg_joymousedelta)\r
-       {\r
-               printf("mousedelta=[%dx%d]\n", *x, *y);\r
-       }\r
-       #endif\r
+       *x = _CX;\r
+       *y = _DX;\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -290,11 +272,10 @@ INL_GetMouseDelta(int *x,int *y)
 static word\r
 INL_GetMouseButtons(void)\r
 {\r
-       union REGS CPURegs;\r
        word    buttons;\r
 \r
        Mouse(MButtons);\r
-       buttons = CPURegs.x.bx;\r
+       buttons = _BX;\r
        return(buttons);\r
 }\r
 \r
@@ -510,7 +491,7 @@ IN_GetJoyButtonsDB(word joy)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 static void\r
-INL_StartKbd()\r
+INL_StartKbd(void)\r
 {\r
        INL_KeyHook = NULL;     // Clear key hook\r
 \r
@@ -541,15 +522,15 @@ INL_ShutKbd(void)
 static boolean\r
 INL_StartMouse(void)\r
 {\r
-       union REGS CPURegs;\r
+#if 0\r
        if (getvect(MouseInt))\r
        {\r
                Mouse(MReset);\r
-               if (/*_AX*/CPURegs.x.ax == 0xffff)\r
+               if (_AX == 0xffff)\r
                        return(true);\r
        }\r
        return(false);\r
-#if 0\r
+#else\r
        byte far *vector;\r
 \r
 \r
@@ -697,7 +678,6 @@ IN_Startup(global_game_variables_t *gvar)
        gvar->in.inst = &inst;\r
 \r
        gvar->in.IN_Started = true;\r
-\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -857,9 +837,6 @@ IN_ReadControl(player_t *player, global_game_variables_t *gvar)
                        sword conpee;\r
                        byte dir=DirTable[2];\r
 register       KeyboardDef     *def;\r
-//#ifdef __DEBUG_InputMgr__\r
-//static               int                     old_dx,old_dy;\r
-//#endif\r
 \r
        dx = dy = 0;\r
        mx = my = motion_None;\r
@@ -889,8 +866,7 @@ register    KeyboardDef     *def;
 #endif\r
                switch (type = player->Controls)\r
                {\r
-               case ctrl_Keyboard1:\r
-               case ctrl_Keyboard2:\r
+               case ctrl_Keyboard:\r
                        def = &(gvar->in.KbdDefs[type - ctrl_Keyboard]);\r
 \r
 /*                     if (Keyboard[def->upleft])\r
@@ -965,8 +941,8 @@ register    KeyboardDef     *def;
        }\r
        else\r
        {\r
-               dx = mx;// * 127;\r
-               dy = my;// * 127;\r
+               dx = mx * 127;\r
+               dy = my * 127;\r
        }\r
 \r
        player->info.x = dx;\r
@@ -1014,12 +990,21 @@ register KeyboardDef     *def;
        }\r
 #endif\r
 #ifdef __DEBUG_InputMgr__\r
-/*if(dbg_joymousedelta)\r
+if(dbg_joymousedelta)\r
 {\r
-       if(dx!=old_dx || dy!=old_dy) printf("dx,dy      [%d,%d] %d,%d\n", dx, dy, mx, my);\r
-       if(dx!=old_dx)  old_dx=dx;\r
-       if(dy!=old_dy)  old_dy=dy;\r
-}*/\r
+       {\r
+static         int                     old_dx,old_dy;\r
+static         word            old_buttons=0;\r
+               if(dx!=old_dx || dy!=old_dy) printf("dx,dy      [%d,%d] %d,%d\n", dx, dy, mx, my);\r
+               if(dx!=old_dx)  old_dx=dx;\r
+               if(dy!=old_dy)  old_dy=dy;\r
+               if(old_buttons!=buttons)\r
+               {\r
+                       printf("        buttons={%u,%u,%u,%u}\n", player->info.button0, player->info.button1, player->info.button2, player->info.button3);\r
+                       old_buttons=buttons;\r
+               }\r
+       }\r
+}\r
 \r
 if(dbg_testcontrolnoisy > 0)\r
 if(player->info.dir!=2/*(inst.Keyboard[def->up] || inst.Keyboard[def->down] || inst.Keyboard[def->left] || inst.Keyboard[def->right])*/ || player->enti.q>1)\r
@@ -1295,11 +1280,10 @@ boolean IN_UserInput(word delay, global_game_variables_t *gvar)
 \r
 byte   IN_MouseButtons (global_game_variables_t *gvar)\r
 {\r
-       union REGS CPURegs;\r
        if (gvar->in.MousePresent)\r
        {\r
                Mouse(MButtons);\r
-               return CPURegs.x.bx;\r
+               return _BX;\r
        }\r
        else\r
                return 0;\r
index 84100aeca43b7ff5f02bc0fcac332a4c0e8de83c..6752c49d12b54b8b4bef5b8b2299ed344fe747b0 100755 (executable)
 #define        MDelta          11\r
 \r
 #define        MouseInt        0x33*/\r
+#define        Mouse(x)        _AX = x,geninterrupt(MouseInt)\r
+\r
 #ifdef DEMO0\r
 typedef        enum            {\r
                                                demo_Off,demo_Record,demo_Playback,demo_PlayDone\r
@@ -246,8 +248,6 @@ void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/, global_game_
 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
 boolean IN_StartDemoRecord(word bufsize);\r
 void IN_StartDemoPlayback(byte *buffer,word bufsize);\r
index 1e7f73a21d87c5eea242cb6420d0804f656991b8..d6eba8441071e3d14b1a0913140556629ef84ea8 100755 (executable)
        PageListStruct  far *gvar->pm.PMPages,\r
                                        _seg *gvar->pm.PMSegPages;*/\r
 \r
-static union REGS CPURegs;\r
-\r
-#define _AX CPURegs.x.ax\r
-#define _BX CPURegs.x.bx\r
-#define _CX CPURegs.x.cx\r
-#define _DX CPURegs.x.dx\r
-\r
-#define _SI CPURegs.x.si\r
-\r
-#define _AH CPURegs.h.ah\r
-#define _AL CPURegs.h.al\r
-#define _BH CPURegs.h.bh\r
-#define _BL CPURegs.h.bl\r
-#define _CH CPURegs.h.ch\r
-#define _CL CPURegs.h.cl\r
-#define _DH CPURegs.h.dh\r
-#define _DL CPURegs.h.dl\r
-\r
-#ifdef __WATCOMC__\r
-#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);\r
-#endif\r
-\r
 static char            *ParmStrings[] = {"nomain","noems","noxms",nil};\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
index 4d6040cb640fcbb51a9907bf805aeb7998b76c3d..c8e1ee81632d245ec51501e8d9058dbce9241de3 100755 (executable)
@@ -171,7 +171,6 @@ void ReadConfig(void)
 \r
                read(file,&mouseenabled,sizeof(mouseenabled));\r
                read(file,&joystickenabled,sizeof(joystickenabled));\r
-               read(file,&joypadenabled,sizeof(joypadenabled));\r
                read(file,&joystickprogressive,sizeof(joystickprogressive));\r
                read(file,&joystickport,sizeof(joystickport));\r
 \r
@@ -230,7 +229,6 @@ void ReadConfig(void)
                        mouseenabled = true;\r
 \r
                joystickenabled = false;\r
-               joypadenabled = false;\r
                joystickport = 0;\r
                joystickprogressive = false;\r
 \r
@@ -269,7 +267,6 @@ void WriteConfig(void)
 \r
                write(file,&mouseenabled,sizeof(mouseenabled));\r
                write(file,&joystickenabled,sizeof(joystickenabled));\r
-               write(file,&joypadenabled,sizeof(joypadenabled));\r
                write(file,&joystickprogressive,sizeof(joystickprogressive));\r
                write(file,&joystickport,sizeof(joystickport));\r
 \r
@@ -409,69 +406,6 @@ noxor:
 \r
 //===========================================================================\r
 \r
-/*\r
-=============================================================================\r
-\r
-                                               MUSIC STUFF\r
-\r
-=============================================================================\r
-*/\r
-\r
-\r
-/*\r
-=================\r
-=\r
-= StopMusic\r
-=\r
-=================\r
-*/\r
-\r
-void TL_StopMusic(global_game_variables_t *gvar)\r
-{\r
-       int     i;\r
-\r
-       SD_MusicOff();\r
-       for (i = 0;i < LASTMUSIC;i++)\r
-               if (gvar->ca.audiosegs[STARTMUSIC + i])\r
-               {\r
-                       MM_SetPurge(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],3, gvar);\r
-                       MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],false, gvar);\r
-               }\r
-}\r
-\r
-//==========================================================================\r
-\r
-\r
-/*\r
-=================\r
-=\r
-= StartMusic\r
-=\r
-=================\r
-*/\r
-\r
-void TL_StartMusic(global_game_variables_t *gvar)\r
-{\r
-       musicnames      chunk;\r
-\r
-       SD_MusicOff();\r
-       chunk = 0;//++++songs[gamestate.mapon+gamestate.episode*10];\r
-\r
-//     if ((chunk == -1) || (MusicMode != smm_AdLib))\r
-//DEBUG control panel          return;\r
-\r
-//++++ MM_BombOnError (false,gvar);\r
-//++++ CA_CacheAudioChunk(STARTMUSIC + chunk, gvar);\r
-//++++ MM_BombOnError (true,gvar);\r
-//++++ if (gvar->mm.mmerror)\r
-//++++         gvar->mm.mmerror = false;\r
-//++++ else\r
-//++++ {\r
-               MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + chunk],true, gvar);\r
-               SD_StartMusic((MusicGroup far *)gvar->ca.audiosegs[STARTMUSIC + chunk]);\r
-//++++ }\r
-}\r
-\r
 /*\r
 ==================\r
 =\r
index 1a8e48a483ab19a9657ce8618938ac464927bf13..3bf8e2c5342e514b0a912ccdc2121d614c77342e 100755 (executable)
@@ -135,8 +135,8 @@ void        Shutdown16(global_game_variables_t *gvar),
 void TL_DosLibStartup(global_game_variables_t *gvar);\r
 void TL_VidInit(global_game_variables_t *gvar);\r
 boolean FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);\r
-void TL_StartMusic(global_game_variables_t *gvar);\r
-void TL_StopMusic(global_game_variables_t *gvar);\r
+void PL_StartMusic(global_game_variables_t *gvar);\r
+void PL_StopMusic(global_game_variables_t *gvar);\r
 void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
 void ClearMemory (global_game_variables_t *gvar);\r
 void Quit (global_game_variables_t *gvar, char *error);\r
index 7a7b07939c4517ebc14aae6f0b6404b938db947a..a9d9d8b313b8b2ade77d779a878bbb2c6fa0e0d3 100755 (executable)
@@ -96,3 +96,68 @@ void TL_VidInit(global_game_variables_t *gvar)
        if(!gvar->video.old_mode) gvar->video.old_mode = VL_vgaGetMode();//out.h.al;\r
        gvar->video.VL_Initiated = 1;\r
 }\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                               MUSIC STUFF\r
+\r
+=============================================================================\r
+*/\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= StopMusic\r
+=\r
+=================\r
+*/\r
+\r
+void PL_StopMusic(global_game_variables_t *gvar)\r
+{\r
+       int     i;\r
+\r
+       SD_MusicOff();\r
+       for (i = 0;i < LASTMUSIC;i++)\r
+               if (gvar->ca.audiosegs[STARTMUSIC + i])\r
+               {\r
+                       MM_SetPurge(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],3, gvar);\r
+                       MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],false, gvar);\r
+               }\r
+}\r
+\r
+//==========================================================================\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= StartMusic\r
+=\r
+=================\r
+*/\r
+\r
+void PL_StartMusic(global_game_variables_t *gvar)\r
+{\r
+       musicnames      chunk;\r
+\r
+       SD_MusicOff();\r
+       chunk = 0;//++++songs[gamestate.mapon+gamestate.episode*10];\r
+\r
+//     if ((chunk == -1) || (MusicMode != smm_AdLib))\r
+//DEBUG control panel          return;\r
+\r
+//++++ MM_BombOnError (false,gvar);\r
+//++++ CA_CacheAudioChunk(STARTMUSIC + chunk, gvar);\r
+//++++ MM_BombOnError (true,gvar);\r
+//++++ if (gvar->mm.mmerror)\r
+//++++         gvar->mm.mmerror = false;\r
+//++++ else\r
+//++++ {\r
+               MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + chunk],true, gvar);\r
+               SD_StartMusic((MusicGroup far *)gvar->ca.audiosegs[STARTMUSIC + chunk]);\r
+//++++ }\r
+}\r
index 5c8d26388d2d89d239fd828e4518565a247ee87c..8396a97ea80ddc3c2dd32c9db46a52b6c57fd194 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5c8d26388d2d89d239fd828e4518565a247ee87c
+Subproject commit 8396a97ea80ddc3c2dd32c9db46a52b6c57fd194
index 4e11d113308b9a558eda3cb3510e341f3193af9c..77b968c33a3aec73ce2c9c830d9461419d0ac520 100755 (executable)
@@ -37,10 +37,10 @@ void main(int argc,char **argv)
        IN_Startup(&gvar);\r
        printf("start\n");\r
        SD_Startup(&gvar);\r
-       TL_StartMusic (&gvar);\r
+       PL_StartMusic (&gvar);\r
        while (!(scancode = gvar.in.inst->LastScan)){}\r
        printf("shutdown\n");\r
-       TL_StopMusic(&gvar);\r
+       PL_StopMusic(&gvar);\r
        SD_Shutdown(&gvar);\r
        IN_Shutdown(&gvar);\r
        ShutdownCAMMPM(&gvar);\r
index 480d517ed2f7872338e401c98aaaf9ef1c831f05..3f097a3c66650b350489ecb1d53d3ccd35f37c95 100755 (executable)
 \r
 //#define NOMAPLOAD\r
 //#define OLDPLAYERSPRITESTUFF\r
+#define XC_CTRLTYPE ctrl_Keyboard\r
+//Mouse\r
 #ifdef __DEBUG__\r
 #define SCROLLEXEDEBUG\r
 boolean\r
-       dbg_nointest=1;\r
+       dbg_nointest=0,\r
+       dbg_joymousedelta=0;\r
 #endif\r
 \r
 //static map_t map;\r
@@ -133,7 +136,8 @@ void main(int argc, char *argv[])
 #endif\r
 \r
        // input!\r
-       IN_Default(0, &gvar.player[0],ctrl_Keyboard1, &gvar);\r
+       IN_Default(0, &gvar.player[0],XC_CTRLTYPE, &gvar);\r
+       IN_SetControlType(&gvar.player[0],XC_CTRLTYPE);\r
 \r
        // save the palette\r
 #ifdef FADE\r