summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-12-28 22:49:22 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-12-28 22:49:22 +0000
commitbd2f678b7037a3cf14819082e1d9b948cbc099cd (patch)
tree4973ab1e0e2e9f75fc5b4e328cd2c2aa407442a8 /firmware
parentb770d53cb41370acf6e36486877f1fb9931c97ef (diff)
Patch #1392287 by Brandon Low - faster LCD update for H300 with ASM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8293 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-h300.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/firmware/drivers/lcd-h300.c b/firmware/drivers/lcd-h300.c
index bb2f9ec777..384490a29f 100644
--- a/firmware/drivers/lcd-h300.c
+++ b/firmware/drivers/lcd-h300.c
@@ -93,8 +93,37 @@ inline void lcd_begin_write_gram(void)
inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR;
inline void lcd_write_data(const unsigned short* p_bytes, int count)
{
- while(count--)
+ int precount = ((-(size_t)p_bytes) & 0xf) / 2;
+ count -= precount;
+ while(precount--)
*(volatile unsigned short *)0xf0000002 = *p_bytes++;
+ while((count -= 8) >= 0) asm (
+ "\n\tmovem.l (%[p_bytes]),%%d1-%%d4\
+ \n\tswap %%d1\
+ \n\tmove.w %%d1,(%[dest])\
+ \n\tswap %%d1\
+ \n\tmove.w %%d1,(%[dest])\
+ \n\tswap %%d2\
+ \n\tmove.w %%d2,(%[dest])\
+ \n\tswap %%d2\
+ \n\tmove.w %%d2,(%[dest])\
+ \n\tswap %%d3\
+ \n\tmove.w %%d3,(%[dest])\
+ \n\tswap %%d3\
+ \n\tmove.w %%d3,(%[dest])\
+ \n\tswap %%d4\
+ \n\tmove.w %%d4,(%[dest])\
+ \n\tswap %%d4\
+ \n\tmove.w %%d4,(%[dest])\
+ \n\tlea.l (16,%[p_bytes]),%[p_bytes]"
+ : [p_bytes] "+a" (p_bytes)
+ : [dest] "a" ((volatile unsigned short *)0xf0000002)
+ : "d1", "d2", "d3", "d4", "memory");
+ if (count != 0) {
+ count += 8;
+ while(count--)
+ *(volatile unsigned short *)0xf0000002 = *p_bytes++;
+ }
}
/*** hardware configuration ***/