From 86619c6a50b07c52481161da4b549ffb5e403e66 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 23 Mar 2017 12:07:44 -0500 Subject: [PATCH] __seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd.c ][ ca needs huge amounts of work and i should remember what needs to be done soon also i should reverify 16_in.c to make sure it can work with other code of id engine] going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now] i fixed a bad bug on building the code initionally ^^; [working on inntest.exe again] --- makefile | 9 ++++++-- src/.16.c.kate-swp | Bin 595 -> 0 bytes src/inntest.c | 8 ++++---- src/lib/16_in_1.c | 50 ++++++++++++++++++++++----------------------- src/lib/16_in_1.h | 14 ++++++------- src/lib/16_tdef.h | 6 +++--- 6 files changed, 46 insertions(+), 41 deletions(-) delete mode 100755 src/.16.c.kate-swp diff --git a/makefile b/makefile index 0b4e1f97..fb475d5d 100755 --- a/makefile +++ b/makefile @@ -135,7 +135,8 @@ LIBFLAGS=$(WLIBQ) -b -n VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) #OLDLIBOBJS=bitmap.$(OBJ) 16render.$(OBJ) GFXLIBOBJS = 16_vl.$(OBJ) 16_vlpal.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16_vrs.$(OBJ) 16_spri.$(OBJ) $(OLDLIBOBJS) -16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_head.$(OBJ) 16_in.$(OBJ) 16_enti.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_wcpu.$(OBJ) 16_timer.$(OBJ) jsmn.$(OBJ) 16_map.$(OBJ) 16text.$(OBJ) +16LIBNOINOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_head.$(OBJ) 16_enti.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_wcpu.$(OBJ) 16_timer.$(OBJ) jsmn.$(OBJ) 16_map.$(OBJ) 16text.$(OBJ) +16LIBOBJS = $(16LIBNOINOBJS) 16_in.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) !ifeq DEBUGSERIAL 1 DOSLIBOBJ += 8250.$(OBJ) @@ -195,7 +196,8 @@ TESTEXEC = & zcroll.exe & inputest.exe & vrstest.exe & - maptest.exe + maptest.exe & + inntest.exe TESTEXEC2 = & pcxtest.exe & scroll.exe & @@ -261,6 +263,7 @@ fonttest.exe: fonttest.$(OBJ) gfx.lib #fonttes0.exe: fonttes0.$(OBJ) $(16LIB) fontgfx.exe: fontgfx.$(OBJ) gfx.lib $(DOSLIB) inputest.exe: inputest.$(OBJ) $(16LIB) $(DOSLIB) gfx.lib +inntest.exe: inntest.$(OBJ) $(16LIBNOINOBJS) 16_in_1.$(OBJ) #sountest.exe: sountest.$(OBJ) $(16LIB) pcxtest.exe: pcxtest.$(OBJ) gfx.lib $(DOSLIB) $(16LIB) vrstest.exe: vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) @@ -301,6 +304,7 @@ fonttest.$(OBJ):$(SRC)/fonttest.c #fonttes0.$(OBJ): $(SRC)/fonttes0.c fontgfx.$(OBJ):$(SRC)/fontgfx.c inputest.$(OBJ):$(SRC)/inputest.c +inntest.$(OBJ):$(SRC)/inntest.c #sountest.$(OBJ): $(SRC)/sountest.c #miditest.$(OBJ): $(SRC)/miditest.c #testemm.$(OBJ):$(SRC)/testemm.c @@ -355,6 +359,7 @@ mapread.$(OBJ):$(SRCLIB)/mapread.c $(SRCLIB)/mapread.h 16_map.$(OBJ):$(SRCLIB)/16_map.c $(SRCLIB)/16_map.h 16_timer.$(OBJ):$(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h 16_in.$(OBJ): $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h +16_in_1.$(OBJ): $(SRCLIB)/16_in_1.c $(SRCLIB)/16_in_1.h 16_rf.$(OBJ): $(SRCLIB)/16_rf.c $(SRCLIB)/16_rf.h 16_mm.$(OBJ): $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h 16_pm.$(OBJ): $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h diff --git a/src/.16.c.kate-swp b/src/.16.c.kate-swp deleted file mode 100755 index e3e59ca6d79b109c85cef325d0f785f629f6c9dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 595 zcmY*WOHSNC6zmyRC>xYDi&73?0t=Rr5E`N=8YN;RSfG*B<9=heu=`p4!I>==h?GlY z#aSZG!6kTYBM6q-{i|11{YokI@w<+M)u4M^*p_fod{#;w9DZmkH~;eI@6-M7hr>p# zuI03lakf}}lj%rC{^tApZwGUwX8(#KJunxc!KbneRHr~i{1u^%A%n;W4G+jSNI};G z-3G>wp4`>fC6TWDusvrK9Y zJayD<$YW@9e5snK4Ld?$c9VnuD(=YJ?GB=7od^oN)3<_6o?xS>yGdxUu>r?M*ef=a z4OjzmwRN;c&DPbqIKM%BgqQ&%FdJasW}}r@=m^ouPx>&>NH0x;@CsTaEAD#n`trnA z1&A);=2b=-oGqsymg!F5Nw@6|n-oVXLz`41>_Vh&Y|;5yiJ!}ITrXvw(y#%&x9n}) c!SS$OtS%+y9CuFl@m<(zX5aRE0-0?W&+o9fZvX%Q diff --git a/src/inntest.c b/src/inntest.c index 3742f87f..598303a6 100755 --- a/src/inntest.c +++ b/src/inntest.c @@ -22,7 +22,7 @@ /* input test */ -#include "src/lib/16_in_.h" +#include "src/lib/16_in_1.h" void probe_dos(){} void cpu_probe(){} @@ -41,8 +41,8 @@ main(int argc, char *argv[]) IN_Startup(&gvar); //IN_Default(0,&gvar.player,ctrl_Joystick1); //IN_SetControlType(0,&gvar.player,ctrl_Joystick1); - IN_Default(0,&gvar.player,ctrl_Keyboard1, &gvar); - IN_SetControlType(0,&gvar.player,ctrl_Keyboard1); + IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar); + IN_SetControlType(&gvar.player[0],ctrl_Keyboard1); gvar.player[0].enti.q=1; gvar.player[0].enti.d=2; @@ -54,7 +54,7 @@ main(int argc, char *argv[]) while(!IN_KeyDown(sc_Escape, &gvar)) { //0000 shinkutxt(&gvar); - IN_ReadControl(0, &gvar.player, &gvar); + IN_ReadControl(&gvar.player[0], &gvar); switch(gvar.player[0].enti.d) { //right movement diff --git a/src/lib/16_in_1.c b/src/lib/16_in_1.c index e7ed19ed..84e1266e 100755 --- a/src/lib/16_in_1.c +++ b/src/lib/16_in_1.c @@ -51,7 +51,7 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ ============================================================================= */ -struct inconfig +/*struct inconfig { boolean MousePresent; boolean JoysPresent[MaxJoys]; @@ -62,7 +62,7 @@ struct inconfig KeyboardDef KbdDefs[MaxKbds]; JoystickDef JoyDefs[MaxJoys]; -} inpu; +} inpu;*/ //inpu.KbdDefs = {0x1d,0x38,/*0x47,*/0x48,/*0x49,*/0x4b,0x4d,/*0x4f,*/0x50/*,0x51*/}; @@ -78,11 +78,11 @@ struct inconfig extern "C" { #endif -static struct instat { +/*static struct instat { boolean IN_Started; boolean CapsLock; ScanCode CurCode,LastCode; -} inst; +} inst;*/ static byte far ASCIINames[] = // Unshifted ASCII for scan codes { @@ -168,7 +168,7 @@ static char *ParmStringsIN[] = {"nojoys","nomouse",nil}; // /////////////////////////////////////////////////////////////////////////// /*static */void interrupt -INL_KeyService(void) +INL_KeyService(void)//! { static boolean special; byte k,c, @@ -376,7 +376,7 @@ done: // joystick (from +/-127) // /////////////////////////////////////////////////////////////////////////// -void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/) +void INL_GetJoyDelta(word joy,int *dx,int *dy/*,boolean adaptive*/)//! { word x,y; word TimeCount = *clockw; @@ -578,7 +578,7 @@ INL_SetJoyScale(word joy) // /////////////////////////////////////////////////////////////////////////// void -IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy) +IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy)//! { word d,r; JoystickDef *def; @@ -634,7 +634,7 @@ INL_StartJoy(word joy) // /////////////////////////////////////////////////////////////////////////// static void -INL_ShutJoy(word joy) +INL_ShutJoy(word joy)//! { inpu.JoysPresent[joy] = false; } @@ -647,7 +647,7 @@ INL_ShutJoy(word joy) // /////////////////////////////////////////////////////////////////////////// void -IN_Startup() +IN_Startup()//! { boolean checkjoys,checkmouse; word i; @@ -686,7 +686,7 @@ IN_Startup() // /////////////////////////////////////////////////////////////////////////// void -IN_Default(boolean gotit,player_t *player,ControlType nt) +IN_Default(boolean gotit,player_t *player,ControlType nt)//! { int i; if @@ -718,7 +718,7 @@ IN_Default(boolean gotit,player_t *player,ControlType nt) // /////////////////////////////////////////////////////////////////////////// void -IN_Shutdown(void) +IN_Shutdown(void)//! { word i; @@ -751,7 +751,7 @@ IN_SetKeyHook(void (*hook)()) // /////////////////////////////////////////////////////////////////////////// void -IN_ClearKeysDown(void) +IN_ClearKeysDown(void)//! { //int i; @@ -784,7 +784,7 @@ INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy) // /////////////////////////////////////////////////////////////////////////// void -IN_ReadCursor(CursorInfo *info) +IN_ReadCursor(CursorInfo *info)//! { word i, buttons; @@ -824,7 +824,7 @@ IN_ReadCursor(CursorInfo *info) // /////////////////////////////////////////////////////////////////////////// void -IN_ReadControl(player_t *player) +IN_ReadControl(player_t *player)//! { boolean realdelta; #if DEMO0 @@ -1108,7 +1108,7 @@ IN_GetScanName(ScanCode scan) // /////////////////////////////////////////////////////////////////////////// ScanCode -IN_WaitForKey(void) +IN_WaitForKey(void)//! { ScanCode result; @@ -1125,7 +1125,7 @@ IN_WaitForKey(void) // /////////////////////////////////////////////////////////////////////////// char -IN_WaitForASCII(void) +IN_WaitForASCII(void)//! { char result; @@ -1144,7 +1144,7 @@ IN_WaitForASCII(void) boolean btnstate[8]; -void IN_StartAck(void) +void IN_StartAck(void)//! { unsigned i,buttons; @@ -1164,7 +1164,7 @@ void IN_StartAck(void) } -boolean IN_CheckAck (void) +boolean IN_CheckAck (void)//! { unsigned i,buttons; @@ -1206,7 +1206,7 @@ void IN_Ack (void) // /////////////////////////////////////////////////////////////////////////// boolean -IN_IsUserInput() +IN_IsUserInput()//! { boolean result; word i; @@ -1258,7 +1258,7 @@ boolean IN_UserInput(word delay) =================== */ -byte IN_MouseButtons (void) +byte IN_MouseButtons (void)//! { union REGS CPURegs; if (inpu.MousePresent) @@ -1290,7 +1290,7 @@ byte IN_JoyButtons (void) return joybits; } -boolean IN_KeyDown(byte code) +boolean IN_KeyDown(byte code)//! { #ifdef __DEBUG_InputMgr__ if(!dbg_nointest) @@ -1305,14 +1305,14 @@ boolean IN_KeyDown(byte code) #endif } -void IN_ClearKey(byte code) +void IN_ClearKey(byte code)//! { inpu.Keyboard[code] = false; if(code == inpu.LastScan) inpu.LastScan = sc_None; } -boolean IN_qb(byte kee) +boolean IN_qb(byte kee)//! { #ifdef __DEBUG_InputMgr__ if(dbg_testkeyin) printf("%u\n", inpu.Keyboard[kee]); @@ -1321,12 +1321,12 @@ boolean IN_qb(byte kee) else return 0; } -ScanCode IN_GetLastScan() +ScanCode IN_GetLastScan()//! { return inpu.LastScan; } -ScanCode IN_GetCurCode() +ScanCode IN_GetCurCode()//! { return inst.CurCode; } diff --git a/src/lib/16_in_1.h b/src/lib/16_in_1.h index eb8048bc..c6115bf0 100755 --- a/src/lib/16_in_1.h +++ b/src/lib/16_in_1.h @@ -34,10 +34,10 @@ #include "src/lib/16_head.h" #include "src/lib/16_timer.h" #include "src/lib/16_dbg.h" -#ifdef __WATCOMC__ //borland C BCEXMM.EXE +/*#ifdef __WATCOMC__ //borland C BCEXMM.EXE #include "src/lib/16_spri.h" #include "src/lib/16_enti.h" -#endif +#endif*/ #define KeyInt 9 // The keyboard ISR number @@ -213,12 +213,12 @@ typedef struct { #endif // Internal routines -extern void IN_Startup(void),IN_Shutdown(void), - IN_Default(boolean gotit,player_t *player,ControlType nt), +extern void IN_Startup(global_game_variables_t *gvar),IN_Shutdown(global_game_variables_t *gvar), + IN_Default(boolean gotit,player_t *player,ControlType nt, global_game_variables_t *gvar), IN_SetKeyHook(void (*)()), IN_ClearKeysDown(void), IN_ReadCursor(CursorInfo *), - IN_ReadControl(player_t *player), + IN_ReadControl(player_t *player, global_game_variables_t *gvar), IN_SetControlType(player_t *player,ControlType type), IN_GetJoyAbs(word joy,word *xp,word *yp), IN_SetupJoy(word joy,word minx,word maxx, @@ -250,8 +250,8 @@ void IN_StopDemo(void); void IN_FreeDemoBuffer(void); #endif -boolean IN_KeyDown(byte code), - IN_qb(byte kee); +boolean IN_KeyDown(byte code, global_game_variables_t *gvar), + IN_qb(byte kee, global_game_variables_t *gvar); void IN_ClearKey(byte code), IN_KbdLED(); ScanCode IN_GetLastScan(), diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index d7350bb2..e386f1fb 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -287,7 +287,7 @@ typedef struct { joyMultXH,joyMultYH; } JoystickDef; -/*typedef struct// inconfig +typedef struct// inconfig { boolean IN_Started; boolean CapsLock; @@ -307,7 +307,7 @@ typedef struct { KeyboardDef KbdDefs[MaxKbds]; JoystickDef JoyDefs[MaxJoys]; -} in_info_t;*/ +} in_info_t; //========================================================================== @@ -654,7 +654,7 @@ typedef struct loghandle_t handle; //handles for file logging kurokku_t kurokku; //clock struct mminfo_t mm; mminfotype mmi; // mm stuff -//++++ in_info_t in; // 16_in info + in_info_t in; // 16_in info player_t player[MaxPlayers]; // player vars map_view_t mv[4]; } global_game_variables_t; -- 2.39.2