summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey_scroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/grey_scroll.c')
-rw-r--r--apps/plugins/lib/grey_scroll.c80
1 files changed, 32 insertions, 48 deletions
diff --git a/apps/plugins/lib/grey_scroll.c b/apps/plugins/lib/grey_scroll.c
index 5040dd4c74..12a27daf23 100644
--- a/apps/plugins/lib/grey_scroll.c
+++ b/apps/plugins/lib/grey_scroll.c
@@ -41,7 +41,7 @@ void grey_scroll_left(int count)
41 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); 41 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
42 length = _grey_info.width - count; 42 length = _grey_info.width - count;
43 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 43 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
44 _grey_info.fg_val : _grey_info.bg_val; 44 _grey_info.fg_brightness : _grey_info.bg_brightness;
45 45
46 do 46 do
47 { 47 {
@@ -66,7 +66,7 @@ void grey_scroll_right(int count)
66 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); 66 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
67 length = _grey_info.width - count; 67 length = _grey_info.width - count;
68 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 68 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
69 _grey_info.fg_val : _grey_info.bg_val; 69 _grey_info.fg_brightness : _grey_info.bg_brightness;
70 70
71 do 71 do
72 { 72 {
@@ -89,7 +89,7 @@ void grey_scroll_up(int count)
89 shift = _GREY_MULUQ(_grey_info.width, count); 89 shift = _GREY_MULUQ(_grey_info.width, count);
90 length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count); 90 length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
91 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 91 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
92 _grey_info.fg_val : _grey_info.bg_val; 92 _grey_info.fg_brightness : _grey_info.bg_brightness;
93 93
94 _grey_info.rb->memmove(_grey_info.buffer, _grey_info.buffer + shift, 94 _grey_info.rb->memmove(_grey_info.buffer, _grey_info.buffer + shift,
95 length); 95 length);
@@ -108,7 +108,7 @@ void grey_scroll_down(int count)
108 shift = _GREY_MULUQ(_grey_info.width, count); 108 shift = _GREY_MULUQ(_grey_info.width, count);
109 length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count); 109 length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
110 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 110 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
111 _grey_info.fg_val : _grey_info.bg_val; 111 _grey_info.fg_brightness : _grey_info.bg_brightness;
112 112
113 _grey_info.rb->memmove(_grey_info.buffer + shift, _grey_info.buffer, 113 _grey_info.rb->memmove(_grey_info.buffer + shift, _grey_info.buffer,
114 length); 114 length);
@@ -117,38 +117,6 @@ void grey_scroll_down(int count)
117 117
118/*** Unbuffered scrolling functions ***/ 118/*** Unbuffered scrolling functions ***/
119 119
120#ifdef SIMULATOR
121
122/* Scroll left */
123void grey_ub_scroll_left(int count)
124{
125 grey_scroll_left(count);
126 grey_update();
127}
128
129/* Scroll right */
130void grey_ub_scroll_right(int count)
131{
132 grey_scroll_right(count);
133 grey_update();
134}
135
136/* Scroll up */
137void grey_ub_scroll_up(int count)
138{
139 grey_scroll_up(count);
140 grey_update();
141}
142
143/* Scroll down */
144void grey_ub_scroll_down(int count)
145{
146 grey_scroll_down(count);
147 grey_update();
148}
149
150#else /* !SIMULATOR */
151
152/* Scroll left */ 120/* Scroll left */
153void grey_ub_scroll_left(int count) 121void grey_ub_scroll_left(int count)
154{ 122{
@@ -162,9 +130,9 @@ void grey_ub_scroll_left(int count)
162 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); 130 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
163 length = (_grey_info.width - count) << _GREY_BSHIFT; 131 length = (_grey_info.width - count) << _GREY_BSHIFT;
164 count <<= _GREY_BSHIFT; 132 count <<= _GREY_BSHIFT;
165 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 133 blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
166 _grey_info.fg_val : _grey_info.bg_val; 134 _grey_info.fg_brightness :
167 135 _grey_info.bg_brightness];
168 do 136 do
169 { 137 {
170 _grey_info.rb->memmove(data, data + count, length); 138 _grey_info.rb->memmove(data, data + count, length);
@@ -173,6 +141,10 @@ void grey_ub_scroll_left(int count)
173 data += count; 141 data += count;
174 } 142 }
175 while (data < data_end); 143 while (data < data_end);
144#ifdef SIMULATOR
145 _grey_info.rb->sim_lcd_ex_update_rect(_grey_info.x, _grey_info.y,
146 _grey_info.width, _grey_info.height);
147#endif
176} 148}
177 149
178/* Scroll right */ 150/* Scroll right */
@@ -188,9 +160,9 @@ void grey_ub_scroll_right(int count)
188 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); 160 data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
189 length = (_grey_info.width - count) << _GREY_BSHIFT; 161 length = (_grey_info.width - count) << _GREY_BSHIFT;
190 count <<= _GREY_BSHIFT; 162 count <<= _GREY_BSHIFT;
191 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 163 blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
192 _grey_info.fg_val : _grey_info.bg_val; 164 _grey_info.fg_brightness :
193 165 _grey_info.bg_brightness];
194 do 166 do
195 { 167 {
196 _grey_info.rb->memmove(data + count, data, length); 168 _grey_info.rb->memmove(data + count, data, length);
@@ -198,6 +170,10 @@ void grey_ub_scroll_right(int count)
198 data += _grey_info.width << _GREY_BSHIFT; 170 data += _grey_info.width << _GREY_BSHIFT;
199 } 171 }
200 while (data < data_end); 172 while (data < data_end);
173#ifdef SIMULATOR
174 _grey_info.rb->sim_lcd_ex_update_rect(_grey_info.x, _grey_info.y,
175 _grey_info.width, _grey_info.height);
176#endif
201} 177}
202 178
203/* Scroll up */ 179/* Scroll up */
@@ -211,8 +187,9 @@ void grey_ub_scroll_up(int count)
211 187
212 dst = _grey_info.values; 188 dst = _grey_info.values;
213 end = dst + _GREY_MULUQ(_grey_info.height, _grey_info.width); 189 end = dst + _GREY_MULUQ(_grey_info.height, _grey_info.width);
214 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 190 blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
215 _grey_info.fg_val : _grey_info.bg_val; 191 _grey_info.fg_brightness :
192 _grey_info.bg_brightness];
216 193
217#if LCD_PIXELFORMAT == VERTICAL_PACKING 194#if LCD_PIXELFORMAT == VERTICAL_PACKING
218 if (count & _GREY_BMASK) 195 if (count & _GREY_BMASK)
@@ -264,6 +241,10 @@ void grey_ub_scroll_up(int count)
264 dst += blen; 241 dst += blen;
265 } 242 }
266 _grey_info.rb->memset(dst, blank, end - dst); /* Fill remainder at once. */ 243 _grey_info.rb->memset(dst, blank, end - dst); /* Fill remainder at once. */
244#ifdef SIMULATOR
245 _grey_info.rb->sim_lcd_ex_update_rect(_grey_info.x, _grey_info.y,
246 _grey_info.width, _grey_info.height);
247#endif
267} 248}
268 249
269/* Scroll down */ 250/* Scroll down */
@@ -277,8 +258,9 @@ void grey_ub_scroll_down(int count)
277 258
278 start = _grey_info.values; 259 start = _grey_info.values;
279 dst = start + _GREY_MULUQ(_grey_info.height, _grey_info.width); 260 dst = start + _GREY_MULUQ(_grey_info.height, _grey_info.width);
280 blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ? 261 blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
281 _grey_info.fg_val : _grey_info.bg_val; 262 _grey_info.fg_brightness :
263 _grey_info.bg_brightness];
282 264
283#if LCD_PIXELFORMAT == VERTICAL_PACKING 265#if LCD_PIXELFORMAT == VERTICAL_PACKING
284 if (count & _GREY_BMASK) 266 if (count & _GREY_BMASK)
@@ -331,6 +313,8 @@ void grey_ub_scroll_down(int count)
331 } 313 }
332 _grey_info.rb->memset(start, blank, dst - start); 314 _grey_info.rb->memset(start, blank, dst - start);
333 /* Fill remainder at once. */ 315 /* Fill remainder at once. */
316#ifdef SIMULATOR
317 _grey_info.rb->sim_lcd_ex_update_rect(_grey_info.x, _grey_info.y,
318 _grey_info.width, _grey_info.height);
319#endif
334} 320}
335
336#endif /* !SIMULATOR */