From 27355d514ac43c054782c9e8079c2f6c96394ee0 Mon Sep 17 00:00:00 2001 From: flatmapthatshit <48256950+flatmapthatshit@users.noreply.github.com> Date: Sun, 7 Jul 2024 18:06:27 +0100 Subject: [PATCH 1/3] Remove duplicate macOS overrides. Keeps the one which works with both arm64 and x86_64. --- Makefile | 48 +++++++++++------------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 003434d39d..901555f67f 100644 --- a/Makefile +++ b/Makefile @@ -102,8 +102,17 @@ endif # macOS overrides ifeq ($(HOST_OS),Darwin) OSX_BUILD := 1 + # Using Homebrew? + ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y) + PLATFORM := $(shell uname -m) + OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) + CC := gcc-$(OSX_GCC_VER) + CXX := g++-$(OSX_GCC_VER) + CPP := cpp-$(OSX_GCC_VER) -P + PLATFORM_CFLAGS := -I $(shell brew --prefix)/include + PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib # Using MacPorts? - ifeq ($(shell test -d /opt/local/lib && echo y),y) + else ifeq ($(shell test -d /opt/local/lib && echo y),y) OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) CC := gcc-mp-$(OSX_GCC_VER) CXX := g++-mp-$(OSX_GCC_VER) @@ -111,42 +120,7 @@ ifeq ($(HOST_OS),Darwin) PLATFORM_CFLAGS := -I /opt/local/include PLATFORM_LDFLAGS := -L /opt/local/lib else - # Using Homebrew? - ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y) - OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) - CC := gcc-$(OSX_GCC_VER) - CXX := g++-$(OSX_GCC_VER) - CPP := cpp-$(OSX_GCC_VER) -P - PLATFORM_CFLAGS := -I /usr/local/include - PLATFORM_LDFLAGS := -L /usr/local/lib - else - $(error No suitable macOS toolchain found, have you installed Homebrew?) - endif - endif -endif - -# macOS overrides -ifeq ($(HOST_OS),Darwin) - OSX_BUILD := 1 - # Using Homebrew? - ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y) - PLATFORM := $(shell uname -m) - OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) - CC := gcc-$(OSX_GCC_VER) - CXX := g++-$(OSX_GCC_VER) - CPP := cpp-$(OSX_GCC_VER) -P - PLATFORM_CFLAGS := -I $(shell brew --prefix)/include - PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib - # Using MacPorts? - else ifeq ($(shell test -d /opt/local/lib && echo y),y) - OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1) - CC := gcc-mp-$(OSX_GCC_VER) - CXX := g++-mp-$(OSX_GCC_VER) - CPP := cpp-mp-$(OSX_GCC_VER) -P - PLATFORM_CFLAGS := -I /opt/local/include - PLATFORM_LDFLAGS := -L /opt/local/lib - else - $(error No suitable macOS toolchain found, have you installed Homebrew?) + $(error No suitable macOS toolchain found, have you installed Homebrew?) endif endif From 62f618f1bdf5966725ab0d33b606677bd8f6db06 Mon Sep 17 00:00:00 2001 From: flatmapthatshit <48256950+flatmapthatshit@users.noreply.github.com> Date: Sun, 7 Jul 2024 18:53:20 +0100 Subject: [PATCH 2/3] Fix tools to build with GCC 14 --- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index efc9cba848..415b8748e4 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,6 +1,6 @@ CC ?= gcc CXX ?= g++ -CFLAGS := -I../include -I. -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s +CFLAGS := -I../include -I. -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s -fpermissive LDFLAGS := -lm PROGRAMS := n64graphics aifc_decode aiff_extract_codebook mio0 vadpcm_enc tabledesign skyconv From a476bb6b3163994c4139c86047098f21751c6506 Mon Sep 17 00:00:00 2001 From: flatmapthatshit <48256950+flatmapthatshit@users.noreply.github.com> Date: Wed, 16 Jul 2025 13:19:07 +0100 Subject: [PATCH 3/3] feat(SDL2): Enable high DPI support and fix window size --- src/pc/gfx/gfx_sdl2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 8e24aed40a..04ac1c975e 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -242,7 +242,7 @@ static void gfx_sdl_init(const char *window_title) { wnd = SDL_CreateWindow( window_title, xpos, ypos, configWindow.w, configWindow.h, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE + SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE ); ctx = SDL_GL_CreateContext(wnd); @@ -270,7 +270,8 @@ static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { static void gfx_sdl_get_dimensions(uint32_t *width, uint32_t *height) { int w, h; - SDL_GetWindowSize(wnd, &w, &h); + SDL_GL_GetDrawableSize(wnd, &w, &h); + if (width) *width = w; if (height) *height = h; }