Fix throttle-detent Abs() macro bug + KB analog-throttle + slide diagnostics (task #50)

Uncommitted work from the speed-model + peer-motion investigation:
 - btl4mppr.cpp: the L4MechControlsMapper full-throttle detent used the
   unparenthesized Abs() macro (STYLE.H:118) on an expression -- Abs(throttlePos
   - 1.0f) mis-expands to -(throttlePos + 1.0f), always <= 0.05, so the detent
   snapped throttle to full EVERY frame.  Diff into a temp first (same class as
   the 7615ecd angular-resync Abs fix).
 - context/pod-hardware.md: document the decomp-verified analog-continuous pod
   throttle path (RIO Ranger 0-800 counts, 0.05 deadband, no notching; '5 speeds'
   is false) from workflow w0odszxro.
 - mech4.cpp: BT_SLIDE/[mslide] per-frame slide diagnostics (peer position moving
   while legs in stand; master decel profile) -- used to prove the stop-slide is a
   peer leg-SM-winds-down-early desync, not master momentum.  Env-gated.

The 'pretty good' coupled-motion gameplay state is already shipped (a9ab3db).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-14 22:13:56 -05:00
co-authored by Claude Opus 4.8
parent a9ab3db952
commit 3792a04661
3 changed files with 75 additions and 1 deletions
+6 -1
View File
@@ -349,7 +349,12 @@ L4MechControlsMapper::MessageHandlerSet&
//
// (1) Full-throttle detent.
//
if (Abs(throttlePosition - 1.0f) <= 0.05f) // _DAT_004d1ac0 / _DAT_004d1ac4
// NB: the Abs() macro (STYLE.H:118) is unparenthesized -- Abs(throttlePosition
// - 1.0f) mis-expands to -(throttlePosition + 1.0f) on the false branch (always,
// since throttle <= 1), which is <= 0.05 UNCONDITIONALLY -> the detent used to
// snap throttle to full every frame. Diff into a temp so the macro sees one token.
const Scalar _thrOff = throttlePosition - 1.0f;
if (((_thrOff < 0.0f) ? -_thrOff : _thrOff) <= 0.05f) // _DAT_004d1ac0 / _DAT_004d1ac4
{
throttlePosition = 1.0f; // @0x11c
}