Redraw (most of the) screen when font/theme change in launcher

This commit is contained in:
Alex Duchesne 2020-03-19 16:05:20 -04:00
parent 73e4a3039d
commit 923b7b1ee6
5 changed files with 31 additions and 23 deletions

View File

@ -184,10 +184,6 @@ label: op(b); break;
#define JR ( PC += 1+(n8)readb(PC) )
#define JP ( PC = readw(PC) )
@ -310,7 +306,16 @@ inline void sound_advance(int cnt)
cpu.sound += cnt;
}
extern int debug_trace;
/* cnt - time to emulate, expressed in 2MHz units */
void cpu_timers(int cnt)
{
cnt <<= 1;
timer_advance(cnt);
serial_advance(cnt);
cnt >>= cpu.speed;
lcdc_advance(cnt);
sound_advance(cnt);
}
/* cpu_emulate()
Emulate CPU for time no less than specified

View File

@ -24,15 +24,11 @@ struct cpu
int serial;
};
extern int debug_trace;
extern struct cpu cpu;
void cpu_timers(int cnt);
void cpu_reset();
int cpu_emulate(int cycles); /* NOTE there may be an ASM version of that */
void div_advance(int cnt);
void timer_advance(int cnt);
void sound_advance(int cnt);
int cpu_emulate(int cycles);
void cpu_timers(int cnt);
#endif

View File

@ -556,12 +556,6 @@ static byte operand_count[256] =
int debug_trace = 0;
rcvar_t debug_exports[] =
{
RCV_BOOL("trace", &debug_trace),
RCV_END
};
void debug_disassemble(addr a, int c)
{
#ifdef GNUBOY_DISABLE_DEBUG_DISASSEMBLE

View File

@ -324,7 +324,9 @@ void app_main(void)
{
LoadState();
}
int frames = 0;
int delayFrames = 0;
while (true)
{
odroid_gamepad_state joystick;
@ -340,10 +342,10 @@ int frames = 0;
};
odroid_overlay_game_settings_menu(options, 2);
}
// if (frames == 0 && joystick.values[ODROID_INPUT_START]) {
// frames = 1;
// if (delayFrames == 0 && joystick.values[ODROID_INPUT_START]) {
// delayFrames = 1;
// }
// if (frames > 0 && ++frames == 15)
// if (delayFrames > 0 && ++delayFrames == 15)
// {
// debug_trace = 1;
// }

View File

@ -11,21 +11,31 @@
extern int gui_themes_count;
static retro_emulator_t *emu = NULL;
static bool show_empty = true;
static int show_cover = 1;
static int selected_emu = 0;
static int theme = 0;
static void redraw_screen()
{
gui_header_draw(emu);
gui_list_draw(emu, theme);
}
static bool font_size_cb(odroid_dialog_choice_t *option, odroid_dialog_event_t event)
{
int font_size = odroid_settings_int32_get("FontSize", 1);
if (event == ODROID_DIALOG_PREV) {
if (--font_size < 1) font_size = 1;
odroid_overlay_set_font_size(font_size);
redraw_screen();
}
if (event == ODROID_DIALOG_NEXT) {
if (++font_size > 2) font_size = 2;
odroid_overlay_set_font_size(font_size);
redraw_screen();
}
strcpy(option->value, font_size > 1 ? "Large" : "Small");
return event == ODROID_DIALOG_ENTER;
@ -63,10 +73,12 @@ static bool color_shift_cb(odroid_dialog_choice_t *option, odroid_dialog_event_t
if (event == ODROID_DIALOG_PREV) {
if (--theme < 0) theme = 0;
odroid_settings_int32_set("Theme", theme);
redraw_screen();
}
if (event == ODROID_DIALOG_NEXT) {
if (++theme > max) theme = max;
odroid_settings_int32_set("Theme", theme);
redraw_screen();
}
sprintf(option->value, "%d/%d", theme + 1, max + 1);
return event == ODROID_DIALOG_ENTER;
@ -100,7 +112,6 @@ static void save_config()
void retro_loop()
{
retro_emulator_t *emu = NULL;
int debounce = 0;
int last_key = -1;
int selected_emu_last = -1;