1
0
Fork 0
forked from len0rd/rockbox

Slight speedup for drawing 1-bit bitmaps with draw modes 0..2

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4784 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2004-06-22 00:02:51 +00:00
parent e6590f1259
commit 051e017ab8

View file

@ -665,6 +665,10 @@ asm (
* _writeblock) */ * _writeblock) */
static void _invertblock(unsigned char *address, unsigned mask, unsigned bits) static void _invertblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
bits &= mask;
if (!bits)
return;
asm volatile ( asm volatile (
"mov #0,r1 \n" /* current_plane = 0 */ "mov #0,r1 \n" /* current_plane = 0 */
@ -680,7 +684,7 @@ static void _invertblock(unsigned char *address, unsigned mask, unsigned bits)
: /* inputs */ : /* inputs */
/* %0 */ "r"(graybuf->depth), /* %0 */ "r"(graybuf->depth),
/* %1 */ "r"(address), /* %1 */ "r"(address),
/* %2 */ "r"(mask & bits), /* %2 */ "r"(bits),
/* %3 */ "r"(graybuf->plane_size) /* %3 */ "r"(graybuf->plane_size)
: /* clobbers */ : /* clobbers */
"r1", "r2", "macl" "r1", "r2", "macl"
@ -690,13 +694,17 @@ static void _invertblock(unsigned char *address, unsigned mask, unsigned bits)
/* Call _writeblock with the mask modified to draw foreground pixels only */ /* Call _writeblock with the mask modified to draw foreground pixels only */
static void _writeblockfg(unsigned char *address, unsigned mask, unsigned bits) static void _writeblockfg(unsigned char *address, unsigned mask, unsigned bits)
{ {
_writeblock(address, mask & bits, bits); mask &= bits;
if (mask)
_writeblock(address, mask, bits);
} }
/* Call _writeblock with the mask modified to draw background pixels only */ /* Call _writeblock with the mask modified to draw background pixels only */
static void _writeblockbg(unsigned char *address, unsigned mask, unsigned bits) static void _writeblockbg(unsigned char *address, unsigned mask, unsigned bits)
{ {
_writeblock(address, mask & ~bits, bits); mask &= ~bits;
if (mask)
_writeblock(address, mask, bits);
} }
/**** public functions ****/ /**** public functions ****/