From 34725d5973398dfe0a276f1b035265d3d159b62c Mon Sep 17 00:00:00 2001 From: digitalLumberjack Date: Tue, 4 Jan 2022 18:17:16 +0100 Subject: [PATCH 1/4] feat(retroarch): bump retroarch to 1.9.14 - related to #2108 --- RELEASE-NOTES.md | 2 +- .../retroarch-0000-remove-search-menu.patch | 25 +- ...ch-0002-add-command-line-hash-option.patch | 102 ++++---- ...ch-0003-mark-frontend-with-@recalbox.patch | 10 +- ...-use-passwords-in-configuration-file.patch | 35 ++- ...0006-fix-min-max-udev-mouse-lightgun.patch | 104 +++------ ...-crt-switch-timings-ntsc-pal-support.patch | 118 +++++----- ...-switch-timings-ntsc-pal-support.patch.old | 221 ++++++++++++++++++ ...arch-0011-aspect-ratio-core-crt-1920.patch | 18 +- package/retroarch/retroarch.mk | 13 +- 10 files changed, 417 insertions(+), 231 deletions(-) create mode 100644 package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch.old diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index f326d67bad..6c7fa843db 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -7,7 +7,7 @@ as release notes for end user on a Recalbox upgrade. ## Version 8.1-Electron ### News - +- Retroach has been bumped to 1.9.14 - Add delete game options - Add core libretro vitaquake2 for x64 - New system sorting options in UI menu: sort your systems by type, manufacturer, release dates and more ! diff --git a/package/retroarch/retroarch-0000-remove-search-menu.patch b/package/retroarch/retroarch-0000-remove-search-menu.patch index 704b40290f..449ce57390 100644 --- a/package/retroarch/retroarch-0000-remove-search-menu.patch +++ b/package/retroarch/retroarch-0000-remove-search-menu.patch @@ -1,13 +1,12 @@ -diff --git a/retroarch.c b/retroarch.c -index 364a96d98a..d9f0ef0121 100644 ---- a/retroarch.c -+++ b/retroarch.c -@@ -2599,7 +2599,7 @@ int generic_menu_entry_action( - entry->label, entry->type, i, entry->entry_idx); - break; - case MENU_ACTION_SEARCH: -- menu_input_dialog_start_search(); -+ //menu_input_dialog_start_search(); - break; - case MENU_ACTION_SCAN: - if (cbs && cbs->action_scan) +diff --git a/menu/menu_driver.c b/menu/menu_driver.c +index ce94d3b..4ca502c 100644 +--- a/menu/menu_driver.c ++++ b/menu/menu_driver.c +@@ -8049,6 +8049,7 @@ bool menu_driver_iterate( + + bool menu_input_dialog_start_search(void) + { ++ return false; + input_driver_state_t + *input_st = input_state_get_ptr(); + #ifdef HAVE_ACCESSIBILITY diff --git a/package/retroarch/retroarch-0002-add-command-line-hash-option.patch b/package/retroarch/retroarch-0002-add-command-line-hash-option.patch index 8bb45c64de..2144942f95 100644 --- a/package/retroarch/retroarch-0002-add-command-line-hash-option.patch +++ b/package/retroarch/retroarch-0002-add-command-line-hash-option.patch @@ -1,16 +1,24 @@ diff --git a/retroarch.c b/retroarch.c -index d9f0ef0121..a12b3741f9 100644 +index 0f9151d..9d35617 100644 --- a/retroarch.c +++ b/retroarch.c -@@ -34369,6 +34369,7 @@ static void retroarch_print_help(const char *arg0) - - strlcat(buf, " --nick=NICK Picks a username (for use with netplay). " +@@ -273,6 +273,7 @@ enum + RA_OPT_EOF_EXIT, + RA_OPT_LOG_FILE, + RA_OPT_MAX_FRAMES, ++ RA_OPT_HASH, + RA_OPT_MAX_FRAMES_SCREENSHOT, + RA_OPT_MAX_FRAMES_SCREENSHOT_PATH, + RA_OPT_SET_SHADER, +@@ -4185,6 +4186,7 @@ static void retroarch_print_help(const char *arg0) "Not mandatory.\n", sizeof(buf)); -+ puts(" --hash=HASH Force a ROM hash. Not mandatory."); strlcat(buf, " -r, --record=FILE Path to record video file.\n " "Using .mkv extension is recommended.\n", sizeof(buf)); ++ strlcat(buf, " --hash=HASH Force a ROM hash. Not mandatory.", sizeof(buf)); strlcat(buf, " --recordconfig Path to settings used during recording.\n", sizeof(buf)); -@@ -34470,6 +34471,7 @@ static bool retroarch_parse_input_and_config( + strlcat(buf, " --size=WIDTHxHEIGHT\n" + " Overrides output video size when recording.\n", sizeof(buf)); +@@ -4291,6 +4293,7 @@ static bool retroarch_parse_input_and_config( { "ips", 1, NULL, RA_OPT_IPS }, { "no-patch", 0, NULL, RA_OPT_NO_PATCH }, #endif @@ -18,71 +26,60 @@ index d9f0ef0121..a12b3741f9 100644 { "detach", 0, NULL, 'D' }, { "features", 0, NULL, RA_OPT_FEATURES }, { "subsystem", 1, NULL, RA_OPT_SUBSYSTEM }, -@@ -34993,6 +34995,11 @@ static bool retroarch_parse_input_and_config( - } +@@ -4794,7 +4797,10 @@ static bool retroarch_parse_input_and_config( + configuration_set_string(settings, + settings->paths.username, optarg); break; - +- + case RA_OPT_HASH: -+ sscanf(optarg, "%8X", &global->name.hash); -+ RARCH_LOG("Got CRC32 from command line: 0x%x .\n", global->name.hash); ++ sscanf(optarg, "%8X", &runloop_st->name.hash); ++ RARCH_LOG("Got CRC32 from command line: 0x%x .\n", runloop_st->name.hash); + break; -+ case RA_OPT_SIZE: if (sscanf(optarg, "%ux%u", - &p_rarch->recording_width, -diff --git a/retroarch.h b/retroarch.h -index 71a2718572..0b5582928a 100644 ---- a/retroarch.h -+++ b/retroarch.h -@@ -245,6 +245,7 @@ typedef struct global + &recording_st->width, +diff --git a/runloop.h b/runloop.h +index 9883fb6..a281f3f 100644 +--- a/runloop.h ++++ b/runloop.h +@@ -256,6 +256,7 @@ struct runloop char bps[8192]; char ips[8192]; char label[8192]; + uint32_t hash; } name; - /* Recording. */ -diff --git a/retroarch_data.h b/retroarch_data.h -index 673fccf62d..b48918d82e 100644 ---- a/retroarch_data.h -+++ b/retroarch_data.h -@@ -1262,6 +1262,7 @@ enum - RA_OPT_EOF_EXIT, - RA_OPT_LOG_FILE, - RA_OPT_MAX_FRAMES, -+ RA_OPT_HASH, - RA_OPT_MAX_FRAMES_SCREENSHOT, - RA_OPT_MAX_FRAMES_SCREENSHOT_PATH, - RA_OPT_SET_SHADER, + bool is_inited; + diff --git a/tasks/task_content.c b/tasks/task_content.c -index 70306d1..e56e67b 100644 +index 72e3f53..82354af 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c -@@ -718,6 +718,7 @@ static bool content_file_load_into_memory( +@@ -716,6 +716,7 @@ static bool content_file_load_into_memory( *data = NULL; *data_size = 0; -+ global_t *global = global_get_ptr(); ++ runloop_state_t *runloop_st = runloop_state_get_ptr(); - RARCH_LOG("[CONTENT LOAD]: %s: %s\n", + RARCH_LOG("[Content]: %s: \"%s\".\n", msg_hash_to_str(MSG_LOADING_CONTENT_FILE), content_path); -@@ -771,6 +772,7 @@ static bool content_file_load_into_memory( +@@ -769,6 +770,7 @@ static bool content_file_load_into_memory( * actually needed */ if (content_compressed || has_patch) { + p_content->pending_rom_crc = false; p_content->rom_crc = encoding_crc32(0, content_data, (size_t)content_size); - RARCH_LOG("[CONTENT LOAD]: CRC32: 0x%x\n", -@@ -784,7 +786,16 @@ static bool content_file_load_into_memory( + RARCH_LOG("[Content]: CRC32: 0x%x.\n", +@@ -782,7 +784,16 @@ static bool content_file_load_into_memory( } } else - p_content->rom_crc = 0; -+ if(global) { ++ if(runloop_st) { + p_content->pending_rom_crc = false; -+ p_content->rom_crc = global->name.hash; -+ RARCH_LOG("[CONTENT LOAD MEMORY]: Got hash from command line - 0x%X", global->name.hash); ++ p_content->rom_crc = runloop_st->name.hash; ++ RARCH_LOG("[CONTENT LOAD MEMORY]: Got hash from command line - 0x%X", runloop_st->name.hash); + } + else + { @@ -92,27 +89,26 @@ index 70306d1..e56e67b 100644 } *data = content_data; -@@ -972,6 +983,7 @@ static bool content_file_load( +@@ -970,6 +981,7 @@ static bool content_file_load( size_t i; char msg[1024]; retro_ctx_load_content_info_t load_info; -+ global_t *global = global_get_ptr(); ++ runloop_state_t *runloop_st = runloop_state_get_ptr(); bool used_vfs_fallback_copy = false; #ifdef __WINRT__ - rarch_system_info_t *system = runloop_get_system_info(); -@@ -1114,15 +1126,23 @@ static bool content_file_load( - * until value is used */ + rarch_system_info_t *system = &runloop_state_get_ptr()->system; +@@ -1113,14 +1125,23 @@ static bool content_file_load( if (i == 0) { -- /* If we have a media type, ignore CRC32 calculation. */ + /* If we have a media type, ignore CRC32 calculation. */ - if (first_content_type == RARCH_CONTENT_NONE) - { - strlcpy(p_content->pending_rom_crc_path, content_path, - sizeof(p_content->pending_rom_crc_path)); - p_content->pending_rom_crc = true; -+ if(global) { ++ if(runloop_st) { + p_content->pending_rom_crc = false; -+ p_content->rom_crc = global->name.hash; ++ p_content->rom_crc = runloop_st->name.hash; + RARCH_LOG("[CONTENT LOAD FILE] Got CRC32 from command line: 0x%X .\n", (unsigned)p_content->rom_crc); } else @@ -131,11 +127,3 @@ index 70306d1..e56e67b 100644 } } } -@@ -2689,6 +2709,7 @@ uint32_t content_get_crc(void) - RARCH_LOG("[CONTENT LOAD]: CRC32: 0x%x .\n", - (unsigned)p_content->rom_crc); - } -+ RARCH_LOG("Called content_get_crc\n"); - return p_content->rom_crc; - } - diff --git a/package/retroarch/retroarch-0003-mark-frontend-with-@recalbox.patch b/package/retroarch/retroarch-0003-mark-frontend-with-@recalbox.patch index f2e4b7e33b..66374cd71f 100644 --- a/package/retroarch/retroarch-0003-mark-frontend-with-@recalbox.patch +++ b/package/retroarch/retroarch-0003-mark-frontend-with-@recalbox.patch @@ -1,8 +1,8 @@ -diff --git a/retroarch.c b/retroarch.c -index b6730f6..24905bf 100644 ---- a/retroarch.c -+++ b/retroarch.c -@@ -7705,7 +7705,7 @@ static void netplay_announce(struct rarch_state *p_rarch) +diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c +index 2959de4..83f3749 100644 +--- a/network/netplay/netplay_frontend.c ++++ b/network/netplay/netplay_frontend.c +@@ -7168,7 +7168,7 @@ static void netplay_announce(void) frontend_architecture_tmp, sizeof(frontend_architecture_tmp)); snprintf(frontend_architecture, sizeof(frontend_architecture), diff --git a/package/retroarch/retroarch-0005-use-passwords-in-configuration-file.patch b/package/retroarch/retroarch-0005-use-passwords-in-configuration-file.patch index c0f024c937..9220bf45bd 100644 --- a/package/retroarch/retroarch-0005-use-passwords-in-configuration-file.patch +++ b/package/retroarch/retroarch-0005-use-passwords-in-configuration-file.patch @@ -1,8 +1,8 @@ -diff --git a/network/netplay/netplay_handshake.c b/network/netplay/netplay_handshake.c -index 08bb128e98..728536f1f8 100644 ---- a/network/netplay/netplay_handshake.c -+++ b/network/netplay/netplay_handshake.c -@@ -286,8 +286,8 @@ static void handshake_password(void *ignore, const char *line) +diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c +index 83f3749..615a09e 100644 +--- a/network/netplay/netplay_frontend.c ++++ b/network/netplay/netplay_frontend.c +@@ -912,8 +912,8 @@ static void handshake_password(void *ignore, const char *line) netplay_send_flush(&connection->send_packet_buffer, connection->fd, false); #ifdef HAVE_MENU @@ -13,9 +13,9 @@ index 08bb128e98..728536f1f8 100644 #endif } #endif -@@ -407,26 +407,6 @@ bool netplay_handshake_init(netplay_t *netplay, +@@ -1066,25 +1066,6 @@ bool netplay_handshake_init(netplay_t *netplay, + if (!ctrans->compression_stream || !ctrans->decompression_stream) return false; - } - /* If a password is demanded, ask for it */ - if (!netplay->is_server && (connection->salt = ntohl(header[3]))) @@ -25,7 +25,7 @@ index 08bb128e98..728536f1f8 100644 - retroarch_menu_running(); -#endif - -- handshake_password_netplay = netplay; +- net_st->handshake_password = netplay; - -#ifdef HAVE_MENU - memset(&line, 0, sizeof(line)); @@ -36,27 +36,24 @@ index 08bb128e98..728536f1f8 100644 - return false; -#endif - } -- + /* Send our nick */ nick_buf.cmd[0] = htonl(NETPLAY_CMD_NICK); - nick_buf.cmd[1] = htonl(sizeof(nick_buf.nick)); -@@ -441,6 +421,19 @@ bool netplay_handshake_init(netplay_t *netplay, +@@ -1100,6 +1081,17 @@ bool netplay_handshake_init(netplay_t *netplay, connection->mode = NETPLAY_CONNECTION_PRE_NICK; *had_input = true; netplay_recv_flush(&connection->recv_packet_buffer); -+ + /* If a password is demanded, ask for it */ + if (!netplay->is_server && (connection->salt = ntohl(header[3]))) + { -+ handshake_password_netplay = netplay; ++ net_st->handshake_password = netplay; + -+ settings_t *settings = config_get_ptr(); -+ const char* password = (settings->bools.netplay_start_as_spectator) ? -+ settings->paths.netplay_spectate_password : settings->paths.netplay_password; -+ handshake_password(NULL, password); -+ netplay_recv_flush(&connection->recv_packet_buffer); ++ settings_t *settings = config_get_ptr(); ++ const char* password = (settings->bools.netplay_start_as_spectator) ? ++ settings->paths.netplay_spectate_password : settings->paths.netplay_password; ++ handshake_password(NULL, password); ++ netplay_recv_flush(&connection->recv_packet_buffer); + } -+ return true; error: diff --git a/package/retroarch/retroarch-0006-fix-min-max-udev-mouse-lightgun.patch b/package/retroarch/retroarch-0006-fix-min-max-udev-mouse-lightgun.patch index be522e2a34..9cdc439e13 100644 --- a/package/retroarch/retroarch-0006-fix-min-max-udev-mouse-lightgun.patch +++ b/package/retroarch/retroarch-0006-fix-min-max-udev-mouse-lightgun.patch @@ -1,73 +1,41 @@ -From 273956fbfc73806cbff59291e4c3954d1185af7f Mon Sep 17 00:00:00 2001 -From: Bozo the geek -Date: Sat, 11 Sep 2021 19:19:11 +0200 -Subject: [PATCH] fix(udev): max/min calculation reworked for lightgun/mouse/touchscreen ---- - input/drivers/udev_input.c | 39 +++++++++++++++++++++++++++++++++----- - 1 file changed, 34 insertions(+), 5 deletions(-) - diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c -index 979425f69c3..f65ca5d4a57 100644 +index 36c1463..861248b 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c -@@ -501,7 +501,7 @@ static int udev_input_add_device(udev_input_t *udev, - udev_input_device_t *device = NULL; - - memset(keycaps, '\0', sizeof (keycaps)); -- memset(keycaps, '\0', sizeof (abscaps)); -+ memset(abscaps, '\0', sizeof (abscaps)); - - st.st_dev = 0; - -@@ -547,7 +547,6 @@ static int udev_input_add_device(udev_input_t *udev, - - if (has_absolutes) - { -- struct input_absinfo absinfo; - if (ioctl(fd, EVIOCGABS(ABS_X), &absinfo) == -1) - return 0; - device->mouse.x_min = absinfo.minimum; -@@ -556,9 +555,39 @@ static int udev_input_add_device(udev_input_t *udev, - if (ioctl(fd, EVIOCGABS(ABS_Y), &absinfo) == -1) - return 0; - device->mouse.y_min = absinfo.minimum; -- device->mouse.y_max = absinfo.maximum; -- } -- -+ device->mouse.y_max = absinfo.maximum; -+ } -+ else -+ { -+ if (ioctl(fd, EVIOCGABS(ABS_X), &absinfo) >= 0) -+ { -+ if (absinfo.minimum >= absinfo.maximum ) -+ { -+ device->mouse.x_min = -1; -+ device->mouse.x_max = -1; -+ } -+ else -+ { -+ device->mouse.x_min = absinfo.minimum; -+ device->mouse.x_max = absinfo.maximum; -+ } -+ } +@@ -626,6 +626,36 @@ static int udev_input_add_device(udev_input_t *udev, + device->mouse.y_min = absinfo.minimum; + device->mouse.y_max = absinfo.maximum; + } ++ else ++ { ++ if (ioctl(fd, EVIOCGABS(ABS_X), &absinfo) >= 0) ++ { ++ if (absinfo.minimum >= absinfo.maximum ) ++ { ++ device->mouse.x_min = -1; ++ device->mouse.x_max = -1; ++ } ++ else ++ { ++ device->mouse.x_min = absinfo.minimum; ++ device->mouse.x_max = absinfo.maximum; ++ } ++ } + -+ if (ioctl(fd, EVIOCGABS(ABS_Y), &absinfo) >= 0) -+ { -+ if (absinfo.minimum >= absinfo.maximum ) -+ { -+ device->mouse.y_min = -1; -+ device->mouse.y_max = -1; -+ } -+ else -+ { -+ device->mouse.y_min = absinfo.minimum; -+ device->mouse.y_max = absinfo.maximum; -+ } -+ } -+ } -+ - } ++ if (ioctl(fd, EVIOCGABS(ABS_Y), &absinfo) >= 0) ++ { ++ if (absinfo.minimum >= absinfo.maximum ) ++ { ++ device->mouse.y_min = -1; ++ device->mouse.y_max = -1; ++ } ++ else ++ { ++ device->mouse.y_min = absinfo.minimum; ++ device->mouse.y_max = absinfo.maximum; ++ } ++ } ++ } - tmp = ( udev_input_device_t**)realloc(udev->devices, - + if (!mouse) + goto end; diff --git a/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch b/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch index 10743c5674..e0e70a051b 100644 --- a/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch +++ b/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch @@ -119,63 +119,25 @@ index ec394ef..7f2e84c 100644 unsigned full_width; unsigned full_height; } video_viewport_t; -diff --git a/retroarch.c b/retroarch.c -index dd3c488..4e0ea82 100644 ---- a/retroarch.c -+++ b/retroarch.c -@@ -30080,9 +30080,38 @@ static bool video_driver_init_internal( - /* Update CUSTOM viewport. */ - custom_vp = &settings->video_viewport_custom; -+ float core_fps = settings->floats.video_refresh_rate; -+ - if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) - { - float default_aspect = aspectratio_lut[ASPECT_RATIO_CORE].value; -+ if(core_fps > 0.1f) -+ { -+ if(abs(60 - core_fps) < abs(50 - core_fps)) -+ { -+ // NTSC -+ if(custom_vp->height_ntsc > 0) -+ custom_vp->height = custom_vp->height_ntsc; -+ if(custom_vp->y_ntsc > 0) -+ custom_vp->y = custom_vp->y_ntsc; -+ if(custom_vp->width_ntsc > 0) -+ custom_vp->width = custom_vp->width_ntsc; -+ if(custom_vp->x_ntsc > 0) -+ custom_vp->x = custom_vp->x_ntsc; -+ } -+ else -+ { -+ // PAL -+ if(custom_vp->height_pal > 0) -+ custom_vp->height = custom_vp->height_pal; -+ if(custom_vp->y_pal > 0) -+ custom_vp->y = custom_vp->y_pal; -+ if(custom_vp->width_pal > 0) -+ custom_vp->width = custom_vp->width_pal; -+ if(custom_vp->x_pal > 0) -+ custom_vp->x = custom_vp->x_pal; -+ } -+ } - aspectratio_lut[ASPECT_RATIO_CUSTOM].value = - (custom_vp->width && custom_vp->height) ? - (float)custom_vp->width / custom_vp->height : default_aspect; -@@ -32999,6 +33028,8 @@ static void drivers_init(struct rarch_state *p_rarch, - #endif - bool video_is_threaded = VIDEO_DRIVER_IS_THREADED_INTERNAL(); - gfx_display_t *p_disp = &p_rarch->dispgfx; -+ struct retro_game_geometry *geom = &p_rarch->video_driver_av_info.geometry; -+ +diff --git a/driver.c b/driver.c +index 99e8cfb..e1624ea 100644 +--- a/driver.c ++++ b/driver.c +@@ -440,6 +440,7 @@ void drivers_init( + *location_st = location_state_get_ptr(); + bool video_is_threaded = VIDEO_DRIVER_IS_THREADED_INTERNAL(video_st); + gfx_display_t *p_disp = disp_get_ptr(); ++ struct retro_game_geometry *geom = &video_st->av_info.geometry; #if defined(HAVE_GFX_WIDGETS) bool video_font_enable = settings->bools.video_font_enable; bool menu_enable_widgets = settings->bools.menu_enable_widgets; -@@ -33013,6 +33044,47 @@ static void drivers_init(struct rarch_state *p_rarch, +@@ -453,7 +454,46 @@ void drivers_init( + if (menu_st) menu_st->data_own = true; #endif - -+ double core_fps = p_rarch->video_driver_av_info.timing.fps; +- ++ double core_fps = video_st->av_info.timing.fps; + + if (!string_is_empty(settings->arrays.crt_switch_timings_pal)|| + !string_is_empty(settings->arrays.crt_switch_timings_ntsc)|| @@ -185,8 +147,8 @@ index dd3c488..4e0ea82 100644 + geom->base_width, + geom->base_height, + geom->aspect_ratio, -+ p_rarch->video_driver_av_info.timing.fps, -+ runloop_state.system.rotation); ++ core_fps, ++ runloop_st->system.rotation); + if(core_fps > 0.0) + { + // We should override core fps with configuration ones. @@ -210,12 +172,54 @@ index dd3c488..4e0ea82 100644 + } + } + settings->floats.video_scale = 1; -+ if(runloop_state.system.rotation == 1){ -+ RARCH_LOG("[Video]: setting rotation %u\n", runloop_state.system.rotation); ++ if(runloop_st->system.rotation == 1){ ++ RARCH_LOG("[Video]: setting rotation %u\n", runloop_st->system.rotation); + //rotation = runloop_state.system.rotation; + } + } -+ if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK)) - driver_adjust_system_rates(p_rarch, + driver_adjust_system_rates( settings->bools.vrr_runloop_enable, +diff --git a/gfx/video_driver.c b/gfx/video_driver.c +index c5f974a..c80c51d 100644 +--- a/gfx/video_driver.c ++++ b/gfx/video_driver.c +@@ -3272,10 +3272,38 @@ bool video_driver_init_internal(bool *video_is_threaded, bool verbosity_enabled) + + /* Update CUSTOM viewport. */ + custom_vp = &settings->video_viewport_custom; ++ float core_fps = settings->floats.video_refresh_rate; + + if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) + { + float default_aspect = aspectratio_lut[ASPECT_RATIO_CORE].value; ++ if(core_fps > 0.1f) ++ { ++ if(abs(60 - core_fps) < abs(50 - core_fps)) ++ { ++ // NTSC ++ if(custom_vp->height_ntsc > 0) ++ custom_vp->height = custom_vp->height_ntsc; ++ if(custom_vp->y_ntsc > 0) ++ custom_vp->y = custom_vp->y_ntsc; ++ if(custom_vp->width_ntsc > 0) ++ custom_vp->width = custom_vp->width_ntsc; ++ if(custom_vp->x_ntsc > 0) ++ custom_vp->x = custom_vp->x_ntsc; ++ } ++ else ++ { ++ // PAL ++ if(custom_vp->height_pal > 0) ++ custom_vp->height = custom_vp->height_pal; ++ if(custom_vp->y_pal > 0) ++ custom_vp->y = custom_vp->y_pal; ++ if(custom_vp->width_pal > 0) ++ custom_vp->width = custom_vp->width_pal; ++ if(custom_vp->x_pal > 0) ++ custom_vp->x = custom_vp->x_pal; ++ } ++ } + aspectratio_lut[ASPECT_RATIO_CUSTOM].value = + (custom_vp->width && custom_vp->height) ? + (float)custom_vp->width / custom_vp->height : default_aspect; diff --git a/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch.old b/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch.old new file mode 100644 index 0000000000..10743c5674 --- /dev/null +++ b/package/retroarch/retroarch-0010-crt-switch-timings-ntsc-pal-support.patch.old @@ -0,0 +1,221 @@ +diff --git a/configuration.c b/configuration.c +index a8424fb..2b502f1 100644 +--- a/configuration.c ++++ b/configuration.c +@@ -1312,6 +1312,8 @@ static struct config_array_setting *populate_settings_array(settings_t *settings + SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, DEFAULT_DISCORD_APP_ID, true); + SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, DEFAULT_AI_SERVICE_URL, true); + SETTING_ARRAY("crt_switch_timings", settings->arrays.crt_switch_timings, false, NULL, true); ++ SETTING_ARRAY("crt_switch_timings_pal", settings->arrays.crt_switch_timings_pal, false, NULL, true); ++ SETTING_ARRAY("crt_switch_timings_ntsc", settings->arrays.crt_switch_timings_ntsc, false, NULL, true); + #ifdef HAVE_LAKKA + SETTING_ARRAY("cpu_main_gov", settings->arrays.cpu_main_gov, false, NULL, true); + SETTING_ARRAY("cpu_menu_gov", settings->arrays.cpu_menu_gov, false, NULL, true); +@@ -1897,6 +1899,8 @@ static struct config_float_setting *populate_settings_float( + SETTING_FLOAT("video_scale", &settings->floats.video_scale, false, 0.0f, false); + SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, DEFAULT_CRT_REFRESH_RATE, false); + SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, DEFAULT_REFRESH_RATE, false); ++ SETTING_FLOAT("video_refresh_rate_pal", &settings->floats.video_refresh_rate_pal, true, 50, false); ++ SETTING_FLOAT("video_refresh_rate_ntsc", &settings->floats.video_refresh_rate_ntsc, true, DEFAULT_REFRESH_RATE, false); + SETTING_FLOAT("audio_rate_control_delta", audio_get_float_ptr(AUDIO_ACTION_RATE_CONTROL_DELTA), true, DEFAULT_RATE_CONTROL_DELTA, false); + SETTING_FLOAT("audio_max_timing_skew", &settings->floats.audio_max_timing_skew, true, DEFAULT_MAX_TIMING_SKEW, false); + SETTING_FLOAT("audio_volume", &settings->floats.audio_volume, true, DEFAULT_AUDIO_VOLUME, false); +@@ -2073,10 +2077,18 @@ static struct config_uint_setting *populate_settings_uint( + #endif + SETTING_UINT("audio_out_rate", &settings->uints.audio_output_sample_rate, true, DEFAULT_OUTPUT_RATE, false); + SETTING_UINT("custom_viewport_width", &settings->video_viewport_custom.width, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_width_ntsc", &settings->video_viewport_custom.width_ntsc, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_width_pal", &settings->video_viewport_custom.width_pal, false, 0 /* TODO */, false); + SETTING_UINT("crt_switch_resolution_super", &settings->uints.crt_switch_resolution_super, true, DEFAULT_CRT_SWITCH_RESOLUTION_SUPER, false); + SETTING_UINT("custom_viewport_height", &settings->video_viewport_custom.height, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_height_ntsc", &settings->video_viewport_custom.height_ntsc, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_height_pal", &settings->video_viewport_custom.height_pal, false, 0 /* TODO */, false); + SETTING_UINT("custom_viewport_x", (unsigned*)&settings->video_viewport_custom.x, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_x_ntsc", (unsigned*)&settings->video_viewport_custom.x_ntsc, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_x_pal", (unsigned*)&settings->video_viewport_custom.x_pal, false, 0 /* TODO */, false); + SETTING_UINT("custom_viewport_y", (unsigned*)&settings->video_viewport_custom.y, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_y_ntsc", (unsigned*)&settings->video_viewport_custom.y_ntsc, false, 0 /* TODO */, false); ++ SETTING_UINT("custom_viewport_y_pal", (unsigned*)&settings->video_viewport_custom.y_pal, false, 0 /* TODO */, false); + SETTING_UINT("content_history_size", &settings->uints.content_history_size, true, default_content_history_size, false); + SETTING_UINT("video_hard_sync_frames", &settings->uints.video_hard_sync_frames, true, DEFAULT_HARD_SYNC_FRAMES, false); + SETTING_UINT("video_frame_delay", &settings->uints.video_frame_delay, true, DEFAULT_FRAME_DELAY, false); +diff --git a/configuration.h b/configuration.h +index cfac5c8..f3b442f 100644 +--- a/configuration.h ++++ b/configuration.h +@@ -309,6 +309,8 @@ typedef struct settings + float video_scale; + float video_aspect_ratio; + float video_refresh_rate; ++ float video_refresh_rate_pal; ++ float video_refresh_rate_ntsc; + float crt_video_refresh_rate; + float video_font_size; + float video_msg_pos_x; +@@ -398,6 +400,8 @@ typedef struct settings + char ai_service_url[PATH_MAX_LENGTH]; + + char crt_switch_timings[255]; ++ char crt_switch_timings_pal[255]; ++ char crt_switch_timings_ntsc[255]; + #ifdef HAVE_LAKKA + char timezone[TIMEZONE_LENGTH]; + char cpu_main_gov[32]; +diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c +index 182d0b4..74df96b 100644 +--- a/gfx/drivers_context/drm_ctx.c ++++ b/gfx/drivers_context/drm_ctx.c +@@ -124,8 +124,31 @@ bool gfx_ctx_drm_load_mode(drmModeModeInfoPtr modeInfo) + int ret; + hdmi_timings_t timings; + settings_t *settings = config_get_ptr(); ++ float current_fps = settings->floats.video_refresh_rate; ++ char *crt_switch_timings_pal = settings->arrays.crt_switch_timings_pal; ++ char *crt_switch_timings_ntsc = settings->arrays.crt_switch_timings_ntsc; + char *crt_switch_timings = settings->arrays.crt_switch_timings; + ++ if(current_fps > 0.1f) ++ { ++ if(abs(60 - current_fps) < abs(50 - current_fps)) ++ { ++ if(!string_is_empty(crt_switch_timings_ntsc)) ++ { ++ RARCH_LOG("[DRM]: selected crt_switch_timings_ntsc\n"); ++ crt_switch_timings = crt_switch_timings_ntsc; ++ } ++ } ++ else ++ { ++ if(!string_is_empty(crt_switch_timings_pal)) ++ { ++ RARCH_LOG("[DRM]: selected crt_switch_timings_pal\n"); ++ crt_switch_timings = crt_switch_timings_pal; ++ } ++ } ++ } ++ + if(modeInfo != NULL && !string_is_empty(crt_switch_timings)) { + ret = sscanf(crt_switch_timings, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + &timings.h_active_pixels, &timings.h_sync_polarity, &timings.h_front_porch, +diff --git a/gfx/video_defines.h b/gfx/video_defines.h +index ec394ef..7f2e84c 100644 +--- a/gfx/video_defines.h ++++ b/gfx/video_defines.h +@@ -144,9 +144,17 @@ enum text_alignment + typedef struct video_viewport + { + int x; ++ int x_ntsc; ++ int x_pal; + int y; ++ int y_ntsc; ++ int y_pal; + unsigned width; ++ unsigned width_ntsc; ++ unsigned width_pal; + unsigned height; ++ unsigned height_ntsc; ++ unsigned height_pal; + unsigned full_width; + unsigned full_height; + } video_viewport_t; +diff --git a/retroarch.c b/retroarch.c +index dd3c488..4e0ea82 100644 +--- a/retroarch.c ++++ b/retroarch.c +@@ -30080,9 +30080,38 @@ static bool video_driver_init_internal( + /* Update CUSTOM viewport. */ + custom_vp = &settings->video_viewport_custom; + ++ float core_fps = settings->floats.video_refresh_rate; ++ + if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) + { + float default_aspect = aspectratio_lut[ASPECT_RATIO_CORE].value; ++ if(core_fps > 0.1f) ++ { ++ if(abs(60 - core_fps) < abs(50 - core_fps)) ++ { ++ // NTSC ++ if(custom_vp->height_ntsc > 0) ++ custom_vp->height = custom_vp->height_ntsc; ++ if(custom_vp->y_ntsc > 0) ++ custom_vp->y = custom_vp->y_ntsc; ++ if(custom_vp->width_ntsc > 0) ++ custom_vp->width = custom_vp->width_ntsc; ++ if(custom_vp->x_ntsc > 0) ++ custom_vp->x = custom_vp->x_ntsc; ++ } ++ else ++ { ++ // PAL ++ if(custom_vp->height_pal > 0) ++ custom_vp->height = custom_vp->height_pal; ++ if(custom_vp->y_pal > 0) ++ custom_vp->y = custom_vp->y_pal; ++ if(custom_vp->width_pal > 0) ++ custom_vp->width = custom_vp->width_pal; ++ if(custom_vp->x_pal > 0) ++ custom_vp->x = custom_vp->x_pal; ++ } ++ } + aspectratio_lut[ASPECT_RATIO_CUSTOM].value = + (custom_vp->width && custom_vp->height) ? + (float)custom_vp->width / custom_vp->height : default_aspect; +@@ -32999,6 +33028,8 @@ static void drivers_init(struct rarch_state *p_rarch, + #endif + bool video_is_threaded = VIDEO_DRIVER_IS_THREADED_INTERNAL(); + gfx_display_t *p_disp = &p_rarch->dispgfx; ++ struct retro_game_geometry *geom = &p_rarch->video_driver_av_info.geometry; ++ + #if defined(HAVE_GFX_WIDGETS) + bool video_font_enable = settings->bools.video_font_enable; + bool menu_enable_widgets = settings->bools.menu_enable_widgets; +@@ -33013,6 +33044,47 @@ static void drivers_init(struct rarch_state *p_rarch, + menu_st->data_own = true; + #endif + ++ double core_fps = p_rarch->video_driver_av_info.timing.fps; ++ ++ if (!string_is_empty(settings->arrays.crt_switch_timings_pal)|| ++ !string_is_empty(settings->arrays.crt_switch_timings_ntsc)|| ++ !string_is_empty(settings->arrays.crt_switch_timings)) ++ { ++ RARCH_LOG("[Video]: NATIVE Core provided resolution @ %ux%u, aspect ratio %f, framerate %f, rotation: %u\n", ++ geom->base_width, ++ geom->base_height, ++ geom->aspect_ratio, ++ p_rarch->video_driver_av_info.timing.fps, ++ runloop_state.system.rotation); ++ if(core_fps > 0.0) ++ { ++ // We should override core fps with configuration ones. ++ if(abs(60 - core_fps) < abs(50 - core_fps)) ++ { ++ // We are NTSC ++ if(settings->floats.video_refresh_rate_ntsc > 0.1) ++ { ++ settings->floats.video_refresh_rate = settings->floats.video_refresh_rate_ntsc; ++ RARCH_LOG("[Video]: Setting video_refresh_rate from config value NTSC: %f\n", settings->floats.video_refresh_rate_ntsc); ++ } ++ } ++ else ++ { ++ // We are PAL ++ if(settings->floats.video_refresh_rate_pal > 0.1) ++ { ++ settings->floats.video_refresh_rate = settings->floats.video_refresh_rate_pal; ++ RARCH_LOG("[Video]: Setting video_refresh_rate from config value PAL: %f\n", settings->floats.video_refresh_rate_pal); ++ } ++ } ++ } ++ settings->floats.video_scale = 1; ++ if(runloop_state.system.rotation == 1){ ++ RARCH_LOG("[Video]: setting rotation %u\n", runloop_state.system.rotation); ++ //rotation = runloop_state.system.rotation; ++ } ++ } ++ + if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK)) + driver_adjust_system_rates(p_rarch, + settings->bools.vrr_runloop_enable, diff --git a/package/retroarch/retroarch-0011-aspect-ratio-core-crt-1920.patch b/package/retroarch/retroarch-0011-aspect-ratio-core-crt-1920.patch index dd6a134e68..b645d89e84 100644 --- a/package/retroarch/retroarch-0011-aspect-ratio-core-crt-1920.patch +++ b/package/retroarch/retroarch-0011-aspect-ratio-core-crt-1920.patch @@ -10,26 +10,26 @@ index 38f8b58..7f2e84c 100644 ASPECT_RATIO_END }; -diff --git a/retroarch.c b/retroarch.c -index 152812c..73c8bb0 100644 ---- a/retroarch.c -+++ b/retroarch.c -@@ -30835,10 +30835,17 @@ void video_driver_set_viewport_core(void) + +diff --git a/gfx/video_driver.c b/gfx/video_driver.c +index 69baa26..9b8a72a 100644 +--- a/gfx/video_driver.c ++++ b/gfx/video_driver.c +@@ -2025,10 +2025,17 @@ void video_driver_set_viewport_core(void) /* Fallback to 1:1 pixel ratio if none provided */ if (geom->aspect_ratio > 0.0f) + { aspectratio_lut[ASPECT_RATIO_CORE].value = geom->aspect_ratio; -- else + aspectratio_lut[ASPECT_RATIO_CORE_CRT_1920].value = geom->aspect_ratio * 6; + } -+ else { + else ++ { aspectratio_lut[ASPECT_RATIO_CORE].value = (float)geom->base_width / geom->base_height; + aspectratio_lut[ASPECT_RATIO_CORE_CRT_1920].value = + 6 * (float)geom->base_width / geom->base_height; + } -+ } - void video_driver_set_viewport_full(void) + void video_driver_set_rgba(void) diff --git a/package/retroarch/retroarch.mk b/package/retroarch/retroarch.mk index 6be1fbdc5a..5017b1318f 100644 --- a/package/retroarch/retroarch.mk +++ b/package/retroarch/retroarch.mk @@ -4,8 +4,8 @@ # ################################################################################ -# Version 1.9.8 -RETROARCH_VERSION = v1.9.8 +# Version 1.9.14 +RETROARCH_VERSION = v1.9.14 RETROARCH_SITE = git://github.com/libretro/RetroArch.git RETROARCH_SITE_METHOD = git RETROARCH_LICENSE = GPLv3+ @@ -257,3 +257,12 @@ RETROARCH_LIBRETRO_BOARD=$(RECALBOX_SYSTEM_PLATFORM) else RETROARCH_LIBRETRO_BOARD=$(RETROARCH_LIBRETRO_PLATFORM) endif + +# Hack to patch the CRLF files +define RETROARCH_CRLF_PATH + sed -i -E -e "s|\r$$||g" $(@D)/runloop.h + sed -i -E -e "s|\r$$||g" $(@D)/gfx/video_driver.c + sed -i -E -e "s|\r$$||g" $(@D)/driver.c +endef + +RETROARCH_PRE_PATCH_HOOKS += RETROARCH_CRLF_PATH -- GitLab From 21f75d9e4c87490d54608316d3c039c9d81cfaa9 Mon Sep 17 00:00:00 2001 From: Akkeoss Date: Wed, 5 Jan 2022 14:31:38 +0100 Subject: [PATCH 2/4] feat(retroarch): bump retroarch assets --- package/retroarch-assets/retroarch-assets.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/retroarch-assets/retroarch-assets.mk b/package/retroarch-assets/retroarch-assets.mk index 3df9562d29..d0706a0891 100644 --- a/package/retroarch-assets/retroarch-assets.mk +++ b/package/retroarch-assets/retroarch-assets.mk @@ -4,7 +4,8 @@ # ################################################################################ -RETROARCH_ASSETS_VERSION = 8d114dd55b0a357efec12d34d02dfe190a6ccc3a +#Commit of version 27/10/2021 +RETROARCH_ASSETS_VERSION = 9c22505bed22370d4b81d10429afc9e0d6cc11ff RETROARCH_ASSETS_SITE = $(call github,libretro,retroarch-assets,$(RETROARCH_ASSETS_VERSION)) RETROARCH_ASSETS_LICENSE = GPL RETROARCH_ASSETS_DEPENDENCIES = retroarch -- GitLab From c469bd1693ae9d163ae590625fad35168473aa22 Mon Sep 17 00:00:00 2001 From: digitalLumberjack Date: Thu, 17 Feb 2022 20:28:20 +0100 Subject: [PATCH 3/4] feat(featureflipping): add a global.experimental flag in recalbox.conf - feature flip the features to test with this flag (in es, configgen, retroarch) - is automatically enabled when we are not on stable updates.type --- ...-configuration-recalbox-experimental.patch | 37 +++++++++++++++++++ projects/configgen/configgen/Emulator.py | 9 +++++ .../generators/libretro/libretroRetroarch.py | 3 ++ 3 files changed, 49 insertions(+) create mode 100644 package/retroarch/retroarch-0012-configuration-recalbox-experimental.patch diff --git a/package/retroarch/retroarch-0012-configuration-recalbox-experimental.patch b/package/retroarch/retroarch-0012-configuration-recalbox-experimental.patch new file mode 100644 index 0000000000..5bee162c9d --- /dev/null +++ b/package/retroarch/retroarch-0012-configuration-recalbox-experimental.patch @@ -0,0 +1,37 @@ +diff --git a/config.def.h b/config.def.h +index e00827f..45e51de 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -1615,6 +1615,8 @@ static const bool enable_device_vibration = false; + + #define DEFAULT_AI_SERVICE_URL "http://localhost:4404/" + ++#define DEFAULT_RECALBOX_EXPERIMENTAL false ++ + #if defined(HAVE_FFMPEG) || defined(HAVE_MPV) + #define DEFAULT_BUILTIN_MEDIAPLAYER_ENABLE true + #else +diff --git a/configuration.c b/configuration.c +index 1f7ede8..92cb875 100644 +--- a/configuration.c ++++ b/configuration.c +@@ -1995,6 +1995,7 @@ static struct config_bool_setting *populate_settings_bool( + SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, true, DEFAULT_AI_SERVICE_ENABLE, false); + SETTING_BOOL("ai_service_pause", &settings->bools.ai_service_pause, true, DEFAULT_AI_SERVICE_PAUSE, false); + SETTING_BOOL("wifi_enabled", &settings->bools.wifi_enabled, true, DEFAULT_WIFI_ENABLE, false); ++ SETTING_BOOL("recalbox_experimental", &settings->bools.recalbox_experimental, true, DEFAULT_RECALBOX_EXPERIMENTAL, false); + + *size = count; + +diff --git a/configuration.h b/configuration.h +index f8d7fef..9b0de83 100644 +--- a/configuration.h ++++ b/configuration.h +@@ -909,6 +909,7 @@ typedef struct settings + + bool ai_service_enable; + bool ai_service_pause; ++ bool recalbox_experimental; + } bools; + + } settings_t; diff --git a/projects/configgen/configgen/Emulator.py b/projects/configgen/configgen/Emulator.py index 520766ae10..7d0c9bb3b4 100644 --- a/projects/configgen/configgen/Emulator.py +++ b/projects/configgen/configgen/Emulator.py @@ -63,6 +63,8 @@ class Emulator: self._retroachievementsHardcore: bool = False self._retroachievementsNickname: str = "" self._retroachievementsPassword: str = "" + self._recalboxexperimental: str = "" + self._updatestype : str = "stable" # Vars from arguments self._hash: str = "default" @@ -129,6 +131,9 @@ class Emulator: self._retroachievementsHardcore = recalboxOptions.getBool('global.retroachievements.hardcore', self._retroachievementsHardcore) self._retroachievementsNickname = recalboxOptions.getString('global.retroachievements.username', self._retroachievementsNickname) self._retroachievementsPassword = recalboxOptions.getString('global.retroachievements.password', self._retroachievementsPassword) + self._recalboxexperimental = recalboxOptions.getString('global.experimental', self._recalboxexperimental) + self._updatestype = recalboxOptions.getString('updates.type', self._updatestype) + # Vars from arguments self._hash = arguments.hash @@ -323,3 +328,7 @@ class Emulator: @property def CRTViewportWidth(self) -> int: return self._crtviewportwidth + + @property + def RecalboxExperimental(self) -> bool: + return self._recalboxexperimental == "1" or (self._recalboxexperimental == "" and self._updatestype != "stable") diff --git a/projects/configgen/configgen/generators/libretro/libretroRetroarch.py b/projects/configgen/configgen/generators/libretro/libretroRetroarch.py index 76857236a0..1e844ef916 100755 --- a/projects/configgen/configgen/generators/libretro/libretroRetroarch.py +++ b/projects/configgen/configgen/generators/libretro/libretroRetroarch.py @@ -332,3 +332,6 @@ class LibretroRetroarch: # Netplay passwords settings.setString("netplay_password", '"' + self.system.NetplayPlayerPassword + '"') \ .setString("netplay_spectate_password", '"' + self.system.NetplayViewerPassword + '"') + + # Experimental features + settings.setBool("recalbox_experimental", self.system.RecalboxExperimental) \ No newline at end of file -- GitLab From d176421a98ce53da94d5ba047d5677a551d83890 Mon Sep 17 00:00:00 2001 From: digitalLumberjack Date: Thu, 17 Feb 2022 20:29:44 +0100 Subject: [PATCH 4/4] feat(retroarch): the kms mode selection now depends on the framerate returned by the core --- RELEASE-NOTES.md | 1 + ...-refresh-rate-for-kms-mode-selection.patch | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 package/retroarch/retroarch-0013-use-core-refresh-rate-for-kms-mode-selection.patch diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 6c7fa843db..ccceae491c 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -7,6 +7,7 @@ as release notes for end user on a Recalbox upgrade. ## Version 8.1-Electron ### News +- Experimental: select the video mode refresh rate (60Hz, 50Hz) depending on the game region - Retroach has been bumped to 1.9.14 - Add delete game options - Add core libretro vitaquake2 for x64 diff --git a/package/retroarch/retroarch-0013-use-core-refresh-rate-for-kms-mode-selection.patch b/package/retroarch/retroarch-0013-use-core-refresh-rate-for-kms-mode-selection.patch new file mode 100644 index 0000000000..2afc77495a --- /dev/null +++ b/package/retroarch/retroarch-0013-use-core-refresh-rate-for-kms-mode-selection.patch @@ -0,0 +1,26 @@ +diff --git a/driver.c b/driver.c +index 350bacb..5d26c1a 100644 +--- a/driver.c ++++ b/driver.c +@@ -493,6 +493,8 @@ void drivers_init( + RARCH_LOG("[Video]: setting rotation %u\n", runloop_st->system.rotation); + //rotation = runloop_state.system.rotation; + } ++ } else if(core_fps > 0.0 && settings->bools.recalbox_experimental) { ++ settings->floats.video_refresh_rate = core_fps; + } + if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK)) + driver_adjust_system_rates( +diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c +index 427edb2..62f3c53 100644 +--- a/gfx/drivers_context/drm_ctx.c ++++ b/gfx/drivers_context/drm_ctx.c +@@ -785,6 +785,8 @@ static bool gfx_ctx_drm_set_video_mode(void *data, + goto error; + } + ++ RARCH_LOG("[KMS]: Mode selected : (%s), %f Hz\n", g_drm_mode->name, drm_calc_refresh_rate(g_drm_mode)); ++ + drm->fb_width = g_drm_mode->hdisplay; + drm->fb_height = g_drm_mode->vdisplay; + -- GitLab