From 20fa4765de170a9cabbb3e3984329ce9bfd6f322 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 18:16:54 +0200 Subject: [PATCH 01/12] Fix double link reference on Mac --- qb/config.libs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qb/config.libs.sh b/qb/config.libs.sh index a9966fb9672..73d4b2c0ad3 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -42,6 +42,8 @@ if [ "$OS" = 'BSD' ]; then [ -d /usr/local/include ] && add_dirs INCLUDE /usr/local/include [ -d /usr/local/lib ] && add_dirs LIBRARY /usr/local/lib DYLIB=-lc; +elif [ "$OS" = 'Darwin' ]; then + DYLIB= elif [ "$OS" = 'Haiku' ]; then DYLIB="" CLIB=-lroot From 97827c1645abc0c5e6d443ec47c1129817b9751d Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 18:37:45 +0200 Subject: [PATCH 02/12] Fix builtin-zlib for Apple --- deps/libz/zutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libz/zutil.h b/deps/libz/zutil.h index 6a961e1cbb2..d999a89881e 100644 --- a/deps/libz/zutil.h +++ b/deps/libz/zutil.h @@ -127,7 +127,7 @@ extern char z_errmsg[10][21]; /* indexed by 2-zlib_error */ # ifndef Z_SOLO # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include /* for fdopen */ -# else +# elif !defined(__APPLE__) # ifndef fdopen # define fdopen(fd,mode) NULL /* No fdopen() */ # endif From b70380c9540c8876d499aba81853a8fd48294ddc Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:22:07 +0200 Subject: [PATCH 03/12] Fix warnings --- gfx/drivers_context/cocoa_gl_ctx.m | 5 +++-- gfx/drivers_context/cocoa_vk_ctx.m | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 9c9751a4f5c..3f76d7b18f1 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -380,8 +380,10 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data, CocoaView *g_view = (CocoaView*)nsview_get_ptr(); #endif cocoa_ctx_data_t *cocoa_ctx = (cocoa_ctx_data_t*)data; +#ifndef HAVE_COCOA_METAL static bool has_went_fullscreen = false; +#endif cocoa_ctx->width = width; cocoa_ctx->height = height; @@ -486,6 +488,7 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data, mode.fullscreen = fullscreen; [apple_platform setVideoMode:mode]; cocoa_show_mouse(data, !fullscreen); + has_went_fullscreen = fullscreen; #else /* Hand-rolled fullscreen for the non-Metal path. * @@ -607,8 +610,6 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data, } #endif - has_went_fullscreen = fullscreen; - return true; } diff --git a/gfx/drivers_context/cocoa_vk_ctx.m b/gfx/drivers_context/cocoa_vk_ctx.m index 462754ab198..60c5e36b5bc 100755 --- a/gfx/drivers_context/cocoa_vk_ctx.m +++ b/gfx/drivers_context/cocoa_vk_ctx.m @@ -182,7 +182,7 @@ static void cocoa_vk_gfx_ctx_swap_interval(void *data, int i) unsigned interval = (unsigned)i; cocoa_vk_ctx_data_t *cocoa_ctx = (cocoa_vk_ctx_data_t*)data; - if (cocoa_ctx->swap_interval != interval) + if (cocoa_ctx->swap_interval != (int)interval) { cocoa_ctx->swap_interval = interval; if (cocoa_ctx->vk.swapchain) From 01d6266984bd2183d2a812368040c802a87d5fb2 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:25:00 +0200 Subject: [PATCH 04/12] Made a mistake, mb --- gfx/drivers_context/cocoa_gl_ctx.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 3f76d7b18f1..a3ae9dbcbb3 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -488,7 +488,6 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data, mode.fullscreen = fullscreen; [apple_platform setVideoMode:mode]; cocoa_show_mouse(data, !fullscreen); - has_went_fullscreen = fullscreen; #else /* Hand-rolled fullscreen for the non-Metal path. * @@ -608,6 +607,8 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data, [[g_view window] setContentSize:NSMakeSize(width, height)]; } + + has_went_fullscreen = fullscreen; #endif return true; From 1499b0d5c6387f4165c2f2887d214e762a8abef8 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:29:13 +0200 Subject: [PATCH 05/12] Fix warning --- ui/drivers/cocoa/cocoa_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/drivers/cocoa/cocoa_common.h b/ui/drivers/cocoa/cocoa_common.h index de713d39306..4a9ed2fece6 100644 --- a/ui/drivers/cocoa/cocoa_common.h +++ b/ui/drivers/cocoa/cocoa_common.h @@ -115,7 +115,7 @@ void get_ios_version(int *major, int *minor); #endif #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000 -@property(nonatomic,readwrite) CADisplayLink *displayLink API_AVAILABLE(macos(14.0)); +@property(nonatomic,readwrite,retain) CADisplayLink *displayLink API_AVAILABLE(macos(14.0)); #endif @end From 5f5f9859f0caee4380a79ec07d9329ce95f80f46 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:33:36 +0200 Subject: [PATCH 06/12] Silence more warnings --- gfx/common/metal_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/common/metal_common.h b/gfx/common/metal_common.h index 25f4bb28179..2aacc73171c 100644 --- a/gfx/common/metal_common.h +++ b/gfx/common/metal_common.h @@ -248,7 +248,7 @@ typedef NS_ENUM(NSUInteger, ViewportResetMode) { @interface Filter : NSObject -@property (nonatomic, readwrite) id delegate; +@property (nonatomic, readwrite, assign) id delegate; @property (nonatomic, readonly) id sampler; - (void)apply:(id)cb in:(id)tin out:(id)tout; From 15868f4b09fe25a07cff75a8c9332d0d981243cd Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:39:19 +0200 Subject: [PATCH 07/12] Warning fixes --- gfx/drivers/metal.m | 4 ++-- ui/drivers/ui_cocoa.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx/drivers/metal.m b/gfx/drivers/metal.m index ed817bd9255..33ca2653636 100644 --- a/gfx/drivers/metal.m +++ b/gfx/drivers/metal.m @@ -4300,7 +4300,7 @@ - (void)drawWithEncoder:(id)rce - (void)drawWithContext:(Context *)ctx { - int i; + size_t i; _texture = _engine.frame.texture[0].view; if ( (_format != RPixelFormatBGRA8Unorm) @@ -4938,7 +4938,7 @@ - (bool)loadImages:(const struct texture_image *)images count:(NSUInteger)count - (void)drawWithEncoder:(id)rce { - int i; + size_t i; NSUInteger count; #if !defined(HAVE_COCOATOUCH) if (_vertDirty) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index d5627d2f16a..a9f6ca23a53 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -681,7 +681,7 @@ - (void)dealloc - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - unsigned i; + int i; apple_platform = self; [self.window setAcceptsMouseMovedEvents: YES]; From 21114157ad681db2cf6a628d5e4b8fb51fe0d1b5 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:41:07 +0200 Subject: [PATCH 08/12] Remove unused variable --- gfx/common/metal/Shaders.metal | 1 - 1 file changed, 1 deletion(-) diff --git a/gfx/common/metal/Shaders.metal b/gfx/common/metal/Shaders.metal index 688c29612b0..b07b310ebf9 100644 --- a/gfx/common/metal/Shaders.metal +++ b/gfx/common/metal/Shaders.metal @@ -543,7 +543,6 @@ namespace hdr namespace hdr_crt { constant float kBeamWidth = 0.5f; - constant uint kChannelMask = 3u; constant uint kFirstChannelShift = 2u; constant uint kRedId = 0u; From 5f61ff9ad12af2db9af37173781affc6cddfb1c4 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 19:42:15 +0200 Subject: [PATCH 09/12] Fix warning '/* within block comment' --- gfx/display_servers/dispserv_apple.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/display_servers/dispserv_apple.m b/gfx/display_servers/dispserv_apple.m index 26ee580fc65..8a6511c8498 100644 --- a/gfx/display_servers/dispserv_apple.m +++ b/gfx/display_servers/dispserv_apple.m @@ -88,7 +88,7 @@ static bool apple_display_server_set_window_progress(void *data, int progress, b * - qb/top-level Makefile: MRC (not in the per-file ARC * override list at Makefile:275 alongside metal.o / * mfi_joypad.o / coreaudio3.o). - * - pkg/apple/*.xcodeproj: ARC, via griffin_objc.m which + * - pkg/apple/.xcodeproj: ARC, via griffin_objc.m which * #include's this file into a TU compiled with * CLANG_ENABLE_OBJC_ARC=YES (pkg/apple/BaseConfig.xcconfig:182). * From fa44a1872d7faad5c213edf044ba8edeeb25b8e7 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Sun, 26 Apr 2026 14:22:04 -0400 Subject: [PATCH 10/12] webdav: fix digest auth --- libretro-common/include/net/net_http.h | 4 +++- libretro-common/net/net_http.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libretro-common/include/net/net_http.h b/libretro-common/include/net/net_http.h index 14fa8f9ec0f..98ffad267e9 100644 --- a/libretro-common/include/net/net_http.h +++ b/libretro-common/include/net/net_http.h @@ -103,7 +103,9 @@ bool net_http_error(struct http_t *state); * * @return the response headers. The returned buffer is owned by the * caller of net_http_new; it is not freed by net_http_delete. - * If the status is not 20x and accept_error is false, it returns NULL. + * On a transport error, NULL is returned unless accept_error is true. + * Headers are returned for any response that was parsed successfully, + * including HTTP error statuses such as 401 (needed for auth challenges). **/ struct string_list *net_http_headers(struct http_t *state); struct string_list *net_http_headers_ex(struct http_t *state, bool accept_error); diff --git a/libretro-common/net/net_http.c b/libretro-common/net/net_http.c index ef2fa034670..29546f3e67a 100644 --- a/libretro-common/net/net_http.c +++ b/libretro-common/net/net_http.c @@ -1804,13 +1804,15 @@ int net_http_status(struct http_t *state) * * @return the response headers. The returned buffer is owned by the * caller of net_http_new; it is not freed by net_http_delete(). - * If the status is not 20x and accept_err is false, it returns NULL. + * On a transport error, NULL is returned unless accept_err is true. + * Headers are returned for any response that was parsed successfully, + * including HTTP error statuses such as 401 (needed for auth challenges). **/ struct string_list *net_http_headers_ex(struct http_t *state, bool accept_err) { if (!state) return NULL; - if (!accept_err && !state->err) + if (!accept_err && state->err) return NULL; return state->response.headers; } From 1224324fb3ab2dfd20d0e08e662a1b3feff8f911 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-SPFP6AQ\\twistedtechre" Date: Sun, 26 Apr 2026 21:50:48 +0200 Subject: [PATCH 11/12] (GL1) Fixes statistics font size --- gfx/drivers/gl1.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index 7ff12fc7aed..5eb5c65d15e 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -840,14 +840,29 @@ static void gl1_raster_font_render_msg( font->block->fullscreen = full_screen; { - unsigned width = gl->video_width; - unsigned height = gl->video_height; + /* gl->video_width/height holds the core's emulated frame size + * (e.g. 256x224), not the window size — gl1 reuses that field + * for texture upload bookkeeping. The font viewport must cover + * the full window, so use screen_width/height instead. Fall + * back to video_width/height if the context driver did not + * report a screen size yet. */ + unsigned width = gl->screen_width + ? gl->screen_width : gl->video_width; + unsigned height = gl->screen_height + ? gl->screen_height : gl->video_height; float inv_tex_size_x = 1.0f / font->tex_width; float inv_tex_size_y = 1.0f / font->tex_height; - float inv_win_width = 1.0f / gl->vp.width; - float inv_win_height = 1.0f / gl->vp.height; + float inv_win_width; + float inv_win_height; + /* setup_viewport may change gl->vp, so capture inv_win_width/height + * AFTER it runs — otherwise the vertex math uses one viewport while + * the actual glViewport is another, producing stretched/squished + * text. The block path defers setup_viewport to flush time and uses + * gl->vp as-is. */ if (!font->block) gl1_raster_font_setup_viewport(gl, width, height, font, full_screen); + inv_win_width = 1.0f / gl->vp.width; + inv_win_height = 1.0f / gl->vp.height; if (msg && *msg && font->font_data && font->font_driver) From 3d687a77ac682de891b4c600d07900659c94ece5 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Sun, 26 Apr 2026 16:25:22 -0400 Subject: [PATCH 12/12] net_http: avoid realloc(p, 0) leaving response->data dangling on empty body --- libretro-common/net/net_http.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libretro-common/net/net_http.c b/libretro-common/net/net_http.c index 29546f3e67a..a6ffa933252 100644 --- a/libretro-common/net/net_http.c +++ b/libretro-common/net/net_http.c @@ -1383,7 +1383,7 @@ static ssize_t net_http_receive_header(struct http_t *state, ssize_t len) { len = response->pos; response->pos = 0; - if (response->bodytype == T_LEN) + if (response->bodytype == T_LEN && response->len > 0) { /* Use a tmp pointer so a realloc failure does not leak the * original buffer AND leave response->data NULL for later @@ -1428,7 +1428,7 @@ static bool net_http_receive_body(struct http_t *state, ssize_t newlen) if (response->bodytype != T_FULL) return false; response->part = P_DONE; - if (response->buflen != response->len) + if (response->buflen != response->len && response->len > 0) { /* Shrink response->data from buflen bytes to len bytes. * Use a tmp pointer so a realloc() failure (rare on shrink @@ -1535,7 +1535,7 @@ static bool net_http_receive_body(struct http_t *state, ssize_t newlen) else if (response->pos == response->len) { response->part = P_DONE; - if (response->buflen != response->len) + if (response->buflen != response->len && response->len > 0) { char *tmp = (char*)realloc(response->data, response->len); if (!tmp)