aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMatthew Ogilvie <mmogilvi_qemu@miniinfo.net>2012-08-23 00:24:42 -0600
committermalc <av1474@comtv.ru>2012-08-24 07:44:39 +0400
commit482f7bf86b43af9f6903c52726fedf82b28bf953 (patch)
treea7c926204eeb43cc3f9b3d15f39c05f6c0717613 /vl.c
parent39dda260628e5f2a3fd2ce2ec8a71f3d5ca309a9 (diff)
vga: add some optional CGA compatibility hacks
This patch adds some optional compatibility hacks (default disabled) to allow Microport UNIX to function under qemu. I've tried to structure it to be easy to add more hacks for other old CGA programs, if anyone ever needs them. Microport UNIX System V/386 v 2.1 (ca 1987) tries to program the CGA registers directly with neither the assistance of BIOS, nor with proper handling of EGA/VGA-only registers. Note that it didn't work on real VGA hardware, either (although in that case, the most obvious problems seemed to be out-of-range hsync and/or vsync signalling, rather than the issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net> Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index febfd62c37..16d04a2ee2 100644
--- a/vl.c
+++ b/vl.c
@@ -179,6 +179,7 @@ int main(int argc, char **argv)
static const char *data_dir;
const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
+int vga_cga_hacks = 0;
DisplayType display_type = DT_DEFAULT;
int display_remote = 0;
const char* keyboard_layout = NULL;
@@ -1748,6 +1749,28 @@ static void select_vgahw (const char *p)
else if (strstart(opts, "precise", &nextopt))
vga_retrace_method = VGA_RETRACE_PRECISE;
else goto invalid_vga;
+ } else if (strstart(opts, ",cga_hacks=", &nextopt)) {
+ opts = nextopt;
+ while (*opts) {
+ if (strstart(opts, "all", &nextopt)) {
+ opts = nextopt;
+ vga_cga_hacks |= ~0;
+ } else if (strstart(opts, "palette_blanking", &nextopt)) {
+ opts = nextopt;
+ vga_cga_hacks |= VGA_CGA_HACK_PALETTE_BLANKING;
+ } else if (strstart(opts, "font_height", &nextopt)) {
+ opts = nextopt;
+ vga_cga_hacks |= VGA_CGA_HACK_FONT_HEIGHT;
+ } else {
+ break;
+ }
+
+ if (*opts == '+') {
+ opts++;
+ } else {
+ break;
+ }
+ }
} else goto invalid_vga;
opts = nextopt;
}