Revision 4c8732d7 hw/cirrus_vga_rop2.h

b/hw/cirrus_vga_rop2.h
36 36
#error unsupported DEPTH
37 37
#endif                
38 38

  
39
/* NOTE: srcpitch is ignored */
39 40
static void
40 41
glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
41 42
     (CirrusVGAState * s, uint8_t * dst,
42
      const uint8_t * src1, 
43
      const uint8_t * src, 
43 44
      int dstpitch, int srcpitch, 
44 45
      int bltwidth, int bltheight)
45 46
{
46
    const uint8_t *src;
47 47
    uint8_t *d;
48 48
    int x, y;
49 49
    unsigned bits;
......
54 54

  
55 55
    col = s->cirrus_blt_fgcol;
56 56
    for(y = 0; y < bltheight; y++) {
57
        src = src1;
58 57
        bitmask = 0x80 >> srcskipleft;
59 58
        bits = *src++;
60 59
        d = dst;
......
70 69
            d += (DEPTH / 8);
71 70
            bitmask >>= 1;
72 71
        }
73
        src1 += srcpitch;
72
        dst += dstpitch;
73
    }
74
}
75

  
76
/* NOTE: srcpitch is ignored */
77
static void
78
glue(glue(glue(cirrus_colorexpand_transp_inv_, ROP_NAME), _),DEPTH)
79
     (CirrusVGAState * s, uint8_t * dst,
80
      const uint8_t * src, 
81
      int dstpitch, int srcpitch, 
82
      int bltwidth, int bltheight)
83
{
84
    uint8_t *d;
85
    int x, y;
86
    unsigned bits;
87
    unsigned int col;
88
    unsigned bitmask;
89
    unsigned index;
90
    int srcskipleft = 0;
91

  
92
    col = s->cirrus_blt_bgcol;
93
    for(y = 0; y < bltheight; y++) {
94
        bitmask = 0x80 >> srcskipleft;
95
        bits = *src++;
96
        d = dst;
97
        for (x = 0; x < bltwidth; x += (DEPTH / 8)) {
98
            if ((bitmask & 0xff) == 0) {
99
                bitmask = 0x80;
100
                bits = *src++;
101
            }
102
            index = (bits & bitmask);
103
            if (!index) {
104
                PUTPIXEL();
105
            }
106
            d += (DEPTH / 8);
107
            bitmask >>= 1;
108
        }
74 109
        dst += dstpitch;
75 110
    }
76 111
}
......
78 113
static void
79 114
glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH)
80 115
     (CirrusVGAState * s, uint8_t * dst,
81
      const uint8_t * src1, 
116
      const uint8_t * src, 
82 117
      int dstpitch, int srcpitch, 
83 118
      int bltwidth, int bltheight)
84 119
{
85
    const uint8_t *src;
86 120
    uint32_t colors[2];
87 121
    uint8_t *d;
88 122
    int x, y;
......
94 128
    colors[0] = s->cirrus_blt_bgcol;
95 129
    colors[1] = s->cirrus_blt_fgcol;
96 130
    for(y = 0; y < bltheight; y++) {
97
        src = src1;
98 131
        bitmask = 0x80 >> srcskipleft;
99 132
        bits = *src++;
100 133
        d = dst;
......
108 141
            d += (DEPTH / 8);
109 142
            bitmask >>= 1;
110 143
        }
111
        src1 += srcpitch;
112 144
        dst += dstpitch;
113 145
    }
114 146
}

Also available in: Unified diff