Zelda64Recomp
Zelda64Recomp copied to clipboard
[Feature Request] macOS Support
I don't know if it's easy to implement, but a macOS version of the project would be very cool. I think native Metal API support would be hard to implement, but since the Linux version uses Vulkan, you could use a translation layer like MoltenVK to translate the Vulkan API calls into Metal API calls and then create a macOS version. I know it's not that easy, and it needs more work than that, but at least it would be less work than a native Metal version.
I am willing to help in whatever way possible. I have a Apple M2 Pro Machine
I have a feeling that once the build instructions are available, someone should be able to PR support for macOS in, just judging by the cmake files and dependencies (even if maybe only for x86/rosetta at first).
Until then, I tried using Whisky with vc2022 winetricks added, but it didn't seem to get very far. I'm not that familiar with running games like that though:
$ wine Zelda64Recompiled.exe
msync: bootstrapped mach port on wine-a3db8c1-msync.
msync: up and running.
wine: Unhandled page fault on read access to 0000000000000010 at address 0000000140010DB1 (thread 00b4)
With most projects in order to build, all you do is you open up a terminal, git clone the repo, cd to the directory of it, run the command 'mkdir build' to create a build folder, then i run 'cmake ..', then followed by 'make'. I did that and it was starting to build but then ran into a bunch of errors. You could always try running it through something like crossover possibly as well.
On an M1 Pro, using cmake, I get the same error as: https://github.com/Mr-Wiseguy/Zelda64Recomp/issues/46, where some other commenters were making progress. But after the README build instructions are updated it should be more clear what's left on macOS. (Again, not speaking from authority here, but it seems likely).
I'm trying to launch the .exe in CrossOver 24.0.1. I get the menu screen and can select a rom. My bluetooth controller even works which was great. Tried with D3DMetal and DXVK modes but same result:
But when I press 'Start Game' the screen is black and the audio plays but it's a little bit 'stuttery'. If I change some graphics settings then a light orange colour is displayed instead of the black background. That's as much as I can get with CrossOver/Wine
But if the build instructions get added then it would great to run it natively on MacOS :D
Support for Metal is an ongoing development over at the RT64 repository and some people have expressed interest in giving it a shot as I do not own Mac hardware to develop it myself or know enough about the platform.
You'll likely get issues with the existing translation layers and RT64's RHI has been designed in mind for Metal to be added as it's a natural fit for the API.
But when I press 'Start Game' the screen is black and the audio plays but it's a little bit 'stuttery'. If I change some graphics settings then a light orange colour is displayed instead of the black background. That's as much as I can get with CrossOver/Wine
Afaik these recomps require AVX when building for x86, which is not supported by Rosetta. Native ARM builds using NEON will have to be made.
For macOS Apple Silicon, I'm trying to figure out will clang work or do we need gcc, something like https://github.com/amlal-elmahrouss/homebrew-mips64 for cross-compilation? Or maybe it's possible to do the build in linux in a vm but built for Mac? I already have the uncompressed elf file from mm and rt64 metal branch. the first errors I get are clang (LLVM option parsing): Unknown command line argument '-mno-check-zero-division'. Try: 'clang (LLVM option parsing) --help' but if I remove that I get clang (LLVM option parsing): Unknown command line argument '-mips-ssection-threshold=0'. Try: 'clang (LLVM option parsing) --help' but that appears nowhere. After that I start to go down the rabbit hole of home brew mips64-elf-binutils, mips64-elf-gcc, mips-linux-gnu-gcc.
ARM64 compilation is already supported, and there's a branch for Darwin already as well. The bigger blocker is that the RT64 metal branch is not complete, so building this project for any form of MacOS won't get you anywhere. MoltenVK won't work either, so there's no real point in getting it to build on MacOS currently.
Once RT64's Metal backend is complete, MacOS support (including Apple silicon) for this project will be added.
Would be awesome on Apple Silicon. Do you think Apple's Game Porting Toolkit can be useful in any way? AFAIK, it translates DirectX to Metal.
Would be awesome on Apple Silicon. Do you think Apple's Game Porting Toolkit can be useful in any way? AFAIK, it translates DirectX to Metal.
GPTK runs an Intel Windows binary (they do not distribute an ARM DLL). This would not work as Rosetta does not support AVX which is required.
Would be awesome on Apple Silicon. Do you think Apple's Game Porting Toolkit can be useful in any way? AFAIK, it translates DirectX to Metal.
GPTK runs an Intel Windows binary (they do not distribute an ARM DLL). This would not work as Rosetta does not support AVX which is required.
I think they do now right? they just started supporting avx/2?
Rosetta and the Game Porting Toolkit won't be necessary for this project. Our more recent tests with MoltenVK have been much more successful than the earlier testing we did, and we've been able to get a native build running using it after all with some tinkering. Now we just need to spend some time optimizing the MoltenVK settings and do thorough testing before a release. Later on once the Metal backend for RT64 gets finished we'll move over to that, since it'll have better performance than going through MoltenVK.
Is there any build instructions you can point towards in Mac? I got near the end but I get a missing Vulkan error message, how would I point this towards MoltenVK?
`cmake -S . -B build-cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -G Ninja -DCMAKE_BUILD_TYPE=Release -- The C compiler identification is AppleClang 15.0.0.15000040 -- The CXX compiler identification is AppleClang 15.0.0.15000040 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The OBJC compiler identification is AppleClang 15.0.0.15000040 -- The OBJCXX compiler identification is AppleClang 15.0.0.15000040 -- Detecting OBJC compiler ABI info -- Detecting OBJC compiler ABI info - done -- Check for working OBJC compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped -- Detecting OBJCXX compiler ABI info -- Detecting OBJCXX compiler ABI info - done -- Check for working OBJCXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped CMake Error at CMakeLists.txt:21 (message): VULKAN_SDK environment variable is not set.
-- Configuring incomplete, errors occurred!`
@retropieuser looking at the CI workflow is a useful way to see how it’s being built: here
I don't know if it's easy to implement, but a macOS version of the project would be very cool. I think native Metal API support would be hard to implement, but since the Linux version uses Vulkan, you could use a translation layer like MoltenVK to translate the Vulkan API calls into Metal API calls and then create a macOS version. I know it's not that easy, and it needs more work than that, but at least it would be less work than a native Metal version.
https://github.com/Zelda64Recomp/Zelda64Recomp/actions/runs/9547047996/artifacts/1608275050 Found this under the WIP mac support. Currently in the intro and its working fine.
@AwayCoast23465 any tips on how to get this to work? It crashes immediately for me.
@AwayCoast23465 any tips on how to get this to work? It crashes immediately for me.
Have you installed what the Darwin branch wants you to have for building? thats all i can think of.
codesign --force --deep --sign - ~/Downloads/Zelda64Recompiled.app/Contents/MacOS/Zelda64Recompiled
codesign --force --deep --sign - ~/Downloads/Zelda64Recompiled.app/Contents/MacOS/Zelda64Recompiled
@cacaosteve Thank you this worked!
The code signing issue has been fixed -- you'll just need to allow the app to run via Security. Performance has also improved a bit!
The code signing issue has been fixed -- you'll just need to allow the app to run via Security. Performance has also improved a bit!
Perfect. So we could merge this and add to Homebrew now right?