]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
added easter egg and palette updater stress test.... apparently ther eis a bug....
[16.git] / src / lib / modex16.c
index 78b5c36977e5ceaea1e1c4f76d66d53f4a172fdf..bcf98c1187adff0119947cd3a992eece926cdae8 100644 (file)
@@ -593,7 +593,7 @@ modexPalWhite() {
 void
 modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqpp)
 {
-       byte *p = bmp->palette;
+       const byte *p = bmp->palette;
        word w=0;
        word q=0;
        word qq=0;
@@ -663,6 +663,8 @@ printf("    %d [%d]\n",((((*i)+((aqpp-ii)*3))+((aqpp+ii)*3))-(bmp->offset*3))/3, p[
                        }
                        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))]);
                        }
@@ -827,6 +829,23 @@ modexPalUpdate2(byte *p)
        }
 }
 
+void
+modexPalUpdate3(byte *p)
+{
+       int i;
+       modexWaitBorder();
+       outp(PAL_WRITE_REG, 0);  /* start at the beginning of palette */
+       for(i=0; i<PAL_SIZE/2; i++)
+       {
+               outp(PAL_DATA_REG, rand());
+       }
+       modexWaitBorder();          /* waits one retrace -- less flicker */
+       for(; i<PAL_SIZE; i++)
+       {
+               outp(PAL_DATA_REG, rand());
+       }
+}
+
 //color checker~
 //i want to make another vesion that checks the palette when the palette is being appened~
 void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z)