X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2F16_tail.c;h=b2acec13763597edfd912d1461b82f605965490e;hb=704ec571885c6255ead65280428ad72510cfe218;hp=f9f6fb569914e1972fd52b528b4786f82ca5cea2;hpb=5965823c934f177a5ef1cd30ae9ee5dda2a95154;p=16.git diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index f9f6fb56..b2acec13 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -25,6 +25,83 @@ #include "src/lib/16_tail.h" +/* +========================== += += Startup16 += += Load a few things right away += +========================== +*/ + +void Startup16(global_game_variables_t *gvar) +{ +#ifdef __WATCOMC__ + // 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; + } + + if (_DEBUG_INIT() == 0) { +#ifdef DEBUGSERIAL + printf("WARNING: Failed to initialize DEBUG output\n"); +#endif + } + _DEBUG("Serial debug output started\n"); // NTS: All serial output must end messages with newline, or DOSBox-X will not emit text to log + _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); +#endif + gvar->mm.mmstarted=0; + gvar->pm.PMStarted=0; + MM_Startup(gvar); + IN_Startup(gvar); + PM_Startup(gvar); + PM_UnlockMainMem(gvar); + CA_Startup(gvar); +#ifdef __WATCOMC__ + start_timer(gvar); + +#endif + +} + +//=========================================================================== + +/* +========================== += += Shutdown16 += += Shuts down all ID_?? managers += +========================== +*/ + +void Shutdown16(global_game_variables_t *gvar) +{ + PM_Shutdown(gvar); + IN_Shutdown(gvar); + CA_Shutdown(gvar); + MM_Shutdown(gvar); +} + + //=========================================================================== /* @@ -55,7 +132,7 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q) printf(" DebugMemory_\n"); printf("========================================\n");} if(q) { printf("Memory Usage\n"); - printf("------------\n"); }else printf(" "); + printf("------------\n"); }else printf(" %c%c", 0xD3, 0xC4); printf("Total: "); if(q) printf(" "); printf("%uk", gvar->mmi.mainmem/1024); if(q) printf("\n"); else printf(" "); printf("Free: "); if(q) printf(" "); printf("%uk", MM_UnusedMemory(gvar)/1024); @@ -78,8 +155,8 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q) void Quit (char *error) { - unsigned finscreen; - memptr screen; + //unsigned finscreen; + memptr screen=0; union REGS in, out; //ClearMemory ();