Revision 8c78881f hw/cirrus_vga_rop.h

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

Also available in: Unified diff