X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=e2c95ac95a018d654725758021d594f872f29228;hb=02dd99850b12a31480e011885a8299a0e24f7dd8;hp=b1cd806af4e236926b7c8f3d6062a5d7726a36bd;hpb=99151323f12c6457ef6c902d6d9ed9670d0122bf;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index b1cd806a..e2c95ac9 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -591,7 +591,7 @@ modexPalWhite() { /* utility */ void -modexPalUpdate(bitmap_t *bmp, word *i, word qp/*, word aqpp*/) +modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset) { //---- static word count=0; byte *p = bmp->palette; @@ -600,7 +600,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp/*, word aqpp*/) word qq=0; //word ii; static word a[PAL_SIZE/3]; - word z=0, aq=0, aa=0, pp=0;//, apee=0; + word z=0, aq=0, aa=0, pp=0; //sword aqpw; //printf("1 (*i)=%02d\n", (*i)/3); @@ -635,21 +635,26 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp/*, word aqpp*/) w++; break; } - else if(qp>0 && (*i)==(qp*3)) + else if(qp>0 && (*i)>=(qp*3) && (*i)<((qp*3)+3)) { - (*i)++; + /* + note to self + use a[qp] instead of bmp->offset for this spot! + */ //printf("qp=%d\n", qp); //printf(" (*i)=%d\n", (*i)/3); - //printf(" %d's color=%d\n", (*i)/3, ((*i)-(bmp->offset*3))); - //printf(" %d's color2=%d\n", (*i)/3, ((*i)-(bmp->offset*3))-(qp*3)); - break; + //for(w=(*i); w<()){ + printf(" (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]); + printf(" %d's color=%d\n", (*i), (a[qp]*3)+(aqoffset*3));//+(aqoffset*3) + outp(PAL_DATA_REG, p[(a[qp]*3)+(aqoffset*3)]); + if((*i)+1==(qp*3)+3){ /*(*i)++;*/ break; } } else { if(bmp->offset==0 && (*i)<3 && q==0) outp(PAL_DATA_REG, 0); else if(qp==0) outp(PAL_DATA_REG, p[(*i)-q]); - else outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3))]); + else outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3)/*+(aqoffset*3)*/)]); } } //if(qp>0) printf("qp=%d\n", qp); @@ -666,19 +671,25 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp/*, word aqpp*/) w++; break; } - else if(qp>0 && (*i)==(qp*3)) + else if(qp>0 && (*i)>=(qp*3) && (*i)<((qp*3)+3)) { - (*i)++; + /* + note to self + use a[qp] instead of bmp->offset for this spot! + */ //printf("qp=%d\n", qp); //printf(" (*i)=%d\n", (*i)/3); - //printf(" %d's color=%d\n", (*i)/3, ((*i)-(bmp->offset*3))); + printf(" (*i)=%d bmp->offset*3=%d (qp*3)=%d\n", (*i), (bmp->offset), (qp)); + printf(" %d's color=%d\n", (*i)/3, ((*i)-(bmp->offset)+(qp*3))); //printf(" %d's color2=%d\n", (*i)/3, ((*i)-(bmp->offset*3))-(qp*3)); + //outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3))+()]); + (*i)++; break; } else { if(qp==0) outp(PAL_DATA_REG, p[(*i)-q]); - else outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3))]); + else outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3))+(qp*3)]); } } //printf(" (*i)=%d\n", (*i)/3); @@ -695,7 +706,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp/*, word aqpp*/) pp = q; //printf("1(*i)=%02d\n", (*i)/3); //printf("1z=%02d\n", z/3); - chkcolor(bmp, &q, &a, &aa, &z, i/*, &aqpp*/); + chkcolor(bmp, &q, &a, &aa, &z, i); //printf("2(*i)=%02d\n", (*i)/3); //printf("2z=%02d\n", z/3); @@ -705,7 +716,7 @@ aqpee: { // printf("a[%02d]=(%d)\n", aq, a[aq]); if(a[aq]==-1) aq++; - else break; //{ apee++; break; } + else { aqoffset++; break; } } for(lq=0; lq