From 75f96fbcc84be6379ff155c1635070054c48c971 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Sun, 3 Apr 2016 22:49:12 -0700 Subject: [PATCH] doslib probe DOS, CPU, and VGA. exit politely if not VGA. --- git_con.fig | 22 +++++++--------------- src/bakapi.c | 26 +++++++++++++++++++++----- src/lib/doslib | 2 +- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/git_con.fig b/git_con.fig index 9c560e30..927bd4df 100755 --- a/git_con.fig +++ b/git_con.fig @@ -3,21 +3,13 @@ filemode = true bare = false logallrefupdates = true -[remote "x4"] - url = ssh://sparky4@4ch.mooo.com:26/var/www/16/16.git - fetch = +refs/heads/*:refs/remotes/x4/* +[remote "origin"] + url = https://github.com/sparky4/16 + fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master -[remote "origin"] - url = git@github.com:sparky4/16.git - fetch = +refs/heads/*:refs/remotes/origin/* -[remote "sf"] - url = ssh://sparky4q@git.code.sf.net/p/project16/code - fetch = +refs/heads/*:refs/remotes/sf/* -[remote "jp"] - url = ssh://sparky4@git.pf.osdn.jp:/gitroot/s/sp/sparky4/project16.git - fetch = +refs/heads/*:refs/remotes/jp/* -[remote "bb"] - url = git@bitbucket.org:sparky4/16.git - fetch = +refs/heads/*:refs/remotes/bb/* +[submodule "src/lib/doslib"] + url = https://github.com/joncampbell123/doslib.git +[submodule "src/lib/jsmn"] + url = https://github.com/zserge/jsmn.git diff --git a/src/bakapi.c b/src/bakapi.c index 28faa99d..9a5412c7 100755 --- a/src/bakapi.c +++ b/src/bakapi.c @@ -33,6 +33,27 @@ int ch=0x0; void main(int argc, char *argvar[]) { + // 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; + } + // main variables values d=4; // switch variable key=2; // default screensaver number @@ -44,11 +65,6 @@ main(int argc, char *argvar[]) #ifdef MXLIB VGAmodeX(1, &gvar); #else - probe_dos(); - if (!probe_vga()) { - printf("VGA probe failed\n"); - return 1; - } int10_setmode(19); update_state_from_vga(); vga_enable_256color_modex(); // VGA mode X diff --git a/src/lib/doslib b/src/lib/doslib index 8b416710..b84bf02a 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 8b4167100563ce243bb334dfa58da6314756cca2 +Subproject commit b84bf02ac8fffdfc6ff569a36efe57ed3a450ef0 -- 2.39.5