summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/gray_scroll.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-02-06 16:04:01 +0000
committerJens Arnold <amiconn@rockbox.org>2006-02-06 16:04:01 +0000
commite6e8aa95197040d5f9e7125819a0a7f047a83f24 (patch)
tree74665c48ddd0f90067101570fd1bed26f9783a04 /apps/plugins/lib/gray_scroll.c
parentd036e97d3816ac2bc0eefc57bc033bd5fbbbf0f9 (diff)
downloadrockbox-e6e8aa95197040d5f9e7125819a0a7f047a83f24.tar.gz
rockbox-e6e8aa95197040d5f9e7125819a0a7f047a83f24.zip
Added memmove() to codec API & plugin API, and changed codeclib and plugin libs to use it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8602 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/gray_scroll.c')
-rw-r--r--apps/plugins/lib/gray_scroll.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/apps/plugins/lib/gray_scroll.c b/apps/plugins/lib/gray_scroll.c
index 341024a67e..89ca2f37c3 100644
--- a/apps/plugins/lib/gray_scroll.c
+++ b/apps/plugins/lib/gray_scroll.c
@@ -29,29 +29,6 @@
29#ifdef HAVE_LCD_BITMAP /* and also not for the Player */ 29#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
30#include "gray.h" 30#include "gray.h"
31 31
32/* FIXME: intermediate solution until we have properly optimised memmove() */
33static void *my_memmove(void *dst0, const void *src0, size_t len0)
34{
35 char *dst = (char *) dst0;
36 char *src = (char *) src0;
37
38 if (dst <= src)
39 {
40 while (len0--)
41 *dst++ = *src++;
42 }
43 else
44 {
45 dst += len0;
46 src += len0;
47
48 while (len0--)
49 *(--dst) = *(--src);
50 }
51
52 return dst0;
53}
54
55/*** Scrolling ***/ 32/*** Scrolling ***/
56 33
57/* Scroll left */ 34/* Scroll left */
@@ -68,7 +45,7 @@ void gray_scroll_left(int count)
68 blank = (_gray_info.drawmode & DRMODE_INVERSEVID) ? 45 blank = (_gray_info.drawmode & DRMODE_INVERSEVID) ?
69 _gray_info.fg_brightness : _gray_info.bg_brightness; 46 _gray_info.fg_brightness : _gray_info.bg_brightness;
70 47
71 my_memmove(_gray_info.cur_buffer, _gray_info.cur_buffer + shift, length); 48 _gray_rb->memmove(_gray_info.cur_buffer, _gray_info.cur_buffer + shift, length);
72 _gray_rb->memset(_gray_info.cur_buffer + length, blank, shift); 49 _gray_rb->memset(_gray_info.cur_buffer + length, blank, shift);
73} 50}
74 51
@@ -86,7 +63,7 @@ void gray_scroll_right(int count)
86 blank = (_gray_info.drawmode & DRMODE_INVERSEVID) ? 63 blank = (_gray_info.drawmode & DRMODE_INVERSEVID) ?
87 _gray_info.fg_brightness : _gray_info.bg_brightness; 64 _gray_info.fg_brightness : _gray_info.bg_brightness;
88 65
89 my_memmove(_gray_info.cur_buffer + shift, _gray_info.cur_buffer, length); 66 _gray_rb->memmove(_gray_info.cur_buffer + shift, _gray_info.cur_buffer, length);
90 _gray_rb->memset(_gray_info.cur_buffer, blank, shift); 67 _gray_rb->memset(_gray_info.cur_buffer, blank, shift);
91} 68}
92 69
@@ -107,7 +84,7 @@ void gray_scroll_up(int count)
107 84
108 do 85 do
109 { 86 {
110 my_memmove(data, data + count, length); 87 _gray_rb->memmove(data, data + count, length);
111 _gray_rb->memset(data + length, blank, count); 88 _gray_rb->memset(data + length, blank, count);
112 data += _gray_info.height; 89 data += _gray_info.height;
113 } 90 }
@@ -131,7 +108,7 @@ void gray_scroll_down(int count)
131 108
132 do 109 do
133 { 110 {
134 my_memmove(data + count, data, length); 111 _gray_rb->memmove(data + count, data, length);
135 _gray_rb->memset(data, blank, count); 112 _gray_rb->memset(data, blank, count);
136 data += _gray_info.height; 113 data += _gray_info.height;
137 } 114 }
@@ -161,7 +138,7 @@ void gray_ub_scroll_left(int count)
161 + MULU16(_gray_info.plane_size, _gray_info.depth); 138 + MULU16(_gray_info.plane_size, _gray_info.depth);
162 do 139 do
163 { 140 {
164 my_memmove(ptr_row, ptr_row + count, length); 141 _gray_rb->memmove(ptr_row, ptr_row + count, length);
165 _gray_rb->memset(ptr_row + length, 0, count); 142 _gray_rb->memset(ptr_row + length, 0, count);
166 ptr_row += _gray_info.plane_size; 143 ptr_row += _gray_info.plane_size;
167 } 144 }
@@ -193,7 +170,7 @@ void gray_ub_scroll_right(int count)
193 + MULU16(_gray_info.plane_size, _gray_info.depth); 170 + MULU16(_gray_info.plane_size, _gray_info.depth);
194 do 171 do
195 { 172 {
196 my_memmove(ptr_row + count, ptr_row, length); 173 _gray_rb->memmove(ptr_row + count, ptr_row, length);
197 _gray_rb->memset(ptr_row, 0, count); 174 _gray_rb->memset(ptr_row, 0, count);
198 ptr_row += _gray_info.plane_size; 175 ptr_row += _gray_info.plane_size;
199 } 176 }