All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] cirrus_vga.c and win95
Date: Thu, 20 Jan 2005 00:33:54 +0100	[thread overview]
Message-ID: <aec7e5c305011915331e260844@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

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

[-- Attachment #2: qemu-cvs_20050118-cirrus_win95.patch --]
[-- Type: text/x-patch, Size: 1560 bytes --]

--- qemu-20050108/hw/cirrus_vga.c	2004-11-21 19:45:57.000000000 +0100
+++ qemu-mmap_20050108/hw/cirrus_vga.c	2005-01-18 13:18:11.989624016 +0100
@@ -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);


[-- Attachment #3: without_patch.jpg --]
[-- Type: image/jpeg, Size: 6907 bytes --]

[-- Attachment #4: with_patch.jpg --]
[-- Type: image/jpeg, Size: 5913 bytes --]

             reply	other threads:[~2005-01-20  0:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19 23:33 Magnus Damm [this message]
2005-01-25 23:07 ` [Qemu-devel] Re: [PATCH] cirrus_vga.c and win95 Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aec7e5c305011915331e260844@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.