Merge pull request #1911 from fr500/master

Implement wii custom resolution saving
This commit is contained in:
Twinaphex 2015-07-06 11:26:43 +02:00
commit 1caa441dbf
5 changed files with 40 additions and 2 deletions

View File

@ -1333,6 +1333,11 @@ static bool config_load_file(const char *path, bool set_defaults)
config_get_bool(conf, "soft_filter_enable",
&global->console.softfilter_enable);
CONFIG_GET_INT_BASE(conf, global, console.screen.resolutions.width,
"console_resolution_width");
CONFIG_GET_INT_BASE(conf, global, console.screen.resolutions.height,
"console_resolution_height");
CONFIG_GET_INT_BASE(conf, global, console.screen.flicker_filter_index,
"flicker_filter_index");
CONFIG_GET_INT_BASE(conf, global, console.screen.soft_filter_index,
@ -2583,6 +2588,11 @@ bool config_save_file(const char *path)
config_set_bool(conf, "flicker_filter_enable",
global->console.flickerfilter_enable);
config_set_int(conf, "console_resolution_width",
global->console.screen.resolutions.width);
config_set_int(conf, "console_resolution_height",
global->console.screen.resolutions.height);
config_set_int(conf, "flicker_filter_index",
global->console.screen.flicker_filter_index);
config_set_int(conf, "soft_filter_index",

View File

@ -427,6 +427,10 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
video_viewport_reset_custom();
g_current_framebuf = 0;
for( int i=0; i < GX_RESOLUTIONS_LAST; i++)
if(fbWidth == menu_gx_resolutions[i][0] && lines == menu_gx_resolutions[i][1])
menu_current_gx_resolution = i;
RARCH_LOG("GX Resolution Index: %d\n", menu_current_gx_resolution);
}
static void gx_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
@ -469,7 +473,8 @@ static void setup_video_mode(void *data)
OSInitThreadQueue(&g_video_cond);
VIDEO_GetPreferredMode(&gx_mode);
gx_set_video_mode(data, 0, 0, true);
global_t *global = global_get_ptr();
gx_set_video_mode(data, global->console.screen.resolutions.width, global->console.screen.resolutions.height, true);
}
static void init_texture(void *data, unsigned width, unsigned height)

View File

@ -1692,7 +1692,7 @@ static int action_ok_video_resolution(const char *path,
#ifdef __CELLOS_LV2__
if (global->console.screen.resolutions.list[
global->console.screen.resolutions.current.idx] ==
global->console.screen.resolutions.current.idx] ==
CELL_VIDEO_OUT_RESOLUTION_576)
{
if (global->console.screen.pal_enable)
@ -1707,7 +1707,11 @@ static int action_ok_video_resolution(const char *path,
event_command(EVENT_CMD_REINIT);
#else
if (video_driver_get_video_output_size(&width, &height))
{
video_driver_set_video_mode(width, height, true);
global->console.screen.resolutions.width = width;
global->console.screen.resolutions.height = height;
}
#endif
return 0;

View File

@ -263,6 +263,19 @@ static int action_start_core_setting(unsigned type,
return 0;
}
static int action_start_video_resolution(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
unsigned width = 0, height = 0;
global_t *global = global_get_ptr();
(void)global;
video_driver_set_video_mode(640, 480, true);
return 0;
}
static int action_start_lookup_setting(unsigned type, const char *label)
{
return menu_setting_set(type, label, MENU_ACTION_START, false);
@ -294,6 +307,8 @@ int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_CHEAT_NUM_PASSES:
cbs->action_start = action_start_cheat_num_passes;
break;
case MENU_LABEL_SCREEN_RESOLUTION:
cbs->action_start = action_start_video_resolution;
default:
return -1;
}
@ -321,6 +336,8 @@ static int menu_cbs_init_bind_start_compare_type(menu_file_list_cbs_t *cbs,
cbs->action_start = action_start_performance_counters_frontend;
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
cbs->action_start = action_start_core_setting;
else if (type == MENU_LABEL_SCREEN_RESOLUTION)
cbs->action_start = action_start_video_resolution;
else
return -1;

View File

@ -250,6 +250,8 @@ typedef struct global
uint32_t *list;
unsigned count;
bool check;
unsigned width;
unsigned height;
} resolutions;
unsigned gamma_correction;