From 3aaf7b8368ec61e42f3babdb7d91918f548d91b3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 2 Mar 2015 23:40:53 +0100 Subject: [PATCH] (PS3) Bootup regressions fixed --- gfx/drivers_context/ps3_ctx.c | 81 +++++++++------------------------- menu/menu_entries_cbs_ok.c | 18 ++++++++ menu/menu_entries_cbs_toggle.c | 25 +++++++++++ 3 files changed, 65 insertions(+), 59 deletions(-) diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index 5e020b167d..97b78a1437 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -15,7 +15,6 @@ */ #include "../../driver.h" -#include "../../retroarch.h" #include "../../ps3/sdk_defines.h" #ifdef HAVE_LIBDBGFONT @@ -48,6 +47,22 @@ typedef struct gfx_ctx_ps3_data #endif } gfx_ctx_ps3_data_t; +static unsigned gfx_ctx_ps3_get_resolution_width(unsigned resolution_id) +{ + CellVideoOutResolution resolution; + cellVideoOutGetResolution(resolution_id, &resolution); + + return resolution.width; +} + +static unsigned gfx_ctx_ps3_get_resolution_height(unsigned resolution_id) +{ + CellVideoOutResolution resolution; + cellVideoOutGetResolution(resolution_id, &resolution); + + return resolution.height; +} + static float gfx_ctx_ps3_get_aspect_ratio(void *data) { CellVideoOutState videoState; @@ -225,43 +240,6 @@ static void gfx_ctx_ps3_get_video_size(void *data, #endif } -static void gfx_ctx_ps3_get_video_output_size(void *data, - unsigned *width, unsigned *height) -{ - unsigned ident = g_extern.console.screen.resolutions.current.id; - if (!width || !height) - return; - - CellVideoOutResolution resolution; - cellVideoOutGetResolution(ident, &resolution); - - *width = resolution.width; - *height = resolution.height; -} - -static void gfx_ctx_ps3_get_video_output_prev(void *data) -{ - if (g_extern.console.screen.resolutions.current.idx) - { - g_extern.console.screen.resolutions.current.idx--; - g_extern.console.screen.resolutions.current.id = - g_extern.console.screen.resolutions.list - [g_extern.console.screen.resolutions.current.idx]; - } -} - -static void gfx_ctx_ps3_get_video_output_next(void *data) -{ - if (g_extern.console.screen.resolutions.current.idx + 1 < - g_extern.console.screen.resolutions.count) - { - g_extern.console.screen.resolutions.current.idx++; - g_extern.console.screen.resolutions.current.id = - g_extern.console.screen.resolutions.list - [g_extern.console.screen.resolutions.current.idx]; - } -} - static bool gfx_ctx_ps3_init(void *data) { gfx_ctx_ps3_data_t *ps3 = (gfx_ctx_ps3_data_t*) @@ -295,8 +273,8 @@ static bool gfx_ctx_ps3_init(void *data) if (g_extern.console.screen.resolutions.current.id) { params.enable |= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT; - - gfx_ctx_ps3_get_video_output_size(data, ¶ms.width, ¶ms.height); + params.width = gfx_ctx_ps3_get_resolution_width(g_extern.console.screen.resolutions.current.id); + params.height = gfx_ctx_ps3_get_resolution_height(g_extern.console.screen.resolutions.current.id); g_extern.console.screen.pal_enable = false; if (params.width == 720 && params.height == 576) @@ -339,21 +317,6 @@ static bool gfx_ctx_ps3_set_video_mode(void *data, bool fullscreen) { (void)data; - - 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.console.screen.pal60_enable = true; - } - else - { - g_extern.console.screen.pal_enable = false; - g_extern.console.screen.pal60_enable = false; - } - - rarch_main_command(RARCH_CMD_REINIT); return true; } @@ -416,10 +379,10 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = { gfx_ctx_ps3_set_swap_interval, gfx_ctx_ps3_set_video_mode, gfx_ctx_ps3_get_video_size, - gfx_ctx_ps3_get_video_output_size, - gfx_ctx_ps3_get_video_output_prev, - gfx_ctx_ps3_get_video_output_next, - NULL, /* translate_aspect */ + NULL, /* get_video_output_size */ + NULL, /* get_video_output_prev */ + NULL, /* get_video_output_next */ + NULL, gfx_ctx_ps3_update_window_title, gfx_ctx_ps3_check_window, gfx_ctx_ps3_set_resize, diff --git a/menu/menu_entries_cbs_ok.c b/menu/menu_entries_cbs_ok.c index c577128bc3..43e54d660b 100644 --- a/menu/menu_entries_cbs_ok.c +++ b/menu/menu_entries_cbs_ok.c @@ -249,11 +249,29 @@ static int action_ok_video_filter(const char *path, if (!menu) return -1; +#ifdef __CELLOS_LV2__ + 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.console.screen.pal60_enable = true; + } + else + { + g_extern.console.screen.pal_enable = false; + g_extern.console.screen.pal60_enable = false; + } + + rarch_main_command(RARCH_CMD_REINIT); + return 0; +#else return menu_list_push_stack_refresh( menu->menu_list, g_settings.video.filter_dir, "deferred_video_filter", 0, idx); +#endif } static int action_ok_core_updater_list(const char *path, diff --git a/menu/menu_entries_cbs_toggle.c b/menu/menu_entries_cbs_toggle.c index e838822939..a43fde0a15 100644 --- a/menu/menu_entries_cbs_toggle.c +++ b/menu/menu_entries_cbs_toggle.c @@ -396,6 +396,30 @@ static int action_toggle_shader_num_passes(unsigned type, const char *label, static int action_toggle_video_resolution(unsigned type, const char *label, unsigned action) { +#if defined(__CELLOS_LV2__) + switch (action) + { + case MENU_ACTION_LEFT: + if (g_extern.console.screen.resolutions.current.idx) + { + g_extern.console.screen.resolutions.current.idx--; + g_extern.console.screen.resolutions.current.id = + g_extern.console.screen.resolutions.list + [g_extern.console.screen.resolutions.current.idx]; + } + break; + case MENU_ACTION_RIGHT: + if (g_extern.console.screen.resolutions.current.idx + 1 < + g_extern.console.screen.resolutions.count) + { + g_extern.console.screen.resolutions.current.idx++; + g_extern.console.screen.resolutions.current.id = + g_extern.console.screen.resolutions.list + [g_extern.console.screen.resolutions.current.idx]; + } + break; + } +#else switch (action) { case MENU_ACTION_LEFT: @@ -409,6 +433,7 @@ static int action_toggle_video_resolution(unsigned type, const char *label, driver.video_poke->get_video_output_next(driver.video_data); break; } +#endif return 0; }