Repository navigation
Conversation
Convert serialized ROM records to native layouts at load boundaries and remove 32-bit address and runtime-layout assumptions. Add Cocoa/SDL build and fullscreen support, ROM-free regression fixtures, macOS CI, build documentation, and converter attribution.
1.0.2b's HUD Scale brackets around the aim sight stored the display-list pointer back with (s32), which truncates it on the native 64-bit build: the next crosshair draw wrote through a garbage pointer and right-click aiming crashed (SIGSEGV in portDisplayCrosshairImage). sp54 is intptr_t, so cast to that like the wide-aim block above. No change on the 32-bit builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/port/package_macos.sh assembles ProjectMidas-<name>-macos.zip in the same layout as the linux zip, with SDL2 bundled beside the exe (rewritten to @executable_path and ad-hoc re-signed). It refuses Homebrew's sdl2, which is sdl2-compat and loads SDL3 at runtime. The package-macos CI job builds SDL2 2.30.11 from the pinned source and one universal arm64 + x86_64 binary for macOS 11+, then uploads the zip. 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.
Goal
Run Project Midas natively on macOS (Apple Silicon and Intel) and ship a macOS zip next to the Windows and Linux ones. Closes #31.
This carries #42 forward. #42's branch is still on 1.0.1 and conflicts with current main, so I rebased its single commit onto 1.0.2b with sh4 kept as the commit author, fixed one 64-bit bug in code that landed in 1.0.2b, and added packaging. Credit for the 64-bit port goes to sh4 (#42). If sh4 would rather update #42, the two extra commits here apply on top of it once it's rebased onto 1.0.2b, and this PR can be closed.
Description
Three commits:
src/game/bondview2.c: Add native 64-bit macOS support #42'sWATCH_MODELmacros with 1.0.2b'sbondviewWatchRate().src/game/gunfire.c: 1.0.2b'sportXhairPrecise()with Add native 64-bit macOS support #42'sGfx **signature forportDrawTargetPlus.tools/THIRD_PARTY_NOTICES.txt: both new sections.src/game/gunfire.c). 1.0.2b's HUD Scale brackets ingunDrawSightstore the display-list pointer back with(s32). On the 64-bit build that truncates it, and right-click aiming crashed with SIGSEGV.sp54is alreadyintptr_t, so both lines now cast tointptr_t, like the wide-aim block above them. No change on the 32-bit builds.scripts/port/package_macos.shbuildsreleases/<name>/ProjectMidas-<name>-macos.zipwith the linux zip's layout. SDL2 is bundled next to the executable, both are relinked to@executable_pathand ad-hoc signed, and the README covers the quarantine flag.sdl2. That package is sdl2-compat, which loads SDL3 at runtime, so it can't be shipped on its own.package-macosCI job: builds SDL2 2.30.11 from the pinned source (sameSDL2_SRC_SHA1as the Linux job), builds one universal arm64 + x86_64 binary for macOS 11+, packages it, and uploads the zip. Run on a tag, the zip gets the tag's name, e.g.ProjectMidas-v1.0.3-macos.zip.docs/macos.md: short "Release zip" section.Type of Change
How Has This Been Tested?
All on an M4 Pro, macOS 27.2, with a locally supplied US cart (SHA-1 matches).
GE_PORT_TESTSfixtures pass.-Wpointer-to-int-cast -Wint-to-pointer-cast -Wvoid-pointer-to-int-cast -Wint-conversion -Wshorten-64-to-32and kept the warnings on lines 1.0.2b added. The only hit was the(s32) agdlcast fixed in commit 2. I also searched those lines for(u32)(uintptr_t)double casts and raw(u8 *)p + 0x...struct offsets and found none.GE_SKIPINTRO=1 GE_STAGE=dam GE_NOINPUT=1 GE_INPUTPLAY=<file>, where the file holds R (P <tick> 10 0 0for ticks 600-6000). Before the fix: SIGSEGV inportDisplayCrosshairImagefromgunDrawSighton the first aiming frame. After: about 30 s in aim mode at 60 fps, no crash.libSDL2-2.0.0.dylib(checked withlsof), found the cart inData/by itself, and ran Dam at 60 fps. Both binaries are universal and ad-hoc signed (codesign --verify --strictpasses), with no rpaths into the build machine.Not tested:
macos-15-intel.intptr_tinstead ofs32, which is the same width there. CI will confirm.build-macosCI job runs them.Checklist
__DATA,__commonalignment linker warning from Add native 64-bit macOS support #42 remains)Separate from this PR: RecompLauncher's Project Midas entry expects
ProjectMidas-*-windows.7zandProjectMidas-*-linux.7z, but 1.0.2b ships.zip. Once a macOS zip is in a release, the entry also needs"macos": "ProjectMidas-*-macos.zip".🤖 Generated with Claude Code