#
VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
-16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ)
+16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ)
GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) $(DOSLIBLIBS) 16_vrs.$(OBJ) 16_sprite.$(OBJ)
#planar.$(OBJ) 16planar.$(OBJ)
DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib
DOSLIBLIBS += $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)8250$(DIRSEP)dos86h$(DIRSEP)8250.lib
!endif
-TESTEXEC = test.exe test0.exe pcxtest.exe pcxtest2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe exmmtest.exe
+TESTEXEC = test.exe test0.exe pcxtest.exe pcxtest2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe exmmtest.exe vrstest.exe
#planrpcx.exe test2.exe
EXEC = 16.exe bakapi.exe tesuto.exe 0.exe $(TESTEXEC)
pcxtest.exe: pcxtest.$(OBJ) gfx.lib
wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -fm=pcxtest.mah
+vrstest.exe: vrstest.$(OBJ) gfx.lib
+ wcl $(FLAGS) vrstest.$(OBJ) gfx.lib -fm=vrstest.mah
+
palettec.exe: palettec.$(OBJ) gfx.lib #$(16LIB)
wcl $(FLAGS) palettec.$(OBJ) gfx.lib -fm=palettec.mah #$(16LIB)
pcxtest.$(OBJ): $(SRC)pcxtest.c $(SRCLIB)modex16.h
wcl $(FLAGS) -c $(SRC)pcxtest.c
+vrstest.$(OBJ): $(SRC)vrstest.c $(SRCLIB)modex16.h
+ wcl $(FLAGS) -c $(SRC)vrstest.c
+
##planrpcx.$(OBJ): $(SRC)planrpcx.c $(SRCLIB)modex16.h
## wcl $(FLAGS) -c $(SRC)planrpcx.c
--- /dev/null
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\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 <stdio.h>\r
+#include <dos.h>\r
+#include <string.h>\r
+#include "src/lib/modex16.h"\r
+#include "src/lib/16_sprite.h"\r
+#include "src/lib/16_ca.h"\r
+#include "src/lib/16_mm.h"\r
+\r
+\r
+global_game_variables_t gvar;\r
+\r
+void main() {\r
+ int i;\r
+ word start;\r
+ int plane;\r
+ float t1, t2;\r
+\r
+ // DOSLIB: check our environment\r
+ probe_dos();\r
+\r
+ // DOSLIB: what CPU are we using?\r
+ // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.\r
+ // So this code by itself shouldn't care too much what CPU it's running on. Except that other\r
+ // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for\r
+ // the CPU to carry out tasks. --J.C.\r
+ cpu_probe();\r
+\r
+ // DOSLIB: check for VGA\r
+ if (!probe_vga()) {\r
+ printf("VGA probe failed\n");\r
+ return;\r
+ }\r
+ // hardware must be VGA or higher!\r
+ if (!(vga_state.vga_flags & VGA_IS_VGA)) {\r
+ printf("This program requires VGA or higher graphics hardware\n");\r
+ return;\r
+ }\r
+\r
+ //bmp = bitmapLoadPcx("data/chikyuu.pcx");\r
+\r
+ VGAmodeX(1, 1, &gvar);\r
+ gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
+\r
+ /* fix up the palette and everything */\r
+ //modexPalUpdate1(bmp.palette);\r
+\r
+ /* clear and draw one sprite and one bitmap */\r
+ modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].sw, gvar.video.page[0].sh, 1);\r
+\r
+ /* non sprite comparison */\r
+ start = *clockw;\r
+ //for(i=0; i<100 ;i++) {\r
+ // oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
+ //}\r
+\r
+ start = *clockw;\r
+ //for(i=0; i<100 ;i++) {\r
+//0000 modexDrawBmp(&gvar.video.page[0], 20, 20, &bmp);\r
+ // modexDrawBmp(&gvar.video.page[0], 160, 120, &bmp);\r
+ //}\r
+ t1 = (*clockw-start) /18.2;\r
+\r
+ start = *clockw;\r
+ //for(i=0; i<100; i++) {\r
+//0000 modexCopyPageRegion(&gvar.video.page[0], &gvar.video.page[0], 20, 20, 128, 20, 64, 64);\r
+ modexCopyPageRegion(&gvar.video.page[0], &gvar.video.page[0], 0, 0, 0, 0, 320, 240);\r
+ //}\r
+ t2 = (*clockw-start)/18.2;\r
+\r
+\r
+ start = *clockw;\r
+ //for(i=0; i<100 ;i++) {\r
+ // oldDrawBmp(VGA, 20, 20, &bmp, 1);\r
+ //}\r
+\r
+\r
+ start = *clockw;\r
+ //for(i=0; i<100 ;i++) {\r
+//0000 modexDrawSprite(&gvar.video.page[0], 20, 20, &bmp);\r
+ // modexDrawSprite(&gvar.video.page[0], 160, 120, &bmp);\r
+ //}\r
+ //_fmemset(MK_FP(0xA000, 0), (int)p->plane, gvar.video.page[0].sw*(gvar.video.page[0].sh*2));\r
+ //modexDrawBmp(&gvar.video.page[0], 0, 0, &bmp);\r
+ while(!kbhit())\r
+ {\r
+ //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0);\r
+ }\r
+ VGAmodeX(0, 1, &gvar);\r
+ /*printf("\nmain=%Fp\n\n", &i);\r
+ printf("bmp.data=%Fp\n", bmp.data);\r
+ printf("*bmp.data=%Fp\n", *(bmp.data));\r
+ printf("&bmp.data=%Fp\n", &(bmp.data));\r
+\r
+ printf("\n%d\n", sizeof(p->plane));\r
+ printf("%d\n", sizeof(bmp));*/\r
+\r
+ /*for(i=0; i<(320*240); i++)\r
+ {\r
+ fprintf(stdout, "%d", bmp.data[i]);\r
+ if(i%bmp.width==0) fprintf(stdout, "\n");\r
+ }*/\r
+ printf("CPU to VGA: %f\n", t1);\r
+ printf("VGA to VGA: %f\n", t2);\r
+ printf("gvar.video.page[0].width: %u\n", gvar.video.page[0].width);\r
+ printf("gvar.video.page[0].height: %u\n", gvar.video.page[0].height);\r
+ return;\r
+}\r