1
0
Fork 0
forked from len0rd/rockbox

FS#10700 - Add --noremote option to simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23358 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Steve Bavin 2009-10-26 09:58:39 +00:00
parent 58c07fbfa8
commit b341f5d594
2 changed files with 56 additions and 26 deletions

View file

@ -24,7 +24,7 @@
#include "lcd-remote-bitmap.h" #include "lcd-remote-bitmap.h"
#include "screendump.h" #include "screendump.h"
SDL_Surface *remote_surface; SDL_Surface *remote_surface = 0;
SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR), SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR),
GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR), GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR),
@ -65,27 +65,35 @@ void lcd_remote_update (void)
void lcd_remote_update_rect(int x_start, int y_start, int width, int height) void lcd_remote_update_rect(int x_start, int y_start, int width, int height)
{ {
sdl_update_rect(remote_surface, x_start, y_start, width, height, if (remote_surface)
LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel); {
sdl_gui_update(remote_surface, x_start, y_start, width, height, sdl_update_rect(remote_surface, x_start, y_start, width, height,
LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel);
background ? UI_REMOTE_POSY : LCD_HEIGHT); sdl_gui_update(remote_surface, x_start, y_start, width, height,
LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0,
background ? UI_REMOTE_POSY : LCD_HEIGHT);
}
} }
void sim_remote_backlight(int value) void sim_remote_backlight(int value)
{ {
if (value > 0) { if (remote_surface)
sdl_set_gradient(remote_surface, &remote_bl_color_dark, {
&remote_bl_color_bright, 0, NUM_SHADES); if (value > 0)
} else { {
sdl_set_gradient(remote_surface, &remote_color_dark, sdl_set_gradient(remote_surface, &remote_bl_color_dark,
&remote_color_bright, 0, NUM_SHADES); &remote_bl_color_bright, 0, NUM_SHADES);
}
else
{
sdl_set_gradient(remote_surface, &remote_color_dark,
&remote_color_bright, 0, NUM_SHADES);
}
sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
background ? UI_REMOTE_POSX : 0,
background? UI_REMOTE_POSY : LCD_HEIGHT);
} }
sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
background ? UI_REMOTE_POSX : 0,
background? UI_REMOTE_POSY : LCD_HEIGHT);
} }
/* initialise simulator lcd remote driver */ /* initialise simulator lcd remote driver */

View file

@ -48,6 +48,9 @@ void button_event(int key, bool pressed);
SDL_Surface *gui_surface; SDL_Surface *gui_surface;
bool background = true; /* use backgrounds by default */ bool background = true; /* use backgrounds by default */
#ifdef HAVE_REMOTE_LCD
static bool showremote = true; /* include remote by default */
#endif
bool lcd_display_redraw = true; /* Used for player simulator */ bool lcd_display_redraw = true; /* Used for player simulator */
char having_new_lcd = true; /* Used for player simulator */ char having_new_lcd = true; /* Used for player simulator */
@ -124,18 +127,25 @@ bool gui_startup(void)
} }
/* Set things up */ /* Set things up */
if (background)
if (background) { {
width = UI_WIDTH; width = UI_WIDTH;
height = UI_HEIGHT; height = UI_HEIGHT;
} else { }
else
{
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH; if (showremote)
height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT; {
#else width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH;
width = SIM_LCD_WIDTH; height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT;
height = SIM_LCD_HEIGHT; }
else
#endif #endif
{
width = SIM_LCD_WIDTH;
height = SIM_LCD_HEIGHT;
}
} }
@ -148,7 +158,8 @@ bool gui_startup(void)
sim_lcd_init(); sim_lcd_init();
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
sim_lcd_remote_init(); if (showremote)
sim_lcd_remote_init();
#endif #endif
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
@ -197,6 +208,14 @@ int main(int argc, char *argv[])
background = false; background = false;
printf("Disabling background image.\n"); printf("Disabling background image.\n");
} }
#ifdef HAVE_REMOTE_LCD
else if (!strcmp("--noremote", argv[x]))
{
showremote = false;
background = false;
printf("Disabling remote image.\n");
}
#endif
else if (!strcmp("--old_lcd", argv[x])) else if (!strcmp("--old_lcd", argv[x]))
{ {
having_new_lcd = false; having_new_lcd = false;
@ -232,6 +251,9 @@ int main(int argc, char *argv[])
printf(" --debugaudio \t Write raw PCM data to audiodebug.raw\n"); printf(" --debugaudio \t Write raw PCM data to audiodebug.raw\n");
printf(" --debugwps \t Print advanced WPS debug info\n"); printf(" --debugwps \t Print advanced WPS debug info\n");
printf(" --nobackground \t Disable the background image\n"); printf(" --nobackground \t Disable the background image\n");
#ifdef HAVE_REMOTE_LCD
printf(" --noremote \t Disable the remote image (will disable backgrounds)\n");
#endif
printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n"); printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n");
printf(" --zoom [VAL]\t Window zoom (will disable backgrounds)\n"); printf(" --zoom [VAL]\t Window zoom (will disable backgrounds)\n");
printf(" --alarm \t Simulate a wake-up on alarm\n"); printf(" --alarm \t Simulate a wake-up on alarm\n");