X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl.c;h=e2000348d7ecf673c569525661a96a5cca4ad7c4;hb=6021fc3f27b895d382fbd30488ead35657e39196;hp=106f71924ae35ac0ac2799a9688005f91dcd04fb;hpb=8c5ce6d6e768ba3dfac7f4e2e95d68152ab42aaa;p=16.git diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 106f7192..e2000348 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -28,7 +28,7 @@ byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); -static byte tmppal[PAL_SIZE]; +/*static */byte tmppal[PAL_SIZE]; //=========================================================================== @@ -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); } @@ -545,6 +546,9 @@ void modexHiganbanaPageSetup(global_game_variables_t *gvar) gvar->video.page[1].dx=gvar->video.page[1].dy=TILEWH; // 1 tile size buffer gvar->video.page[2].dx=gvar->video.page[2].dy= gvar->video.page[3].dx=gvar->video.page[3].dy=0; // cache pages are buffer wwww + + gvar->video.page[0].tlx=gvar->mv[0].tx*TILEWH; + gvar->video.page[0].tly=gvar->mv[0].ty*TILEWH; } // @@ -936,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, @@ -1265,6 +1284,12 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c } } +// short hand of modexprint +void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar) +{ + 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); +} + /* palette dump on display! */ void modexpdump(nibble pagenum, global_game_variables_t *gvar) { @@ -1389,7 +1414,8 @@ void VL_PrintmodexmemInfo(video_t *v) // printf("========================================\n"); 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"); 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"); - printf(" stride: %u ", vga_state.vga_stride); + printf(" vga_stride: %u ", vga_state.vga_stride); + printf("pagestride: %u ", v->page[0].stridew); printf("draw_stride: %u ", vga_state.vga_draw_stride); printf("draw_stride_limit: %u\n", vga_state.vga_draw_stride_limit);