From: sparky4 Date: Tue, 14 Jul 2015 13:27:39 +0000 (-0500) Subject: HOLY SHIT I GOT FONTS TO RENDER!!! X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=b853220e4c3600b7d3b06b1888ec34269e96ceb6;p=16.git HOLY SHIT I GOT FONTS TO RENDER!!! modified: 16.exe new file: fontgfx.exe modified: fonttes0.exe modified: makefile modified: maptest.exe modified: palettec.exe modified: pcxtest.exe new file: 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 9017de37..7ec60bb2 100644 Binary files a/16.exe and b/16.exe differ diff --git a/fontgfx.exe b/fontgfx.exe new file mode 100644 index 00000000..d3f896aa Binary files /dev/null and b/fontgfx.exe differ diff --git a/fonttes0.exe b/fonttes0.exe index 6a0d03e6..52ebe384 100644 Binary files a/fonttes0.exe and b/fonttes0.exe differ diff --git a/makefile b/makefile index 20796d08..eed5450f 100644 --- a/makefile +++ b/makefile @@ -22,10 +22,10 @@ JSMNLIB=$(SRCLIB)jsmn$(DIRSEP) EXMMLIB=$(SRCLIB)exmm$(DIRSEP) WCPULIB=$(SRCLIB)wcpu$(DIRSEP) -16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16text.$(OBJ) 16_ca.$(OBJ) -GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) +16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16_ca.$(OBJ) +GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) -all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe inputest.exe exmmtest.exe fonttes0.exe +all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe inputest.exe exmmtest.exe fonttes0.exe fontgfx.exe # #executables @@ -49,14 +49,17 @@ fonttest.exe: fonttest.$(OBJ) 16.lib fonttes0.exe: fonttes0.$(OBJ) 16.lib wcl $(FLAGS) fonttes0.$(OBJ) 16.lib +fontgfx.exe: fontgfx.$(OBJ) 16.lib + wcl $(FLAGS) fontgfx.$(OBJ) 16.lib + inputest.exe: inputest.$(OBJ) 16.lib wcl $(FLAGS) inputest.$(OBJ) 16.lib pcxtest.exe: pcxtest.$(OBJ) gfx.lib wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -palettec.exe: palettec.$(OBJ) modex16.$(OBJ) - wcl $(FLAGS) palettec.$(OBJ) modex16.$(OBJ) +palettec.exe: palettec.$(OBJ) 16.lib + wcl $(FLAGS) palettec.$(OBJ) 16.lib maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) 16.lib wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) 16.lib @@ -115,6 +118,9 @@ fonttest.$(OBJ): $(SRC)fonttest.c fonttes0.$(OBJ): $(SRC)fonttes0.c wcl $(FLAGS) -c $(SRC)fonttes0.c +fontgfx.$(OBJ): $(SRC)fontgfx.c + wcl $(FLAGS) -c $(SRC)fontgfx.c + inputest.$(OBJ): $(SRC)inputest.c wcl $(FLAGS) -c $(SRC)inputest.c diff --git a/maptest.exe b/maptest.exe index f267d6cd..9703973b 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index 81fd61aa..496ce523 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index 61cc8d88..a2536aa6 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/fontgfx.c b/src/fontgfx.c new file mode 100644 index 00000000..85fb555b --- /dev/null +++ b/src/fontgfx.c @@ -0,0 +1,35 @@ +/* Project 16 Source Code~ + * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * + * This file is part of Project 16. + * + * Project 16 is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Project 16 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +#include +#include +#include "lib/types.h" +//#include "lib/16text.h" +#include "lib/modex16.h" + +void main(int argc, char near *argv[]) +{ + textInit(); + modexEnter(); + modexprint(16, 16, 1, 15, "wwww"); + getch(); + modexLeave(); +} diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 4c127c73..91f83d6e 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -969,14 +969,40 @@ byte modexgetPixel(int x, int y) } -void bputs(word x, unsigned y, , const char *s) +void modexprint(word x, word y, word t, word col, const byte *str) { - int j; - word s, o, t, w; - word addr = (word) l; + word i, s, o, w, j, xp; + char l[16]; + 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; + o=romFonts[t].off; + for(; *str != '\0'; str++) + { + c = *(str); //load the letter 'A' __asm { MOV DI, addr @@ -995,15 +1021,13 @@ void bputs(word x, unsigned y, , const char *s) JNZ L1 } - for(; *s != '\0'; s++) - { for(i=0; i>=1; } diff --git a/src/lib/modex16.h b/src/lib/modex16.h index b69f658b..363004b3 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 bputs(/*bmp_t *bmp, */unsigned x, unsigned y, const char *s); +void modexprint(word x, word y, word t, word col, const byte *str); void modexWaitBorder(); /* -======================= Constants & Vars ==========================- */ diff --git a/test.exe b/test.exe index 8b9d9f96..acbbfab1 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index b9df4623..b6d00f54 100644 Binary files a/test2.exe and b/test2.exe differ