From: sparky4 Date: Sat, 4 Apr 2015 00:55:08 +0000 (-0500) Subject: still working on it! wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=5fc15e3d34041d3e1192ea2f17a9ed13df097806;p=16.git still working on it! wwww modified: pcxtest.exe modified: scroll.exe modified: src/lib/modex16.c modified: src/lib/modex16.h modified: src/pcxtest.c modified: src/scroll.c modified: test.exe modified: test2.exe --- diff --git a/pcxtest.exe b/pcxtest.exe index 8cd0c010..aaa5caa7 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.exe b/scroll.exe index 7bf4adf6..1f9bd58c 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/modex16.c b/src/lib/modex16.c index b1cd806a..4d10ab58 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,13 +635,18 @@ 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)); + printf(" (*i)=%d bmp->offset=%d aqoffset=%d\n", (*i)/3, (bmp->offset), aqoffset); + printf(" %d's color=%d\n", (*i)/3, (*i)-(bmp->offset*3));//+(aqoffset*3) + outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3))]); + (*i)++; break; } else @@ -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; lqdata->offset=(paloffset/3); - modexPalUpdate(map.tiles->data, &paloffset, 0/*, 0*/); + modexPalUpdate(map.tiles->data, &paloffset, 0, 0); printf("\n====\n"); printf("0 paloffset= %d\n", paloffset/3); printf("====\n\n"); @@ -548,9 +548,9 @@ void main() { if(keyp(25)){ pdump(bg); pdump(spri); } if(keyp(24)){ modexPalUpdate3(gpal); paloffset=0; pdump(bg); pdump(spri); } if(keyp(22)){ - paloffset=0; modexPalBlack(); modexPalUpdate(&ptmp, &paloffset, 0/*, 0*/); + paloffset=0; modexPalBlack(); modexPalUpdate(&ptmp, &paloffset, 0, 0); printf("1paloffset = %d\n", paloffset/3); - modexPalUpdate(map.tiles->data, &paloffset, 0/*, 0*/); + modexPalUpdate(map.tiles->data, &paloffset, 0, 0); printf("2paloffset = %d\n", paloffset/3); pdump(bg); pdump(spri); } diff --git a/test.exe b/test.exe index 8e7ac3bf..129cd162 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 25c682d0..4ac34702 100644 Binary files a/test2.exe and b/test2.exe differ