diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-06-30 18:42:24 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-30 18:42:24 +0000 |
| commit | a142d4d79fe84dd4e75f3cb01d25e4cee945036b (patch) | |
| tree | 376eaba480f295f6fde5976ded9792bd5e6b57a9 /firmware/drivers | |
| parent | 3b90707fdd85a4b21258f6e11f10e15e0f668e3d (diff) | |
| download | rockbox-a142d4d79fe84dd4e75f3cb01d25e4cee945036b.zip rockbox-a142d4d79fe84dd4e75f3cb01d25e4cee945036b.tar.gz rockbox-a142d4d79fe84dd4e75f3cb01d25e4cee945036b.tar.bz2 rockbox-a142d4d79fe84dd4e75f3cb01d25e4cee945036b.tar.xz | |
Graphics: Lowlevel block function are in IRAM now as they're called often. Switched the masking logic for better readability. Draw modes and lowlevel function types are now defined for all platforms.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6952 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 32 | ||||
| -rw-r--r-- | firmware/drivers/lcd-h100.c | 32 | ||||
| -rw-r--r-- | firmware/drivers/lcd-recorder.c | 32 |
3 files changed, 72 insertions, 24 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index bdc5799..8112aec 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -500,41 +500,57 @@ lcd_pixelfunc_type* lcd_remote_pixelfuncs[8] = { }; static void flipblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (bits & mask); } static void bgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bgblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= (bits | ~mask); } static void fgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fgblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (bits & mask); } static void solidblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +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"))); +static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (~bits & mask); } static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +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"))); +static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (~bits & mask); } static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (~bits & mask); } @@ -707,8 +723,8 @@ void lcd_remote_vline(int x, int y1, int y2) dst += LCD_REMOTE_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; - bfunc(dst, mask_bottom, 0xFFu); + mask &= mask_bottom; + bfunc(dst, mask, 0xFFu); } /* Draw a rectangular box */ @@ -782,14 +798,14 @@ void lcd_remote_fillrect(int x, int y, int width, int height) dst += LCD_REMOTE_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (fillopt && (mask_bottom == 0xFFu)) + if (fillopt && (mask == 0xFFu)) memset(dst, bits, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, 0xFFu); + bfunc(dst++, mask, 0xFFu); } } @@ -871,14 +887,14 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, dst += LCD_REMOTE_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (copyopt && (mask_bottom == 0xFFu)) + if (copyopt && (mask == 0xFFu)) memcpy(dst, src, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, *src++); + bfunc(dst++, mask, *src++); } } else diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index 929a4fa..3d858e2 100644 --- a/firmware/drivers/lcd-h100.c +++ b/firmware/drivers/lcd-h100.c @@ -339,41 +339,57 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = { }; static void flipblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (bits & mask); } static void bgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bgblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= (bits | ~mask); } static void fgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fgblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (bits & mask); } static void solidblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +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"))); +static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (~bits & mask); } static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +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"))); +static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (~bits & mask); } static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (~bits & mask); } @@ -544,8 +560,8 @@ void lcd_vline(int x, int y1, int y2) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; - bfunc(dst, mask_bottom, 0xFFu); + mask &= mask_bottom; + bfunc(dst, mask, 0xFFu); } /* Draw a rectangular box */ @@ -619,14 +635,14 @@ void lcd_fillrect(int x, int y, int width, int height) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (fillopt && (mask_bottom == 0xFFu)) + if (fillopt && (mask == 0xFFu)) memset(dst, bits, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, 0xFFu); + bfunc(dst++, mask, 0xFFu); } } @@ -708,14 +724,14 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (copyopt && (mask_bottom == 0xFFu)) + if (copyopt && (mask == 0xFFu)) memcpy(dst, src, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, *src++); + bfunc(dst++, mask, *src++); } } else diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 6747f7f..f933e6c 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c @@ -396,41 +396,57 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = { }; static void flipblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (bits & mask); } static void bgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bgblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= (bits | ~mask); } static void fgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fgblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (bits & mask); } static void solidblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +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"))); +static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (~bits & mask); } static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +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"))); +static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (~bits & mask); } static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (~bits & mask); } @@ -601,8 +617,8 @@ void lcd_vline(int x, int y1, int y2) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; - bfunc(dst, mask_bottom, 0xFFu); + mask &= mask_bottom; + bfunc(dst, mask, 0xFFu); } /* Draw a rectangular box */ @@ -676,14 +692,14 @@ void lcd_fillrect(int x, int y, int width, int height) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (fillopt && (mask_bottom == 0xFFu)) + if (fillopt && (mask == 0xFFu)) memset(dst, bits, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, 0xFFu); + bfunc(dst++, mask, 0xFFu); } } @@ -765,14 +781,14 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (copyopt && (mask_bottom == 0xFFu)) + if (copyopt && (mask == 0xFFu)) memcpy(dst, src, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, *src++); + bfunc(dst++, mask, *src++); } } else |