summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/xlcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/xlcd.c')
-rw-r--r--apps/plugins/lib/xlcd.c38
1 files changed, 8 insertions, 30 deletions
diff --git a/apps/plugins/lib/xlcd.c b/apps/plugins/lib/xlcd.c
index 33d807f2f3..a842cf5eb7 100644
--- a/apps/plugins/lib/xlcd.c
+++ b/apps/plugins/lib/xlcd.c
@@ -106,28 +106,6 @@ void xlcd_filltriangle(int x1, int y1, int x2, int y2, int x3, int y3)
106} 106}
107 107
108#if LCD_DEPTH >= 8 108#if LCD_DEPTH >= 8
109/* FIXME: intermediate solution until we have properly optimised memmove() */
110static void *my_memmove(void *dst0, const void *src0, size_t len0)
111{
112 char *dst = (char *) dst0;
113 char *src = (char *) src0;
114
115 if (dst <= src)
116 {
117 while (len0--)
118 *dst++ = *src++;
119 }
120 else
121 {
122 dst += len0;
123 src += len0;
124
125 while (len0--)
126 *(--dst) = *(--src);
127 }
128
129 return dst0;
130}
131 109
132void xlcd_scroll_left(int count) 110void xlcd_scroll_left(int count)
133{ 111{
@@ -143,7 +121,7 @@ void xlcd_scroll_left(int count)
143 121
144 do 122 do
145 { 123 {
146 my_memmove(data, data + count, length * sizeof(fb_data)); 124 local_rb->memmove(data, data + count, length * sizeof(fb_data));
147 data += LCD_WIDTH; 125 data += LCD_WIDTH;
148 } 126 }
149 while (data < data_end); 127 while (data < data_end);
@@ -168,7 +146,7 @@ void xlcd_scroll_right(int count)
168 146
169 do 147 do
170 { 148 {
171 my_memmove(data + count, data, length * sizeof(fb_data)); 149 local_rb->memmove(data + count, data, length * sizeof(fb_data));
172 data += LCD_WIDTH; 150 data += LCD_WIDTH;
173 } 151 }
174 while (data < data_end); 152 while (data < data_end);
@@ -188,9 +166,9 @@ void xlcd_scroll_up(int count)
188 166
189 length = LCD_HEIGHT - count; 167 length = LCD_HEIGHT - count;
190 168
191 my_memmove(local_rb->lcd_framebuffer, 169 local_rb->memmove(local_rb->lcd_framebuffer,
192 local_rb->lcd_framebuffer + count * LCD_WIDTH, 170 local_rb->lcd_framebuffer + count * LCD_WIDTH,
193 length * LCD_WIDTH * sizeof(fb_data)); 171 length * LCD_WIDTH * sizeof(fb_data));
194 172
195 oldmode = local_rb->lcd_get_drawmode(); 173 oldmode = local_rb->lcd_get_drawmode();
196 local_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 174 local_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
@@ -207,9 +185,9 @@ void xlcd_scroll_down(int count)
207 185
208 length = LCD_HEIGHT - count; 186 length = LCD_HEIGHT - count;
209 187
210 my_memmove(local_rb->lcd_framebuffer + count * LCD_WIDTH, 188 local_rb->memmove(local_rb->lcd_framebuffer + count * LCD_WIDTH,
211 local_rb->lcd_framebuffer, 189 local_rb->lcd_framebuffer,
212 length * LCD_WIDTH * sizeof(fb_data)); 190 length * LCD_WIDTH * sizeof(fb_data));
213 191
214 oldmode = local_rb->lcd_get_drawmode(); 192 oldmode = local_rb->lcd_get_drawmode();
215 local_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 193 local_rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);