fclose(file);\r
}\r
\r
-void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar)\r
-{\r
- VL_LoadPalFilewithoffset(filename, palette,\r
- 0, gvar);\r
- //9, gvar);\r
-// VL_LoadPalFileCore(palette);\r
-}\r
-\r
-void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar)\r
-{\r
- VL_LoadPalFilewithoffset("data/16.pal", palette, 0, gvar);\r
-}\r
-\r
-void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar)\r
+void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word palsize, global_game_variables_t *gvar)\r
{\r
int fd;\r
+ byte *newpalette;\r
\r
fd = open(filename,O_RDONLY|O_BINARY);\r
if (fd >= 0) {\r
- read(fd,palette, PAL_SIZE);\r
+ read(fd,palette, palsize);\r
close(fd);\r
\r
- VL_UpdatePaletteWrite(palette, o, gvar);\r
+ if(palsize==27) newpalette = palette; else{ //if core then load it\r
+ newpalette = &palette[3]; //skip overscan color\r
+ if(!o) o++;\r
+ }\r
+ VL_UpdatePaletteWrite(newpalette, o, gvar);\r
}\r
}\r
\r
+void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar)\r
+{\r
+ VLL_LoadPalFilewithoffset(filename, palette,\r
+ 0,\r
+// 9,\r
+ PAL_SIZE, gvar);\r
+}\r
+\r
+void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar)\r
+{\r
+ VLL_LoadPalFilewithoffset("data/16.pal", palette, 0, 27, gvar);\r
+}\r
+\r
void VL_UpdatePaletteWrite(byte *palette, word o, global_game_variables_t *gvar)\r
{\r
word i;\r
- vga_palette_lseek(/*1+*/o);\r
- //for (i=o;i < 256-o;i++)\r
- for (i=0;i < 256-o;i++)\r
+\r
+ vga_palette_lseek(o);\r
+ for (i=0;i < 255-o;i++)\r
vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2);\r
\r
VL_PaletteSync(gvar);\r
}\r
\r
word\r
-modexPalOverscan(word col)\r
+VL_modexPalOverscan(byte *p, word col)\r
{\r
+ int i;\r
//modexWaitBorder();\r
vga_wait_for_vsync();\r
outp(PAL_WRITE_REG, 0); /* start at the beginning of palette */\r
- outp(PAL_DATA_REG, col);\r
+ for(i=col; i<(3+col); i++)\r
+ {\r
+ outp(PAL_DATA_REG, p[i]);\r
+ }\r
+// modexPalSave(p);\r
return col;\r
}\r
\r
void modexLoadPalFile(char *filename, byte *palette);\r
void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar);\r
void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar);\r
-void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar);\r
+//void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar);\r
void VL_UpdatePaletteWrite(byte *palette, word o, global_game_variables_t *gvar);\r
void VL_PaletteSync(global_game_variables_t *gvar);\r
void modexSavePalFile(char *filename, byte *palette);\r
/* utility functions */\r
void modexPalUpdate(byte *p);\r
void VL_modexPalScramble(byte *p);\r
-word modexPalOverscan(word col);\r
+word VL_modexPalOverscan(byte *p, word col);\r
void VL_ColorBorder (int color, video_t *v);\r
void VL_Plot (int x, int y, int color, global_game_variables_t *gvar);\r
void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar);\r
//read_vrs(&gvar, bakapee, gvar.player[0].enti.spri->spritesheet);\r
VRS_ReadVRS(bakapee, &gvar.player[0].enti, &gvar);\r
VL_LoadPalFile(bakapeep, &gvar.video.palette, &gvar);\r
+ ZC_animatePlayer(&gvar.mv, &gvar.player, 0);\r
}//JK\r
-#ifdef FADE\r
- if(gvar.in.inst->Keyboard[10]){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1, &gvar); }\r
-#endif\r
- if(gvar.in.inst->Keyboard[sc_R]){ modexPalOverscan(rand()%56); } //r\r
+//#ifdef FADE\r
+// if(gvar.in.inst->Keyboard[10]){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1, &gvar); }\r
+//#endif\r
+ if(gvar.in.inst->Keyboard[sc_R]){ VL_modexPalOverscan(&gvar.video.palette, rand()%32); } //r\r
\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!\r
}\r