qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/3] vga: fix CGA 640x200 mode


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 3/3] vga: fix CGA 640x200 mode
Date: Sat, 8 Aug 2015 15:11:09 +0200

SeaBIOS programs the CGA 2-color 640x200 mode with 0xC1 in the maximum
scan line register.  Ordinarily, this would mean 100 vertical lines,
but the CGA modes ignore bits 4:0 (DOSBox's BIOS also uses 0xC1).
Unfortunately, the test used to catch CGA modes worked for 4-color
320x200 graphics, but not for the 2-color 640x200 mode.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 hw/display/vga.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/display/vga.c b/hw/display/vga.c
index 19dcb6b..7d4e1b0 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1442,12 +1442,11 @@ static void vga_draw_graphic(VGACommonState *s, int 
full_update)
 
     shift_control = (s->gr[VGA_GFX_MODE] >> 5) & 3;
     double_scan = (s->cr[VGA_CRTC_MAX_SCAN] >> 7);
-    if (shift_control != 1) {
+    if (s->cr[VGA_CRTC_MODE] & 1) {
         multi_scan = (((s->cr[VGA_CRTC_MAX_SCAN] & 0x1f) + 1) << double_scan)
             - 1;
     } else {
         /* in CGA modes, multi_scan is ignored */
-        /* XXX: is it correct ? */
         multi_scan = double_scan;
     }
     multi_run = multi_scan;
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]