summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-04 06:20:50 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-04 06:20:50 +0000
commitf89f011508c80985b4dfee4fcc296689c149b30f (patch)
tree4c09a16f8420504adb7195456052d51bb081b80d
parentc0e6ed6b66f31bb44c2f38afb85453a8389d4c34 (diff)
downloadrockbox-f89f011508c80985b4dfee4fcc296689c149b30f.zip
rockbox-f89f011508c80985b4dfee4fcc296689c149b30f.tar.gz
rockbox-f89f011508c80985b4dfee4fcc296689c149b30f.tar.bz2
rockbox-f89f011508c80985b4dfee4fcc296689c149b30f.tar.xz
Converted to use the IRAM defines, and some small optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7007 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/lcd-h100-remote.c42
-rw-r--r--firmware/drivers/lcd-recorder.c38
2 files changed, 40 insertions, 40 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 8fa193a..b68890a 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -68,7 +68,7 @@
unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]
IDATA_ATTR;
-
+
static int drawmode = DRMODE_SOLID;
static int xmargin = 0;
static int ymargin = 0;
@@ -380,7 +380,7 @@ void lcd_remote_init(void)
/* Update the display.
This must be called after all other LCD functions that change the display. */
-void lcd_remote_update(void) __attribute__ ((section (".icode")));
+void lcd_remote_update(void) ICODE_ATTR;
void lcd_remote_update(void)
{
int y;
@@ -399,7 +399,7 @@ void lcd_remote_update(void)
}
/* Update a fraction of the display. */
-void lcd_remote_update_rect(int, int, int, int) __attribute__ ((section (".icode")));
+void lcd_remote_update_rect(int, int, int, int) ICODE_ATTR;
void lcd_remote_update_rect(int x, int y, int width, int height)
{
int ymax;
@@ -497,56 +497,56 @@ lcd_pixelfunc_type* lcd_remote_pixelfuncs[8] = {
};
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address ^= (bits & mask);
+ *address ^= bits & mask;
}
static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address &= (bits | ~mask);
+ *address &= bits | ~mask;
}
static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address |= (bits & mask);
+ *address |= bits & mask;
}
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (bits & mask);
}
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address ^= (~bits & mask);
+ *address ^= ~bits & mask;
}
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address &= ~(bits & mask);
}
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address |= (~bits & mask);
+ *address |= ~bits & mask;
}
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (~bits & mask);
@@ -714,7 +714,7 @@ void lcd_remote_vline(int x, int y1, int y2)
dst = &lcd_remote_framebuffer[y1>>3][x];
ny = y2 - (y1 & ~7);
mask = 0xFFu << (y1 & 7);
- mask_bottom = 0xFFu >> (7 - (ny & 7));
+ mask_bottom = 0xFFu >> (~ny & 7);
for (; ny >= 8; ny -= 8)
{
@@ -780,7 +780,7 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
dst = &lcd_remote_framebuffer[y>>3][x];
ny = height - 1 + (y & 7);
mask = 0xFFu << (y & 7);
- mask_bottom = 0xFFu >> (7 - (ny & 7));
+ mask_bottom = 0xFFu >> (~ny & 7);
for (; ny >= 8; ny -= 8)
{
@@ -826,7 +826,7 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
/* Draw a partial bitmap */
void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height)
{
@@ -867,8 +867,8 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
bfunc = lcd_remote_blockfuncs[drawmode];
mask = 0xFFu << (shift + src_y);
- mask_bottom = 0xFFu >> (7 - (ny & 7));
-
+ mask_bottom = 0xFFu >> (~ny & 7);
+
if (shift == 0)
{
bool copyopt = (drawmode == DRMODE_SOLID);
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index b857708..b0308c6 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -284,7 +284,7 @@ void lcd_blit(const unsigned char* data, int x, int by, int width,
/* Update the display.
This must be called after all other LCD functions that change the display. */
-void lcd_update(void) __attribute__ ((section (".icode")));
+void lcd_update(void) ICODE_ATTR;
void lcd_update(void)
{
int y;
@@ -301,7 +301,7 @@ void lcd_update(void)
}
/* Update a fraction of the display. */
-void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode")));
+void lcd_update_rect(int, int, int, int) ICODE_ATTR;
void lcd_update_rect(int x, int y, int width, int height)
{
int ymax;
@@ -396,56 +396,56 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = {
};
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address ^= (bits & mask);
+ *address ^= bits & mask;
}
static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address &= (bits | ~mask);
+ *address &= bits | ~mask;
}
static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address |= (bits & mask);
+ *address |= bits & mask;
}
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (bits & mask);
}
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address ^= (~bits & mask);
+ *address ^= ~bits & mask;
}
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address &= ~(bits & mask);
}
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
- *address |= (~bits & mask);
+ *address |= ~bits & mask;
}
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (~bits & mask);
@@ -611,7 +611,7 @@ void lcd_vline(int x, int y1, int y2)
dst = &lcd_framebuffer[y1>>3][x];
ny = y2 - (y1 & ~7);
mask = 0xFFu << (y1 & 7);
- mask_bottom = 0xFFu >> (7 - (ny & 7));
+ mask_bottom = 0xFFu >> (~ny & 7);
for (; ny >= 8; ny -= 8)
{
@@ -677,7 +677,7 @@ void lcd_fillrect(int x, int y, int width, int height)
dst = &lcd_framebuffer[y>>3][x];
ny = height - 1 + (y & 7);
mask = 0xFFu << (y & 7);
- mask_bottom = 0xFFu >> (7 - (ny & 7));
+ mask_bottom = 0xFFu >> (~ny & 7);
for (; ny >= 8; ny -= 8)
{
@@ -723,7 +723,7 @@ void lcd_fillrect(int x, int y, int width, int height)
/* Draw a partial bitmap */
void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height)
- __attribute__ ((section(".icode")));
+ ICODE_ATTR;
void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height)
{
@@ -764,7 +764,7 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
bfunc = lcd_blockfuncs[drawmode];
mask = 0xFFu << (shift + src_y);
- mask_bottom = 0xFFu >> (7 - (ny & 7));
+ mask_bottom = 0xFFu >> (~ny & 7);
if (shift == 0)
{