X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vlpal.c;h=57a97f0a70e35071cd170571e381bed3d8cea0a0;hb=b8c9d5fcb2b66420bc673f54b14cc5d0ea5283ed;hp=db0f19d668c532b10426e9fe24d8a10a0f77f861;hpb=46ab351125c93564e17aacce420069f865188737;p=16.git diff --git a/src/lib/16_vlpal.c b/src/lib/16_vlpal.c index db0f19d6..57a97f0a 100755 --- a/src/lib/16_vlpal.c +++ b/src/lib/16_vlpal.c @@ -24,15 +24,15 @@ //color checker~ //i want to make another vesion that checks the palette when the palette is being appened~ -void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/) +void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/, global_game_variables_t *gv) { - byte *pal; + byte *pal=&(gv->video.palette); word zz=0; - pal = modexNewPal(); - modexPalSave(pal); + //pal = modexNewPal(); +// modexPalSave(pal); CHKCOLDBGOUT1 //check palette for dups - for(; (*z)palette; word w=0; word q=0; word qq=0; - static word a[PAL_SIZE-3]; //palette array of change values! + static word a[PAL_SIZE]; //palette array of change values! word z=0, aq=0, aa=0, pp=0; //modexWaitBorder(); @@ -107,7 +107,7 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset) if((*i)==0) { memset(a, -1, sizeof(a)); - outp(PAL_WRITE_REG, 1); /* start at the beginning of palette */ + outp(PAL_WRITE_REG, 0); /* start at the beginning of palette */ } else if(qp==0) { @@ -124,9 +124,9 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset) #endif outp(PAL_WRITE_REG, qq); /* start at the beginning of palette */ } - if((*i)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 @@ -179,7 +179,7 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset) printf("1(*i)=%02d\n", (*i)/3);// printf("1z=%02d\n", z/3);// #endif - modexchkcolor(bmp, &q, &a, &aa, &z, i); + modexchkcolor(bmp, &q, &a, &aa, &z, i, gv); #ifdef BEVERBOSEPALCHECK printf("2(*i)=%02d\n", (*i)/3); printf("2z=%02d\n", z/3); @@ -189,7 +189,7 @@ aqpee: while(aq<=aa) { #ifdef BEVERBOSEPALCHECK - printf("a[%02d]=(%d)\n", aq, a[aq]);// +// printf("a[%02d]=(%d)\n", aq, a[aq]);//0000 #endif if(a[aq]==-1) aq++; else { aqoffset++; break; } @@ -253,7 +253,7 @@ printf(" aq=%02d\n", aq);// printf(" aa=%02d\n", aa);// #endif //update the palette~ - VL_palette(bmp, p, &pp, aq, aqoffset); + VL_palette(bmp, p, &pp, aq, aqoffset, gv); (*i)=pp; if(aq