Wrap libwfb memory access.

Use the READ and WRITE macros to wrap memory accesses that could be in video
memory.  Add MEMCPY_WRAPPED and MEMSET_WRAPPED macros to wrap memcpy and
memset, respectively.
This commit is contained in:
Aaron Plattner 2006-08-01 13:45:43 -07:00
parent a69335dc29
commit ee02e64788
20 changed files with 641 additions and 614 deletions

40
fb/fb.h
View File

@ -45,14 +45,36 @@
#endif #endif
#ifdef FB_ACCESS_WRAPPER #ifdef FB_ACCESS_WRAPPER
#include "wfbrename.h" #include "wfbrename.h"
#define FBPREFIX(x) wfb##x #define FBPREFIX(x) wfb##x
#define WRITE(ptr, val) ((*wfbWriteMemory)(ptr, val, sizeof(*ptr))) #define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
#define READ(ptr) ((*wfbReadMemory)(ptr, sizeof(*ptr))) #define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
#define MEMCPY_WRAPPED(dst, src, size) do { \
size_t _i; \
CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
for(_i = 0; _i < size; _i++) { \
WRITE(_dst +_i, READ(_src + _i)); \
} \
} while(0)
#define MEMSET_WRAPPED(dst, val, size) do { \
size_t _i; \
CARD8 *_dst = (CARD8*)(dst); \
for(_i = 0; _i < size; _i++) { \
WRITE(_dst +_i, (val)); \
} \
} while(0)
#else #else
#define FBPREFIX(x) fb##x #define FBPREFIX(x) fb##x
#define WRITE(ptr, val) (*(ptr) = (val)) #define WRITE(ptr, val) (*(ptr) = (val))
#define READ(ptr) (*(ptr)) #define READ(ptr) (*(ptr))
#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
#endif #endif
/* /*
@ -233,8 +255,8 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
#define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o))) #define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
#define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3)) #define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3))
#define FbStorePart(dst,off,t,xor) (*FbPtrOffset(dst,off,t) = \ #define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset(dst,off,t), \
FbSelectPart(xor,off,t)) FbSelectPart(xor,off,t)))
#ifndef FbSelectPart #ifndef FbSelectPart
#define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t) #define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
#endif #endif
@ -414,7 +436,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \ FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \
break; \ break; \
default: \ default: \
*dst = FbDoMaskRRop(*dst, and, xor, l); \ WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, l)); \
break; \ break; \
} \ } \
} }
@ -434,7 +456,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
break; \ break; \
FbDoRightMaskByteRRop6Cases(dst,xor) \ FbDoRightMaskByteRRop6Cases(dst,xor) \
default: \ default: \
*dst = FbDoMaskRRop (*dst, and, xor, r); \ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \
} \ } \
} }
#endif #endif
@ -467,15 +489,15 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
*/ */
#define FbLaneCase1(n,a,o) ((n) == 0x01 ? \ #define FbLaneCase1(n,a,o) ((n) == 0x01 ? \
(*(CARD8 *) ((a)+FbPatternOffset(o,CARD8)) = \ WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), \
fgxor) : 0) fgxor) : 0)
#define FbLaneCase2(n,a,o) ((n) == 0x03 ? \ #define FbLaneCase2(n,a,o) ((n) == 0x03 ? \
(*(CARD16 *) ((a)+FbPatternOffset(o,CARD16)) = \ WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), \
fgxor) : \ fgxor) : \
((void)FbLaneCase1((n)&1,a,o), \ ((void)FbLaneCase1((n)&1,a,o), \
FbLaneCase1((n)>>1,a,(o)+1))) FbLaneCase1((n)>>1,a,(o)+1)))
#define FbLaneCase4(n,a,o) ((n) == 0x0f ? \ #define FbLaneCase4(n,a,o) ((n) == 0x0f ? \
(*(CARD32 *) ((a)+FbPatternOffset(o,CARD32)) = \ WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), \
fgxor) : \ fgxor) : \
((void)FbLaneCase2((n)&3,a,o), \ ((void)FbLaneCase2((n)&3,a,o), \
FbLaneCase2((n)>>2,a,(o)+2))) FbLaneCase2((n)>>2,a,(o)+2)))

View File

@ -38,18 +38,18 @@
* by reading/writing aligned CARD32s where it's easy * by reading/writing aligned CARD32s where it's easy
*/ */
#define Get8(a) ((CARD32) *(a)) #define Get8(a) ((CARD32) READ(a))
#if BITMAP_BIT_ORDER == MSBFirst #if BITMAP_BIT_ORDER == MSBFirst
#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2)) #define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2))
#define Put24(a,p) (((a)[0] = (CARD8) ((p) >> 16)), \ #define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \
((a)[1] = (CARD8) ((p) >> 8)), \ (WRITE((a+1), (CARD8) ((p) >> 8))), \
((a)[2] = (CARD8) (p))) (WRITE((a+2), (CARD8) (p))))
#else #else
#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16)) #define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16))
#define Put24(a,p) (((a)[0] = (CARD8) (p)), \ #define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \
((a)[1] = (CARD8) ((p) >> 8)), \ (WRITE((a+1), (CARD8) ((p) >> 8))), \
((a)[2] = (CARD8) ((p) >> 16))) (WRITE((a+2), (CARD8) ((p) >> 16))))
#endif #endif
typedef void (*fb24_32BltFunc) (CARD8 *srcLine, typedef void (*fb24_32BltFunc) (CARD8 *srcLine,
@ -106,7 +106,7 @@ fb24_32BltDown (CARD8 *srcLine,
while (((long) dst & 3) && w) while (((long) dst & 3) && w)
{ {
w--; w--;
pixel = *src++; pixel = READ(src++);
pixel = FbDoDestInvarientMergeRop(pixel); pixel = FbDoDestInvarientMergeRop(pixel);
Put24 (dst, pixel); Put24 (dst, pixel);
dst += 3; dst += 3;
@ -115,35 +115,35 @@ fb24_32BltDown (CARD8 *srcLine,
while (w >= 4) while (w >= 4)
{ {
CARD32 s0, s1; CARD32 s0, s1;
s0 = *src++; s0 = READ(src++);
s0 = FbDoDestInvarientMergeRop(s0); s0 = FbDoDestInvarientMergeRop(s0);
s1 = *src++; s1 = READ(src++);
s1 = FbDoDestInvarientMergeRop(s1); s1 = FbDoDestInvarientMergeRop(s1);
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
*(CARD32 *)(dst) = (s0 & 0xffffff) | (s1 << 24); WRITE((CARD32 *)dst, (s0 & 0xffffff) | (s1 << 24));
#else #else
*(CARD32 *)(dst) = (s0 << 8) | ((s1 & 0xffffff) >> 16); WRITE((CARD32 *)dst, (s0 << 8) | ((s1 & 0xffffff) >> 16));
#endif #endif
s0 = *src++; s0 = READ(src++);
s0 = FbDoDestInvarientMergeRop(s0); s0 = FbDoDestInvarientMergeRop(s0);
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
*(CARD32 *)(dst+4) = ((s1 & 0xffffff) >> 8) | (s0 << 16); WRITE((CARD32 *)(dst+4), ((s1 & 0xffffff) >> 8) | (s0 << 16));
#else #else
*(CARD32 *)(dst+4) = (s1 << 16) | ((s0 & 0xffffff) >> 8); WRITE((CARD32 *)(dst+4), (s1 << 16) | ((s0 & 0xffffff) >> 8));
#endif #endif
s1 = *src++; s1 = READ(src++);
s1 = FbDoDestInvarientMergeRop(s1); s1 = FbDoDestInvarientMergeRop(s1);
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
*(CARD32 *)(dst+8) = ((s0 & 0xffffff) >> 16) | (s1 << 8); WRITE((CARD32 *)(dst+8), ((s0 & 0xffffff) >> 16) | (s1 << 8));
#else #else
*(CARD32 *)(dst+8) = (s0 << 24) | (s1 & 0xffffff); WRITE((CARD32 *)(dst+8), (s0 << 24) | (s1 & 0xffffff));
#endif #endif
dst += 12; dst += 12;
w -= 4; w -= 4;
} }
while (w--) while (w--)
{ {
pixel = *src++; pixel = READ(src++);
pixel = FbDoDestInvarientMergeRop(pixel); pixel = FbDoDestInvarientMergeRop(pixel);
Put24 (dst, pixel); Put24 (dst, pixel);
dst += 3; dst += 3;
@ -153,7 +153,7 @@ fb24_32BltDown (CARD8 *srcLine,
{ {
while (w--) while (w--)
{ {
pixel = *src++; pixel = READ(src++);
dpixel = Get24 (dst); dpixel = Get24 (dst);
pixel = FbDoMergeRop(pixel, dpixel); pixel = FbDoMergeRop(pixel, dpixel);
Put24 (dst, pixel); Put24 (dst, pixel);
@ -205,40 +205,40 @@ fb24_32BltUp (CARD8 *srcLine,
w--; w--;
pixel = Get24(src); pixel = Get24(src);
src += 3; src += 3;
*dst++ = FbDoDestInvarientMergeRop(pixel); WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
} }
/* Do four aligned pixels at a time */ /* Do four aligned pixels at a time */
while (w >= 4) while (w >= 4)
{ {
CARD32 s0, s1; CARD32 s0, s1;
s0 = *(CARD32 *)(src); s0 = READ((CARD32 *)src);
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
pixel = s0 & 0xffffff; pixel = s0 & 0xffffff;
#else #else
pixel = s0 >> 8; pixel = s0 >> 8;
#endif #endif
*dst++ = FbDoDestInvarientMergeRop(pixel); WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
s1 = *(CARD32 *)(src+4); s1 = READ((CARD32 *)(src+4));
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff); pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff);
#else #else
pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16); pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16);
#endif #endif
*dst++ = FbDoDestInvarientMergeRop(pixel); WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
s0 = *(CARD32 *)(src+8); s0 = READ((CARD32 *)(src+8));
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff); pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff);
#else #else
pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24); pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24);
#endif #endif
*dst++ = FbDoDestInvarientMergeRop(pixel); WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
pixel = s0 >> 8; pixel = s0 >> 8;
#else #else
pixel = s0 & 0xffffff; pixel = s0 & 0xffffff;
#endif #endif
*dst++ = FbDoDestInvarientMergeRop(pixel); WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
src += 12; src += 12;
w -= 4; w -= 4;
} }
@ -247,7 +247,7 @@ fb24_32BltUp (CARD8 *srcLine,
w--; w--;
pixel = Get24(src); pixel = Get24(src);
src += 3; src += 3;
*dst++ = FbDoDestInvarientMergeRop(pixel); WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
} }
} }
else else
@ -256,7 +256,7 @@ fb24_32BltUp (CARD8 *srcLine,
{ {
pixel = Get24(src); pixel = Get24(src);
src += 3; src += 3;
*dst = FbDoMergeRop(pixel, *dst); WRITE(dst, FbDoMergeRop(pixel, READ(dst)));
dst++; dst++;
} }
} }

