Commit be9d365723740a8bf4f11d2eb3e9099c99019a57
1 parent
24201115
PL110 byteswapping fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1763 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
6 deletions
hw/pl110_template.h
@@ -92,7 +92,7 @@ static void glue(pl110_draw_line1_,NAME)(uint32_t *pallette, uint8_t *d, const u | @@ -92,7 +92,7 @@ static void glue(pl110_draw_line1_,NAME)(uint32_t *pallette, uint8_t *d, const u | ||
92 | #else | 92 | #else |
93 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x) + y)) & 1]); | 93 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x) + y)) & 1]); |
94 | #endif | 94 | #endif |
95 | -#ifdef SWAP_BYTES | 95 | +#ifdef SWAP_WORDS |
96 | FN_8(24) | 96 | FN_8(24) |
97 | FN_8(16) | 97 | FN_8(16) |
98 | FN_8(8) | 98 | FN_8(8) |
@@ -119,7 +119,7 @@ static void glue(pl110_draw_line2_,NAME)(uint32_t *pallette, uint8_t *d, const u | @@ -119,7 +119,7 @@ static void glue(pl110_draw_line2_,NAME)(uint32_t *pallette, uint8_t *d, const u | ||
119 | #else | 119 | #else |
120 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*2 + y)) & 3]); | 120 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*2 + y)) & 3]); |
121 | #endif | 121 | #endif |
122 | -#ifdef SWAP_BYTES | 122 | +#ifdef SWAP_WORDS |
123 | FN_4(0, 24) | 123 | FN_4(0, 24) |
124 | FN_4(0, 16) | 124 | FN_4(0, 16) |
125 | FN_4(0, 8) | 125 | FN_4(0, 8) |
@@ -146,7 +146,7 @@ static void glue(pl110_draw_line4_,NAME)(uint32_t *pallette, uint8_t *d, const u | @@ -146,7 +146,7 @@ static void glue(pl110_draw_line4_,NAME)(uint32_t *pallette, uint8_t *d, const u | ||
146 | #else | 146 | #else |
147 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*4 + y)) & 0xf]); | 147 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*4 + y)) & 0xf]); |
148 | #endif | 148 | #endif |
149 | -#ifdef SWAP_BYTES | 149 | +#ifdef SWAP_WORDS |
150 | FN_2(0, 24) | 150 | FN_2(0, 24) |
151 | FN_2(0, 16) | 151 | FN_2(0, 16) |
152 | FN_2(0, 8) | 152 | FN_2(0, 8) |
@@ -169,7 +169,7 @@ static void glue(pl110_draw_line8_,NAME)(uint32_t *pallette, uint8_t *d, const u | @@ -169,7 +169,7 @@ static void glue(pl110_draw_line8_,NAME)(uint32_t *pallette, uint8_t *d, const u | ||
169 | while (width > 0) { | 169 | while (width > 0) { |
170 | data = *(uint32_t *)src; | 170 | data = *(uint32_t *)src; |
171 | #define FN(x) COPY_PIXEL(d, pallette[(data >> (x)) & 0xff]); | 171 | #define FN(x) COPY_PIXEL(d, pallette[(data >> (x)) & 0xff]); |
172 | -#ifdef SWAP_BYTES | 172 | +#ifdef SWAP_WORDS |
173 | FN(24) | 173 | FN(24) |
174 | FN(16) | 174 | FN(16) |
175 | FN(8) | 175 | FN(8) |
@@ -192,7 +192,7 @@ static void glue(pl110_draw_line16_,NAME)(uint32_t *pallette, uint8_t *d, const | @@ -192,7 +192,7 @@ static void glue(pl110_draw_line16_,NAME)(uint32_t *pallette, uint8_t *d, const | ||
192 | unsigned int r, g, b; | 192 | unsigned int r, g, b; |
193 | while (width > 0) { | 193 | while (width > 0) { |
194 | data = *(uint32_t *)src; | 194 | data = *(uint32_t *)src; |
195 | -#ifdef SWAP_BYTES | 195 | +#ifdef SWAP_WORDS |
196 | data = bswap32(data); | 196 | data = bswap32(data); |
197 | #endif | 197 | #endif |
198 | #if 0 | 198 | #if 0 |
@@ -229,7 +229,7 @@ static void glue(pl110_draw_line32_,NAME)(uint32_t *pallette, uint8_t *d, const | @@ -229,7 +229,7 @@ static void glue(pl110_draw_line32_,NAME)(uint32_t *pallette, uint8_t *d, const | ||
229 | unsigned int r, g, b; | 229 | unsigned int r, g, b; |
230 | while (width > 0) { | 230 | while (width > 0) { |
231 | data = *(uint32_t *)src; | 231 | data = *(uint32_t *)src; |
232 | -#ifdef SWAP_BYTES | 232 | +#ifdef SWAP_WORDS |
233 | r = data & 0xff; | 233 | r = data & 0xff; |
234 | g = (data >> 8) & 0xff; | 234 | g = (data >> 8) & 0xff; |
235 | b = (data >> 16) & 0xff; | 235 | b = (data >> 16) & 0xff; |