From: sparky4 Date: Sun, 14 Jun 2015 23:28:21 +0000 (-0500) Subject: font rendering = fail X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=51b3ed042a486cbede892743b0770d904d6006d7 font rendering = fail modified: Project 16.bfproject modified: maptest.exe modified: pcxtest.exe modified: scroll.exe modified: src/lib/modex16.c modified: src/lib/modex16.h modified: test.exe modified: test2.exe --- diff --git a/Project 16.bfproject b/Project 16.bfproject index d992d194..efc7e591 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -8,14 +8,14 @@ openfiles: /dos/z/16/src/fmemtest.c:116:0:0: openfiles: /dos/z/16/src/emmtest.c:732:0:0: openfiles: /dos/z/16/src/emsdump.c:456:0:0: openfiles: /dos/z/16/src/maptest.c:463:0:0: -openfiles: /dos/z/16/src/maptest0.c:506:19:0: +openfiles: /dos/z/16/src/maptest0.c:366:19:0: openfiles: /dos/z/16/src/test.c:0:0:0: openfiles: /dos/z/16/src/test2.c:0:0:0: openfiles: /dos/z/16/src/lib/planar.h:602:0:0: openfiles: /dos/z/16/src/lib/PLANAR.C:0:0:0: openfiles: /dos/z/16/src/lib/bitmap.c:294:0:0: openfiles: /dos/z/16/src/lib/bitmap.h:257:0:0: -openfiles: /dos/z/16/src/lib/modex16.c:23968:23029:1: +openfiles: /dos/z/16/src/lib/modex16.c:23351:22964:1: openfiles: /dos/z/16/src/lib/modex16.h:2566:1791:0: openfiles: /dos/z/16/src/lib/dos_kb.c:3264:2598:0: openfiles: /dos/z/16/src/lib/dos_kb.h:0:0:0: diff --git a/maptest.exe b/maptest.exe index 75de896a..aa7f662b 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index a6bd559d..a5970fd5 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.exe b/scroll.exe index aa6367d6..9667cb30 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 9b954529..b25d8674 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -8,6 +8,12 @@ byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ +word text_mask[16] = { + 0x0002, 0x0102, 0x0202, 0x0302, + 0x0402, 0x0502, 0x0602, 0x0702, + 0x0802, 0x0902, 0x0A02, 0x0B02, + 0x0C02, 0x0D02, 0x0E02, 0x0F02 +}; static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); static byte tmppal[PAL_SIZE]; @@ -912,17 +918,32 @@ byte far *bios_8x8_font(void) /***************************************************************************** *****************************************************************************/ void bputs(page_t *pee, int x, int y, const char *s) -{ +{ + //int i, skip; byte far *font; - byte far *fontoffset; + byte far *font_pntr; + //byte c, temp; font = bios_8x8_font(); + //skip = 2 - ((pee->width/4) << 3); //printf("font=%Fp\n", font); for(; *s != '\0'; s++) { //src.raster = font + 8 * (*s); //BLOODY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111111111111!!!11!!11!111!11!!1111!!111!11!!1!!!11!11!!1!!111!11!! // (*(bmp->data)) = (*(font + 8 * (*s))); + font_pntr = (*(font + 8 * (*s))); +// font_pntr = font + (c << 3); +// i=8; +// while (i--) { +// temp = *font_pntr++; +// outpw(SC_INDEX, text_mask[temp & 0x0F]); + //*vga_ptr++ = color; + +// outpw(SC_INDEX, text_mask[temp >> 4]); + //*vga_ptr-- = color; + //vga_ptr += widthBytes; +// } //printf("fontoffset=%Fp\n", font + 8 * (*s)); //printf("*fontoffset=%s\n", *(font + 8 * (*s))); @@ -934,8 +955,9 @@ void bputs(page_t *pee, int x, int y, const char *s) // printf("%x\n", (*(font + 8 * (*s)))); //_fmemset(VGA, *(font + 8 * (*s)), _msize(font)); //draw text?!?! wwww + modexClearRegion(pee, x, y, 8, 8, 4); - x += 8; +// x += 8; } // printf("\n"); } diff --git a/src/lib/modex16.h b/src/lib/modex16.h index b81fb36c..f3064d1b 100644 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -74,6 +74,7 @@ void bputs(page_t *pee, int x, int y, const char *s); /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ +extern word text_mask[16]; #define SCREEN_SEG 0xa000 #define VIDEO_INT 0x10 #define SET_MODE 0x00 diff --git a/test.exe b/test.exe index ec3ea875..410e743c 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 92bb6efb..2809a69c 100644 Binary files a/test2.exe and b/test2.exe differ