AFLAGS=-mh -0 -d1
16FLAGS=-fh=16.hed
BAKAPIFLAGS=-fh=bakapi.hed
-SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#55808#60000
+SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#54096#60000
DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS)
ZFLAGS=-zk0 -zc -zp8 $(WCLQ) ## -zm
CFLAGS=$(AFLAGS) $(IFLAGS)-lr -l=dos -wo -i$(DOSLIB)##wwww
tesuto.$(OBJ): $(SRC)tesuto.c
wcl $(FLAGS) $(WCLQ) -c $(SRC)tesuto.c
-test.exe: test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ)
- wcl $(FLAGS) test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) -fm=test.mah
+test.exe: test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) $(DOSLIBLIBS)
+ wcl $(FLAGS) test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) $(DOSLIBLIBS) -fm=test.mah
-test2.exe: test2.$(OBJ) gfx.lib
- wcl $(FLAGS) test2.$(OBJ) gfx.lib -fm=test2.mah
+test2.exe: test2.$(OBJ) $(DOSLIBLIBS) gfx.lib
+ wcl $(FLAGS) test2.$(OBJ) $(DOSLIBLIBS) gfx.lib -fm=test2.mah
fonttest.exe: fonttest.$(OBJ) $(16LIB) gfx.lib
wcl $(FLAGS) fonttest.$(OBJ) $(16LIB) gfx.lib -fm=fonttest.mah
//TODO MAKE FLEXIBLE~\r
// gv->video.page[0].tilemidposscreenx = gv->video.page[0].tilesw;\r
// gv->video.page[0].tilemidposscreeny = (gv->video.page[0].tilesh/2)+1;\r
+ gv->video.num_of_pages=0;\r
}\r
\r
void\r
void modexCalcVmemRemain(video_t *video)\r
{\r
byte i;\r
- printf("\n\n 1st vmem_remain=%ld\n", video->vmem_remain);\r
+ //printf("\n\n 1st vmem_remain=%ld\n", video->vmem_remain);\r
for(i=0; i<=video->num_of_pages-1; i++)\r
{\r
video->vmem_remain-=video->page[i].pagesize;\r
- printf(" [%u], video->page[i].pagesize=%ld\n", i, video->page[i].pagesize);\r
- printf(" [%u], vmem_remain=%ld\n", i, video->vmem_remain);\r
+ //printf(" [%u], video->page[i].pagesize=%ld\n", i, video->page[i].pagesize);\r
+ //printf(" [%u], vmem_remain=%ld\n", i, video->vmem_remain);\r
}\r
}\r
\r
if(argv[1]) bakapee = atoi(argv[1]);\r
else bakapee = 1;\r
\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
/* load our palette */\r
modexLoadPalFile("data/default.pal", &pal2);\r
\r
modexFadeOff(1, pal);\r
modexPalBlack();\r
\r
- VGAmodeX(bakapee, 1, &gvar);\r
- modexPalBlack();\r
-\r
IN_Startup();\r
IN_Default(0,&player,ctrl_Joystick);\r
\r
+ textInit();\r
+ VGAmodeX(bakapee, 1, &gvar);\r
+ modexPalBlack();\r
+\r
/* set up the page, but with 16 pixels on all borders in offscreen mem */\r
- gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
- gvar.video.page[1] = modexNextPage(&gvar.video.page[0]);\r
- gvar.video.page[0].width += 32;\r
- gvar.video.page[0].height += 32;\r
+ modexHiganbanaPageSetup(&gvar.video);\r
+// gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
+// gvar.video.page[1] = modexNextPage(&gvar.video.page[0]);\r
+// gvar.video.page[0].width += 32;\r
+// gvar.video.page[0].height += 32;\r
\r
\r
/* fill the page with one color, but with a black border */\r
modexShowPage(&gvar.video.page[1]);\r
+ //modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 0);\r
modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128);\r
modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42);\r
modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128);\r
modexShowPage(&gvar.video.page[0]);\r
+ modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width, gvar.video.page[0].height);\r
\r
/* fade in */\r
modexFadeOn(1, pal2);\r
modexFadeOff(1, pal2);\r
modexPalBlack();\r
VGAmodeX(0, 1, &gvar);\r
- IN_Shutdown();\r
printf("Project 16 test.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
+ printf("video memory remaining: %ld\n", gvar.video.vmem_remain);\r
+ printf("page ");\r
+ for(i=0; i<gvar.video.num_of_pages;i++)\r
+ {\r
+ printf(" [%u]=", i);\r
+ printf("(%Fp)\n", (gvar.video.page[i].data));\r
+ }\r
+ IN_Shutdown();\r
modexPalBlack();\r
modexFadeOn(1, pal);\r
}\r