Add a free camera to the debug menu.

With it on, the game draws from a camera of the menu's instead of its own, in play and in cutscenes. The left stick moves it along its view and sideways, the right stick turns it, ZR and ZL raise and lower it, R makes it faster and L slower, and Link stands meanwhile; or the camera stays where it is and the pad plays the game.

It works inside the game's own camera update: a new patch site sends the instruction at which the frame's position, target and up vector are final to a host function, which replaces them for the camera that follows Link and the one the events direct, so the game draws, culls and loads detail for what the free camera sees. The camera of the interface's 3D models and the one the sound follows stay the game's. The set is off unless the menu switches it on. A teleport's arrival starts the free camera again from the game's view.

Tested in Hyrule Field with scripted stick input (turn, rise, strafe, with Link's position unchanged), with the pad playing while the camera stays, across a teleport to Kakariko Village, during the Kakariko arrival cutscene, and switched on by a click in the menu.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
epicmeme546
2026-11-11 08:04:19 -05:00
parent fe3126e9a7
commit b59c0d40a8
11 changed files with 207 additions and 15 deletions

View File

@@ -19,6 +19,7 @@ set res_fixed NX2NAVI_PATCH_RES_FIXED 0
set ostep NX2NAVI_OCARINA_REALTIME 1
set zstd NX2NAVI_ZSTD_NATIVE 1
set osolver NX2NAVI_PHYSICS_STEPS 1
set freecam NX2NAVI_PATCH_FREECAM 0
# Real-time step: the framework's per-frame update (main+0x6e6be0) gives the time manager **[main+0x4c7e890] its
# nominal frame through main+0x3b4e300 (+0x10 frames per update, +0x14 the inverse, +0x18 seconds, +0x1c the rate),
@@ -122,3 +123,11 @@ site zstd main e910c 9400089d 9536dfb9 # bl ZSTD_decompressMultiFrame -> page
site zstd main bf72e0 97d3d028 950aa744 # bl ZSTD_decompressMultiFrame -> page+0xff0
site zstd main f50164 97c66c87 94fd43a3 # bl ZSTD_decompressMultiFrame -> page+0xff0
site zstd main f5c2c 94000015 9536acd5 # bl the stream feed -> page+0xf80
# The debug menu's free camera (runtime/debug_tools.c dbg_freecam_host; switched on by the menu, never by a setting). The
# camera update (main+0x4c48c0) chooses the frame's position and target (doubles) and up vector between the camera's
# own and an override; every path of that choice joins at main+0x4c4e50 with them in d0-d2, d3-d5 and s7, s16, s6,
# before they are stored into the look-at camera and its matrix is made. That instruction goes to the host function
# on the patch page (+0xf70), which puts the free camera's vectors into those registers and does the instruction's
# own work.
site freecam main 4c4e50 1e624011 95277048 # fcvt s17, d0 -> bl page+0xf70