diff --git a/ps3/main.c b/ps3/main.c index 696fec9f8c..e6466af892 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -144,6 +144,7 @@ static void init_settings(void) init_setting_bool("screenshots_enabled", g_console.screenshots_enable, false); init_setting_bool("throttle_enable", g_console.throttle_enable, true); init_setting_bool("triple_buffering_enable", g_console.triple_buffering_enable, true); + init_setting_uint("current_resolution_id", g_console.current_resolution_id, CELL_VIDEO_OUT_RESOLUTION_UNDEFINED); // g_extern init_setting_uint("state_slot", g_extern.state_slot, 0); @@ -544,7 +545,7 @@ int main(int argc, char *argv[]) } #endif - ps3_video_init(); + ps3graphics_video_init(); ps3_input_init(); menu_init(); diff --git a/ps3/menu.c b/ps3/menu.c index 171c7105e7..26e4fae1d3 100644 --- a/ps3/menu.c +++ b/ps3/menu.c @@ -867,18 +867,13 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue) 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(); + ps3graphics_video_reinit(); } } 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); + ps3graphics_video_reinit(); } } break; diff --git a/ps3/ps3_video_psgl.c b/ps3/ps3_video_psgl.c index d1e4b7fd1f..c946a8b46b 100644 --- a/ps3/ps3_video_psgl.c +++ b/ps3/ps3_video_psgl.c @@ -828,6 +828,16 @@ static bool psgl_init_device(gl_t *gl, const video_info_t *video, uint32_t resol .bufferingMode = PSGL_BUFFERING_MODE_TRIPLE, }; + if(resolution_id) + { + CellVideoOutResolution resolution; + cellVideoOutGetResolution(resolution_id, &resolution); + + params.enable |= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT; + params.width = resolution.width; + params.height = resolution.height; + } + gl->gl_device = psglCreateDeviceExtended(¶ms); psglGetDeviceDimensions(gl->gl_device, &gl->win_width, &gl->win_height); gl->gl_context = psglCreateContext(); @@ -856,7 +866,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo if (!gl) return NULL; - if (!psgl_init_device(gl, video, 0)) + if (!psgl_init_device(gl, video, g_console.current_resolution_id)) return NULL; @@ -1200,13 +1210,13 @@ void ps3_set_filtering(unsigned index, bool set_smooth) When SSNES wants to free it, it is ignored. */ -void ps3_video_init(void) +void ps3graphics_video_init(void) { video_info_t video_info = {0}; // Might have to supply correct values here. - video_info.vsync = true; + video_info.vsync = g_settings.video.vsync; video_info.force_aspect = false; - video_info.smooth = true; + video_info.smooth = g_settings.video.smooth; video_info.input_scale = 2; g_gl = gl_init(&video_info, NULL, NULL); @@ -1215,6 +1225,17 @@ void ps3_video_init(void) ps3_setup_texture(); } +void ps3graphics_video_reinit(void) +{ + gl_t * gl = g_gl; + + if(!gl) + return; + + ps3_video_deinit(); + ps3graphics_video_init(); +} + void ps3_video_deinit(void) { void *data = g_gl; diff --git a/ps3/ps3_video_psgl.h b/ps3/ps3_video_psgl.h index 9e761c6ddf..5256c4dae4 100644 --- a/ps3/ps3_video_psgl.h +++ b/ps3/ps3_video_psgl.h @@ -23,7 +23,8 @@ #include "../gfx/gfx_common.h" #include -void ps3_video_init(void); +void ps3graphics_video_init(void); +void ps3graphics_video_reinit(void); void ps3_video_deinit(void); void ps3_next_resolution (void);