qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Fix VGA for MIPS Malta (big endian)


From: Stefan Weil
Subject: [Qemu-devel] [PATCH] Fix VGA for MIPS Malta (big endian)
Date: Sun, 20 Jul 2008 16:28:44 +0200
User-agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509)

Hello,

this patch fixes the VGA display for MIPS Malta (big endian, 32 bit).

I have no tests for other big endian targets (32 or 64 bit).
Do they have a working VGA display (then my patch must be restricted
to MIPS and/or 32 bit), or do they show wrong pixel columns with current
Qemu trunk, too?

Regards
Stefan

Index: hw/vga_template.h
===================================================================
--- hw/vga_template.h   (Revision 4908)
+++ hw/vga_template.h   (Arbeitskopie)
@@ -327,6 +327,16 @@
     palette = s1->last_palette;
     width >>= 3;
     for(x = 0; x < width; x++) {
+#if defined(TARGET_WORDS_BIGENDIAN)
+        ((PIXEL_TYPE *)d)[3] = palette[s[0]];
+        ((PIXEL_TYPE *)d)[2] = palette[s[1]];
+        ((PIXEL_TYPE *)d)[1] = palette[s[2]];
+        ((PIXEL_TYPE *)d)[0] = palette[s[3]];
+        ((PIXEL_TYPE *)d)[7] = palette[s[4]];
+        ((PIXEL_TYPE *)d)[6] = palette[s[5]];
+        ((PIXEL_TYPE *)d)[5] = palette[s[6]];
+        ((PIXEL_TYPE *)d)[4] = palette[s[7]];
+#else
         ((PIXEL_TYPE *)d)[0] = palette[s[0]];
         ((PIXEL_TYPE *)d)[1] = palette[s[1]];
         ((PIXEL_TYPE *)d)[2] = palette[s[2]];
@@ -335,6 +345,7 @@
         ((PIXEL_TYPE *)d)[5] = palette[s[5]];
         ((PIXEL_TYPE *)d)[6] = palette[s[6]];
         ((PIXEL_TYPE *)d)[7] = palette[s[7]];
+#endif
         d += BPP * 8;
         s += 8;
     }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]