From: sparky4 Date: Mon, 13 Jul 2015 14:41:25 +0000 (-0500) Subject: ok X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=419bebfa81244ec6362f29e03d7cb0e1a19b3aef;p=16.git ok modified: exmmtest.exe new file: fonttes0.exe modified: makefile new file: src/fonttes0.c --- diff --git a/exmmtest.exe b/exmmtest.exe index 1d1e40b1..3099ebc4 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/fonttes0.exe b/fonttes0.exe new file mode 100644 index 00000000..b90962ee Binary files /dev/null and b/fonttes0.exe differ diff --git a/makefile b/makefile index b8b69f0f..cfe71842 100644 --- a/makefile +++ b/makefile @@ -25,7 +25,7 @@ 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) -all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe inputest.exe exmmtest.exe +all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe inputest.exe exmmtest.exe fonttes0.exe # #executables @@ -46,6 +46,9 @@ test2.exe: test2.$(OBJ) gfx.lib fonttest.exe: fonttest.$(OBJ) 16.lib wcl $(FLAGS) fonttest.$(OBJ) 16.lib +fonttes0.exe: fonttes0.$(OBJ) 16.lib + wcl $(FLAGS) fonttes0.$(OBJ) 16.lib + inputest.exe: inputest.$(OBJ) 16.lib wcl $(FLAGS) inputest.$(OBJ) 16.lib @@ -109,6 +112,9 @@ fmemtest.$(OBJ): $(SRC)fmemtest.c fonttest.$(OBJ): $(SRC)fonttest.c wcl -c $(SRC)fonttest.c +fonttes0.$(OBJ): $(SRC)fonttes0.c + wcl -c $(SRC)fonttes0.c + inputest.$(OBJ): $(SRC)inputest.c wcl $(FLAGS) -c $(SRC)inputest.c diff --git a/src/fonttes0.c b/src/fonttes0.c new file mode 100644 index 00000000..9b5b89c4 --- /dev/null +++ b/src/fonttes0.c @@ -0,0 +1,109 @@ +/* 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" + +void main(int argc, char *argv[]) +{ + int i; + int j; + char l[16]; + char c; + word s, o, t, w; + word addr = (word) l; + textInit(); + + //print the addresses of the fonts + printf("ROM FONT Addresses\n"); + for(i=0; i<4; i++) { + printf("%d: %x:%x\n", i, romFonts[i].seg, romFonts[i].off); + } + + printf("*argv[1]=%d\n", *argv[1]); + + printf("Character: "); + scanf("%c", &c); + + if(*argv[1]!=1) + switch(*argv[1]) + { + case 48: + t=0; + w=14; + break; + case 49: + t=1; + w=8; + break; + case 50: + t=2; + w=8; + break; + case 51: + t=3; + w=16; + break; + default: + t=3; + w=16; + break; + } + else + { + t=3; + w=16; + } + + + s=romFonts[t].seg; + o=romFonts[t].off; + + //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 + } + + //render the letter in ascii art + for(i=0; i>=1; + } + printf("\n"); + } +}