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:
parent
e6590f1259
commit
051e017ab8
1 changed files with 11 additions and 3 deletions
|
|
@ -665,6 +665,10 @@ asm (
|
|||
* _writeblock) */
|
||||
static void _invertblock(unsigned char *address, unsigned mask, unsigned bits)
|
||||
{
|
||||
bits &= mask;
|
||||
if (!bits)
|
||||
return;
|
||||
|
||||
asm volatile (
|
||||
"mov #0,r1 \n" /* current_plane = 0 */
|
||||
|
||||
|
|
@ -680,7 +684,7 @@ static void _invertblock(unsigned char *address, unsigned mask, unsigned bits)
|
|||
: /* inputs */
|
||||
/* %0 */ "r"(graybuf->depth),
|
||||
/* %1 */ "r"(address),
|
||||
/* %2 */ "r"(mask & bits),
|
||||
/* %2 */ "r"(bits),
|
||||
/* %3 */ "r"(graybuf->plane_size)
|
||||
: /* clobbers */
|
||||
"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 */
|
||||
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 */
|
||||
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 ****/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue