Revision e69390ce hw/cirrus_vga_rop2.h
b/hw/cirrus_vga_rop2.h | ||
---|---|---|
36 | 36 |
#error unsupported DEPTH |
37 | 37 |
#endif |
38 | 38 |
|
39 |
static void |
|
40 |
glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH) |
|
41 |
(CirrusVGAState * s, uint8_t * dst, |
|
42 |
const uint8_t * src, |
|
43 |
int dstpitch, int srcpitch, |
|
44 |
int bltwidth, int bltheight) |
|
45 |
{ |
|
46 |
uint8_t *d; |
|
47 |
int x, y, pattern_y, pattern_pitch, pattern_x; |
|
48 |
unsigned int col; |
|
49 |
const uint8_t *src1; |
|
50 |
|
|
51 |
#if DEPTH == 8 |
|
52 |
pattern_pitch = 8; |
|
53 |
#elif DEPTH == 16 |
|
54 |
pattern_pitch = 16; |
|
55 |
#else |
|
56 |
pattern_pitch = 32; |
|
57 |
#endif |
|
58 |
pattern_y = s->cirrus_blt_srcaddr & 7; |
|
59 |
pattern_x = 0; |
|
60 |
for(y = 0; y < bltheight; y++) { |
|
61 |
d = dst; |
|
62 |
src1 = src + pattern_y * pattern_pitch; |
|
63 |
for (x = 0; x < bltwidth; x += (DEPTH / 8)) { |
|
64 |
#if DEPTH == 8 |
|
65 |
col = src1[pattern_x]; |
|
66 |
pattern_x = (pattern_x + 1) & 7; |
|
67 |
#elif DEPTH == 16 |
|
68 |
col = ((uint16_t *)(src1 + pattern_x))[0]; |
|
69 |
pattern_x = (pattern_x + 2) & 15; |
|
70 |
#else |
|
71 |
col = ((uint32_t *)(src1 + pattern_x))[0]; |
|
72 |
pattern_x = (pattern_x + 4) & 31; |
|
73 |
#endif |
|
74 |
PUTPIXEL(); |
|
75 |
d += (DEPTH / 8); |
|
76 |
} |
|
77 |
pattern_y = (pattern_y + 1) & 7; |
|
78 |
dst += dstpitch; |
|
79 |
} |
|
80 |
} |
|
81 |
|
|
39 | 82 |
/* NOTE: srcpitch is ignored */ |
40 | 83 |
static void |
41 | 84 |
glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) |
Also available in: Unified diff