summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-07-18 00:04:43 +0000
committerJens Arnold <amiconn@rockbox.org>2006-07-18 00:04:43 +0000
commit393f31cc43cd9dff55a92e615ca52209b79944ac (patch)
treeedd0f00c5051a30dcc0afe92f6ec2cceeab0c7fd /apps/plugins/lib
parented00b173059ae76f6a610bd834ace6d59a5c3a1f (diff)
1bit and 2bit LCD drivers: Low-level bit handling optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10225 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/playergfx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c
index d7e1ce26e8..b6e7ccfc64 100644
--- a/apps/plugins/lib/playergfx.c
+++ b/apps/plugins/lib/playergfx.c
@@ -152,7 +152,10 @@ static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address = (*address & ~mask) | (bits & mask);
+ unsigned data = *(char *)address;
+
+ bits ^= data;
+ *address = data ^ (bits & mask);
}
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
@@ -172,7 +175,10 @@ static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address = (*address & ~mask) | (~bits & mask);
+ unsigned data = *(char *)address;
+
+ bits = ~bits ^ data;
+ *address = data ^ (bits & mask);
}
lcd_blockfunc_type* pgfx_blockfuncs[8] = {