From 0b27dec43b461090fb2b9770f031dd230a9a0f75 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Sat, 16 Apr 2016 23:58:17 -0700 Subject: [PATCH] 16.c needs to probe DOS and VGA before using modex library. now it works without crashing. --- src/16.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/16.c b/src/16.c index bfe777e2..27c17a58 100755 --- a/src/16.c +++ b/src/16.c @@ -32,6 +32,27 @@ player_t player[MaxPlayers]; void main(int argc, char *argv[]) { + // 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; + } + //screen = modexDefaultPage(); engi_stat = ENGI_RUN; //textInit(); -- 2.39.2