]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
wwww workings!! wwww
[16.git] / src / lib / modex16.c
index a7f37c4512b94bb747d90319730c20db6c7112d9..fa13d3658ccc16987c8127c7e0a90d17c0d2ec40 100644 (file)
@@ -593,13 +593,12 @@ modexPalWhite() {
 void
 modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
 {
-//---- static word count=0;
        byte *p = bmp->palette;
        word w=0;
        word q=0;
        word qq=0;
        //word ii;
-       static word a[PAL_SIZE];
+       static word a[PAL_SIZE/3];      //palette array of change values!
        word z=0, aq=0, aa=0, pp=0;
        //sword aqpw;
 
@@ -645,8 +644,8 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
                                //printf("                                              (*i)=%d\n", (*i)/3);
                                //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)
-                               outp(PAL_DATA_REG, p[((a[qp])*3)]);// fix this shit!
+//0000                         printf("                %d's color=%d\n", (*i), (a[qp])*3);//+(aqoffset*3)
+//0000                         outp(PAL_DATA_REG, p[((a[qp])*3)]);// fix this shit!
                                if((*i)+1==(qp*3)+3){ w++; /*(*i)++;*/ break; }
                        }
                        else
@@ -673,10 +672,6 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
                        }
                        else if(qp>0 && (*i)>=(qp*3) && (*i)<((qp*3)+3))
                        {
-                               /*
-                                                                       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("        (*i)=%d bmp->offset*3=%d        (qp*3)=%d\n", (*i), (bmp->offset), (qp));
@@ -721,6 +716,28 @@ aqpee:
 
        for(lq=0; lq<bufSize; lq++)
        {
+                               /*
+                                                                       note to self
+                                                                       use a[qp] instead of bmp->offset for this spot!
+                                                                       NO! wwww
+                               */
+
+
+
+
+                               /*
+                               Facking bloody point the values of the changed palette to correct values.... major confusion! wwww
+                               */
+
+
+
+
+
+               //(offset/bmp->offset)*bmp->offset
+
+
+               printf("%02d ",bmp->data[lq]+bmp->offset);
+               if(lq > 0 && lq%bmp->width==0) printf("\n");
                //printf("%02d_", bmp->data[lq]+bmp->offset);
                /*if(bmp->data[lq]+bmp->offset==aq)
                {
@@ -806,14 +823,16 @@ void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, wor
                printf("chkcolor start~\n");
                printf("1                               (*z): %d\n", (*z)/3);
                printf("1                               (*i): %d\n", (*i)/3);
+//             printf("1 offset of color in palette    (*q): %d\n", (*q)/3);
+               printf("wwwwwwwwwwwwwwww\n");
                //check palette for dups
                for(; (*z)<PAL_SIZE; (*z)+=3)
                {
-//                     printf("\n              z: %d\n", (*z));
-//                     printf("                q: %d\n", (*q));
-//                     printf("                z+q: %d\n\n", ((*z)+(*q)));
-                       if((*z)%3==0)
-                       {
+                       //printf("\n            z: %d\n", (*z));
+                       //printf("              q: %d\n", (*q));
+                       //printf("              z+q: %d\n\n", ((*z)+(*q)));
+                       //if((*z)%3==0)
+                       //{
 //----                         if(pal[(*z)]==pal[(*z)+3] && pal[(*z)+1]==pal[(*z)+4] && pal[(*z)+2]==pal[(*z)+5])
                                if((*z)==(*i))
                                {
@@ -824,11 +843,10 @@ void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, wor
                                }
                                else for(zz=0; zz<(*q); zz+=3)
                                {
-                                       //zq=(zz+(q-3));
                                        //printf("zz: %02d\n", zz/3);
                                        if(zz%3==0)
                                        {
-                                               if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5])
+                                               if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5])    //break if duplicate colors found in palette because it have reached the end of the current data of the palette
                                                {
 //                                                     (*z)-=3;
 //                                                     (*i)-=3;
@@ -845,9 +863,20 @@ void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, wor
 //                                                     printf("        z : %d  [%02d][%02d][%02d] offset value~\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);
 //++++                                                 (*i)--;
 //                                                     (*z)--;
-                                                       a[(((*z)+(*q))/3)]=zz/3;
-                                                       (*aa)=(((*z)+(*q))/3);
-                                                       printf("!!                              a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);
+                                                       //expand dong here
+/*
+planned features that i plan to implement~
+image that has values on the pallete list!
+wwww
+no... wait.... no wwww
+*/
+                                                       //for(zzii=0; zzii<3; zzii++)
+                                                       //{
+                                                               //printf("z+q: %d\n\n", ((*z)+(*q)));
+                                                               a[(((*z)+(*q)))]=zz;
+                                                       //}
+                                                       (*aa)=(((*z)+(*q)));
+                                                       printf("!!                                      a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);
 //                                                     printf("\n              aa: %d\n\n", (*aa));
 //                                                     printf("        a[%02d]=(%02d) offset array i think the palette should be updated again~\n", ((*z)+(*q))/3, a[((*z)+(*q))/3]);
 //                                                     printf("wwwwwwwwwwwwwwww\n\n");
@@ -863,13 +892,11 @@ void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, wor
                                                //printf("[%d]", (zz+q));
                                        }
                                }
-                               //printf("\nz:  %d\n", z);
-                               //printf("q:    %d\n", q);
-                               //printf("zz:   %d\n", zz);
-                       }
                }
+               printf("wwwwwwwwwwwwwwww\n");
                printf("2                               (*z): %d\n", (*z)/3);
                printf("2                               (*i): %d\n", (*i)/3);
+//             printf("2 offset of color in palette    (*q): %d\n", (*q)/3);
                printf("chkcolor end~\n");
                free(pal);
 }