From 609bb732b9f17bd1400b3ae789b65c4ec0f63241 Mon Sep 17 00:00:00 2001 From: James Dansereau <106631954+jkdansereau@users.noreply.github.com> Date: Sun, 30 Aug 2026 20:49:50 -0400 Subject: [PATCH] M-29: aim sensitivity fix (BACKLOG B3 / SMALL-FIXES B4) port/src/input.c: RMB manual-aim mouse sensitivity overshot badly at the old MouseAimSpeed=50 default (25 px/poll saturated the aim band, so a flick ran GE's (stick-60)/10 curve at full rate for many polls). Lower the default to 25 and expose the band itself as Input.AimBand (int 5..40, default 20 -> unchanged behaviour at the new speed). Port-only, config- backed, fully reversible via ge007.ini. port/fast3d/gfx_pc.cpp: annotate the dead D74 texture-wrap block (SMALL-FIXES B1). The in-place correction (G_TX_CLAMP test + per-texunit index) activates never-run code and crashes -level_09 at boot; it needs the hoist-out-of-vertex-loop rework + per-level visual verification, not a one-liner. Left inert with a NOTE; no behaviour change. Verified: build green (ntsc-final); -level_09 + -level_20 crash-free for a full ~75s capture window on a settled machine (D153: earlier back-to- back runs crashed under build/run thrash, not a regression). --- port/fast3d/gfx_pc.cpp | 7 +++++++ port/src/input.c | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/port/fast3d/gfx_pc.cpp b/port/fast3d/gfx_pc.cpp index 7d5f6250..3906f0ee 100644 --- a/port/fast3d/gfx_pc.cpp +++ b/port/fast3d/gfx_pc.cpp @@ -1567,6 +1567,13 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo // sub-region of the image (uls/ult offset + lrs/lrt window); GL // would wrap at the full uploaded image size instead. Pre-wrap per // vertex (GE/PD triangles never span more than one tile period). + // NOTE (SMALL-FIXES B1, DEFERRED): this block's guard is dead + // (`& G_TX_WRAP` == `& 0`) and its indices are OOB (`[i]` is the + // vertex, arrays are per-texunit [2]). Correcting it to + // `(cms & G_TX_CLAMP) == 0` + `[t]` activates never-run code and + // crashed -level_09 at boot (0 frames) -- needs the hoist-out-of- + // -loop rework + per-level visual verification, not an in-place + // one-liner. Left inert for now. { const uint32_t tw = tex_width2[i]; const uint32_t th = tex_height2[i]; diff --git a/port/src/input.c b/port/src/input.c index 00a81cca..52f6d393 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -114,7 +114,6 @@ * hide that so mouse-down looks down by default; MouseInvertY flips it. */ #define MOUSE_TURN_GAIN 6.0 /* hipfire: raw px this poll -> stick-X counts */ #define MOUSE_PITCH_THRESH 1.5 /* hipfire: px/poll before a C-button fires */ -#define AIM_BAND 20 /* aim mode: usable stick range above the 60 gate */ #define AIM_GAIN 4.0 /* aim mode: px/poll -> counts into the band */ #define AIM_MOVE_THRESH 0.5 /* aim mode: px/poll before the stick moves */ @@ -125,7 +124,8 @@ static SDL_GameController *pads[MAX_PADS]; static int mouseEnabled = 1; static int mouseGrabbed = 1; /* released while the window is unfocused */ -static int mouseAimSpeed = 50; /* aim-mode sensitivity, percent */ +static int mouseAimSpeed = 25; /* aim-mode sensitivity, percent (B3: was 50, overshot) */ +static int aimBand = 20; /* aim mode: usable stick range above the 60 gate */ static int mouseTurnSpeed = 100; /* hipfire yaw sensitivity, percent */ static int mouseInvertY = 0; /* 1 = mouse-down looks up */ static int mouseYScale = 100; /* extra vertical (pitch) sensitivity, % */ @@ -471,11 +471,11 @@ unsigned inputComputePad(int idx, signed char *stick_x, signed char *stick_y) double gx = fabs(edx) * (mouseAimSpeed / 100.0) * AIM_GAIN; double gy = fabs(dyLook) * (mouseAimSpeed / 100.0) * AIM_GAIN; if (fabs(edx) >= AIM_MOVE_THRESH) { - int m = 61 + (int)gx; if (m > 60 + AIM_BAND) m = 60 + AIM_BAND; + int m = 61 + (int)gx; if (m > 60 + aimBand) m = 60 + aimBand; sx += (edx > 0) ? m : -m; } if (fabs(dyLook) >= AIM_MOVE_THRESH) { - int m = 61 + (int)gy; if (m > 60 + AIM_BAND) m = 60 + AIM_BAND; + int m = 61 + (int)gy; if (m > 60 + aimBand) m = 60 + aimBand; sy += (dyLook > 0) ? m : -m; /* +stick_y = look down */ } } else { @@ -609,6 +609,7 @@ PD_CONSTRUCTOR static void inputConfigInit(void) { configRegisterInt("Input.MouseEnabled", &mouseEnabled, 0, 1); configRegisterInt("Input.MouseAimSpeed", &mouseAimSpeed, 1, 500); + configRegisterInt("Input.AimBand", &aimBand, 5, 40); configRegisterInt("Input.MouseTurnSpeed", &mouseTurnSpeed, 1, 500); configRegisterInt("Input.MouseInvertY", &mouseInvertY, 0, 1); configRegisterInt("Input.MouseYScale", &mouseYScale, 1, 500);