diff options
Diffstat (limited to 'firmware/drivers/lcd-h300.c')
-rw-r--r-- | firmware/drivers/lcd-h300.c | 31 |
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) | |||
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 ***/ |