]> 4ch.mooo.com Git - 16.git/commitdiff
still working on it! wwww
authorsparky4 <sparky4@cock.li>
Sat, 4 Apr 2015 00:55:08 +0000 (19:55 -0500)
committersparky4 <sparky4@cock.li>
Sat, 4 Apr 2015 00:55:08 +0000 (19:55 -0500)
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

pcxtest.exe
scroll.exe
src/lib/modex16.c
src/lib/modex16.h
src/pcxtest.c
src/scroll.c
test.exe
test2.exe

index 8cd0c01052d378c24a57fb48b2dd90494aed444a..aaa5caa78f0f03291ce7884af250e58397cfc494 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 7bf4adf64b131e9ee308234c8b5a0e399956a5d6..1f9bd58c093db4176a843ccd64f4e03ac156ed56 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index b1cd806af4e236926b7c8f3d6062a5d7726a36bd..4d10ab58e75ae9fca19192ccda0e4683a55c0ac6 100644 (file)
@@ -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; lq<bufSize; lq++)
@@ -742,7 +753,7 @@ aqpee:
 //printf("             aa=%02d\n", aa);
 
        //update the palette~
-       modexPalUpdate(bmp, &pp, aq/*, apee*/);
+       modexPalUpdate(bmp, &pp, aq, aqoffset);
        (*i)=pp;
 
        if(aq<aa){ pp=q; aq++; goto aqpee; }
index a4be22f6df889805db5cca3f37c94d67a9a2edcf..47c88325de221069abedf2707a36abc21f502049 100644 (file)
@@ -55,7 +55,7 @@ void modexPalBlack();
 void modexPalWhite();
 
 /* utility functions */
-void modexPalUpdate(bitmap_t *bmp, word *i, word qp/*, word aqpp*/);
+void modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset);
 void modexPalUpdate2(byte *p);
 void modexPalUpdate3(byte *p);
 void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/);
index 7efc3fad7dee7ae3aada53c1852d8ee167fc0b88..f735a5597e2561044f64406e85cd453c41e314cd 100644 (file)
@@ -68,7 +68,7 @@ void main() {
     modexEnter();\r
 \r
     /* fix up the palette and everything */\r
-    modexPalUpdate(&bmp, 0, 0/*, 0*/);\r
+    modexPalUpdate(&bmp, 0, 0, 0);\r
 \r
     /* clear and draw one sprite and one bitmap */\r
     modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
index dc783edba44eaa3e80852148cc76905177a05566..263b66027e6ce2b990eee5e8c17e4cd657cce3ec 100644 (file)
@@ -184,11 +184,11 @@ void main() {
        modexPalBlack();        //reset the palette~
 //     printf("Total used @ before palette initiation:         %zu\n", oldfreemem-GetFreeSize());
        ptmp.offset=(paloffset/3);
-       modexPalUpdate(&ptmp, &paloffset, 0/*, 0*/);
+       modexPalUpdate(&ptmp, &paloffset, 0, 0);
        //printf("      %d\n", sizeof(ptmp.data));
        //printf("1:    %d\n", paloffset);
        map.tiles->data->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); }
 
index 8e7ac3bf138ebdd870d2fcf7c290fe88d332707b..129cd162e54940c8b61a9b933b5d25331a689296 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 25c682d08aaedb2f6ddb6296ed908bd5bd438a52..4ac34702f79cacee6d564a7b2b9b1b919b2aff0a 100644 (file)
Binary files a/test2.exe and b/test2.exe differ