diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 18 | ||||
-rw-r--r-- | firmware/export/scroll_engine.h | 3 |
2 files changed, 19 insertions, 2 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 586c74578f..24c5aa15cb 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c | |||
@@ -39,6 +39,9 @@ | |||
39 | #define MAIN_LCD | 39 | #define MAIN_LCD |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #define HAS_BACKDROP ((defined(MAIN_LCD) && LCD_DEPTH > 1) \ | ||
43 | || (!defined(MAIN_LCD) && LCD_REMOTE_DEPTH > 1)) | ||
44 | |||
42 | #if defined(MAIN_LCD) && defined(HAVE_LCD_COLOR) | 45 | #if defined(MAIN_LCD) && defined(HAVE_LCD_COLOR) |
43 | /* Fill a rectangle with a gradient */ | 46 | /* Fill a rectangle with a gradient */ |
44 | static void lcd_gradient_rect(int x1, int x2, int y, unsigned h, | 47 | static void lcd_gradient_rect(int x1, int x2, int y, unsigned h, |
@@ -370,7 +373,10 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string, | |||
370 | s->len = utf8length(string); | 373 | s->len = utf8length(string); |
371 | s->offset = offset; | 374 | s->offset = offset; |
372 | s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL); | 375 | s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL); |
373 | s->backward = false; | 376 | s->backward = false; |
377 | #if HAS_BACKDROP | ||
378 | s->backdrop = (char*)LCDFN(get_backdrop()); | ||
379 | #endif | ||
374 | 380 | ||
375 | LCDFN(scroll_info).lines++; | 381 | LCDFN(scroll_info).lines++; |
376 | } | 382 | } |
@@ -399,6 +405,9 @@ void LCDFN(scroll_fn)(void) | |||
399 | int index; | 405 | int index; |
400 | int xpos, ypos; | 406 | int xpos, ypos; |
401 | struct viewport* old_vp = current_vp; | 407 | struct viewport* old_vp = current_vp; |
408 | #if HAS_BACKDROP | ||
409 | FBFN(data*) old_backdrop = LCDFN(get_backdrop)(); | ||
410 | #endif | ||
402 | 411 | ||
403 | for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) { | 412 | for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) { |
404 | s = &LCDFN(scroll_info).scroll[index]; | 413 | s = &LCDFN(scroll_info).scroll[index]; |
@@ -408,7 +417,9 @@ void LCDFN(scroll_fn)(void) | |||
408 | continue; | 417 | continue; |
409 | 418 | ||
410 | LCDFN(set_viewport)(s->vp); | 419 | LCDFN(set_viewport)(s->vp); |
411 | 420 | #if HAS_BACKDROP | |
421 | LCDFN(set_backdrop)((FBFN(data*))s->backdrop); | ||
422 | #endif | ||
412 | if (s->backward) | 423 | if (s->backward) |
413 | s->offset -= LCDFN(scroll_info).step; | 424 | s->offset -= LCDFN(scroll_info).step; |
414 | else | 425 | else |
@@ -442,5 +453,8 @@ void LCDFN(scroll_fn)(void) | |||
442 | LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos, | 453 | LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos, |
443 | pf->height); | 454 | pf->height); |
444 | } | 455 | } |
456 | #if HAS_BACKDROP | ||
457 | LCDFN(set_backdrop)(old_backdrop); | ||
458 | #endif | ||
445 | LCDFN(set_viewport)(old_vp); | 459 | LCDFN(set_viewport)(old_vp); |
446 | } | 460 | } |
diff --git a/firmware/export/scroll_engine.h b/firmware/export/scroll_engine.h index 0fcb06af81..838926af57 100644 --- a/firmware/export/scroll_engine.h +++ b/firmware/export/scroll_engine.h | |||
@@ -55,6 +55,9 @@ struct scrollinfo | |||
55 | int offset; | 55 | int offset; |
56 | int startx; | 56 | int startx; |
57 | #ifdef HAVE_LCD_BITMAP | 57 | #ifdef HAVE_LCD_BITMAP |
58 | #if LCD_DEPTH > 1 || (defined(HAVE_LCD_REMOTE) && LCD_REMOTE_DEPTH > 1) | ||
59 | char *backdrop; | ||
60 | #endif | ||
58 | int width; /* length of line in pixels */ | 61 | int width; /* length of line in pixels */ |
59 | int style; /* line style */ | 62 | int style; /* line style */ |
60 | #endif/* HAVE_LCD_BITMAP */ | 63 | #endif/* HAVE_LCD_BITMAP */ |