Repository navigation
Conversation
- tools/build-macos.sh: working .app bundling (assets in Resources, built-in mod catalog, user state in ~/Library/Application Support, app icon, version from CMakeLists, dylib bundling, ad-hoc signing, opt-in diagnostics via marker files), applies the engine patch below. - macos/build-on-mac.sh: one-shot setup (Homebrew deps, first-run regen from the owner's ROM) and build, logged to macos/build.log. - macos/patches/snesrecomp-macos-data-dir.patch: honour SNESRECOMP_DATA_DIR on macOS in host_paths.c and keybinds.c so nothing is written inside the signed bundle. Kept as a patch so the submodule still points at the upstream pin. - src/main.c, src/opengl.c: enable vsync only when the window's display runs at ~60 Hz (re-checked periodically). On a 100 Hz monitor the 60 Hz frame timer plus vsync made Metal block ~20 ms per frame (50 fps, slow motion and audio crackle). - Falcon cache helper path via _NSGetExecutablePath (no /proc on macOS). - tools/regen.sh: portable sed for BSD sed. - docs/macos.md: build instructions, layout, measurements, limitations. Tested on a MacBook Air M5 (macOS 27, SDL 3.4): builds cleanly, launcher and gameplay run; audio-paced benchmark 60.0 fps with no underflows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KD5Psut8yQnHGZHQ13ARSr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a working native macOS build that produces a self-contained
SuperMarioWorld.app, plus a vsync fix for non-60 Hz displays that benefits every platform.Tested on a MacBook Air M5 (arm64) with macOS 27, AppleClang 21 and SDL 3.4.20: the app builds cleanly and both the launcher and gameplay work. Full write-up:
docs/macos.md.What changes
tools/build-macos.sh: rewrote the bundling, which had fallen behindbuild-linux.sh.Contents/Resources, whereSDL_GetBasePath()resolves inside a bundle.config.ini,keybinds.ini,rom.cfg,saves/,logs/,mods/) lives in~/Library/Application Support/SuperMarioWorld, never inside the signed bundle (which can also be read-only under App Translocation).CMakeLists.txt,dylibbundlerruns only when non-system dylibs are linked, and the bundle is ad-hoc signed..app(diag.flag,bench.flag), so the signed bundle never has to be edited.macos/build-on-mac.sh: one-shot script. It installs the missing Homebrew packages (cmake, sdl3, dylibbundler, plus rust for the first regen), generatessrc/genfrom the owner'ssmw.sfcon the first run, builds, and logs everything tomacos/build.log.macos/patches/snesrecomp-macos-data-dir.patch: on macOS,host_paths.candkeybinds.cnow honourSNESRECOMP_DATA_DIR(previously Android-only). It is kept as a patch, applied idempotently bybuild-macos.sh, so the submodule still points at the upstream pin. Happy to send it to snesrecomp separately if you prefer.src/main.c,src/opengl.c: display-rate-aware vsync. The main loop already paces to 60 Hz with its frame delay. Waiting on vsync as well only works on a ~60 Hz panel. On a 100 Hz monitor, Metal blocked about 20 ms per frame. Stall-log measurement:draw_msmedian 19.35 ms,run_ms0.68 ms. The game dropped to 50 fps, with slow motion and audio crackle. Vsync is now enabled only while the window's display runs at ~60 Hz, and this is re-checked about every 0.5 s so it follows the window across displays. This applies to both the SDL and OpenGL presenters, and to Windows and Linux too (75/100/144 Hz monitors).src/mods/falcon/smw_falcon_presentation_runtime.c: on macOS, the helper is located with_NSGetExecutablePath+realpath, since there is no/proc.tools/regen.sh: replaced a GNU-onlysed -i(co-op path) with a portable equivalent for BSD sed..gitignoreentries forrelease-macos/andmacos/build.log.Measurements (M5, after the fix)
--benchmark 1800: about 100 fps. The ceiling is the 100 Hz panel's presentation, not the CPU.--benchmark-audio-paced 1800: 60.0 fps,audio_health.ok, 0 underflows.Not covered
🤖 Generated with Claude Code
https://claude.ai/code/session_01KD5Psut8yQnHGZHQ13ARSr