From: sparky4 Date: Thu, 16 Jul 2015 22:07:57 +0000 (-0500) Subject: facking modex X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=94b2c3169aa6501f14ef021317647259b831d185;p=16.git facking modex modified: 16.exe modified: fontgfx.exe modified: fonttes0.exe modified: maptest.exe modified: palettec.exe modified: pcxtest.exe modified: src/fontgfx.c modified: src/fonttes0.c modified: src/lib/modex16.c modified: src/lib/modex16.h modified: test.exe modified: test2.exe --- diff --git a/16.exe b/16.exe index 3a9097a3..4f7763a7 100644 Binary files a/16.exe and b/16.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index f3aab825..0582b483 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/fonttes0.exe b/fonttes0.exe index 60716ba0..01bc01dd 100644 Binary files a/fonttes0.exe and b/fonttes0.exe differ diff --git a/maptest.exe b/maptest.exe index ec0f0812..cb6dd8c3 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index a86f64bf..533a71d0 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index c45738a7..2e3f94de 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/fontgfx.c b/src/fontgfx.c index 34154f06..d6599e60 100644 --- a/src/fontgfx.c +++ b/src/fontgfx.c @@ -67,6 +67,7 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ screen = modexDefaultPage(); screen.width += (16*2); screen.height += (16*2); +//++++ modexShowPage(&screen); //modexprint(16, 16, 1, 15, "wwww"); //getch(); chx=0; @@ -90,7 +91,8 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ //modexprint(100, 100, 1, 47, 0, "wwww"); getch(); // modexprint(0, 0, 1, 0, colpee, &rose); - modexprint(&screen, 0, 0, 0, 0, colpee, &ibmlogo); +//++++ modexprint(&screen, 0, 0, 0, 0, colpee, &ibmlogo); + modexprintbig(&screen, 0, 0, 1, colpee, 0, "IBM"); // modexprint(0, 0, 1, 0, colpee, ROSE); getch(); modexLeave(); diff --git a/src/fonttes0.c b/src/fonttes0.c index 4365b812..6414f7f3 100644 --- a/src/fonttes0.c +++ b/src/fonttes0.c @@ -171,7 +171,7 @@ void main(int argc, char near *argv[]) //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++; diff --git a/src/lib/modex16.c b/src/lib/modex16.c index ae0bd692..3efba94c 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -942,12 +942,14 @@ no... wait.... no wwww free(pal); } -void modexputPixel(int x, int y, byte color) -{ +void modexputPixel(page_t *page, int x, int y, byte color) +{ + word pageOff = (word) page->data; /* 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: */ + significant bits of the x-coordinate: */ + //modexSelectPlane(PLANE(x)); outp(SC_INDEX, 0x02); outp(SC_DATA, 0x01 << (x & 3)); @@ -955,7 +957,7 @@ void modexputPixel(int x, int y, byte color) offset = (width * y + x) / 4, and write the given color to the plane we selected above. Heed the active page start selection. */ - VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + 0] = color; + VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + pageOff] = color; } @@ -1003,8 +1005,83 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons for(; *str != '\0'; str++) { 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' + __asm { + MOV DI, addr + MOV SI, o + MOV ES, s + SUB AH, AH + MOV AL, c ; the letter + MOV CX, w + MUL CX + ADD SI, AX ;the address of charcter + L1: MOV AX, ES:SI + MOV DS:DI, AX + INC SI + INC DI + DEC CX + JNZ L1 + } + + for(i=0; i>=1; + } + } + chw += xp; + } +} + +void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str) +{ + word i, s, o, w, j, xp; + byte l[1024]; + word addr = (word) l; + word chw=0; + byte c; + + switch(t) + { + case 0: + w=14; + break; + case 1: + w=8; + break; + case 2: + w=8; + break; + case 3: + w=16; + break; + default: + t=3; + w=16; + break; + } + + s=romFonts[t].seg; + o=romFonts[t].off; + + for(; *str != '\0'; str++) + { + c = (*str); + if((c=='\n'/* || c=="\ +"*/)/* || chw>=page->width*/) { chw=0; y+=w; @@ -1034,12 +1111,13 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons xp=0; 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; } } - chw += xp-1; + chw += xp; } } diff --git a/src/lib/modex16.h b/src/lib/modex16.h index f311a69e..122e11e3 100644 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -93,8 +93,9 @@ void modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset); 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 ==========================- */ diff --git a/test.exe b/test.exe index 81771e66..6553fc9e 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 8305d8b5..f33345c9 100644 Binary files a/test2.exe and b/test2.exe differ