Reset Cirrus device model `VRAM' whenever a VGA/SVGA mode switch occurs.

If you change the video resolution on a Windows XP guest 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.

Signed-off-by: Donald.D.Dugger@intel.com
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-05-10 16:05:24 +01:00
1 parent 3f37f70c65
commit ff712d654d
1 file changed
+11 -4
+11 -4
View File
@@ -1187,6 +1187,17 @@ cirrus_hook_write_sr(CirrusVGAState * s, unsigned reg_index, int reg_value)
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
@@ -3021,10 +3032,6 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
}
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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.