Repository navigation
Conversation
Launching the bare tmc_pc from Finder opens a Terminal window. Wrap it in an ad-hoc-signed Picori.app instead (tools/make_macos_app.py), produced by build.py on macOS and shipped by CI as a separate *-app.tar.gz. A Finder launch starts with CWD = / and the bundle must not be written to, so when running from <name>.app/Contents/MacOS the port now chdirs to ~/Library/Application Support/Picori (like Android's data dir), stages the public defaults from Contents/Resources there, and logs to picori.log. The asset cache and a picked ROM go to that dir instead of beside the binary. The plain tarball layout is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On macOS the build is a bare
tmc_pcexecutable, so double-clicking it in Finder opens a Terminal window. A plain.appwrapper isn't enough on its own, for two reasons:/. The port keeps all its state relative to the working directory or the binary's folder (config.json, tmc.sav, the asset cache, quicksaves, bug reports, the installedbaserom.gba).Changes
port/port_macos_bundle.{c,h}(new; SDL-free, no-op outside a bundle): when the binary runs from<name>.app/Contents/MacOS,Port_MacBundle_Init()does the following, mirroring the existing Android data-dir approach:~/Library/Application Support/PicoriContents/Resources(voxel_shapes.json,assets/rando/default.logic) if they're missingpicori.log, keeping the previous run's log aspicori.log.1port_main.c: calls it before anything opens a file relative to the working directory.port_asset_bootstrap.cpp/port_rom_picker.c: in a bundle, the asset cache and a picked ROM go to the data dir instead of next to the binary. Mods, rando logic and the ROM probe already search the working directory, so they work unchanged.tools/make_macos_app.py(new): wraps a builttmc_pcintoPicori.app. It writes anInfo.plist(NSHighResolutionCapable,GCSupportsGameMode, games category, version taken fromxmake.lua), turnsdocs/picori-logo.pnginto.icnswithsips/iconutil, copies the same public defaults the tarball ships, and ad-hoc signs the result withcodesign -s -. No ROM or ROM-derived data goes into the bundle.build.py: on macOS, also producesdist/<VERSION>/Picori.app._build.yaml): macOS legs add a step that packagestmc-multi-macos-<arch>-<version>-app.tar.gz(withCOPYFILE_DISABLE=1, so no._*entries) and runscodesign --verify --stricton it. The existing*.tar.gzrelease glob picks it up, sorelease.yamlis untouched, and the existing tarball payload, along with its regression test, is unchanged.Picori.appand where its data lives.Testing (Apple Silicon, macOS 27, USA ROM)
python3 build.py --usa→dist/USA/Picori.app;codesign --verify --strictpasses.open(as Finder does: working directory/, no TTY):picori.logassets/usatheretmc.savis written theredist/USA/tmc_pcrun from a terminal behaves as before: no bundle mode, and ROM and assets are found next to the binary.Notes
io.github.999sian.picoriis a placeholder. Happy to change it.tools/release_payload_regression_test.pyalready fails on master when run on macOS, because macOStaradds._*AppleDouble entries. It passes withCOPYFILE_DISABLE=1.port_main.cbut merge cleanly.🤖 Generated with Claude Code