fix resolution changes not appearing until applied in GX

This commit is contained in:
Toad King 2014-10-12 21:10:17 -05:00
parent 4f97781f42
commit 0af2abed74
2 changed files with 14 additions and 10 deletions

View File

@ -310,15 +310,6 @@ void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines)
g_current_framebuf = 0;
}
const char *gx_get_video_mode(void)
{
static char format[16];
snprintf(format, sizeof(format), "%.3ux%.3u%c",
gx_mode.fbWidth, gx_mode.efbHeight,
(gx_mode.viTVMode & 3) == VI_INTERLACE ? 'i' : 'p');
return format;
}
static void gx_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
{
gx_video_t *gx = (gx_video_t*)driver.video_data;

View File

@ -1731,6 +1731,19 @@ static void menu_common_setting_set_label_perf(char *type_str,
*w = 0;
}
#if defined(GEKKO)
extern unsigned menu_gx_resolutions[][2];
extern unsigned menu_current_gx_resolution;
static void gx_strcpy_resolution(char *type_str, size_t type_str_size)
{
snprintf(type_str, type_str_size, "%.3ux%.3u%c",
menu_gx_resolutions[menu_current_gx_resolution][0],
menu_gx_resolutions[menu_current_gx_resolution][1],
menu_gx_resolutions[menu_current_gx_resolution][1] > 300 ? 'i' : 'p');
}
#endif
static int get_fallback_label(char *type_str,
size_t type_str_size, unsigned *w, unsigned type,
const char *menu_label, const char *label, unsigned index)
@ -1741,7 +1754,7 @@ static int get_fallback_label(char *type_str,
{
#if defined(GEKKO)
case MENU_SETTINGS_VIDEO_RESOLUTION:
strlcpy(type_str, gx_get_video_mode(), type_str_size);
gx_strcpy_resolution(type_str, type_str_size);
break;
#elif defined(__CELLOS_LV2__)
case MENU_SETTINGS_VIDEO_RESOLUTION: