From c7ae7cd0460c247860178af759be514bf514e02f Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 14 Feb 2017 11:47:34 -0600 Subject: [PATCH] wwww reverted because zcroll broke --- src/lib/16_vl.c | 17 +++-------------- src/lib/16_vlpal.c | 12 ++++++------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 881239de..71c5667d 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -689,18 +689,7 @@ modexLoadPalFile(byte *filename, byte **palette) { void VL_LoadPalFile(const char *filename, byte *palette) { - int fd; - - fd = open(filename,O_RDONLY|O_BINARY); - if (fd >= 0) { - word i; - - read(fd,palette, PAL_SIZE); - close(fd); - - vga_palette_lseek(0); - for (i=0;i < 256;i++) vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2); - } + VL_LoadPalFilewithoffset(filename, palette, 0); } void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o) @@ -714,8 +703,8 @@ void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o) read(fd,palette, PAL_SIZE); close(fd); - vga_palette_lseek(o); - for (i=o;i < 256-o;i++) vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2); + vga_palette_lseek(1+o); + for (i=o;i < 255-o;i++) vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2); } } diff --git a/src/lib/16_vlpal.c b/src/lib/16_vlpal.c index 2f155f03..3a809828 100755 --- a/src/lib/16_vlpal.c +++ b/src/lib/16_vlpal.c @@ -32,7 +32,7 @@ void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word modexPalSave(pal); CHKCOLDBGOUT1 //check palette for dups - for(; (*z)0)&&((*i)-q)%3==0 && (p[((*i)-q)]==p[((*i)-q)+3] && p[((*i)-q)+1]==p[((*i)-q)+4] && p[((*i)-q)+2]==p[((*i)-q)+5])) outp(PAL_DATA_REG, p[(*i)-q]); else -- 2.39.5