]> 4ch.mooo.com Git - 16.git/commitdiff
16_ca needs huge amounts of work and I should remember what needs to be done soon...
authorsparky4 <sparky4@cock.li>
Wed, 3 May 2017 22:04:49 +0000 (17:04 -0500)
committersparky4 <sparky4@cock.li>
Wed, 3 May 2017 22:04:49 +0000 (17:04 -0500)
data/G.PAL
src/lib/16_mm.c
src/lib/16_vl.c
src/lib/16_vl.h
src/xcroll.c

index 34da18d07d1b14cc3ff233f7e8b1a01281ffcc61..ebf070246a34cd165802552d2a0325c7df679385 100755 (executable)
Binary files a/data/G.PAL and b/data/G.PAL differ
index 9b7a123f75327a178e91b4494ba39bab027927d3..06338dbbb9ac92951fb50a8bd7af00488a58d4ae 100755 (executable)
@@ -1249,7 +1249,7 @@ void MM_SortMem (global_game_variables_t *gvar)
 \r
        SD_StopSound();*/\r
        oldborder = gvar->video.bordercolor;\r
-       gvar->video.bordercolor = modexPalOverscan(15);\r
+       gvar->video.bordercolor = VL_modexPalOverscan(gvar->video.palette, 4);\r
 \r
        if (beforesort)\r
                beforesort();\r
index 77c5fad2e4839df1202869b259ab7041e97cff33..5b73ac5c5240ea28464c74263091b0c4b2ff1e34 100755 (executable)
@@ -916,38 +916,43 @@ modexLoadPalFile(byte *filename, byte *palette) {
        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
@@ -1031,12 +1036,17 @@ VL_modexPalScramble(byte *p)
 }\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
index abea3773a42963c2472a515ad2dbda23324e5e92..91db3049fc66befde000d91ac286ae4cfbbd4265 100755 (executable)
@@ -201,7 +201,7 @@ void modexPalSave(byte *palette);
 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
@@ -214,7 +214,7 @@ void modexPalWhite();
 /* 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
index 7e93de09e9421bdeb42d7df3fee6a7f5a32a8f8d..9416cf9ee5ab38a1477f7931a4bfd8eab5e0b113 100755 (executable)
@@ -232,11 +232,12 @@ void main(int argc, char *argv[])
                        //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