diff --git a/console/griffin/hook.h b/console/griffin/hook.h index 91fc3785a9..33329f88b7 100644 --- a/console/griffin/hook.h +++ b/console/griffin/hook.h @@ -39,6 +39,8 @@ #define video_free_func() gl_free(driver.video_data) #define video_set_rotation_func(rotation) gl_set_rotation(driver.video_data, rotation) #define video_set_aspect_ratio_func(aspectratio_idx) gfx_ctx_set_aspect_ratio(driver.video_data, aspectratio_idx) +#define video_stop_func() gl_stop() +#define video_start_func() gl_start() #define gfx_ctx_window_has_focus() (true) @@ -66,6 +68,8 @@ #define video_free_func() xdk_d3d_free(driver.video_data) #define video_set_rotation_func(rotation) xdk_d3d_set_rotation(driver.video_data, rotation) #define video_set_aspect_ratio_func(aspectratio_idx) gfx_ctx_set_aspect_ratio(driver.video_data, aspectratio_idx) +#define video_stop_func() xdk_d3d_stop() +#define video_start_func() xdk_d3d_start() #define gfx_ctx_window_has_focus() (true) @@ -92,6 +96,8 @@ #define video_free_func() gx_free(driver.video_data) #define video_set_rotation_func(orientation) gx_set_rotation(driver.video_data, orientation) #define video_set_aspect_ratio_func(aspectratio_idx) gx_set_aspect_ratio(driver.video_data, aspectratio_idx) +#define video_stop_func() gx_stop() +#define video_start_func() gx_start() #define input_init_func() gx_input_initialize() #define input_poll_func() gx_input_poll(driver.input_data) @@ -117,6 +123,8 @@ #define video_free_func() null_gfx_free(driver.video_data) #define video_set_rotation_func(orientation) (true) #define video_set_aspect_ratio_func(aspectratio_idx) (true) +#define video_stop_func() null_gfx_stop() +#define video_start_func() null_gfx_start() #define input_init_func() null_input_init() #define input_poll_func() null_input_poll(driver.input_data) diff --git a/console/rgui/rgui.c b/console/rgui/rgui.c index d7bd41ee39..83fa3fd3ae 100644 --- a/console/rgui/rgui.c +++ b/console/rgui/rgui.c @@ -54,7 +54,7 @@ struct rgui_handle uint32_t font_green[256][FONT_HEIGHT][FONT_WIDTH]; }; -static const char *rgui_device_lables[] = { +static const char *rgui_device_labels[] = { "GameCube Controller", "Wiimote", "Wiimote + Nunchuk", @@ -85,11 +85,6 @@ static inline bool rgui_is_controller_menu(rgui_file_type_t menu_type) return (menu_type >= RGUI_SETTINGS_CONTROLLER_1 && menu_type <= RGUI_SETTINGS_CONTROLLER_4); } -static inline bool rgui_is_filebrowser_menu(rgui_file_type_t menu_type) -{ - return (menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE); -} - static void copy_glyph(uint32_t glyph_white[FONT_HEIGHT][FONT_WIDTH], uint32_t glyph_green[FONT_HEIGHT][FONT_WIDTH], const uint8_t *buf) @@ -277,18 +272,14 @@ static void render_text(rgui_handle_t *rgui) const char *dir = 0; rgui_file_type_t menu_type = 0; rgui_list_back(rgui->path_stack, &dir, &menu_type, NULL); + if (menu_type == RGUI_SETTINGS_CORE) - { snprintf(title, sizeof(title), "CORE SELECTION"); - } else if (rgui_is_controller_menu(menu_type) || menu_type == RGUI_SETTINGS) - { snprintf(title, sizeof(title), "SETTINGS: %s", dir); - } else - { snprintf(title, sizeof(title), "FILE BROWSER: %s", dir); - } + blit_line(rgui, TERM_START_X + 15, 15, title, true); struct retro_system_info info; @@ -360,7 +351,7 @@ static void render_text(rgui_handle_t *rgui) snprintf(type_str, sizeof(type_str), "..."); break; case RGUI_SETTINGS_BIND_DEVICE: - snprintf(type_str, sizeof(type_str), "%s", rgui_device_lables[g_settings.input.device[port]]); + snprintf(type_str, sizeof(type_str), "%s", rgui_device_labels[g_settings.input.device[port]]); break; case RGUI_SETTINGS_BIND_UP: case RGUI_SETTINGS_BIND_DOWN: @@ -407,9 +398,7 @@ static void render_text(rgui_handle_t *rgui) static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t action, rgui_file_type_t menu_type) { unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1; -#ifdef GEKKO - gx_video_t *gx = (gx_video_t*)driver.video_data; -#endif + void *data = (gx_video_t*)driver.video_data; switch (setting) { @@ -440,8 +429,11 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t break; #ifdef HW_RVL case RGUI_SETTINGS_VIDEO_SOFT_FILTER: - g_console.soft_display_filter_enable = !g_console.soft_display_filter_enable; - gx->should_resize = true; + { + gx_video_t *gx = (gx_video_t*)data; + g_console.soft_display_filter_enable = !g_console.soft_display_filter_enable; + gx->should_resize = true; + } break; #endif case RGUI_SETTINGS_VIDEO_GAMMA: @@ -449,6 +441,7 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t { g_console.gamma_correction = 0; #ifdef GEKKO + gx_video_t *gx = (gx_video_t*)data; gx->should_resize = true; #endif } @@ -458,6 +451,7 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t { g_console.gamma_correction--; #ifdef GEKKO + gx_video_t *gx = (gx_video_t*)data; gx->should_resize = true; #endif } @@ -468,6 +462,7 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t { g_console.gamma_correction++; #ifdef GEKKO + gx_video_t *gx = (gx_video_t*)data; gx->should_resize = true; #endif } @@ -486,23 +481,17 @@ static void rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t if (action == RGUI_ACTION_START) { rarch_settings_default(S_DEF_AUDIO_CONTROL_RATE); -#ifdef GEKKO - video_gx.set_rotation(NULL, g_console.screen_orientation); -#endif + video_set_rotation_func(g_console.screen_orientation); } else if (action == RGUI_ACTION_LEFT) { rarch_settings_change(S_ROTATION_DECREMENT); -#ifdef GEKKO - video_gx.set_rotation(NULL, g_console.screen_orientation); -#endif + video_set_rotation_func(g_console.screen_orientation); } else if (action == RGUI_ACTION_RIGHT) { rarch_settings_change(S_ROTATION_INCREMENT); -#ifdef GEKKO - video_gx.set_rotation(NULL, g_console.screen_orientation); -#endif + video_set_rotation_func(g_console.screen_orientation); } break; case RGUI_SETTINGS_AUDIO_MUTE: @@ -696,7 +685,7 @@ static const char *rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t acti rgui_list_back(rgui->path_stack, &dir, &menu_type, &directory_ptr); - if (rgui->need_refresh && !rgui_is_filebrowser_menu(menu_type)) + if (rgui->need_refresh && !(menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE)) { rgui->need_refresh = false; if (rgui_is_controller_menu(menu_type)) @@ -841,7 +830,7 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action) // refresh values in case the stack changed rgui_list_back(rgui->path_stack, &dir, &menu_type, &directory_ptr); - if (rgui->need_refresh && rgui_is_filebrowser_menu(menu_type)) + if (rgui->need_refresh && (menu_type == RGUI_FILE_DIRECTORY || menu_type == RGUI_FILE_DEVICE || menu_type == RGUI_SETTINGS_CORE)) { rgui->need_refresh = false; rgui_list_clear(rgui->folder_buf); diff --git a/gx/frontend/main.c b/gx/frontend/main.c index 5041e6ff58..d2db184997 100644 --- a/gx/frontend/main.c +++ b/gx/frontend/main.c @@ -362,7 +362,7 @@ int main(void) config_set_defaults(); input_gx.init(); - video_gx.start(); + video_start_func(); gx_video_t *gx = (gx_video_t*)driver.video_data; gx->menu_data = menu_framebuf; @@ -419,7 +419,8 @@ begin_shutdown: rarch_main_deinit(); input_gx.free(NULL); - video_gx.stop(); + + video_stop_func(); menu_free(); #ifdef HAVE_FILE_LOGGER diff --git a/ps3/frontend/main.c b/ps3/frontend/main.c index 74161143b9..a41636f6bf 100644 --- a/ps3/frontend/main.c +++ b/ps3/frontend/main.c @@ -284,8 +284,7 @@ int main(int argc, char *argv[]) #endif #endif - video_gl.start(); - + video_start_func(); #ifdef HAVE_OSKUTIL oskutil_init(&g_console.oskutil_handle, 0); @@ -343,7 +342,7 @@ begin_shutdown: rarch_main_deinit(); input_ps3.free(NULL); - video_gl.stop(); + video_stop_func(); menu_free(); #ifdef HAVE_OSKUTIL diff --git a/xdk/frontend/main.c b/xdk/frontend/main.c index 18e618d652..eff4be9e37 100644 --- a/xdk/frontend/main.c +++ b/xdk/frontend/main.c @@ -170,11 +170,7 @@ int main(int argc, char *argv[]) input_xinput.post_init(); -#if defined(HAVE_D3D8) || defined(HAVE_D3D9) - video_xdk_d3d.start(); -#else - video_null.start(); -#endif + video_start_func(); system_init(); @@ -210,11 +206,7 @@ begin_shutdown: rarch_config_save(default_paths.config_file); menu_free(); -#if defined(HAVE_D3D8) || defined(HAVE_D3D9) - video_xdk_d3d.stop(); -#else - video_null.stop(); -#endif + video_stop_func(); input_xinput.free(NULL); if(g_console.return_to_launcher)