diff --git a/apps/plugin.c b/apps/plugin.c index 4827476545..c6481e8eae 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -466,6 +466,9 @@ static const struct plugin_api rockbox_api = { #endif #endif /* HAVE_RECORDING */ #endif /* CONFIG_CODEC == SWCODEC */ + + lcd_set_backdrop, + }; int plugin_load(const char* plugin, void* parameter) @@ -485,6 +488,7 @@ int plugin_load(const char* plugin, void* parameter) #ifdef HAVE_REMOTE_LCD int rxm, rym; #endif + #if LCD_DEPTH > 1 fb_data* old_backdrop; #endif @@ -567,10 +571,11 @@ int plugin_load(const char* plugin, void* parameter) xm = lcd_getxmargin(); ym = lcd_getymargin(); lcd_setmargins(0,0); + #if LCD_DEPTH > 1 old_backdrop = lcd_get_backdrop(); - lcd_set_backdrop(NULL); #endif + lcd_clear_display(); lcd_update(); #else /* !HAVE_LCD_BITMAP */ diff --git a/apps/plugin.h b/apps/plugin.h index bfb02b9e67..2fcd52198c 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -578,6 +578,8 @@ struct plugin_api { #endif #endif /* HAVE_RECORDING */ #endif /* CONFIG_CODEC == SWCODEC */ + + void (*lcd_set_backdrop)(fb_data* backdrop); }; /* plugin header */ diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index 002c913d77..e3e90468cc 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c @@ -480,6 +480,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb = api; len = rb->strlen(SS_TITLE); + rb->lcd_set_backdrop(NULL); rb->lcd_setfont(FONT_SYSFIXED); rb->lcd_getstringsize((unsigned char *)SS_TITLE, &w, &h); diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index 2afbaba011..4a3f1c6962 100755 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c @@ -2699,6 +2699,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { rb->lcd_clear_display(); /* start app */ + rb->lcd_set_backdrop(NULL); rb->lcd_setfont(FONT_SYSFIXED); while(!exit) { diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index fdab570bc2..d82ac9e181 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c @@ -643,10 +643,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { /* plugin init */ (void)parameter; rb = api; + rb->lcd_set_backdrop(NULL); /* end of plugin init */ /* load opening book, soon */ - + /* init board */ GNUChess_Initialize(); diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c index a01a6eb608..032344263a 100644 --- a/apps/plugins/clock.c +++ b/apps/plugins/clock.c @@ -3101,11 +3101,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) draw_extras(year, day, month, temphour, minute, second); -#if (CONFIG_KEYPAD == IPOD_4G_PAD) - rb->lcd_drawline (113, 0, 113, 65); - rb->lcd_drawline (0, 65, 113, 65); -#endif - if(!idle_poweroff) rb->reset_poweroff_timer(); diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 1dd981bb56..02f7b45770 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -558,6 +558,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #ifdef HAVE_LCD_BITMAP #if LCD_DEPTH > 1 + rb->lcd_set_backdrop(NULL); xlcd_init(rb); #elif defined(USE_GSLIB) gbuf = (unsigned char *)rb->plugin_get_buffer(&gbuf_size); diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 44b658e878..36e41a2a73 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c @@ -445,6 +445,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) int ret; rb = api; /* copy to global api pointer */ + rb->lcd_set_backdrop(NULL); (void)parameter; if (rb->global_settings->backlight_timeout > 0) { diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index 718a7b9f47..2b42322daa 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c @@ -849,6 +849,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->profile_thread(); #endif + rb->lcd_set_backdrop(NULL); + D_DoomMain (); #ifdef RB_PROFILE diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c index df46eb918e..6f20609e62 100644 --- a/apps/plugins/fire.c +++ b/apps/plugins/fire.c @@ -409,6 +409,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb = api; // copy to global api pointer (void)parameter; + rb->lcd_set_backdrop(NULL); if (rb->global_settings->backlight_timeout > 0) rb->backlight_set_timeout(1);/* keep the light on */ diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 0712e32563..b44a54d1da 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -469,6 +469,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->lcd_set_foreground(LCD_BLACK); #endif + rb->lcd_set_backdrop(NULL); + rb->splash(HZ, true, "FlipIt!"); #ifdef HAVE_LCD_BITMAP diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 90544202a6..1982d77db1 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -1562,6 +1562,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { jewels_loadscores(&bj); rb->lcd_setfont(FONT_SYSFIXED); + rb->lcd_set_backdrop(NULL); jewels_setcolors(); while(!exit) { diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c index 4c7c4bbc9b..7e6c4f3d48 100644 --- a/apps/plugins/mandelbrot.c +++ b/apps/plugins/mandelbrot.c @@ -546,6 +546,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) xlcd_init(rb); #endif + rb->lcd_set_backdrop(NULL); + init_mandelbrot_set(); /* main loop */ diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index fe24e44a77..143908e040 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -657,6 +657,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) (void)parameter; rb = api; + rb->lcd_set_backdrop(NULL); while( !exit ) { diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 7df43e7271..f8564b211a 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -575,6 +575,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #if LCD_DEPTH > 1 rb->lcd_set_foreground(GRAPH_COLOR); rb->lcd_set_background(BACKG_COLOR); + rb->lcd_set_backdrop(NULL); rb->lcd_clear_display(); rb->lcd_update(); #endif diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c index 8acc06ae1d..7c2d1e21ca 100644 --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c @@ -389,7 +389,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cpu_boost(true); #endif - + rb->lcd_set_backdrop(NULL); rb->lcd_set_foreground(LCD_WHITE); rb->lcd_set_background(LCD_BLACK); rb->lcd_clear_display(); diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c index c48235ecf8..927b290e12 100644 --- a/apps/plugins/plasma.c +++ b/apps/plugins/plasma.c @@ -348,6 +348,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb = api; /* copy to global api pointer */ (void)parameter; + rb->lcd_set_backdrop(NULL); if (rb->global_settings->backlight_timeout > 0) rb->backlight_set_timeout(1);/* keep the light on */ diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index a9fd89db16..34754bfd78 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -910,6 +910,7 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter) rb = api; rb->srand (*rb->current_tick); + rb->lcd_set_backdrop(NULL); #ifdef HAVE_LCD_BITMAP rb->lcd_setfont (FONT_SYSFIXED); diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index d070fc09bb..5ef47b5813 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -170,6 +170,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->lcd_setfont(0); + rb->lcd_set_backdrop(NULL); #if defined(HAVE_LCD_COLOR) rb->lcd_set_foreground(LCD_WHITE); rb->lcd_set_background(LCD_BLACK); diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index 8fd75755d6..27df31092a 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c @@ -2941,6 +2941,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb = api; rb->lcd_set_foreground(COLOR_WHITE); + rb->lcd_set_backdrop(NULL); rb->lcd_fillrect(0,0,LCD_WIDTH,LCD_HEIGHT); rb->splash( HZ/2, true, "Rock Paint"); diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index c2357967f5..39ffec2dda 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -1134,7 +1134,7 @@ void game (void) draw_apple(); - rb->sleep(HZ/speed); + rb->sleep(HZ/speed); /* Make snake more addaptive for frequency shifts */ button = rb->button_get(false); @@ -1326,7 +1326,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) /* Lets use the default font */ rb->lcd_setfont(FONT_SYSFIXED); - + rb->lcd_set_backdrop(NULL); #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_BLACK); rb->lcd_set_background(LCD_WHITE); diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index d72cea9a96..fe72d823b5 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -362,17 +362,11 @@ static void draw_card_ext( int x, int y, bool selected, bool cursor ) if( selected ) { -#if LCD_DEPTH > 1 - rb->lcd_set_foreground( FRAME_COLOR ); -#endif rb->lcd_drawrect( x+1, y+1, CARD_WIDTH-2, CARD_HEIGHT-2 ); #ifdef LARGE_CARD rb->lcd_drawrect( x+2, y+2, CARD_WIDTH-4, CARD_HEIGHT-4 ); #endif } -#if LCD_DEPTH > 1 - rb->lcd_set_foreground( LCD_BLACK ); -#endif if( cursor ) { @@ -575,11 +569,6 @@ int solitaire_menu(bool in_game) struct menu_item items[5]; -#if LCD_DEPTH > 1 - rb->lcd_set_background(LCD_DEFAULT_BG); - rb->lcd_set_foreground(LCD_DEFAULT_FG); -#endif - if (in_game) { items[i++].desc = "Resume Game"; @@ -1098,15 +1087,8 @@ int solitaire( void ) while( true ) { -#if LCD_DEPTH>1 - rb->lcd_set_background(BACKGROUND_COLOR); -#endif rb->lcd_clear_display(); -#if LCD_DEPTH > 1 - rb->lcd_set_foreground(LCD_BLACK); -#endif - /* get the biggest column length so that display can be "optimized" */ biggest_col_length = 0; diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 1406643395..c1daa94fa5 100755 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -1675,6 +1675,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) game_state = ATTRACT_MODE; /* universal font */ + rb->lcd_set_backdrop(NULL); rb->lcd_setfont(FONT_SYSFIXED); rb->backlight_set_timeout(1); iohiscore(); diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 2bf2902bc6..2f5814d8c8 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -1115,6 +1115,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->lcd_getstringsize("a", &char_width, &char_height); #if LCD_DEPTH > 1 + rb->lcd_set_backdrop(NULL); rb->lcd_set_background( LCD_BLACK ); rb->lcd_set_foreground( LCD_WHITE ); #endif diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index 0d87ea7fff..b236a21c21 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c @@ -223,11 +223,6 @@ int plugin_main(void) starfield_init(&starfield); starfield_add_stars(&starfield, INIT_STARS); -#ifdef HAVE_LCD_COLOR - rb->lcd_set_background(LCD_BLACK); - rb->lcd_set_foreground(LCD_WHITE); -#endif - while (true) { rb->sleep(1); diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c index e1e99bf444..d280688a8d 100644 --- a/apps/plugins/sudoku/sudoku.c +++ b/apps/plugins/sudoku/sudoku.c @@ -1125,6 +1125,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) /* plugin init */ rb = api; /* end of plugin init */ + + rb->lcd_set_backdrop(NULL); clear_state(&state); diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index f108b4d518..3d3cd4f25c 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -2355,6 +2355,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->lcd_set_background(COLOR_BG); #endif + rb->lcd_set_backdrop(NULL); + #ifdef DEBUG_WORMLET testline_in_rect(); test_worm_argh_collision_in_moves(); diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index abfd2a53b4..e6b66b3ab5 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -861,6 +861,7 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter) rb = api; rb->lcd_setfont (FONT_SYSFIXED); + rb->lcd_set_backdrop(NULL); /* Permanently enable the backlight (unless the user has turned it off) */ if (rb->global_settings->backlight_timeout > 0) diff --git a/apps/plugins/zxbox/zxbox.c b/apps/plugins/zxbox/zxbox.c index eb177a090e..54a11d010e 100644 --- a/apps/plugins/zxbox/zxbox.c +++ b/apps/plugins/zxbox/zxbox.c @@ -72,6 +72,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #if CODEC == SWCODEC && !defined SIMULATOR rb->pcm_play_stop(); #endif + rb->lcd_set_backdrop(NULL); rb->splash(HZ, true, "Welcome to ZXBox"); #ifdef USE_IRAM