diff --git a/game/reconstructed/mechmppr.cpp b/game/reconstructed/mechmppr.cpp index 8cffb05..c6bd9de 100644 --- a/game/reconstructed/mechmppr.cpp +++ b/game/reconstructed/mechmppr.cpp @@ -704,6 +704,29 @@ void // after the push, immediately before interpretation -- making the keyboard // authoritative on the dev box. Interpretation below stays 100% authentic. // + // BENCH (BT_MODECYCLE_EVERY=): cycle the control mode every n + // InterpretControls calls, driving the SAME body the 'M' key and the pod + // console button (key 0x13d -- not a RIO button, so BT_BTNTEST cannot press + // it) drive. Dev-only; default off. + // + // ⚠ DELIBERATELY OUTSIDE the key-bridge block below. The ONLY caller of + // ClearRecenterCommand() lives inside that block, so forcing BT_KEY_BRIDGE=1 + // to make this hook run would ALSO switch on the one thing that clears + // centerCommand -- masking the very bug under test. That is exactly how the + // first run of modecycle.sh came back clean. Keeping the hook out here lets + // the bench reproduce the RIO-present (glass/PadRIO) configuration, where the + // bridge is OFF and nothing clears the cell. + { + static const char *s_mcEvery = getenv("BT_MODECYCLE_EVERY"); + if (s_mcEvery != 0) + { + static int s_mcN = 0; + int period = atoi(s_mcEvery); + if (period < 1) period = 300; + if (++s_mcN % period == 0) + CycleControlModeNow(); + } + } { // STAND-DOWN (glass-cockpit step 2c): BT_KEY_BRIDGE unset = AUTO -- // the bridge runs only when NO live cockpit device (serial RIO / @@ -868,23 +891,6 @@ void gBTModeCycle = 0; CycleControlModeNow(); } - // BENCH (BT_MODECYCLE_EVERY=): cycle the control mode every n - // InterpretControls calls. mech4's BT_MODECYCLE_TEST hook sits in - // a scope whose frame counter did not advance in a solo run, and - // the pod's own route is console key 0x13d -- not a RIO button, so - // BT_BTNTEST cannot press it. This drives the SAME body the key - // and the console button drive. Dev-only; default off. - { - static const char *s_mcEvery = getenv("BT_MODECYCLE_EVERY"); - if (s_mcEvery != 0) - { - static int s_mcN = 0; - int period = atoi(s_mcEvery); - if (period < 1) period = 300; - if (++s_mcN % period == 0) - CycleControlModeNow(); - } - } // Gitea #6: 'N' cycles the secondary screen's schematic // (Damage -> Critical -> Heat) -- the same body the pod's // status-info-center button message drives. diff --git a/game/reconstructed/torso.cpp b/game/reconstructed/torso.cpp index a3842ce..a7e15ec 100644 --- a/game/reconstructed/torso.cpp +++ b/game/reconstructed/torso.cpp @@ -618,6 +618,30 @@ void if (lsw != 0 && s_lockSweep <= 0.0f) s_lockSweep = 0.12f; if (s_lockSweep > 1.0f) s_lockSweep = 1.0f; } + // BENCH (BT_TWIST_PULSE=): deflect the analog twist axis for n ticks, + // then RELEASE it for n ticks, repeating. BT_LOCK_SWEEP never releases, + // so it cannot show the reported symptom: with a stuck centerCommand the + // torso holds while you are actively pushing (the analog arm clears + // recenterActive) and snaps back the moment you let go (centerCommand + // re-arms it) -- "the torso centering FOUGHT my control". Measure the + // RELEASE windows: currentTwist should HOLD, not decay toward 0. + { + static const char *s_tp = getenv("BT_TWIST_PULSE"); + if (s_tp != 0) + { + static int s_tpN = 0; + int period = atoi(s_tp); + if (period < 1) period = 120; + const int phase = (s_tpN++ / period) % 2; + analogTwistAxis = phase ? 0.0f : 0.6f; + if ((s_tpN % 30) == 0) + DEBUG_STREAM << "[twistpulse] phase=" << (phase ? "RELEASE" : "deflect") + << " axis=" << analogTwistAxis + << " twist=" << currentTwist + << " ctrCmd=" << centerCommand + << " recen=" << recenterActive << "\n" << std::flush; + } + } if (s_lockSweep > 0.0f) { effectiveTwistRate = baseTwistRate; diff --git a/scratchpad/night13/modecycle.sh b/scratchpad/night13/modecycle.sh index f378522..7e0ae38 100644 --- a/scratchpad/night13/modecycle.sh +++ b/scratchpad/night13/modecycle.sh @@ -40,7 +40,7 @@ bt_expert_egg MP.EGG MC.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" MC.EGG ( export BT_MODECYCLE_EVERY=400 - export BT_TORSO_LOG=1 BT_KEY_NOFOCUS=1 BT_KEY_BRIDGE=1 ${LEGACY:+BT_LEGACY_MODE_RECENTER=1} + export BT_TORSO_LOG=1 BT_KEY_NOFOCUS=1 BT_KEY_BRIDGE=0 BT_TWIST_PULSE=150 ${LEGACY:+BT_LEGACY_MODE_RECENTER=1} bt_launch mc_a.log MC.EGG 0x03 ) sleep 150 bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe > /dev/null 2>&1; sleep 3