GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) $(DOSLIBLIBS)
-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)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 $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vgatty.lib
TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe planrpcx.exe
# tsthimem.exe
#fonttes0.exe: fonttes0.$(OBJ) $(16LIBOBJS)
# wcl $(FLAGS) fonttes0.$(OBJ) $(16LIBOBJS)
-fontgfx.exe: fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib
- wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fontgfx.map
+fontgfx.exe: fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS)
+ wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS) -fm=fontgfx.map
inputest.exe: inputest.$(OBJ) $(16LIBOBJS)
wcl $(FLAGS) inputest.$(OBJ) $(16LIBOBJS) -fm=inputest.map
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu && .$(DIRSEP)make.sh
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos && .$(DIRSEP)make.sh
+$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vgatty.lib:
+ cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga && .$(DIRSEP)make.sh
$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga && .$(DIRSEP)make.sh
+
joytest.exe:
cd $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)joystick && .$(DIRSEP)make.sh && $(COPYCOMMAND) dos86h$(DIRSEP)test.exe $(PDIR)$(PDIR)$(PDIR)$(PDIR)$(PDIR)joytest.exe
#$(DOSLIBLIBS): .symbolic
//#include "lib/16text.h"\r
#include "lib/modex16.h"\r
\r
+#include <hw/cpu/cpu.h>\r
+#include <hw/dos/dos.h>\r
+#include <hw/vga/vga.h>\r
+#include <hw/vga/vgatty.h>\r
+\r
global_game_variables_t gvar;\r
\r
void main(int argc, char near *argv[])\r
,'___...---~~~\n\\r
";\r
// static byte *rosa;\r
- static word chx;//, chy, colpee;\r
+// static word chx;//, chy, colpee;\r
+ static word z;\r
// textInit();\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
VGAmodeX(1, 1, &gvar);\r
+// __asm{\r
+// mov ax,1112h ; load 8x8 character set into RAM\r
+// mov bl,0\r
+// int 10h\r
+// }\r
/* setup camera and screen~ */\r
gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);\r
//gvar.video.page[0].width += (16*2);\r
//++++ modexShowPage(&gvar.video.page[0]);\r
//modexprint(16, 16, 1, 15, "wwww");\r
//getch();\r
- chx=0;\r
+// chx=0;\r
// chy=0;\r
// colpee=32;\r
+ bios_cls();\r
/* position the cursor to home */\r
vga_moveto(0,0);\r
vga_sync_bios_cursor();\r
- for(e=0x00; e<=0xFE; e++)\r
+ for(e=0x00, z=0; e<=0xFE; e++, z++)\r
{\r
- if(chx+8>(gvar.video.page[0].width/2))\r
+ //if(chx+8>(gvar.video.page[0].width/2))\r
+ if((z)+1>16)\r
{\r
- chx=0;\r
- printf("\n");\r
+// chx=0;\r
// chy+=8;\r
// sprintf(pee,"%u", colpee);\r
// modexprint(&gvar.video.page[0], 200, 200, 1, 47, 0, &pee, 1);\r
+ z=0;\r
+ printf("\n");\r
//getch();\r
}\r
- printf("%c", e);\r
+ //printf("%zc", e);\r
// modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e, 1);\r
- chx+=9;\r
+// chx+=9;\r
// colpee++;\r
// if(colpee>=32+24) colpee=32;\r
}\r
// spin\r
}\r
}*/\r
+\r
+void bios_cls() {\r
+ VGA_ALPHA_PTR ap;\r
+ VGA_RAM_PTR rp;\r
+ unsigned char m;\r
+\r
+ m = int10_getmode();\r
+ if ((rp=vga_state.vga_graphics_ram) != NULL && !(m <= 3 || m == 7)) {\r
+ unsigned int i,im;\r
+\r
+ im = (FP_SEG(vga_state.vga_graphics_ram_fence) - FP_SEG(vga_state.vga_graphics_ram));\r
+ if (im > 0xFFE) im = 0xFFE;\r
+ im <<= 4;\r
+ for (i=0;i < im;i++) vga_state.vga_graphics_ram[i] = 0;\r
+ }\r
+ else if ((ap=vga_state.vga_alpha_ram) != NULL) {\r
+ unsigned int i,im;\r
+\r
+ im = (FP_SEG(vga_state.vga_alpha_ram_fence) - FP_SEG(vga_state.vga_alpha_ram));\r
+ if (im > 0x7FE) im = 0x7FE;\r
+ im <<= 4 - 1; /* because ptr is type uint16_t */\r
+ for (i=0;i < im;i++) vga_state.vga_alpha_ram[i] = 0x0720;\r
+ }\r
+ else {\r
+ printf("WARNING: bios cls no ptr\n");\r
+ }\r
+}\r