]> 4ch.mooo.com Git - 16.git/commitdiff
ok
authorsparky4 <sparky4@cock.li>
Mon, 13 Jul 2015 14:41:25 +0000 (09:41 -0500)
committersparky4 <sparky4@cock.li>
Mon, 13 Jul 2015 14:41:25 +0000 (09:41 -0500)
modified:   exmmtest.exe
new file:   fonttes0.exe
modified:   makefile
new file:   src/fonttes0.c

exmmtest.exe
fonttes0.exe [new file with mode: 0644]
makefile
src/fonttes0.c [new file with mode: 0644]

index 1d1e40b1df8f972ba7f754429f4a5254f5e099da..3099ebc42460b6488fb1d6affe1199703ad346d6 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
diff --git a/fonttes0.exe b/fonttes0.exe
new file mode 100644 (file)
index 0000000..b90962e
Binary files /dev/null and b/fonttes0.exe differ
index b8b69f0f4a67a4eb296f03455ce7ac0005e9287a..cfe7184236f99d1048c0502b646b0fb7d84ea600 100644 (file)
--- 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 (file)
index 0000000..9b5b89c
--- /dev/null
@@ -0,0 +1,109 @@
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+#include <stdio.h>\r
+#include <conio.h>\r
+#include "lib/types.h"\r
+#include "lib/16text.h"\r
+\r
+void main(int argc, char *argv[])\r
+{\r
+    int i;\r
+    int j;\r
+       char l[16];\r
+    char c;\r
+    word s, o, t, w;\r
+    word addr = (word) l;\r
+    textInit();\r
+\r
+    //print the addresses of the fonts\r
+    printf("ROM FONT Addresses\n");\r
+    for(i=0; i<4; i++) {\r
+       printf("%d: %x:%x\n", i, romFonts[i].seg, romFonts[i].off);\r
+    }\r
+\r
+       printf("*argv[1]=%d\n", *argv[1]);\r
+\r
+    printf("Character: ");\r
+    scanf("%c", &c);\r
+\r
+       if(*argv[1]!=1)\r
+       switch(*argv[1])\r
+       {\r
+               case 48:\r
+                       t=0;\r
+                       w=14;\r
+               break;\r
+               case 49:\r
+                       t=1;\r
+                       w=8;\r
+               break;\r
+               case 50:\r
+                       t=2;\r
+                       w=8;\r
+               break;\r
+               case 51:\r
+                       t=3;\r
+                       w=16;\r
+               break;\r
+               default:\r
+                       t=3;\r
+                       w=16;\r
+               break;\r
+       }\r
+       else\r
+       {\r
+               t=3;\r
+               w=16;   \r
+       }\r
+\r
+\r
+    s=romFonts[t].seg;\r
+    o=romFonts[t].off;\r
+\r
+    //load the letter 'A'\r
+    __asm {\r
+               MOV DI, addr\r
+               MOV SI, o\r
+               MOV ES, s\r
+               SUB AH, AH\r
+               MOV AL, c       ; the letter\r
+               MOV CX, w\r
+               MUL CX\r
+               ADD SI, AX      ;the address of charcter\r
+       L1:     MOV AX, ES:SI\r
+               MOV DS:DI, AX\r
+               INC SI\r
+               INC DI\r
+               DEC CX\r
+               JNZ L1\r
+    }\r
+\r
+    //render the letter in ascii art\r
+    for(i=0; i<w; i++) {\r
+       j=1<<8;\r
+       while(j) {\r
+           printf("%c", l[i] & j ? '*':' ');\r
+           j>>=1;\r
+       }\r
+       printf("\n");\r
+    }\r
+}\r