From: sparky4 Date: Wed, 25 Oct 2017 20:16:40 +0000 (-0500) Subject: corepal variable added and i need to find out how to get the joystick input correct... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=eda37da84ccb4fc381507f04832d0358799ed67c;p=16.git corepal variable added and i need to find out how to get the joystick input correct and working correctly. it also tends to not work in 2 directions in slow xt speed.. timer? wwww also palette manipulation and showmem function (tweaking in watcom and porting to work with in borland c) --- diff --git a/makefile b/makefile index b0bd5986..bc228a0a 100755 --- a/makefile +++ b/makefile @@ -269,7 +269,7 @@ testexec: $(EXEC) $(TESTEXEC2) # game and bakapi executables # 16.exe: 16.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) -bakapi.exe: bakapi.$(OBJ) 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) $(DOSLIB) 16_wcpu.$(OBJ)# gfx.lib +bakapi.exe: bakapi.$(OBJ) 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) $(DOSLIB) 16_wcpu.$(OBJ) gamepal.$(OBJ)# gfx.lib sp2.exe: sp2.$(OBJ) # diff --git a/src/inputest.c b/src/inputest.c index e74d10c7..efba7464 100755 --- a/src/inputest.c +++ b/src/inputest.c @@ -25,8 +25,8 @@ #include "src/lib/16_in.h" #include "src/lib/16_tail.h" -//#define INPUTEST_JOYSTICKPADTEST -#define INPUTEST_MOUSETEST +#define INPUTEST_JOYSTICKPADTEST +//#define INPUTEST_MOUSETEST void main(int argc, char *argv[]) diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index ac001021..a9d4b668 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -45,7 +45,8 @@ void VL_Startup (global_game_variables_t *gvar) __asm cld; VGAmodeX(1/*TODO other modes*/, 1, gvar); - VL_LoadPalFileCore(gvar->video.palette, gvar); +//-- VL_LoadPalFileCore(gvar->video.palette, gvar); + VL_SetCorePal(gvar); //Quit ("Improper video card! If you really have a VGA card that I am not\ndetecting it!", gvar); } @@ -939,6 +940,21 @@ void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word } } +//++++// +void VL_SetCorePal(global_game_variables_t *gvar) +{ + byte *palette = &corepal; + word i; + + vga_palette_lseek(0); + for (i=0;i < COREPALSIZE;i++) + vga_palette_write(palette[(i*3)+0]>>2, + palette[(i*3)+1]>>2, + palette[(i*3)+2]>>2); + + VL_PaletteSync(gvar); +} + void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar) { VLL_LoadPalFilewithoffset(filename, palette, diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index 098eed8b..30231f47 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -69,6 +69,7 @@ typedef union /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ extern byte far gamepal; +extern byte far corepal; //core palette used universally #define SCREEN_SEG 0xa000 #define VIDEO_INT 0x10 #define SET_MODE 0x00 @@ -207,6 +208,7 @@ void modexPalSave(byte *palette); void modexLoadPalFile(char *filename, byte *palette); void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar); void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar); +void VL_SetCorePal(global_game_variables_t *gvar); //void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar); void VL_UpdatePaletteWrite(byte *palette, word o, word palsize, global_game_variables_t *gvar); void VL_PaletteSync(global_game_variables_t *gvar); diff --git a/src/lib/doslib b/src/lib/doslib index 1921c95c..3801d6b6 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 1921c95c26a77c368197a8e402aab9d50d2df38e +Subproject commit 3801d6b6128ef21c0fdbbdd407dd6ff818b0c1c7 diff --git a/src/lib/gamepal.c b/src/lib/gamepal.c index f9f8caa9..7edffc05 100755 --- a/src/lib/gamepal.c +++ b/src/lib/gamepal.c @@ -53,3 +53,15 @@ unsigned char __far gamepal[768]={ 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}; + +const unsigned char __far corepal[27]={ + 1, 1, 1, //overscan color not pure black +63, 0, 0, //red + 0, 0, 63, //blue + 0, 63, 0, //green +63, 63, 0, //yellow +63, 63, 63, //white +63, 0, 63, //magenta + 0, 63, 63, //cyan + 0, 0, 0, //pure black +}; diff --git a/src/xcroll.c b/src/xcroll.c index 0c428ba9..cbbabea9 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -28,7 +28,7 @@ //#define NOMAPLOAD //#define OLDPLAYERSPRITESTUFF -#define XC_CTRLTYPE ctrl_Mouse//Keyboard +#define XC_CTRLTYPE ctrl_Joystick1//ctrl_Mouse//ctrl_Keyboard //Mouse #ifdef __DEBUG__ #define SCROLLEXEDEBUG