From: sparky4 Date: Wed, 3 May 2017 22:04:49 +0000 (-0500) Subject: 16_ca needs huge amounts of work and I should remember what needs to be done soon... X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=1af0b853a337587df021dcabc445088c78fbd703 16_ca needs huge amounts of work and I should remember what needs to be done soon[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]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] added 1st scroll back [i work on CA] palette debug show values added wwww and i need to know how to see vrs/vrl imaage data palette index numbers [i am trying to find out how the hell you get the index number values of VRL/VRS] [xcroll.exe JK ing stuff makes the mm go BOOM so.. i will work on this.... --- diff --git a/data/G.PAL b/data/G.PAL index 34da18d0..ebf07024 100755 Binary files a/data/G.PAL and b/data/G.PAL differ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 9b7a123f..06338dbb 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1249,7 +1249,7 @@ void MM_SortMem (global_game_variables_t *gvar) SD_StopSound();*/ oldborder = gvar->video.bordercolor; - gvar->video.bordercolor = modexPalOverscan(15); + gvar->video.bordercolor = VL_modexPalOverscan(gvar->video.palette, 4); if (beforesort) beforesort(); diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 77c5fad2..5b73ac5c 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -916,38 +916,43 @@ modexLoadPalFile(byte *filename, byte *palette) { fclose(file); } -void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar) -{ - VL_LoadPalFilewithoffset(filename, palette, - 0, gvar); - //9, gvar); -// VL_LoadPalFileCore(palette); -} - -void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar) -{ - VL_LoadPalFilewithoffset("data/16.pal", palette, 0, gvar); -} - -void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar) +void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word palsize, global_game_variables_t *gvar) { int fd; + byte *newpalette; fd = open(filename,O_RDONLY|O_BINARY); if (fd >= 0) { - read(fd,palette, PAL_SIZE); + read(fd,palette, palsize); close(fd); - VL_UpdatePaletteWrite(palette, o, gvar); + if(palsize==27) newpalette = palette; else{ //if core then load it + newpalette = &palette[3]; //skip overscan color + if(!o) o++; + } + VL_UpdatePaletteWrite(newpalette, o, gvar); } } +void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar) +{ + VLL_LoadPalFilewithoffset(filename, palette, + 0, +// 9, + PAL_SIZE, gvar); +} + +void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar) +{ + VLL_LoadPalFilewithoffset("data/16.pal", palette, 0, 27, gvar); +} + void VL_UpdatePaletteWrite(byte *palette, word o, global_game_variables_t *gvar) { word i; - vga_palette_lseek(/*1+*/o); - //for (i=o;i < 256-o;i++) - for (i=0;i < 256-o;i++) + + vga_palette_lseek(o); + for (i=0;i < 255-o;i++) vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2); VL_PaletteSync(gvar); @@ -1031,12 +1036,17 @@ VL_modexPalScramble(byte *p) } word -modexPalOverscan(word col) +VL_modexPalOverscan(byte *p, word col) { + int i; //modexWaitBorder(); vga_wait_for_vsync(); outp(PAL_WRITE_REG, 0); /* start at the beginning of palette */ - outp(PAL_DATA_REG, col); + for(i=col; i<(3+col); i++) + { + outp(PAL_DATA_REG, p[i]); + } +// modexPalSave(p); return col; } diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index abea3773..91db3049 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -201,7 +201,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_LoadPalFilewithoffset(const char *filename, byte *palette, word o, 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, global_game_variables_t *gvar); void VL_PaletteSync(global_game_variables_t *gvar); void modexSavePalFile(char *filename, byte *palette); @@ -214,7 +214,7 @@ void modexPalWhite(); /* utility functions */ void modexPalUpdate(byte *p); void VL_modexPalScramble(byte *p); -word modexPalOverscan(word col); +word VL_modexPalOverscan(byte *p, word col); void VL_ColorBorder (int color, video_t *v); void VL_Plot (int x, int y, int color, global_game_variables_t *gvar); void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar); diff --git a/src/xcroll.c b/src/xcroll.c index 7e93de09..9416cf9e 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -232,11 +232,12 @@ void main(int argc, char *argv[]) //read_vrs(&gvar, bakapee, gvar.player[0].enti.spri->spritesheet); VRS_ReadVRS(bakapee, &gvar.player[0].enti, &gvar); VL_LoadPalFile(bakapeep, &gvar.video.palette, &gvar); + ZC_animatePlayer(&gvar.mv, &gvar.player, 0); }//JK -#ifdef FADE - 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]){ modexPalOverscan(rand()%56); } //r +//#ifdef FADE +// 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.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! }