cirrus_vga.c and win95
PATCH 1/1 cirrus_vga.c and win95
Hello,
I recently tried to install win95 (swedish version) using QEMU CVS, but after the first reboot the text on the screen was somewhat corrupted. The background, mouse pointer and widget background were still ok though. The attaches pictures shows you what I am talking about. If -std-vga was enabled everything was just fine. Anyway, the attached patch solves three things:
Hunk 1: Small typo fix.
Hunk 2: Fix for cirrus_mem_writeb_mode4and5_8bpp(), this was the actual bug. Hunk 3: Similar fix for cirrus_mem_writeb_mode4and5_16bpp(), untested.
Please apply.
/ magnus
hw/cirrus_vga.c +9 -7
@@ -790,7 +790,7 @@ blt_rop = s->gr[0x32 ];#ifdef DEBUG_BITBLT - printf("rop=0x%02x mode=0x%02x modeext=0x%02x w=%d h=%d dpitch=%d spicth=%d daddr=0x%08x saddr=0x%08x writemask=0x%02x\n", + printf("rop=0x%02x mode=0x%02x modeext=0x%02x w=%d h=%d dpitch=%d spitch=%d daddr=0x%08x saddr=0x%08x writemask=0x%02x\n", blt_rop, s->cirrus_blt_mode, s->cirrus_blt_modeext,
@@ -1780,11 +1780,12 @@ dst = s->vram_ptr + offset;for (x =0 ; x <8 ; x++) {if (val &0x80 ) { - *dst++ = s->cirrus_shadow_gr1; + *dst = s->cirrus_shadow_gr1; }else if (mode ==5 ) { - *dst++ = s->cirrus_shadow_gr0; + *dst = s->cirrus_shadow_gr0; } val <<=1 ; + dst++; }cpu_physical_memory_set_dirty (s->vram_offset + offset);cpu_physical_memory_set_dirty (s->vram_offset + offset +7 );
@@ -1802,13 +1803,14 @@ dst = s->vram_ptr + offset;for (x =0 ; x <8 ; x++) {if (val &0x80 ) { - *dst++ = s->cirrus_shadow_gr1; - *dst++ = s->gr[0x11 ]; + *dst = s->cirrus_shadow_gr1; + *(dst +1 ) = s->gr[0x11 ]; }else if (mode ==5 ) { - *dst++ = s->cirrus_shadow_gr0; - *dst++ = s->gr[0x10 ]; + *dst = s->cirrus_shadow_gr0; + *(dst +1 ) = s->gr[0x10 ]; } val <<=1 ; + dst +=2 ; }cpu_physical_memory_set_dirty (s->vram_offset + offset);cpu_physical_memory_set_dirty (s->vram_offset + offset +15 );
Quoted 9 lines · Magnus Damm
Hello,
I recently tried to install win95 (swedish version) using QEMU CVS, but after the first reboot the text on the screen was somewhat corrupted. The background, mouse pointer and widget background were still ok though. The attaches pictures shows you what I am talking about. If -std-vga was enabled everything was just fine. Anyway, the attached patch solves three things:
Quoted 5 lines
Hunk 1: Small typo fix.
Hunk 2: Fix forcirrus_mem_writeb_mode4and5_8bpp(), this was the actual bug. Hunk 3: Similar fix forcirrus_mem_writeb_mode4and5_16bpp(), untested.Please apply.
Did this email get stuck in the spam filters because of the jpegs? Any comments on the patch?
Thanks,
/ magnus