diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-07 19:46:45 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-07 19:46:45 +0000 |
commit | 4c8732d71b61d2950a57dbb758517de536125175 (patch) | |
tree | a9965a1007c6c374eea16178411643b037b90d02 /hw/cirrus_vga_rop2.h | |
parent | 1cc98a5f045fefd4d0243a8f868c8a331839def0 (diff) |
cirrus blitter fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@907 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/cirrus_vga_rop2.h')
-rw-r--r-- | hw/cirrus_vga_rop2.h | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/hw/cirrus_vga_rop2.h b/hw/cirrus_vga_rop2.h index 682662741e..c7514d3161 100644 --- a/hw/cirrus_vga_rop2.h +++ b/hw/cirrus_vga_rop2.h @@ -36,14 +36,14 @@ #error unsupported DEPTH #endif +/* NOTE: srcpitch is ignored */ static void glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) (CirrusVGAState * s, uint8_t * dst, - const uint8_t * src1, + const uint8_t * src, int dstpitch, int srcpitch, int bltwidth, int bltheight) { - const uint8_t *src; uint8_t *d; int x, y; unsigned bits; @@ -54,7 +54,6 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) col = s->cirrus_blt_fgcol; for(y = 0; y < bltheight; y++) { - src = src1; bitmask = 0x80 >> srcskipleft; bits = *src++; d = dst; @@ -70,7 +69,43 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) d += (DEPTH / 8); bitmask >>= 1; } - src1 += srcpitch; + dst += dstpitch; + } +} + +/* NOTE: srcpitch is ignored */ +static void +glue(glue(glue(cirrus_colorexpand_transp_inv_, ROP_NAME), _),DEPTH) + (CirrusVGAState * s, uint8_t * dst, + const uint8_t * src, + int dstpitch, int srcpitch, + int bltwidth, int bltheight) +{ + uint8_t *d; + int x, y; + unsigned bits; + unsigned int col; + unsigned bitmask; + unsigned index; + int srcskipleft = 0; + + col = s->cirrus_blt_bgcol; + for(y = 0; y < bltheight; y++) { + bitmask = 0x80 >> srcskipleft; + bits = *src++; + d = dst; + for (x = 0; x < bltwidth; x += (DEPTH / 8)) { + if ((bitmask & 0xff) == 0) { + bitmask = 0x80; + bits = *src++; + } + index = (bits & bitmask); + if (!index) { + PUTPIXEL(); + } + d += (DEPTH / 8); + bitmask >>= 1; + } dst += dstpitch; } } @@ -78,11 +113,10 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH) static void glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH) (CirrusVGAState * s, uint8_t * dst, - const uint8_t * src1, + const uint8_t * src, int dstpitch, int srcpitch, int bltwidth, int bltheight) { - const uint8_t *src; uint32_t colors[2]; uint8_t *d; int x, y; @@ -94,7 +128,6 @@ glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH) colors[0] = s->cirrus_blt_bgcol; colors[1] = s->cirrus_blt_fgcol; for(y = 0; y < bltheight; y++) { - src = src1; bitmask = 0x80 >> srcskipleft; bits = *src++; d = dst; @@ -108,7 +141,6 @@ glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH) d += (DEPTH / 8); bitmask >>= 1; } - src1 += srcpitch; dst += dstpitch; } } |