]> 4ch.mooo.com Git - 16.git/commitdiff
working on font~
authorsparky4 <sparky4@cock.li>
Wed, 11 Nov 2015 13:47:45 +0000 (07:47 -0600)
committersparky4 <sparky4@cock.li>
Wed, 11 Nov 2015 13:47:45 +0000 (07:47 -0600)
24 files changed:
16.exe
bakapi.exe
exmmtest.exe
fmemtest.exe
fontgfx.exe
fonttest.exe
inputest.exe
makefile
maptest.exe
palettec.exe
palettel.exe
pcxtest.exe
pcxtest2.exe
planrpcx.exe
scroll.exe
src/lib/16text.c
src/lib/16text.h
src/lib/modex16.c
src/lib/modex16/16render.c
src/lib/modex16/16render.h
test.exe
test2.exe
tesuto.exe
vgmtest.exe

diff --git a/16.exe b/16.exe
index e57e73b20f76038fd598097fdef1608926511071..e3d1b91c64f072225efbd732857be6d0c71243a6 100755 (executable)
Binary files a/16.exe and b/16.exe differ
index 38a9a561286c9b5e7eb0cb62336dbf2c4d42e8d6..4dcc4052f29f1ea15c4e79d8f00b2323af46ba3f 100755 (executable)
Binary files a/bakapi.exe and b/bakapi.exe differ
index 7f03a7a728669ae60f3b6ab7a1ca0d719c601174..39ba53b805ec36085612738f8b7ef1e91393551c 100755 (executable)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index 7a35aaf960479941184554ce2e7d8f79ee958149..c88212abf6af8315621abd78613afc60175f8178 100755 (executable)
Binary files a/fmemtest.exe and b/fmemtest.exe differ
index dcffafe8d0709ef1d866bfd5d8d2a2273eab2bec..1886fcc97bf09ab0aa4d0878487bd66280e6724e 100755 (executable)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 256aed671e04dbd688e2255b25f403f7eb8d1d54..c59b86a554e7326206db41e5dc13539591fe8c4c 100755 (executable)
Binary files a/fonttest.exe and b/fonttest.exe differ
index caf53e608f46367bbfb70afb8092b6173db21633..09cb3893242693857946b66b1f6a34c677c05d9d 100755 (executable)
Binary files a/inputest.exe and b/inputest.exe differ
index cf7ce427cbf09be8085936da0fe616c2d5551097..6c388c71f96fff09e1224c685f9f688ae62d342d 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -59,7 +59,7 @@ WCPULIB=$(SRCLIB)wcpu$(DIRSEP)
 
 16FLAGS=-fh=16.hed
 BAKAPIFLAGS=-fh=bakapi.hed
-SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k56832#60000#32768
+SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k55808#60000#32768
 DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS)
 ZFLAGS=-zk0 -zq -zc -zp8# -zm
 CFLAGS=$(IFLAGS) -mh -lr -l=dos -wo# -d2##wwww
index 6e420ea400534954767e6a6140240dbfb3e39fc1..e9b7685ab7d44ebb5598256121fc37d2ea3d0013 100755 (executable)
Binary files a/maptest.exe and b/maptest.exe differ
index 27870e4735907aa24419e0644c809c460975e983..7222a87a691dc6bce2c981efe8ac4e7033ec7579 100755 (executable)
Binary files a/palettec.exe and b/palettec.exe differ
index de2b7d81c2796d0b063fdd63256f92cd8af9554e..c68fd94d70917e625ca67f7f25d636bf7e14941d 100755 (executable)
Binary files a/palettel.exe and b/palettel.exe differ
index 33f8e41a7e129a32b6d7f83323e0be82eec9c37d..8a5dd42b741f109568c4989495424e4f68378dcd 100755 (executable)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 282949111bb26ca7cc20026f821164d2fb962f4d..5f5124dd50c3e9db23a63bb09205dbfbba912bc5 100755 (executable)
Binary files a/pcxtest2.exe and b/pcxtest2.exe differ
index f3e54abf51a07e95d3c3fdc595566df547912d9d..cfcf4fffc09d114d34bf0cb08eee989d584fc720 100755 (executable)
Binary files a/planrpcx.exe and b/planrpcx.exe differ
index ee9d1f07d8ef1627ac08d351540b57eed6436b07..cc6b0edc7d258c0354f42aa5ac2531d9816147ea 100755 (executable)
Binary files a/scroll.exe and b/scroll.exe differ
index fc7c775f9a26c124ccb21b912fe6b9896f0cf903..62b581e8c3d2ce70411dbe332baaa936a2ffb35f 100755 (executable)
@@ -1,30 +1,30 @@
-/* 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 <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
+/* 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
+\r
 #include "16text.h"\r
 \r
 /* this array holds the rom font descriptors */\r
 font_t romFonts[4];\r
