X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=blobdiff_plain;f=src%2Flib%2F16_vlpal.c;h=691171808dcac8a43a8e43d0d7f3f98d5b687183;hp=032f2b7a947c7b875ae0a9daba44d01353bd73e2;hb=ce1c7884eb2b6e2e3b468a7f661abd2962a15122;hpb=0fafba3a1ca84e8bb74c995cc42e397131f2bcd6 diff --git a/src/lib/16_vlpal.c b/src/lib/16_vlpal.c index 032f2b7a..69117180 100755 --- a/src/lib/16_vlpal.c +++ b/src/lib/16_vlpal.c @@ -92,15 +92,18 @@ no... wait.... no wwww //free(pal); } +//what is *i, w, q, qq, z, aq, aa, pp, qp, and aqoffset... +//pp is related to i + void -VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, global_game_variables_t *gv) +VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, word *apal, global_game_variables_t *gv) { //byte *p = bmp->palette; word w=0; word q=0; word qq=0; - static word a[PAL_SIZE]; //palette array of change values! - word z=0, aq=0, aa=0, pp=0; + word a[PAL_SIZE]; //palette array of change values! + word z=0, aq=0, aa=0, pp=0, iq=0;//iq=(*i)-q //modexWaitBorder(); vga_wait_for_vsync(); @@ -124,13 +127,14 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, global_g #endif outp(PAL_WRITE_REG, qq); /* start at the beginning of palette */ } + iq=(*i)-q; 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 - 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])) +//____ 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 + if((((iq)%3==0)) && (p[(iq)]==p[(iq)+3] && p[(iq)+1]==p[(iq)+4] && p[(iq)+2]==p[(iq)+5])) { w++; break; @@ -149,7 +153,7 @@ VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, global_g { if(bmp->offset==0 && (*i)<3 && q==0) outp(PAL_DATA_REG, 0); else - if(qp==0) outp(PAL_DATA_REG, p[(*i)-q]); + if(qp==0) outp(PAL_DATA_REG, p[iq]); else { outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3)+qp)]); #ifdef BEVERBOSEPALCHECK @@ -189,7 +193,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 +257,7 @@ printf(" aq=%02d\n", aq);// printf(" aa=%02d\n", aa);// #endif //update the palette~ - VL_palette(bmp, p, &pp, aq, aqoffset, gv); + VL_palette(bmp, p, &pp, aq, aqoffset, &a, gv); (*i)=pp; if(aq