If you change the video resolution while running a Windows XP image such that
it uses fewer bytes of VRAM (either by using fewer bytes per pixel or by
lowering the resolution) then some window backgrounds will become corrupted.
This happens because the Windows XP Cirrus Logic driver assumes that VRAM is
initialized to 0xff whenever the video mode switches between VGA and SVGA.

This patch fixes this problem by resetting VRAM whenever a VGA/SVGA mode switch
occurs.

Signed-off-by: [EMAIL PROTECTED]

-- 
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[EMAIL PROTECTED]
Ph: (303)440-1368


--- qemu-0.8.0-/hw/cirrus_vga.c 2005-12-19 15:51:53.000000000 -0700
+++ qemu-0.8.0/hw/cirrus_vga.c  2006-05-04 10:14:28.000000000 -0600
@@ -1185,6 +1185,17 @@
        s->hw_cursor_y = (reg_value << 3) | (reg_index >> 5);
        break;
     case 0x07:                 // Extended Sequencer Mode
+       /* Win2K seems to assume that the VRAM is set to 0xff
+        *   whenever VGA/SVGA mode changes
+        */
+       if ((s->sr[0x07] ^ reg_value) & CIRRUS_SR7_BPP_SVGA)
+           memset(s->vram_ptr, 0xff, s->real_vram_size);
+       s->sr[0x07] = reg_value;
+#ifdef DEBUG_CIRRUS
+       printf("cirrus: handled outport sr_index %02x, sr_value %02x\n",
+              reg_index, reg_value);
+#endif
+       break;
     case 0x08:                 // EEPROM Control
     case 0x09:                 // Scratch Register 0
     case 0x0a:                 // Scratch Register 1
@@ -2993,10 +3004,6 @@
     }
     s->cr[0x27] = device_id;
 
-    /* Win2K seems to assume that the pattern buffer is at 0xff
-       initially ! */
-    memset(s->vram_ptr, 0xff, s->real_vram_size);
-
     s->cirrus_hidden_dac_lockindex = 5;
     s->cirrus_hidden_dac_data = 0;
 


_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to