(PS3) Refactor PAL60 setting

This commit is contained in:
twinaphex 2014-08-31 03:50:44 +02:00
parent 27a60f1d5d
commit 262ec8881a
4 changed files with 25 additions and 45 deletions

View File

@ -159,10 +159,7 @@ static void menu_common_entries_init(menu_handle_t *menu, unsigned menu_type)
#endif
add_setting_entry(menu,"video_viwidth", 0, setting_data);
add_setting_entry(menu,"video_filter", MENU_SETTINGS_VIDEO_SOFTFILTER, setting_data);
#if defined(__CELLOS_LV2__)
file_list_push(menu->selection_buf, "PAL60 Mode", "",
MENU_SETTINGS_VIDEO_PAL60, 0);
#endif
add_setting_entry(menu, "pal60_enable", 0, setting_data);
add_setting_entry(menu,"video_smooth", 0, setting_data);
add_setting_entry(menu, "soft_filter", 0, setting_data);
add_setting_entry(menu,"video_gamma", MENU_SETTINGS_VIDEO_GAMMA, setting_data);
@ -3290,43 +3287,17 @@ static int menu_common_setting_set(unsigned id, unsigned action)
if (g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx] == CELL_VIDEO_OUT_RESOLUTION_576)
{
if (g_extern.console.screen.pal_enable)
g_extern.lifecycle_state |= (1ULL<< MODE_VIDEO_PAL_ENABLE);
g_extern.console.screen.pal60_enable = true;
}
else
{
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_ENABLE);
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
g_extern.console.screen.pal_enable = false;
g_extern.console.screen.pal60_enable = false;
}
rarch_main_command(RARCH_CMD_REINIT);
}
break;
case MENU_SETTINGS_VIDEO_PAL60:
switch (action)
{
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_ENABLE))
{
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
else
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
rarch_main_command(RARCH_CMD_REINIT);
}
break;
case MENU_ACTION_START:
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_ENABLE))
{
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
rarch_main_command(RARCH_CMD_REINIT);
}
break;
}
break;
#endif
break;
case MENU_SETTINGS_SHADER_PASSES:
@ -3639,12 +3610,6 @@ static void menu_common_setting_set_label(char *type_str,
snprintf(type_str, type_str_size, "%dx%d", width, height);
}
break;
case MENU_SETTINGS_VIDEO_PAL60:
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
strlcpy(type_str, "ON", type_str_size);
else
strlcpy(type_str, "OFF", type_str_size);
break;
#endif
case MENU_FILE_PLAIN:
strlcpy(type_str, "(FILE)", type_str_size);

View File

@ -144,8 +144,6 @@ enum menu_enums
MODE_EXITSPAWN_MULTIMAN,
MODE_VIDEO_TRIPLE_BUFFERING_ENABLE,
MODE_VIDEO_FLICKER_FILTER_ENABLE,
MODE_VIDEO_PAL_ENABLE,
MODE_VIDEO_PAL_TEMPORAL_ENABLE,
MODE_AUDIO_CUSTOM_BGM_ENABLE,
MODE_OSK_ENTRY_SUCCESS,
MODE_OSK_ENTRY_FAIL,
@ -700,6 +698,7 @@ struct global
unsigned char flicker_filter_index;
unsigned char soft_filter_index;
bool pal_enable;
bool pal60_enable;
} screen;
struct

View File

@ -242,17 +242,16 @@ static bool gfx_ctx_init(void *data)
params.enable |= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT;
params.width = gfx_ctx_get_resolution_width(g_extern.console.screen.resolutions.current.id);
params.height = gfx_ctx_get_resolution_height(g_extern.console.screen.resolutions.current.id);
g_extern.console.screen.pal_enable = false;
if (params.width == 720 && params.height == 576)
{
RARCH_LOG("[PSGL Context]: 720x576 resolution detected, setting MODE_VIDEO_PAL_ENABLE.\n");
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_ENABLE);
g_extern.console.screen.pal_enable = true;
}
else
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_ENABLE);
}
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE))
if (g_extern.console.screen.pal60_enable)
{
RARCH_LOG("[PSGL Context]: Setting temporal PAL60 mode.\n");
params.enable |= PSGL_DEVICE_PARAMETERS_RESC_PAL_TEMPORAL_MODE;

View File

@ -1154,6 +1154,8 @@ static void general_read_handler(const void *data)
#endif
else if (!strcmp(setting->name, "video_smooth"))
*setting->value.boolean = g_settings.video.smooth;
else if (!strcmp(setting->name, "pal60_enable"))
*setting->value.boolean = g_extern.console.screen.pal60_enable;
else if (!strcmp(setting->name, "video_monitor_index"))
*setting->value.unsigned_integer = g_settings.video.monitor_index;
else if (!strcmp(setting->name, "video_disable_composition"))
@ -1499,6 +1501,18 @@ static void general_write_handler(const void *data)
if (driver.video_data && driver.video_poke && driver.video_poke->set_filtering)
driver.video_poke->set_filtering(driver.video_data, 1, g_settings.video.smooth);
}
else if (!strcmp(setting->name, "pal60_enable"))
{
g_extern.console.screen.pal60_enable = *setting->value.boolean;
if (*setting->value.boolean && g_extern.console.screen.pal_enable)
rarch_cmd = RARCH_CMD_REINIT;
else
{
g_extern.console.screen.pal60_enable = false;
*setting->value.boolean = false;
}
}
else if (!strcmp(setting->name, "video_monitor_index"))
{
g_settings.video.monitor_index = *setting->value.unsigned_integer;
@ -2035,6 +2049,9 @@ rarch_setting_t *setting_data_get_list(void)
CONFIG_UINT(g_settings.video.viwidth, "video_viwidth", "Set Screen Width", video_viwidth, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
#endif
CONFIG_BOOL(g_settings.video.smooth, "video_smooth", "Use Bilinear Filtering", video_smooth, "Point filtering", "Bilinear filtering", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
#if defined(__CELLOS_LV2__)
CONFIG_BOOL(g_settings.video.smooth, "pal60_enable", "Use PAL60 Mode", false, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
#endif
CONFIG_UINT(g_settings.video.rotation, "video_rotation", "Rotation", 0, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, 3, 1, true, true)
#if defined(HW_RVL) || defined(_XBOX360)
CONFIG_UINT(g_extern.console.screen.gamma_correction, "video_gamma", "Gamma", 0, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, MAX_GAMMA_SETTING, 1, true, true)