#-zk0u = translate kanji to unicode... wwww\r
#-zk0 = kanji support~\r
#-zkl = current codepage\r
-
+\r
MFLAGS=-mh# -zm\r
CFLAGS=-zkl -wo -x#### -mc# -zdp# -zp16 -zq\r
OFLAGS=-ot -ox -ob -oh -or# -om -ol -ol+\r
DIRSEP=\\r
SRC=src$(DIRSEP)\r
SRCLIB=$(SRC)lib$(DIRSEP)\r
-JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
-EXMMLIB=$(SRCLIB)exmm$(DIRSEP)
+JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)\r
+EXMMLIB=$(SRCLIB)exmm$(DIRSEP)\r
WCPULIB=$(SRCLIB)wcpu$(DIRSEP)\r
\r
-all: 16.exe test.exe pcxtest.exe test2.exe scroll.exe palettec.exe maptest.exe maptest0.exe emsdump.exe emmtest.exe fmemtest.exe \r
-
-#
-#executables
-#
-16.exe: 16.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj scroll16.obj#planar.obj wcpu.obj
- wcl $(FLAGS) 16.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj scroll16.obj#planar.obj wcpu.obj
+all: 16.exe test.exe pcxtest.exe test2.exe scroll.exe palettec.exe maptest.exe maptest0.exe emsdump.exe emmtest.exe fmemtest.exe ftest.exe\r
+\r
+#\r
+#executables\r
+#\r
+16.exe: 16.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj scroll16.obj#planar.obj wcpu.obj\r
+ wcl $(FLAGS) 16.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj scroll16.obj#planar.obj wcpu.obj\r
\r
scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj planar.obj mapread.obj jsmn.obj wcpu.obj\r
wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj planar.obj mapread.obj jsmn.obj wcpu.obj# 16/lib/x/modex.lib\r
test2.exe: test2.obj modex16.obj bitmap.obj planar.obj lib_head.obj\r
wcl $(FLAGS) test2.obj modex16.obj bitmap.obj planar.obj lib_head.obj\r
\r
+ftest.exe: text.obj ftest.obj\r
+ wcl $(FLAGS) ftest.obj text.obj\r
+\r
+text.obj: $(SRCLIB)text.c\r
+ wcl -c $(SRCLIB)text.c\r
+\r
+ftest.obj: $(SRC)ftest.c\r
+ wcl -c $(SRC)ftest.c\r
+\r
pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj planar.obj lib_head.obj\r
- wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj planar.obj lib_head.obj
-
+ wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj planar.obj lib_head.obj\r
+\r
palettec.exe: palettec.obj modex16.obj\r
wcl $(FLAGS) palettec.obj modex16.obj\r
\r
maptest.exe: maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj\r
wcl $(FLAGS) maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj\r
-
+\r
maptest0.exe: maptest0.obj fmapread.obj farjsmn.obj# modex16.obj bitmap.obj lib_head.obj\r
- wcl $(FLAGS) $(MFLAGS) maptest0.obj fmapread.obj farjsmn.obj# modex16.obj bitmap.obj lib_head.obj
-
-emmtest.exe: emmtest.obj memory.obj
- wcl $(FLAGS) $(MFLAGS) emmtest.obj memory.obj
-
-emsdump.exe: emsdump.obj memory.obj
- wcl $(FLAGS) $(MFLAGS) emsdump.obj memory.obj
-
-fmemtest.exe: fmemtest.obj# memory.obj
- wcl $(FLAGS) $(MFLAGS) fmemtest.obj# memory.obj
-
-#
-#executable's objects
-#
+ wcl $(FLAGS) $(MFLAGS) maptest0.obj fmapread.obj farjsmn.obj# modex16.obj bitmap.obj lib_head.obj\r
+\r
+emmtest.exe: emmtest.obj memory.obj\r
+ wcl $(FLAGS) $(MFLAGS) emmtest.obj memory.obj\r
+\r
+emsdump.exe: emsdump.obj memory.obj\r
+ wcl $(FLAGS) $(MFLAGS) emsdump.obj memory.obj\r
+\r
+fmemtest.exe: fmemtest.obj# memory.obj\r
+ wcl $(FLAGS) $(MFLAGS) fmemtest.obj# memory.obj\r
+\r
+#\r
+#executable's objects\r
+#\r
16.obj: $(SRC)16.h $(SRC)16.c\r
- wcl $(FLAGS) -c $(SRC)16.c
+ wcl $(FLAGS) -c $(SRC)16.c\r
\r
test.obj: $(SRC)test.c $(SRCLIB)modex16.h\r
wcl $(FLAGS) -c $(SRC)test.c\r
wcl $(FLAGS) -c $(SRC)test2.c\r
\r
pcxtest.obj: $(SRC)pcxtest.c $(SRCLIB)modex16.h\r
- wcl $(FLAGS) -c $(SRC)pcxtest.c
-
+ wcl $(FLAGS) -c $(SRC)pcxtest.c\r
+\r
palettec.obj: $(SRC)palettec.c\r
- wcl $(FLAGS) -c $(SRC)palettec.c
+ wcl $(FLAGS) -c $(SRC)palettec.c\r
+\r
+maptest.obj: $(SRC)maptest.c $(SRCLIB)modex16.h\r
+ wcl $(FLAGS) -c $(SRC)maptest.c\r
\r
-maptest.obj: $(SRC)maptest.c $(SRCLIB)modex16.h
- wcl $(FLAGS) -c $(SRC)maptest.c
-
maptest0.obj: $(SRC)maptest0.c# $(SRCLIB)modex16.h\r
- wcl $(FLAGS) $(MFLAGS) -c $(SRC)maptest0.c
-
+ wcl $(FLAGS) $(MFLAGS) -c $(SRC)maptest0.c\r
+\r
emmtest.obj: $(SRC)emmtest.c\r
wcl $(FLAGS) $(MFLAGS) -c $(SRC)emmtest.c\r
-
+\r
emsdump.obj: $(SRC)emsdump.c\r
- wcl $(FLAGS) $(MFLAGS) -c $(SRC)emsdump.c
-
+ wcl $(FLAGS) $(MFLAGS) -c $(SRC)emsdump.c\r
+\r
fmemtest.obj: $(SRC)fmemtest.c\r
- wcl $(FLAGS) $(MFLAGS) -c $(SRC)fmemtest.c
-
-#
-#non executable objects libraries
+ wcl $(FLAGS) $(MFLAGS) -c $(SRC)fmemtest.c\r
+\r
+#\r
+#non executable objects libraries\r
#\r
modex16.obj: $(SRCLIB)modex16.h $(SRCLIB)modex16.c\r
wcl $(FLAGS) -c $(SRCLIB)modex16.c\r
wcl $(FLAGS) -c $(SRCLIB)bitmap.c\r
\r
planar.obj: $(SRCLIB)planar.h $(SRCLIB)planar.c\r
- wcl $(FLAGS) -c $(SRCLIB)planar.c
-
+ wcl $(FLAGS) -c $(SRCLIB)planar.c\r
+\r
scroll16.obj: $(SRCLIB)scroll16.h $(SRCLIB)scroll16.c\r
- wcl $(FLAGS) -c $(SRCLIB)scroll16.c
-
+ wcl $(FLAGS) -c $(SRCLIB)scroll16.c\r
+\r
wcpu.obj: $(WCPULIB)wcpu.h $(WCPULIB)wcpu.c\r
- wcl $(FLAGS) -c $(WCPULIB)wcpu.c
+ wcl $(FLAGS) -c $(WCPULIB)wcpu.c\r
\r
mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c\r
- wcl $(FLAGS) -c $(SRCLIB)mapread.c
-
+ wcl $(FLAGS) -c $(SRCLIB)mapread.c\r
+\r
fmapread.obj: $(SRCLIB)fmapread.h $(SRCLIB)fmapread.c\r
wcl $(FLAGS) $(MFLAGS) -c $(SRCLIB)fmapread.c\r
\r
wcl $(FLAGS) -c $(SRCLIB)lib_head.c\r
\r
jsmn.obj: $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c\r
- wcl $(FLAGS) -c $(JSMNLIB)jsmn.c
-
+ wcl $(FLAGS) -c $(JSMNLIB)jsmn.c\r
+\r
farjsmn.obj: $(JSMNLIB)farjsmn.h $(JSMNLIB)farjsmn.c\r
wcl $(FLAGS) $(MFLAGS) -c $(JSMNLIB)farjsmn.c\r
-
+\r
memory.obj: $(EXMMLIB)memory.h $(EXMMLIB)memory.c\r
- wcl $(FLAGS) $(MFLAGS) -c $(EXMMLIB)memory.c
-
-#
-#other~
+ wcl $(FLAGS) $(MFLAGS) -c $(EXMMLIB)memory.c\r
+\r
+#\r
+#other~\r
#\r
clean: .symbolic\r
# @$(REMOVECOMMAND) *.obj\r
--- /dev/null
+#include "text.h"\r
+\r
+/* this array holds the rom font descriptors */\r
+font_t romFonts[4];\r
+\r
+\r
+static void getRomFontAddr(char fontNum, int index) {\r
+ word fontSeg;\r
+ word fontOff;\r
+\r
+ __asm {\r
+ PUSH BP\r
+ MOV AX, 0x1130 ;I can haz font info plz?\r
+ MOV BH, fontNum ; where ur fontNum\r
+ INT 0x10 ;kthxbae\r
+ MOV AX, ES ;save teh segmentz\r
+ MOV BX, BP ;and all the base!\r
+ POP BP ;u can haz ur frame back!\r
+ MOV fontSeg, AX ;Storage\r
+ MOV fontOff, BX ;Storage\r
+ }\r
+ romFonts[index].seg = fontSeg;\r
+ romFonts[index].off = fontOff;\r
+\r
+}\r
+\r
+/* This function initializes the text engine */\r
+void textInit() {\r
+ getRomFontAddr(0x02, ROM_FONT_8x14);\r
+ getRomFontAddr(0x03, ROM_FONT_8x8_LOW);\r
+ getRomFontAddr(0x04, ROM_FONT_8x8_HIGH);\r
+ getRomFontAddr(0x06, ROM_FONT_8x16);\r
+ romFonts[ROM_FONT_8x14].charSize=14;\r
+ romFonts[ROM_FONT_8x8_LOW].charSize=8;\r
+ romFonts[ROM_FONT_8x8_HIGH].charSize=8;\r
+ romFonts[ROM_FONT_8x16].charSize=16;\r
+}\r
-/* 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
* Just some handy typedefs that make it easier to think about the low\r
* level code\r
- */
-
-#ifndef _TYPE_H_
-#define _TYPE_H_
+ */\r
+\r
+#ifndef _TYPE_H_\r
+#define _TYPE_H_\r
\r
typedef unsigned char byte;\r
typedef unsigned short word;\r
typedef unsigned long dword;\r
typedef signed char sbyte;\r
typedef signed short sword;\r
-typedef signed long sdword;
-
-#endif/*_TYPE_H_*/
+typedef signed long sdword;\r
+\r
+#endif/*_TYPE_H_*/\r