]> 4ch.mooo.com Git - 16.git/commitdiff
16.c needs to probe DOS and VGA before using modex library.
authorJonathan Campbell <jonathan@castus.tv>
Sun, 17 Apr 2016 06:58:17 +0000 (23:58 -0700)
committerJonathan Campbell <jonathan@castus.tv>
Sun, 17 Apr 2016 06:58:17 +0000 (23:58 -0700)
now it works without crashing.

src/16.c

index bfe777e253ad2ed5b686b1b9be92fd29e54c4cc3..27c17a58c57641cb14d8324a26b040567f53b8d0 100755 (executable)
--- a/src/16.c
+++ b/src/16.c
@@ -32,6 +32,27 @@ player_t player[MaxPlayers];
 void\r
 main(int argc, char *argv[])\r
 {\r
+       // DOSLIB: check our environment\r
+       probe_dos();\r
+\r
+       // DOSLIB: what CPU are we using?\r
+       // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.\r
+       //      So this code by itself shouldn't care too much what CPU it's running on. Except that other\r
+       //      parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for\r
+       //      the CPU to carry out tasks. --J.C.\r
+       cpu_probe();\r
+\r
+       // DOSLIB: check for VGA\r
+       if (!probe_vga()) {\r
+               printf("VGA probe failed\n");\r
+               return;\r
+       }\r
+       // hardware must be VGA or higher!\r
+       if (!(vga_state.vga_flags & VGA_IS_VGA)) {\r
+               printf("This program requires VGA or higher graphics hardware\n");\r
+               return;\r
+       }\r
+\r
        //screen = modexDefaultPage();\r
        engi_stat = ENGI_RUN;\r
        //textInit();\r