screen = modexDefaultPage();\r
screen.width += (16*2);\r
screen.height += (16*2);\r
+//++++ modexShowPage(&screen);\r
//modexprint(16, 16, 1, 15, "wwww");\r
//getch();\r
chx=0;\r
//modexprint(100, 100, 1, 47, 0, "wwww");\r
getch();\r
// modexprint(0, 0, 1, 0, colpee, &rose);\r
- modexprint(&screen, 0, 0, 0, 0, colpee, &ibmlogo);\r
+//++++ modexprint(&screen, 0, 0, 0, 0, colpee, &ibmlogo);\r
+ modexprintbig(&screen, 0, 0, 1, colpee, 0, "IBM");\r
// modexprint(0, 0, 1, 0, colpee, ROSE);\r
getch();\r
modexLeave();\r
//printf("%02x\n", l[i] & j);
//modexPutPixel(xp, i, l[i] & j ? 15:0);
//modexpixelwr(xp, i, 0, l[i] & j ? 15:0);
- modexputPixel(xp, i, l[i] & j ? 15:0);
+ modexputPixel(&page, xp, i, l[i] & j ? 15:0);
//modexClearRegion(&page, xp*4, i*4, 4, 4, l[i] & j ? 15:0);
//while(!getch());
xp++;
free(pal);\r
}\r
\r
-void modexputPixel(int x, int y, byte color)\r
-{\r
+void modexputPixel(page_t *page, int x, int y, byte color)\r
+{
+ word pageOff = (word) page->data;\r
/* Each address accesses four neighboring pixels, so set\r
Write Plane Enable according to which pixel we want\r
to modify. The plane is determined by the two least\r
- significant bits of the x-coordinate: */\r
+ significant bits of the x-coordinate: */
+ //modexSelectPlane(PLANE(x));\r
outp(SC_INDEX, 0x02);\r
outp(SC_DATA, 0x01 << (x & 3));\r
\r
offset = (width * y + x) / 4, and write the given\r
color to the plane we selected above. Heed the active\r
page start selection. */\r
- VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + 0] = color;\r
+ VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + pageOff] = color;\r
\r
}\r
\r
for(; *str != '\0'; str++)\r
{
c = (*str);
- if(c=='\n' || c=="\
-" || chw>=page->width-1)
+ if((c=='\n'/* || c=="\
+"*/) || chw
+>=page->width)
+ {
+ chw=0;
+ y+=w;
+ continue;
+ }
+ //load the letter 'A'\r
+ __asm {\r
+ MOV DI, addr\r
+ MOV SI, o\r
+ MOV ES, s\r
+ SUB AH, AH\r
+ MOV AL, c ; the letter\r
+ MOV CX, w\r
+ MUL CX\r
+ ADD SI, AX ;the address of charcter\r
+ L1: MOV AX, ES:SI\r
+ MOV DS:DI, AX\r
+ INC SI\r
+ INC DI\r
+ DEC CX\r
+ JNZ L1\r
+ }
+\r
+ for(i=0; i<w; i++)
+ {\r
+ j=1<<8;
+ xp=0;\r
+ while(j)
+ {
+ modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);
+ xp++;
+ j>>=1;
+ }
+ }\r
+ chw += xp;\r
+ }\r
+}
+
+void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str)\r
+{
+ word i, s, o, w, j, xp;
+ byte l[1024];\r
+ word addr = (word) l;
+ word chw=0;
+ byte c;
+
+ switch(t)\r
+ {\r
+ case 0:
+ w=14;\r
+ break;\r
+ case 1:
+ w=8;\r
+ break;\r
+ case 2:
+ w=8;\r
+ break;\r
+ case 3:
+ w=16;\r
+ break;\r
+ default:
+ t=3;\r
+ w=16;\r
+ break;\r
+ }
+\r
+ s=romFonts[t].seg;\r
+ o=romFonts[t].off;
+\r
+ for(; *str != '\0'; str++)\r
+ {
+ c = (*str);
+ if((c=='\n'/* || c=="\
+"*/)/* || chw>=page->width*/)
{
chw=0;
y+=w;
xp=0;\r
while(j)
{
- modexputPixel(x+xp+chw, y+i, l[i] & j ? col:bgcol);
+ //modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);
+ modexClearRegion(page, (x+xp+chw)*8, (y+i)*8, 8, 8, l[i] & j ? col:bgcol);
xp++;
j>>=1;
}
}\r
- chw += xp-1;\r
+ chw += xp;\r
}\r
}\r
\r
void modexPalUpdate1(byte *p);
void modexPalUpdate0(byte *p);
void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/);
-void modexputPixel(int x, int y, byte color);
+void modexputPixel(page_t *page, int x, int y, byte color);
void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);
+void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);
void modexWaitBorder();
/* -======================= Constants & Vars ==========================- */