From 2fc6c650cc91ba3a4447630286d9aa4bb92bbfda Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 13 Oct 2017 11:28:56 -0500 Subject: [PATCH] having the palette in the game code may help. also i added wolf3d's palette for examaning reasons wwww. i am STILL far too busy to code again. there is also borland c showmem stuff and joystick testing and palett manipulation stuff i needd to do but no time] --- makefile | 3 ++- src/lib/16_vl.c | 2 +- src/lib/16_vl.h | 2 ++ src/lib/doslib | 2 +- src/lib/gamepal.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ src/xcroll.c | 1 + 6 files changed, 62 insertions(+), 3 deletions(-) create mode 100755 src/lib/gamepal.c diff --git a/makefile b/makefile index 528cb6ed..b0bd5986 100755 --- a/makefile +++ b/makefile @@ -144,7 +144,7 @@ LIBFLAGS=$(WLIBQ) -b -n # VGMSNDOBJ = vgmSnd.$(OBJ) OLDLIBOBJS=bitmap.$(OBJ) 16render.$(OBJ) -GFXLIBOBJS = 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16_vl_2.$(OBJ) 16_vlpal.$(OBJ) 16text.$(OBJ) scroll16.$(OBJ) 16_spri.$(OBJ) +GFXLIBOBJS = 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16_vl_2.$(OBJ) 16_vlpal.$(OBJ) 16text.$(OBJ) scroll16.$(OBJ) 16_spri.$(OBJ) gamepal.$(OBJ) 16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_head.$(OBJ) 16_enti.$(OBJ) 16_dbg.$(OBJ) 16_in.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_wcpu.$(OBJ) 16_timer.$(OBJ) jsmn.$(OBJ) 16_map.$(OBJ) 16_sd.$(OBJ) 16_snd.$(OBJ) 16_tail_.$(OBJ) 16_dbg_1.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) !ifeq DEBUGSERIAL 1 @@ -403,6 +403,7 @@ opltest.exe: 16_vl.$(OBJ): $(SRCLIB)/16_vl.c $(SRCLIB)/16_vl.h 16_vl_1.$(OBJ): $(SRCLIB)/16_vl_1.c $(SRCLIB)/16_vl.h 16_vlpal.$(OBJ): $(SRCLIB)/16_vlpa_.c $(SRCLIB)/16_vlpal.c $(SRCLIB)/16_vlpal.h +gamepal.$(OBJ): $(SRCLIB)/gamepal.c bakapee.$(OBJ): $(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.h 16planar.$(OBJ): $(MODEXLIB16)/16planar.c $(MODEXLIB16)/16planar.h #16_vrs.$(OBJ): $(SRCLIB)/16_vrs.c $(SRCLIB)/16_vrs.h $(DOSLIB) diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 761a0cf3..ac001021 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -28,7 +28,7 @@ byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); -static byte tmppal[PAL_SIZE]; +/*static */byte tmppal[PAL_SIZE]; //=========================================================================== diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index a3769a28..098eed8b 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -68,6 +68,7 @@ typedef union /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ +extern byte far gamepal; #define SCREEN_SEG 0xa000 #define VIDEO_INT 0x10 #define SET_MODE 0x00 @@ -200,6 +201,7 @@ void modexFlashOn(word fade, byte *palette); void modexFlashOff(word fade, byte *palette); /* palette loading and saving */ +void VL_SetPalette (byte far *palette, video_t *v); void modexPalSave(byte *palette); //byte *modexNewPal(); void modexLoadPalFile(char *filename, byte *palette); diff --git a/src/lib/doslib b/src/lib/doslib index 8747af5a..1921c95c 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 8747af5a1100fa9bee7fb87664ff54b248877d9f +Subproject commit 1921c95c26a77c368197a8e402aab9d50d2df38e diff --git a/src/lib/gamepal.c b/src/lib/gamepal.c new file mode 100755 index 00000000..f9f8caa9 --- /dev/null +++ b/src/lib/gamepal.c @@ -0,0 +1,55 @@ +//#define SODPAL + +unsigned char __far gamepal[768]={ + 0, 0, 0, 0, 0, 42, 0, 42, 0, 0, 42, 42, 42, 0, 0, 42, + 0, 42, 42, 21, 0, 42, 42, 42, 21, 21, 21, 21, 21, 63, 21, 63, + 21, 21, 63, 63, 63, 21, 21, 63, 21, 63, 63, 63, 21, 63, 63, 63, + 59, 59, 59, 55, 55, 55, 52, 52, 52, 48, 48, 48, 45, 45, 45, 42, + 42, 42, 38, 38, 38, 35, 35, 35, 31, 31, 31, 28, 28, 28, 25, 25, + 25, 21, 21, 21, 18, 18, 18, 14, 14, 14, 11, 11, 11, 8, 8, 8, + 63, 0, 0, 59, 0, 0, 56, 0, 0, 53, 0, 0, 50, 0, 0, 47, + 0, 0, 44, 0, 0, 41, 0, 0, 38, 0, 0, 34, 0, 0, 31, 0, + 0, 28, 0, 0, 25, 0, 0, 22, 0, 0, 19, 0, 0, 16, 0, 0, + 63, 54, 54, 63, 46, 46, 63, 39, 39, 63, 31, 31, 63, 23, 23, 63, + 16, 16, 63, 8, 8, 63, 0, 0, 63, 42, 23, 63, 38, 16, 63, 34, + 8, 63, 30, 0, 57, 27, 0, 51, 24, 0, 45, 21, 0, 39, 19, 0, + 63, 63, 54, 63, 63, 46, 63, 63, 39, 63, 63, 31, 63, 62, 23, 63, + 61, 16, 63, 61, 8, 63, 61, 0, 57, 54, 0, 51, 49, 0, 45, 43, + 0, 39, 39, 0, 33, 33, 0, 28, 27, 0, 22, 21, 0, 16, 16, 0, + 52, 63, 23, 49, 63, 16, 45, 63, 8, 40, 63, 0, 36, 57, 0, 32, + 51, 0, 29, 45, 0, 24, 39, 0, 54, 63, 54, 47, 63, 46, 39, 63, + 39, 32, 63, 31, 24, 63, 23, 16, 63, 16, 8, 63, 8, 0, 63, 0, + 0, 63, 0, 0, 59, 0, 0, 56, 0, 0, 53, 0, 1, 50, 0, 1, + 47, 0, 1, 44, 0, 1, 41, 0, 1, 38, 0, 1, 34, 0, 1, 31, + 0, 1, 28, 0, 1, 25, 0, 1, 22, 0, 1, 19, 0, 1, 16, 0, + 54, 63, 63, 46, 63, 63, 39, 63, 63, 31, 63, 62, 23, 63, 63, 16, + 63, 63, 8, 63, 63, 0, 63, 63, 0, 57, 57, 0, 51, 51, 0, 45, + 45, 0, 39, 39, 0, 33, 33, 0, 28, 28, 0, 22, 22, 0, 16, 16, + 23, 47, 63, 16, 44, 63, 8, 42, 63, 0, 39, 63, 0, 35, 57, 0, + 31, 51, 0, 27, 45, 0, 23, 39, 54, 54, 63, 46, 47, 63, 39, 39, + 63, 31, 32, 63, 23, 24, 63, 16, 16, 63, 8, 9, 63, 0, 1, 63, + 0, 0, 63, 0, 0, 59, 0, 0, 56, 0, 0, 53, 0, 0, 50, 0, + 0, 47, 0, 0, 44, 0, 0, 41, 0, 0, 38, 0, 0, 34, 0, 0, + 31, 0, 0, 28, 0, 0, 25, 0, 0, 22, 0, 0, 19, 0, 0, 16, + 10, 10, 10, 63, 56, 13, 63, 53, 9, 63, 51, 6, 63, 48, 2, 63, +#ifndef SODPAL + 45, 0, 45, 8, 63, 42, 0, 63, 38, 0, 57, 32, 0, 51, 29, 0, +#else + 45, 0, 0, 14, 0, 0, 10, 0, 38, 0, 57, 32, 0, 51, 29, 0, +#endif + 45, 24, 0, 39, 20, 0, 33, 17, 0, 28, 13, 0, 22, 10, 0, 16, + 63, 54, 63, 63, 46, 63, 63, 39, 63, 63, 31, 63, 63, 23, 63, 63, + 16, 63, 63, 8, 63, 63, 0, 63, 56, 0, 57, 50, 0, 51, 45, 0, + 45, 39, 0, 39, 33, 0, 33, 27, 0, 28, 22, 0, 22, 16, 0, 16, + 63, 58, 55, 63, 56, 52, 63, 54, 49, 63, 53, 47, 63, 51, 44, 63, + 49, 41, 63, 47, 39, 63, 46, 36, 63, 44, 32, 63, 41, 28, 63, 39, + 24, 60, 37, 23, 58, 35, 22, 55, 34, 21, 52, 32, 20, 50, 31, 19, + 47, 30, 18, 45, 28, 17, 42, 26, 16, 40, 25, 15, 39, 24, 14, 36, + 23, 13, 34, 22, 12, 32, 20, 11, 29, 19, 10, 27, 18, 9, 23, 16, + 8, 21, 15, 7, 18, 14, 6, 16, 12, 6, 14, 11, 5, 10, 8, 3, + 24, 0, 25, 0, 25, 25, 0, 24, 24, 0, 0, 7, 0, 0, 11, 12, + 9, 4, 18, 0, 18, 20, 0, 20, 0, 0, 13, 7, 7, 7, 19, 19, + 19, 23, 23, 23, 16, 16, 16, 12, 12, 12, 13, 13, 13, 54, 61, 61, + 46, 58, 58, 39, 55, 55, 29, 50, 50, 18, 48, 48, 8, 45, 45, 8, + 44, 44, 0, 41, 41, 0, 38, 38, 0, 35, 35, 0, 33, 33, 0, 31, + 31, 0, 30, 30, 0, 29, 29, 0, 28, 28, 0, 27, 27, 38, 0, 34}; diff --git a/src/xcroll.c b/src/xcroll.c index 93afc856..0c428ba9 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -315,6 +315,7 @@ void main(int argc, char *argv[]) // if(gvar.in.inst->Keyboard[10]){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1, &gvar); } //#endif if(gvar.in.inst->Keyboard[sc_R]){ VL_modexPalOverscan(&gvar.video.palette, rand()%32); } //r + if(gvar.in.inst->Keyboard[sc_F]){ VL_SetPalette(&gamepal, &gvar.video); } //f //if((gvar.player[0].enti.q==1) && !(gvar.player[0].enti.x%TILEWH==0 && gvar.player[0].enti.y%TILEWH==0)) Quit (&gvar, "PLAYER OFF THE RAILS!");//break; //incase things go out of sync! -- 2.39.5