diff --git a/config.def.h b/config.def.h index 56999e908e..b8eda46cb7 100644 --- a/config.def.h +++ b/config.def.h @@ -225,6 +225,9 @@ #define DEFAULT_FULLSCREEN_Y 0 #endif +/* Force 4k resolution */ +#define DEFAULT_FORCE_RESOLUTION false + /* Number of threads to use for video recording */ #define DEFAULT_VIDEO_RECORD_THREADS 2 diff --git a/configuration.c b/configuration.c index f27376525b..6f5b5b7a73 100644 --- a/configuration.c +++ b/configuration.c @@ -1486,6 +1486,9 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("auto_screenshot_filename", &settings->bools.auto_screenshot_filename, true, DEFAULT_AUTO_SCREENSHOT_FILENAME, false); SETTING_BOOL("video_force_srgb_disable", &settings->bools.video_force_srgb_disable, true, false, false); SETTING_BOOL("video_fullscreen", &settings->bools.video_fullscreen, true, DEFAULT_FULLSCREEN, false); +#ifdef __WINRT__ + SETTING_BOOL("video_force_resolution", &settings->bools.video_force_resolution, true, DEFAULT_FORCE_RESOLUTION, false); +#endif SETTING_BOOL("bundle_assets_extract_enable", &settings->bools.bundle_assets_extract_enable, true, DEFAULT_BUNDLE_ASSETS_EXTRACT_ENABLE, false); SETTING_BOOL("video_vsync", &settings->bools.video_vsync, true, DEFAULT_VSYNC, false); SETTING_BOOL("video_adaptive_vsync", &settings->bools.video_adaptive_vsync, true, DEFAULT_ADAPTIVE_VSYNC, false); diff --git a/configuration.h b/configuration.h index e03455679b..f3eb071728 100644 --- a/configuration.h +++ b/configuration.h @@ -501,6 +501,7 @@ typedef struct settings #ifdef HAVE_VIDEO_LAYOUT bool video_layout_enable; #endif + bool video_force_resolution; /* Accessibility */ bool accessibility_enable; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index dca4d8c9ce..4a607dd338 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -3482,6 +3482,10 @@ MSG_HASH( MENU_ENUM_LABEL_VIDEO_FULLSCREEN_Y, "video_fullscreen_y" ) +MSG_HASH( + MENU_ENUM_LABEL_VIDEO_FORCE_RESOLUTION, + "video_force_resolution" +) MSG_HASH( MENU_ENUM_LABEL_VIDEO_LAYOUT_ENABLE, "video_layout_enable" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 4c354ac29c..1db78e906a 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1561,6 +1561,14 @@ MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_Y, "Set the custom height size for the non-windowed fullscreen mode. Leaving it unset will use the desktop resolution." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_RESOLUTION, + "Force resolution on UWP" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_VIDEO_FORCE_RESOLUTION, + "Force the resolution to the fullscreen size, if set to 0, a fixed value of 3840 x 2160 will be used." + ) /* Settings > Video > Windowed Mode */ diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 4193cfe8d3..acaab17590 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -428,6 +428,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_width, MENU_ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_height, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_fullscreen_x, MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_X) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_fullscreen_y, MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_Y) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_force_resolution, MENU_ENUM_SUBLABEL_VIDEO_FORCE_RESOLUTION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_save_window_position, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_SAVE_POSITION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_message_pos_x, MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_X) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_message_pos_y, MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_Y) @@ -3234,6 +3235,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_VIDEO_FULLSCREEN_Y: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_fullscreen_y); break; + case MENU_ENUM_LABEL_VIDEO_FORCE_RESOLUTION: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_force_resolution); + break; case MENU_ENUM_LABEL_VIDEO_WINDOW_SAVE_POSITION: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_save_window_position); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 6b0816ceb4..f6318bf28c 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -7445,6 +7445,12 @@ unsigned menu_displaylist_build_list( MENU_ENUM_LABEL_VIDEO_FULLSCREEN_Y, PARSE_ONLY_UINT, false) == 0) count++; +#ifdef __WINRT__ + if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, + MENU_ENUM_LABEL_VIDEO_FORCE_RESOLUTION, + PARSE_ONLY_BOOL, false) == 0) + count++; +#endif break; case DISPLAYLIST_VIDEO_OUTPUT_SETTINGS_LIST: { diff --git a/menu/menu_setting.c b/menu/menu_setting.c index ec4492661b..3b0eff1cb4 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -10701,6 +10701,23 @@ static bool setting_append_list( (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint_special; menu_settings_list_current_add_range(list, list_info, 0, 4320, 8, true, true); SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_ADVANCED); + + CONFIG_BOOL( + list, list_info, + &settings->bools.video_force_resolution, + MENU_ENUM_LABEL_VIDEO_FORCE_RESOLUTION, + MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_RESOLUTION, + DEFAULT_FORCE_RESOLUTION, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_CMD_APPLY_AUTO); + MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_REINIT_FROM_TOGGLE); + SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED); } #if defined(DINGUX) && defined(DINGUX_BETA) diff --git a/msg_hash.h b/msg_hash.h index 819411ec91..79921bdc97 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1032,6 +1032,7 @@ enum msg_hash_enums MENU_LABEL(VIDEO_WINDOW_OPACITY), MENU_LABEL(VIDEO_FULLSCREEN_X), MENU_LABEL(VIDEO_FULLSCREEN_Y), + MENU_LABEL(VIDEO_FORCE_RESOLUTION), MENU_LABEL(VIDEO_FORCE_SRGB_DISABLE), MENU_LABEL(VIDEO_ROTATION), MENU_LABEL(SCREEN_ORIENTATION), diff --git a/retroarch.c b/retroarch.c index 8dbd384026..41788ea096 100644 --- a/retroarch.c +++ b/retroarch.c @@ -30109,6 +30109,14 @@ static bool video_driver_init_internal( } } +#ifdef __WINRT__ + if (settings->bools.video_force_resolution) + { + width = settings->uints.video_fullscreen_x != 0 ? settings->uints.video_fullscreen_x : 3840; + height = settings->uints.video_fullscreen_y != 0 ? settings->uints.video_fullscreen_y : 2160; + } +#endif + if (width && height) RARCH_LOG("[Video]: Video @ %ux%u\n", width, height); else diff --git a/uwp/uwp_main.cpp b/uwp/uwp_main.cpp index 4a150548e0..d1e5a49a9c 100644 --- a/uwp/uwp_main.cpp +++ b/uwp/uwp_main.cpp @@ -669,6 +669,14 @@ extern "C" { bool *quit, bool *resize, unsigned *width, unsigned *height) { *quit = App::GetInstance()->IsWindowClosed(); + settings_t* settings = config_get_ptr(); + if (settings->bools.video_force_resolution) + { + *width = settings->uints.video_fullscreen_x != 0 ? settings->uints.video_fullscreen_x : 3840; + *height = settings->uints.video_fullscreen_y != 0 ? settings->uints.video_fullscreen_y : 2160; + return; + } + *resize = App::GetInstance()->CheckWindowResized(); if (*resize) {