Revision 8c78881f
b/hw/cirrus_vga.c | ||
---|---|---|
280 | 280 |
} |
281 | 281 |
|
282 | 282 |
#define ROP_NAME 0 |
283 |
#define ROP_OP(d, s) d = 0
|
|
283 |
#define ROP_FN(d, s) 0
|
|
284 | 284 |
#include "cirrus_vga_rop.h" |
285 | 285 |
|
286 | 286 |
#define ROP_NAME src_and_dst |
287 |
#define ROP_OP(d, s) d = (s) & (d)
|
|
287 |
#define ROP_FN(d, s) (s) & (d)
|
|
288 | 288 |
#include "cirrus_vga_rop.h" |
289 | 289 |
|
290 | 290 |
#define ROP_NAME src_and_notdst |
291 |
#define ROP_OP(d, s) d = (s) & (~(d))
|
|
291 |
#define ROP_FN(d, s) (s) & (~(d))
|
|
292 | 292 |
#include "cirrus_vga_rop.h" |
293 | 293 |
|
294 | 294 |
#define ROP_NAME notdst |
295 |
#define ROP_OP(d, s) d = ~(d)
|
|
295 |
#define ROP_FN(d, s) ~(d)
|
|
296 | 296 |
#include "cirrus_vga_rop.h" |
297 | 297 |
|
298 | 298 |
#define ROP_NAME src |
299 |
#define ROP_OP(d, s) d = s
|
|
299 |
#define ROP_FN(d, s) s
|
|
300 | 300 |
#include "cirrus_vga_rop.h" |
301 | 301 |
|
302 | 302 |
#define ROP_NAME 1 |
303 |
#define ROP_OP(d, s) d = ~0
|
|
303 |
#define ROP_FN(d, s) ~0
|
|
304 | 304 |
#include "cirrus_vga_rop.h" |
305 | 305 |
|
306 | 306 |
#define ROP_NAME notsrc_and_dst |
307 |
#define ROP_OP(d, s) d = (~(s)) & (d)
|
|
307 |
#define ROP_FN(d, s) (~(s)) & (d)
|
|
308 | 308 |
#include "cirrus_vga_rop.h" |
309 | 309 |
|
310 | 310 |
#define ROP_NAME src_xor_dst |
311 |
#define ROP_OP(d, s) d = (s) ^ (d)
|
|
311 |
#define ROP_FN(d, s) (s) ^ (d)
|
|
312 | 312 |
#include "cirrus_vga_rop.h" |
313 | 313 |
|
314 | 314 |
#define ROP_NAME src_or_dst |
315 |
#define ROP_OP(d, s) d = (s) | (d)
|
|
315 |
#define ROP_FN(d, s) (s) | (d)
|
|
316 | 316 |
#include "cirrus_vga_rop.h" |
317 | 317 |
|
318 | 318 |
#define ROP_NAME notsrc_or_notdst |
319 |
#define ROP_OP(d, s) d = (~(s)) | (~(d))
|
|
319 |
#define ROP_FN(d, s) (~(s)) | (~(d))
|
|
320 | 320 |
#include "cirrus_vga_rop.h" |
321 | 321 |
|
322 | 322 |
#define ROP_NAME src_notxor_dst |
323 |
#define ROP_OP(d, s) d = ~((s) ^ (d))
|
|
323 |
#define ROP_FN(d, s) ~((s) ^ (d))
|
|
324 | 324 |
#include "cirrus_vga_rop.h" |
325 | 325 |
|
326 | 326 |
#define ROP_NAME src_or_notdst |
327 |
#define ROP_OP(d, s) d = (s) | (~(d))
|
|
327 |
#define ROP_FN(d, s) (s) | (~(d))
|
|
328 | 328 |
#include "cirrus_vga_rop.h" |
329 | 329 |
|
330 | 330 |
#define ROP_NAME notsrc |
331 |
#define ROP_OP(d, s) d = (~(s))
|
|
331 |
#define ROP_FN(d, s) (~(s))
|
|
332 | 332 |
#include "cirrus_vga_rop.h" |
333 | 333 |
|
334 | 334 |
#define ROP_NAME notsrc_or_dst |
335 |
#define ROP_OP(d, s) d = (~(s)) | (d)
|
|
335 |
#define ROP_FN(d, s) (~(s)) | (d)
|
|
336 | 336 |
#include "cirrus_vga_rop.h" |
337 | 337 |
|
338 | 338 |
#define ROP_NAME notsrc_and_notdst |
339 |
#define ROP_OP(d, s) d = (~(s)) & (~(d))
|
|
339 |
#define ROP_FN(d, s) (~(s)) & (~(d))
|
|
340 | 340 |
#include "cirrus_vga_rop.h" |
341 | 341 |
|
342 | 342 |
static const cirrus_bitblt_rop_t cirrus_fwd_rop[16] = { |
b/hw/cirrus_vga_rop.h | ||
---|---|---|
22 | 22 |
* THE SOFTWARE. |
23 | 23 |
*/ |
24 | 24 |
|
25 |
static inline void glue(rop_8_,ROP_NAME)(uint8_t *dst, uint8_t src) |
|
26 |
{ |
|
27 |
*dst = ROP_FN(*dst, src); |
|
28 |
} |
|
29 |
|
|
30 |
static inline void glue(rop_16_,ROP_NAME)(uint16_t *dst, uint16_t src) |
|
31 |
{ |
|
32 |
*dst = ROP_FN(*dst, src); |
|
33 |
} |
|
34 |
|
|
35 |
static inline void glue(rop_32_,ROP_NAME)(uint32_t *dst, uint32_t src) |
|
36 |
{ |
|
37 |
*dst = ROP_FN(*dst, src); |
|
38 |
} |
|
39 |
|
|
40 |
#define ROP_OP(d, s) glue(rop_8_,ROP_NAME)(d, s) |
|
41 |
#define ROP_OP_16(d, s) glue(rop_16_,ROP_NAME)(d, s) |
|
42 |
#define ROP_OP_32(d, s) glue(rop_32_,ROP_NAME)(d, s) |
|
43 |
#undef ROP_FN |
|
44 |
|
|
25 | 45 |
static void |
26 | 46 |
glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s, |
27 | 47 |
uint8_t *dst,const uint8_t *src, |
... | ... | |
39 | 59 |
|
40 | 60 |
for (y = 0; y < bltheight; y++) { |
41 | 61 |
for (x = 0; x < bltwidth; x++) { |
42 |
ROP_OP(*dst, *src);
|
|
62 |
ROP_OP(dst, *src); |
|
43 | 63 |
dst++; |
44 | 64 |
src++; |
45 | 65 |
} |
... | ... | |
59 | 79 |
srcpitch += bltwidth; |
60 | 80 |
for (y = 0; y < bltheight; y++) { |
61 | 81 |
for (x = 0; x < bltwidth; x++) { |
62 |
ROP_OP(*dst, *src);
|
|
82 |
ROP_OP(dst, *src); |
|
63 | 83 |
dst--; |
64 | 84 |
src--; |
65 | 85 |
} |
... | ... | |
81 | 101 |
for (y = 0; y < bltheight; y++) { |
82 | 102 |
for (x = 0; x < bltwidth; x++) { |
83 | 103 |
p = *dst; |
84 |
ROP_OP(p, *src); |
|
104 |
ROP_OP(&p, *src);
|
|
85 | 105 |
if (p != s->vga.gr[0x34]) *dst = p; |
86 | 106 |
dst++; |
87 | 107 |
src++; |
... | ... | |
104 | 124 |
for (y = 0; y < bltheight; y++) { |
105 | 125 |
for (x = 0; x < bltwidth; x++) { |
106 | 126 |
p = *dst; |
107 |
ROP_OP(p, *src); |
|
127 |
ROP_OP(&p, *src);
|
|
108 | 128 |
if (p != s->vga.gr[0x34]) *dst = p; |
109 | 129 |
dst--; |
110 | 130 |
src--; |
... | ... | |
128 | 148 |
for (x = 0; x < bltwidth; x+=2) { |
129 | 149 |
p1 = *dst; |
130 | 150 |
p2 = *(dst+1); |
131 |
ROP_OP(p1, *src); |
|
132 |
ROP_OP(p2, *(src+1));
|
|
151 |
ROP_OP(&p1, *src);
|
|
152 |
ROP_OP(&p2, *(src + 1));
|
|
133 | 153 |
if ((p1 != s->vga.gr[0x34]) || (p2 != s->vga.gr[0x35])) { |
134 | 154 |
*dst = p1; |
135 | 155 |
*(dst+1) = p2; |
... | ... | |
156 | 176 |
for (x = 0; x < bltwidth; x+=2) { |
157 | 177 |
p1 = *(dst-1); |
158 | 178 |
p2 = *dst; |
159 |
ROP_OP(p1, *(src-1));
|
|
160 |
ROP_OP(p2, *src); |
|
179 |
ROP_OP(&p1, *(src - 1));
|
|
180 |
ROP_OP(&p2, *src);
|
|
161 | 181 |
if ((p1 != s->vga.gr[0x34]) || (p2 != s->vga.gr[0x35])) { |
162 | 182 |
*(dst-1) = p1; |
163 | 183 |
*dst = p2; |
... | ... | |
184 | 204 |
|
185 | 205 |
#undef ROP_NAME |
186 | 206 |
#undef ROP_OP |
207 |
#undef ROP_OP_16 |
|
208 |
#undef ROP_OP_32 |
b/hw/cirrus_vga_rop2.h | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
|
25 | 25 |
#if DEPTH == 8 |
26 |
#define PUTPIXEL() ROP_OP(d[0], col) |
|
26 |
#define PUTPIXEL() ROP_OP(&d[0], col)
|
|
27 | 27 |
#elif DEPTH == 16 |
28 |
#define PUTPIXEL() ROP_OP(((uint16_t *)d)[0], col);
|
|
28 |
#define PUTPIXEL() ROP_OP_16((uint16_t *)&d[0], col)
|
|
29 | 29 |
#elif DEPTH == 24 |
30 |
#define PUTPIXEL() ROP_OP(d[0], col); \
|
|
31 |
ROP_OP(d[1], (col >> 8)); \ |
|
32 |
ROP_OP(d[2], (col >> 16)) |
|
30 |
#define PUTPIXEL() ROP_OP(&d[0], col); \
|
|
31 |
ROP_OP(&d[1], (col >> 8)); \
|
|
32 |
ROP_OP(&d[2], (col >> 16))
|
|
33 | 33 |
#elif DEPTH == 32 |
34 |
#define PUTPIXEL() ROP_OP(((uint32_t *)d)[0], col)
|
|
34 |
#define PUTPIXEL() ROP_OP_32(((uint32_t *)&d[0]), col)
|
|
35 | 35 |
#else |
36 | 36 |
#error unsupported DEPTH |
37 | 37 |
#endif |
Also available in: Unified diff