]> 4ch.mooo.com Git - 16.git/blobdiff - src/FTEST.C
wwww ftest test~
[16.git] / src / FTEST.C
index 5f7efa80b24c62e0069d1d8bbf0e5e495cc9a0f8..3ec8940a1162a4be87ca3f1a78f2096e2978bff3 100644 (file)
@@ -1,13 +1,36 @@
+/* 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/text.h"\r
 \r
-main() {\r
+void main(int argc, char *argv[])\r
+{\r
     int i;\r
     int j;\r
-    char l[16];\r
+       char l[16];\r
     char c;\r
-    word s, o;\r
+    word s, o, t, w;\r
     word addr = (word) l;\r
     textInit();\r
 \r
@@ -20,8 +43,38 @@ main() {
     printf("Character: ");\r
     scanf("%c", &c);\r
 \r
-    s=romFonts[ROM_FONT_8x16].seg;\r
-    o=romFonts[ROM_FONT_8x16].off;\r
+       if(*argv[1]!=NULL)\r
+       switch(*argv[1])\r
+       {\r
+               case 0:\r
+                       t=0;\r
+                       w=14;\r
+               break;\r
+               case 1:\r
+                       t=1;\r
+                       w=8;\r
+               break;\r
+               case 2:\r
+                       t=2;\r
+                       w=8;\r
+               break;\r
+               case 3:\r
+                       t=3;\r
+                       w=16;\r
+               break;\r
+               default:\r
+                       t=3;\r
+                       w=16;\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
@@ -35,7 +88,7 @@ main() {
                SHL BX, 1\r
                SHL BX, 1\r
                ADD SI, BX      ;the address of A\r
-               MOV CX, 16\r
+               MOV CX, w\r
        L1:     MOV AX, ES:SI\r
                MOV DS:DI, AX\r
                INC SI\r
@@ -45,7 +98,7 @@ main() {
     }\r
 \r
     //render the letter in ascii art\r
-    for(i=0; i<16; i++) {\r
+    for(i=0; i<w; i++) {\r
        j=1<<8;\r
        while(j) {\r
            printf("%c", l[i] & j ? '*':' ');\r