View File

@ -103,14 +103,14 @@
#define BITSUNIT BYTE #define BITSUNIT BYTE
#define BITSMUL 3 #define BITSMUL 3
#define FbDoTypeStore(b,t,x,s) (*((t *) (b)) = (x) >> (s)) #define FbDoTypeStore(b,t,x,s) WRITE(((t *) (b)), (x) >> (s))
#define FbDoTypeRRop(b,t,a,x,s) (*((t *) (b)) = FbDoRRop(*((t *) (b)),\ #define FbDoTypeRRop(b,t,a,x,s) WRITE((t *) (b), FbDoRRop(READ((t *) (b)),\
(a) >> (s), \ (a) >> (s), \
(x) >> (s))) (x) >> (s)))
#define FbDoTypeMaskRRop(b,t,a,x,m,s) (*((t *) (b)) = FbDoMaskRRop(*((t *) (b)),\ #define FbDoTypeMaskRRop(b,t,a,x,m,s) WRITE((t *) (b), FbDoMaskRRop(READ((t *) (b)),\
(a) >> (s), \ (a) >> (s), \
(x) >> (s), \ (x) >> (s), \
(m) >> (s)) (m) >> (s)))
#if BITMAP_BIT_ORDER == LSBFirst #if BITMAP_BIT_ORDER == LSBFirst
#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \ #define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \
(FbDoTypeStore (b, CARD8, x, 0), \ (FbDoTypeStore (b, CARD8, x, 0), \

View File

@ -42,13 +42,13 @@
#ifdef BITSSTORE #ifdef BITSSTORE
#define STORE(b,x) BITSSTORE(b,x) #define STORE(b,x) BITSSTORE(b,x)
#else #else
#define STORE(b,x) (*(b) = (x)) #define STORE(b,x) WRITE((b), (x))
#endif #endif
#ifdef BITSRROP #ifdef BITSRROP
#define RROP(b,a,x) BITSRROP(b,a,x) #define RROP(b,a,x) BITSRROP(b,a,x)
#else #else
#define RROP(b,a,x) (*(b) = FbDoRRop (*(b), (a), (x))) #define RROP(b,a,x) WRITE((b), FbDoRRop (READ(b), (a), (x)))
#endif #endif
#ifdef BITSUNIT #ifdef BITSUNIT
@ -545,18 +545,18 @@ ARC (FbBits *dst,
# define WRITE_ADDR4(n) ((n)) # define WRITE_ADDR4(n) ((n))
#endif #endif
#define WRITE1(d,n,fg) ((d)[WRITE_ADDR1(n)] = (BITS) (fg)) #define WRITE1(d,n,fg) WRITE(d + WRITE_ADDR1(n), (BITS) (fg))
#ifdef BITS2 #ifdef BITS2
# define WRITE2(d,n,fg) (*((BITS2 *) &((d)[WRITE_ADDR2(n)])) = (BITS2) (fg)) # define WRITE2(d,n,fg) WRITE((BITS2 *) &((d)[WRITE_ADDR2(n)]), (BITS2) (fg))
#else #else
# define WRITE2(d,n,fg) WRITE1(d,(n)+1,WRITE1(d,n,fg)) # define WRITE2(d,n,fg) (WRITE1(d,n,fg), WRITE1(d,(n)+1,fg))
#endif #endif
#ifdef BITS4 #ifdef BITS4
# define WRITE4(d,n,fg) (*((BITS4 *) &((d)[WRITE_ADDR4(n)])) = (BITS4) (fg)) # define WRITE4(d,n,fg) WRITE((BITS4 *) &((d)[WRITE_ADDR4(n)]), (BITS4) (fg))
#else #else
# define WRITE4(d,n,fg) WRITE2(d,(n)+2,WRITE2(d,n,fg)) # define WRITE4(d,n,fg) (WRITE2(d,n,fg), WRITE2(d,(n)+2,fg))
#endif #endif
void void
@ -892,20 +892,20 @@ POLYSEGMENT (DrawablePtr pDrawable,
FbMaskBits (dstX, width, startmask, nmiddle, endmask); FbMaskBits (dstX, width, startmask, nmiddle, endmask);
if (startmask) if (startmask)
{ {
*dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, startmask); WRITE(dstLine, FbDoMaskRRop (READ(dstLine), andBits, xorBits, startmask));
dstLine++; dstLine++;
} }
if (!andBits) if (!andBits)
while (nmiddle--) while (nmiddle--)
*dstLine++ = xorBits; WRITE(dstLine++, xorBits);
else else
while (nmiddle--) while (nmiddle--)
{ {
*dstLine = FbDoRRop (*dstLine, andBits, xorBits); WRITE(dstLine, FbDoRRop (READ(dstLine), andBits, xorBits));
dstLine++; dstLine++;
} }
if (endmask) if (endmask)
*dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, endmask); WRITE(dstLine, FbDoMaskRRop (READ(dstLine), andBits, xorBits, endmask));
} }
else else
{ {

View File

@ -92,10 +92,10 @@ fbBlt (FbBits *srcLine,
if (!upsidedown) if (!upsidedown)
for (i = 0; i < height; i++) for (i = 0; i < height; i++)
memcpy(dst + i * dstStride, src + i * srcStride, width); MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
else else
for (i = height - 1; i >= 0; i--) for (i = height - 1; i >= 0; i--)
memcpy(dst + i * dstStride, src + i * srcStride, width); MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
return; return;
} }
@ -137,7 +137,7 @@ fbBlt (FbBits *srcLine,
{ {
if (endmask) if (endmask)
{ {
bits = *--src; bits = READ(--src);
--dst; --dst;
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask); FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
} }
@ -145,20 +145,20 @@ fbBlt (FbBits *srcLine,
if (destInvarient) if (destInvarient)
{ {
while (n--) while (n--)
*--dst = FbDoDestInvarientMergeRop(*--src); WRITE(--dst, FbDoDestInvarientMergeRop(READ(--src)));
} }
else else
{ {
while (n--) while (n--)
{ {
bits = *--src; bits = READ(--src);
--dst; --dst;
*dst = FbDoMergeRop (bits, *dst); WRITE(dst, FbDoMergeRop (bits, READ(dst)));
} }
} }
if (startmask) if (startmask)
{ {
bits = *--src; bits = READ(--src);
--dst; --dst;
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask); FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
} }
@ -167,7 +167,7 @@ fbBlt (FbBits *srcLine,
{ {
if (startmask) if (startmask)
{ {
bits = *src++; bits = READ(src++);
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask); FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
dst++; dst++;
} }
@ -198,20 +198,20 @@ fbBlt (FbBits *srcLine,
} }
#endif #endif
while (n--) while (n--)
*dst++ = FbDoDestInvarientMergeRop(*src++); WRITE(dst++, FbDoDestInvarientMergeRop(READ(src++)));
} }
else else
{ {
while (n--) while (n--)
{ {
bits = *src++; bits = READ(src++);
*dst = FbDoMergeRop (bits, *dst); WRITE(dst, FbDoMergeRop (bits, READ(dst)));
dst++; dst++;
} }
} }
if (endmask) if (endmask)
{ {
bits = *src; bits = READ(src);
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask); FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
} }
} }
@ -240,13 +240,13 @@ fbBlt (FbBits *srcLine,
if (reverse) if (reverse)
{ {
if (srcX < dstX) if (srcX < dstX)
bits1 = *--src; bits1 = READ(--src);
if (endmask) if (endmask)
{ {
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift)) if (FbScrRight(endmask, leftShift))
{ {
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
} }
--dst; --dst;
@ -258,10 +258,10 @@ fbBlt (FbBits *srcLine,
while (n--) while (n--)
{ {
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
--dst; --dst;
*dst = FbDoDestInvarientMergeRop(bits); WRITE(dst, FbDoDestInvarientMergeRop(bits));
} }
} }
else else
@ -269,10 +269,10 @@ fbBlt (FbBits *srcLine,
while (n--) while (n--)
{ {
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
--dst; --dst;
*dst = FbDoMergeRop(bits, *dst); WRITE(dst, FbDoMergeRop(bits, READ(dst)));
} }
} }
if (startmask) if (startmask)
@ -280,7 +280,7 @@ fbBlt (FbBits *srcLine,
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift)) if (FbScrRight(startmask, leftShift))
{ {
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
} }
--dst; --dst;
@ -290,13 +290,13 @@ fbBlt (FbBits *srcLine,
else else
{ {
if (srcX > dstX) if (srcX > dstX)
bits1 = *src++; bits1 = READ(src++);
if (startmask) if (startmask)
{ {
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(startmask, rightShift)) if (FbScrLeft(startmask, rightShift))
{ {
bits1 = *src++; bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
} }
FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask); FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
@ -308,9 +308,9 @@ fbBlt (FbBits *srcLine,
while (n--) while (n--)
{ {
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
bits1 = *src++; bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
*dst = FbDoDestInvarientMergeRop(bits); WRITE(dst, FbDoDestInvarientMergeRop(bits));
dst++; dst++;
} }
} }
@ -319,9 +319,9 @@ fbBlt (FbBits *srcLine,
while (n--) while (n--)
{ {
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
bits1 = *src++; bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
*dst = FbDoMergeRop(bits, *dst); WRITE(dst, FbDoMergeRop(bits, READ(dst)));
dst++; dst++;
} }
} }
@ -330,7 +330,7 @@ fbBlt (FbBits *srcLine,
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift)) if (FbScrLeft(endmask, rightShift))
{ {
bits1 = *src; bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
} }
FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask); FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
@ -425,45 +425,45 @@ fbBlt24Line (FbBits *src,
{ {
if (endmask) if (endmask)
{ {
bits = *--src; bits = READ(--src);
--dst; --dst;
*dst = FbDoMaskMergeRop (bits, *dst, mask & endmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
mask = FbPrev24Pix (mask); mask = FbPrev24Pix (mask);
} }
while (n--) while (n--)
{ {
bits = *--src; bits = READ(--src);
--dst; --dst;
*dst = FbDoMaskMergeRop (bits, *dst, mask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
mask = FbPrev24Pix (mask); mask = FbPrev24Pix (mask);
} }
if (startmask) if (startmask)
{ {
bits = *--src; bits = READ(--src);
--dst; --dst;
*dst = FbDoMaskMergeRop(bits, *dst, mask & startmask); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
} }
} }
else else
{ {
if (startmask) if (startmask)
{ {
bits = *src++; bits = READ(src++);
*dst = FbDoMaskMergeRop (bits, *dst, mask & startmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
dst++; dst++;
mask = FbNext24Pix(mask); mask = FbNext24Pix(mask);
} }
while (n--) while (n--)
{ {
bits = *src++; bits = READ(src++);
*dst = FbDoMaskMergeRop (bits, *dst, mask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
dst++; dst++;
mask = FbNext24Pix(mask); mask = FbNext24Pix(mask);
} }
if (endmask) if (endmask)
{ {
bits = *src; bits = READ(src);
*dst = FbDoMaskMergeRop(bits, *dst, mask & endmask); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
} }
} }
} }
@ -484,26 +484,26 @@ fbBlt24Line (FbBits *src,
if (reverse) if (reverse)
{ {
if (srcX < dstX) if (srcX < dstX)
bits1 = *--src; bits1 = READ(--src);
if (endmask) if (endmask)
{ {
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift)) if (FbScrRight(endmask, leftShift))
{ {
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
} }
--dst; --dst;
*dst = FbDoMaskMergeRop (bits, *dst, mask & endmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
mask = FbPrev24Pix(mask); mask = FbPrev24Pix(mask);
} }
while (n--) while (n--)
{ {
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
--dst; --dst;
*dst = FbDoMaskMergeRop(bits, *dst, mask); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
mask = FbPrev24Pix(mask); mask = FbPrev24Pix(mask);
} }
if (startmask) if (startmask)
@ -511,32 +511,32 @@ fbBlt24Line (FbBits *src,
bits = FbScrRight(bits1, rightShift); bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift)) if (FbScrRight(startmask, leftShift))
{ {
bits1 = *--src; bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift); bits |= FbScrLeft(bits1, leftShift);
} }
--dst; --dst;
*dst = FbDoMaskMergeRop (bits, *dst, mask & startmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
} }
} }
else else
{ {
if (srcX > dstX) if (srcX > dstX)
bits1 = *src++; bits1 = READ(src++);
if (startmask) if (startmask)
{ {
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
bits1 = *src++; bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
*dst = FbDoMaskMergeRop (bits, *dst, mask & startmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
dst++; dst++;
mask = FbNext24Pix(mask); mask = FbNext24Pix(mask);
} }
while (n--) while (n--)
{ {
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
bits1 = *src++; bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
*dst = FbDoMaskMergeRop(bits, *dst, mask); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
dst++; dst++;
mask = FbNext24Pix(mask); mask = FbNext24Pix(mask);
} }
@ -545,10 +545,10 @@ fbBlt24Line (FbBits *src,
bits = FbScrLeft(bits1, leftShift); bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift)) if (FbScrLeft(endmask, rightShift))
{ {
bits1 = *src; bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift); bits |= FbScrRight(bits1, rightShift);
} }
*dst = FbDoMaskMergeRop (bits, *dst, mask & endmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
} }
} }
} }
@ -707,8 +707,8 @@ fbBltOdd (FbBits *srcLine,
{ {
if (startmask) if (startmask)
{ {
bits = *src++; bits = READ(src++);
*dst = FbDoMaskMergeRop (bits, *dst, startmask); WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), startmask));
dst++; dst++;
} }
n = nmiddle; n = nmiddle;
@ -716,8 +716,8 @@ fbBltOdd (FbBits *srcLine,
{ {
while (n--) while (n--)
{ {
bits = *src++; bits = READ(src++);
*dst = FbDoDestInvarientMergeRop(bits); WRITE(dst, FbDoDestInvarientMergeRop(bits));
dst++; dst++;
} }
} }
@ -725,28 +725,28 @@ fbBltOdd (FbBits *srcLine,
{ {
while (n--) while (n--)
{ {
bits = *src++; bits = READ(src++);
*dst = FbDoMergeRop (bits, *dst); WRITE(dst, FbDoMergeRop (bits, READ(dst)));
dst++; dst++;
} }
} }
if (endmask) if (endmask)
{ {
bits = *src; bits = READ(src);
*dst = FbDoMaskMergeRop(bits, *dst, endmask); WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), endmask));
} }
} }
else else
{ {
bits = 0; bits = 0;
if (srcX > dstX) if (srcX > dstX)
bits = *src++; bits = READ(src++);
if (startmask) if (startmask)
{ {
bits1 = FbScrLeft(bits, leftShift); bits1 = FbScrLeft(bits, leftShift);
bits = *src++; bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift); bits1 |= FbScrRight(bits, rightShift);
*dst = FbDoMaskMergeRop (bits1, *dst, startmask); WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), startmask));
dst++; dst++;
} }
n = nmiddle; n = nmiddle;
@ -755,9 +755,9 @@ fbBltOdd (FbBits *srcLine,
while (n--) while (n--)
{ {
bits1 = FbScrLeft(bits, leftShift); bits1 = FbScrLeft(bits, leftShift);
bits = *src++; bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift); bits1 |= FbScrRight(bits, rightShift);
*dst = FbDoDestInvarientMergeRop(bits1); WRITE(dst, FbDoDestInvarientMergeRop(bits1));
dst++; dst++;
} }
} }
@ -766,9 +766,9 @@ fbBltOdd (FbBits *srcLine,
while (n--) while (n--)
{ {
bits1 = FbScrLeft(bits, leftShift); bits1 = FbScrLeft(bits, leftShift);
bits = *src++; bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift); bits1 |= FbScrRight(bits, rightShift);
*dst = FbDoMergeRop(bits1, *dst); WRITE(dst, FbDoMergeRop(bits1, READ(dst)));
dst++; dst++;
} }
} }
@ -777,10 +777,10 @@ fbBltOdd (FbBits *srcLine,
bits1 = FbScrLeft(bits, leftShift); bits1 = FbScrLeft(bits, leftShift);
if (FbScrLeft(endmask, rightShift)) if (FbScrLeft(endmask, rightShift))
{ {
bits = *src; bits = READ(src);
bits1 |= FbScrRight(bits, rightShift); bits1 |= FbScrRight(bits, rightShift);
} }
*dst = FbDoMaskMergeRop (bits1, *dst, endmask); WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), endmask));
} }
} }
} }

