(PS3/Wii) Reimplement video resolution code

This commit is contained in:
twinaphex 2015-11-21 08:39:46 +01:00
parent ad75d00bd4
commit de44911092
5 changed files with 29 additions and 28 deletions

View File

@ -355,9 +355,8 @@ static bool gfx_ctx_ps3_bind_api(void *data,
return api == GFX_CTX_OPENGL_API || GFX_CTX_OPENGL_ES_API; return api == GFX_CTX_OPENGL_API || GFX_CTX_OPENGL_ES_API;
} }
static void gx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsigned *height) static void gfx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsigned *height)
{ {
unsigned width, height;
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
if (!global) if (!global)
@ -365,6 +364,17 @@ static void gx_ctx_ps3_get_video_output_size(void *data, unsigned *width, unsign
gfx_ctx_ps3_get_resolution(global->console.screen.resolutions.current.id, gfx_ctx_ps3_get_resolution(global->console.screen.resolutions.current.id,
width, height); width, height);
if (*width == 720 && *height == 576)
{
if (global->console.screen.pal_enable)
global->console.screen.pal60_enable = true;
}
else
{
global->console.screen.pal_enable = false;
global->console.screen.pal60_enable = false;
}
} }
static void gfx_ctx_ps3_get_video_output_prev(void *data) static void gfx_ctx_ps3_get_video_output_prev(void *data)

View File

@ -666,15 +666,20 @@ bool video_driver_set_rotation(unsigned rotation)
} }
void video_driver_set_video_mode(unsigned width, bool video_driver_set_video_mode(unsigned width,
unsigned height, bool fullscreen) unsigned height, bool fullscreen)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver); const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver);
if (poke && poke->set_video_mode) if (poke && poke->set_video_mode)
{
poke->set_video_mode(driver->video_data, poke->set_video_mode(driver->video_data,
width, height, fullscreen); width, height, fullscreen);
return true;
}
return gfx_ctx_set_video_mode(driver->video_context_data, width, height, fullscreen);
} }
bool video_driver_get_video_output_size(unsigned *width, unsigned *height) bool video_driver_get_video_output_size(unsigned *width, unsigned *height)
@ -1130,14 +1135,14 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
poke->get_video_output_next(driver->video_data); poke->get_video_output_next(driver->video_data);
return true; return true;
} }
return gfx_ctx_get_video_output_next(driver->video_data); return gfx_ctx_get_video_output_next(driver->video_context_data);
case RARCH_DISPLAY_CTL_GET_PREV_VIDEO_OUT: case RARCH_DISPLAY_CTL_GET_PREV_VIDEO_OUT:
if (poke && poke->get_video_output_prev) if (poke && poke->get_video_output_prev)
{ {
poke->get_video_output_prev(driver->video_data); poke->get_video_output_prev(driver->video_data);
return true; return true;
} }
return gfx_ctx_get_video_output_next(driver->video_data); return gfx_ctx_get_video_output_next(driver->video_context_data);
case RARCH_DISPLAY_CTL_INIT: case RARCH_DISPLAY_CTL_INIT:
return init_video(); return init_video();
case RARCH_DISPLAY_CTL_DEINIT: case RARCH_DISPLAY_CTL_DEINIT:

View File

@ -299,7 +299,7 @@ bool video_driver_set_shader(enum rarch_shader_type type,
bool video_driver_set_rotation(unsigned rotation); bool video_driver_set_rotation(unsigned rotation);
void video_driver_set_video_mode(unsigned width, bool video_driver_set_video_mode(unsigned width,
unsigned height, bool fullscreen); unsigned height, bool fullscreen);
bool video_driver_get_video_output_size( bool video_driver_get_video_output_size(

View File

@ -1833,39 +1833,23 @@ static int action_ok_help_load_content(const char *path,
static int action_ok_video_resolution(const char *path, static int action_ok_video_resolution(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
global_t *global = global_get_ptr();
#ifdef __CELLOS_LV2__
if (global->console.screen.resolutions.list[
global->console.screen.resolutions.current.idx] ==
CELL_VIDEO_OUT_RESOLUTION_576)
{
if (global->console.screen.pal_enable)
global->console.screen.pal60_enable = true;
}
else
{
global->console.screen.pal_enable = false;
global->console.screen.pal60_enable = false;
}
event_command(EVENT_CMD_REINIT);
#else
unsigned width = 0; unsigned width = 0;
unsigned height = 0; unsigned height = 0;
global_t *global = global_get_ptr();
if (video_driver_get_video_output_size(&width, &height)) if (video_driver_get_video_output_size(&width, &height))
{ {
char msg[PATH_MAX_LENGTH] = {0}; char msg[PATH_MAX_LENGTH] = {0};
#ifdef __CELLOS_LV2__
event_command(EVENT_CMD_REINIT);
#else
video_driver_set_video_mode(width, height, true); video_driver_set_video_mode(width, height, true);
global->console.screen.resolutions.width = width; global->console.screen.resolutions.width = width;
global->console.screen.resolutions.height = height; global->console.screen.resolutions.height = height;
#endif
snprintf(msg, sizeof(msg),"Applying: %dx%d\n START to reset",width, height); snprintf(msg, sizeof(msg),"Applying: %dx%d\n START to reset", width, height);
menu_display_msg_queue_push(msg, 1, 100, true); menu_display_msg_queue_push(msg, 1, 100, true);
} }
#endif
return 0; return 0;
} }

View File

@ -1679,7 +1679,9 @@ static int menu_displaylist_parse_load_content_settings(menu_displaylist_info_t
{ {
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
#ifdef HAVE_CHEEVOS
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
#endif
if (!menu) if (!menu)
return -1; return -1;