diff --git a/Makefile.common b/Makefile.common index c0fea61d70..09503623cf 100644 --- a/Makefile.common +++ b/Makefile.common @@ -2274,7 +2274,7 @@ ifeq ($(HAVE_FFMPEG), 1) endif # CRT mode switching -ifeq ($(HAVE_SR2), 1) +ifeq ($(HAVE_CRTSWITCHRES), 1) INCLUDE_DIRS += -I$(DEPS_DIR)/switchres OBJ += gfx/video_crt_switch.o \ $(DEPS_DIR)/switchres/monitor.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 952641f676..d097be331f 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -971,7 +971,9 @@ MIDI /*============================================================ DRIVERS ============================================================ */ -/*#include "../gfx/video_crt_switch.c" */ +#ifdef HAVE_CRTSWITCHRES +#include "../gfx/video_crt_switch.c" +#endif #include "../gfx/gfx_animation.c" #include "../gfx/gfx_display.c" #include "../gfx/gfx_thumbnail_path.c" diff --git a/qb/config.params.sh b/qb/config.params.sh index 386f5929dc..0cff89c402 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -195,5 +195,5 @@ HAVE_ODROIDGO2=no # ODROID-GO Advance rotation support (requires librga HAVE_LIBSHAKE=no # libShake haptic feedback support HAVE_CHECK=no # check support for unit tests HAVE_WIFI=no # wifi driver support -HAVE_CRTSWITCHRES=auto # CRT mode switching support +HAVE_CRTSWITCHRES=yes # CRT mode switching support C89_CRTSWITCHRES=no diff --git a/retroarch.c b/retroarch.c index a7f56cf2a1..acc22a7788 100644 --- a/retroarch.c +++ b/retroarch.c @@ -226,8 +226,8 @@ #include "gfx/video_thread_wrapper.h" #endif #include "gfx/video_display_server.h" -#ifdef HAVE_SR2 - #include "gfx/video_crt_switch.h" +#ifdef HAVE_CRTSWITCHRES +#include "gfx/video_crt_switch.h" #endif #include "bluetooth/bluetooth_driver.h" #include "wifi/wifi_driver.h" @@ -31602,9 +31602,8 @@ static void video_driver_frame(const void *data, unsigned width, #if defined(HAVE_GFX_WIDGETS) bool widgets_active = p_rarch->widgets_active; #endif - static int native_width = 0; - status_text[0] = '\0'; + status_text[0] = '\0'; video_driver_msg[0] = '\0'; if (!video_driver_active) @@ -31968,28 +31967,30 @@ static void video_driver_frame(const void *data, unsigned width, } } +#if defined(HAVE_CRTSWITCHRES) /* trigger set resolution*/ if (video_info.crt_switch_resolution) { - p_rarch->video_driver_crt_switching_active = true; - native_width = width; + unsigned native_width = width; + bool dynamic_super_width = false; + + p_rarch->video_driver_crt_switching_active = true; + switch (video_info.crt_switch_resolution_super) { case 2560: case 3840: case 1920: - width = - video_info.crt_switch_resolution_super; - p_rarch->video_driver_crt_dynamic_super_width = false; + width = video_info.crt_switch_resolution_super; + dynamic_super_width = false; break; case 1: - p_rarch->video_driver_crt_dynamic_super_width = true; + dynamic_super_width = true; break; default: - p_rarch->video_driver_crt_dynamic_super_width = false; break; } - #if defined(HAVE_SR2) && !defined(ANDROID) + crt_switch_res_core( &p_rarch->crt_switch_st, native_width, width, @@ -31999,12 +32000,12 @@ static void video_driver_frame(const void *data, unsigned width, video_info.crt_switch_center_adjust, video_info.crt_switch_porch_adjust, video_info.monitor_index, - p_rarch->video_driver_crt_dynamic_super_width, + dynamic_super_width, video_info.crt_switch_resolution_super, video_info.crt_switch_hires_menu); - #endif } else if (!video_info.crt_switch_resolution) +#endif p_rarch->video_driver_crt_switching_active = false; } @@ -33517,15 +33518,18 @@ static void retroarch_deinit_drivers( } #endif +#if defined(HAVE_CRTSWITCHRES) /* Switchres deinit */ - if (p_rarch->video_driver_crt_switching_active) { - /* RARCH_LOG("[CRT]: Getting video info\n"); + if (p_rarch->video_driver_crt_switching_active) + { +#if defined(DEBUG) + RARCH_LOG("[CRT]: Getting video info\n"); RARCH_LOG("[CRT]: About to destroy SR\n"); - */ - #ifdef HAVE_SR2 +#endif crt_destroy_modes(&p_rarch->crt_switch_st); - #endif } +#endif + /* Video */ video_display_server_destroy(); diff --git a/retroarch_data.h b/retroarch_data.h index 5bd5c9236c..9e4ab8a71c 100644 --- a/retroarch_data.h +++ b/retroarch_data.h @@ -1719,9 +1719,9 @@ struct rarch_state double audio_source_ratio_original; double audio_source_ratio_current; struct retro_system_av_info video_driver_av_info; /* double alignment */ - #ifdef HAVE_SR2 +#ifdef HAVE_CRTSWITCHRES videocrt_switch_t crt_switch_st; /* double alignment */ - #endif +#endif retro_time_t frame_limit_minimum_time; retro_time_t frame_limit_last_time; retro_time_t libretro_core_runtime_last; @@ -2254,7 +2254,6 @@ struct rarch_state bool video_driver_state_out_rgb32; #endif bool video_driver_crt_switching_active; - bool video_driver_crt_dynamic_super_width; bool video_driver_threaded; bool video_started_fullscreen;