diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-07-18 00:04:43 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-07-18 00:04:43 +0000 |
commit | 393f31cc43cd9dff55a92e615ca52209b79944ac (patch) | |
tree | edd0f00c5051a30dcc0afe92f6ec2cceeab0c7fd /firmware/drivers/lcd-recorder.c | |
parent | ed00b173059ae76f6a610bd834ace6d59a5c3a1f (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 'firmware/drivers/lcd-recorder.c')
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index d75b989dd2..22bfebe289 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c @@ -441,7 +441,10 @@ static void solidblock(unsigned char *address, unsigned mask, unsigned bits) ICODE_ATTR; 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) @@ -469,7 +472,10 @@ static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) ICODE_ATTR; 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* const lcd_blockfuncs[8] = { |