-\r
+fontdata_t romFontsData;\r
 \r
 static void getRomFontAddr(char fontNum, int index) {\r
     word fontSeg;\r
@@ -56,4 +56,5 @@ void textInit() {
     romFonts[ROM_FONT_8x8_LOW].charSize=8;\r
     romFonts[ROM_FONT_8x8_HIGH].charSize=8;\r
     romFonts[ROM_FONT_8x16].charSize=16;\r
+       //romFontsData\r
 }\r
index a44537397e2c19c145cb97021ebb1e2f7fe4a4e7..c946ae5ea6631d7631d2a4572d64c99cc02c69b7 100755 (executable)
@@ -1,24 +1,24 @@
-/* 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 <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+/* 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
 /*\r
  * This is the text subsystem for project 16.\r
  * These functions provide for the rendering of text strings\r
  * They copy the font characters directly to VGA.\r
  */\r
 #ifndef TEXT_H\r
-#define TEXT_H
-#ifdef __WATCOMC__
-#include <jstring.h>
+#define TEXT_H\r
+#ifdef __WATCOMC__\r
+#include <jstring.h>\r
 #include <jctype.h>\r
-#endif
+#endif\r
 #include "src/lib/types.h"\r
 \r
 /* font information type */\r
@@ -40,8 +40,17 @@ typedef struct font {
     byte  charSize;  //bytes in each character\r
 } font_t;\r
 \r
+typedef struct fontdata {\r
+       byte z[9];\r
+       byte col;       //color\r
+       byte bgcol;             //bg color!\r
+       word chw;               //char width\r
+       byte l[1024];\r
+} fontdata_t;\r
+\r
 /* storage for the rom fonts */\r
 extern font_t romFonts[4];\r
+extern fontdata_t romFontsData;\r
 #define ROM_FONT_8x14     0\r
 #define ROM_FONT_8x8_LOW  1\r
 #define ROM_FONT_8x8_HIGH 2\r
index 8637d7111e4636f4c39a290bff2bd6838eda7b27..1ddefc699670533b11d02b0a466808d710c20ea6 100755 (executable)
@@ -954,46 +954,24 @@ void modexhlin(page_t *page, word xl, word xh, word y, word color)
 \r
 void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str, boolean q)\r
 {\r
-       word i, s, o, w, j, k, xp;\r
-       byte l[1024];\r
-       word addr = (word) l;\r
-       word chw=0;\r
+       word s, o, w;\r
+       word addr = (word) romFontsData.l;\r
        byte c;\r
-       byte z[10];\r
-       //byte near *bakapee;\r
-\r
-       switch(t)\r
-       {\r
-               case 0:\r
-                       w=14;\r
-               break;\r
-               case 1:\r
-                       w=8;\r
-               break;\r
-               case 2:\r
-                       w=8;\r
-               break;\r
-               case 3:\r
-                       w=16;\r
-               break;\r
-               default:\r
-                       t=3;\r
-                       w=16;\r
-               break;\r
-       }\r
 \r
        s=romFonts[t].seg;\r
        o=romFonts[t].off;\r
+       w=romFonts[t].charSize;\r
+       romFontsData.chw=0;\r
 \r
        for(; *str != '\0'; str++)\r
        {\r
        c = (*str);\r
        if((c=='\n'/* || c=="\\r
-"*/) || chw\r
+"*/) || romFontsData.chw\r
 >=page->width)\r
        {\r
-               chw=0;\r
-               y+=w;\r
+               romFontsData.chw=0;\r
+               y+=romFonts[t].charSize;\r
                continue;\r
        }\r
        //load the letter 'A'\r
@@ -1013,42 +991,10 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons
                DEC CX\r
                JNZ L1\r
        }\r
-       //bakapee = _nmalloc(sizeof(byte)*8);\r
 //TODO: OPTIMIZE THIS!!!!\r
-               for(i=0; i<w; i++)\r
-               {\r
-                       /*modexSelectPlane(PLANE(x));\r
-                       j=1<<8;\r
-                       *bakapee=(l[i] & j ? col:bgcol);\r
-                       _fmemcpy(page->data + (((page->width/4) * (y+page->dy+i)) + ((x+page->dx+chw) / 4)), bakapee, 8);*/\r
-                       j=1<<8;\r
-                       k=0;\r
-                       xp=0;\r
-                       //every "pixel" row\r
-                       while(j)\r
-                       {\r
-                               if(q)\r
-                               //_fmemcpy(page->data + (((page->width/4) * (y)) + ((x) / 4)), l[i] & j ? col:bgcol, 8);\r
-                               modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);\r
-                               else\r
-                                       //printf("l[i]=%c j=%02u l[i] & j=%02u %c\n", l[i] , j, l[i] & j, l[i] & j ? '*':' ');\r
-                                       //printf("%c", l[i] & j ? '*':' ');\r
-                                       z[k]=l[i] & j ? '*':' ';\r
-                               xp++;\r
-                               j>>=1;\r
-                               k++;\r
-                       }\r
-                       if(!q)\r
-                       {\r
-                               for(k=0;k<10;k++)\r
-                               {\r
-                                       printf("%c", z[k]);\r
-                               }\r
-                               printf("\n");\r
-                       }\r
-               }\r
+               modexDrawCharPBuf(page, x, y, t, col, bgcol, q);\r
+\r
                if(!q) getch();\r
