X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tail.c;h=b2acec13763597edfd912d1461b82f605965490e;hb=989f287818c93cf9b1ff96c13e66720571210513;hp=8ebc0c35058e108e866ef7b77db4150988c70f4c;hpb=093c85d77838f681dee4a6cf13264a3e30b63d4f;p=16.git diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index 8ebc0c35..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); +} + + //=========================================================================== /* @@ -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 ();