Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C5XHV-0005B3-2P for qemu-devel@nongnu.org; Thu, 09 Sep 2004 18:20:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C5XHS-0005AT-SB for qemu-devel@nongnu.org; Thu, 09 Sep 2004 18:20:40 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5XHS-0005AQ-PU for qemu-devel@nongnu.org; Thu, 09 Sep 2004 18:20:38 -0400 Received: from [206.190.39.133] (helo=web52508.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1C5XBf-0000IF-Kp for qemu-devel@nongnu.org; Thu, 09 Sep 2004 18:14:39 -0400 Message-ID: <20040909221435.58599.qmail@web52508.mail.yahoo.com> Date: Thu, 9 Sep 2004 15:14:35 -0700 (PDT) From: Piotr Krysik MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1043190094-1094768075=:58086" Subject: [Qemu-devel] [patch] incorrect VGA initialization, can provide image Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0-1043190094-1094768075=:58086 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline Hi! This patch should fix the problem. Piotrek _______________________________ Do you Yahoo!? Shop for Back-to-School deals on Yahoo! Shopping. http://shopping.yahoo.com/backtoschool --0-1043190094-1094768075=:58086 Content-Type: text/x-patch; name="vga-update-1.patch" Content-Description: vga-update-1.patch Content-Disposition: inline; filename="vga-update-1.patch" diff -ru qemu-snapshot-2004-08-04_23/hw/vga.c qemu-snapshot-2004-08-04_23-vga-update/hw/vga.c --- qemu-snapshot-2004-08-04_23/hw/vga.c 2004-06-26 18:12:26.000000000 +0200 +++ qemu-snapshot-2004-08-04_23-vga-update/hw/vga.c 2004-09-09 23:40:51.000000000 +0200 @@ -696,10 +696,14 @@ /* chain 4 mode : simplest access */ plane = addr & 3; if (s->sr[2] & (1 << plane)) { - s->vram_ptr[addr] = val; #ifdef DEBUG_VGA_MEM printf("vga: chain4: [0x%x]\n", addr); #endif + s->vram_ptr[addr] = val; + /* force full update for vga_draw_text when writing font memory */ + if (((s->font_offsets[0] ^ addr) & ~0x7ffc) == 0 || + ((s->font_offsets[1] ^ addr) & ~0x7ffc) == 0) + s->font_offsets[0] = -1; cpu_physical_memory_set_dirty(s->vram_offset + addr); } } else if (s->gr[5] & 0x10) { @@ -707,10 +711,14 @@ plane = (s->gr[4] & 2) | (addr & 1); if (s->sr[2] & (1 << plane)) { addr = ((addr & ~1) << 1) | plane; - s->vram_ptr[addr] = val; #ifdef DEBUG_VGA_MEM printf("vga: odd/even: [0x%x]\n", addr); #endif + s->vram_ptr[addr] = val; + /* force full update for vga_draw_text when writing font memory */ + if (((s->font_offsets[0] ^ addr) & ~0x7ffc) == 0 || + ((s->font_offsets[1] ^ addr) & ~0x7ffc) == 0) + s->font_offsets[0] = -1; cpu_physical_memory_set_dirty(s->vram_offset + addr); } } else { @@ -776,14 +784,19 @@ do_write: /* mask data according to sr[2] */ write_mask = mask16[s->sr[2]]; +#ifdef DEBUG_VGA_MEM + printf("vga: latch: [0x%x] mask=0x%08x val=0x%08x\n", + addr * 4, write_mask, val); +#endif ((uint32_t *)s->vram_ptr)[addr] = (((uint32_t *)s->vram_ptr)[addr] & ~write_mask) | (val & write_mask); -#ifdef DEBUG_VGA_MEM - printf("vga: latch: [0x%x] mask=0x%08x val=0x%08x\n", - addr * 4, write_mask, val); -#endif - cpu_physical_memory_set_dirty(s->vram_offset + (addr << 2)); + /* force full update for vga_draw_text when writing font memory */ + if ((s->sr[2] & 4) && + (((s->font_offsets[0] ^ ((addr << 2) + 2)) & ~0x7ffc) == 0 || + ((s->font_offsets[1] ^ ((addr << 2) + 2)) & ~0x7ffc) == 0)) + s->font_offsets[0] = -1; + cpu_physical_memory_set_dirty(s->vram_offset + (addr << 2)); } } --0-1043190094-1094768075=:58086--