summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-06-25 00:28:09 +0000
committerJens Arnold <amiconn@rockbox.org>2005-06-25 00:28:09 +0000
commit934941294b27b3e9a9012be1abe86f4e05db2204 (patch)
treeb704b66f0c8936ba78bdc6a69c2126cf0dba3314 /firmware
parent24a1f94cd7cc50fbda6689d33c5d2dbcf123dab5 (diff)
Core functions taking advantage of the new, optimised lcd_hline() and lcd_vline() functions. Some cleanup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6859 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-h100.c9
-rw-r--r--firmware/drivers/lcd-recorder.c9
-rw-r--r--firmware/export/lcd.h4
3 files changed, 8 insertions, 14 deletions
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index db2aba8673..666949ff72 100644
--- a/firmware/drivers/lcd-h100.c
+++ b/firmware/drivers/lcd-h100.c
@@ -332,7 +332,7 @@ static void nopixel(int x, int y)
}
lcd_pixelfunc_type* pixelfunc[8] = {flippixel, nopixel, setpixel, setpixel,
- nopixel, clearpixel, nopixel, clearpixel};
+ nopixel, clearpixel, nopixel, clearpixel};
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{
@@ -361,10 +361,9 @@ lcd_blockfunc_type* blockfunc[4] = {flipblock, bgblock, fgblock, solidblock};
/* Clear the whole display */
void lcd_clear_display(void)
{
- if (drawmode & DRMODE_INVERSEVID)
- memset (lcd_framebuffer, 0xFF, sizeof lcd_framebuffer);
- else
- memset (lcd_framebuffer, 0, sizeof lcd_framebuffer);
+ unsigned bits = (drawmode & DRMODE_INVERSEVID) ? 0xFFu : 0;
+
+ memset(lcd_framebuffer, bits, sizeof lcd_framebuffer);
scrolling_lines = 0;
}
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index a83f58e35d..1255516b51 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -391,7 +391,7 @@ static void nopixel(int x, int y)
}
lcd_pixelfunc_type* pixelfunc[8] = {flippixel, nopixel, setpixel, setpixel,
- nopixel, clearpixel, nopixel, clearpixel};
+ nopixel, clearpixel, nopixel, clearpixel};
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{
@@ -420,10 +420,9 @@ lcd_blockfunc_type* blockfunc[4] = {flipblock, bgblock, fgblock, solidblock};
/* Clear the whole display */
void lcd_clear_display(void)
{
- if (drawmode & DRMODE_INVERSEVID)
- memset (lcd_framebuffer, 0xFF, sizeof lcd_framebuffer);
- else
- memset (lcd_framebuffer, 0, sizeof lcd_framebuffer);
+ unsigned bits = (drawmode & DRMODE_INVERSEVID) ? 0xFFu : 0;
+
+ memset(lcd_framebuffer, bits, sizeof lcd_framebuffer);
scrolling_lines = 0;
}
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index c6e0fe0f0e..3824096aba 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -122,10 +122,6 @@ extern void lcd_jump_scroll_delay(int ms);
#define DRMODE_SOLID 3
#define DRMODE_INVERSEVID 4 /* used as bit modifier for basic modes */
-#define DRAW_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] |= (1<<((y)&7))
-#define CLEAR_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7))
-#define INVERT_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] ^= (1<<((y)&7))
-
typedef void lcd_pixelfunc_type(int x, int y); /* for b&w */
typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits);