From: sparky4 Date: Sun, 17 Apr 2016 23:19:42 +0000 (-0500) Subject: dang it./wbuild.sh X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=17f60b63aafe3f54c42f8141ba45bb45bc0e4982 dang it./wbuild.sh --- diff --git a/16.exe b/16.exe deleted file mode 100755 index f243a6b6..00000000 Binary files a/16.exe and /dev/null differ diff --git a/bakapi.exe b/bakapi.exe deleted file mode 100755 index b762938e..00000000 Binary files a/bakapi.exe and /dev/null differ diff --git a/exmmtest.exe b/exmmtest.exe deleted file mode 100755 index cc4eb9a4..00000000 Binary files a/exmmtest.exe and /dev/null differ diff --git a/fmemtest.exe b/fmemtest.exe deleted file mode 100755 index b8bc18b0..00000000 Binary files a/fmemtest.exe and /dev/null differ diff --git a/fontgfx.exe b/fontgfx.exe deleted file mode 100755 index 23909ae1..00000000 Binary files a/fontgfx.exe and /dev/null differ diff --git a/fonttest.exe b/fonttest.exe deleted file mode 100755 index 7df23f11..00000000 Binary files a/fonttest.exe and /dev/null differ diff --git a/inputest.exe b/inputest.exe deleted file mode 100755 index da99804b..00000000 Binary files a/inputest.exe and /dev/null differ diff --git a/makefile b/makefile index da98dc4f..33c33aeb 100755 --- a/makefile +++ b/makefile @@ -81,7 +81,7 @@ DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) 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 @@ -131,8 +131,8 @@ fonttest.exe: fonttest.$(OBJ) $(16LIBOBJS) gfx.lib #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 @@ -292,8 +292,11 @@ $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib: 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 diff --git a/maptest.exe b/maptest.exe deleted file mode 100755 index 575de090..00000000 Binary files a/maptest.exe and /dev/null differ diff --git a/palettec.exe b/palettec.exe deleted file mode 100755 index f0499ca9..00000000 Binary files a/palettec.exe and /dev/null differ diff --git a/palettel.exe b/palettel.exe deleted file mode 100755 index b8dba39b..00000000 Binary files a/palettel.exe and /dev/null differ diff --git a/pcx2vrl b/pcx2vrl index bd947e55..3d9ac6e6 100755 Binary files a/pcx2vrl and b/pcx2vrl differ diff --git a/pcxsscut b/pcxsscut index 1deec74d..d743ac3b 100755 Binary files a/pcxsscut and b/pcxsscut differ diff --git a/pcxtest.exe b/pcxtest.exe deleted file mode 100755 index 4c292953..00000000 Binary files a/pcxtest.exe and /dev/null differ diff --git a/pcxtest2.exe b/pcxtest2.exe deleted file mode 100755 index 2a7e8f63..00000000 Binary files a/pcxtest2.exe and /dev/null differ diff --git a/planrpcx.exe b/planrpcx.exe deleted file mode 100755 index f05646b6..00000000 Binary files a/planrpcx.exe and /dev/null differ diff --git a/scroll.exe b/scroll.exe deleted file mode 100755 index be8d1762..00000000 Binary files a/scroll.exe and /dev/null differ diff --git a/src/fontgfx.c b/src/fontgfx.c index 1fb477df..112aaaa0 100755 --- a/src/fontgfx.c +++ b/src/fontgfx.c @@ -25,6 +25,11 @@ //#include "lib/16text.h" #include "lib/modex16.h" +#include +#include +#include +#include + global_game_variables_t gvar; void main(int argc, char near *argv[]) @@ -61,9 +66,36 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ ,'___...---~~~\n\ "; // static byte *rosa; - static word chx;//, chy, colpee; +// static word chx;//, chy, colpee; + static word z; // textInit(); + + // DOSLIB: check our environment + probe_dos(); + + // DOSLIB: what CPU are we using? + // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. + // So this code by itself shouldn't care too much what CPU it's running on. Except that other + // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for + // the CPU to carry out tasks. --J.C. + cpu_probe(); + + // DOSLIB: check for VGA + if (!probe_vga()) { + printf("VGA probe failed\n"); + return; + } + // hardware must be VGA or higher! + if (!(vga_state.vga_flags & VGA_IS_VGA)) { + printf("This program requires VGA or higher graphics hardware\n"); + return; + } VGAmodeX(1, 1, &gvar); +// __asm{ +// mov ax,1112h ; load 8x8 character set into RAM +// mov bl,0 +// int 10h +// } /* setup camera and screen~ */ gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); //gvar.video.page[0].width += (16*2); @@ -71,26 +103,29 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ //++++ modexShowPage(&gvar.video.page[0]); //modexprint(16, 16, 1, 15, "wwww"); //getch(); - chx=0; +// chx=0; // chy=0; // colpee=32; + bios_cls(); /* position the cursor to home */ vga_moveto(0,0); vga_sync_bios_cursor(); - for(e=0x00; e<=0xFE; e++) + for(e=0x00, z=0; e<=0xFE; e++, z++) { - if(chx+8>(gvar.video.page[0].width/2)) + //if(chx+8>(gvar.video.page[0].width/2)) + if((z)+1>16) { - chx=0; - printf("\n"); +// chx=0; // chy+=8; // sprintf(pee,"%u", colpee); // modexprint(&gvar.video.page[0], 200, 200, 1, 47, 0, &pee, 1); + z=0; + printf("\n"); //getch(); } - printf("%c", e); + //printf("%zc", e); // modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e, 1); - chx+=9; +// chx+=9; // colpee++; // if(colpee>=32+24) colpee=32; } diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 6f8d64fa..c1c8eb5d 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -1045,3 +1045,30 @@ modexWaitBorder() { // spin } }*/ + +void bios_cls() { + VGA_ALPHA_PTR ap; + VGA_RAM_PTR rp; + unsigned char m; + + m = int10_getmode(); + if ((rp=vga_state.vga_graphics_ram) != NULL && !(m <= 3 || m == 7)) { + unsigned int i,im; + + im = (FP_SEG(vga_state.vga_graphics_ram_fence) - FP_SEG(vga_state.vga_graphics_ram)); + if (im > 0xFFE) im = 0xFFE; + im <<= 4; + for (i=0;i < im;i++) vga_state.vga_graphics_ram[i] = 0; + } + else if ((ap=vga_state.vga_alpha_ram) != NULL) { + unsigned int i,im; + + im = (FP_SEG(vga_state.vga_alpha_ram_fence) - FP_SEG(vga_state.vga_alpha_ram)); + if (im > 0x7FE) im = 0x7FE; + im <<= 4 - 1; /* because ptr is type uint16_t */ + for (i=0;i < im;i++) vga_state.vga_alpha_ram[i] = 0x0720; + } + else { + printf("WARNING: bios cls no ptr\n"); + } +} diff --git a/src/lib/modex16.h b/src/lib/modex16.h index acdf63e9..fe96a78f 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -129,6 +129,7 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c void modexpdump(page_t *pee); void modexcls(page_t *page, byte color, byte *Where); //void modexWaitBorder(); +void bios_cls(); /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ diff --git a/test.exe b/test.exe deleted file mode 100755 index 9fb706c6..00000000 Binary files a/test.exe and /dev/null differ diff --git a/test2.exe b/test2.exe deleted file mode 100755 index 0b19f957..00000000 Binary files a/test2.exe and /dev/null differ diff --git a/tesuto.exe b/tesuto.exe deleted file mode 100755 index 6c8c4e35..00000000 Binary files a/tesuto.exe and /dev/null differ diff --git a/vgmtest.exe b/vgmtest.exe deleted file mode 100755 index 2ba020fe..00000000 Binary files a/vgmtest.exe and /dev/null differ diff --git a/vrl2vrs b/vrl2vrs index b67956b7..acdd4bda 100755 Binary files a/vrl2vrs and b/vrl2vrs differ diff --git a/vrsdump b/vrsdump index dbaba30e..8ba0497d 100755 Binary files a/vrsdump and b/vrsdump differ