-void modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqpp);
-void modexPalUpdate2(byte *p);
-void modexPalUpdate3(byte *p);
-void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i);
-void modexWaitBorder();
+void modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset);
+void modexPalUpdate1(byte *p);
+void modexPalUpdate0(byte *p);
+void modexPalOverscan(byte *p, word col);
+void modexchkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/);
+void modexputPixel(page_t *page, int x, int y, byte color);
+byte modexgetPixel(page_t *page, int x, int y);
+static inline void modexwritepixel(page_t *page, int x, int y, word addr, byte color)
+{
+ /* Each address accesses four neighboring pixels, so set
+ Write Plane Enable according to which pixel we want
+ to modify. The plane is determined by the two least
+ significant bits of the x-coordinate: */
+ modexSelectPlane(PLANE(x));
+ //outp(SC_INDEX, 0x02);
+ //outp(SC_DATA, 0x01 << (x & 3));