/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */\r
\r
static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette);\r
-static byte tmppal[PAL_SIZE];\r
+/*static */byte tmppal[PAL_SIZE];\r
\r
//===========================================================================\r
\r
__asm cld;\r
\r
VGAmodeX(1/*TODO other modes*/, 1, gvar);\r
- VL_LoadPalFileCore(gvar->video.palette, gvar);\r
+//-- VL_LoadPalFileCore(gvar->video.palette, gvar);\r
+ VL_SetCorePal(gvar);\r
//Quit ("Improper video card! If you really have a VGA card that I am not\ndetecting it!", gvar);\r
}\r
\r
gvar->video.page[1].dx=gvar->video.page[1].dy=TILEWH; // 1 tile size buffer\r
gvar->video.page[2].dx=gvar->video.page[2].dy=\r
gvar->video.page[3].dx=gvar->video.page[3].dy=0; // cache pages are buffer wwww\r
+\r
+ gvar->video.page[0].tlx=gvar->mv[0].tx*TILEWH;\r
+ gvar->video.page[0].tly=gvar->mv[0].ty*TILEWH;\r
}\r
\r
//\r
}\r
}\r
\r
+//++++//\r
+void VL_SetCorePal(global_game_variables_t *gvar)\r
+{\r
+ byte *palette = &corepal;\r
+ word i;\r
+\r
+ vga_palette_lseek(0);\r
+ for (i=0;i < COREPALSIZE;i++)\r
+ vga_palette_write(palette[(i*3)+0]>>2,\r
+ palette[(i*3)+1]>>2,\r
+ palette[(i*3)+2]>>2);\r
+\r
+ VL_PaletteSync(gvar);\r
+}\r
+\r
void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar)\r
{\r
VLL_LoadPalFilewithoffset(filename, palette,\r
}\r
}\r
\r
+// short hand of modexprint\r
+void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar)\r
+{\r
+ modexprint(&(gvar->video.page[pagenum]), gvar->video.print.x, gvar->video.print.y, gvar->video.print.t, gvar->video.print.tlsw, gvar->video.print.color, gvar->video.print.bgcolor, gvar->video.VL_Started, str);\r
+}\r
+\r
/* palette dump on display! */\r
void modexpdump(nibble pagenum, global_game_variables_t *gvar)\r
{\r
// printf("========================================\n");\r
printf(" Virtual Screen: %dx", v->page[0].width); printf("%d ", v->page[0].height); printf("Tile: %dx", v->page[0].ti.tilesw); printf("%d", v->page[0].ti.tilesh); printf("=((Virtual Screen)/16)\n");\r
printf(" Screen: %dx", v->page[0].sw); printf("%d ", v->page[0].sh); printf("Tile: %dx", v->page[0].ti.tw); printf("%d", v->page[0].ti.th); printf("=((Screen)/16)\n");\r
- printf(" stride: %u ", vga_state.vga_stride);\r
+ printf(" vga_stride: %u ", vga_state.vga_stride);\r
+ printf("pagestride: %u ", v->page[0].stridew);\r
printf("draw_stride: %u ", vga_state.vga_draw_stride);\r
printf("draw_stride_limit: %u\n", vga_state.vga_draw_stride_limit);\r
\r