From e050ca89c7c9c06eded2cacb3c50a301883f8435 Mon Sep 17 00:00:00 2001 From: radius Date: Thu, 6 Dec 2018 10:03:48 -0500 Subject: [PATCH 1/9] make windowed size take into account window border and title height --- gfx/common/win32_common.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index f9314ada30..25552ed318 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -622,18 +622,22 @@ static LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message, static void win32_set_position_from_config(void) { settings_t *settings = config_get_ptr(); + int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); + int title_bar_height = GetSystemMetrics(SM_CYCAPTION); if (!settings->bools.video_window_save_positions) return; g_win32_pos_x = settings->uints.window_position_x; g_win32_pos_y = settings->uints.window_position_y; - g_win32_pos_width = settings->uints.window_position_width; - g_win32_pos_height= settings->uints.window_position_height; + g_win32_pos_width = settings->uints.window_position_width + border_thickness * 2; + g_win32_pos_height= settings->uints.window_position_height + border_thickness * 2 + title_bar_height; } static void win32_save_position(void) { RECT rect; + int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); + int title_bar_height = GetSystemMetrics(SM_CYCAPTION); WINDOWPLACEMENT placement; settings_t *settings = config_get_ptr(); memset(&placement, 0, sizeof(placement)); @@ -655,8 +659,8 @@ static void win32_save_position(void) { settings->uints.window_position_x = g_win32_pos_x; settings->uints.window_position_y = g_win32_pos_y; - settings->uints.window_position_width = g_win32_pos_width; - settings->uints.window_position_height = g_win32_pos_height; + settings->uints.window_position_width = g_win32_pos_width - border_thickness * 2; + settings->uints.window_position_height = g_win32_pos_height - border_thickness * 2 - title_bar_height; } } } From 0735fbcd57ec8b6d683ec797358c19188e51ce19 Mon Sep 17 00:00:00 2001 From: orbea Date: Thu, 6 Dec 2018 07:09:03 -0800 Subject: [PATCH 2/9] Fix build with '--enable-sixel'. (#7704) First bad commit 2edd03361c35ef2648d30ff421bfcee44158bb4f --- gfx/drivers/sixel_gfx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gfx/drivers/sixel_gfx.c b/gfx/drivers/sixel_gfx.c index 8daecdaa32..d49c3dd74f 100644 --- a/gfx/drivers/sixel_gfx.c +++ b/gfx/drivers/sixel_gfx.c @@ -30,6 +30,7 @@ #include "../../driver.h" #include "../../configuration.h" +#include "../../retroarch.h" #include "../../verbosity.h" #include "../../frontend/frontend_driver.h" #include "../common/sixel_common.h" From defe82c9ceb3357c8b4f3f75b27a6d89193d1e45 Mon Sep 17 00:00:00 2001 From: radius Date: Thu, 6 Dec 2018 10:15:50 -0500 Subject: [PATCH 3/9] fix the menubar height growing issue too --- gfx/common/win32_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 25552ed318..a9d96062e0 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -624,6 +624,7 @@ static void win32_set_position_from_config(void) settings_t *settings = config_get_ptr(); int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); int title_bar_height = GetSystemMetrics(SM_CYCAPTION); + int menu_bar_height = GetSystemMetrics(SM_CYMENU); if (!settings->bools.video_window_save_positions) return; @@ -638,6 +639,7 @@ static void win32_save_position(void) RECT rect; int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); int title_bar_height = GetSystemMetrics(SM_CYCAPTION); + int menu_bar_height = GetSystemMetrics(SM_CYMENU); WINDOWPLACEMENT placement; settings_t *settings = config_get_ptr(); memset(&placement, 0, sizeof(placement)); @@ -660,7 +662,7 @@ static void win32_save_position(void) settings->uints.window_position_x = g_win32_pos_x; settings->uints.window_position_y = g_win32_pos_y; settings->uints.window_position_width = g_win32_pos_width - border_thickness * 2; - settings->uints.window_position_height = g_win32_pos_height - border_thickness * 2 - title_bar_height; + settings->uints.window_position_height = g_win32_pos_height - border_thickness * 2 - title_bar_height - (settings->bools.ui_menubar_enable ? menu_bar_height : 0); } } } From 5898f3e5d22b930a1050a59b61e98ecd07dd6977 Mon Sep 17 00:00:00 2001 From: orbea Date: Thu, 6 Dec 2018 08:31:01 -0800 Subject: [PATCH 4/9] Fix KMS with OpenGL. All credit for this patch goes to dtsarr. Fixes https://github.com/libretro/RetroArch/issues/7119 --- gfx/common/egl_common.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index f3c579af21..ee7bca84b6 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -329,8 +329,47 @@ bool egl_init_context(egl_ctx_data_t *egl, RARCH_LOG("[EGL]: EGL version: %d.%d\n", *major, *minor); - if (!eglChooseConfig(egl->dpy, attrib_ptr, &egl->config, 1, n) || *n != 1) + EGLint count = 0; + EGLint matched = 0; + EGLConfig *configs; + int config_index = -1; + + if (!eglGetConfigs(egl->dpy, NULL, 0, &count) || count < 1) + { + RARCH_ERR("[EGL]: No cofigs to choose from.\n"); return false; + } + + configs = malloc(count * sizeof *configs); + if (!configs) return false; + + if (!eglChooseConfig(egl->dpy, attrib_ptr, configs, count, &matched) || !matched) + { + RARCH_ERR("[EGL]: No EGL configs with appropriate attributes.\n"); + return false; + } + + int i; + EGLint id; + + for (i = 0; i < count; ++i) + { + if (!eglGetConfigAttrib(egl->dpy, configs[i], EGL_NATIVE_VISUAL_ID, &id)) + continue; + + if (id == GBM_FORMAT_XRGB8888) break; + } + + if (id != GBM_FORMAT_XRGB8888) + { + RARCH_ERR("[EGL]: No EGL configs with format XRGB8888\n"); + return false; + } + + config_index = i; + if (config_index != -1) egl->config = configs[config_index]; + + free(configs); egl->major = g_egl_major; egl->minor = g_egl_minor; From 763863751855ca733c1ccadb78b9e8e61302e773 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 7 Dec 2018 00:51:56 +0100 Subject: [PATCH 5/9] Cleanups --- gfx/common/egl_common.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index ee7bca84b6..8ae8fee90c 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -315,7 +315,12 @@ bool egl_init_context(egl_ctx_data_t *egl, EGLint *major, EGLint *minor, EGLint *n, const EGLint *attrib_ptr) { - EGLDisplay dpy = get_egl_display(platform, display_data); + EGLConfig *configs = NULL; + EGLint count = 0; + EGLint matched = 0; + int config_index = -1; + EGLDisplay dpy = get_egl_display(platform, display_data); + if (dpy == EGL_NO_DISPLAY) { RARCH_ERR("[EGL]: Couldn't get EGL display.\n"); @@ -329,11 +334,6 @@ bool egl_init_context(egl_ctx_data_t *egl, RARCH_LOG("[EGL]: EGL version: %d.%d\n", *major, *minor); - EGLint count = 0; - EGLint matched = 0; - EGLConfig *configs; - int config_index = -1; - if (!eglGetConfigs(egl->dpy, NULL, 0, &count) || count < 1) { RARCH_ERR("[EGL]: No cofigs to choose from.\n"); @@ -343,7 +343,8 @@ bool egl_init_context(egl_ctx_data_t *egl, configs = malloc(count * sizeof *configs); if (!configs) return false; - if (!eglChooseConfig(egl->dpy, attrib_ptr, configs, count, &matched) || !matched) + if (!eglChooseConfig(egl->dpy, attrib_ptr, + configs, count, &matched) || !matched) { RARCH_ERR("[EGL]: No EGL configs with appropriate attributes.\n"); return false; @@ -354,10 +355,12 @@ bool egl_init_context(egl_ctx_data_t *egl, for (i = 0; i < count; ++i) { - if (!eglGetConfigAttrib(egl->dpy, configs[i], EGL_NATIVE_VISUAL_ID, &id)) + if (!eglGetConfigAttrib(egl->dpy, + configs[i], EGL_NATIVE_VISUAL_ID, &id)) continue; - if (id == GBM_FORMAT_XRGB8888) break; + if (id == GBM_FORMAT_XRGB8888) + break; } if (id != GBM_FORMAT_XRGB8888) @@ -367,7 +370,8 @@ bool egl_init_context(egl_ctx_data_t *egl, } config_index = i; - if (config_index != -1) egl->config = configs[config_index]; + if (config_index != -1) + egl->config = configs[config_index]; free(configs); From e27e1114c77088c594c3368c970db941c2f83c03 Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Fri, 7 Dec 2018 14:18:43 +0000 Subject: [PATCH 6/9] (3DS) Improve default configuration --- config.def.h | 5 +++++ configuration.c | 7 +++++-- frontend/drivers/platform_ctr.c | 27 ++++++++++++++++++++------- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/config.def.h b/config.def.h index 02fe8569cc..362672ca6b 100644 --- a/config.def.h +++ b/config.def.h @@ -244,6 +244,11 @@ static const bool aspect_ratio_auto = false; static unsigned aspect_ratio_idx = ASPECT_RATIO_16_9; #elif defined(PSP) static unsigned aspect_ratio_idx = ASPECT_RATIO_CORE; +#elif defined(_3DS) +/* Previously defaulted to ASPECT_RATIO_4_3. + * Non-4:3 content looks dreadful when stretched + * to 4:3 on the 3DS screen... */ +static unsigned aspect_ratio_idx = ASPECT_RATIO_CORE; #elif defined(RARCH_CONSOLE) static unsigned aspect_ratio_idx = ASPECT_RATIO_4_3; #else diff --git a/configuration.c b/configuration.c index 4264d236a5..e778f43a09 100644 --- a/configuration.c +++ b/configuration.c @@ -543,6 +543,9 @@ static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_CORELOCATION static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL; #endif +#if defined(_3DS) && defined(HAVE_RGUI) +static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI; +#else #if defined(HAVE_XUI) static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XUI; #elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE) @@ -556,7 +559,7 @@ static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI; #else static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_NULL; #endif - +#endif #define GENERAL_SETTING(key, configval, default_enable, default_setting, type, handle_setting) \ { \ @@ -678,7 +681,7 @@ const char *config_get_default_audio(void) case AUDIO_PS2: return "ps2"; case AUDIO_CTR: - return "csnd"; + return "dsp"; case AUDIO_SWITCH: return "switch"; case AUDIO_RWEBAUDIO: diff --git a/frontend/drivers/platform_ctr.c b/frontend/drivers/platform_ctr.c index 68110a0f28..58fb331736 100644 --- a/frontend/drivers/platform_ctr.c +++ b/frontend/drivers/platform_ctr.c @@ -240,13 +240,15 @@ static void frontend_ctr_exec(const char* path, bool should_load_game) } else { - RARCH_LOG("\n"); - RARCH_LOG("\n"); - RARCH_LOG("Warning:\n"); - RARCH_LOG("First core launch may take 20 seconds!\n"); - RARCH_LOG("Do not force quit before then or your memory card may be corrupted!\n"); - RARCH_LOG("\n"); - RARCH_LOG("\n"); + RARCH_WARN("\n"); + RARCH_WARN("\n"); + RARCH_WARN("Warning:\n"); + RARCH_WARN("First core launch may take 20\n"); + RARCH_WARN("seconds! Do not force quit\n"); + RARCH_WARN("before then or your memory\n"); + RARCH_WARN("card may be corrupted!\n"); + RARCH_WARN("\n"); + RARCH_WARN("\n"); exec_cia(path, arg_data); } @@ -356,6 +358,17 @@ static void ctr_check_dspfirm(void) } fclose(code_fp); } + else + { + RARCH_WARN("\n"); + RARCH_WARN("\n"); + RARCH_WARN("Warning:\n"); + RARCH_WARN("3DS DSP dump is missing.\n"); + RARCH_WARN("A working DSP dump is required\n"); + RARCH_WARN("for correct operation.\n"); + RARCH_WARN("\n"); + RARCH_WARN("\n"); + } } } From 96840572ef116f1f7018901c129de3bb8a7018bb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 7 Dec 2018 20:18:01 +0100 Subject: [PATCH 7/9] Add HAVE_GBM ifdefs --- gfx/common/egl_common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index 8ae8fee90c..16616a566e 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -315,6 +315,8 @@ bool egl_init_context(egl_ctx_data_t *egl, EGLint *major, EGLint *minor, EGLint *n, const EGLint *attrib_ptr) { + int i; + EGLint id; EGLConfig *configs = NULL; EGLint count = 0; EGLint matched = 0; @@ -350,24 +352,25 @@ bool egl_init_context(egl_ctx_data_t *egl, return false; } - int i; - EGLint id; - for (i = 0; i < count; ++i) { if (!eglGetConfigAttrib(egl->dpy, configs[i], EGL_NATIVE_VISUAL_ID, &id)) continue; +#ifdef HAVE_GBM if (id == GBM_FORMAT_XRGB8888) break; +#endif } +#ifdef HAVE_GBM if (id != GBM_FORMAT_XRGB8888) { RARCH_ERR("[EGL]: No EGL configs with format XRGB8888\n"); return false; } +#endif config_index = i; if (config_index != -1) From bfd914157718083bfa511e54ccdb894d2d41ee05 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 7 Dec 2018 21:15:38 +0100 Subject: [PATCH 8/9] Play it safe for non-GBM targets --- gfx/common/egl_common.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index 16616a566e..b9416d2f13 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -336,14 +336,16 @@ bool egl_init_context(egl_ctx_data_t *egl, RARCH_LOG("[EGL]: EGL version: %d.%d\n", *major, *minor); +#ifdef HAVE_GBM if (!eglGetConfigs(egl->dpy, NULL, 0, &count) || count < 1) { - RARCH_ERR("[EGL]: No cofigs to choose from.\n"); + RARCH_ERR("[EGL]: No configs to choose from.\n"); return false; } configs = malloc(count * sizeof *configs); - if (!configs) return false; + if (!configs) + return false; if (!eglChooseConfig(egl->dpy, attrib_ptr, configs, count, &matched) || !matched) @@ -358,25 +360,25 @@ bool egl_init_context(egl_ctx_data_t *egl, configs[i], EGL_NATIVE_VISUAL_ID, &id)) continue; -#ifdef HAVE_GBM if (id == GBM_FORMAT_XRGB8888) break; -#endif } -#ifdef HAVE_GBM if (id != GBM_FORMAT_XRGB8888) { RARCH_ERR("[EGL]: No EGL configs with format XRGB8888\n"); return false; } -#endif config_index = i; if (config_index != -1) egl->config = configs[config_index]; free(configs); +#else + if (!eglChooseConfig(egl->dpy, attrib_ptr, &egl->config, 1, n) || *n != 1) + return false; +#endif egl->major = g_egl_major; egl->minor = g_egl_minor; From 7ed7b7b4362211dec57b7bd0efaaa052e359f21e Mon Sep 17 00:00:00 2001 From: natinusala Date: Sat, 8 Dec 2018 13:27:57 +0100 Subject: [PATCH 9/9] Add more generated Wayland files to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 1094b5599e..2ca4c1f0f6 100644 --- a/.gitignore +++ b/.gitignore @@ -167,5 +167,7 @@ retroarch_switch.nso # Wayland gfx/common/wayland/idle-inhibit-unstable-v1.c gfx/common/wayland/idle-inhibit-unstable-v1.h +gfx/common/wayland/idle-inhibit-unstable-v6.c +gfx/common/wayland/idle-inhibit-unstable-v6.h gfx/common/wayland/xdg-shell.c gfx/common/wayland/xdg-shell.h