Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
12 KiB
id, title, status, source_sections, related_topics, key_terms
| id | title | status | source_sections | related_topics | key_terms | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wintesla-port | The WinTesla Windows Port — the base everything builds on | established | PROGRESS_LOG.md §5b, §8 |
|
|
The WinTesla Windows Port
The Elsewhen RP411 archive is a working Windows port of the MUNGA engine (VS2005,
WinTesla.sln). It means the hardest infrastructure is already solved — the bt411 build sits
on top of it. Full detail: docs/PROGRESS_LOG.md §5b, §8.
What WinTesla already did (do NOT rebuild)
- Renderer bypass: DONE —
MUNGA_L4/L4D3D.cpp+DXUtilsreplace libDPL / the IG board with Direct3D9. Nolibdpl.libin the tree. (The early from-scratch D3D9 viewer was retired and removed.) [T1] - Audio: BACKEND now REAL + soundbank loaded; only game-triggering remains [T2, updated
2026-07-15]. OpenAL replaces the HMI "SOS" engine and the renderer→device→buffer→source→play chain
IS all implemented (
L4AUDRND/L4AUDRES/L4AUDLVL;PatchLevelOfDetail::PlayNotereally callsalSourcePlay). The "no sound, ever" root cause was DEEPER than a gate — both audio backend DLLs shipped inengine/lib/were no-op STUBS: (a)libsndfile-1.dllexports 15 funcs BY ORDINAL ONLY (no names),sf_open()always returns NULL; (b)OpenAL32.dll(72KB) imported only KERNEL32 — no dsound/wasapi/winmm — so it returned fake handles (ctx=0x00000001,alGenSources→0) and never touched the hardware. So the chain ran clean and silent. FIXES (commit5b46655): OpenAL32.dll → real OpenAL Soft 1.25.2 Win32 (drop-in: the exe imports the 25 AL funcs by NAME;alSourcePlaynow reachesAL_PLAYING). libsndfile DROPPED — replaced byLoadWavPCM()inL4AUDRES(a tiny in-tree RIFF/WAVE fmt+data reader, no external dep). Gates fixed earlier: theAWE_FRONT/AWE_REARenv-var gate inMakeAudioRendererwas relaxed to default-on (BT_NO_AUDIO=1disables). Soundbank recovered: 241 samples cracked fromAUDIO1/2.RES(SF2 v1.0) bytools/sf2extract.py→content/AUDIO/*.wav+ theallPresets[2][128]table (audiopresets.cpp, replacing the zero-init btstubs stub); all 241 load (alErr=0). In-game triggering now WORKS (commit7b1e469): enabling audio unlockedL4AudioRenderer::CreateEntityAudioObjects, which bindsAudioStateWatchers to entity/subsystem state attrs BY NAME (the attribute-pointer databinding, same as gauges) and callsAddAudioWatcheron the resolvedStateIndicator. The reconstruction had pointed the Mech's state attrs at the scalar read-padattrPad(fine for a gauge that READs a value, fatal for a state watcher that calls a METHOD → AV inSChainOf::Addon 0xCDCDCDCD). FIXED: the Mech'sAnimationState/ReplicantAnimationState(driven fromSetBodyAnimation) andCollisionState(driven fromProcessCollisionviacollisionTemporaryState) are now realStateIndicatormembers — verified: walking firesSetupPatch+PlayNote/alSourcePlay(footstep/gait patches 78/80/116). So mech movement/animation/collision audio is live. Subsystem STATE audio DONE (commits 5ba541e/0e05a22/dcdd7dd): the audio watcher TYPE per attribute was recovered via aMakeObjectImplementationClassID trace (class 28 =AudioStateTrigger/StateIndicator). KEY: the binary's 0x54-byte subsystem alarm (FUN_0041b9ec, reconstructed asGaugeAlarm54) IS a StateIndicator — its "three sub-indicators" @0x18/0x2c/0x40 are the audio/video/gauge watcher SChains,level@0x14= currentState. The reconstruction had modeled that tail as an opaque_tail(never constructed → AddAudioWatcher AV'd on 0xCDCDCDCD). FIX:GaugeAlarm54now has three REAL constructed sockets +AddAudioWatcher;SetLevelfires them on change (empty sockets = no-op, so other alarms/weapons unaffected;levelB/LevelCountBuntouched; sizeof stays 0x54). Then registered each state attr → its subsystem's own alarm (ownAttributePointers[]chained to the parent):Generator.GeneratorState→stateAlarm,Condenser.CondenserState→condenserAlarm,Reservoir.ReservoirState→reservoirAlarm,AmmoBin.AmmoState→ammoAlarm (+ chained AmmoBin's bare index soSimulationStateresolves too).GeneratorOn→generatorOn. audiostate skips 85 → 0 — every StateIndicator audio attribute across the mech + all subsystems binds to a real indicator, and the alarms are alreadySetLevel'd by the sims, so generator/condenser/reservoir/ammo state sounds fire on transition. Still inert (read 0, silent, non-crashing — no modeled backing member in the size-locked layouts, a polish follow-up):ReportLeak(Logical),Torso.MotionState(Enum),Torso.SpeedOfTorsoHorizontal(Scalar). NOW REAL (fidelity Phase 1, commitfc7f311):ConfigureActivePresspublished at the MechSubsystem BASE (binary attr id 2, descriptor @0x50de5c → member @+0x110 — the field previously misnamedvitalSubsystemIndex; idle −1, driven 0/−1 byMechWeapon::ConfigureMappablesMessageHandler),AmmoBin.FireCountdownStarted→cookOffArmed@0x18C,L4MechControlsMapper.TargetRangeExponent→targetRangeExponent@0x1a4. The bring-up guards [T3, self-clearing] stay: a NULL subsystem attr → inert pad (was a fatalFail); anAudioStateWatcheron an unconstructed indicator (chain@+0x18 null/0xCDCDCDCD) → skip. Both pass automatically once a subsystem is built. Diagnostics:BT_AUDIO_LOG(chain + skips/redirects),BT_ATTRBIND_LOG(every attr bind),BT_AUDIO_TEST(proof-of-life buffer0). - Audio FIDELITY pass (2026-07-16, commits
fc7f311+ 691e885; the full audit ledger isdocs/AUDIO_FIDELITY.md, 37 findings). Settled facts [T1 unless noted]:- Patch numbering = SF2
wPreset. Any tooling must key presets onwPreset, never on phdr record order.AUDIO1/2.RESare SF2 v1.0 (16-byte shdr, NO name/rate/pitch field); pitch metadata rides generators: 55 = SBK samplePitch (root*100+cents, on every zone), 58 = overridingRootKey, 51/52 = coarse/fineTune. EMU8000 v1 base rate = 44100 Hz → a zone's true data rate is baked into its WAV:rate = round(44100·2^(((6000−rootCents)+tune)/1200))(tools/sf2extract.py); the engine's note-60 pitch model (BTNotePitchFactor) then reproduces original playback at every note. SBKinitialAttenuation(48) is INVERTED (127 = full volume; 0.375 dB/step [T3 exact curve], baked into the PCM). - Full-zone table: 603 zones / 241 presets in
audiopresets.cpp; the authored MIDI note SELECTS zones by keyRange inSetupPatch/PlayNote(key-splits: Loaded/Jam family low-36 clunk vs high-84 blip; Warnings01 8-way klaxon split), layers attach together,MAX_PRESET_SAMPLES=25(AllExplosion). Authored loop REGIONS apply viaAL_SOFT_loop_points; authoredreleaseVolEnv(1.1–3.9 s on ~20 looping presets) fades on Stop (PRESET_serviceReleaseFades, serviced fromAudioHead::Execute). - Distance/volume/doppler: OpenAL distance model is
AL_NONE— the AUTHOREDGetDistanceVolumeScale()curve multiplies inCalculateSourceVolumeScale(Dynamic3D + Static3D); per-sourceAL_GAIN = volume_scale²(GM CC7 squared law);alDopplerFactor(0)— the authoredGetDopplerCents()(AUDIO.INI model, consumer decomp part_008.c:7466) adds into the Dynamic3D pitch chain. - Audio clock:
FUN_0044e19cisApplicationManager::GetFrameRate— the original audio "frames" were SYSTEM CLOCK TICKS;MakeAudioRenderercalibrates atSystemClock::GetTicksPerSecond()(fallback 1000), never the old garbagedivisionParameters+0x10read. - Published
localVelocitysmoothing is authentic [T1]:Mech::Execute(FUN_004ab430) runs the localVelocity components throughAverageOfrunning-average filters (part_012.c:15169-15179); the port's ~0.25 s exponential filter inmech4.cppreconstructs it. - Phases 3+4 SHIPPED (2026-07-16, commits 0ca7d26..0e2401f). Phase 3 EFX:
L4AUDEFXbridge — per-source lowpass (Dyn3D = highFreqCutoffScale×brightness UNGATED, Static/Direct = brightness; AWE 100–8000 Hz → 5 kHz-ref gainhf [T3 curve]), one EAXReverb slot at global_reverb_scale 0.3 (3D wet / cockpit Direct dry), Direct position-enum placement. Phase 4 attributes (all [T1] from binary attribute tables, walked as 16-byte {id,name,off+1,pad} rows): HeatSink table @0x50e438 (ids 3..12) confirms every heat binding + adds ReportLeak id 12 @0x138 = coolantActive (serves all 19 leak watchers via PoweredSubsystem⊂HeatSink); Mech table @0x50c0xx (ids 21..56): IncomingLock@0x3fc / DistanceToMissile@0x400 (real members, Missile::MoveAndCollide reports, PerformAndWatch latches; oldmaxSpeed@0x400was a misread of the FLT_MAX far default), CollisionSpeed@0x4B4 (=|impact velocity| at contact-arm), ReduceButton@0x340, FootStep@0x394, RearFiring@0x410 (oldstateFlagsmisread); Torso table (ids 3..15): full publish onto existing members (SpeedOfTorsoHorizontal=twistVelocity@0x1E8 abs'd, MotionState=statusFlags@0x20C, ==2 = limit-hit frame). F5 footStep = CONTACT LEVEL: (jointlocal.y <= *ANI hdr[2] threshold) per frame, states 0/1 retain (SelectSequence now captures hdr[2]; the 150 ms pulse is retired). F19: the authored footstep volume = LocalAcceleration |lin| [0,10]→ctl100 + LocalVelocity |lin| [0,0.6]→ctl101 (ALL motion watchers extract |linearMotion|, motionValue=3); localAcceleration.linear = d(published velocity)/dt (binary part_012.c:15186-15195); the mech2.cpp step broadcast is REMOVED. attrnull count = 0 — every authored audio attribute binds a real member. - Still deferred: UnstablePercentage@0x3F0 (needs the gyro sway/overspeed model — its live
writer is unexported), F21 attack velocity/time (all captured events were default 1),
per-zone static filter fc/Q baking (F14 residue), F22 HRTF (user has 2 speakers; enable
via alsoft.ini
hrtf=truefor headphones).
- Patch numbering = SF2
- L4 HAL on Windows + the VS build system: DONE. [T1]
- Red Planet game logic: COMPLETE & buildable —
VTV/VTVMPPR/WEAPSYS/.... RP is at/near playable. [T1] - Multiplayer: the DOS
NETNUBdriver is already replaced by a ~3.5k-line WinSock2 TCP reimplementation (MUNGA_L4/L4NET.CPP) + the master/replicant distributed-sim core. See multiplayer. [T1]
What BT still needs (the only remaining work below the game layer is NONE)
Everything below the game layer — engine, renderer, audio, HAL, build — exists and is shared. The ONLY thing BT needs is its game-logic source, which is gone (see source-completeness) → it must be reconstructed, with the three anchors (BT headers + the WinTesla engine to compile against + RP's parallel code + the binary oracle). [T2]
Build implications
WinTesla.slnis VS2005 and hard-depends on the legacy DirectX SDK (June 2010) (d3dx9,dinput,dxerr— all removed from the modern Windows SDK). The DXSDK is installed atC:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\. [T2]- The shared engine builds GREEN to
munga_engine.libvia CMake/MSVC Win32 (see build-and-run). Recipe gotchas (include-path shadowing, the CAMMGR/time.h fixes, the ATL shim) are indocs/PROGRESS_LOG.md §8. [T2]
Roadmap position
Old plan ("build a libDPL shim + port the engine") is superseded — WinTesla did it. New plan:
reuse the WinTesla engine (shared) + reconstruct the BT game library (BT410_L4 + game logic). The
from-scratch libDPL shim is no longer needed. Phases 4-8 (BT game layer + pod bring-up) still apply.
[T2]
Key Relationships
- Solves: the infrastructure that source-completeness would otherwise require.
- Feeds: build-and-run, rendering, multiplayer.