How madebyjordan/longshot works
Longshot is a native Windows/Linux static recompilation of Ocarina of Time for Switch 2, not an emulator. Its user workflow starts with the user’s own game files, builds a local game folder with Longshot Builder, then runs the game; the README says both the builder and game-folder launcher check Longshot releases for updates. Internally, the sampled shader tool documents capture, lowering, Maxwell translation, and SPIR-V emission; the renderer’s draw path assembles WebGPU pipelines and submits draws. Several runtime connections are omitted because their call sites were not sampled.
Main entry points: shadertool.cpp Shader Tool · hookshot_builder.py Linux Builder · program.cpp Shader IR · hos.h Host Services
Components 23
Local Build
- Linux Builder
builder/linux/hookshot_builder.py - Windows Builder
builder/HookshotBuilder/MainWindow.xaml.cs - Game Builder
nx2/make_game.py - Release Updates
builder/linux/linux_update.py
Native Runtime
- Game Launcher
nx2/standalone.py
Shader Recompilation
- Shader Tool
gpu/shadertool.cpp - Ampere Lowering
gpu/vk/eden/shader_recompiler/frontend/ampere/lower_to_maxwell.h - Maxwell Frontend
gpu/vk/eden/shader_recompiler/frontend/maxwell/translate_program.h - Shader IR
gpu/vk/eden/shader_recompiler/frontend/ir/program.cpp - IR Blocks
gpu/vk/eden/shader_recompiler/frontend/ir/basic_block.h - IR Values
gpu/vk/eden/shader_recompiler/frontend/ir/value.h - IR Optimization
gpu/vk/eden/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp - SPIR-V Backend
gpu/vk/eden/shader_recompiler/backend/spirv/emit_spirv.h - Program Metadata
gpu/vk/eden/shader_recompiler/program_header.h
GPU Rendering
- Render Core
gpu/render/rx_core.cpp - Draw Pipeline
gpu/render/rx_draw.cpp - Renderer State
gpu/render/rx_internal.h - Vulkan Backend
gpu/vk/vk_main.cpp
Host Services
- Host Runtime
host/hos_main.c - Host Services
host/hos.h - Native NVN
host/nvn_native.c - Audio Services
host/nn_audio.c
Other components
- Game owner
Connections 23
- Game owner → Linux Builder: builds locally
- Game owner → Windows Builder: builds locally
- Linux Builder → Game Builder: invokes build
builder/linux/hookshot_builder.py - Game Builder → Game Launcher: creates game folder
nx2/make_game.py - Game Launcher → Host Runtime: starts runtime
- Host Runtime → Host Services: uses host API
- Host Services → Audio Services: provides audio
host/nn_audio.c - Host Services → Native NVN: provides graphics
host/nvn_native.c - Native NVN → Renderer State: uses renderer API
host/nvn_native.c - Render Core → Renderer State: uses shared state
gpu/render/rx_internal.h - Draw Pipeline → Renderer State: reads renderer state
gpu/render/rx_draw.cpp - Draw Pipeline → Vulkan Backend: uses Vulkan backend
- Shader Tool → Program Metadata: reads program header
gpu/shadertool.cpp - Shader Tool → Ampere Lowering: captures and lowers
gpu/shadertool.cpp - Shader Tool → Maxwell Frontend: translates instructions
gpu/shadertool.cpp - Shader Tool → SPIR-V Backend: emits SPIR-V
gpu/shadertool.cpp - Maxwell Frontend → Shader IR: produces program
- Shader IR → IR Blocks: uses blocks
gpu/vk/eden/shader_recompiler/frontend/ir/program.cpp - Shader IR → IR Values: dumps values
gpu/vk/eden/shader_recompiler/frontend/ir/program.cpp - IR Optimization → IR Blocks: rewrites blocks
gpu/vk/eden/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp - IR Optimization → IR Values: rewrites values
gpu/vk/eden/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp - Linux Builder → Release Updates: checks updates
builder/linux/hookshot_builder.py - Game owner → Release Updates: receives updates