diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 909c1116b9..1c88da1049 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -60,6 +60,7 @@ #include "../../verbosity.h" #include "../../lakka.h" #include "../../wifi/wifi_driver.h" +#include "../../gfx/video_display_server.h" #include @@ -4463,12 +4464,37 @@ static int action_ok_push_dropdown_item(const char *path, static int action_ok_push_dropdown_item_resolution(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { - RARCH_LOG("dropdown: \n"); - RARCH_LOG("path: %s \n", path); - RARCH_LOG("label: %s \n", label); - RARCH_LOG("type: %d \n", type); - RARCH_LOG("idx: %d \n", idx); - RARCH_LOG("entry_idx: %d \n", entry_idx); + char str[100]; + char *pch = NULL; + unsigned width = 0; + unsigned height = 0; + unsigned refreshrate = 0; + + snprintf(str, sizeof(str), "%s", path); + + pch = strtok(str, "x"); + if (pch) + width = strtoul(pch, NULL, 0); + pch = strtok(NULL, " "); + if (pch) + height = strtoul(pch, NULL, 0); + pch = strtok(NULL, "("); + if (pch) + refreshrate = strtoul(pch, NULL, 0); + + if (video_display_server_set_resolution(width, height, + refreshrate, (float)refreshrate, 0)) + { + settings_t *settings = config_get_ptr(); + + video_monitor_set_refresh_rate((float)refreshrate); + + settings->uints.video_fullscreen_x = width; + settings->uints.video_fullscreen_y = height; + + /* TODO/FIXME - menu drivers like XMB don't rescale + * automatically */ + } return 0; } diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ededbc3812..19699ba94c 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -8333,7 +8333,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist for (i = 0; i < size; i++) { char val_d[256], str[256]; - snprintf(str, sizeof(str), "%dx%d (%dHz)", list[i].width, list[i].height, list[i].refreshrate); + snprintf(str, sizeof(str), "%dx%d (%d Hz)", list[i].width, list[i].height, list[i].refreshrate); snprintf(val_d, sizeof(val_d), "%d", i); menu_entries_append_enum(info->list, str,