summaryrefslogtreecommitdiff
path: root/firmware/target/arm/gigabeat/meg-fx
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/gigabeat/meg-fx')
-rw-r--r--firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c
index 4a24e27abe..9a3d483e1a 100644
--- a/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c
+++ b/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c
@@ -293,94 +293,6 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
293 : : "r" (src), "r" (dst), "r" (width), "r" (dst_end), "r" (stride), "r" (transcolor) : "r0", "r1" ); 293 : : "r" (src), "r" (dst), "r" (width), "r" (dst_end), "r" (stride), "r" (transcolor) : "r0", "r1" );
294} 294}
295 295
296void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
297 int stride, int x, int y, int width, int height)
298 ICODE_ATTR;
299void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
300 int stride, int x, int y, int width, int height)
301{
302 const unsigned char *src_end;
303 fb_data *dst, *dst_end;
304
305 /* nothing to draw? */
306 if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
307 || (x + width <= 0) || (y + height <= 0))
308 return;
309
310 /* clipping */
311 if (x < 0)
312 {
313 width += x;
314 src_x -= x;
315 x = 0;
316 }
317 if (y < 0)
318 {
319 height += y;
320 src_y -= y;
321 y = 0;
322 }
323 if (x + width > LCD_WIDTH)
324 width = LCD_WIDTH - x;
325 if (y + height > LCD_HEIGHT)
326 height = LCD_HEIGHT - y;
327
328 src += stride * (src_y >> 3) + src_x; /* move starting point */
329 src_y &= 7;
330 src_end = src + width;
331
332 dst = LCDADDR(x, y);
333 int drawmode = lcd_get_drawmode();
334 fb_data *backdrop = lcd_get_backdrop();
335 bool has_backdrop = backdrop ? true : false;
336 backdrop = backdrop + y * LCD_WIDTH + x;
337 lcd_fastpixelfunc_type *fgfunc = lcd_fastpixelfuncs[drawmode];;
338 lcd_fastpixelfunc_type *bgfunc = lcd_fastpixelfuncs[drawmode ^ DRMODE_INVERSEVID];;
339 do {
340 const unsigned char *src_col = src++;
341 unsigned data = *src_col >> src_y;
342 fb_data *dst_col = dst++;
343 int numbits = 8 - src_y;
344 fb_data *backdrop_col = backdrop++;
345 dst_end = dst_col + height * LCD_WIDTH;
346 do {
347 switch(drawmode) {
348 case DRMODE_SOLID:
349 if (data & 0x01)
350 *dst_col = fg_pattern;
351 else
352 *dst_col = has_backdrop ? *backdrop_col : bg_pattern;
353 break;
354 case DRMODE_FG:
355 if (data & 0x01)
356 *dst_col = fg_pattern;
357 break;
358 case (DRMODE_SOLID|DRMODE_INVERSEVID):
359 if(data & 0x01)
360 *dst_col = has_backdrop ? *backdrop_col : bg_pattern;
361 else
362 *dst_col = fg_pattern;
363 break;
364 default:
365 if (data & 0x01)
366 fgfunc(dst_col);
367 else
368 bgfunc(dst_col);
369 break;
370 };
371 dst_col += LCD_WIDTH;
372 backdrop_col += LCD_WIDTH;
373 data >>= 1;
374 if (--numbits == 0) {
375 src_col += stride;
376 data = *src_col;
377 numbits = 8;
378 }
379 } while (dst_col < dst_end);
380 } while (src < src_end);
381}
382
383
384#define CSUB_X 2 296#define CSUB_X 2
385#define CSUB_Y 2 297#define CSUB_Y 2
386 298