View File

@ -51,12 +51,12 @@
#define LoadBits {\ #define LoadBits {\
if (leftShift) { \ if (leftShift) { \
bitsRight = (src < srcEnd ? *src++ : 0); \ bitsRight = (src < srcEnd ? READ(src++) : 0); \
bits = (FbStipLeft (bitsLeft, leftShift) | \ bits = (FbStipLeft (bitsLeft, leftShift) | \
FbStipRight(bitsRight, rightShift)); \ FbStipRight(bitsRight, rightShift)); \
bitsLeft = bitsRight; \ bitsLeft = bitsRight; \
} else \ } else \
bits = (src < srcEnd ? *src++ : 0); \ bits = (src < srcEnd ? READ(src++) : 0); \
} }
#ifndef FBNOPIXADDR #ifndef FBNOPIXADDR
@ -285,7 +285,7 @@ fbBltOne (FbStip *src,
bitsLeft = 0; bitsLeft = 0;
if (srcX > dstS) if (srcX > dstS)
bitsLeft = *src++; bitsLeft = READ(src++);
if (n) if (n)
{ {
/* /*
@ -338,7 +338,7 @@ fbBltOne (FbStip *src,
else else
#endif #endif
mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)]; mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
*dst = FbOpaqueStipple (mask, fgxor, bgxor); WRITE(dst, FbOpaqueStipple (mask, fgxor, bgxor));
dst++; dst++;
bits = FbStipLeft(bits, pixelsPerDst); bits = FbStipLeft(bits, pixelsPerDst);
} }
@ -368,8 +368,8 @@ fbBltOne (FbStip *src,
if (left || !transparent) if (left || !transparent)
{ {
mask = fbBits[left]; mask = fbBits[left];
*dst = FbStippleRRop (*dst, mask, WRITE(dst, FbStippleRRop (READ(dst), mask,
fgand, fgxor, bgand, bgxor); fgand, fgxor, bgand, bgxor));
} }
dst++; dst++;
bits = FbStipLeft(bits, pixelsPerDst); bits = FbStipLeft(bits, pixelsPerDst);
@ -537,7 +537,7 @@ const FbBits fbStipple24Bits[3][1 << FbStip24Len] = {
stip = FbLeftStipBits(bits, len); \ stip = FbLeftStipBits(bits, len); \
} else { \ } else { \
stip = FbLeftStipBits(bits, remain); \ stip = FbLeftStipBits(bits, remain); \
bits = (src < srcEnd ? *src++ : 0); \ bits = (src < srcEnd ? READ(src++) : 0); \
__len = (len) - remain; \ __len = (len) - remain; \
stip = FbMergePartStip24Bits(stip, FbLeftStipBits(bits, __len), \ stip = FbMergePartStip24Bits(stip, FbLeftStipBits(bits, __len), \
remain, __len); \ remain, __len); \
@ -548,7 +548,7 @@ const FbBits fbStipple24Bits[3][1 << FbStip24Len] = {
} }
#define fbInitStipBits(offset,len,stip) {\ #define fbInitStipBits(offset,len,stip) {\
bits = FbStipLeft (*src++,offset); \ bits = FbStipLeft (READ(src++),offset); \
remain = FB_STIP_UNIT - offset; \ remain = FB_STIP_UNIT - offset; \
fbFirstStipBits(len,stip); \ fbFirstStipBits(len,stip); \
stip = FbMergeStip24Bits (0, stip, len); \ stip = FbMergeStip24Bits (0, stip, len); \
@ -631,10 +631,11 @@ fbBltOne24 (FbStip *srcLine,
if (leftMask) if (leftMask)
{ {
mask = fbStipple24Bits[rot >> 3][stip]; mask = fbStipple24Bits[rot >> 3][stip];
*dst = (*dst & ~leftMask) | (FbOpaqueStipple (mask, WRITE(dst, (READ(dst) & ~leftMask) |
FbRot24(fgxor, rot), (FbOpaqueStipple (mask,
FbRot24(bgxor, rot)) FbRot24(fgxor, rot),
& leftMask); FbRot24(bgxor, rot))
& leftMask));
dst++; dst++;
fbNextStipBits(rot,stip); fbNextStipBits(rot,stip);
} }
@ -642,19 +643,20 @@ fbBltOne24 (FbStip *srcLine,
while (nl--) while (nl--)
{ {
mask = fbStipple24Bits[rot>>3][stip]; mask = fbStipple24Bits[rot>>3][stip];
*dst = FbOpaqueStipple (mask, WRITE(dst, FbOpaqueStipple (mask,
FbRot24(fgxor, rot), FbRot24(fgxor, rot),
FbRot24(bgxor, rot)); FbRot24(bgxor, rot)));
dst++; dst++;
fbNextStipBits(rot,stip); fbNextStipBits(rot,stip);
} }
if (rightMask) if (rightMask)
{ {
mask = fbStipple24Bits[rot >> 3][stip]; mask = fbStipple24Bits[rot >> 3][stip];
*dst = (*dst & ~rightMask) | (FbOpaqueStipple (mask, WRITE(dst, (READ(dst) & ~rightMask) |
FbRot24(fgxor, rot), (FbOpaqueStipple (mask,
FbRot24(bgxor, rot)) FbRot24(fgxor, rot),
& rightMask); FbRot24(bgxor, rot))
& rightMask));
} }
dst += dstStride; dst += dstStride;
src += srcStride; src += srcStride;
@ -674,7 +676,7 @@ fbBltOne24 (FbStip *srcLine,
if (stip) if (stip)
{ {
mask = fbStipple24Bits[rot >> 3][stip] & leftMask; mask = fbStipple24Bits[rot >> 3][stip] & leftMask;
*dst = (*dst & ~mask) | (FbRot24(fgxor, rot) & mask); WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask));
} }
dst++; dst++;
fbNextStipBits (rot, stip); fbNextStipBits (rot, stip);
@ -685,7 +687,7 @@ fbBltOne24 (FbStip *srcLine,
if (stip) if (stip)
{ {
mask = fbStipple24Bits[rot>>3][stip]; mask = fbStipple24Bits[rot>>3][stip];
*dst = (*dst & ~mask) | (FbRot24(fgxor,rot) & mask); WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor,rot) & mask));
} }
dst++; dst++;
fbNextStipBits (rot, stip); fbNextStipBits (rot, stip);
@ -695,7 +697,7 @@ fbBltOne24 (FbStip *srcLine,
if (stip) if (stip)
{ {
mask = fbStipple24Bits[rot >> 3][stip] & rightMask; mask = fbStipple24Bits[rot >> 3][stip] & rightMask;
*dst = (*dst & ~mask) | (FbRot24(fgxor, rot) & mask); WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask));
} }
} }
dst += dstStride; dst += dstStride;
@ -712,12 +714,12 @@ fbBltOne24 (FbStip *srcLine,
if (leftMask) if (leftMask)
{ {
mask = fbStipple24Bits[rot >> 3][stip]; mask = fbStipple24Bits[rot >> 3][stip];
*dst = FbStippleRRopMask (*dst, mask, WRITE(dst, FbStippleRRopMask (READ(dst), mask,
FbRot24(fgand, rot), FbRot24(fgand, rot),
FbRot24(fgxor, rot), FbRot24(fgxor, rot),
FbRot24(bgand, rot), FbRot24(bgand, rot),
FbRot24(bgxor, rot), FbRot24(bgxor, rot),
leftMask); leftMask));
dst++; dst++;
fbNextStipBits(rot,stip); fbNextStipBits(rot,stip);
} }
@ -725,23 +727,23 @@ fbBltOne24 (FbStip *srcLine,
while (nl--) while (nl--)
{ {
mask = fbStipple24Bits[rot >> 3][stip]; mask = fbStipple24Bits[rot >> 3][stip];
*dst = FbStippleRRop (*dst, mask, WRITE(dst, FbStippleRRop (READ(dst), mask,
FbRot24(fgand, rot), FbRot24(fgand, rot),
FbRot24(fgxor, rot), FbRot24(fgxor, rot),
FbRot24(bgand, rot), FbRot24(bgand, rot),
FbRot24(bgxor, rot)); FbRot24(bgxor, rot)));
dst++; dst++;
fbNextStipBits(rot,stip); fbNextStipBits(rot,stip);
} }
if (rightMask) if (rightMask)
{ {
mask = fbStipple24Bits[rot >> 3][stip]; mask = fbStipple24Bits[rot >> 3][stip];
*dst = FbStippleRRopMask (*dst, mask, WRITE(dst, FbStippleRRopMask (READ(dst), mask,
FbRot24(fgand, rot), FbRot24(fgand, rot),
FbRot24(fgxor, rot), FbRot24(fgxor, rot),
FbRot24(bgand, rot), FbRot24(bgand, rot),
FbRot24(bgxor, rot), FbRot24(bgxor, rot),
rightMask); rightMask));
} }
dst += dstStride; dst += dstStride;
} }
@ -832,7 +834,7 @@ fbBltPlane (FbBits *src,
if (srcBpp == 24) if (srcBpp == 24)
srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp); srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp);
#endif #endif
srcBits = *s++; srcBits = READ(s++);
dstMask = dstMaskFirst; dstMask = dstMaskFirst;
dstUnion = 0; dstUnion = 0;
@ -844,7 +846,7 @@ fbBltPlane (FbBits *src,
{ {
if (!srcMask) if (!srcMask)
{ {
srcBits = *s++; srcBits = READ(s++);
#ifdef FB_24BIT #ifdef FB_24BIT
if (srcBpp == 24) if (srcBpp == 24)
srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24); srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24);
@ -853,9 +855,9 @@ fbBltPlane (FbBits *src,
} }
if (!dstMask) if (!dstMask)
{ {
*d = FbStippleRRopMask(*d, dstBits, WRITE(d, FbStippleRRopMask(READ(d), dstBits,
fgand, fgxor, bgand, bgxor, fgand, fgxor, bgand, bgxor,
dstUnion); dstUnion));
d++; d++;
dstMask = FbStipMask(0,1); dstMask = FbStipMask(0,1);
dstUnion = 0; dstUnion = 0;
@ -871,9 +873,9 @@ fbBltPlane (FbBits *src,
dstMask = FbStipRight(dstMask,1); dstMask = FbStipRight(dstMask,1);
} }
if (dstUnion) if (dstUnion)
*d = FbStippleRRopMask(*d,dstBits, WRITE(d, FbStippleRRopMask(READ(d),dstBits,
fgand, fgxor, bgand, bgxor, fgand, fgxor, bgand, bgxor,
dstUnion); dstUnion));
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@
#define StepAlpha ((__ap += __ao), (__ao ^= 1)) #define StepAlpha ((__ap += __ao), (__ao ^= 1))
#define AddAlpha(a) { \ #define AddAlpha(a) { \
CARD8 __o = *__ap; \ CARD8 __o = READ(__ap); \
CARD8 __a = (a) + Get4(__o, __ao); \ CARD8 __a = (a) + Get4(__o, __ao); \
*__ap = Put4 (__o, __ao, __a | (0 - ((__a) >> 4))); \ WRITE(__ap, Put4 (__o, __ao, __a | (0 - ((__a) >> 4)))); \
} }
#include "fbedgeimp.h" #include "fbedgeimp.h"
@ -102,7 +102,7 @@ add_saturate_8 (CARD8 *buf, int value, int length)
{ {
while (length--) while (length--)
{ {
*buf = clip255 (*buf + value); WRITE(buf, clip255 (READ(buf) + value));
buf++; buf++;
} }
} }
@ -164,11 +164,11 @@ fbRasterizeEdges8 (FbBits *buf,
/* Add coverage across row */ /* Add coverage across row */
if (lxi == rxi) if (lxi == rxi)
{ {
ap[lxi] = clip255 (ap[lxi] + rxs - lxs); WRITE(ap +lxi, clip255 (READ(ap + lxi) + rxs - lxs));
} }
else else
{ {
ap[lxi] = clip255 (ap[lxi] + N_X_FRAC(8) - lxs); WRITE(ap + lxi, clip255 (READ(ap + lxi) + N_X_FRAC(8) - lxs));
/* Move forward so that lxi/rxi is the pixel span */ /* Move forward so that lxi/rxi is the pixel span */
lxi++; lxi++;
@ -238,7 +238,7 @@ fbRasterizeEdges8 (FbBits *buf,
* necessary to avoid a buffer overrun, (when rx * necessary to avoid a buffer overrun, (when rx
* is exactly on a pixel boundary). */ * is exactly on a pixel boundary). */
if (rxs) if (rxs)
ap[rxi] = clip255 (ap[rxi] + rxs); WRITE(ap + rxi, clip255 (READ(ap + rxi) + rxs));
} }
} }
@ -247,7 +247,7 @@ fbRasterizeEdges8 (FbBits *buf,
if (fill_start != fill_end) { if (fill_start != fill_end) {
if (fill_size == N_Y_FRAC(8)) if (fill_size == N_Y_FRAC(8))
{ {
memset (ap + fill_start, 0xff, fill_end - fill_start); MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start);
} }
else else
{ {
@ -273,7 +273,7 @@ fbRasterizeEdges8 (FbBits *buf,
{ {
if (fill_size == N_Y_FRAC(8)) if (fill_size == N_Y_FRAC(8))
{ {
memset (ap + fill_start, 0xff, fill_end - fill_start); MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start);
} }
else else
{ {

View File

@ -76,12 +76,14 @@ rasterizeEdges (FbBits *buf,
x &= FB_MASK; x &= FB_MASK;
FbMaskBits (x, width, startmask, nmiddle, endmask); FbMaskBits (x, width, startmask, nmiddle, endmask);
if (startmask) if (startmask) {
*a++ |= startmask; WRITE(a, READ(a) | startmask);
a++;
}
while (nmiddle--) while (nmiddle--)
*a++ = FB_ALLONES; WRITE(a++, FB_ALLONES);
if (endmask) if (endmask)
*a |= endmask; WRITE(a, READ(a) | endmask);
} }
#else #else
{ {

View File

@ -106,14 +106,14 @@ fbPadPixmap (PixmapPtr pPixmap)
mask = FbBitsMask (0, width); mask = FbBitsMask (0, width);
while (height--) while (height--)
{ {
b = *bits & mask; b = READ(bits) & mask;
w = width; w = width;
while (w < FB_UNIT) while (w < FB_UNIT)
{ {
b = b | FbScrRight(b, w); b = b | FbScrRight(b, w);
w <<= 1; w <<= 1;
} }
*bits = b; WRITE(bits, b);
bits += stride; bits += stride;
} }
@ -155,7 +155,7 @@ fbLineRepeat (FbBits *bits, int len, int width)
width = (width + FB_UNIT-1) >> FB_SHIFT; width = (width + FB_UNIT-1) >> FB_SHIFT;
bits++; bits++;
while (--width) while (--width)
if (*bits != first) if (READ(bits) != first)
return FALSE; return FALSE;
return TRUE; return TRUE;
} }

View File

@ -62,11 +62,11 @@ fbGlyphIn (RegionPtr pRegion,
#ifdef FB_24BIT #ifdef FB_24BIT
#ifndef FBNOPIXADDR #ifndef FBNOPIXADDR
#define WRITE1(d,n,fg) ((d)[n] = (CARD8) fg) #define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg)
#define WRITE2(d,n,fg) (*(CARD16 *) &(d[n]) = (CARD16) fg) #define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg)
#define WRITE4(d,n,fg) (*(CARD32 *) &(d[n]) = (CARD32) fg) #define WRITE4(d,n,fg) WRITE((CARD32 *) &(d[n]), (CARD32) fg)
#if FB_UNIT == 6 && IMAGE_BYTE_ORDER == LSBFirst #if FB_UNIT == 6 && IMAGE_BYTE_ORDER == LSBFirst
#define WRITE8(d) (*(FbBits *) &(d[0]) = fg) #define WRITE8(d) WRITE((FbBits *) &(d[0]), fg)
#else #else
#define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB) #define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB)
#endif #endif
@ -157,7 +157,7 @@ fbGlyph24 (FbBits *dstBits,
lshift = 4 - shift; lshift = 4 - shift;
while (height--) while (height--)
{ {
bits = *stipple++; bits = READ(stipple++);
n = lshift; n = lshift;
dst = dstLine; dst = dstLine;
while (bits) while (bits)

View File

@ -137,18 +137,18 @@ fbCompositeSolidMask_nx8x8888 (CARD8 op,
while (w--) while (w--)
{ {
m = *mask++; m = READ(mask++);
if (m == 0xff) if (m == 0xff)
{ {
if (srca == 0xff) if (srca == 0xff)
*dst = src & dstMask; WRITE(dst, src & dstMask);
else else
*dst = fbOver (src, *dst) & dstMask; WRITE(dst, fbOver (src, READ(dst)) & dstMask);
} }
else if (m) else if (m)
{ {
d = fbIn (src, m); d = fbIn (src, m);
*dst = fbOver (d, *dst) & dstMask; WRITE(dst, fbOver (d, READ(dst)) & dstMask);
} }
dst++; dst++;
} }
@ -199,17 +199,17 @@ fbCompositeSolidMask_nx8888x8888C (CARD8 op,
while (w--) while (w--)
{ {
ma = *mask++; ma = READ(mask++);
if (ma == 0xffffffff) if (ma == 0xffffffff)
{ {
if (srca == 0xff) if (srca == 0xff)
*dst = src & dstMask; WRITE(dst, src & dstMask);
else else
*dst = fbOver (src, *dst) & dstMask; WRITE(dst, fbOver (src, READ(dst)) & dstMask);
} }
else if (ma) else if (ma)
{ {
d = *dst; d = READ(dst);
#define FbInOverC(src,srca,msk,dst,i,result) { \ #define FbInOverC(src,srca,msk,dst,i,result) { \
CARD16 __a = FbGet8(msk,i); \ CARD16 __a = FbGet8(msk,i); \
CARD32 __t, __ta; \ CARD32 __t, __ta; \
@ -224,7 +224,7 @@ fbCompositeSolidMask_nx8888x8888C (CARD8 op,
FbInOverC (src, srca, ma, d, 8, n); FbInOverC (src, srca, ma, d, 8, n);
FbInOverC (src, srca, ma, d, 16, o); FbInOverC (src, srca, ma, d, 16, o);
FbInOverC (src, srca, ma, d, 24, p); FbInOverC (src, srca, ma, d, 24, p);
*dst = m|n|o|p; WRITE(dst, m|n|o|p);
} }
dst++; dst++;
} }
@ -274,7 +274,7 @@ fbCompositeSolidMask_nx8x0888 (CARD8 op,
while (w--) while (w--)
{ {
m = *mask++; m = READ(mask++);
if (m == 0xff) if (m == 0xff)
{ {
if (srca == 0xff) if (srca == 0xff)
@ -339,23 +339,23 @@ fbCompositeSolidMask_nx8x0565 (CARD8 op,
while (w--) while (w--)
{ {
m = *mask++; m = READ(mask++);
if (m == 0xff) if (m == 0xff)
{ {
if (srca == 0xff) if (srca == 0xff)
d = src; d = src;
else else
{ {
d = *dst; d = READ(dst);
d = fbOver24 (src, cvt0565to8888(d)); d = fbOver24 (src, cvt0565to8888(d));
} }
*dst = cvt8888to0565(d); WRITE(dst, cvt8888to0565(d));
} }
else if (m) else if (m)
{ {
d = *dst; d = READ(dst);
d = fbOver24 (fbIn(src,m), cvt0565to8888(d)); d = fbOver24 (fbIn(src,m), cvt0565to8888(d));
*dst = cvt8888to0565(d); WRITE(dst, cvt8888to0565(d));
} }
dst++; dst++;
} }
@ -409,29 +409,29 @@ fbCompositeSolidMask_nx8888x0565C (CARD8 op,
while (w--) while (w--)
{ {
ma = *mask++; ma = READ(mask++);
if (ma == 0xffffffff) if (ma == 0xffffffff)
{ {
if (srca == 0xff) if (srca == 0xff)
{ {
*dst = src16; WRITE(dst, src16);
} }
else else
{ {
d = *dst; d = READ(dst);
d = fbOver24 (src, cvt0565to8888(d)); d = fbOver24 (src, cvt0565to8888(d));
*dst = cvt8888to0565(d); WRITE(dst, cvt8888to0565(d));
} }
} }
else if (ma) else if (ma)
{ {
d = *dst; d = READ(dst);
d = cvt0565to8888(d); d = cvt0565to8888(d);
FbInOverC (src, srca, ma, d, 0, m); FbInOverC (src, srca, ma, d, 0, m);
FbInOverC (src, srca, ma, d, 8, n); FbInOverC (src, srca, ma, d, 8, n);
FbInOverC (src, srca, ma, d, 16, o); FbInOverC (src, srca, ma, d, 16, o);
d = m|n|o; d = m|n|o;
*dst = cvt8888to0565(d); WRITE(dst, cvt8888to0565(d));
} }
dst++; dst++;
} }
@ -476,12 +476,12 @@ fbCompositeSrc_8888x8888 (CARD8 op,
while (w--) while (w--)
{ {
s = *src++; s = READ(src++);
a = s >> 24; a = s >> 24;
if (a == 0xff) if (a == 0xff)
*dst = s & dstMask; WRITE(dst, s & dstMask);
else if (a) else if (a)
*dst = fbOver (s, *dst) & dstMask; WRITE(dst, fbOver (s, READ(dst)) & dstMask);
dst++; dst++;
} }
} }
@ -524,7 +524,7 @@ fbCompositeSrc_8888x0888 (CARD8 op,
while (w--) while (w--)
{ {
s = *src++; s = READ(src++);
a = s >> 24; a = s >> 24;
if (a) if (a)
{ {
@ -576,7 +576,7 @@ fbCompositeSrc_8888x0565 (CARD8 op,
while (w--) while (w--)
{ {
s = *src++; s = READ(src++);
a = s >> 24; a = s >> 24;
if (a) if (a)
{ {
@ -584,10 +584,10 @@ fbCompositeSrc_8888x0565 (CARD8 op,
d = s; d = s;
else else
{ {
d = *dst; d = READ(dst);
d = fbOver24 (s, cvt0565to8888(d)); d = fbOver24 (s, cvt0565to8888(d));
} }
*dst = cvt8888to0565(d); WRITE(dst, cvt8888to0565(d));
} }
dst++; dst++;
} }
@ -629,7 +629,7 @@ fbCompositeSrc_0565x0565 (CARD8 op,
w = width; w = width;
while (w--) while (w--)
*dst++ = *src++; WRITE(dst, READ(src++));
} }
fbFinishAccess (pDst->pDrawable); fbFinishAccess (pDst->pDrawable);
@ -670,16 +670,16 @@ fbCompositeSrcAdd_8000x8000 (CARD8 op,
while (w--) while (w--)
{ {
s = *src++; s = READ(src++);
if (s) if (s)
{ {
if (s != 0xff) if (s != 0xff)
{ {
d = *dst; d = READ(dst);
t = d + s; t = d + s;
s = t | (0 - (t >> 8)); s = t | (0 - (t >> 8));
} }
*dst = s; WRITE(dst, s);
} }
dst++; dst++;
} }
@ -724,12 +724,12 @@ fbCompositeSrcAdd_8888x8888 (CARD8 op,
while (w--) while (w--)
{ {
s = *src++; s = READ(src++);
if (s) if (s)
{ {
if (s != 0xffffffff) if (s != 0xffffffff)
{ {
d = *dst; d = READ(dst);
if (d) if (d)
{ {
m = FbAdd(s,d,0,t); m = FbAdd(s,d,0,t);
@ -739,7 +739,7 @@ fbCompositeSrcAdd_8888x8888 (CARD8 op,
s = m|n|o|p; s = m|n|o|p;
} }
} }
*dst = s; WRITE(dst, s);
} }
dst++; dst++;
} }

View File

@ -76,13 +76,13 @@
fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
switch (__bpp__) { \ switch (__bpp__) { \
case 32: \ case 32: \
(bits) = *(CARD32 *) __bits__; \ (bits) = READ((CARD32 *) __bits__); \
break; \ break; \
case 24: \ case 24: \
(bits) = Fetch24 ((CARD8 *) __bits__); \ (bits) = Fetch24 ((CARD8 *) __bits__); \
break; \ break; \
case 16: \ case 16: \
(bits) = *(CARD16 *) __bits__; \ (bits) = READ((CARD16 *) __bits__); \
(bits) = cvt0565to8888(bits); \ (bits) = cvt0565to8888(bits); \
break; \ break; \
default: \ default: \
@ -121,22 +121,22 @@
#if IMAGE_BYTE_ORDER == MSBFirst #if IMAGE_BYTE_ORDER == MSBFirst
#define Fetch24(a) ((unsigned long) (a) & 1 ? \ #define Fetch24(a) ((unsigned long) (a) & 1 ? \
((*(a) << 16) | *((CARD16 *) ((a)+1))) : \ ((READ(a) << 16) | READ((CARD16 *) ((a)+1))) : \
((*((CARD16 *) (a)) << 8) | *((a)+2))) ((READ((CARD16 *) (a)) << 8) | READ((a)+2)))
#define Store24(a,v) ((unsigned long) (a) & 1 ? \ #define Store24(a,v) ((unsigned long) (a) & 1 ? \
((*(a) = (CARD8) ((v) >> 16)), \ (WRITE(a, (CARD8) ((v) >> 16)), \
(*((CARD16 *) ((a)+1)) = (CARD16) (v))) : \ WRITE((CARD16 *) ((a)+1), (CARD16) (v))) : \
((*((CARD16 *) (a)) = (CARD16) ((v) >> 8)), \ (WRITE((CARD16 *) (a), (CARD16) ((v) >> 8)), \
(*((a)+2) = (CARD8) (v)))) WRITE((a)+2, (CARD8) (v))))
#else #else
#define Fetch24(a) ((unsigned long) (a) & 1 ? \ #define Fetch24(a) ((unsigned long) (a) & 1 ? \
((*(a)) | (*((CARD16 *) ((a)+1)) << 8)) : \ (READ(a) | (READ((CARD16 *) ((a)+1)) << 8)) : \
((*((CARD16 *) (a))) | (*((a)+2) << 16))) (READ((CARD16 *) (a)) | (READ((a)+2) << 16)))
#define Store24(a,v) ((unsigned long) (a) & 1 ? \ #define Store24(a,v) ((unsigned long) (a) & 1 ? \
((*(a) = (CARD8) (v)), \ (WRITE(a, (CARD8) (v)), \
(*((CARD16 *) ((a)+1)) = (CARD16) ((v) >> 8))) : \ WRITE((CARD16 *) ((a)+1), (CARD16) ((v) >> 8))) : \
((*((CARD16 *) (a)) = (CARD16) (v)),\ (WRITE((CARD16 *) (a), (CARD16) (v)),\
(*((a)+2) = (CARD8) ((v) >> 16)))) WRITE((a)+2, (CARD8) ((v) >> 16))))
#endif #endif
/* /*

View File

@ -176,7 +176,7 @@ fbPixmapToRegion(PixmapPtr pPix)
irectLineStart = rects - FirstRect; irectLineStart = rects - FirstRect;
/* If the Screen left most bit of the word is set, we're starting in /* If the Screen left most bit of the word is set, we're starting in
* a box */ * a box */
if(*pw & mask0) if(READ(pw) & mask0)
{ {
fInBox = TRUE; fInBox = TRUE;
rx1 = 0; rx1 = 0;
@ -187,7 +187,7 @@ fbPixmapToRegion(PixmapPtr pPix)
pwLineEnd = pw + (width >> FB_SHIFT); pwLineEnd = pw + (width >> FB_SHIFT);
for (base = 0; pw < pwLineEnd; base += FB_UNIT) for (base = 0; pw < pwLineEnd; base += FB_UNIT)
{ {
w = *pw++; w = READ(pw++);
if (fInBox) if (fInBox)
{ {
if (!~w) if (!~w)
@ -228,7 +228,7 @@ fbPixmapToRegion(PixmapPtr pPix)
if(width & FB_MASK) if(width & FB_MASK)
{ {
/* Process final partial word on line */ /* Process final partial word on line */
w = *pw++; w = READ(pw++);
for(ib = 0; ib < (width & FB_MASK); ib++) for(ib = 0; ib < (width & FB_MASK); ib++)
{ {
/* If the Screen left most bit of the word is set, we're /* If the Screen left most bit of the word is set, we're

View File

@ -90,20 +90,20 @@ fbDots (FbBits *dstOrig,
FbMaskStip (x, 24, leftMask, n, rightMask); FbMaskStip (x, 24, leftMask, n, rightMask);
if (leftMask) if (leftMask)
{ {
*d = FbDoMaskRRop (*d, andT, xorT, leftMask); WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, leftMask));
andT = FbNext24Stip(andT); andT = FbNext24Stip(andT);
xorT = FbNext24Stip(xorT); xorT = FbNext24Stip(xorT);
d++; d++;
} }
if (rightMask) if (rightMask)
*d = FbDoMaskRRop(*d, andT, xorT, rightMask); WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask));
} }
else else
#endif #endif
{ {
FbStip mask; FbStip mask;
mask = FbStipMask(x, dstBpp); mask = FbStipMask(x, dstBpp);
*d = FbDoMaskRRop (*d, and, xor, mask); WRITE(d, FbDoMaskRRop (READ(d), and, xor, mask));
} }
} }
} }

View File

@ -58,7 +58,7 @@ fbPushPattern (DrawablePtr pDrawable,
w = width; w = width;
s = src; s = src;
src += srcStride; src += srcStride;
bits = *s++; bits = READ(s++);
xspan = x; xspan = x;
while (w) while (w)
{ {
@ -73,7 +73,7 @@ fbPushPattern (DrawablePtr pDrawable,
bitsMask = FbStipRight (bitsMask, 1); bitsMask = FbStipRight (bitsMask, 1);
if (!bitsMask) if (!bitsMask)
{ {
bits = *s++; bits = READ(s++);
bitsMask = FbBitsMask(0,1); bitsMask = FbBitsMask(0,1);
} }
} while (bits & bitsMask); } while (bits & bitsMask);
@ -92,7 +92,7 @@ fbPushPattern (DrawablePtr pDrawable,
bitsMask = FbStipRight (bitsMask, 1); bitsMask = FbStipRight (bitsMask, 1);
if (!bitsMask) if (!bitsMask)
{ {
bits = *s++; bits = READ(s++);
bitsMask = FbBitsMask(0,1); bitsMask = FbBitsMask(0,1);
} }
} while (!(bits & bitsMask)); } while (!(bits & bitsMask));

View File

@ -79,7 +79,7 @@ fbBresSolid (DrawablePtr pDrawable,
mask = fbBresShiftMask(mask,signdx,dstBpp); mask = fbBresShiftMask(mask,signdx,dstBpp);
if (!mask) if (!mask)
{ {
*dst = FbDoMaskRRop (*dst, and, xor, bits); WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
bits = 0; bits = 0;
dst += signdx; dst += signdx;
mask = mask0; mask = mask0;
@ -87,20 +87,20 @@ fbBresSolid (DrawablePtr pDrawable,
e += e1; e += e1;
if (e >= 0) if (e >= 0)
{ {
*dst = FbDoMaskRRop (*dst, and, xor, bits); WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
bits = 0; bits = 0;
dst += dstStride; dst += dstStride;
e += e3; e += e3;
} }
} }
if (bits) if (bits)
*dst = FbDoMaskRRop (*dst, and, xor, bits); WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
} }
else else
{ {
while (len--) while (len--)
{ {
*dst = FbDoMaskRRop (*dst, and, xor, mask); WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, mask));
dst += dstStride; dst += dstStride;
e += e1; e += e1;
if (e >= 0) if (e >= 0)
@ -166,9 +166,9 @@ fbBresDash (DrawablePtr pDrawable,
while (len--) while (len--)
{ {
if (even) if (even)
*dst = FbDoMaskRRop (*dst, and, xor, mask); WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, mask));
else if (doOdd) else if (doOdd)
*dst = FbDoMaskRRop (*dst, bgand, bgxor, mask); WRITE(dst, FbDoMaskRRop (READ(dst), bgand, bgxor, mask));
if (axis == X_AXIS) if (axis == X_AXIS)
{ {
mask = fbBresShiftMask(mask,signdx,dstBpp); mask = fbBresShiftMask(mask,signdx,dstBpp);
@ -375,13 +375,13 @@ fbBresSolid24RRop (DrawablePtr pDrawable,
FbMaskStip (x, 24, leftMask, nl, rightMask); FbMaskStip (x, 24, leftMask, nl, rightMask);
if (leftMask) if (leftMask)
{ {
*d = FbDoMaskRRop (*d, andT, xorT, leftMask); WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, leftMask));
d++; d++;
andT = FbNext24Stip (andT); andT = FbNext24Stip (andT);
xorT = FbNext24Stip (xorT); xorT = FbNext24Stip (xorT);
} }
if (rightMask) if (rightMask)
*d = FbDoMaskRRop (*d, andT, xorT, rightMask); WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, rightMask));
if (axis == X_AXIS) if (axis == X_AXIS)
{ {
x1 += signdx; x1 += signdx;
@ -474,13 +474,13 @@ fbBresDash24RRop (DrawablePtr pDrawable,
FbMaskStip (x, 24, leftMask, nl, rightMask); FbMaskStip (x, 24, leftMask, nl, rightMask);
if (leftMask) if (leftMask)
{ {
*d = FbDoMaskRRop (*d, andT, xorT, leftMask); WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, leftMask));
d++; d++;
andT = FbNext24Stip (andT); andT = FbNext24Stip (andT);
xorT = FbNext24Stip (xorT); xorT = FbNext24Stip (xorT);
} }
if (rightMask) if (rightMask)
*d = FbDoMaskRRop (*d, andT, xorT, rightMask); WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, rightMask));
} }
if (axis == X_AXIS) if (axis == X_AXIS)
{ {

View File

@ -70,12 +70,12 @@ fbSolid (FbBits *dst,
n = nmiddle; n = nmiddle;
if (!and) if (!and)
while (n--) while (n--)
*dst++ = xor; WRITE(dst++, xor);
else else
while (n--) while (n--)
{ {
*dst = FbDoRRop (*dst, and, xor); WRITE(dst, FbDoRRop (READ(dst), and, xor));
dst++; dst++;
} }
if (endmask) if (endmask)
FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor); FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor);
@ -160,26 +160,26 @@ fbSolid24 (FbBits *dst,
{ {
if (startmask) if (startmask)
{ {
*dst = FbDoMaskRRop(*dst, andS, xorS, startmask); WRITE(dst, FbDoMaskRRop(READ(dst), andS, xorS, startmask));
dst++; dst++;
} }
n = nmiddle; n = nmiddle;
if (!and0) if (!and0)
{ {
while (n >= 3) while (n >= 3)
{ {
*dst++ = xor0; WRITE(dst++, xor0);
*dst++ = xor1; WRITE(dst++, xor1);
*dst++ = xor2; WRITE(dst++, xor2);
n -= 3; n -= 3;
} }
if (n) if (n)
{ {
*dst++ = xor0; WRITE(dst++, xor0);
n--; n--;
if (n) if (n)
{ {
*dst++ = xor1; WRITE(dst++, xor1);
} }
} }
} }
@ -187,28 +187,28 @@ fbSolid24 (FbBits *dst,
{ {
while (n >= 3) while (n >= 3)
{ {
*dst = FbDoRRop (*dst, and0, xor0); WRITE(dst, FbDoRRop (READ(dst), and0, xor0));
dst++; dst++;
*dst = FbDoRRop (*dst, and1, xor1); WRITE(dst, FbDoRRop (READ(dst), and1, xor1));
dst++; dst++;
*dst = FbDoRRop (*dst, and2, xor2); WRITE(dst, FbDoRRop (READ(dst), and2, xor2));
dst++; dst++;
n -= 3; n -= 3;
} }
if (n) if (n)
{ {
*dst = FbDoRRop (*dst, and0, xor0); WRITE(dst, FbDoRRop (READ(dst), and0, xor0));
dst++; dst++;
n--; n--;
if (n) if (n)
{ {
*dst = FbDoRRop (*dst, and1, xor1); WRITE(dst, FbDoRRop (READ(dst), and1, xor1));
dst++; dst++;
} }
} }
} }
if (endmask) if (endmask)
*dst = FbDoMaskRRop (*dst, andE, xorE, endmask); WRITE(dst, FbDoMaskRRop (READ(dst), andE, xorE, endmask));
dst += dstStride; dst += dstStride;
} }
} }

View File

@ -155,7 +155,7 @@ fbEvenStipple (FbBits *dst,
/* /*
* Extract stipple bits for this scanline; * Extract stipple bits for this scanline;
*/ */
bits = *s; bits = READ(s);
s += stipStride; s += stipStride;
if (s == stipEnd) if (s == stipEnd)
s = stip; s = stip;
@ -199,12 +199,12 @@ fbEvenStipple (FbBits *dst,
n = nmiddle; n = nmiddle;
if (!and) if (!and)
while (n--) while (n--)
*dst++ = xor; WRITE(dst++, xor);
else else
{ {
while (n--) while (n--)
{ {
*dst = FbDoRRop (*dst, and, xor); WRITE(dst, FbDoRRop (READ(dst), and, xor));
dst++; dst++;
} }
} }

View File

@ -80,7 +80,7 @@ fbEvenTile (FbBits *dst,
/* /*
* Pick up bits for this scanline * Pick up bits for this scanline
*/ */
bits = *t++; bits = READ(t++);
if (t == tileEnd) t = tile; if (t == tileEnd) t = tile;
bits = FbRotLeft(bits,rot); bits = FbRotLeft(bits,rot);
and = fbAnd(alu,bits,pm); and = fbAnd(alu,bits,pm);
@ -94,11 +94,11 @@ fbEvenTile (FbBits *dst,
n = nmiddle; n = nmiddle;
if (!and) if (!and)
while (n--) while (n--)
*dst++ = xor; WRITE(dst++, xor);
else else
while (n--) while (n--)
{ {
*dst = FbDoRRop (*dst, and, xor); WRITE(dst, FbDoRRop (READ(dst), and, xor));
dst++; dst++;
} }
if (endmask) if (endmask)