mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-22 13:05:57 +00:00
Merge pull request #1213 into task/pr1213
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
53f9e9bb5f
16 files changed
+562
-11
No files matched your search
@@ -129,6 +129,39 @@ bind_X = pad:west, key:space
|
||||
bind_Y = pad:north, key:mouse_l
|
||||
```
|
||||
|
||||
## Free camera
|
||||
|
||||
On game 1.4.3, a chosen gamepad combo or a key steps the free camera through three stages: move, lock, and off again.
|
||||
Neither is set by default: pick them with `freecam_pad` and `freecam_key` in `totk.ini` or on the Controls tab (for
|
||||
example ZL+ZR+L3, LT+RT+L3 on an Xbox pad, and F2; `none` turns one off). An input script can press the combo as a
|
||||
gamepad would; the keys bound to its buttons do not. While the free camera moves, the world goes on but the game gets
|
||||
no input, so Link stands where he was.
|
||||
|
||||
Locked, the view stays where the flight left it and the game gets its input back. Link walks where the left stick
|
||||
points on screen, as the game steers him by the camera it draws. The right stick and the mouse turn the game camera,
|
||||
which still follows Link unseen.
|
||||
|
||||
| Gamepad | Keyboard and mouse (default bindings) | Free camera |
|
||||
|---|---|---|
|
||||
| Left stick | W A S D | forward and back along the view, and sideways |
|
||||
| ZR / ZL (RT / LT) | X / Z | straight up / down; a trigger by how far it is pressed |
|
||||
| Right stick | mouse, arrow keys | turn (yaw and pitch; pitch stops 5 degrees short of straight up or down) |
|
||||
| R / L (RB / LB) | R / Q | each press doubles / halves the speed, 0.25 to 512 m/s |
|
||||
|
||||
The keys are the ones bound to the left and right stick and to ZR, ZL, R and L (`bind_` lines), so remapped keys follow.
|
||||
The mouse turns the free camera at the game camera's rate (0.08 degrees a count at `mouse_sens = 1`) and the game's
|
||||
mouse camera gets none of it meanwhile. Each switch starts at the game camera's position and view at 8 m/s; the speed
|
||||
follows the clock, so it is the same at any frame rate and game speed. The horizon stays level.
|
||||
|
||||
How it works (`runtime/freecam.c`): the camera component update (main+0x628460) copies each component's eye, target
|
||||
and up into its sead camera. The site `freecam` (`recomp/patches-v143.txt`, main+0x6286d4) runs before that copy and
|
||||
writes the component's one-shot eye and target overrides (+0x180, +0x198), which the update takes in place of the pose
|
||||
and then clears, so the game camera's own state is never changed and resumes the frame the free camera ends. Locked,
|
||||
the site keeps writing the overrides without moving them. 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 free camera drives the two that share the player camera's eye and leaves the one at the default pose
|
||||
(eye 0, 0, 10). After a load replaced the components it picks the new ones and keeps its position.
|
||||
|
||||
## Mouse camera
|
||||
|
||||
`mouse_mode = direct` (the default) turns the camera by the raw mouse motion on games 1.4.3 and 1.2.1, through hooks in the game's camera code (`runtime/mouse_direct.c`, the `mouse_direct` sites of `recomp/patches-v143.txt` and `recomp/patches-v121.txt`). None of them changes a step of the gamepad alone. The free-orbit camera receives raw-count
|
||||
|
||||
@@ -232,6 +232,7 @@ These names are code patch sets built into the generated game code (`recomp/patc
|
||||
| `aspect_patch` (default `0`) | Patch set that feeds the camera the output's aspect ratio when it is not 16:9. | The resolution code switches this set on or off itself at start, so a value here is replaced; the code does not settle what a manual value does. | Unknown |
|
||||
| `audio_drain_fix` (default `1`) | Patch set that sends the game's audio thread back to its command ring after each list (1.2.1 main+0x883780, 1.4.3 main+0x149244), so it takes every queued list per 5 ms audio frame instead of one (#337). Game 1.1.0 has no site and keeps the game's code. | `0` runs the game's code as shipped: above about 200 game updates a second the ring fills, and the game's guard (1.2.1 main+0x9bcdc4) switches the sound commands off until the game is restarted once 300 updates in a row find it full. The guard starts over whenever two audio frames fall between two updates, so by the code it fires only while the audio frames come evenly, 5 ms apart: with `audio = none`, or while the audio device takes nothing and the mixer keeps time by its own timer. The guard's count and the switch have not been read in a run. With a device playing the game kept its sound in every run on Linux with PipeWire and 1024-frame device periods, where the frames come in bursts after each period; on Windows the bursts are read from the code (`gap_ns = 0` in `runtime/audren.c`), not measured; a device with periods of 240 frames or less was not tried and may pace as evenly as the timer. The set acts only when more than one list is queued, so below that rate it seldom changes anything. Measured at `fps_limit = 240` (Linux, PipeWire), seconds with sound with `0` and with `1`. On 1.2.1: without a device 6 of 119 and 111 of 119; with a device 111 of 119 and 112 of 119; with the game's stream paused for 5 s from outside (`pw-cli`, not a real device stalling) 4 of 120 (silent from the pause on, also after the device resumed) and 113 of 119; a pause of 2 s silenced the game with `0`, a pause of 1 s did not. On 1.4.3: without a device 3 of 119 and 113 of 120; with a device 111 of 119 with `0`; with the stream paused for 5 s, in 60 s runs, 3 of 59 and 51 of 59; a pause of 2 s with `0`, 4 of 59. | Safe |
|
||||
| `fixed_res_patch` (default `0`) | Patch set that holds the game's dynamic resolution at 100 percent (the scene tier). | The resolution code switches this set from `dynamic_res` (on at `0`); a manual value is replaced. | Unknown |
|
||||
| `freecam_patch` (default `1`) | Patch set of the hook in the camera component update behind the free camera (`freecam_pad`) on game 1.4.3. | `0` removes the hook: the free camera combo does nothing and the game gets the combo's buttons. | Safe |
|
||||
| `fov_patch` (default `0`) | Patch set that scales the camera's vertical view angle by the field-of-view setting. | The resolution code switches this set itself whenever the field of view is not 100 percent; a manual value is replaced. | Unknown |
|
||||
| `mouse_direct_patch` (default `1`) | Patch set of the hooks in the game's camera code behind `mouse_mode = direct` on game 1.4.3. | `0` stops `mouse_mode = direct` from taking effect; other mouse modes are unaffected. | Safe |
|
||||
| `optref_guard` (default `1`) | Patch set that treats a negative value in the optional reference at object +0x6b0 (1.4.3 main+0x1bd01c0, 1.2.1 main+0x1622bec) as absent instead of loading through it (#1005). | `0` runs the game's code as shipped: the random crash reading `0xffffffffffffffff` after minutes to hours of play can return. | Risky |
|
||||
|
||||
Reference in new issue
Block a user