qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [patch] incorrect VGA initialization, can provide image
@ 2004-09-09 22:14 Piotr Krysik
  2004-09-10 10:20 ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Piotr Krysik @ 2004-09-09 22:14 UTC (permalink / raw)
  To: qemu-devel

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

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vga-update-1.patch --]
[-- Type: text/x-patch; name="vga-update-1.patch", Size: 2568 bytes --]

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));
     }
 }
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-10-11  7:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-09 22:14 [Qemu-devel] [patch] incorrect VGA initialization, can provide image Piotr Krysik
2004-09-10 10:20 ` Johannes Schindelin
2004-09-10 12:26   ` Piotr Krysik
2004-09-10 13:17     ` Fabrice Bellard
2004-09-10 16:15       ` [Qemu-devel] IRIX host Johannes Schindelin
2004-09-10 16:33         ` Paul Brook
2004-09-10 18:34       ` [Qemu-devel] [patch] incorrect VGA initialization, can provide image Piotr Krysik
2004-09-13 21:29         ` Fabrice Bellard
2004-10-11  7:40           ` Piotr Krysik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).