mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 10:19:57 -04:00
Make the direct mouse camera work on game 1.1.1.
mouse_mode = direct is the default, but on 1.1.1 it did nothing: only the 1.4.3 patch table had the sites, so the mouse always went through the stick emulation, which gives no turn at slow mouse speeds and tops out at about 107 degrees a second. The 1.1.1 table now has the set mouse_direct (on by default): at main+0x37c45c, where the camera's input update holds the processed stick in s1 and s0, a host call performs the displaced store and adds the raw mouse counts to both, so the mouse meets no dead zone and no curve; at main+0x37c4f0 a second call clears the idle bit for an update the mouse moved in. The counts are divided by the frames the game steps per update and by the stick camera speed, so the same hand movement turns the same angle at every frame rate. The Controls tab gets the mouse mode and mouse sensitivity rows, and mouse_mode = stick or NX2NAVI_MOUSE_DIRECT_PATCH=0 gives the old behaviour. Checked here: the generator lifts the 1.1.1 game with the two sites (it compares each site's original word), the lifted game compiles and links with the runtime, and tests/mouse_direct_check.py passes its 1.1.1 harness (register contract, displaced store and load, equal turn at every frame rate and stick speed, the reset pause, capture and mode). Not checked here: the game was not run, so aiming with the mouse was not tried, and the differential tests against Unicorn were not run because no Python on this PC has Unicorn. The contributor measured 0.0800 degrees per count on both axes in the game. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit bb8fecfbe43517006eafd7be9c22e8dbe9601de7)
This commit is contained in:
@@ -59,6 +59,20 @@ site osolver main 38afd20 1e380001 1e280001
|
||||
# manager, last read at main+0xa682ec, and every path from the site reaches a call before it reads x13 again.
|
||||
site opickup main a68300 1e38000c 1e38000c 5ac0118d 53057dad 0b0d018c # fcvtzs w12, s0; clz w13, w12; lsr w13, w13, #5; add w12, w12, w13
|
||||
|
||||
# Mouse camera: the camera's stick input update (main+0x37c300) puts the right stick through a radial dead zone of
|
||||
# 0.005, scales the radius to one, clamps it and raises it to StickExponent (2, the default of
|
||||
# game__component__PlayerCameraParam); then come the reset timer at +0x5e0 (the stick reads zero while it runs), the X/Y
|
||||
# inversion (w21 bits 1 and 2) and the idle test (flags +0x530 bit 4: the processed stick under 10%). At 37c45c s1 and
|
||||
# s0 hold the processed x and y for the stores at +0x538 and +0x53c: the host callback performs the displaced store of
|
||||
# s1 and adds the raw mouse counts to both (runtime/mouse_direct.c camera_input_oot), so the mouse never becomes a stick
|
||||
# value and meets no dead zone or curve. At 37c4f0, the displaced ldp d9, d8, [sp, #0x10] before the update's last
|
||||
# `str w8, [x20, #0x530]`, w8 holds the flags: a second callback clears the idle bit for an update the mouse moved in
|
||||
# (camera_activity_oot). x30 is the function's own saved one at both sites. The callbacks' addresses are page +0xfd0
|
||||
# and +0xfc0; the page is main+0x4ea0000 on this build.
|
||||
set mouse_direct NX2NAVI_MOUSE_DIRECT_PATCH 1
|
||||
site mouse_direct main 37c45c bd053a81 952c92dd # str s1, [x20, #0x538] -> bl page+0xfd0
|
||||
site mouse_direct main 37c4f0 6d4123e9 952c92b4 # ldp d9, d8, [sp, #0x10] -> bl page+0xfc0
|
||||
|
||||
# Game image: the graphics setup (main+0x1202ce0) fills the renderer's configuration with the size of the picture the
|
||||
# game presents, 2560x1440 at every console mode (config +0x14, copied to renderer +0x9c, which main+0x346be50 reads
|
||||
# for the main render target set, main+0xf49040), and the display settings object (main+0x31f3890) stores the same size
|
||||
|
||||
Reference in New Issue
Block a user