wwww
リビジョン | 0b27dec43b461090fb2b9770f031dd230a9a0f75 (tree) |
---|---|
日時 | 2016-04-17 15:58:17 |
作者 | Jonathan Campbell <jonathan@cast...> |
コミッター | Jonathan Campbell |
16.c needs to probe DOS and VGA before using modex library.
now it works without crashing.
@@ -32,6 +32,27 @@ player_t player[MaxPlayers]; | ||
32 | 32 | void |
33 | 33 | main(int argc, char *argv[]) |
34 | 34 | { |
35 | + // DOSLIB: check our environment | |
36 | + probe_dos(); | |
37 | + | |
38 | + // DOSLIB: what CPU are we using? | |
39 | + // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. | |
40 | + // So this code by itself shouldn't care too much what CPU it's running on. Except that other | |
41 | + // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for | |
42 | + // the CPU to carry out tasks. --J.C. | |
43 | + cpu_probe(); | |
44 | + | |
45 | + // DOSLIB: check for VGA | |
46 | + if (!probe_vga()) { | |
47 | + printf("VGA probe failed\n"); | |
48 | + return; | |
49 | + } | |
50 | + // hardware must be VGA or higher! | |
51 | + if (!(vga_state.vga_flags & VGA_IS_VGA)) { | |
52 | + printf("This program requires VGA or higher graphics hardware\n"); | |
53 | + return; | |
54 | + } | |
55 | + | |
35 | 56 | //screen = modexDefaultPage(); |
36 | 57 | engi_stat = ENGI_RUN; |
37 | 58 | //textInit(); |