How ly05010419/macnativegames works
MacNativeGames builds native Apple-silicon ports of Tears of the Kingdom and Breath of the Wild from a player's own Switch files. The main user journey is to provide a game image and keys, build an app, then run the game's ARM64 code with host implementations of Switch services and graphics/audio. The graph includes the documented shader preparation and contribution workflow. Source excerpts are partial, so internal links not established by those excerpts or the README are omitted or marked unverified.
Main entry points: loader.c Guest loader · ipc.h Horizon IPC · build_app.py App builder · shader_list.py Shared shader list
Components 19
Game preparation
- Game image and keys
- App builder
build_app.py - Game extraction
games/totk/scripts/extract_update_romfs.py - Module preparation
games/totk/scripts/prepare_modules.py
Native runtime
- Guest loader
games/totk/runtime/loader.c - Horizon IPC
games/totk/runtime/ipc.h - Host services
games/totk/runtime/services.c - Settings service
games/totk/runtime/settings_service.c - Thread compatibility
games/totk/runtime/threads.c - Game filesystem
games/totk/runtime/romfs.c - Game patches
games/totk/runtime/game_patches.c
Graphics and audio
- Metal graphics bridge
games/totk/runtime/gfx_bridge.c - Audio renderer
games/by3/runtime/audio_renderer.c - Audio mixer
games/by3/runtime/audio_mixer.c
Shader workflow
- Shared shader list
games/totk/scripts/shader_list.py - Shader translator
games/totk/tools/totk_xlate/Program.cs - iOS shader fill
games/totk/ios/tools/fill_shaders.py - Shader contributions
games/totk/ios/tools/shader_contrib_watch.py
Other components
- Player
Connections 18
- Player → Game image and keys: provides
README.md - Game image and keys → App builder: builds with
README.md - App builder → Game extraction: prepares game data
- App builder → Module preparation: prepares modules
- Module preparation → Guest loader: loads game code
- Guest loader → Horizon IPC: dispatches services
- Host services → Horizon IPC: serves requests
games/totk/runtime/services.c - Settings service → Horizon IPC: handles requests
games/totk/runtime/settings_service.c - Thread compatibility → Horizon IPC: uses IPC handles
games/totk/runtime/threads.c - Guest loader → Game filesystem: accesses game files
- Guest loader → Game patches: applies patches
- Metal graphics bridge → Shader translator: translates at runtime
- Audio renderer → Audio mixer: mixes audio
games/by3/runtime/audio_renderer.c - Player → Shared shader list: contributes shader data
README.md - Shared shader list → Shader translator: seeds shader preparation
- iOS shader fill → Shader translator: requests translation
games/totk/ios/tools/fill_shaders.py - iOS shader fill → Shared shader list: updates cache index
games/totk/ios/tools/fill_shaders.py - Shader contributions → Player: requests submission
games/totk/ios/tools/shader_contrib_watch.py