From c8d0f894b450f6dc3b80fbe28fedff4d424ce294 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 24 Mar 2017 09:38:06 -0500 Subject: [PATCH] [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]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] --- src/exmmtest.c | 8 ++++---- src/lib/16_dbg.c | 12 ++++++++---- src/lib/16_in.c | 12 +++++++++--- src/lib/16_tdef.h | 20 ++++++++++++-------- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/exmmtest.c b/src/exmmtest.c index e50dfdad..11cdf7cf 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -223,13 +223,13 @@ PRINTBB; printf("\n\npress any key to continue!\n"); getch(); #endif #endif //filereadload -/* + #ifdef __WATCOMC__ - IN_Shutdown(&gvar); - ShapeTest (&gvar); IN_Startup(&gvar); + ShapeTest (&gvar); + IN_Shutdown(&gvar); #endif -*/ + DebugMemory_(&gvar, 1); MM_DumpData(&gvar); diff --git a/src/lib/16_dbg.c b/src/lib/16_dbg.c index 576f492b..db8f71a1 100755 --- a/src/lib/16_dbg.c +++ b/src/lib/16_dbg.c @@ -126,9 +126,9 @@ static char buf[10]; // US_Print(" Page #"); // US_PrintUnsigned(i); printf(" Page #%u", i); - if (i < (gvar->pm.fi.PMSpriteStart)) +//++ if (i < (gvar->pm.fi.PMSpriteStart)) // US_Print(" (Wall)"); - printf(" (Wall)"); +//++ printf(" (Wall)"); /* else if (i < (gvar->pm.fi.PMSoundStart)) // US_Print(" (Sprite)"); printf(" (Sprite)"); @@ -256,10 +256,14 @@ static char buf[10]; // VW_UpdateScreen(); -// while (!(scan = IN_GetLastScan())) - scan = *IN_GetScanName(scan); + while (!(scan = gvar->in.inst->LastScan)) + { + } +// scan = *IN_GetScanName(scan); // SD_Poll(); +if(IN_KeyDown(sc_Escape)) break; + IN_ClearKey(scan); switch (scan) { diff --git a/src/lib/16_in.c b/src/lib/16_in.c index 98ecb70d..14086bd8 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -78,15 +78,21 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ extern "C" { #endif -static struct instat { - boolean CapsLock; +/*static struct instat { + boolean CapsLock; ScanCode CurCode,LastCode; boolean Keyboard[NumCodes]; boolean Paused; char LastASCII; ScanCode LastScan; -} inst; +} inst;*/ + +//the def stuff is need fix warnings +#ifndef INSTDEFED +#define INSTDEFED +static inst_t inst; +#endif static byte far ASCIINames[] = // Unshifted ASCII for scan codes { diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 27f43adc..08b96996 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -287,27 +287,31 @@ typedef struct { joyMultXH,joyMultYH; } JoystickDef; +typedef struct instat { + boolean CapsLock; + ScanCode CurCode,LastCode; + + boolean Keyboard[NumCodes]; + boolean Paused; + char LastASCII; + ScanCode LastScan; +} inst_t; + typedef struct// inconfig { boolean IN_Started; -// boolean CapsLock; -// ScanCode CurCode,LastCode; // // configuration variables // -// boolean Keyboard[NumCodes], boolean JoysPresent[MaxJoys], MousePresent, JoyPadPresent; // Global variables -// boolean Paused; -// char LastASCII; -// ScanCode LastScan; - KeyboardDef KbdDefs[MaxKbds]; JoystickDef JoyDefs[MaxJoys]; - struct instat *inst; + //struct instat *inst; + inst_t *inst; } in_info_t; //========================================================================== -- 2.39.2