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 | 92 | #else |
93 | 93 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x) + y)) & 1]); |
94 | 94 | #endif |
95 | -#ifdef SWAP_BYTES | |
95 | +#ifdef SWAP_WORDS | |
96 | 96 | FN_8(24) |
97 | 97 | FN_8(16) |
98 | 98 | FN_8(8) |
... | ... | @@ -119,7 +119,7 @@ static void glue(pl110_draw_line2_,NAME)(uint32_t *pallette, uint8_t *d, const u |
119 | 119 | #else |
120 | 120 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*2 + y)) & 3]); |
121 | 121 | #endif |
122 | -#ifdef SWAP_BYTES | |
122 | +#ifdef SWAP_WORDS | |
123 | 123 | FN_4(0, 24) |
124 | 124 | FN_4(0, 16) |
125 | 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 | 146 | #else |
147 | 147 | #define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*4 + y)) & 0xf]); |
148 | 148 | #endif |
149 | -#ifdef SWAP_BYTES | |
149 | +#ifdef SWAP_WORDS | |
150 | 150 | FN_2(0, 24) |
151 | 151 | FN_2(0, 16) |
152 | 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 | 169 | while (width > 0) { |
170 | 170 | data = *(uint32_t *)src; |
171 | 171 | #define FN(x) COPY_PIXEL(d, pallette[(data >> (x)) & 0xff]); |
172 | -#ifdef SWAP_BYTES | |
172 | +#ifdef SWAP_WORDS | |
173 | 173 | FN(24) |
174 | 174 | FN(16) |
175 | 175 | FN(8) |
... | ... | @@ -192,7 +192,7 @@ static void glue(pl110_draw_line16_,NAME)(uint32_t *pallette, uint8_t *d, const |
192 | 192 | unsigned int r, g, b; |
193 | 193 | while (width > 0) { |
194 | 194 | data = *(uint32_t *)src; |
195 | -#ifdef SWAP_BYTES | |
195 | +#ifdef SWAP_WORDS | |
196 | 196 | data = bswap32(data); |
197 | 197 | #endif |
198 | 198 | #if 0 |
... | ... | @@ -229,7 +229,7 @@ static void glue(pl110_draw_line32_,NAME)(uint32_t *pallette, uint8_t *d, const |
229 | 229 | unsigned int r, g, b; |
230 | 230 | while (width > 0) { |
231 | 231 | data = *(uint32_t *)src; |
232 | -#ifdef SWAP_BYTES | |
232 | +#ifdef SWAP_WORDS | |
233 | 233 | r = data & 0xff; |
234 | 234 | g = (data >> 8) & 0xff; |
235 | 235 | b = (data >> 16) & 0xff; | ... | ... |