diff options
author | Jens Arnold <amiconn@rockbox.org> | 2009-06-07 21:27:05 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2009-06-07 21:27:05 +0000 |
commit | 1d6df54df27cb41c02226678a2c8f9feddd1a1e0 (patch) | |
tree | 5fdc6dd98ac0208f5c3351b062063af6914cbefb /firmware/drivers/lcd-1bit-vert.c | |
parent | c3182ec333982e961d3babfbdb1125fd5bac7fb8 (diff) | |
download | rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.tar.gz rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.zip |
Convert a number of places in core and plugins to use the BIT_N() macro instead of 1<<n. Speeds up things on SH1, and also reduces core binsize. Most notable speedups: 1 bit lcd driver: drawpixel +20%, drawline + 27%, hline +5%; jpeg viewer: +8% for 1/8 scaling. Other targets are unaffected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21205 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-1bit-vert.c')
-rw-r--r-- | firmware/drivers/lcd-1bit-vert.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c index b09ce0e76d..5fb652431c 100644 --- a/firmware/drivers/lcd-1bit-vert.c +++ b/firmware/drivers/lcd-1bit-vert.c | |||
@@ -155,17 +155,17 @@ int LCDFN(getstringsize)(const unsigned char *str, int *w, int *h) | |||
155 | 155 | ||
156 | static void setpixel(int x, int y) | 156 | static void setpixel(int x, int y) |
157 | { | 157 | { |
158 | LCDFN(framebuffer)[y>>3][x] |= 1 << (y & 7); | 158 | LCDFN(framebuffer)[y>>3][x] |= BIT_N(y & 7); |
159 | } | 159 | } |
160 | 160 | ||
161 | static void clearpixel(int x, int y) | 161 | static void clearpixel(int x, int y) |
162 | { | 162 | { |
163 | LCDFN(framebuffer)[y>>3][x] &= ~(1 << (y & 7)); | 163 | LCDFN(framebuffer)[y>>3][x] &= ~BIT_N(y & 7); |
164 | } | 164 | } |
165 | 165 | ||
166 | static void flippixel(int x, int y) | 166 | static void flippixel(int x, int y) |
167 | { | 167 | { |
168 | LCDFN(framebuffer)[y>>3][x] ^= 1 << (y & 7); | 168 | LCDFN(framebuffer)[y>>3][x] ^= BIT_N(y & 7); |
169 | } | 169 | } |
170 | 170 | ||
171 | static void nopixel(int x, int y) | 171 | static void nopixel(int x, int y) |
@@ -401,7 +401,7 @@ void LCDFN(hline)(int x1, int x2, int y) | |||
401 | 401 | ||
402 | bfunc = LCDFN(blockfuncs)[current_vp->drawmode]; | 402 | bfunc = LCDFN(blockfuncs)[current_vp->drawmode]; |
403 | dst = &LCDFN(framebuffer)[y>>3][x1]; | 403 | dst = &LCDFN(framebuffer)[y>>3][x1]; |
404 | mask = 1 << (y & 7); | 404 | mask = BIT_N(y & 7); |
405 | 405 | ||
406 | dst_end = dst + width; | 406 | dst_end = dst + width; |
407 | do | 407 | do |