Commit ad81218e40e27d79e1021c248cf16ca269d963df
1 parent
e4afee97
depth=24 write mask fix (Volker Ruppert)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1404 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
15 additions
and
1 deletions
hw/cirrus_vga.c
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | 31 | ||
| 32 | /* | 32 | /* |
| 33 | * TODO: | 33 | * TODO: |
| 34 | - * - add support for WRITEMASK (GR2F) | 34 | + * - destination write mask support not complete (bits 5..7) |
| 35 | * - optimize linear mappings | 35 | * - optimize linear mappings |
| 36 | * - optimize bitblt functions | 36 | * - optimize bitblt functions |
| 37 | */ | 37 | */ |
hw/cirrus_vga_rop2.h
| @@ -47,7 +47,11 @@ glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH) | @@ -47,7 +47,11 @@ glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH) | ||
| 47 | int x, y, pattern_y, pattern_pitch, pattern_x; | 47 | int x, y, pattern_y, pattern_pitch, pattern_x; |
| 48 | unsigned int col; | 48 | unsigned int col; |
| 49 | const uint8_t *src1; | 49 | const uint8_t *src1; |
| 50 | +#if DEPTH == 24 | ||
| 51 | + int skipleft = s->gr[0x2f] & 0x1f; | ||
| 52 | +#else | ||
| 50 | int skipleft = (s->gr[0x2f] & 0x07) * (DEPTH / 8); | 53 | int skipleft = (s->gr[0x2f] & 0x07) * (DEPTH / 8); |
| 54 | +#endif | ||
| 51 | 55 | ||
| 52 | #if DEPTH == 8 | 56 | #if DEPTH == 8 |
| 53 | pattern_pitch = 8; | 57 | pattern_pitch = 8; |
| @@ -100,8 +104,13 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) | @@ -100,8 +104,13 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) | ||
| 100 | unsigned int col; | 104 | unsigned int col; |
| 101 | unsigned bitmask; | 105 | unsigned bitmask; |
| 102 | unsigned index; | 106 | unsigned index; |
| 107 | +#if DEPTH == 24 | ||
| 108 | + int dstskipleft = s->gr[0x2f] & 0x1f; | ||
| 109 | + int srcskipleft = dstskipleft / 3; | ||
| 110 | +#else | ||
| 103 | int srcskipleft = s->gr[0x2f] & 0x07; | 111 | int srcskipleft = s->gr[0x2f] & 0x07; |
| 104 | int dstskipleft = srcskipleft * (DEPTH / 8); | 112 | int dstskipleft = srcskipleft * (DEPTH / 8); |
| 113 | +#endif | ||
| 105 | 114 | ||
| 106 | if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) { | 115 | if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) { |
| 107 | bits_xor = 0xff; | 116 | bits_xor = 0xff; |
| @@ -178,8 +187,13 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH) | @@ -178,8 +187,13 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH) | ||
| 178 | int x, y, bitpos, pattern_y; | 187 | int x, y, bitpos, pattern_y; |
| 179 | unsigned int bits, bits_xor; | 188 | unsigned int bits, bits_xor; |
| 180 | unsigned int col; | 189 | unsigned int col; |
| 190 | +#if DEPTH == 24 | ||
| 191 | + int dstskipleft = s->gr[0x2f] & 0x1f; | ||
| 192 | + int srcskipleft = dstskipleft / 3; | ||
| 193 | +#else | ||
| 181 | int srcskipleft = s->gr[0x2f] & 0x07; | 194 | int srcskipleft = s->gr[0x2f] & 0x07; |
| 182 | int dstskipleft = srcskipleft * (DEPTH / 8); | 195 | int dstskipleft = srcskipleft * (DEPTH / 8); |
| 196 | +#endif | ||
| 183 | 197 | ||
| 184 | if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) { | 198 | if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) { |
| 185 | bits_xor = 0xff; | 199 | bits_xor = 0xff; |