diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-28 22:49:22 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-28 22:49:22 +0000 |
commit | bd2f678b7037a3cf14819082e1d9b948cbc099cd (patch) | |
tree | 4973ab1e0e2e9f75fc5b4e328cd2c2aa407442a8 | |
parent | b770d53cb41370acf6e36486877f1fb9931c97ef (diff) | |
download | rockbox-bd2f678b7037a3cf14819082e1d9b948cbc099cd.tar.gz rockbox-bd2f678b7037a3cf14819082e1d9b948cbc099cd.zip |
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
-rw-r--r-- | docs/CREDITS | 1 | ||||
-rw-r--r-- | firmware/drivers/lcd-h300.c | 31 |
2 files changed, 31 insertions, 1 deletions
diff --git a/docs/CREDITS b/docs/CREDITS index 2bd8b2616b..e18ae81bd9 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -151,3 +151,4 @@ Jeong Taek In | |||
151 | Anders Kagerin | 151 | Anders Kagerin |
152 | Peter D'Hoye | 152 | Peter D'Hoye |
153 | Ben Basha | 153 | Ben Basha |
154 | Brandon Low | ||
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) | |||
93 | inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; | 93 | inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; |
94 | inline void lcd_write_data(const unsigned short* p_bytes, int count) | 94 | inline void lcd_write_data(const unsigned short* p_bytes, int count) |
95 | { | 95 | { |
96 | while(count--) | 96 | int precount = ((-(size_t)p_bytes) & 0xf) / 2; |
97 | count -= precount; | ||
98 | while(precount--) | ||
97 | *(volatile unsigned short *)0xf0000002 = *p_bytes++; | 99 | *(volatile unsigned short *)0xf0000002 = *p_bytes++; |
100 | while((count -= 8) >= 0) asm ( | ||
101 | "\n\tmovem.l (%[p_bytes]),%%d1-%%d4\ | ||
102 | \n\tswap %%d1\ | ||
103 | \n\tmove.w %%d1,(%[dest])\ | ||
104 | \n\tswap %%d1\ | ||
105 | \n\tmove.w %%d1,(%[dest])\ | ||
106 | \n\tswap %%d2\ | ||
107 | \n\tmove.w %%d2,(%[dest])\ | ||
108 | \n\tswap %%d2\ | ||
109 | \n\tmove.w %%d2,(%[dest])\ | ||
110 | \n\tswap %%d3\ | ||
111 | \n\tmove.w %%d3,(%[dest])\ | ||
112 | \n\tswap %%d3\ | ||
113 | \n\tmove.w %%d3,(%[dest])\ | ||
114 | \n\tswap %%d4\ | ||
115 | \n\tmove.w %%d4,(%[dest])\ | ||
116 | \n\tswap %%d4\ | ||
117 | \n\tmove.w %%d4,(%[dest])\ | ||
118 | \n\tlea.l (16,%[p_bytes]),%[p_bytes]" | ||
119 | : [p_bytes] "+a" (p_bytes) | ||
120 | : [dest] "a" ((volatile unsigned short *)0xf0000002) | ||
121 | : "d1", "d2", "d3", "d4", "memory"); | ||
122 | if (count != 0) { | ||
123 | count += 8; | ||
124 | while(count--) | ||
125 | *(volatile unsigned short *)0xf0000002 = *p_bytes++; | ||
126 | } | ||
98 | } | 127 | } |
99 | 128 | ||
100 | /*** hardware configuration ***/ | 129 | /*** hardware configuration ***/ |