ZL+ZR+L3 detaches the view from Link on 1.4.3 and flies it with the gamepad (freecam_pad)

The camera component update (main+0x628460) copies each component's eye, target and up into its sead camera. The site
freecam (main+0x6286d4, the load every path to that copy runs first) calls runtime/freecam.c freecam_hook, which
writes the component's one-shot eye and target overrides (+0x180, +0x198) while the free camera is on; the update
takes them in place of the pose and clears them, so the game camera's own state is never changed and resumes the
frame the free camera ends. The up vector is levelled through the component's up offset (+0x200), which is kept and
put back. Of the three components a frame updates, the hook drives the two that share the player camera's eye, leaves
the one at the default pose and picks again after a load; with the free camera off it does only the displaced load.

input.c freecam_gate latches TOTK_FREECAM_PAD (zl+zr+lstick when unset, none for no combo) like Minus+Plus and, while
the free camera is on, gives it the sticks, the trigger axes and L and R presses and the game nothing. The left stick
flies along the view and sideways, the triggers straight up and down, the right stick turns, each L or R press halves
or doubles the speed (0.25 to 512 m/s, 8 at the start); the flight follows the wall clock. TOTK_FREECAM_PATCH=0
removes the hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lebomisandClaude Opus 5.5 committed 2026-11-19 13:32:22 +11:00
1 parent 94c33b1d85
commit 29eec07245
9 files changed
+353 -4

No files matched your search

+9
View File
@@ -98,6 +98,15 @@ uint32_t input_pad_combo(const char *env, const char *s);
int input_pad_read(uint64_t *buttons, int32_t *lx, int32_t *ly);
// The gamepad layout in effect (PAD_LAYOUT_*, input_map.h; TOTK_PAD_LAYOUT, live); -1 without a gamepad. Any thread.
int input_pad_layout(void);
// Free camera (freecam.c). input.c switches it with TOTK_FREECAM_PAD and, while it is on, hands it the gamepad and
// gives the game none: sticks -1..1 with up +y after the dead zone, triggers 0..1; each L or R press is one speed click.
typedef struct { float lx, ly, rx, ry, lt, rt; } FreecamPad;
int freecam_available(void); // game 1.4.3 with the freecam patch set on
int freecam_on(void);
void freecam_toggle(void); // logs; input thread
void freecam_pad(const FreecamPad *p);
void freecam_speed_click(int faster); // R (1) doubles the speed, L (0) halves it
// How far the open gamepad's left (pct[0]) and right (pct[1]) sticks are from the centre now, in percent of full
// deflection, before the dead zone: the menu shows it on the dead zone rows, so a drifting stick's resting value can be
// read off. 0 (and both 0) without a connected gamepad. Any thread.