How itsnotrexed/hookshot works
Hookshot is a native Windows/Linux static recompilation of Ocarina of Time for Switch 2: the player supplies game files, and Hookshot builds a PC game that runs with a reimplemented system layer and Vulkan graphics. The README documents the build-and-play workflow and major features; sampled code shows the shader translation stages and NVN command recording. Several runtime subsystems are represented by their exact enclosing directories because their implementation files were not sampled, so those links are documented or marked unverified.
Main entry points: hos_main.c Native game · BuilderHome.cs Hookshot Builder · program.h Shader IR · hookshot_builder.py Linux Builder
Components 23
Build and launch
- Hookshot Builder
builder/HookshotBuilder/BuilderHome.cs - Linux Builder
builder/linux/hookshot_builder.py
Game runtime
- Native game
host/hos_main.c - System reimplementation
host - Input and audio
host - Mods and saves
host
Graphics and shaders
- NVN recording
host/nvn_native.c - Vulkan renderer
gpu/vk - Shader capture
gpu/vk/eden/shader_recompiler/frontend/ampere/program_capture.h - Ampere lowering
gpu/vk/eden/shader_recompiler/frontend/ampere/lower_to_maxwell.h - Maxwell control flow
gpu/vk/eden/shader_recompiler/frontend/maxwell/control_flow.h - Shader translation
gpu/vk/eden/shader_recompiler/frontend/maxwell/translate_program.cpp - Shader IR
gpu/vk/eden/shader_recompiler/frontend/ir/program.h - IR optimization
gpu/vk/eden/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp - SPIR-V emission
gpu/vk/eden/shader_recompiler/backend/spirv/emit_spirv.cpp - Pipeline cache
gpu/vk/pipeline_cache_file.h
Player features
- Menu and debug tools
gpu/vk - Upscaling and framegen
gpu/vk - Save editor
nx2/saveedit/server.py - Save backups
builder/HookshotBuilder/Saves.cs
Other components
- Player
- Game files
- Update service
Connections 26
- Player → Hookshot Builder: starts build
- Player → Linux Builder: starts build
- Game files → Hookshot Builder: supplies files
- Game files → Linux Builder: supplies files
- Hookshot Builder → Native game: builds game
- Linux Builder → Native game: builds game
- Player → Native game: launches
- Native game → System reimplementation: uses
- Native game → Input and audio: uses
- Native game → Mods and saves: loads
- Player → Menu and debug tools: configures
- Menu and debug tools → Upscaling and framegen: selects
- Native game → NVN recording: records GPU calls
host/nvn_native.c - NVN recording → Vulkan renderer: replays commands
host/nvn_native.c - Shader capture → Ampere lowering: lowers shaders
nx2/bake_ds/bake_ds.cpp - Ampere lowering → Maxwell control flow: builds CFG
nx2/bake_ds/bake_ds.cpp - Maxwell control flow → Shader translation: translates program
- Shader translation → Shader IR: produces IR
- Shader IR → IR optimization: optimizes
gpu/vk/eden/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp - Shader IR → SPIR-V emission: emits SPIR-V
- SPIR-V emission → Vulkan renderer: provides shaders
- Vulkan renderer → Pipeline cache: caches pipelines
- Player → Save editor: edits saves
- Save editor → Save backups: writes with backups
- Player → Update service: gets updates
- Update service → Hookshot Builder: updates launcher