(PS3) Added preliminary resolution switching options

This commit is contained in:
TwinAphex51224 2012-01-18 00:18:23 +01:00
parent c7e32cbbd2
commit 5453cc0448
3 changed files with 92 additions and 0 deletions

View File

@ -525,6 +525,12 @@ static void set_setting_label(menu * menu_obj, int currentsetting)
switch(currentsetting)
{
case SETTING_CHANGE_RESOLUTION:
if(g_console.initial_resolution_id == g_console.supported_resolutions[g_console.current_resolution_index])
menu_obj->items[currentsetting].text_color = GREEN;
else
menu_obj->items[currentsetting].text_color = ORANGE;
snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), ps3_get_resolution_label(g_console.supported_resolutions[g_console.current_resolution_index]));
break;
case SETTING_SHADER_PRESETS:
/* add a comment */
@ -805,6 +811,37 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
switch(switchvalue)
{
case SETTING_CHANGE_RESOLUTION:
if(CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) )
{
ps3_next_resolution();
set_text_message("", 7);
}
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) )
{
ps3_previous_resolution();
set_text_message("", 7);
}
if(CTRL_CROSS(state))
{
if (g_console.supported_resolutions[g_console.current_resolution_index] == CELL_VIDEO_OUT_RESOLUTION_576)
{
if(ps3_check_resolution(CELL_VIDEO_OUT_RESOLUTION_576))
{
//ps3graphics_set_pal60hz(Settings.PS3PALTemporalMode60Hz);
//ps3graphics_switch_resolution(ps3graphics_get_current_resolution(), Settings.PS3PALTemporalMode60Hz, Settings.TripleBuffering, Settings.ScaleEnabled, Settings.ScaleFactor);
//ps3graphics_set_vsync(Settings.Throttled);
//apply_scaling();
}
}
else
{
//ps3graphics_set_pal60hz(0);
//ps3graphics_switch_resolution(ps3graphics_get_current_resolution(), 0, Settings.TripleBuffering, Settings.ScaleEnabled, Settings.ScaleFactor);
//ps3graphics_set_vsync(Settings.Throttled);
//apply_scaling();
//emulator_implementation_set_texture(Settings.PS3CurrentBorder);
}
}
break;
/*
case SETTING_PAL60_MODE:

View File

@ -1045,6 +1045,55 @@ void ps3_set_resolution (void)
cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &g_video_state);
}
void ps3_next_resolution (void)
{
if(g_console.current_resolution_index+1 < g_console.supported_resolutions_count)
{
g_console.current_resolution_index++;
g_console.current_resolution_id = g_console.supported_resolutions[g_console.current_resolution_index];
}
}
void ps3_previous_resolution (void)
{
if(g_console.current_resolution_index > 0)
{
g_console.current_resolution_index--;
g_console.current_resolution_id = g_console.supported_resolutions[g_console.current_resolution_index];
}
}
int ps3_check_resolution(uint32_t resolution_id)
{
return cellVideoOutGetResolutionAvailability(CELL_VIDEO_OUT_PRIMARY, resolution_id, \
CELL_VIDEO_OUT_ASPECT_AUTO,0);
}
const char * ps3_get_resolution_label(uint32_t resolution)
{
switch(resolution)
{
case CELL_VIDEO_OUT_RESOLUTION_480:
return "720x480 (480p)";
case CELL_VIDEO_OUT_RESOLUTION_576:
return "720x576 (576p)";
case CELL_VIDEO_OUT_RESOLUTION_720:
return "1280x720 (720p)";
case CELL_VIDEO_OUT_RESOLUTION_960x1080:
return "960x1080";
case CELL_VIDEO_OUT_RESOLUTION_1280x1080:
return "1280x1080";
case CELL_VIDEO_OUT_RESOLUTION_1440x1080:
return "1440x1080";
case CELL_VIDEO_OUT_RESOLUTION_1600x1080:
return "1600x1080";
case CELL_VIDEO_OUT_RESOLUTION_1080:
return "1920x1080 (1080p)";
default:
return "Unknown";
}
}
// PS3 needs a working graphics stack before SSNES even starts.
// To deal with this main.c,
// the top level module owns the instance, and is created beforehand.

View File

@ -26,6 +26,12 @@
void ps3_video_init(void);
void ps3_video_deinit(void);
void ps3_next_resolution (void);
void ps3_previous_resolution (void);
const char * ps3_get_resolution_label(uint32_t resolution);
int ps3_check_resolution(uint32_t resolution_id);
extern void *g_gl;
#endif