From: sparky4 Date: Tue, 14 Jul 2015 16:01:43 +0000 (-0500) Subject: why dose a ! appear at the end? X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=a6b0748477dd54ae822c4204c848468bca230c2a;p=16.git why dose a ! appear at the end? modified: 16.exe modified: fontgfx.exe modified: fonttes0.exe modified: maptest.exe modified: palettec.exe modified: pcxtest.exe modified: src/fontgfx.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 7ec60bb2..b74b601a 100644 Binary files a/16.exe and b/16.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index dc4a2a37..796ed4c3 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/fonttes0.exe b/fonttes0.exe index 52ebe384..0f5bfce7 100644 Binary files a/fonttes0.exe and b/fonttes0.exe differ diff --git a/maptest.exe b/maptest.exe index 9703973b..342a6bea 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index 496ce523..96e18a07 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index a2536aa6..c7abb981 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/fontgfx.c b/src/fontgfx.c index ed9dbd50..14184577 100644 --- a/src/fontgfx.c +++ b/src/fontgfx.c @@ -29,25 +29,29 @@ void main(int argc, char near *argv[]) { //JMOJI byte e; - word chx, chy; + word chx, chy, colpee; textInit(); modexEnter(); //modexprint(16, 16, 1, 15, "wwww"); //getch(); chx=0; - chy=0; - for(e=''; e<=''; e++) - { - modexprint(chx, chy, 1, 15, &e); - chx+=8; - if(chx+8>=SCREEN_WIDTH) - { - chx=0; - chy+=8; - } - } + chy=0; + colpee=0; + for(e=' '; e<='~'; e++) + { + if(chx+8>(SCREEN_WIDTH/2)-1) + { + chx=0; + chy+=8; + modexprint(200, 200, 1, 47, 0, &e); + } + modexprint(chx, chy, 1, 0, colpee, &e); + chx+=9; + colpee++; + } + modexprint(100, 100, 1, 47, 0, "wwww"); getch(); modexLeave(); printf("\n\n%u %c", ''); - //printf("\n%c", '€ '); + printf("\n%c\n", e); } diff --git a/src/lib/modex16.c b/src/lib/modex16.c index acc0058b..1730d5eb 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -969,10 +969,10 @@ byte modexgetPixel(int x, int y) } -void modexprint(word x, word y, word t, word col, const byte *str) +void modexprint(word x, word y, word t, word col, word bgcol, const byte *str) { word i, s, o, w, j, xp; - byte l[16]; + byte l[1024]; word addr = (word) l; word chw=0; byte c; @@ -1002,6 +1002,7 @@ void modexprint(word x, word y, word t, word col, const byte *str) for(; *str != '\0'; str++) { + if(chw>=SCREEN_WIDTH-1) y+=w; c = *(str); //load the letter 'A' __asm { @@ -1027,12 +1028,12 @@ void modexprint(word x, word y, word t, word col, const byte *str) xp=0; while(j) { - modexputPixel(x+xp+chw, y+i, l[i] & j ? col:0); + modexputPixel(x+xp+chw, y+i, l[i] & j ? col:bgcol); xp++; j>>=1; } } - chw += 8; + chw += xp; } } diff --git a/src/lib/modex16.h b/src/lib/modex16.h index 363004b3..61e75d9c 100644 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -94,7 +94,7 @@ 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 modexprint(word x, word y, word t, word col, const byte *str); +void modexprint(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 acbbfab1..17d922a3 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index b6d00f54..f9dc5174 100644 Binary files a/test2.exe and b/test2.exe differ