OSDN Git Service

updated copyleft and need to test and fix newer version of open watcom
[proj16/16.git] / src / lib / 16_vlpal.c
index a6af261..f0b8d5f 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
@@ -103,7 +103,7 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, word *ap
        word q=0;\r
        word qq=0;\r
        word a[PAL_SIZE];       //palette array of change values!\r
-       word z=0, aq=0, aa=0, pp=0;\r
+       word z=0, aq=0, aa=0, pp=0, iq=0;//iq=(*i)-q\r
 \r
        //modexWaitBorder();\r
        vga_wait_for_vsync();\r
@@ -127,13 +127,14 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, word *ap
 #endif\r
                outp(PAL_WRITE_REG, qq);  /* start at the beginning of palette */\r
        }\r
+       iq=(*i)-q;\r
        if((*i)<PAL_SIZE && w==0)\r
        {\r
                for(; (*i)<PAL_SIZE; (*i)++)\r
                {\r
                        //if(i%3==0 && (p[i+5]==p[i+4] && p[i+4]==p[i+3] && p[i+3]==p[i+2] && p[i+2]==p[i+1] && p[i+1]==p[i] && p[i+5]==p[i]))\r
-//____           if((qp>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\r
-                       if(((((*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]))\r
+//____           if((qp>0)&&(iq)%3==0 && (p[(iq)]==p[(iq)+3] && p[(iq)+1]==p[(iq)+4] && p[(iq)+2]==p[(iq)+5])) outp(PAL_DATA_REG, p[iq]); else\r
+                       if((((iq)%3==0)) && (p[(iq)]==p[(iq)+3] && p[(iq)+1]==p[(iq)+4] && p[(iq)+2]==p[(iq)+5]))\r
                        {\r
                                w++;\r
                                break;\r
@@ -152,7 +153,7 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, word *ap
                        {\r
                                if(bmp->offset==0 && (*i)<3 && q==0) outp(PAL_DATA_REG, 0);\r
                                else\r
-                               if(qp==0) outp(PAL_DATA_REG, p[(*i)-q]);\r
+                               if(qp==0) outp(PAL_DATA_REG, p[iq]);\r
                                else\r
                                { outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3)+qp)]);\r
 #ifdef BEVERBOSEPALCHECK\r