-               chw += xp;\r
        }\r
        //_nfree(bakapee);\r
 }\r
index 198844081b005924553591da69f19964e53a89a7..91820e8e246d8fbaa67a0bccafe1ec2577deede9 100755 (executable)
@@ -434,3 +434,37 @@ modexDrawSpritePBufRegion(page_t *page, int x, int y,
                JNZ PLANE_LOOP    ; do all 4 planes\r
     }\r
 }\r
+\r
+void modexDrawCharPBuf(page_t *page, int x, int y, word t, word col, word bgcol, boolean q)\r
+{\r
+       word i, j, k;\r
+       for(i=0; i<romFonts[t].charSize; i++)\r
+       {\r
+               j=1<<8;\r
+               k=0;\r
+               //every "pixel" row\r
+               while(j)\r
+               {\r
+                       if(q)\r
+                       _fmemcpy(page->data + (((page->width/4) * (y+i)) + ((x+romFontsData.chw+k) / 4)),\r
+ romFontsData.l[i] & j ?\r
+ col:bgcol, 2);\r
+                       //modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);\r
+                       else\r
+                               //printf("l[i]=%c j=%02u l[i] & j=%02u %c\n", l[i] , j, l[i] & j, l[i] & j ? '*':' ');\r
+                               //printf("%c", l[i] & j ? '*':' ');\r
+                               romFontsData.z[k]=romFontsData.l[i] & j ? '*':' ';\r
+                       j>>=1;\r
+                       k++;\r
+               }\r
+               if(!q)\r
+               {\r
+                       for(k=0;k<9;k++)\r
+                       {\r
+                               printf("%c", romFontsData.z[k]);\r
+                       }\r
+                       printf("\n");\r
+               }\r
+       }\r
+       romFontsData.chw += k;\r
+}\r
index 4b2ebcd9fea8149d40716621cff58236359b6038..23d507ac1248c29aff47ac1daf06c2a437e47340 100755 (executable)
@@ -36,5 +36,6 @@ void modexDrawBmpPBuf(page_t *page, int x, int y, planar_buf_t *bmp); /*pbuf ver
 void modexDrawBmpPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp);\r
 void modexDrawSpritePBuf(page_t *page, int x, int y, planar_buf_t *bmp);\r
 void modexDrawSpritePBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp);\r
+void modexDrawCharPBuf(page_t *page, int x, int y, word t, word col, word bgcol, boolean q);\r
 \r
 #endif\r
index e6acda179f682bd3a6bb85224a26a3778f5514ac..27bdd0c7e97430fc41bbecf7f91bb96217abbb9e 100755 (executable)
Binary files a/test.exe and b/test.exe differ
index bb6b3a0fb7de3afcd652bbb663911243f7aad49e..4822506d694c69e094de66598269753be67c9b48 100755 (executable)
Binary files a/test2.exe and b/test2.exe differ
index e475c0f0f3cd7c457657e254c392b3136a048adf..6dbf027edf2117d3a5a54f2fd40b88760076686f 100755 (executable)
Binary files a/tesuto.exe and b/tesuto.exe differ
index 335f9668ec33c995d80a8da007ef1d0e9a24dd3f..892afa7ebd4a9f70eac2d885b59bdd1d13e9f365 100755 (executable)
Binary files a/vgmtest.exe and b/vgmtest.exe differ