From 6b9a54089cd940e40f8e4855803ec5b41494b927 Mon Sep 17 00:00:00 2001 From: Cyd Date: Mon, 3 Aug 2026 14:55:36 -0500 Subject: [PATCH] BT410 5.3.104: turn-in-place -- the mech STEPS around at a standstill instead of pivoting like a statue The dispatcher (master perf @0x4aa505-0x4aa588, from the raw disasm -- the function Ghidra never decompiled), re-hosted at the gait seam in Simulate: From Standing, arm the trn clip when the mech is TURNING (the binary's operand is |angularVelocity| > 1e-4; at a standstill the turn rate is exactly walkingTurnRate, so the test is turnDemand * walkingTurnRate), the speed demand sits in the FULL sub-walk band [0, standSpeed], the model carries a trn clip (turnCapable, real since 5.3.103), and the wind-down debounce is clear. BOTH channels arm on the same frame -- the lockstep weld. Arming only the leg lets the body enter its next cycle frames apart and the two walk cycles run permanently out of phase (the donor's rhythmic-gait-skip finding). Each trn clip plays one figure and drops back to Standing via the case-4 group, so a held turn re-arms clip after clip. The debounce is the master perf's own shape: legResetLatch cleared at the top of every frame (@0x4a9bff), set by the advancer's wind-down, honoured here -- a walk that wound down THIS frame cannot re-enter as a turn until the next. LIVE (new pod_render_trn.conf: throttle 0, turn 0.5, exterior clips): pos PINNED at (-641.043, 0, -243.722) across the whole run yaw sweeping the full circle spd oscillating +/-0.001347 That last number is the proof of authenticity: it is the trn clip's authored root translation -- the foot shuffle. The mech turns by STEPPING, not by having its yaw slid underneath it, and the stride-driven speed model shows the steps. Co-Authored-By: Claude Fable 5 --- emulator/render-bridge/pod_render_trn.conf | 87 ++++++++++++++++++++++ restoration/source410/BT/MECH.CPP | 39 ++++++++++ 2 files changed, 126 insertions(+) create mode 100644 emulator/render-bridge/pod_render_trn.conf diff --git a/emulator/render-bridge/pod_render_trn.conf b/emulator/render-bridge/pod_render_trn.conf new file mode 100644 index 00000000..ec496a36 --- /dev/null +++ b/emulator/render-bridge/pod_render_trn.conf @@ -0,0 +1,87 @@ +# pod_render_norio.conf -- pod_render_rec with the RIO serial port OFF. +# +# The emulator log shows a steady stream of serial1 RX OVERRUN errors on +# the RIO pipe, and controls post their events at HighEventPriority +# UNCONDITIONALLY (CONTROLS.HPP:250) -- so a chattering RIO port would +# flood a priority the background pump always serves first, starving the +# priority-0 renderer events the load gate waits on. This conf tests that +# by removing the port entirely. Everything else is identical to the rec +# conf, so a launch here and a hang there isolates the RIO. +# +[sdl] +output=opengl +# higher,higher not highest: HIGH_PRIORITY_CLASS starved the host desktop; +# with the retry patches a rare dropout self-recovers (see gauge_rio.conf). +priority=higher,higher +[dosbox] +memsize=32 +machine=svga_s3 +[cpu] +core=dynamic +cputype=pentium +cycles=max +[sblaster] +sbtype=sb16 +sbbase=220 +irq=5 +dma=1 +hdma=5 +[mixer] +# match the EMU8000s' native rate (no resample) and buffer ~60ms so brief +# emulation-thread stalls (RIO retry recovery) don't audibly chop +rate=44100 +blocksize=1024 +prebuffer=60 +[serial] +# RIO on COM1 with the low-latency options (rxpollus/rxburst) so the board's +# few-ms ACK deadline is met; plasma display on COM2 (real pod has both). +# VWE fork namedpipe backend (com0com/realport retired -- COM1/COM2 gone): +# DOSBox = pipe client (retry), vRIO/vPLASMA apps = servers; an unconnected +# pipe behaves as an unplugged cable so the mission still runs. serialnamedpipe.h +serial1=disabled +serial2=namedpipe pipe:vplasma +# live UNBUFFERED game output: DOS char devices are not buffered, so +# redirecting stdout to COM3 lands every line immediately. A normal +# '> file' redirect stays 0 bytes until the process exits, which hides +# all progress on a run that does NOT crash. +serial3=file file:C:\VWE\TeslaRel410\emulator\render-bridge\podlog.txt +[autoexec] +mount c "C:\VWE\TeslaRel410\ALPHA_1" +c: +cd \REL410\BT +set VIDEOFORMAT=svga +rem production pod card init (PARAMETR.BAT:181-186): DIAGNOSE + AWEUTIL per +rem card -- AWEUTIL /S does the EMU8000 bring-up and DRAM detect the HMI SOS +rem driver relies on; skipping it left the cards uninitialized (silent). +rem aweutil /s SKIPPED for now: it verifies the AWE32 GM ROM, which the +rem emulated cards lack (hangs in a retry loop) -- restore once the ROM is +rem dumped from a real card. diagnose /s kept (passes, sets mixer config). +set BLASTER=A220 I5 D1 H5 P330 T6 +c:\sb16\diagnose /s +set BLASTER=A240 I7 D3 H6 P300 T6 +c:\sb16\diagnose /s +set BLASTER=A220 I5 D1 H5 P330 T6 +set TEMP=c:\ +rem arena1 city mission (TESTARN.EGG: map=arena1, time=day) with the RIO +rem attached; stdout redirected so mission-load progress survives kills. +set BT_JOINTS=1 +set L4VIEWEXT=1 +set BT_MECH_LOG=1 +set BT_MAP_LOG=1 +set BT_MER_LOG=1 +set BT_VID_LOG=1 +set BT_LAUNCH_LOG=1 +set BT_STACK_LOG=1 +set BT_FORCE_THROTTLE=0.0 +set BT_FORCE_TURN=0.5 +set HEAPSIZE=15000000 +set L4GAUGE=640x480x16 +call setenv.bat r s n p +32rtm.exe -x +BTL4REC.EXE -egg testarn.egg > COM3 + +echo GAME-RC=%errorlevel% >> RC.TXT +32rtm.exe -u +echo ALPHA1-RUN-DONE +pause + diff --git a/restoration/source410/BT/MECH.CPP b/restoration/source410/BT/MECH.CPP index dfb1d066..36f657de 100644 --- a/restoration/source410/BT/MECH.CPP +++ b/restoration/source410/BT/MECH.CPP @@ -1596,6 +1596,14 @@ void limping = (mode == 3 || mode == 4) && hasGimpClips; } + // + // The master performance clears the leg reset latch at the top of every + // frame (@0x4a9bff); the wind-down inside the advancer may set it again, + // and the turn-in-place dispatcher below honours it -- so a walk that + // wound down THIS frame cannot re-enter as a turn until the next. + // + legResetLatch = 0; + if (limping) { AdvanceLegAnimationGimp(time_slice); @@ -1604,6 +1612,37 @@ void { AdvanceLegAnimation(time_slice); } + + // + // THE TURN-IN-PLACE DISPATCHER (master perf @0x4aa505-0x4aa588, decoded + // from raw disasm -- Ghidra never decompiled the function). From + // Standing, arm the trn clip when the mech is TURNING (the binary tests + // |angularVelocity| > 1e-4; at a standstill the turn rate is exactly + // walkingTurnRate, so the operand is turnDemand * walkingTurnRate), the + // speed demand sits in the FULL sub-walk band [0, standSpeed], the model + // has a trn clip, and the wind-down debounce is clear. + // + // BOTH channels arm on the same frame -- the lockstep weld. Arming only + // the leg lets the body enter its next cycle frames apart and the two + // walk cycles run permanently out of phase. Each trn clip plays one + // turn figure and drops back to Standing (the case-4 group), so a held + // turn re-arms clip after clip. + // + if (!limping && turnCapable != 0 && legResetLatch == 0) + { + Scalar + standstill_turn_rate = turnDemand * walkingTurnRate; + if ( + legStateAlarm.GetLevel() == 0 && + bodyStateAlarm.GetLevel() == 0 && + speedDemand >= 0.0f && speedDemand <= standSpeed && + (standstill_turn_rate > 1.0e-4f || standstill_turn_rate < -1.0e-4f) + ) + { + SetLegAnimation(4); + SetBodyAnimation(4); + } + } { Scalar stride = limping ? AdvanceBodyAnimationGimp(time_slice, 0)