From: sparky4 Date: Fri, 14 Apr 2017 20:26:49 +0000 (-0500) Subject: p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I... X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=f2a811af6076e5d139acaef8c0fcf7c40244d8ed p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] MM_ShowMemory is quite buggy on real machines. i need to debug it and fix added a struct printer[gvar.mm is FUCKING HUGE 14402 bytes FAT\!]16_rf now compiles BT UNKNOWN ON WHAT IT DOSE\! text box creates a ghost because page 1 do not have bg info thus it is stored and saved.... wwww fizzfade being worked on and no idea how to make it work...[xcroll is not working right FUCK] --- diff --git a/DEBUG.16B b/DEBUG.16B new file mode 100755 index 00000000..a278ea53 --- /dev/null +++ b/DEBUG.16B @@ -0,0 +1,210 @@ +Seg:0 Size:5524 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++_0 +Seg:1594 Size:256 Owner:0x6d31 +_0 +Seg:1694 Size:256 Owner:0x3316 +_0 +Seg:1794 Size:256 Owner:0x3318 +_0 +Seg:1894 Size:256 Owner:0x331a +_0 +Seg:1994 Size:256 Owner:0x331c +_0 +Seg:1a94 Size:256 Owner:0x331e +_0 +Seg:1b94 Size:256 Owner:0x3320 +_0 +Seg:1c94 Size:256 Owner:0x3322 +_0 +Seg:1d94 Size:256 Owner:0x3324 +_0 +Seg:1e94 Size:256 Owner:0x3326 +_00 +Seg:1fde Size:34 Owner:0x0 +_0 +Seg:2000 Size:256 Owner:0x3328 +_0 +Seg:2100 Size:256 Owner:0x332a +_0 +Seg:2200 Size:256 Owner:0x332c +_0 +Seg:2300 Size:256 Owner:0x332e +_0 +Seg:2400 Size:256 Owner:0x3330 +_0 +Seg:2500 Size:256 Owner:0x3332 +_0 +Seg:2600 Size:256 Owner:0x3334 +_0 +Seg:2700 Size:256 Owner:0x3336 +_0 +Seg:2800 Size:256 Owner:0x3338 +_0 +Seg:2900 Size:256 Owner:0x333a +_0 +Seg:2a00 Size:256 Owner:0x333c +_0 +Seg:2b00 Size:256 Owner:0x333e +_0 +Seg:2c00 Size:256 Owner:0x3340 +_0 +Seg:2d00 Size:256 Owner:0x3342 +_0 +Seg:2e00 Size:256 Owner:0x3344 +_0 +Seg:2f00 Size:256 Owner:0x3346 +_0 +Seg:3000 Size:256 Owner:0x3348 +_0 +Seg:3100 Size:256 Owner:0x334a +_0 +Seg:3200 Size:256 Owner:0x334c +_0 +Seg:3300 Size:256 Owner:0x334e +_0 +Seg:3400 Size:256 Owner:0x3350 +_0 +Seg:3500 Size:256 Owner:0x3352 +_0 +Seg:3600 Size:256 Owner:0x3354 +_0 +Seg:3700 Size:256 Owner:0x3356 +_0 +Seg:3800 Size:256 Owner:0x3358 +_0 +Seg:3900 Size:256 Owner:0x335a +_0 +Seg:3a00 Size:256 Owner:0x335c +_0 +Seg:3b00 Size:256 Owner:0x335e +_0 +Seg:3c00 Size:256 Owner:0x3360 +_0 +Seg:3d00 Size:256 Owner:0x3362 +_0 +Seg:3e00 Size:256 Owner:0x3364 +_0 +Seg:3f00 Size:256 Owner:0x3366 +_0 +Seg:4000 Size:256 Owner:0x3368 +_0 +Seg:4100 Size:256 Owner:0x336a +_0 +Seg:4200 Size:256 Owner:0x336c +_0 +Seg:4300 Size:256 Owner:0x336e +_0 +Seg:4400 Size:256 Owner:0x3370 +_0 +Seg:4500 Size:256 Owner:0x3372 +_0 +Seg:4600 Size:256 Owner:0x3374 +_0 +Seg:4700 Size:256 Owner:0x3376 +_0 +Seg:4800 Size:256 Owner:0x3378 +_0 +Seg:4900 Size:256 Owner:0x337a +_0 +Seg:4a00 Size:256 Owner:0x337c +_0 +Seg:4b00 Size:256 Owner:0x337e +_0 +Seg:4c00 Size:256 Owner:0x3380 +_0 +Seg:4d00 Size:256 Owner:0x3382 +_0 +Seg:4e00 Size:256 Owner:0x3384 +_0 +Seg:4f00 Size:256 Owner:0x3386 +_0 +Seg:5000 Size:256 Owner:0x3388 +_0 +Seg:5100 Size:256 Owner:0x338a +_0 +Seg:5200 Size:256 Owner:0x338c +_0 +Seg:5300 Size:256 Owner:0x338e +_0 +Seg:5400 Size:256 Owner:0x3390 +_0 +Seg:5500 Size:256 Owner:0x3392 +_0 +Seg:5600 Size:256 Owner:0x3394 +_0 +Seg:5700 Size:256 Owner:0x3396 +_0 +Seg:5800 Size:256 Owner:0x3398 +_0 +Seg:5900 Size:256 Owner:0x339a +_0 +Seg:5a00 Size:256 Owner:0x339c +_0 +Seg:5b00 Size:256 Owner:0x339e +_0 +Seg:5c00 Size:256 Owner:0x33a0 +_0 +Seg:5d00 Size:256 Owner:0x33a2 +_0 +Seg:5e00 Size:256 Owner:0x33a4 +_0 +Seg:5f00 Size:256 Owner:0x33a6 +_0 +Seg:6000 Size:256 Owner:0x33a8 +_0 +Seg:6100 Size:256 Owner:0x33aa +_0 +Seg:6200 Size:256 Owner:0x33ac +_0 +Seg:6300 Size:256 Owner:0x33ae +_0 +Seg:6400 Size:256 Owner:0x33b0 +_0 +Seg:6500 Size:256 Owner:0x33b2 +_0 +Seg:6600 Size:256 Owner:0x33b4 +_0 +Seg:6700 Size:256 Owner:0x33b6 +_0 +Seg:6800 Size:256 Owner:0x33b8 +_0 +Seg:6900 Size:256 Owner:0x33ba +_0 +Seg:6a00 Size:256 Owner:0x33bc +_0 +Seg:6b00 Size:256 Owner:0x33be +_0 +Seg:6c00 Size:256 Owner:0x33c0 +_0 +Seg:6d00 Size:256 Owner:0x33c2 +_0 +Seg:6e00 Size:256 Owner:0x33c4 +_0 +Seg:6f00 Size:256 Owner:0x33c6 +_0 +Seg:7000 Size:256 Owner:0x33c8 +_0 +Seg:7100 Size:256 Owner:0x33ca +_0 +Seg:7200 Size:256 Owner:0x33cc +_0 +Seg:7300 Size:256 Owner:0x33ce +_0 +Seg:7400 Size:256 Owner:0x33d0 +_0 +Seg:7500 Size:256 Owner:0x33d2 +_0 +Seg:7600 Size:256 Owner:0x33d4 +_0 +Seg:7700 Size:256 Owner:0x33d6 +_0 +Seg:7800 Size:256 Owner:0x33d8 +_0 +Seg:7900 Size:256 Owner:0x33da +_0 +Seg:7a00 Size:256 Owner:0x33dc +_0 +Seg:7b00 Size:273 Owner:0x6d31 +_00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Seg:9f3f Size:24768 Owner:0x0 +_ \ No newline at end of file diff --git a/DEBUG.16W b/DEBUG.16W new file mode 100755 index 00000000..6c2eb433 --- /dev/null +++ b/DEBUG.16W @@ -0,0 +1,212 @@ +Seg:0 Size:11373 Owner:0x0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++_000 +Seg:2d30 Size:36 Owner:0x0 +_0 +Seg:2d54 Size:256 Owner:0x5772 +_0 +Seg:2e54 Size:256 Owner:0x1dc0 +_0 +Seg:2f54 Size:256 Owner:0x1dc2 +_0 +Seg:3054 Size:256 Owner:0x1dc4 +_0 +Seg:3154 Size:256 Owner:0x1dc6 +_0 +Seg:3254 Size:256 Owner:0x1dc8 +_0 +Seg:3354 Size:256 Owner:0x1dca +_0 +Seg:3454 Size:256 Owner:0x1dcc +_0 +Seg:3554 Size:256 Owner:0x1dce +_0 +Seg:3654 Size:256 Owner:0x1dd0 +_0 +Seg:3754 Size:256 Owner:0x1dd2 +_0 +Seg:3854 Size:256 Owner:0x1dd4 +_0 +Seg:3954 Size:256 Owner:0x1dd6 +_0 +Seg:3a54 Size:256 Owner:0x1dd8 +_0 +Seg:3b54 Size:256 Owner:0x1dda +_0 +Seg:3c54 Size:256 Owner:0x1ddc +_0 +Seg:3d54 Size:256 Owner:0x1dde +_0 +Seg:3e54 Size:256 Owner:0x1de0 +_0 +Seg:3f54 Size:256 Owner:0x1de2 +_0 +Seg:4054 Size:256 Owner:0x1de4 +_0 +Seg:4154 Size:256 Owner:0x1de6 +_0 +Seg:4254 Size:256 Owner:0x1de8 +_0 +Seg:4354 Size:256 Owner:0x1dea +_0 +Seg:4454 Size:256 Owner:0x1dec +_0 +Seg:4554 Size:256 Owner:0x1dee +_0 +Seg:4654 Size:256 Owner:0x1df0 +_0 +Seg:4754 Size:256 Owner:0x1df2 +_0 +Seg:4854 Size:256 Owner:0x1df4 +_0 +Seg:4954 Size:256 Owner:0x1df6 +_0 +Seg:4a54 Size:256 Owner:0x1df8 +_0 +Seg:4b54 Size:256 Owner:0x1dfa +_0 +Seg:4c54 Size:256 Owner:0x1dfc +_0 +Seg:4d54 Size:256 Owner:0x1dfe +_0 +Seg:4e54 Size:256 Owner:0x1e00 +_0 +Seg:4f54 Size:256 Owner:0x1e02 +_0 +Seg:5054 Size:256 Owner:0x1e04 +_0 +Seg:5154 Size:256 Owner:0x1e06 +_0 +Seg:5254 Size:256 Owner:0x1e08 +_0 +Seg:5354 Size:256 Owner:0x1e0a +_0 +Seg:5454 Size:256 Owner:0x1e0c +_0 +Seg:5554 Size:256 Owner:0x1e0e +_0 +Seg:5654 Size:256 Owner:0x1e10 +_0 +Seg:5754 Size:256 Owner:0x1e12 +_0 +Seg:5854 Size:256 Owner:0x1e14 +_0 +Seg:5954 Size:256 Owner:0x1e16 +_0 +Seg:5a54 Size:256 Owner:0x1e18 +_0 +Seg:5b54 Size:256 Owner:0x1e1a +_0 +Seg:5c54 Size:256 Owner:0x1e1c +_0 +Seg:5d54 Size:256 Owner:0x1e1e +_0 +Seg:5e54 Size:256 Owner:0x1e20 +_0 +Seg:5f54 Size:256 Owner:0x1e22 +_0 +Seg:6054 Size:256 Owner:0x1e24 +_0 +Seg:6154 Size:256 Owner:0x1e26 +_0 +Seg:6254 Size:256 Owner:0x1e28 +_0 +Seg:6354 Size:256 Owner:0x1e2a +_0 +Seg:6454 Size:256 Owner:0x1e2c +_0 +Seg:6554 Size:256 Owner:0x1e2e +_0 +Seg:6654 Size:256 Owner:0x1e30 +_0 +Seg:6754 Size:256 Owner:0x1e32 +_0 +Seg:6854 Size:256 Owner:0x1e34 +_0 +Seg:6954 Size:256 Owner:0x1e36 +_0 +Seg:6a54 Size:256 Owner:0x1e38 +_0 +Seg:6b54 Size:256 Owner:0x1e3a +_0 +Seg:6c54 Size:256 Owner:0x1e3c +_0 +Seg:6d54 Size:256 Owner:0x1e3e +_0 +Seg:6e54 Size:256 Owner:0x1e40 +_0 +Seg:6f54 Size:256 Owner:0x1e42 +_0 +Seg:7054 Size:256 Owner:0x1e44 +_0 +Seg:7154 Size:256 Owner:0x1e46 +_0 +Seg:7254 Size:256 Owner:0x1e48 +_0 +Seg:7354 Size:256 Owner:0x1e4a +_0 +Seg:7454 Size:256 Owner:0x1e4c +_0 +Seg:7554 Size:256 Owner:0x1e4e +_0 +Seg:7654 Size:256 Owner:0x1e50 +_0 +Seg:7754 Size:256 Owner:0x1e52 +_0 +Seg:7854 Size:256 Owner:0x1e54 +_0 +Seg:7954 Size:256 Owner:0x1e56 +_0 +Seg:7a54 Size:256 Owner:0x1e58 +_0 +Seg:7b54 Size:256 Owner:0x1e5a +_0 +Seg:7c54 Size:256 Owner:0x1e5c +_0 +Seg:7d54 Size:256 Owner:0x1e5e +_0 +Seg:7e54 Size:256 Owner:0x1e60 +_0 +Seg:7f54 Size:256 Owner:0x1e62 +_0 +Seg:8054 Size:256 Owner:0x1e64 +_0 +Seg:8154 Size:256 Owner:0x1e66 +_0 +Seg:8254 Size:256 Owner:0x1e68 +_0 +Seg:8354 Size:256 Owner:0x1e6a +_0 +Seg:8454 Size:256 Owner:0x1e6c +_0 +Seg:8554 Size:256 Owner:0x1e6e +_0 +Seg:8654 Size:256 Owner:0x1e70 +_0 +Seg:8754 Size:256 Owner:0x1e72 +_0 +Seg:8854 Size:256 Owner:0x1e74 +_0 +Seg:8954 Size:256 Owner:0x1e76 +_0 +Seg:8a54 Size:256 Owner:0x1e78 +_0 +Seg:8b54 Size:256 Owner:0x1e7a +_0 +Seg:8c54 Size:256 Owner:0x1e7c +_0 +Seg:8d54 Size:256 Owner:0x1e7e +_0 +Seg:8e54 Size:256 Owner:0x1e80 +_0 +Seg:8f54 Size:256 Owner:0x1e82 +_0 +Seg:9054 Size:256 Owner:0x1e84 +_0 +Seg:9154 Size:256 Owner:0x1e86 +_0 +Seg:9254 Size:882 Owner:0x17f8 +_0 +Seg:95c6 Size:401 Owner:0x1da6 +_000000000000000000000000000 +Seg:9f93 Size:24684 Owner:0x0 +_ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W new file mode 100755 index 00000000..8efe9690 --- /dev/null +++ b/HEAP.16W @@ -0,0 +1,43 @@ + + == default == + + USED block at 284e0016 of size 136 + FREE block at 284e009e of size 22530 + USED block at 284e58a0 of size 20 + FREE block at 284e58b4 of size 8024 +OK - end of heap + + == near == + + USED block at 184dea96 of size 12 + USED block at 184deaa2 of size 364 + USED block at 184dec0e of size 52 + USED block at 184dec42 of size 20 + USED block at 184dec56 of size 20 + USED block at 184dec6a of size 20 + USED block at 184dec7e of size 20 + USED block at 184dec92 of size 20 + USED block at 184deca6 of size 4950 +OK - end of heap + + == far == + + USED block at 284e0016 of size 136 + USED block at 284e009e of size 22530 + USED block at 284e58a0 of size 20 + USED block at 284e58b4 of size 8024 +OK - end of heap + +Memory Type Total Used Free +---------------- -------- -------- -------- +Default 30710 156 30554 +Near 5478 528 4950 +Far 30710 156 30554 +---------------- -------- -------- -------- +HC_coreleft = 4948 +HC_farcoreleft = 458752 +HC_GetFreeSize = 30554 +HC_GetNearFreeSize = 4950 +HC_GetFarFreeSize = 30554 +memavl = 4948 +stackavail = 31484 diff --git a/MEMINFO.16B b/MEMINFO.16B new file mode 100755 index 00000000..e69de29b diff --git a/MEMINFO.16W b/MEMINFO.16W new file mode 100755 index 00000000..e69de29b diff --git a/MMDUMP.16B b/MMDUMP.16B new file mode 100755 index 00000000..5d7e8600 Binary files /dev/null and b/MMDUMP.16B differ diff --git a/MMDUMP.16W b/MMDUMP.16W new file mode 100755 index 00000000..8a5fd254 Binary files /dev/null and b/MMDUMP.16W differ diff --git a/bcexmm.dsk b/bcexmm.dsk index fb8a3fd5..1244a4fd 100755 Binary files a/bcexmm.dsk and b/bcexmm.dsk differ diff --git a/bcexmm.exe b/bcexmm.exe index c1a3808c..8241cd6c 100755 Binary files a/bcexmm.exe and b/bcexmm.exe differ diff --git a/bcexmm.prj b/bcexmm.prj index 4f33a902..4ac8b0f3 100755 Binary files a/bcexmm.prj and b/bcexmm.prj differ diff --git a/data/winrun.cfg b/data/winrun.cfg deleted file mode 100755 index be5f0482..00000000 --- a/data/winrun.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[autoexec] - -mount d . -d: -scroll.exe diff --git a/makefile b/makefile index 50c4ffcb..1579ffa2 100755 --- a/makefile +++ b/makefile @@ -36,7 +36,7 @@ # serial output is plain text ASCII. DEBUGSERIAL=1 -DELLOGFILE=1 +DELLOGFILE=0 #192x144 #wwww will add these @@ -286,8 +286,8 @@ pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib $(DOSLIB) #planrpcx.exe: planrpcx.$(OBJ) gfx.lib maptest.exe: maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIB) $(16LIB) fmemtest.exe: fmemtest.$(OBJ) -exmmtest.exe: exmmtest.$(OBJ) 16_pm.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) 16_mm.$(OBJ) 16_hc.$(OBJ) kitten.$(OBJ) 16_vl_1.$(OBJ) 16_tail.$(OBJ) 16_in.$(OBJ) 16_dbg.$(OBJ) -#$(16LIB) gfx.lib $(DOSLIB) +exmmtest.exe: exmmtest.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) +#16_pm.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) 16_mm.$(OBJ) 16_hc.$(OBJ) kitten.$(OBJ) 16_vl_1.$(OBJ) 16_tail.$(OBJ) 16_in.$(OBJ) 16_dbg.$(OBJ) vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIB) $(DOSLIB) gfx.lib db.exe: db.$(OBJ) ps.exe: ps.$(OBJ) 16_head.$(OBJ) diff --git a/src/bakapi.c b/src/bakapi.c index cc26c64c..8c2b3f73 100755 --- a/src/bakapi.c +++ b/src/bakapi.c @@ -31,10 +31,6 @@ sword vgamodex_mode = 1; // 1 = 320x240 with buffer void TL_VidInit(global_game_variables_t *gvar){} //int ch=0x0; -#define SETUPPAGEBAKAPI \ -gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); \ -gvar.video.page[1] = modexNextPage(&gvar.video.page[0]); - void main(int argc, char *argvar[]) @@ -42,9 +38,9 @@ main(int argc, char *argvar[]) static global_game_variables_t gvar; struct glob_game_vars *ggvv; char *a; - int i; - word panq=1, pand=0; - boolean panswitch=0; + int i,c; + word panq=1, pand=0,showding=0; + boolean panswitch=0,bptest=1,runding=1; ggvv=&gvar; @@ -75,52 +71,21 @@ main(int argc, char *argvar[]) } } - // 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; - } - textInit(); + // initiate doslib // + TL_DosLibStartup(&gvar); // main variables values d=4; // switch variable key=2; // default screensaver number - xpos=TILEWHD; - ypos=TILEWHD; - xdir=1; - ydir=1; + xpos=TILEWHD; ypos=TILEWHD; xdir=1; ydir=1; VGAmodeX(vgamodex_mode, 0, &gvar); // TODO: Suggestion: Instead of magic numbers for the first param, might I suggest defining an enum or some #define constants that are easier to remember? --J.C. // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in. // we'll integrate DOSLIB vga into that part of the code instead for less disruption. -- J.C. - - bakapee.xx = rand()&0%gvar.video.page[0].width; - bakapee.yy = rand()&0%gvar.video.page[0].height; - bakapee.gq = 0; - bakapee.sx= bakapee.sy=0; - bakapee.bakax= bakapee.bakay=0; - bakapee.coor=0; - + bakapee.xx = rand()&0%gvar.video.page[0].width; bakapee.yy = rand()&0%gvar.video.page[0].height; + bakapee.gq = 0; bakapee.sx=bakapee.sy=0; bakapee.bakax=bakapee.bakay=0; bakapee.coor=0; //once where #defines - bakapee.tile=0; - bakapee.bonk=400; - bakapee.lgq=32; - bakapee.hgq=55; + bakapee.tile=0; bakapee.bonk=400; bakapee.lgq=32; bakapee.hgq=55; switch(WCPU_detectcpu()) { @@ -132,39 +97,85 @@ main(int argc, char *argvar[]) break; } - /* setup camera and screen~ */ + // setup camera and screen~ // SETUPPAGEBAKAPI - //modexPalUpdate(bmp.palette); //____ - //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____ - //getch(); //____ - //VL_SetLineWidth (40, &gvar); - VL_ShowPage(&gvar.video.page[0], 1, 0); + BAKAPIINITFIZZTEST + + while (bptest) { - word w; - for(w=0;w<64000;w++) +/* if (key > 0) + {*/ + while (!kbhit() && runding) + { + //{ word w; for(w=0;w<(gvar.video.page[0].width*gvar.video.page[0].height);w++) {}} + ding(&gvar.video.page[showding], &bakapee, 4); + } + if (kbhit()) +// { + getch(); // eat keyboard input +// break; +// } +// }*/ + { - ding(&gvar.video.page[0], &bakapee, 2); -// ding(&gvar.video.page[1], &bakapee, 2); + + c = getch(); + switch (c) + { + case 27: // Escape key // + case '0': + default: + bptest = false; + break; + case 'b': // test tile change // + switch (bakapee.tile) + { + case 0: + bakapee.tile=1; + break; + case 1: + bakapee.tile=0; + break; + } + break; + case 'r': + runding = false; + BAKAPIINITFIZZTEST + break; + case 'e': + runding = 1; + break; + case 'z': + runding = false; + FIZZFADEFUN +// runding = true; + break; + case '3': + case '4': + runding = 1; + showding = c - '0' - 3; + break; + case '1': + case '2': + // case '5': + // case '6': + // case '9': + key = c - '0' - 1; + VL_ShowPage(&gvar.video.page[key], 1, 0); + break; + } } - modexClearRegion(&(gvar.video.page[1]), 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 14); - VL_ShowPage(&gvar.video.page[1], 0, 0); - while(!kbhit()){} getch(); - VL_ShowPage(&gvar.video.page[0], 0, 0); -#ifdef BAKAFIZZUNSIGNED - baka_FizzleFade (gvar.video.ofs.bufferofs, gvar.video.ofs.displayofs, gvar.video.page[0].width, gvar.video.page[0].height, 70, true, &gvar); -#else - baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, &gvar); -#endif } - while(!kbhit()){} + + +//while(!kbhit()){} // screen savers //#ifdef BOINK while(d>0) // on! { - int c; /* run screensaver routine until keyboard input */ while (key > 0) { if (kbhit()) { @@ -180,7 +191,7 @@ main(int argc, char *argvar[]) { ding(&gvar.video.page[1], &bakapee, 4); ding(&gvar.video.page[0], &bakapee, 4); - baka_FizzleFade (gvar.video.ofs.bufferofs, gvar.video.ofs.displayofs, gvar.video.page[0].width, gvar.video.page[0].height, 70, true, &gvar); + FIZZFADEFUN }else ding(&gvar.video.page[0], &bakapee, key); } else ding(&gvar.video.page[0], &bakapee, 2); if(panswitch!=0) diff --git a/src/bakapi.h b/src/bakapi.h index 0795f6c7..484646d7 100755 --- a/src/bakapi.h +++ b/src/bakapi.h @@ -30,5 +30,24 @@ //project 16 testing define switch for veiwing the contents of the video memory --sparky4 #define BOINK // what does this mean? --J.C. +//#define BDOFSCONV (unsigned __near) defed in 16_tdef +#define BOFSS BDOFSCONV (gvar.video.BOFS)//gvar.video.ofs.bufferofs +#define DOFSS BDOFSCONV (gvar.video.DOFS)//gvar.video.ofs.displayofs + +#define SETUPPAGEBAKAPI \ +gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); \ +gvar.video.page[1] = modexNextPage(&gvar.video.page[0]); + +#ifdef BAKAFIZZUNSIGNED +#define FIZZFADEFUN baka_FizzleFade (BOFSS, DOFSS, gvar.video.page[0].width, gvar.video.page[0].height, 70, true, &gvar); +#else +#define FIZZFADEFUN baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, &gvar); +#endif + +#define BAKAPIINITFIZZTEST \ + modexClearRegion(&(gvar.video.page[0]), 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 0); \ + modexClearRegion(&(gvar.video.page[1]), 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 14); \ + FIZZFADEFUN +//{ word w; for(w=0;w<(gvar.video.page[0].width*gvar.video.page[0].height);w++) { ding(&gvar.video.page[0], &bakapee, 2); } #endif /*__BAKAPI_H__*/ diff --git a/src/exmmtest.c b/src/exmmtest.c index fd849790..98708a88 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -44,11 +44,12 @@ //#define EXMMVERBOSE__ // #define PRINTBBDUMP #define BUFFDUMP + #ifdef __BORLANDC__ #define NOVID #endif #ifdef __WATCOMC__ -#define NOVID +//#define NOVID #endif @@ -69,8 +70,8 @@ //////////////////////////////////////////////////////////////////////////// #ifdef NOVID -void VL_Startup (global_game_variables_t *gvar){} -void VL_Shutdown (global_game_variables_t *gvar){} +void VL_Startup (global_game_variables_t *gvar){ gvar=gvar; } +void VL_Shutdown (global_game_variables_t *gvar){ gvar=gvar; } void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv) { printf("VGAmodeX dummy:\n %Fp %Fp %Fp\n", &vq, &cmem, gv); @@ -297,7 +298,7 @@ PRINTBB; KEYP VGAmodeX(0, 0, &gvar); #endif #endif -// MM_ShowMemory(&gvar); + MM_ShowMemory(&gvar); DebugMemory_(&gvar, 1); MM_DumpData(&gvar); MM_Report_(&gvar); diff --git a/src/lib/16_head.c b/src/lib/16_head.c index f0175d43..8786a9fd 100755 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -34,6 +34,13 @@ filesize(FILE *fp) return(size_of_file); } +// clrstdin() clear any leftover chars tha may be in stdin stream // +void clrstdin() +{ + int ch = 0; + while( ( ch = getchar() ) != '\n' && ch != EOF ); +} + //from http://stackoverflow.com/questions/2736753/how-to-remove-extension-from-file-name // remove_ext: removes the "extension" from a file spec. // mystr is the string to process. @@ -49,7 +56,6 @@ char *remove_ext (char* mystr, char dot, char sep) { char *retstr, *lastdot, *lastsep; // Error checks and allocate string. - if (mystr == NULL) return NULL; if ((retstr = malloc(strlen (mystr) + 1)) == NULL) @@ -85,7 +91,6 @@ char *remove_ext (char* mystr, char dot, char sep) { } - //from http://quiz.geeksforgeeks.org/c-program-cyclically-rotate-array-one/ void rotateR(byte *arr, byte n) { @@ -148,7 +153,7 @@ US_CheckParm(char *parm,char **strings) return(-1); } - +// for input test // byte dirchar(byte in) { byte out; diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 9fcf3668..0f0c74f7 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -197,8 +197,9 @@ typedef union REGPACK regs_t; #define INPUT_STATUS_1 0x03da -/* local function */ +// local function // long int filesize(FILE *fp); +void clrstdin(); char *remove_ext(char* mystr, char dot, char sep); void rotateR(byte arr[], byte n); void rotateL(byte arr[], byte n); diff --git a/src/lib/16_in.c b/src/lib/16_in.c index a3e3fabd..c543caf9 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -169,6 +169,7 @@ static Direction DirTable[] = // Quick lookup for total direction static void (*INL_KeyHook)(void); static void interrupt (*OldKeyVect)(void); static char *ParmStringsIN[] = {"nojoys","nomouse",nil}; +static void INL_StartKbd(void); // Internal routines diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 8ee134f0..7bd320ba 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1241,7 +1241,7 @@ void MM_SortMem(global_game_variables_t *gvar) if(aftersort) aftersort(); -// VW_ColorBorder (oldborder); + VL_ColorBorder (oldborder, &gvar->video); /*++++ if(playing) MM_SetLock((memptr *)&audiosegs[playing],false);*/ @@ -1258,17 +1258,20 @@ void MM_SortMem(global_game_variables_t *gvar) */ //#define MMSMSORTNEWTYPE +#define MMSHOWMEMOFFSET 0//(gvar->video.page[0].dx+(gvar->video.page[0].dy*gvar->video.page[0].stridew)) void MM_ShowMemory(global_game_variables_t *gvar) { mmblocktype far *scan; - unsigned color,temp,x,y,w; + unsigned color,temp,x,y ,w;//,bofstemp; sdword end,owner; byte scratch[160],scratch0[4096],str[16]; -// VL_SetLineWidth(40, gvar); - temp = gvar->video.ofs.bufferofs; - gvar->video.ofs.bufferofs = gvar->video.ofs.displayofs; +//-- VL_SetLineWidth(40, gvar); + //temp = gvar->video.ofs.bufferofs; + //gvar->video.ofs.bufferofs = gvar->video.ofs.displayofs; + temp = BDOFSCONV gvar->video.BOFS+MMSHOWMEMOFFSET; + gvar->video.BOFS = gvar->video.DOFS; scan = gvar->mm.mmhead; end = -1; w = 0; @@ -1303,13 +1306,14 @@ void MM_ShowMemory(global_game_variables_t *gvar) write(gvar->handle.debughandle,scratch,strlen(scratch)); Quit (gvar, "MM_ShowMemory: Memory block order currupted!"); } -#ifndef MMSMSORTNEWTYPE - end = scan->length-1; -#else +#ifdef MMSMSORTNEWTYPE end = scan->start+(scan->length)-1; +#else + end = scan->length-1; #endif - y = scan->start/320; - x = scan->start%320; + if(!gvar->video.page[0].width) gvar->video.page[0].width = 352; + y = scan->start/gvar->video.page[0].width; + x = scan->start%gvar->video.page[0].width; VW_Hlin(x,x+end,y,color,gvar); VL_Plot(x,y,15,gvar); for(w=(scan->start)/80;w<=end/80;w++) @@ -1317,7 +1321,8 @@ void MM_ShowMemory(global_game_variables_t *gvar) //printf("+ %u %lu\n", w, scan->length); strcat(scratch0, "+"); } -//++==++==optional strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_"); + //++==++==optional + strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_"); #ifdef MMSMSORTNEWTYPE if (scan->next && scan->next->start > end+1) #else @@ -1360,9 +1365,11 @@ void MM_ShowMemory(global_game_variables_t *gvar) strcat(scratch,"Seg:"); ultoa (scan->start,str,16); strcat (scratch,str); +// strcat(scratch, AABLACK); strcat(scratch,"\t"); strcat(scratch, AARESET); strcat (scratch,"\tSize:"); ultoa ((unsigned)scan->length,str,10); strcat (scratch,str); +// strcat(scratch, AABLACK); strcat(scratch,"\t"); strcat(scratch, AARESET); strcat (scratch,"\tOwner:0x"); owner = (unsigned)scan->useptr; ultoa (owner,str,16); @@ -1378,8 +1385,11 @@ void MM_ShowMemory(global_game_variables_t *gvar) CA_CloseDebug (gvar); IN_Ack(gvar); -//**** VW_SetLineWidth(64); - gvar->video.ofs.bufferofs = temp; +//-- VW_SetLineWidth(64); + //gvar->video.ofs.bufferofs = temp; + //bofstemp = BDOFSCONV gvar->video.BOFS;//+MMSHOWMEMOFFSET; + //bofstemp = temp; + gvar->video.BOFS = (byte __far *)temp; } diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index ec7023c8..6b08e0fb 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -243,27 +243,38 @@ void Shutdown16(global_game_variables_t *gvar) =================== */ -#define PIXPERFRAME 1600 - boolean FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar) { word p,pixperframe; unsigned drawofs,pagedelta; byte mask,maskb[8] = {1,2,4,8}; - unsigned x,y,frame ,esorig,q; - dword rndval; - word screenseg = SCREENSEG; + unsigned x,y,frame; + long rndval; + word screenseg; +#ifdef __WATCOMC__ + unsigned esorig;//,q; +#endif pagedelta = dest-source; - rndval = 1; esorig = 0; q = 16; + rndval = 1; +#ifdef __WATCOMC__ + esorig = 0;// q = 16; +#endif x = y = 0; - pixperframe = 76800/(dword)frames; + pixperframe = (dword)(gvar->video.page[0].width*gvar->video.page[0].height)/frames; + screenseg = SCREENSEG; IN_StartAck (gvar); +// modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0); +// modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15); + +#ifdef __WATCOMC__ __asm { mov [esorig],es } +#endif +// TimeCount= frame=0; do // while (1) { @@ -308,22 +319,19 @@ noxor: mov [WORD PTR rndval+2],dx } - if ((x>width || y>height) && (xwidth || y>height) +// if ((x>width || y>height) && (xvideo.ofs.ylookup[y]) + (x>>2); +// drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2); drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2); // // copy one pixel // -//* mask = x&3; VGAREADMAP(mask); mask = maskb[mask]; VGAMAPMASK(mask); -//*/ -// modexputPixel(&(gvar->video.page[0]), x, y, rand()%8); -// VL_Plot (x, y, 15, &(gvar->video.ofs)); __asm { mov di,[drawofs] @@ -337,11 +345,14 @@ noxor: } frame++; //-- while (TimeCountDLStarted) + return; // DOSLIB: check our environment probe_dos(); @@ -60,6 +71,24 @@ void TL_VidInit(global_game_variables_t *gvar) _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); textInit(); + gvar->DLStarted = true; +} + +//=========================================================================== + +/* +==================== += += TL_VidInit += +==================== +*/ + +void TL_VidInit(global_game_variables_t *gvar) +{ + start_timer(gvar); + + if(!gvar->DLStarted) TL_DosLibStartup(gvar); // get old video mode //in.h.ah = 0xf; diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 7ed1ae7d..fe5083a5 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -37,6 +37,10 @@ #define MAXPAGE 4 +#define BDOFSCONV (unsigned __near) +#define BOFS page[1].data +#define DOFS page[0].data + /* * typedefs of the game variables! */ @@ -380,8 +384,9 @@ typedef struct //ylookup[MAXSCANLINES], unsigned int offscreen_ofs; unsigned int pattern_ofs; - unsigned bufferofs,linewidth,displayofs; +// unsigned bufferofs,linewidth,displayofs; pan_t pan; + } ofs_t; //unfinished typedef struct @@ -717,6 +722,7 @@ typedef struct glob_game_vars player_t player[MaxPlayers]; // player vars map_view_t mv[4]; // sw_t sw; + boolean DLStarted; } global_game_variables_t; #ifdef __WATCOMC__ diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 88a153cb..882dd3d2 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -351,9 +351,9 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) } break; } -// VL_SetLineWidth (cm.offset, gv); - gv->video.ofs.displayofs = 0; - gv->video.ofs.bufferofs = gv->video.page[0].width*gv->video.page[0].height;//gvar->video.page[0].pagesize; +//-- VL_SetLineWidth (cm.offset, gv); + //gv->video.ofs.displayofs = 0; + //gv->video.ofs.bufferofs = gv->video.page[0].width*gv->video.page[0].height;//gvar->video.page[0].pagesize; // gv->video.curr_mode=vq; gv->video.VL_Started=1; } @@ -1033,6 +1033,7 @@ modexPalOverscan(word col) outp(PAL_DATA_REG, col); return col; } + //check 16_vl_1.c void modexputPixel(page_t *page, int x, int y, byte color) diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index a4337fea..6437e1b9 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -214,6 +214,7 @@ void modexPalWhite(); void modexPalUpdate(byte *p); void VL_modexPalScramble(byte *p); word modexPalOverscan(word col); +void VL_ColorBorder (int color, video_t *v); void VL_Plot (int x, int y, int color, global_game_variables_t *gvar); void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar); void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar); diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c index 0ad22064..a1257fdc 100755 --- a/src/lib/16_vl_1.c +++ b/src/lib/16_vl_1.c @@ -483,6 +483,25 @@ void VL_TestPaletteSet (video_t *v) v->fastpalette = false; } +/* +================== += += VL_ColorBorder += +================== +*/ + +void VL_ColorBorder (int color, video_t *v) +{ + union REGS in, out; + + in.h.ah = 0x10; + in.h.al = 0x01; + in.h.bh = color; + int86(0x10, &in, &out); + v->bordercolor = color; +} + /* ============================================================================= @@ -507,10 +526,13 @@ void VL_Plot (int x, int y, int color, global_game_variables_t *gvar) byte mask; VCLIPDEF + if(!gvar->video.VL_Started) return; + mask = pclip[x&3]; VGAMAPMASK(mask); //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(gvar->video.ofs.ylookup[y]+(x>>2))) = color; - *(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color; + //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color; + *(byte far *)MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+((y*gvar->video.page[0].stridew)+(x>>2))) = color; VGAMAPMASK(15); } @@ -532,13 +554,15 @@ void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_gam LRCLIPDEF + if(!gvar->video.VL_Started) return; + xbyte = x>>2; leftmask = lclip[x&3]; rightmask = rclip[(x+width-1)&3]; midbytes = ((x+width+3)>>2) - xbyte - 2; //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+xbyte); - dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+xbyte); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+xbyte); if (midbytes<0) { @@ -576,16 +600,19 @@ void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar byte far *dest,mask; VCLIPDEF + if(!gvar->video.VL_Started) return; + mask = pclip[x&3]; VGAMAPMASK(mask); //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2)); - dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2)); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2)); while (height--) { *dest = color; - dest += gvar->video.ofs.linewidth; + //dest += gvar->video.ofs.linewidth; + dest += gvar->video.page[0].stridew; } VGAMAPMASK(15); @@ -608,13 +635,16 @@ void VL_Bar (int x, int y, int width, int height, int color, global_game_variabl LRCLIPDEF + if(!gvar->video.VL_Started) return; + leftmask = lclip[x&3]; rightmask = rclip[(x+width-1)&3]; midbytes = ((x+width+3)>>2) - (x>>2) - 2; - linedelta = gvar->video.ofs.linewidth-(midbytes+1); + //linedelta = gvar->video.ofs.linewidth-(midbytes+1); + linedelta = gvar->video.page[0].stridew-(midbytes+1); //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2)); - dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2)); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2)); if (midbytes<0) { @@ -623,7 +653,8 @@ void VL_Bar (int x, int y, int width, int height, int color, global_game_variabl while (height--) { *dest = color; - dest += gvar->video.ofs.linewidth; + //dest += gvar->video.ofs.linewidth; + dest += gvar->video.page[0].stridew; } VGAMAPMASK(15); return; @@ -666,7 +697,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, glob width>>=2; //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2)); - dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2)); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2)); mask = 1 << (x&3); for (plane = 0; plane<4; plane++) @@ -677,7 +708,8 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, glob mask = 1; screen = dest; - for (y=0;yvideo.ofs.linewidth,source+=width) + //for (y=0;yvideo.ofs.linewidth,source+=width) + for (y=0;yvideo.page[0].stridew,source+=width) _fmemcpy (screen,source,width); } } diff --git a/src/lib/bakapee.c b/src/lib/bakapee.c index 26d7c802..3236d8d3 100755 --- a/src/lib/bakapee.c +++ b/src/lib/bakapee.c @@ -54,40 +54,45 @@ char global_temp_status_text2[512]; */ //extern ControlInfo c; -#define PIXPOSX gvar->video.page[0].sw/2 -#define PIXPOSY gvar->video.page[0].sh/2 +//#define PIXPOSX gvar->video.page[0].sw/2 +//#define PIXPOSY gvar->video.page[0].sh/2 #ifdef BAKAFIZZUNSIGNED boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar) { word p,pixperframe; unsigned drawofs,pagedelta; byte mask,maskb[8] = {1,2,4,8}; - unsigned x,y,frame ,esorig,q; - dword rndval; - word screenseg = SCREENSEG; + unsigned x,y,frame; + long rndval; + word screenseg; +#ifdef __WATCOMC__ + unsigned esorig;//,q; +#endif pagedelta = dest-source; - rndval = 1; esorig = 0; q = 16; + rndval = 1; +#ifdef __WATCOMC__ + esorig = 0;// q = 16; +#endif x = y = 0; - pixperframe = /*64000*/76800/(dword)frames; - -// IN_StartAck (); + pixperframe = (dword)(gvar->video.page[0].width*gvar->video.page[0].height)/frames;//64000/(dword)frames; + screenseg = SCREENSEG; -// VL_ShowPage(&(gvar->video.page[0]), 1, 0); -// VL_ShowPage(&(gvar->video.page[1]), 1, 0); +// IN_StartAck (gvar); // modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0); // modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15); -// VL_SetLineWidth(44, gvar); +#ifdef __WATCOMC__ __asm { mov [esorig],es } +#endif // TimeCount= frame=0; do // while (1) { - if (abortable && kbhit())//IN_CheckAck () ) + if (abortable && kbhit())//IN_CheckAck (gvar) ) return true; __asm { @@ -128,12 +133,10 @@ noxor: mov [WORD PTR rndval+2],dx } -// if (x>destpage->width || y>destpage->height) -// if (xsw || ysh) - if ((x>width || y>height) && (xwidth || y>height) +// if ((x>width || y>height) && (xvideo.ofs.ylookup[y]) + (x>>2); - //drawofs = source+((y+1)*gvar->video.page[0].stridew) + (x>>2); +// drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2); drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2); /* sprintf(global_temp_status_text, "draw - %Fp", drawofs); @@ -166,15 +169,17 @@ modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_te } frame++; //-- while (TimeCountDLStarted) + return; + + // 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; + } + + textInit(); + gvar->DLStarted = true; +} + //color ‚Ä‚·‚Æ void colortest(page_t *page, bakapee_t *pee) { diff --git a/src/lib/bakapee.h b/src/lib/bakapee.h index 2626e708..808bdb36 100755 --- a/src/lib/bakapee.h +++ b/src/lib/bakapee.h @@ -48,6 +48,7 @@ boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigne boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar); #endif void clrstdin(); +void TL_DosLibStartup(global_game_variables_t *gvar); void colortest(page_t *page, bakapee_t *pee); void colorz(page_t *page, bakapee_t *pee); void ssd(page_t *page, bakapee_t *pee, word svq); diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 4e9577bb..35062f70 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -1058,7 +1058,6 @@ void player_walk(player_t *player, map_view_t *map_v){ */ - void mapScroll(map_view_t *mv, player_t *player) { //word x, y; /* coordinate for drawing */ diff --git a/src/xcroll.c b/src/xcroll.c index 7b97a9af..891f15cd 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -125,13 +125,24 @@ void main(int argc, char *argv[]) #ifdef FADE modexPalSave(&gvar.video.palette); modexSavePalFile("data/g.pal", &gvar.video.palette); - modexPalBlack(); //so gvar.player will not see loadings~ + modexPalBlack(); //so player will not see loadings~ #endif // setup camera and screen~ modexHiganbanaPageSetup(&gvar.video); ZC_MVSetup(&gvar.mv, &map, &gvar); +#ifdef FADE + modexFadeOn(4, &gvar.video.palette); +#endif + + IN_StartAck (&gvar); + MM_ShowMemory(&gvar); + while (!IN_CheckAck (&gvar)){} +#ifdef FADE + modexPalBlack(); //so player will not see loadings~ +#endif + // set up paging //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen mapGoTo(&gvar.mv, 0, 0); @@ -153,6 +164,7 @@ void main(int argc, char *argv[]) // while(!gvar.in.inst->Keyboard[sc_Escape) && !gvar.in.inst->Keyboard[sc_Space) && !gvar.in.inst->Keyboard[sc_Enter]){ FUNCTIONKEYSHOWMV } gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH; gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH; + shinku(&gvar); //modexpdump(gvar.mv[0].page); #ifdef FADE