210 Commits
Author SHA1 Message Date
boubou666 404738f590 Merge pull request #93 from TheBozos/claude/release-0.5.0
Prepare the 0.5.0 release notes
2026-11-09 17:32:41 +01:00
Thomas MartinandClaude Opus 5.5 857bc004e1 Word the 0.5.0 replay claim precisely
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 17:31:14 +01:00
Thomas MartinandClaude Opus 5.5 0239a547df Prepare the 0.5.0 release notes
Move the Unreleased fix into a 0.5.0 section and describe the native
math and graphics work since 0.4.0, the engine update, the test coverage
and the unchanged known limits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 17:31:04 +01:00
boubou666 672e7ed1b2 Merge pull request #88 from TheBozos/claude/native-movie-vblank-handler
Run the movie player's vblank handler natively (fixes vehicle-select stall)
2026-11-09 17:28:10 +01:00
boubou666 b8b63c1ef0 Merge pull request #92 from TheBozos/claude/native-persistent-forward
Replace the last persistent-field forward transforms with native math (269/269)
2026-11-09 17:25:20 +01:00
Thomas MartinandClaude Opus 5.5 391206dda1 Replace the last persistent-field forward transforms with native math
FireSpecial's type 1a0 horn push (14aff4, vehicle velocity), BurnMan's
spawn position (112524) and collisCheapTires' free-fall tire offset
(117710) now use the native separately rounded XYZ helper. No reader of
those fields' W exists anywhere in the generated code. All 269 inventoried
forward-transform returns are now native.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 17:23:49 +01:00
boubou666 363eb61acd Merge pull request #91 from TheBozos/claude/native-blow-debris-forward
Replace the BlowDebris forward transforms with native math
2026-11-09 17:08:56 +01:00
Thomas MartinandClaude Opus 5.5 eb2ee14258 Replace the BlowDebris forward transforms with native math
DebrisStuff::BlowDebris's piece offsets (120788, 1208dc, 120c3c) and
debris velocities (120838, 1209a0, 120b28) now use the native separately
rounded XYZ helper. The outputs are read only as XYZ: scalar loads,
mathfRotationFromVector, and Debris::Update for the velocities. The
one-player RAM hash differs on 309 frames, in one dead frame W slot of
1208dc (0x8fefdc); a NaN-poison experiment changed no other recorded field.
Known forward coverage grows from 260 to 266 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 17:06:04 +01:00
boubou666 c6d7787140 Merge pull request #90 from TheBozos/claude/native-hud-laser-forward
Replace the HUD laser forward transforms with native math
2026-11-09 16:42:36 +01:00
Thomas MartinandClaude Opus 5.5 9f80bfe6ab Replace the HUD laser forward transforms with native math
Hud::BuildLaserStuff's laser sight points (142640, 1426cc) now use the
native separately rounded XYZ helper. Each point is read only as XYZ by
mathfAddVector, and the owner never loads the forward W slot. Known
forward coverage grows from 258 to 260 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 16:40:48 +01:00
boubou666 0fb62aa91f Merge pull request #89 from TheBozos/claude/native-update-launcher-forward
Replace the UpdateLauncher forward transforms with native math
2026-11-09 16:30:35 +01:00
Thomas MartinandClaude Opus 5.5 f2eb2f9686 Replace the UpdateLauncher forward transforms with native math
Launcher::UpdateLauncher's aim point (147a8c), muzzle point (147cc8) and
type-1c0 turret point (147cf4) now use the native separately rounded XYZ
helper. The results are read only as XYZ by mathfAddVector and the next
transform; the owner never loads the forward W slot. Known forward
coverage grows from 255 to 258 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 16:27:35 +01:00
boubou666 24ef197926 Merge pull request #87 from TheBozos/claude/native-fire-torch-forward
Replace the FireSpecial type c0/1e0/220 forward transforms with native math
2026-11-09 16:13:37 +01:00
Thomas MartinandClaude Opus 5.5 0413fe523c Run the movie player's vblank handler natively
The port ran the game's vblankHandler inside its override and freed the shown
picture's buffer after it returned. When a scheduler event came due inside the
handler (after a long frame's clock catch-up), the deferred stop skipped that
free: the oldest picture tag stayed 0, the movie froze, the decoder waited for a
buffer forever, and the next menu choice that stopped the movie hung
(one-player route, vehicle select, frame 4340).

With native graphics the handler is now C++: same field parity, flags and tag
states, the picture shown natively and the odd field's buffer freed at once. It
logs "[tmb:movie] stall" if the picture buffer stays full for 120 fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 16:11:22 +01:00
Thomas MartinandClaude Opus 5.5 eec7c3c30a Replace the FireSpecial type c0/1e0/220 forward transforms with native math
Launcher::FireSpecial's type c0 (14acf0), Minion (14b3ec, 14b424) and
Tanker (14b618, 14b65c, 14b670) returns now use the native separately
rounded XYZ helper. The results are read only as XYZ by mathfAddVector,
the next transform, mathfRotationFromPointToPoint and mathfSubVector; the
owner never loads the forward W slots. Every frame-output FireSpecial
forward is now native: 255 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 16:10:23 +01:00
boubou666 06764432cd Merge pull request #86 from TheBozos/claude/native-fire-lockon-forward
Replace the FireSpecial type a0 lock-on forward transforms with native math
2026-11-09 15:59:46 +01:00
Thomas MartinandClaude Opus 5.5 11f46a2669 Replace the FireSpecial type a0 lock-on forward transforms with native math
Launcher::FireSpecial's type a0 lock-on launch points (14a4d4, 14a518,
14a73c, 14a780, 14a98c, 14a9d0) now use the native separately rounded XYZ
helper. Each point is read only as XYZ by mathfAddVector,
particleCreateFx and the take-hit readers (mathfManhatDist and
forceFieldTakeHit's xyz-masked subtraction). The owner never loads the
forward W slot. Known forward coverage grows from 243 to 249 of 269
returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 15:56:28 +01:00
boubou666 8cd62cd4b9 Merge pull request #85 from TheBozos/claude/native-fire-special-forward
Replace the FireSpecial type 20/40/60 forward transforms with native math
2026-11-09 15:39:38 +01:00
Thomas MartinandClaude Opus 5.5 242498bee9 Replace the FireSpecial type 20/40/60 forward transforms with native math
Launcher::FireSpecial's type 20 (1499d4), type 40 (149bb8, 149c28) and
type 60 (149d8c, 149e14) returns now use the native separately rounded
XYZ helper. The results are read only as XYZ by mathfAddVector,
mathfDist3 and a 32-bit height load; the owner never loads the forward W
slot. Also restore the two registers a trailing comment had hidden in the
PR #78 volley fixture. Known forward coverage grows from 238 to 243 of
269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 15:37:56 +01:00
boubou666 3c65abe6a0 Merge pull request #84 from TheBozos/claude/native-looptank-forward
Replace the LoopTank segment forward transforms with native math
2026-11-09 15:06:21 +01:00
Thomas MartinandClaude Opus 5.5 14ea3480ec Replace the LoopTank segment forward transforms with native math
LoopTank::update's segment points (151c08, 151c18) now use the native
separately rounded XYZ helper. Each point is read only as XYZ by
mathfAddVector, hdLosCsTest and mathfSubVector. The take-hit pointer to
the first point is read only by mathfManhatDist and by forceFieldTakeHit's
xyz-masked VU subtraction. The owner never loads the forward W slots.
Known forward coverage grows from 236 to 238 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 15:04:49 +01:00
boubou666 fa84a39b98 Merge pull request #83 from TheBozos/claude/native-special-torch-forward
Replace the special-weapon torch forward transforms with native math
2026-11-09 14:41:50 +01:00
Thomas MartinandClaude Opus 5.5 c5a225198e Replace the special-weapon torch forward transforms with native math
Launcher::UpdateSpecial's tank car (14f190, 14f1c4, 14f3e8), Minion
(14f654, 14f68c, 14f72c, 14f954) and Tanker (14fb7c, 14fbb8, 14fc24) torch
returns now use the native separately rounded XYZ helper. Their results
reach mathfAddVector, hdLosCsTest, DispatchHit,
mathfRotationFromPointToPoint and the particle position, all of which read
them only as XYZ. The owner never loads the forward W slots. Every
UpdateSpecial forward is now native: 236 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 14:39:02 +01:00
boubou666 366c6b2408 Merge pull request #82 from TheBozos/claude/native-ferris-boss-forward
Replace the Ferris wheel and final boss hit-test forward transforms with native math
2026-11-09 14:17:06 +01:00
Thomas MartinandClaude Opus 5.5 b852b3ed7e Replace the Ferris wheel and final boss hit-test forward transforms with native math
FerrisWheel::UpdateFerrisWheel (12a6d8, 12a930, 12a9e8) and
FinalBoss::CheckCollision (11201c) now use the native separately rounded
XYZ helper. Their results reach only mathfAddVector, hdPntSphereTest,
mathfSubVector and DispatchHit, which were audited to read points as XYZ
only. Neither owner loads the forward W slot. Known forward coverage
grows from 222 to 226 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 14:15:21 +01:00
boubou666 eefb1518e5 Merge pull request #81 from TheBozos/claude/native-weapon-hit-forward
Replace the RockHD and RicoHD hit-test forward transforms with native math
2026-11-09 13:59:35 +01:00
Thomas MartinandClaude Opus 5.5 cb229340da Replace the RockHD and RicoHD hit-test forward transforms with native math
Weapon::RockHD (1b6cd8, 1b6d3c) and Weapon::RicoHD (1b5168, 1b52c0,
1b5528, 1b5630) now use the native separately rounded XYZ helper. The
results feed mathfAddVector, hdPntSphereTest, mathfSubVector, DispatchHit,
mathfRotationFromVector and updateRichochetBounce. All of these were
audited to read the point only as XYZ, and the owners never load the
forward W slots. Known forward coverage grows from 216 to 222 of 269
returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 13:57:50 +01:00
boubou666 4847649ef6 Merge pull request #80 from TheBozos/claude/native-special-arcs-forward
Replace the held-aim and lock-on arc special-weapon forward transforms with native math
2026-11-09 13:34:38 +01:00
Thomas MartinandClaude Opus 5.5 34c7363870 Replace the held-aim and lock-on arc special-weapon forward transforms with native math
Launcher::UpdateSpecial's type 100 held aim (14ed94) and type a0 lock-on
arc ends (14e2d0, 14e320, 14e498, 14e4dc, 14e6a8, 14e6ec) now use the
native separately rounded XYZ helper. Each result is read only as XYZ by
mathfAddVector and particleElectricArc; the owner never reads the forward
W slots. Known forward coverage grows from 209 to 216 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 13:33:12 +01:00
boubou666 2d3c0f4413 Merge pull request #79 from TheBozos/claude/native-special-sweep-forward
Replace the type-100 launcher special-weapon forward transforms with native math
2026-11-09 13:12:11 +01:00
Thomas MartinandClaude Opus 5.5 a8ee999ecb Replace the type-100 launcher special-weapon forward transforms with native math
Launcher::UpdateSpecial's vehicle type 100 branch (14eb9c, 14ec04, 14ec70)
now uses the native separately rounded XYZ helper. Each result is read only
as XYZ by mathfAddVector; the owner never reads the forward W slots. Known
forward coverage grows from 206 to 209 of 269 returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 13:10:38 +01:00
boubou666 e1cf66974f Merge pull request #78 from TheBozos/claude/native-special-volley-forward
Replace the second batch of launcher special-weapon forward transforms with native math
2026-11-09 12:50:48 +01:00
Thomas MartinandClaude Opus 5.5 924b277776 Replace the second batch of launcher special-weapon forward transforms with native math
Launcher::UpdateSpecial's type-1c0 volley (14ee10, 14ee2c, 14ee48: a table
offset through the vehicle's system, then in place through the part basis)
and type-140 launch points (14ef50, 14ef80 into +620, the vehicle's +2760)
reach only the next transform's XYZ input and mathfAddVector; their W is
never read. All five join the native direction returns (206/269).

The caller suite adds kinds 306..310 (1c0 entries start after the hardware
timer read; chained transforms are captured for these kinds only) and
stops at Weapons::CreateWeapon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 12:47:23 +01:00
boubou666 c4a4fac1f7 Merge pull request #77 from TheBozos/claude/native-special-guns-forward
Replace the first five launcher special-weapon forward transforms with native math
2026-11-09 12:22:30 +01:00
Thomas MartinandClaude Opus 5.5 5aae7226db Replace the first five launcher special-weapon forward transforms with native math
Launcher::UpdateSpecial's launch points for vehicle types 60 (14dc44,
14dccc), 120 (14dea8, 14df2c) and c0 (14e020) write the frame vector at +0,
read only by mathfAddVector into the launcher's +620; frame W is never read.
All five join the native direction returns (201/269).

The caller suite adds kinds 301..305: type 60/c0 entries from the owner's
start through the type dispatch, countdown, turret matrix and GetLockOn;
type 120 entries after its UpdateHearse; each stops at weapon creation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 12:20:57 +01:00
boubou666 8f0fdf3870 Merge pull request #76 from TheBozos/claude/native-boss-move-forward
Replace the FinalBoss movement forward transforms with native math
2026-11-09 12:00:21 +01:00
Thomas MartinandClaude Opus 5.5 162f3e9926 Replace the FinalBoss movement forward transforms with native math
FinalBoss::UpdateTrans (111788) and FinalBoss::UpdateDeath (111cc4) put the
boss velocity through its own basis into frame +0, read only by
mathfAddVector (hdHatTest only writes the slot); frame W is never read. Both
join the native direction returns (196/269).

The caller suite adds kinds 299 and 300 with owner entries after the speed
smoothing and after the death-roll matrix rebuild, stopping at the grid
reparent and the ground probe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 11:58:44 +01:00
boubou666 75e7827be6 Merge pull request #75 from TheBozos/claude/native-boss-shots-forward
Replace the twelve FinalBoss gun-shot forward transforms with native math
2026-11-09 11:47:16 +01:00
Thomas MartinandClaude Opus 5.5 6903c90e5d Replace the twelve FinalBoss gun-shot forward transforms with native math
FinalBoss::UpdateBoss's shot origins (10febc, 110114, 1101b0, 1103e4, 1104e4,
110880, 11091c, 110a0c, 110adc, 110d9c, 110e8c, 110f74) write frame +10,
read only by mathfAddVector, CreateStaticWeapon and (shots disabled) the
machine-gun sound's calcDualMonoMixVolPan; frame W is never read. All twelve
join the native direction returns (194/269).

The caller suite adds kinds 287..298 with owner entries at the call-return
label before each shot, through the aim and on to CreateStaticWeapon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 11:36:12 +01:00
boubou666 1f22318dc4 Merge pull request #74 from TheBozos/claude/native-particle-arcs-forward
Replace the particle flat-arc and electric-arc forward transforms with native math
2026-11-09 11:19:12 +01:00
Thomas MartinandClaude Opus 5.5 2d955238b9 Replace the particle flat-arc and electric-arc forward transforms with native math
particleFlatArcs (1e7e08) writes each arc point, then rewrites its W itself
before any read; particleElectricArc (1e77e8) writes a frame vector read only
by mathfScaleVector. Both join the native direction returns (182/269).

The caller suite adds kinds 285 and 286 from the owners' start through the
real particle allocation, basis construction and random helpers to 1e22f0;
FlatArcs cases compare memory exactly with no W exclusion. The 1P replay's
RAM hash differs only through ElectricArc's dead frame+0c W slot (0x8ff36c),
shown by a RAM dump, a logging build and a NaN-poison build.

Also converts NATIVE_AI_BEAD_FORWARD.md to LF line endings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 11:15:43 +01:00
boubou666 c265cfda01 Merge pull request #73 from TheBozos/claude/native-ai-bead-forward
Replace the AI hunt and bait forward transforms with native math
2026-11-09 11:01:48 +01:00
Thomas MartinandClaude Opus 5.5 4252d9835d Replace the AI hunt and bait forward transforms with native math
Vehicle::aiPerformBeadOnHuntCs's heading offset (103534) and
Vehicle::aiUpdateBaitModeOld's bait point (106af0) write frame +10, read only
by mathfAddVector, mathfSubVector, attractGetClosestPoint and scalar X/Y loads;
frame W is never read. Both join the native direction returns (180/269).

The caller suite adds kinds 283 and 284: hunt entries from 1034c4 through
the clamp branches to aiDriveToAttackRange, bait entries from the owner's
start through the real attractor search to its return.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 10:56:31 +01:00
boubou666 71e5997e9f Merge pull request #72 from TheBozos/claude/native-zoomies-hal-forward
Replace the Zoomies and HalTrans weapon forward transforms with native math
2026-11-09 10:35:31 +01:00
Thomas MartinandClaude Opus 5.5 f9fa811743 Replace the Zoomies and HalTrans weapon forward transforms with native math
Launcher::UpdateZoomies's muzzle point (14d294) and Weapon::UpdateHalTrans's
flying step (1b3874) and attached-target points (1b39a4, 1b3b00) write a
frame vector read only by mathfAddVector and scalar XYZ loads; frame W is
never read. All four join the native direction returns (178/269).

The caller suite adds kinds 279..282: Zoomies through the real GetLockOn
to CreateWeapon, and HalTrans states 0/1/2 through the real smoothing and
matrix rebuild to the owner's return.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 10:32:24 +01:00
boubou666 2b4f79be08 Merge pull request #71 from TheBozos/claude/native-combo-forward
Replace the five combo-launch forward transforms with native math
2026-11-09 10:14:59 +01:00
Thomas MartinandClaude Opus 5.5 d3fc24e4a0 Replace the five combo-launch forward transforms with native math
Vehicle::vehicleCheckForCombos's launch points (1af700, 1af790, 1af890,
1af8fc, 1af980) write a frame vector read only by mathfAddVector into the
vehicle's +2760 (XYZ only) before CreateWeapon; frame W is never read. All
five join the native direction returns (174/269).

The caller suite adds kinds 274..278 running the owner from its start
through the combo dispatch, cost checks and the real Launcher::GetLockOn,
stopping at CreateWeapon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 10:13:18 +01:00
boubou666 7627a523dc Merge pull request #70 from TheBozos/claude/native-tire-rotation-forward
Replace the two tire-pair correction forward transforms with native math
2026-11-09 09:56:04 +01:00
Thomas MartinandClaude Opus 5.5 607cb2d080 Replace the two tire-pair correction forward transforms with native math
Vehicle::tireUpdateCarRotation's axle height corrections (18b10c, 18b19c)
write frame +50, read only by mathfAddVector; frame W is never read. Both
join the native direction returns (169/269).

The caller suite adds kinds 272 and 273 with owner entries at 18b088 (after
the up-vector normalize, frame and saved registers as the prologue leaves
them) running both axle blocks and the full basis rebuild to the real
return, across 2/4/5/6-wheel layouts and single-axle cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 09:42:58 +01:00
boubou666 027357a694 Merge pull request #69 from TheBozos/claude/native-machine-gun-forward
Replace the two machine-gun muzzle forward transforms with native math
2026-11-09 00:58:37 +01:00
Thomas MartinandClaude Opus 5.5 b08b9c45b4 Replace the two machine-gun muzzle forward transforms with native math
Weapon::InitWeapon's type-0 muzzle placements (1b79f8, 1b7a14) put the
transformed muzzle offset in a frame vector read only by mathfAddVector;
frame W is never read. Both join the native direction returns (167/269).

The caller suite adds kinds 270 and 271 through the real weapon-type
dispatch, both aim gates and the +22c4 branch, asserting the round's
position and the barrel toggle.

On the 1P replay both sites are live (81/82 calls); every recorded field
matches the parent except the end-of-frame RAM hash on 354 frames, caused
by the dead frame+0c W slot (0x8ff32c) keeping the old stack word instead of
the original's stale VU W. A NaN-poison experiment on that slot changed no
other recorded field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 00:57:09 +01:00
boubou666 e298f208bd Merge pull request #68 from TheBozos/claude/native-envheli-gun-forward
Replace the helicopter gun and walking pedestrian forward transforms with native math
2026-11-09 00:29:29 +01:00
Thomas MartinandClaude Opus 5.5 b71f6c3178 Replace the helicopter gun and walking pedestrian forward transforms with native math
EnvHeli::UpdateEnvHeli's gun origin (129c48) goes only to mathfAddVector
and CreateStaticWeapon, and AttractPed::updateTrans's step (10cc7c) only
to mathfAddVector (hdHatTest only writes the same slot); neither frame W
is read. Both join the native direction returns (165/269).

The caller suite adds kinds 268 and 269: firing, non-firing and
non-attacking helicopter updates, and walking/drifting pedestrians.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 00:08:32 +01:00
boubou666 ba9f83ea76 Merge pull request #67 from TheBozos/claude/native-jet-death-forward
Replace the six falling junk jet forward transforms with native math
2026-11-08 23:49:44 +01:00
Thomas MartinandClaude Opus 5.5 45ed78cc2a Replace the six falling junk jet forward transforms with native math
JunkJet::UpdateDeath's drift (143864), high explosion (143940), low burst
(1439bc, 143a18) and crash burst (143b0c, 143b60) outputs go to a frame
vector read only as XYZ by mathfAddVector and particleCreateFx; frame W is
never read. All six join the native direction returns (163/269).

The caller suite adds kinds 262..267 with the particle system off so the
owner runs to its real return, capturing each effect point; high (seeded
rand), low and crash paths are covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 23:17:56 +01:00
boubou666 17bc13a536 Merge pull request #66 from TheBozos/claude/native-blimp-death-forward
Replace the sinking blimp forward transforms with native math
2026-11-08 22:59:35 +01:00
Thomas MartinandClaude Opus 5.5 d9a54c7a27 Replace the sinking blimp forward transforms with native math
Blimp::UpdateDeath's drift (10eee0) and explosion point (10efa0) write a
function-local static whose W is never read; every consumer, including
the effect and explosion-sound distance/pan helpers, reads only XYZ.
Both join the native direction returns (157/269).

The caller suite adds kinds 260 and 261: helper-boundary continuations and
full-owner entries covering drift, seeded rand explosion, no explosion and
crash-landing paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 22:57:56 +01:00
boubou666 bb685156ff Merge pull request #65 from TheBozos/claude/native-gastank-forward
Replace the rolling and falling gas tank forward transforms with native math
2026-11-08 22:41:38 +01:00
Thomas MartinandClaude Opus 5.5 cacb8b9c16 Replace the rolling and falling gas tank forward transforms with native math
GasTank::UpdateGasTank (135cf8) and both UpdateFalling bursts (136200,
1362ec) read their transform output only as XYZ and never read the frame
W, so they join the native direction returns (155/269).

The caller suite adds kinds 257..259: helper-boundary continuations and
full-owner entries covering roll, bounce, landing, inactive, both seeded
rand bursts, no burst and tank-down paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 22:38:16 +01:00
boubou666 7b715046f5 Merge pull request #64 from TheBozos/claude/native-flyer-forward
Replace the junk jet and blimp flight forward transforms with native math
2026-11-08 20:20:04 +01:00
Thomas MartinandClaude Opus 5.5 ebea3f6454 Replace the junk jet and blimp flight forward transforms with native math
JunkJet::UpdateJet 143468 and Blimp::UpdateBlimp 10eca0 transform the flyer's speed
vector through its freshly rebuilt basis into frame+0, read only by mathfAddVector
into its position; frame+0c is never read and neither owner reads VU state.
Allowlist 150 -> 152 of 269 (117 remain).

Caller suite: 131,584 sequences / 6,208 whole-memory checks; full owners run the
steering, matrix rebuild, move and waypoint check and stop at the jet sound / blimp
grid reparent. Default/strict 1P/4P replays exact to 7e19e2b; 143468 runs natively
3,902 times on the 1P route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 20:16:12 +01:00
boubou666 7e19e2bbf1 Merge pull request #63 from TheBozos/claude/native-heli-death-forward
Replace the two falling helicopter forward transforms with native math
2026-11-08 19:55:36 +01:00
Thomas MartinandClaude Opus 5.5 b3a9b77819 Replace the two falling helicopter forward transforms with native math
EnvHeli::UpdateDeath 12a180 and Helicopter::UpdateDeath 1392e4 transform the
smoothed fall velocity through the craft's stored basis into frame+0, read only by
mathfAddVector into the coordinate-system position; frame+0c is never read and
neither owner reads VU state. Allowlist 148 -> 150 of 269 (119 remain).

Caller suite: 130,560 sequences / 6,144 whole-memory checks; full owners cover the
falling path, the timeout (stopping at BlowDebris/Regen) and the Helicopter's
frame-60 debris boundary. Default/strict 1P/4P replays exact to 9daca2b.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 19:50:12 +01:00
boubou666 9daca2b6f4 Merge pull request #62 from TheBozos/claude/native-ferris-smasher-forward
Replace the Ferris wheel fall and smasher camera forward transforms with native math
2026-11-08 19:34:03 +01:00
Thomas MartinandClaude Opus 5.5 315b91cb9a Replace the Ferris wheel fall and smasher camera forward transforms with native math
FerrisWheel::UpdateFalling 12aad4 and Smashers::SmasherHit 169ed0 consume only XYZ
of their frame vectors: mathfAddVector, then the smasher's DetachCamera copies the
point with scalar mathfCopyVector. Frame W slots are never read and neither owner
reads VU state. Allowlist 146 -> 148 of 269 (121 remain).

Caller suite: 129,536 sequences / 6,080 whole-memory checks; full owners publish
the Ferris position and landing state, and the smasher camera position, slot and
mode (new 0x20-byte camera mode region). Default/strict 1P/4P replays exact to
9057db2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 19:17:17 +01:00
boubou666 9057db28e9 Merge pull request #61 from TheBozos/claude/native-envweapon-forward
Replace the two environment gun fire-point forward transforms with native math
2026-11-08 19:03:53 +01:00
Thomas MartinandClaude Opus 5.5 ca4a8058cd docs: environment gun sites are cold on the qualification routes (no claim about which levels have the gun)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 19:00:09 +01:00
Thomas MartinandClaude Opus 5.5 e7893ce259 Replace the two environment gun fire-point forward transforms with native math
Launcher::UpdateEnvWeapon returns 14d62c and 14d678 transform a muzzle offset
into frame+0, add the gun position and pass it to CreateStaticWeapon, which reads
it only through scalar mathfCopyVector; frame+0c is never read and the owner reads
no VU state. Allowlist 144 -> 146 of 269 (123 remain).

Caller suite: 128,512 sequences / 6,016 whole-memory checks; full entries go
through the real game-mode jump table, nearest-vehicle search and fire counter and
stop at CreateStaticWeapon with the shot origin asserted. Default/strict 1P/4P
replays exact to aadc76b.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 18:59:57 +01:00
boubou666 aadc76bd52 Merge pull request #60 from TheBozos/claude/native-copsuv-aim-forward
Replace the two Cop SUV laser-aim forward transforms with native math
2026-11-08 18:44:22 +01:00
Thomas MartinandClaude Opus 5.5 448755193b Replace the two Cop SUV laser-aim forward transforms with native math
Launcher::UpdateCopSUV returns 150094 (mode 0x14 player-state branch) and 1502cc
(closest-car branch) transform the laser offset into frame+10, add the shooter
position and hand it only to the scalar mathfRotationFromPointToPoint; frame+1c is
never read and the owner reads no VU state. Allowlist 142 -> 144 of 269 (125 remain).

Caller suite: 127,488 sequences / 5,952 whole-memory checks; both branches reached,
fixtures stop at the laser-sound calls into the sound driver after the aim point is
consumed. Default/strict 1P/4P replays exact to 5135b43; 1502cc runs natively
1,638 times (1P) and 845 times (4P). Also corrects the launcher doc's explanation
of the shifted random-data counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 18:40:08 +01:00
boubou666 5135b43c84 Merge pull request #59 from TheBozos/claude/native-launcher-aim-forward
Replace the Hearse, Minion and Tanker launcher aim forward transforms with native math
2026-11-08 18:25:42 +01:00
Thomas MartinandClaude Opus 5.5 ce16d68b70 Replace the Hearse, Minion and Tanker launcher aim forward transforms with native math
Launcher returns 150efc, 1511ec and 1513f4 transform a turret offset into frame+10,
add the shooter position and hand it only to the scalar
mathfRotationFromPointToPoint toward GetClosestCar's target; frame+1c is never read
and the owners read no VU state. Allowlist 139 -> 142 of 269 (127 remain).
Zoomies (14d294) is left for later: its tail continues into GetLockOn/CreateWeapon.

Caller suite: 126,464 sequences / 5,888 whole-memory checks; 480 publishing cases
per site through the real GetClosestCar (new 0x2600-byte game vehicle region) and
turret matrix publication. Default/strict 1P/4P replays exact to 3e3740f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 18:12:13 +01:00
boubou666 3e3740ff7c Merge pull request #58 from TheBozos/claude/native-ricochet-forward
Replace the two ricochet forward transforms with native math
2026-11-08 17:49:45 +01:00
Thomas MartinandClaude Opus 5.5 1cf43a4f91 Replace the two ricochet forward transforms with native math
Weapon::UpdateRicoTrans returns 1b2fb0 and 1b3118 consume only XYZ of their
frame-local vector (mathfAddVector, hdHatTest, ComputeReflection's scalar
helpers); frame+0c is never read and the owner reads no VU state. Allowlist
137 -> 139 of 269 (130 remain). RockHD stays original: its point feeds hdHier.

Caller suite: 124,928 sequences / 5,792 whole-memory checks; both sites reached,
including the real reflection branch with its owner-rebuilt basis. Also restores
a PR #57 satellite fixture line a misplaced comment had disabled. Default/strict
1P/4P replays exact to 4d863cd; 1b2fb0 runs natively 319 times on the 1P route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:46:48 +01:00
boubou666 4d863cdaad Merge pull request #57 from TheBozos/claude/native-weapon-lock-forward
Replace six weapon lock-on, satellite and rock forward transforms with native math
2026-11-08 17:05:54 +01:00
Thomas MartinandClaude Opus 5.5 eb383881aa Replace six weapon lock-on, satellite and rock forward transforms with native math
Lock-on 1b1700, look-ahead 1b1bbc, skill-satellite 1b339c/1b3634/1b371c and
rock 1b3ef8 consume only XYZ through mathfAddVector (and the rock's hdHatTest);
destination W is dead and the owners read no VU state. The existing native
direction helper serves them (allowlist 131 -> 137 of 269; 132 remain).

Caller suite: 123,904 sequences / 5,728 whole-memory checks, all six sites reached
with independent transform and published-point assertions. Default/strict 1P/4P
replays exact to 145964b; rock runs natively 1,569 times on the 1P route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:04:22 +01:00
boubou666 145964b12a Merge pull request #56 from TheBozos/codex/native-minion-forward
Replace Minion shield forward transforms with native math
2026-11-08 16:25:33 +01:00
Thomas MartinandCodex 1b09c45aaf Replace Minion shield forward transforms with native math
Co-Authored-By: Codex <[email protected]>
2026-11-08 16:24:13 +01:00
boubou666 cafd3f7124 Merge pull request #55 from TheBozos/codex/native-attachment-forward
Replace attachment forward transforms with native arithmetic
2026-11-08 16:06:55 +01:00
Thomas MartinandCodex 65c46972ab Replace five attachment forward transforms with native arithmetic
Qualify helicopter/cable/weapon consumers, real grid reparenting and height-query gates, and gameplay/loading/movie behavior.

Co-Authored-By: Codex <[email protected]>
2026-11-08 16:05:09 +01:00
boubou666 2ee3dc9f62 Merge pull request #54 from TheBozos/codex/native-collision-forward
Replace vehicle-collision forward transforms with native arithmetic
2026-11-08 15:43:14 +01:00
Thomas MartinandCodex a779181569 Replace six vehicle-collision forwards with native arithmetic
Qualify force/morph owners, bounded collision and impact consumers, gameplay/loading/movies, and exact provenance of transient scratch-W RAM differences.

Co-Authored-By: Codex <[email protected]>
2026-11-08 15:41:06 +01:00
boubou666 555f9b33d1 Merge pull request #53 from TheBozos/codex/fix-driver-handoff-encoding
Restore UTF-8 text in the handoff document
2026-11-08 15:12:54 +01:00
Thomas MartinandCodex 44a65a52c3 Restore UTF-8 text in the driver handoff document
Co-Authored-By: Codex <[email protected]>
2026-11-08 15:11:42 +01:00
boubou666 2d25eb2323 Merge pull request #52 from TheBozos/codex/native-driver-forward
Replace driver forward transforms with native arithmetic
2026-11-08 15:10:43 +01:00
Thomas MartinandCodex 5c48a618c5 Replace seven driver forward transforms with native arithmetic
Qualify complete path-offset, lookahead and LOS owners, actual query consumers, meaningful inverse W and replay/window behavior.

Co-Authored-By: Codex <[email protected]>
2026-11-08 15:09:14 +01:00
boubou666 94ad67d0b7 Merge pull request #51 from TheBozos/codex/native-rigid-body-forward
Replace ten rigid-body forward transforms with native records
2026-11-08 14:44:28 +01:00
Thomas MartinandCodex 96015971c0 Replace rigid-body forward transport with native records
Qualify complete local force, torque, impulse, integration and world-point entries with actual downstream consumers and audited W lifetimes.

Co-Authored-By: Codex <[email protected]>
2026-11-08 14:43:08 +01:00
boubou666 79acf148a0 Merge pull request #50 from TheBozos/codex/native-final-inverses
Complete native coverage of all known inverse-helper returns
2026-11-08 14:24:38 +01:00
Thomas MartinandCodex eff76e3be9 Replace the final six known inverse-helper returns with native records
Qualify force-field, health-stand, HUD/radar and particle visibility/sorting consumers while preserving meaningful XYZW and historical ABI.

Co-Authored-By: Codex <[email protected]>
2026-11-08 14:23:25 +01:00
boubou666 9298010a7c Merge pull request #49 from TheBozos/codex/native-remaining-inverses
Replace six vehicle and object-light inverses with native records
2026-11-08 13:56:34 +01:00
Thomas MartinandCodex 498f93894b Replace vehicle and object-light inverse transport with native records
Qualify complete tire, rollover, weapon-damage and lighting entries with actual state-publication consumers.

Co-Authored-By: Codex <[email protected]>
2026-11-08 13:55:26 +01:00
boubou666 99efa7f95c Merge pull request #48 from TheBozos/codex/native-driver-boss-inverses
Replace driver and boss inverses with native transforms
2026-11-08 13:34:09 +01:00
Thomas MartinandCodex b7a26374d2 Replace driver and boss inverse transport with native records
Qualify driver scalar consumers and composed boss attachment publication, including its coupled forward transform.

Co-Authored-By: Codex <[email protected]>
2026-11-08 13:33:10 +01:00
boubou666 bd12a90f79 Merge pull request #47: native AI inverses
Native AI inverses
2026-11-08 03:49:23 +01:00
Thomas MartinandCodex e3d7dda618 Use native AI inverses
Qualify navigation, steering, attack-range and shot-policy inverse consumers with real control and attack-state publication. Document exact paired replays and windowed gameplay/loading/movie checks.

Co-Authored-By: Codex <[email protected]>
2026-11-08 03:48:06 +01:00
boubou666 c7c798e585 Merge pull request #46: native rigid-body inverses
Native rigid-body inverses
2026-11-08 03:19:01 +01:00
Thomas MartinandCodex 7107924b1b Use native rigid-body inverses
Qualify seven inverse returns with complete impulse/collision entries and point-velocity consumers. Document gameplay/loading/movie checks and the bounded stale stack-W RAM difference.

Co-Authored-By: Codex <[email protected]>
2026-11-08 03:17:54 +01:00
boubou666 a36c634449 Merge pull request #45: native vehicle collision and drift inverses
Native vehicle collision and drift inverses
2026-11-08 02:56:32 +01:00
Thomas MartinandCodex 9bcc54240b Use native vehicle collision and drift inverses
Qualify sixteen inverse returns with generated consumers, drift entries and full XYZW comparisons. Document exact paired replays and windowed gameplay/loading/movie checks.

Co-Authored-By: Codex <[email protected]>
2026-11-08 02:55:26 +01:00
boubou666andCodex a2905f2bfc Merge pull request #44: native weapon translation and skid-mark transforms
Co-Authored-By: Codex <[email protected]>
2026-11-08 02:19:48 +01:00
Thomas MartinandCodex ec9feba867 Use native weapon translation and skid-mark transforms
Co-Authored-By: Codex <[email protected]>
2026-11-08 02:18:30 +01:00
boubou666andCodex c5888d2629 Merge pull request #43: native weather viewport transform
Co-Authored-By: Codex <[email protected]>
2026-11-08 01:53:09 +01:00
Thomas MartinandCodex 783b4fb417 Use native weather viewport transform
Co-Authored-By: Codex <[email protected]>
2026-11-08 01:51:29 +01:00
boubou666andCodex 1067036f29 Merge pull request #42: native camera and rear-view transforms
Co-Authored-By: Codex <[email protected]>
2026-11-08 01:38:53 +01:00
Thomas MartinandCodex d014351e10 Use native camera and rear-view transforms
Co-Authored-By: Codex <[email protected]>
2026-11-08 01:37:35 +01:00
boubou666andCodex 00b7414b75 Merge pull request #41: native vehicle peel-out transform
Co-Authored-By: Codex <[email protected]>
2026-11-08 01:19:14 +01:00
Thomas MartinandCodex e818cae146 Use native vehicle peel-out transform
Co-Authored-By: Codex <[email protected]>
2026-11-08 01:17:43 +01:00
boubou666andCodex 81d72db999 Merge pull request #40: native attractor-group spatial transforms
Co-Authored-By: Codex <[email protected]>
2026-11-08 00:10:15 +01:00
Thomas MartinandCodex 256aef3f26 Use native attractor-group spatial transforms
Co-Authored-By: Codex <[email protected]>
2026-11-08 00:08:16 +01:00
boubou666andCodex 0bf979a90e Merge pull request #39: native tow-truck launcher transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 23:09:17 +01:00
Thomas MartinandCodex 87bd01df70 Use native tow-truck launcher transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 23:07:54 +01:00
boubou666andCodex f1118f479c Merge pull request #38: native shadow transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 22:49:11 +01:00
Thomas MartinandCodex ad5169b914 Record shadow runtime qualification
Co-Authored-By: Codex <[email protected]>
2026-11-07 22:47:53 +01:00
Thomas MartinandCodex 0d51802ca2 Use native shadow transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 22:31:43 +01:00
Thomas MartinandCodex 0de15ebac0 Merge pull request #37: native particle-emission transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 21:29:51 +01:00
Thomas MartinandCodex dc687d6dbd Use native particle-emission transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 21:28:15 +01:00
Thomas MartinandCodex 017908b7b1 Merge pull request #36: native suspension and tire-height transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 20:53:51 +01:00
Thomas MartinandCodex 907f8e1f43 Use native suspension and tire-height transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 20:52:24 +01:00
Thomas MartinandCodex 9156063b6d Merge pull request #35: native terrain debug, edit and wave transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 20:26:12 +01:00
Thomas MartinandCodex 2fbfea6742 Use native terrain debug, edit and wave transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 20:24:54 +01:00
Thomas MartinandCodex 199d9a6753 Merge pull request #34: native older car and hierarchy particle transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 20:08:30 +01:00
Thomas MartinandCodex 8282d51d4e Use native older car and hierarchy particle transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 20:06:48 +01:00
Thomas MartinandCodex 571020ea64 Merge pull request #33: native terrain LOS, cell and ray transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 19:42:46 +01:00
Thomas MartinandCodex 8456027b2e Use native terrain LOS, cell and ray transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 19:41:35 +01:00
Thomas MartinandCodex c4afff2dc6 Merge pull request #32: native terrain bounds and query-input transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 19:12:22 +01:00
Thomas MartinandCodex ddb161136f Use native terrain bounds and query-input transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 19:11:01 +01:00
Thomas MartinandCodex 279e3a12e8 Merge pull request #31: native point-contact, ray and root helper transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 18:44:43 +01:00
Thomas MartinandCodex 6a190b0276 Use native point-contact, ray and root helper transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 18:43:21 +01:00
Thomas MartinandCodex e7cdaff01a Merge pull request #30: native older BSP and hierarchy setup helpers
Co-Authored-By: Codex <[email protected]>
2026-11-07 18:28:32 +01:00
Thomas MartinandCodex 0f70ad94a6 Use native older BSP and hierarchy setup helpers
Co-Authored-By: Codex <[email protected]>
2026-11-07 18:26:53 +01:00
Thomas MartinandCodex c0d2fc7549 Merge pull request #29: native hierarchy traversal and older collision setup
Co-Authored-By: Codex <[email protected]>
2026-11-07 17:30:45 +01:00
Thomas MartinandCodex 9daed27724 Use native hierarchy traversal and older collision setup transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 17:29:09 +01:00
Thomas MartinandCodex a29c09f8c5 Merge pull request #28: native BSP point and segment-crossing transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 17:08:20 +01:00
Thomas MartinandCodex 20703fceee Use native transforms for BSP points and segment crossings
Co-Authored-By: Codex <[email protected]>
2026-11-07 17:06:33 +01:00
Thomas MartinandCodex b3d03f6f99 Merge pull request #27: native hierarchy query and lighting transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 16:44:46 +01:00
Thomas MartinandCodex df60a500cc Use native transforms for hierarchy query and lighting consumers
Co-Authored-By: Codex <[email protected]>
2026-11-07 16:43:15 +01:00
Thomas MartinandCodex 9a8e69827a Merge pull request #26: native hierarchy grid and result transforms
Co-Authored-By: Codex <[email protected]>
2026-11-07 16:18:14 +01:00
Thomas MartinandCodex 57414f68ae Use native transforms for hierarchy grid and result helpers
Co-Authored-By: Codex <[email protected]>
2026-11-07 16:17:10 +01:00
Thomas MartinandCodex 4b36de291c Merge pull request #25: native sphere/LOD and collision hierarchy calculations
Co-Authored-By: Codex <[email protected]>
2026-11-07 15:55:46 +01:00
Thomas MartinandCodex 807de7adfa Replace sphere/LOD and collision hierarchy transforms with native records
Co-Authored-By: Codex <[email protected]>
2026-11-07 15:53:50 +01:00
Thomas MartinandCodex 90c9e219ee Merge pull request #24: native inline terrain and contact calculations
Co-Authored-By: Codex <[email protected]>
2026-11-07 14:53:49 +01:00
Thomas MartinandCodex d91b938e7c Replace inline terrain and contact VU calculations with native records
Lower all 27 inline vector blocks in terrain, node, point-contact and ray
result construction. Preserve destination W without VU register/flag
transport, and qualify generated scalar continuations and gameplay.

Co-Authored-By: Codex <[email protected]>
2026-11-07 14:52:24 +01:00
Thomas MartinandCodex 75b6b3597a Merge pull request #23: native BSP and vehicle inverse directions
Co-Authored-By: Codex <[email protected]>
2026-11-07 03:58:11 +01:00
Thomas MartinandCodex 581690018b Lower BSP and vehicle inverse directions to native records
Retire four audited inverse-transform leaves and verify paired generated
continuations leave the complete VU state untouched. Trace contact-position
W residue and qualify its XYZ consumer without restoring padding.

Co-Authored-By: Codex <[email protected]>
2026-11-07 03:56:38 +01:00
Thomas MartinandCodex 4a65a8bcf7 Merge pull request #22: native vehicle/light directions and resumed particles
Co-Authored-By: Codex <[email protected]>
2026-11-07 03:26:54 +01:00
Thomas MartinandCodex 889b086d47 Lower vehicle and light directions and keep resumed particles native
Extend native XYZ direction math to audited vehicle collision-point, tire-height and light-node callers. Retain original ABI fallbacks outside those callers and add generated consumer comparisons.

Fix the native flare fallback exposed by a live 4P scheduler continuation: use durable backend/options selection and keep native depth available across host-time gaps. Add a regression that fails on the prior path without a live particleDraw call scope.

Validate ten native suites, twelve release-tool tests, full 9500/8500-frame baseline/default/strict comparisons and complete RAM snapshots, plus movie/loading/1P/4P window reruns and reviewed captures. Document the initial timing-sensitive stall and remaining acceptance limits.

Co-Authored-By: Codex <[email protected]>
2026-11-07 03:25:21 +01:00
Thomas MartinandCodex 582099259a Merge pull request #21: native BSP collision directions
Co-Authored-By: Codex <[email protected]>
2026-11-06 18:29:49 +01:00
Thomas MartinandCodex e5158e488a Replace hot BSP direction calls with native record math
Lower three audited hdBspNode direction calls without VU state. Preserve destination W and retain original fallbacks for other callers and the historical host. Add optional caller counts and generated BSP continuation coverage.

Validate all nine native suites, twelve release-tool tests, full 9500/8500-frame default and strict gameplay recordings, windowed movie/loading/1P/4P routes and a complete RAM padding audit. Document remaining coverage and audio limits.

Co-Authored-By: Codex <[email protected]>
2026-11-06 18:28:06 +01:00
Thomas MartinandCodex f946958da6 Merge pull request #20: native texture upload-link completion
Co-Authored-By: Codex <[email protected]>
2026-11-06 18:00:51 +01:00
Thomas MartinandCodex 311ca059d0 Replace texture upload-link builder with native cursor completion
Preserve the original complete caller ABI and legacy extent without emitting
hardware tags. Keep unknown, historical and overlapping-record fallbacks.
Qualify the native leaf and full texture chain with original comparisons,
complete game recordings, memory snapshots and windowed movie/loading/gameplay.

Co-Authored-By: Codex <[email protected]>
2026-11-06 17:58:55 +01:00
Thomas MartinandCodex 6341d9bdf9 Merge pull request #19: native traversal texture inputs
Co-Authored-By: Codex <[email protected]>
2026-11-06 17:41:53 +01:00
Thomas MartinandCodex 26f5275333 Read traversal texture inputs directly and retire remaining object copies
Resolve source records from the actual queue and saved consumer frames without
a scoped binding or packet shadow. Preserve texture-manager calculations and
unknown/historical callers while retiring obsolete copy reads and patches.
Qualify the boundary with full consumer/builder fixtures and complete game routes.

Co-Authored-By: Codex <[email protected]>
2026-11-06 17:40:12 +01:00
Thomas MartinandCodex 3fd4257f6a Merge pull request #18: retire per-object shader packet output
Co-Authored-By: Codex <[email protected]>
2026-11-06 17:15:56 +01:00
Thomas MartinandCodex f556f00a4e Retire native mesh shader packet output and RGB readbacks
Keep texture payload copies paired with their downstream activation consumer.
Preserve scalar context, cursor/cache bookkeeping and historical checker ABI.
Qualify the boundary with full-builder fixtures, strict/default recordings,
gameplay memory snapshots and movie/loading/1P/4P captures.

Co-Authored-By: Codex <[email protected]>
2026-11-06 17:14:33 +01:00
Thomas MartinandCodex 165c6f2bfe Merge pull request #17: native screen and weather projection
Replace audited projection and identity boundaries after original-helper/generated-caller checks, bounded peeling-out W-padding analysis and movie/loading/1P/4P validation. Windows/Linux shader and tooling CI passed.

Co-Authored-By: Codex <[email protected]>
2026-11-06 16:27:28 +01:00
Thomas MartinandCodex ce7df104ff Replace audited screen and weather projection VU helpers
Compute row-wise projection and the weather identity matrix from native records at audited callers. Preserve reduction order, overlap and scalar CPU results while leaving VU state untouched; retain original ABIs for other callers and an explicit copied-context comparison flag.

Validate arbitrary-bit helpers, generated screen/weather callers and the remaining peeling-out W-padding chain. Record exact non-RAM 1P/4P comparisons, bounded RAM snapshots and movie/loading/gameplay smoke coverage.

Co-Authored-By: Codex <[email protected]>
2026-11-06 16:23:59 +01:00
Thomas MartinandCodex a415f4279d Merge pull request #16: native mesh shader parameters
Replace the packed VU-shaped shader buffer and light transport with named native records after exact default/strict 1P/4P recordings, movie/loading/gameplay checks and Windows/Linux shader/tooling CI.

Co-Authored-By: Codex <[email protected]>
2026-11-06 15:46:38 +01:00
Thomas MartinandCodex 53afc88139 Avoid POSIX random name collision in shader tests
Use a distinct deterministic fixture helper name on Linux and let both CI platforms finish independently. Runtime code and qualified game recordings are unchanged.

Co-Authored-By: Codex <[email protected]>
2026-11-06 15:45:06 +01:00
Thomas MartinandCodex 39b55f619b Replace packed VU shader inputs with native parameters
Pass named transform, light, fog, tint, texture and morph records directly into native mesh shading. Scene selection now produces logical light records, with per-run opaque/morph caches and the original resume/rounding/alias contracts. Remove the runtime word bank and unused packed draw snapshots.

Preserve complete default/strict 1P and 4P recordings byte-for-byte. Add disc-free shader comparisons to Windows/Linux CI; retain the prior packed implementation only as a synthetic test reference and document real-time capture/audio limits.

Co-Authored-By: Codex <[email protected]>
2026-11-06 15:43:09 +01:00
Thomas MartinandCodex 9d7372f116 Merge pull request #15: native renderer hierarchy records
Replace hierarchy matrix/FOV/light/LOD VU transport with per-run native records after helper/shading, generated-route and movie/loading/1P/4P qualification.

Co-Authored-By: Codex <[email protected]>
2026-11-06 15:14:59 +01:00
Thomas MartinandCodex a5b11695fa Replace renderer hierarchy VU state with native scene records
Move camera/root/child transforms, clipping, projection, lighting, LOD and matrix accessors to per-run records consumed directly by native meshes. Retire their register/memory transfers and image-selection shims, with explicit guards for unsupported callms paths.

Qualify original arithmetic/shading and generated-helper routing, all existing native suites, exact non-RAM 1P/4P records and movie/loading/gameplay captures. Document packet-buffer-only RAM differences at the checked snapshot and remaining macro/shader work.

Co-Authored-By: Codex <[email protected]>
2026-11-06 15:13:41 +01:00
Thomas MartinandCodex 31f54d1a23 Merge pull request #14: native collision hierarchy calculations
Replace audited sphere, inverse-transform and BSP plane-distance VU paths with native record calculations after helper, recursive-caller and movie/loading/1P/4P validation.

Co-Authored-By: Codex <[email protected]>
2026-11-06 14:33:18 +01:00
Thomas MartinandCodex 21c7daa6e2 Replace collision hierarchy VU calculations with native records
Compute height-test spheres, audited inverse transforms and BSP distance pairs without VU context transport. Keep the scalar BSP traversal and other caller ABIs intact; document traced raw-RAM differences and bounded gameplay qualification.

Co-Authored-By: Codex <[email protected]>
2026-11-06 14:31:55 +01:00
Thomas MartinandCodex ce7eb9f60a Merge pull request #13: native graphics services
Adopt the qualified BozoEngine native graphics services and remove the packet-based flare readback adapter.

Co-Authored-By: Codex <[email protected]>
2026-11-06 14:00:41 +01:00
Thomas MartinandCodex ee920b0c53 Adopt merged native graphics services and retire packet-based flare adapter
Pin BozoEngine main 4a8f70a after independent TMB qualification with DC and VP2S. The shared change removes engine GS register/device state and runtime GIF readers, uses native SDK completion/configuration, and rejects unowned readbacks. Remove TMB's obsolete image-packet flare adapter and retain direct native depth sampling; legacy readback diagnostics now fail explicitly.

Independent published-source tests pass 9,500 1P and 8,500 4P frames with exact draw/sound/call/clock results, plus windowed movies/loading/gameplay. The combined vehicle main and new engine reproduce those full records exactly and pass a further four-player window run, all native math suites and 13 engine checks. Record RAM, diagnostic-readback, audio and campaign limits. All 34 no-option TMB generated files match the independently qualified compiler output.

Co-Authored-By: Codex <[email protected]>
2026-11-06 13:55:12 +01:00
boubou666 92a7cfbc8f Merge pull request #12 from TheBozos/codex/native-vehicle-math
Calculate vehicle spatial updates from native records
2026-11-06 13:42:36 +01:00
Thomas MartinandCodex 74fe9e545d Replace vehicle spatial math with native record calculations
Compute the vehicle 3x3 basis product and thirteen inline vector blocks without VU register, accumulator or flag transport. Retain CPU control flow and checkpoints, snapshot each block at its existing store, and preserve destination W for XYZ outputs. Lower the separately audited skid-mark direction call while keeping other helper callers on their existing ABI.

Validate 1,048,576 matrix/direction cases, 425,984 generated-block cases, whole-memory and ordered-overlap checks, 1,024 complete vehicleSetCsMat caller cases, and 2,048 other-caller ABI cases. Independent strict/default 1P and 4P runs reproduce all baseline frame-record fields exactly, including RAM. Movie/loading/gameplay captures pass; document multi-step coverage and full-campaign/audio limits.

Move extracted original fixtures outside the recompiler cleanup directory and verify forced incremental regeneration.

Co-Authored-By: Codex <[email protected]>
2026-11-06 13:39:51 +01:00
boubou666 74fd638c09 Merge pull request #11 from TheBozos/codex/native-image-builders
Adopt shared native image-builder completion
2026-11-06 12:50:49 +01:00
Thomas MartinandCodex 659ef01e02 Pin merged native image-builder retirement and record TMB qualification
Use BozoEngine main149bf90, containing DC's isolated native image-builder guards and generic/native/inaccessible-output regression. TMB resident texture binding still precedes the SDK completion; obsolete image packet output is no longer constructed.

Validate nine engine checks, HUD/matrix suites, 12 release-tool tests, exact9500-frame1P and8500-frame4P draw/sound/call/clock records, unchanged texture initialization diagnostics, and windowed movies/loading/1P/4P captures. Document RAM packet-output and audio/full-campaign limits.

Co-Authored-By: Codex <[email protected]>
2026-11-06 12:49:41 +01:00
boubou666 5b5cd5785d Merge pull request #10 from TheBozos/codex/native-hud-transforms
Calculate inline HUD transforms from native records
2026-11-06 12:40:23 +01:00
Thomas MartinandCodex 0ec0919cd3 Record final HUD movie and gameplay validation
Record default windowed movie/menu, one-player and four-player completions with directly inspected captures, audio observations and bounded coverage limits.

Co-Authored-By: Codex <[email protected]>
2026-11-06 12:39:01 +01:00
Thomas MartinandCodex fac4832771 Replace inline HUD transforms with native record calculations
Lower six point/direction blocks through the native instruction dispatcher, using current matrix/vector records at each final store. Write XYZ and preserve each destination's opaque fourth component without VU register, accumulator or flag transport. Keep generated original-block diagnostics and historical fallback.

Validate 196,608 exact generated-block cases, 192 whole-memory cases and 1,024 ordered overlapping-block cases. Independent default 1P/4P runs reproduce strict records and baseline draws/sound/calls/clocks. Document HUD position.W snapshot differences and the targeting-warning live-coverage limit.

Co-Authored-By: Codex <[email protected]>
2026-11-06 12:37:56 +01:00
boubou666 16a2fcb5bc Merge pull request #9 from TheBozos/codex/native-matrix-helpers
Calculate camera matrix products directly over native records
2026-11-06 12:19:36 +01:00
Thomas MartinandCodex 382e1bbb18 Record final native camera matrix gameplay checks
Record successful windowed movies, loading, one-player and four-player routes, plus 175,340 exact live four-player products and native-only replay equivalence. Isolate the four-player RAM snapshot difference to position.W in the four HUD coordinate records, linked through the actual HUD pointer array. Retain bounded gameplay and audio qualification limits.

Co-Authored-By: Codex <[email protected]>
2026-11-06 12:18:56 +01:00
Thomas MartinandCodex 839c5093f8 Replace camera matrix helpers with native record calculations
Compute transposed 3x3 and full 4x4 camera products directly over typed records without VU register, accumulator, flag or microcode state. Preserve aliasing and number-format behavior, and keep an opt-in original-helper comparison for validation.

Validate 524,288 exact helper/ABI cases and 256 complete-memory cases. A separate 9,500-frame default run matches the strict run; all 8,500 comparable baseline draw/sound/call/clock records match. Document the traced HUD position.W RAM difference and the VU work that remains.

Co-Authored-By: Codex <[email protected]>
2026-11-06 12:13:16 +01:00
boubou666 c736d9ceec Merge pull request #8 from TheBozos/codex/native-graphics-completion
Replace graphics DMA waits with native submission and completion
2026-11-06 11:34:54 +01:00
Thomas MartinandCodex 478a6b6560 Pin merged engine graphics completion and record integration checks
Use BozoEngine main at 5bb4efb, which includes the current shared native port services and graphics completion. Record eight passing local checks, Windows/Linux CI, exact reproduction of all 8,500 native test frames and a further windowed movie/loading/four-player smoke run.

Co-Authored-By: Codex <[email protected]>
2026-11-06 11:33:35 +01:00
Thomas MartinandCodex 0215b07d60 Replace graphics DMA waits with native submission and completion
Replace 109 hardware-output/completion instruction sites before MMIO. Submit and release native view queues directly, select native VU0 routines without uploads, and complete movie presentation without GIF interrupts. Guard retired graphics access while retaining the historical checker path and separate movie-input synchronization.

Pin BozoEngine f715d57. Validation: 5/5 CTest checks, 146 instruction cases, boot and 1P historical checker MATCH, 8,500 guarded native frames, windowed 1P and four-player play, and no-skip movies at normal cadence. NATIVE_GRAPHICS.md records the remaining floating-point and audio comparison limits.

Co-Authored-By: Codex <[email protected]>
2026-11-06 11:22:58 +01:00
boubou666 0f43f931ba Merge pull request #7 from TheBozos/codex/release-verification
Record v0.4.0 publication and installed verification
2026-11-06 09:16:37 +01:00
Thomas MartinandCodex 59be1873d8 Record v0.4.0 publication and released-package verification
Co-Authored-By: Codex <[email protected]>
2026-11-06 09:11:15 +01:00
boubou666 eea175219b Merge pull request #6 from TheBozos/codex/release-0.4.0
Release TMB v0.4.0 on BozoEngine
2026-11-06 00:56:38 +01:00
Thomas MartinandCodex a2df8d5bf3 Prepare TMB v0.4.0 on BozoEngine
Keep the shared README format, publish the native migration changelog and update project metadata for the retired fork.

Co-Authored-By: Codex <[email protected]>
2026-11-06 00:55:51 +01:00
boubou666 faa3473262 Merge pull request #5 from TheBozos/codex/readme-format
Restore the shared project README format
2026-11-06 00:49:13 +01:00
Thomas MartinandCodex d9504a3bbc Restore the shared project README format for BozoEngine
Keep the original section order, badges, screenshots, milestone/native-layer tables, controls and cheats while updating the runtime/build facts.

Co-Authored-By: Codex <[email protected]>
2026-11-06 00:41:35 +01:00
boubou666 80d028269a Merge pull request #4 from TheBozos/codex/validation-notes
Record native acceptance and clarify migration downloads
2026-11-06 00:31:03 +01:00
Thomas MartinandCodex c92c4cf3a2 Record final native acceptance and clarify migration downloads
Co-Authored-By: Codex <[email protected]>
2026-11-06 00:13:56 +01:00
boubou666 c2a6d301af Merge pull request #3 from TheBozos/codex/phase4-finish
Retire PS2Recomp and finish the BozoEngine-only port
2026-11-05 23:49:24 +01:00
Thomas MartinandCodex fe0f21a281 Refresh native build instructions and record packaged validation
Co-Authored-By: Codex <[email protected]>
2026-11-05 23:43:34 +01:00
Thomas MartinandCodex b9c42cb332 Validate native Windows installs, retries and archive export end to end
Enable UTF-8 and long paths in native Windows executables, invalidate stale compiler feature checks after
toolchain relocation changes, and report real installation paths after temporary aliases are removed.
Drain tar record padding before waiting for git archive, fixing a reproduced release-export deadlock.

Strengthen launcher self-test failures, extend the release regressions, port pad-script helpers to native frame
inputs, and recheck README availability, requirements, controls and commands against the tested native build.

Co-Authored-By: Codex <[email protected]>
2026-11-05 23:26:09 +01:00
Thomas MartinandCodex 4e43adcc40 Fix standalone accented-path builds and retire installed fork sources
Keep GCC's startup/library search paths on the ASCII alias and disable unused C++ module scanning, fixing two
failures found in a fresh bundled-kit build under Jerome's accented folder. Add a game-data-free static-link
probe to release CI at an accented installation path.

Remove the retired PS2Recomp source tree after an in-place update, pruning junctions before traversal and keeping
player/custom files outside managed roots. Make the launcher's self-test fail on a failed build or game start.

Co-Authored-By: Codex <[email protected]>
2026-11-05 23:10:22 +01:00
Thomas MartinandCodex 75c24362f5 Retire PS2Recomp and finish the BozoEngine-only player build
Remove the fork gitlink, CMake branch, old recompiler/IOP/PGO steps and pack-tool fallbacks. Route the retained
build/run shortcuts through the native pipeline and keep native frame pacing unconditional.

Pin BozoEngine's reviewed timing/heat-haze changes. Prepare both a separate-install ZIP and a compatible
in-place-update ZIP with the same native payload, audit out the retired runtime, document CPU requirements,
and add migration/timing CI and current build/release guidance.

Co-Authored-By: Codex <[email protected]>
2026-11-05 22:55:52 +01:00
Thomas MartinandClaude Opus 5.5 e65ac1ed3b BozoEngine 8575559: the match-start sound freeze fixed (989SND on the PC's clock in real time) and the lens flares' depth reads no longer stall the present; game work cut by about a third
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 00:05:47 +01:00
Thomas MartinandClaude Opus 5.5 6e1d224cc5 Bozo M6: README (the BozoEngine build's tmb_build steps, kit, launcher, release names); release.yml's test builds are 0.0.0-test.<run>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 23:10:06 +01:00
Thomas MartinandClaude Opus 5.5 f04a154be1 Bozo M6: the launcher and build kit build TMB on BozoEngine from the player's disc
- BozoEngine is a submodule (37ba878, public); cmake/bozo.cmake uses it unless BOZO_ENGINE_DIR names another tree,
  takes TMB_DISC_DIR (the packs' files already extracted), a tmb_recompile target and TMB_GUI_SUBSYSTEM (tmb.exe
  without a console, the players' build).
- tools/tmb_build.py: verify, extract (the ELF and the packs' .TEX/.RTX/.NGP/.PTR only, and disc.iso), configure,
  tools (bozo-recomp, bozo-externals from BozoEngine's sources), recompile, packs, compile (tmb), stage (tmb.exe,
  SCUS_971.01, the packs, disc.iso). No IOP step, no ps2_recomp or ps2_vu_aot; Ninja keeps it incremental.
- tools/make_build_kit.py (kit_version 2): SDL3 3.4.20 and ImGui b1bcb12a from the archives BozoEngine pins (SHA-256),
  unpacked as deps/sdl3-src and deps/imgui-src with their licences in licenses/deps; FFmpeg without swscale; no
  prebuilt recompilers, no raylib or the fork's tool libraries; the MSYS2 pins unchanged.
- launcher: SDL3 + ImGui's own SDL3 / OpenGL 3 backends instead of raylib / rlImGui (window.cpp; the background on
  ImGui's background draw list, screenshots with BozoEngine's PNG writer); it starts tmb.exe --elf --iso.
- tools/make_release.py: TMB_Recomp-<version>-bozo.zip (folder TMB_Recomp_Bozo) with source\BozoEngine (MIT) instead
  of the fork; apply_update.py and the launcher's Update use that name.
- release.yml: the kit and zip for this build; run by hand without a tag, a test build whose zips are artifacts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 23:04:14 +01:00
Thomas MartinandClaude Opus 5.5 03b6a2fd5f videoDecAbort: tell BozoEngine's libmpeg the playback was aborted (a skipped movie: sceMpegIsEnd 1 from then on, as the fork's abortMpegPlayback did); the story run's skipped stage movie diverged at #9723824 without it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 17:50:43 +01:00
Thomas MartinandClaude Opus 5.5 9a6d4a35ab Bozo M5: tmb-check --window (the pinned run in BozoEngine's window, 640x448 at render scale 1, 4:3 letterboxed; --capture-frames holds the run at each frame's end until its picture is read back: exactly that frame's picture, for the pixel comparison with the fork)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 17:27:47 +01:00
Thomas MartinandClaude Opus 5.5 816a03de06 tmb_overrides.cpp: back to LF line endings (the clock-debt commit converted the file to CRLF)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 16:24:04 +01:00
Thomas MartinandClaude Opus 5.5 3845b42d07 nativeFrameEnd: in paced runs the EE time a frame accounted beyond its real time is a debt paid back from later frames' charges; TMB_TRACE_CLOCK adds the last 300 frames' EE/PC and the debt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 16:23:01 +01:00
Thomas MartinandClaude Opus 5.5 79f0f7636b Bozo M4: the Cheats tab through BozoEngine's settings window (bozo_ui, BOZO_SETTINGS_UI); tmb reads video.ini (the fork's file) with its command line over it; TMB_TRACE_CLOCK logs the EE clock against the PC's
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 15:51:00 +01:00
Thomas Martin 2b020b531d Merge branch 'bozo/freefault' into bozo/m0 2026-11-04 15:01:25 +01:00
Thomas MartinandClaude Opus 5.5 d7966c41f3 Merge bozo/m3 (sound) with phase4/m2 (pads): CMake source lists and command-line options combined
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 15:01:25 +01:00
Thomas MartinandClaude Opus 5.5 6edb484721 killEnemies: note BozoEngine's rule for guest code on an override's own context (the free story fault at frame 5458)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 14:54:25 +01:00
Thomas MartinandClaude Opus 5.5 829e39605b Phase 4 M3: tmb plays the game's sound (BozoEngine's AudioDevice on the default device, --no-sound, --audio-latency, --audio-stats, --wav / PS2X_AUDIO_RECORD); tmb-headless --wav [--wav-frames a-b], --no-sound
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 14:50:22 +01:00
Thomas MartinandClaude Opus 5.5 5c27e14a9c Phase 4 M2: tmb with the fork's TMB identity (user folder %APPDATA%\TMB_Recomp: input.ini, the memory cards, logs, crash reports), the PC's pads for up to four players (BozoEngine's DevicePad, input.ini), --pad-script n=file for players 1-4 in tmb and tmb-headless; tmb-headless reports each pad socket's reads
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 14:28:26 +01:00
Thomas MartinandClaude Opus 5.5 a5c96286b9 Phase 4 M1: TMB's runtime at -O2 and the renderer, both for AVX2 with FMA, as the reference build compiled them: the draw lists equal the reference's (boot and match1p, every frame but each log's last)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 13:38:41 +01:00
Thomas MartinandClaude Opus 5.5 c1da396ef4 Phase 4 M1: tmb, the game in a window in real time on BozoEngine (bozo/tmb_window.cpp: SDL3, OpenGL 3.3, F8 / --capture-frames PNGs); the texture and mesh packs built from the disc image (TMB_ISO) into <build>/packs by BozoEngine's tools/native_pack
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 12:52:40 +01:00
Thomas MartinandClaude Opus 5.5 03b04bf734 Phase 4 M0: the frame end's cycle read after the host took the frame
tmb_overrides.cpp: g_frameEndCycle is read after bozo::port::frameEnd (a checked run moves the clock to the reference's
frame end; the next frame's debt is counted from there, so its T0 poll is taken as the reference's: match1p
#59270988).

With it tmb-check matches match1p --pinned on every frame and record (16000 frames, 74,615,923 records), TMB's
overrides native; tmb-headless reaches the title, and with the 1P pad script a match (rtMain__Fi from frame 5591).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 12:06:49 +01:00
Thomas MartinandClaude Opus 5.5 68409d1283 Phase 4 M0: TMB's runtime on BozoEngine, headless (-DTMB_BOZO=ON -DBOZO_ENGINE_DIR=<BozoEngine>)
The runtime builds against BozoEngine (its phase4/m0) instead of the PS2Recomp fork; the fork build of this branch no
longer builds it. cmake/bozo.cmake: the generated code (bozo-recomp with the externals bozo-externals writes from the
ELF, recomp/tmb_stubs.txt and the override list tools/tmb_overrides_list.py makes from runtime/*.cpp), and two
executables:
- tmb-check: BozoEngine's call-log checker with TMB's overrides running natively, each call checked against the
  reference's log (boot --pinned: 3000 of 3000 frames, every record);
- tmb-headless: the game with no log and no window, every library native, BozoEngine's own timing; it reaches the title
  (uiTitle_Main__Fv from frame 1116) and, with the 1P pad script, a match (rtMain__Fi from frame 5591).

What changed in runtime/:
- runtime/tmb_port.h: the context helpers, the generated functions by name, bozo/port.h; PS2Runtime is BozoEngine's
  Runtime, the install functions take the registry as `runtime` (their registration lines unchanged).
- tmb_overrides.cpp: the scheduler calls through the port API (switchThread, native frames: accountCycles, frameEnd,
  ioRead32 / ioWrite32 for T0); the fork's experiments dropped (GS lag, VIF1 thread, vblank hold, A/B, rain lift, idle
  and thread traces, profiler gates, fps overlay notes, env defaults for the IOP and GS); the libmpeg HLE calls dropped
  (BozoEngine's libmpeg sees the stream's end itself); sceGsExecStoreImage and the timeline's sceGs calls through
  bozo::port::callLibrary; the Logitech wheel's TOML stubs as returnZero overrides; findDiscImage kept for the
  executable; the multitap flag in BozoEngine's libpad.
- tmb_native.cpp: the VIF1 stream adapter, VU1 translations, GS front end and their toggles dropped (3515 -> 270
  lines); what the hooks share kept (match / menu frames, screen, view clip, fog colour, flare depth, publish).
- tmb_vu0.cpp and vu1/tmb_vu1_rain.cpp deleted (BozoEngine's VU0 programs; no VU1).
- tmb_2d, tmb_meshes, tmb_particles, tmb_textures, tmb_cheats: includes and the renderer's namespace (bozo::render),
  the store patch (bozo:store marks the dialog kick), the particles' FPU / VU0 helpers on BozoEngine's PS2 floats,
  particleDraw resumed through its resume entry, sceGsSetDefLoadImage's original through callLibrary, the pack
  folders from tmb_host (executableDirectory, elfDirectory).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 11:02:15 +01:00
Thomas MartinandClaude Opus 5.5 7f508eb520 PS2Recomp: _sceSifSendCmd gets its own handler (VP2S's fix: the underscore alias bound it to sceSifSendCmd, one argument off; TMB never reaches it, its SIF traffic is 989SND through sceSifCallRpc); recomp.sh stops when rsync is missing instead of keeping the old generated code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 11:55:57 +01:00
199 changed files with 20998 additions and 9678 deletions

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
name: CI
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
release-tools:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Release, migration and timing checks
run: python -m unittest discover -s tests -v
- name: Python syntax
run: python -m compileall -q tools
- name: Shell syntax
shell: bash
run: for file in scripts/*.sh; do bash -n "$file" || exit; done
native-shader:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
if: runner.os == 'Windows'
with:
msystem: UCRT64
update: false
install: mingw-w64-ucrt-x86_64-gcc
- name: Shader comparisons without game data (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
g++ -std=c++20 -O2 -mavx2 -mfma -Iruntime tests/native_shader_tests.cpp -o shader-tests.exe
./shader-tests.exe
- name: Shader comparisons without game data (Linux)
if: runner.os == 'Linux'
run: |
g++ -std=c++20 -O2 -mavx2 -mfma -Iruntime tests/native_shader_tests.cpp -o shader-tests
./shader-tests
+81 -28
View File
@@ -1,11 +1,17 @@
# The release: built only when the owner asks for one, never on an ordinary push or a pull request.
# The release of the BozoEngine build: built only when the owner asks for one, never on an ordinary push or a pull
# request.
#
# git tag v0.1.0 && git push origin v0.1.0 (or Actions > Release > Run workflow, with the tag)
#
# On a version tag it makes the build kit from the pinned MSYS2 packages (tools/build_kit_packages.json), the release
# zip, its SHA-256 and the sources zip with tools/make_release.py, checks them without any game data, and creates a
# DRAFT GitHub release with CHANGELOG.md's section for the version as its body. Nothing is ever published by this
# workflow: the owner runs docs/RELEASE_CHECKLIST.md on a clean PC, then publishes the draft by hand.
# zips TMB_Recomp-<version>-bozo.zip (folder TMB_Recomp_Bozo) and TMB_Recomp-<version>.zip (folder TMB_Recomp for
# the previous updater). Both carry BozoEngine. It adds hashes and corresponding sources, checks without game data, and creates a DRAFT
# GitHub release with CHANGELOG.md's section for the version as its body. Nothing is ever published by this workflow:
# the owner runs docs/RELEASE_CHECKLIST.md on a clean PC, then publishes the draft by hand.
#
# Run by hand without a tag (Actions > Release > Run workflow on a branch, or gh workflow run release.yml --ref
# <branch>): a test build of that branch (version 0.0.0-test.<run number> unless given), the same kit, zip and checks,
# no sources zip and no draft release; the zips are the run's artifacts.
#
# Every step is a thin call into tools/make_build_kit.py or tools/make_release.py, so the same commands run on a
# developer's PC (README, "Making a release").
@@ -20,8 +26,14 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'The version tag to release (already pushed), e.g. v0.1.0'
required: true
description: 'The version tag to release (already pushed), e.g. v0.1.0; empty: a test build of the branch'
required: false
default: ''
type: string
version:
description: 'A test build only: its version (default 0.0.0-test.<run number>)'
required: false
default: ''
type: string
release:
types: [published]
@@ -41,25 +53,37 @@ jobs:
permissions:
contents: write # the draft release and its files
env:
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || (github.event_name == 'push' && github.ref_name || '') }}
TEST_VERSION: ${{ inputs.version }}
defaults:
run:
shell: bash
steps:
- name: Version from the tag
- name: Version from the tag (or a test build's)
run: |
set -eu
if ! printf '%s' "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
echo "::error::$TAG is not a version tag (vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-pre)"
exit 1
if [ -n "$TAG" ]; then
if ! printf '%s' "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
echo "::error::$TAG is not a version tag (vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-pre)"
exit 1
fi
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
echo "TEST_BUILD=" >> "$GITHUB_ENV"
else
v="${TEST_VERSION:-0.0.0-test.$GITHUB_RUN_NUMBER}"
if ! printf '%s' "$v" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
echo "::error::$v is not a version (MAJOR.MINOR.PATCH or MAJOR.MINOR.PATCH-pre)"
exit 1
fi
echo "VERSION=$v" >> "$GITHUB_ENV"
echo "TEST_BUILD=1" >> "$GITHUB_ENV"
fi
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
echo "WORK=$(cygpath -m "$RUNNER_TEMP")/tmb" >> "$GITHUB_ENV"
- name: Check out the tag (and the PS2Recomp submodule at its recorded commit)
- name: Check out the tag or the branch (and the BozoEngine submodule at its recorded commit)
uses: actions/checkout@v4
with:
ref: refs/tags/${{ env.TAG }}
ref: ${{ env.TAG != '' && format('refs/tags/{0}', env.TAG) || '' }}
submodules: true
persist-credentials: false
@@ -69,6 +93,7 @@ jobs:
python-version: '3.14'
- name: The changelog has this version
if: env.TEST_BUILD == ''
run: python tools/make_release.py --check-changelog --version "$VERSION"
- name: MSYS2 (pacman, and sh for FFmpeg's configure; the toolchain itself comes from the pins)
@@ -79,12 +104,12 @@ jobs:
update: false
install: diffutils
- name: Cache the downloads (pinned MSYS2 packages, FFmpeg, Python, MSYS2 sources, the font)
- name: Cache the downloads (pinned MSYS2 packages, FFmpeg, Python, SDL3, ImGui, MSYS2 sources, the font)
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/tmb/downloads
key: tmb-downloads-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
restore-keys: tmb-downloads-
key: tmb-bozo-downloads-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
restore-keys: tmb-bozo-downloads-
- name: Cache the kit's FFmpeg (by the pins and make_build_kit.py)
id: ffmpeg
@@ -95,14 +120,14 @@ jobs:
${{ runner.temp }}/tmb/kit/sources
${{ runner.temp }}/tmb/kit/licenses/ffmpeg
${{ runner.temp }}/tmb/kit/.parts/ffmpeg.json
key: tmb-ffmpeg-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
key: tmb-bozo-ffmpeg-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
- name: Install the pinned MSYS2 packages (exact files, SHA-256 checked)
env:
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
run: python tools/make_build_kit.py --install-packages --msys "$MSYS2_ROOT" --downloads "$WORK/downloads"
- name: Build kit
- name: Build kit (toolchain, Python, SDL3 and ImGui sources, FFmpeg)
env:
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
FFMPEG_CACHED: ${{ steps.ffmpeg.outputs.cache-hit }}
@@ -111,28 +136,35 @@ jobs:
steps="--only toolchain --only python --only deps"
if [ "$FFMPEG_CACHED" != true ]; then steps="$steps --only ffmpeg"; fi
python tools/make_build_kit.py --out "$WORK/kit" --msys "$MSYS2_ROOT" --downloads "$WORK/downloads" \
--work "$WORK/kit-work" $steps --only tools --only manifest
--work "$WORK/kit-work" $steps --only manifest
- name: Make the release (zip, .sha256, sources zip, notes from CHANGELOG.md)
env:
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
run: |
set -eu
if [ -n "$TEST_BUILD" ]; then extra="--allow-missing-changelog"; else extra="--with-sources"; fi
python tools/make_release.py --version "$VERSION" --kit "$WORK/kit" --msys "$MSYS2_ROOT" \
--out "$WORK/release" --downloads "$WORK/downloads" --with-sources
--out "$WORK/release" --downloads "$WORK/downloads" $extra
- name: Smoke checks (no game data anywhere)
run: |
set -eu
rel="$WORK/release"
name="TMB_Recomp-$VERSION"
name="TMB_Recomp-$VERSION-bozo"
# The zip: no game file, the files a release needs; the hashes.
python tools/make_release.py --verify-zip "$rel/$name.zip"
(cd "$rel" && sha256sum -c "$name.zip.sha256" && sha256sum -c "$name-sources.zip.sha256")
(cd "$rel" && sha256sum -c "$name.zip.sha256")
(cd "$rel" && sha256sum -c "TMB_Recomp-$VERSION.zip.sha256")
python -c 'import sys; sys.path.insert(0, "tools"); from make_release import verify_zip; p = verify_zip(sys.argv[1], top="TMB_Recomp"); print(p); sys.exit(bool(p))' "$rel/TMB_Recomp-$VERSION.zip"
if [ -z "$TEST_BUILD" ]; then (cd "$rel" && sha256sum -c "$name-sources.zip.sha256"); fi
# Unzipped as a player would.
t="$WORK/smoke"
t="$WORK/smoke/Jérôme Games"
rm -rf "$t" && mkdir -p "$t/user"
python -I -c 'import sys, zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])' "$rel/$name.zip" "$t"
app="$t/TMB_Recomp"
app="$t/TMB_Recomp_Bozo"
# A real static C++ link through an accented kit path, without any game data or installed developer tools.
"$app/kit/python/python.exe" -I "$app/source/tools/check_toolchain.py" --toolchain "$app/kit/ucrt64" --out "$WORK/compiler-check"
head -c 1048576 /dev/zero > "$t/not_a_disc.iso"
# tmb_build with the kit's own Python refuses a file that is not a disc.
if "$app/kit/python/python.exe" -I -X utf8 "$app/source/tools/tmb_build.py" --check \
@@ -150,7 +182,24 @@ jobs:
cat "$t/self-check.txt"
grep -q "^version $VERSION$" "$t/self-check.txt"
- name: Draft GitHub release (never published here)
- name: Keep the zips (the run's artifacts)
uses: actions/upload-artifact@v4
with:
name: TMB_Recomp-${{ env.VERSION }}-bozo
path: |
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo.zip
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo.zip.sha256
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}.zip
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}.zip.sha256
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo-sources.zip
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo-sources.zip.sha256
${{ runner.temp }}/tmb/release/RELEASE_NOTES.md
if-no-files-found: error
retention-days: 14
compression-level: 0
- name: Draft GitHub release (never published here; tags only)
if: env.TEST_BUILD == ''
env:
GH_TOKEN: ${{ github.token }}
run: python tools/make_release.py --version "$VERSION" --out "$WORK/release" --publish-only
@@ -159,10 +208,14 @@ jobs:
if: always()
run: |
{
echo "## TMB_Recomp $VERSION"
echo "## TMB_Recomp $VERSION (BozoEngine)"
echo
if [ -f "$WORK/release/RELEASE_NOTES.md" ]; then
echo "A **draft** release was created if every step passed: run docs/RELEASE_CHECKLIST.md on a clean PC, then publish it."
if [ -n "$TEST_BUILD" ]; then
echo "A test build: the zip is this run's artifact; no release was made."
else
echo "A **draft** release was created if every step passed: run docs/RELEASE_CHECKLIST.md on a clean PC, then publish it."
fi
echo
cat "$WORK/release/RELEASE_NOTES.md"
else
+4 -1
View File
@@ -17,7 +17,7 @@ SLUS_*
*.irx
*.IMG
# PS2Recomp is a git submodule; local build trees live here
# Local build trees
build/
out/
cmake-build-*/
@@ -41,3 +41,6 @@ ps2_log.txt
# Debug UI layout the runtime writes in the working directory
imgui.ini
__pycache__/
# Retired local checkout (not a dependency; preserves untracked local files during migration)
/PS2Recomp/
+3 -3
View File
@@ -1,3 +1,3 @@
[submodule "PS2Recomp"]
path = PS2Recomp
url = https://github.com/TheBozos/PS2Recomp.git
[submodule "BozoEngine"]
path = BozoEngine
url = https://github.com/TheBozos/BozoEngine.git
+3 -3
View File
@@ -11,8 +11,8 @@
"project": "TMB_Recomp",
"status": "released",
"targets": ["Windows"],
"toolchain": "Ps2recomp",
"approach": "Static recompilation with a PS2Recomp fork; native PC renderer, sound and timing, no GS, VU or SPU2 emulation in the default mode.",
"toolchain": "BozoEngine",
"approach": "Static recompilation with BozoEngine; native PC renderer, sound, input and timing, with no PS2Recomp dependency or IOP, GS, VIF or VU interpreter in the player build.",
"started": "2026-10-22",
"maintainers": [
{ "name": "boubou666", "link": "https://github.com/boubou666" },
@@ -27,5 +27,5 @@
"Testing on high-refresh monitors (the experimental smoothed frame rate)",
"Testing on Linux"
],
"notes": "Playable at 60 fps on Windows, built by the launcher from the player's own USA disc. Every Challenge arena played, split screen for 2 to 4 players, memory card saves, rebindable controls including keyboard and mouse, video settings and cheats. Next: story levels 2 to 8 checked to the end, widescreen."
"notes": "Playable at a 60 Hz target on Windows, built by the launcher from the player's own USA disc. BozoEngine replaces the previous runtime; native 1P with bots, four-player split screen, level 20, card writes and restart/readback are validated. Rebindable controls, video settings, cheats and default-on heat haze. Next: full campaign endings, every arena rechecked on BozoEngine, physical-controller/clean-OS acceptance and widescreen."
}
Submodule
+1
Submodule BozoEngine added at 4a8f70a502.
+71 -1
View File
@@ -7,6 +7,74 @@ under "Unreleased" as they land, then move them under the new version's heading
## [Unreleased]
## [0.5.0] - 2026-11-09
### Changed
- **The game's 3D math runs natively.** Every inventoried coordinate transform (269 forward and 134 inverse uses)
now runs as native C++. So do the hierarchy, collision, terrain, particle, camera, weapon and HUD calculations
built on them; none of them goes through the recompiled vector-unit helper any more. Generated tests compare
every one against the original arithmetic. Recorded one-player and four-player replays match the previous build
on every frame's calls, draws, sound and timing. The only differences found were in unused scratch memory.
- More of the graphics path is native: HUD and menu image builders, mesh shader parameters, screen and weather
projection, texture inputs and upload completion. The game no longer emits per-object shader packets.
- BozoEngine is updated to `4a8f70a`.
### Fixed
- **Rare hang when leaving a menu movie** (seen once on vehicle select): a movie could freeze after a long frame, and
the next menu choice then waited for its decoder forever. The movie player's vblank handler now runs natively.
### Developer changes
- The native-math caller suite covers about 191,000 generated sequences (9,952 whole-memory comparisons). They span
four rounding modes, denormal flushing, RAM aliases and arbitrary W payloads, with full-owner entries for each
call site.
- `docs/HANDOFF.md` links one qualification document per batch: test coverage, replay comparison and window runs.
### Known limits
- Only the USA disc is supported. Windows is the validated player target; the migrated Linux player build is not yet validated.
- Full campaign endings, a fresh standard-user Windows installation and four physical controllers still need player/hardware acceptance.
Widescreen is not implemented; presentation above 60 Hz remains experimental for effects that update at game rate.
## [0.4.0] - 2026-11-06
### Changed
- **BozoEngine is now the only recompiler and runtime.** The PS2Recomp submodule, legacy build targets and IOP
recompilation steps are removed. TMB and BozoEngine are MIT; release packages retain every third-party licence.
- The launcher uses SDL3 and Dear ImGui; the game uses BozoEngine's native window, input, renderer, sound and movie
services. Existing memory-card files and settings remain usable.
- Two installation ZIPs contain the same BozoEngine build: `-bozo.zip` installs beside the previous port, while the
ZIP without that suffix preserves the old launcher's in-place update path. Both use BozoEngine.
### Fixed
- **Original heat haze enabled by default** around fire and explosions. `BOZO_HEAT_HAZE=0` disables it for comparisons
with the previous PC build.
- Menu and movie pacing always uses the native clock. An old `TMB_NATIVE_FRAMES=0` setting can no longer select an
unpaced path. Timing checks now measure menu ticks and movie picture cadence independently of the FPS counter.
- Match-start sound and lens-flare presentation stalls are fixed in the pinned BozoEngine revision.
- Building from folders with spaces and accents now keeps GCC's startup objects and static libraries on the
safe path and disables unused C++ module scanning. In-place updates remove the retired runtime's source folder
without following directory links. Launcher self-tests fail when preparing or starting the game fails.
- Native Windows executables use UTF-8 file paths. A changed toolchain invalidates stale configure checks before
retrying, and release source exports drain tar padding so they cannot hang waiting for `git archive`.
### Developer changes
- All build/run shortcuts use the disc-to-game BozoEngine pipeline. Release audits reject the retired runtime.
- Added Windows/Linux CI and regression checks for timing, package contents and the migration ZIP layout.
### Known limits
- Only the USA disc is supported. Windows is the validated player target; the migrated Linux player build is not yet validated.
- Full campaign endings, a fresh standard-user Windows installation and four physical controllers still need player/hardware acceptance.
Widescreen is not implemented; presentation above 60 Hz remains experimental for effects that update at game rate.
- Exact native sound-model/sample equality and the old test-only save-cheat replay remain reference-test limitations.
Native story progression, card writes, restart/readback and actual four-player play pass; see `docs/HANDOFF.md` for the evidence.
## [0.3.2] - 2026-11-02
### Added
@@ -123,7 +191,9 @@ The first release. You build the game on your own PC from your own USA disc; not
- Technical: built from TMB_Recomp's code and the PS2Recomp fork (`native/renderer`) with the build kit's GCC 16.2,
FFmpeg 9.0.2 and Python 3.14; the default mode has no GS, VU or SPU2 emulation and no IOP hardware model.
[Unreleased]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.2...HEAD
[Unreleased]: https://github.com/TheBozos/TMB_Recomp/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.2...v0.4.0
[0.3.2]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.2.0...v0.3.0
+4 -135
View File
@@ -1,139 +1,8 @@
cmake_minimum_required(VERSION 3.21)
project(TMB_Recomp LANGUAGES C CXX)
# Twisted Metal: Black (USA, SCUS-97101) static recompilation on top of PS2Recomp.
#
# Build the tools first (scripts/build_tools.sh), generate code (scripts/recomp.sh),
# then configure this project to get the `ps2EntryRunner` executable with the
# recompiled game linked in.
# The port uses no C++ modules. GCC's module mapper cannot represent canonical Windows kit paths with spaces.
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
set(TMB_GENERATED_DIR "${CMAKE_SOURCE_DIR}/generated" CACHE PATH
"Directory containing the output of ps2_recomp for the game ELF")
# Only the runtime is needed here; the recompiler/analyzer are built separately.
set(PS2X_BUILD_RECOMP OFF CACHE BOOL "" FORCE)
set(PS2X_BUILD_ANALYZER OFF CACHE BOOL "" FORCE)
set(PS2X_BUILD_TEST OFF CACHE BOOL "" FORCE)
set(PS2X_BUILD_STUDIO OFF CACHE BOOL "" FORCE)
# The runner as a PC game (the fork's ps2_app.h): its window title, the per-user folder (%APPDATA%\TMB_Recomp,
# $XDG_DATA_HOME/tmb_recomp) for the memory cards, input.ini, video.ini, the log and crash reports, and with no argument
# the game data in game/ next to the runner (or in the user folder). No console window (a GUI-subsystem runner: the
# output goes to the log, and to the terminal it was started from).
set(PS2X_APP_TITLE "Twisted Metal: Black" CACHE STRING "" FORCE)
set(PS2X_APP_FOLDER "TMB_Recomp" CACHE STRING "" FORCE)
set(PS2X_APP_XDG_FOLDER "tmb_recomp" CACHE STRING "" FORCE)
set(PS2X_APP_BOOT_ELF "SCUS_971.01" CACHE STRING "" FORCE)
set(PS2X_APP_DATA_FOLDER "game" CACHE STRING "" FORCE)
set(PS2X_SHOW_WINDOWS_CONSOLE OFF CACHE BOOL "" FORCE)
add_subdirectory(PS2Recomp)
# The runner's icon and version information (runtime/app: a placeholder icon, no game art).
if(WIN32)
enable_language(RC)
target_sources(ps2EntryRunner PRIVATE "${CMAKE_SOURCE_DIR}/runtime/app/tmb.rc")
endif()
file(GLOB TMB_GENERATED_SOURCES CONFIGURE_DEPENDS "${TMB_GENERATED_DIR}/*.cpp")
if(NOT TMB_GENERATED_SOURCES)
message(FATAL_ERROR
"No generated sources in ${TMB_GENERATED_DIR}. Run scripts/recomp.sh first.")
endif()
# The runtime ships a placeholder register_functions.cpp that defines the same
# function-table globals as the generated one; drop it from the runner.
get_target_property(_runner_sources ps2EntryRunner SOURCES)
list(FILTER _runner_sources EXCLUDE REGEX "src/runner/register_functions\\.cpp$")
set_property(TARGET ps2EntryRunner PROPERTY SOURCES ${_runner_sources})
file(GLOB TMB_RUNTIME_SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/*.cpp")
# The native texture pack scripts/recomp.sh converts from the disc (runtime/tmb_textures.cpp loads it).
target_compile_definitions(ps2EntryRunner PRIVATE TMB_TEXTURE_PACK="${TMB_GENERATED_DIR}/tmb_textures.pack")
# The native mesh pack it converts from the disc's NGP files (tools/tmb_mesh_pack.py).
target_compile_definitions(ps2EntryRunner PRIVATE TMB_MESH_PACK="${TMB_GENERATED_DIR}/tmb_meshes.pack")
# IOP modules recompiled to native C++ by the fork's tools/iop_recomp.py (989snd, libsd; PS2X_IOP_NATIVE=1 runs them;
# scripts/iop_recomp.sh writes them, derived from the game's IRX files like the rest of generated/): their own object
# library, outside the unity batches (each file's names are its own), without debug info.
file(GLOB TMB_IOP_NATIVE_SOURCES CONFIGURE_DEPENDS "${TMB_GENERATED_DIR}/iop/*.cpp")
if(TMB_IOP_NATIVE_SOURCES)
add_library(tmb_iop_native OBJECT ${TMB_IOP_NATIVE_SOURCES})
target_link_libraries(tmb_iop_native PRIVATE ps2x::iop)
set_target_properties(tmb_iop_native PROPERTIES UNITY_BUILD OFF)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(tmb_iop_native PRIVATE -O2 -g0)
endif()
target_sources(ps2EntryRunner PRIVATE $<TARGET_OBJECTS:tmb_iop_native>)
endif()
# The host OS layer includes <windows.h>, which clashes with raylib names: outside the unity batches and the PCH.
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/tmb_host.cpp" PROPERTIES
SKIP_UNITY_BUILD_INCLUSION ON SKIP_PRECOMPILE_HEADERS ON)
# VU1 microcode compiled ahead of time by ps2_vu_aot (scripts/recomp.sh): an object library both executables
# link, so it compiles once. -O3 unrolls the operand loops over each pair's constexpr decode; debug info is of no
# use for it and triples its build time. Each file takes GCC several GB: at most 4 compile at once.
file(GLOB TMB_VU1_AOT_SOURCES CONFIGURE_DEPENDS "${TMB_GENERATED_DIR}/vu1/*.cpp")
if(TMB_VU1_AOT_SOURCES)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS tmb_vu1_aot=4)
# With it, microcode loops lifted to native code by hand (runtime/vu1, VU1Interpreter::registerLiftedEntry).
file(GLOB TMB_VU1_LIFTED_SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/vu1/*.cpp")
add_library(tmb_vu1_aot OBJECT ${TMB_VU1_AOT_SOURCES} ${TMB_VU1_LIFTED_SOURCES})
target_link_libraries(tmb_vu1_aot PRIVATE ps2_runtime)
set_target_properties(tmb_vu1_aot PROPERTIES UNITY_BUILD OFF JOB_POOL_COMPILE tmb_vu1_aot)
# TMB_VU1_AOT_LINES=ON: line tables only (-g1), so a profile of the replay maps samples to the jit helpers.
option(TMB_VU1_AOT_LINES "Line tables in the compiled VU1 microcode, for profiling" OFF)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
if(TMB_VU1_AOT_LINES)
target_compile_options(tmb_vu1_aot PRIVATE -O3 -g1)
else()
target_compile_options(tmb_vu1_aot PRIVATE -O3 -g0)
endif()
endif()
target_sources(ps2EntryRunner PRIVATE $<TARGET_OBJECTS:tmb_vu1_aot>)
endif()
target_sources(ps2EntryRunner PRIVATE ${TMB_GENERATED_SOURCES} ${TMB_RUNTIME_SOURCES})
target_include_directories(ps2EntryRunner PRIVATE "${TMB_GENERATED_DIR}")
list(LENGTH TMB_GENERATED_SOURCES _tmb_count)
message(STATUS "TMB_Recomp: linking ${_tmb_count} generated source files from ${TMB_GENERATED_DIR}")
# The VU1 replay tool with the compiled microcode linked in: checks it against runs recorded with
# PS2X_VU1_RECORD (build/game/tmb_vu1_replay <trace> [repeat]).
if(TMB_VU1_AOT_SOURCES)
add_executable(tmb_vu1_replay PS2Recomp/ps2xRuntime/tools/ps2_vu1_replay.cpp $<TARGET_OBJECTS:tmb_vu1_aot>)
target_link_libraries(tmb_vu1_replay PRIVATE ps2_runtime)
if(WIN32)
# PS2X_PROFILE=<seconds>: the fork's sampling profiler, to see where the compiled microcode spends its time.
target_sources(tmb_vu1_replay PRIVATE PS2Recomp/ps2xRuntime/src/profiling/sampling_profiler.cpp)
target_link_libraries(tmb_vu1_replay PRIVATE raylib winmm) # raylib first: winmm has a PlaySound too
endif()
endif()
# Profile-guided optimization (GCC) of the runtime, the IOP and the compiled VU1 microcode, the code the frame time
# goes to; the generated game code keeps its flags (it would all rebuild). scripts/pgo.sh: GENERATE, a training run
# into the match, then USE. The profile is specific to this build tree and machine, never committed.
set(TMB_PGO "OFF" CACHE STRING "Profile-guided optimization: OFF, GENERATE or USE (scripts/pgo.sh)")
set_property(CACHE TMB_PGO PROPERTY STRINGS OFF GENERATE USE)
set(TMB_PGO_DIR "${CMAKE_BINARY_DIR}/pgo-profile" CACHE PATH "Where TMB_PGO=GENERATE writes the profile USE reads")
if(NOT TMB_PGO STREQUAL "OFF" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(TMB_PGO STREQUAL "GENERATE")
set(_tmb_pgo_flags "-fprofile-generate=${TMB_PGO_DIR}" -fprofile-update=atomic)
target_link_options(ps2EntryRunner PRIVATE "-fprofile-generate=${TMB_PGO_DIR}")
target_sources(ps2EntryRunner PRIVATE "${CMAKE_SOURCE_DIR}/runtime/pgo/tmb_pgo_train.cpp")
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/pgo/tmb_pgo_train.cpp" PROPERTIES
SKIP_UNITY_BUILD_INCLUSION ON SKIP_PRECOMPILE_HEADERS ON)
else()
set(_tmb_pgo_flags "-fprofile-use=${TMB_PGO_DIR}" -fprofile-partial-training -fprofile-correction -Wno-missing-profile)
endif()
foreach(_tmb_pgo_target ps2_runtime ps2_iop tmb_vu1_aot)
if(TARGET ${_tmb_pgo_target})
target_compile_options(${_tmb_pgo_target} PRIVATE ${_tmb_pgo_flags})
endif()
endforeach()
if(TMB_PGO STREQUAL "GENERATE" AND TARGET tmb_vu1_replay)
target_link_options(tmb_vu1_replay PRIVATE "-fprofile-generate=${TMB_PGO_DIR}")
endif()
message(STATUS "TMB_Recomp: profile-guided optimization ${TMB_PGO} (${TMB_PGO_DIR})")
endif()
# The port is built only on BozoEngine. The pre-migration build remains in the v0.3.2 tag.
include(cmake/bozo.cmake)
+2 -3
View File
@@ -23,9 +23,8 @@ SOFTWARE.
---
This licence covers TMB_Recomp's own files. It does not cover:
- PS2Recomp/ (the runtime and recompiler, a separate project): GPL-3.0, see PS2Recomp/LICENSE.
The game executable a player builds links that runtime, so that build is a GPL-3.0 combined work.
- BozoEngine/ (the recompiler and runtime, a separate MIT project): see BozoEngine/LICENSE.
- Anything from Twisted Metal: Black. No game data, code or art is in this repository or its releases;
players build the port from their own disc.
- Third-party components with their own licences (raylib, Dear ImGui, the Exo 2 font, and the build
- Third-party components with their own licences (SDL3, Dear ImGui, the Exo 2 font, and the build
kit's GCC, binutils, CMake, Ninja, FFmpeg, Python); a release lists them in LICENSES\.
Submodule PS2Recomp deleted from 3eb40ffffd.
+509 -582
View File
File diff suppressed because it is too large. Load diff
+154
View File
@@ -0,0 +1,154 @@
// tmb-check: BozoEngine's call-log checker (bozo-run: BozoEngine's tools/run/README.md) with TMB's overrides running
// natively (BozoEngine's kernel.md section 3b), each call checked against the reference's log:
// tmb-check <log.clg> --pinned --ref <run.ref> [--iso <image>] [--pad-script <file>] [--overrides log] ...
// The ELF defaults to the one this build was generated from.
//
// --window (builds with TMB_WINDOW): the same pinned run, its frames shown in a window as they are made (BozoEngine's
// window, the renderer's present), to capture the pictures of chosen frames (milestone M5's pixel comparison):
// tmb-check <log.clg> ... --window --capture-frames n,n,... [--capture-dir dir] [--width w --height h]
// [--render-scale s] [--aspect a]
// --capture-frames n: the picture once n frames have ended, i.e. the reference record n - 1's frame (frame_<n>.png). The
// run is held at that frame's end until the window has read it back, so the picture is exactly that frame's. The window
// is 640x448 at render scale 1 by default; --aspect is the picture's shape inside it (4:3 by default, letterboxed).
#include "run_main.h"
#if TMB_CHECK_WINDOW
#include "bozo/app/determinism.h"
#include "bozo/app/window.h"
#include <algorithm>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <set>
#include <sstream>
#endif
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#ifndef BOZO_RUN_DEFAULT_ELF
#define BOZO_RUN_DEFAULT_ELF ""
#endif
#if TMB_CHECK_WINDOW
namespace
{
// The run held at a capture frame's end until the window read that frame's picture back.
struct CaptureGate
{
std::mutex mutex;
std::condition_variable wake;
std::set<uint64_t> frames;
uint64_t captured = 0; // the last frame count the window captured at
bool closing = false;
};
CaptureGate &gate()
{
static CaptureGate s_gate;
return s_gate;
}
int runWindowed(const std::vector<char *> &args)
{
bozo::app::WindowOptions window;
window.title = "Twisted Metal: Black (BozoEngine, pinned)";
window.width = 640;
window.height = 448;
window.renderScale = 1.0f;
window.aspect = 4.0f / 3.0f; // the picture's shape, letterboxed in the window (as the fork's window and tmb)
window.panel = false;
window.stats = false;
static std::vector<char *> rest;
for (size_t k = 0; k < args.size(); ++k)
{
const std::string a = args[k];
auto value = [&]() -> std::string { return k + 1 < args.size() ? args[++k] : ""; };
if (a == "--window")
continue;
if (a == "--capture-frames")
{
std::stringstream list(value());
for (std::string item; std::getline(list, item, ',');)
if (!item.empty())
window.captureFrames.push_back(std::stoull(item));
}
else if (a == "--capture-dir")
window.captureDir = value();
else if (a == "--width")
window.width = std::stoi(value());
else if (a == "--height")
window.height = std::stoi(value());
else if (a == "--render-scale")
window.renderScale = std::stof(value());
else if (a == "--aspect")
window.aspect = std::stof(value());
else
rest.push_back(args[k]);
}
gate().frames.insert(window.captureFrames.begin(), window.captureFrames.end());
bozo::run::setFrameHook([](uint64_t framesEnded) {
CaptureGate &g = gate();
std::unique_lock<std::mutex> lock(g.mutex);
if (!g.frames.count(framesEnded))
return;
// Held until the window has shown and read back this frame (30 s at most: a closed window lets it go).
if (!g.wake.wait_for(lock, std::chrono::seconds(30), [&] { return g.closing || g.captured >= framesEnded; }))
std::fprintf(stderr, "tmb-check: no capture of frame %llu within 30 s\n", static_cast<unsigned long long>(framesEnded));
});
window.onCaptured = [](uint64_t frames) {
CaptureGate &g = gate();
{
std::lock_guard<std::mutex> lock(g.mutex);
g.captured = std::max(g.captured, frames);
}
g.wake.notify_all();
};
bozo::app::Game game;
game.run = [] { return bozo::run::main(static_cast<int>(rest.size()), rest.data()); };
game.stop = [] {
CaptureGate &g = gate();
{
std::lock_guard<std::mutex> lock(g.mutex);
g.closing = true;
}
g.wake.notify_all();
};
game.framesEnded = [] { return bozo::det::frame(); };
return bozo::app::runWindow(window, game, nullptr);
}
}
#endif
int main(int argc, char **argv)
{
std::vector<char *> args(argv, argv + argc);
bool hasElf = false, windowed = false;
for (int i = 1; i < argc; ++i)
{
hasElf = hasElf || std::strcmp(argv[i], "--elf") == 0;
windowed = windowed || std::strcmp(argv[i], "--window") == 0;
}
static char elfFlag[] = "--elf";
static std::string elf = BOZO_RUN_DEFAULT_ELF;
if (!hasElf && !elf.empty() && argc >= 2)
{
args.push_back(elfFlag);
args.push_back(elf.data());
}
if (windowed)
{
#if TMB_CHECK_WINDOW
return runWindowed(args);
#else
std::fprintf(stderr, "tmb-check: --window needs a build with TMB_WINDOW\n");
return 2;
#endif
}
return bozo::run::main(static_cast<int>(args.size()), args.data());
}
+232
View File
@@ -0,0 +1,232 @@
// tmb-headless: Twisted Metal: Black on BozoEngine with no window (phase 4, milestone M0). Every library native, the
// disc image read, BozoEngine's own timing (free mode), TMB's overrides native; the native renderer records its frames.
//
// tmb-headless [--frames n] [--elf SCUS_971.01] [--iso image] [--pad-script [n=]file]... [--card-dir dir]
// [--out run.ref] [--report n] [--quiet] [--wav file [--wav-frames a-b]] [--no-sound]
//
// --pad-script n=file: player n's frame-keyed script (1 when omitted; players 2-4 are the multitap's slots, as the
// reference's PS2X_PAD2_SCRIPT..PS2X_PAD4_SCRIPT).
//
// --wav: the sound the mixer made (48 kHz stereo, 16-bit), from game frame a to b (all of it by default); --no-sound:
// the mixer is not brought up at the frames' ends (as before milestone M3).
// Every --report frames (500 by default) and at the end: the frame, the EE clock, the function that waited for the
// frame's end (the game's loop: uiTitle_Main__Fv at the title), the Shell (the menus' object, gp - 0x4148) and the
// overrides that ran.
#include "tmb_host.h"
#include "tmb_port.h"
#include "bozo/app/determinism.h"
#include "bozo/audio/wav.h"
#include "bozo/ee/dispatcher.h"
#include "bozo/host/free_host.h"
#include "tmb_scene.h"
#include "bozo/render/renderer.h"
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <filesystem>
#include <map>
#include <string>
#ifndef BOZO_RUN_DEFAULT_ELF
#define BOZO_RUN_DEFAULT_ELF ""
#endif
int main(int argc, char **argv)
{
bozo::host::FreeOptions opt;
opt.elf = BOZO_RUN_DEFAULT_ELF;
uint64_t report = 500;
std::string wavPath;
uint64_t wavFrom = 0, wavTo = UINT64_MAX;
for (int k = 1; k < argc; ++k)
{
const std::string a = argv[k];
auto value = [&]() -> std::string { return k + 1 < argc ? argv[++k] : ""; };
if (a == "--frames")
opt.frames = static_cast<uint32_t>(std::stoul(value()));
else if (a == "--elf")
opt.elf = value();
else if (a == "--iso")
opt.iso = value();
else if (a == "--pad-script")
{
std::string v = value();
int player = 1;
if (v.size() > 2 && v[1] == '=' && v[0] >= '1' && v[0] <= '4')
{
player = v[0] - '0';
v = v.substr(2);
}
(player == 1 ? opt.padScript : opt.playerScripts[static_cast<size_t>(player - 2)]) = v;
}
else if (a == "--card-dir")
opt.cardDir = value();
else if (a == "--out")
opt.out = value();
else if (a == "--report")
report = std::stoull(value());
else if (a == "--quiet")
opt.quiet = true;
else if (a == "--print")
opt.printGameOutput = true;
else if (a == "--wav")
wavPath = value();
else if (a == "--wav-frames")
{
const std::string range = value();
const size_t dash = range.find('-');
wavFrom = std::stoull(range.substr(0, dash));
if (dash != std::string::npos && dash + 1 < range.size())
wavTo = std::stoull(range.substr(dash + 1));
}
else if (a == "--no-sound")
opt.sound = false;
else
{
std::fprintf(stderr, "usage: tmb-headless [--frames n] [--elf path] [--iso image] [--pad-script [n=]file]... [--card-dir dir] "
"[--out run.ref] [--report n] [--print] [--quiet] [--wav file [--wav-frames a-b]] [--no-sound]\n");
return 2;
}
}
if (opt.elf.empty())
{
std::fprintf(stderr, "tmb-headless: no ELF (--elf)\n");
return 2;
}
tmb::host::setElfDirectory(std::filesystem::path(opt.elf).parent_path().string());
if (opt.iso.empty())
opt.iso = tmb::findDiscImage(std::filesystem::path(opt.elf).parent_path().string(), "SCUS_971.01");
if (opt.iso.empty())
{
std::fprintf(stderr, "tmb-headless: no disc image (--iso, TMB_ISO, or an .iso beside the ELF)\n");
return 2;
}
// Headless: no host clock reaches the game (determinism.h).
bozo::det::setEnabled(true);
const bozo::port::Port *port = bozo::port::port();
bozo::port::Registry registry;
port->install(registry);
const std::vector<uint32_t> missing = bozo::port::undeclared(registry, tmb_external_table, tmb_external_count);
if (!missing.empty())
{
std::fprintf(stderr, "%zu registered overrides are not externals of the generated code (regenerate):", missing.size());
for (uint32_t a : missing)
std::fprintf(stderr, " 0x%x", a);
std::fprintf(stderr, "\n");
return 2;
}
bozo::host::FreeHost host(opt);
bozo::ee::Dispatcher d(host);
tmb::scene::Binding scene(&d.runtime());
d.setFunctions(tmb_function_table, tmb_function_count, tmb_resume_table, tmb_resume_count);
std::string error;
if (!host.setUp(d, tmb_external_table, tmb_external_count, &registry, error))
{
std::fprintf(stderr, "tmb-headless: %s\n", error.c_str());
return 2;
}
std::printf("tmb-headless: %s, %zu overrides, ELF %s, disc %s\n", port->title, registry.functions().size(), opt.elf.c_str(),
opt.iso.c_str());
// What the game is doing at a frame's end.
std::string waiter;
uint32_t shell = 0;
// The shell's screen: gp - 0x3d2c, which uiMain__Fv switches on through its table at 0x4eae90 (case 0, 0x18ee14,
// calls uiTitle_Main__Fv), and the frame it last changed at; -1 outside the shell's loop.
int32_t screen = -1;
uint64_t screenSince = 0;
std::map<int32_t, uint64_t> screens; // frames per screen
const auto t0 = std::chrono::steady_clock::now();
std::map<std::string, uint64_t> waiters; // the frames each loop function ended
auto state = [&](uint64_t frame) {
const double secs = std::chrono::duration<double>(std::chrono::steady_clock::now() - t0).count();
const bozo::render::Renderer &r = bozo::render::Renderer::instance();
const auto published = r.published();
const auto overlay = r.publishedOverlay();
std::printf("frame %llu: EE cycle %llu (%llu vblanks), loop %s, Shell 0x%x, screen %d%s since frame %llu; renderer: 3D "
"%zu batches, 2D %zu batches, movie picture %s; %.1f s\n",
static_cast<unsigned long long>(frame), static_cast<unsigned long long>(d.now()),
static_cast<unsigned long long>(d.kernel().vblankCount()), waiter.c_str(), shell, screen,
screen == 0 ? " (uiTitle_Main__Fv)" : "", static_cast<unsigned long long>(screenSince),
published ? published->batches.size() : 0u, overlay ? overlay->batches.size() : 0u,
r.backdrop() ? "yes" : "no", secs);
std::fflush(stdout);
};
host.onFrame = [&](uint64_t frame, const R5900Context *ctx) {
if (ctx)
{
// The function that called the frame's end (timer1Handler's caller, or sceGsSyncV's): the game's loop.
waiter = host.functionAt(ctx->r[31].uw[0]);
const std::string fn = waiter.substr(0, waiter.find('+'));
++waiters[fn];
const uint32_t gp = ctx->r[28].uw[0];
int32_t now = -1;
if (gp)
{
std::memcpy(&shell, d.runtime().memory.ram() + ((gp - 0x4148u) & 0x1FFFFFCu), 4);
if (fn == "uiMain__Fv")
std::memcpy(&now, d.runtime().memory.ram() + ((gp - 0x3D2Cu) & 0x1FFFFFCu), 4);
}
if (now != screen)
{
screen = now;
screenSince = frame;
}
++screens[now];
}
if (report && (frame + 1) % report == 0 && !opt.quiet)
state(frame + 1);
};
bozo::audio::WavWriter wav;
if (!wavPath.empty())
{
if (!wav.open(wavPath))
{
std::fprintf(stderr, "tmb-headless: cannot write %s\n", wavPath.c_str());
return 2;
}
host.onAudio = [&](uint64_t frame, const int16_t *samples, size_t count) {
if (frame >= wavFrom && frame <= wavTo)
wav.write(samples, count);
};
}
const uint64_t frames = host.run();
if (wav.isOpen())
{
std::printf("wav: %s, %.1f s of sound\n", wavPath.c_str(), wav.frames() / 48000.0);
wav.close();
}
state(frames);
const bozo::host::FreeStats &s = host.stats();
std::printf("end: %s; %llu frames; %llu library calls, %llu kernel calls, %llu override calls, %llu VU0 programs, %llu "
"hardware accesses (%llu to registers the I/O model does not know)\n",
host.endReason().empty() ? "every thread ended" : host.endReason().c_str(), static_cast<unsigned long long>(frames),
static_cast<unsigned long long>(s.libraryCalls), static_cast<unsigned long long>(s.kernelCalls),
static_cast<unsigned long long>(s.overrideCalls), static_cast<unsigned long long>(s.vu0Calls),
static_cast<unsigned long long>(s.ioAccesses), static_cast<unsigned long long>(s.ioUnknown));
std::printf("frame ends by loop function:");
for (const auto &[fn, n] : waiters)
std::printf(" %s %llu;", fn.c_str(), static_cast<unsigned long long>(n));
std::printf("\nframes per shell screen (-1: outside the shell's loop):");
for (const auto &[sc, n] : screens)
std::printf(" %d: %llu;", sc, static_cast<unsigned long long>(n));
std::printf("\noverride calls:");
for (const auto &[a, n] : host.overrideCalls())
std::printf(" 0x%x:%llu", a, static_cast<unsigned long long>(n));
std::printf("\n");
// The pads the game found and read: each socket's reads (port.slot), and whether the multitap was open.
const bozo::libs::PadState &pads = host.libraries().pad;
std::printf("pad reads (port.slot: reads; multitap %s):", pads.multitap ? "open" : "closed");
for (int p = 0; p < 2; ++p)
for (int sl = 0; sl < 4; ++sl)
std::printf(" %d.%d: %llu;", p + 1, sl, static_cast<unsigned long long>(pads.socketReads[p][sl]));
std::printf("\n");
for (const auto &[name, n] : s.unanswered)
std::printf("no native answer: %s (%llu)\n", name.c_str(), static_cast<unsigned long long>(n));
return host.endReason().rfind("FAULT", 0) == 0 ? 1 : 0;
}
+246
View File
@@ -0,0 +1,246 @@
// tmb: Twisted Metal: Black on BozoEngine in a window, in real time (phase 4, milestones M1 and M2). The free host as
// tmb-headless runs it (every library native, the disc image read, TMB's overrides native), with the host's clock: the
// game's frames held to the field rate (TMB's native frame end, bozo::app::FramePacer), each one presented in an SDL3
// window through OpenGL 3.3 (bozo::app::runWindow). The players' pads: the keyboard, mouse and up to four gamepads
// through input.ini's bindings (bozo::app::DevicePad; with the game's multitap, players 2-4 are its slots), or the
// frame-keyed scripts given.
//
// tmb [--iso image] [--elf SCUS_971.01] [--card-dir dir] [--width w --height h] [--fullscreen] [--no-vsync]
// [--render-scale s] [--capture-dir dir] [--capture-frames n,n,...] [--quit-after n] [--pad-script [n=]file]...
// [--no-sound] [--audio-latency ms] [--audio-stats] [--wav file]
//
// The user folder (%APPDATA%\TMB_Recomp, as the fork's TMB; PS2X_USER_DIR overrides it) holds input.ini, the memory
// cards (mc0, mc1; --card-dir overrides) and the logs (logs/TMB_Recomp.log). Without --elf the game data is looked for
// as the fork's TMB did (<exe>/game/SCUS_971.01, then the same in the user folder).
//
// Milestone M4, as the fork's TMB: F2 the settings window (Controls: input.ini; Video: video.ini in the user folder,
// --width / --height / --fullscreen (borderless) / --render-scale over it; Cheats: runtime/tmb_cheats.cpp), F3 the
// frame rate counter (PS2X_SHOW_FPS=1 from the start), F8 a capture sequence (PS2X_CAPTURE_SEQUENCE presents,
// PS2X_CAPTURE_SEQUENCE_AT seconds), F9 a burst of captures, ten a second; --capture-frames saves the game's picture at
// the first present after each of those game frames. The captures go to --capture-dir, else PS2X_CAPTURE_WINDOW_DIR,
// else <user folder>/captures. F11 / Alt+Enter: between the window and the last full-screen mode. --quit-after: close
// after that many frames. PS2X_FRAME_STATS=1: the frames' work times every 2 s (the FramePacer).
//
// Sound (milestone M3): the mixer's samples, made on the EE clock at each frame's end, go to the default playback device
// (bozo::app::AudioDevice: a queue of --audio-latency ms, 32 by default, plus the device's buffer). --audio-stats: the
// queue, latency and underruns every 2 s. --wav (or PS2X_AUDIO_RECORD): what the mixer made, also to a WAV file.
#include "tmb_host.h"
#include "tmb_port.h"
#include "bozo/app/app.h"
#include "bozo/app/audio_device.h"
#include "bozo/app/determinism.h"
#include "bozo/audio/wav.h"
#include "bozo/app/device_pad.h"
#include "bozo/app/input_bindings.h"
#include "bozo/app/video_settings.h"
#include "bozo/app/window.h"
#include "bozo/ee/dispatcher.h"
#include "bozo/host/free_host.h"
#include "tmb_scene.h"
#include <cstdio>
#include <cstdlib>
#include <filesystem>
#include <sstream>
#include <string>
#ifndef BOZO_RUN_DEFAULT_ELF
#define BOZO_RUN_DEFAULT_ELF ""
#endif
int main(int argc, char **argv)
{
// The fork's TMB identity (its PS2X_APP_* CMake values): the same user folder, so the cards and input.ini carry over.
bozo::app::Identity identity;
identity.title = "Twisted Metal: Black";
identity.folder = "TMB_Recomp";
identity.xdgFolder = "tmb_recomp";
identity.bootElf = "SCUS_971.01";
identity.dataFolder = "game";
bozo::app::setIdentity(identity);
bozo::app::startLogging();
bozo::app::installCrashHandler();
bozo::host::FreeOptions opt;
opt.elf = BOZO_RUN_DEFAULT_ELF;
opt.realTime = true;
opt.quiet = true;
bozo::app::WindowOptions window;
window.title = "Twisted Metal: Black (BozoEngine)";
bozo::app::AudioOptions audio;
bool sound = true;
std::string wavPath;
if (const char *record = std::getenv("PS2X_AUDIO_RECORD"); record && *record)
wavPath = record;
// The command line's window options, over video.ini (applied once the user folder is known, below).
int width = 0, height = 0;
bool fullscreen = false;
float renderScale = 0.0f;
for (int k = 1; k < argc; ++k)
{
const std::string a = argv[k];
auto value = [&]() -> std::string { return k + 1 < argc ? argv[++k] : ""; };
if (a == "--elf")
opt.elf = value();
else if (a == "--iso")
opt.iso = value();
else if (a == "--card-dir")
opt.cardDir = value();
else if (a == "--pad-script")
{
// [n=]file: player n's script (1 when omitted; players 2-4: the multitap's slots)
std::string v = value();
int player = 1;
if (v.size() > 2 && v[1] == '=' && v[0] >= '1' && v[0] <= '4')
{
player = v[0] - '0';
v = v.substr(2);
}
(player == 1 ? opt.padScript : opt.playerScripts[static_cast<size_t>(player - 2)]) = v;
}
else if (a == "--width")
width = std::stoi(value());
else if (a == "--height")
height = std::stoi(value());
else if (a == "--fullscreen")
fullscreen = true;
else if (a == "--no-vsync")
window.vsync = false;
else if (a == "--render-scale")
renderScale = std::stof(value());
else if (a == "--capture-dir")
window.captureDir = value();
else if (a == "--capture-frames")
{
std::stringstream list(value());
for (std::string item; std::getline(list, item, ',');)
if (!item.empty())
window.captureFrames.push_back(std::stoull(item));
}
else if (a == "--quit-after")
window.quitAfterFrames = std::stoull(value());
else if (a == "--print")
opt.printGameOutput = true;
else if (a == "--no-sound")
sound = false;
else if (a == "--audio-latency")
audio.latencyMs = std::stod(value());
else if (a == "--audio-stats")
audio.stats = true;
else if (a == "--wav")
wavPath = value();
else
{
std::fprintf(stderr, "usage: tmb [--iso image] [--elf path] [--card-dir dir] [--width w] [--height h] [--fullscreen] "
"[--no-vsync] [--render-scale s] [--capture-dir dir] [--capture-frames n,n,...] [--quit-after n] "
"[--pad-script [n=]file]... [--print] [--no-sound] [--audio-latency ms] [--audio-stats] [--wav file]\n");
return 2;
}
}
// The window as the player set it (video.ini in the user folder, the fork's file; PS2X_WINDOW_SIZE / _MODE,
// PS2X_RENDER_SCALE over it), then the command line over both.
bozo::app::video::loadAtStartup(window.width, window.height);
{
bozo::app::video::Settings &v = bozo::app::video::edited();
if (width > 0 && height > 0)
v.width = width, v.height = height;
if (fullscreen)
v.mode = bozo::app::video::WindowMode::Borderless;
if (renderScale > 0.0f)
v.renderScale = renderScale;
}
window.videoSettings = true;
std::error_code ec;
if (opt.elf.empty() || !std::filesystem::is_regular_file(opt.elf, ec))
{
std::string searched;
const std::filesystem::path found = bozo::app::findGameData(&searched);
if (found.empty())
{
std::fprintf(stderr, "tmb: no ELF (--elf); looked for the game data at\n%s", searched.c_str());
return 2;
}
opt.elf = found.string();
}
// The memory cards in the user folder (<user>/mc0, mc1: the fork's layout, its saves read as they are).
if (opt.cardDir.empty() && !bozo::app::userDirectory().empty())
opt.cardDir = bozo::app::userDirectory().string();
tmb::host::setElfDirectory(std::filesystem::path(opt.elf).parent_path().string());
if (opt.iso.empty())
opt.iso = tmb::findDiscImage(std::filesystem::path(opt.elf).parent_path().string(), "SCUS_971.01");
if (opt.iso.empty())
{
std::fprintf(stderr, "tmb: no disc image (--iso, TMB_ISO, or an .iso beside the ELF)\n");
return 2;
}
// Real time: the host's clock reaches the game (frame steps, the EE charged the real time a frame took).
bozo::det::setEnabled(false);
const bozo::port::Port *port = bozo::port::port();
bozo::port::Registry registry;
port->install(registry);
const std::vector<uint32_t> missing = bozo::port::undeclared(registry, tmb_external_table, tmb_external_count);
if (!missing.empty())
{
std::fprintf(stderr, "%zu registered overrides are not externals of the generated code (regenerate)\n", missing.size());
return 2;
}
bozo::host::FreeHost host(opt);
bozo::ee::Dispatcher d(host);
d.setFunctions(tmb_function_table, tmb_function_count, tmb_resume_table, tmb_resume_count);
std::string error;
if (!host.setUp(d, tmb_external_table, tmb_external_count, &registry, error))
{
std::fprintf(stderr, "tmb: %s\n", error.c_str());
return 2;
}
bozo::app::DevicePad pad;
bool scripted = !opt.padScript.empty();
for (const std::string &script : opt.playerScripts)
scripted = scripted || !script.empty();
if (!scripted)
host.libraries().pad.input = &pad;
const std::string pads = scripted ? std::string("the scripts") : "the PC's devices (" + bozo::app::input::configPath() + ")";
std::fprintf(stderr, "tmb: user folder %s, memory cards in %s, pads from %s\n", bozo::app::userDirectory().string().c_str(),
opt.cardDir.empty() ? "memory" : opt.cardDir.c_str(), pads.c_str());
std::fprintf(stderr, "tmb: %s, %zu overrides, ELF %s, disc %s\n", port->title, registry.functions().size(), opt.elf.c_str(),
opt.iso.c_str());
// The sound: what the mixer makes at each frame's end, to the device (and the WAV file).
bozo::app::AudioDevice device(audio);
bozo::audio::WavWriter wav;
if (!wavPath.empty() && !wav.open(wavPath))
std::fprintf(stderr, "tmb: cannot write %s\n", wavPath.c_str());
if (sound)
device.open();
if (device.isOpen() || wav.isOpen())
host.onAudio = [&](uint64_t, const int16_t *samples, size_t count) {
device.push(samples, count);
wav.write(samples, count);
};
bozo::app::Game game;
game.run = [&]
{
tmb::scene::Binding scene(&d.runtime());
const uint64_t frames = host.run();
if (device.isOpen())
{
const bozo::app::AudioDevice::Stats a = device.stats();
std::fprintf(stderr, "tmb: sound: %.1f s pushed, %llu frames dropped, %llu underruns (%.1f ms of silence); queue %.1f ms "
"(%.1f-%.1f) + device %.1f ms; ratio %.4f\n",
a.pushed / 48000.0, static_cast<unsigned long long>(a.dropped), static_cast<unsigned long long>(a.underruns),
a.missing / 48.0, a.queueMs, a.minQueueMs, a.maxQueueMs, a.deviceMs, a.ratio);
device.close();
}
wav.close();
std::fprintf(stderr, "tmb: the game ended after %llu frames: %s\n", static_cast<unsigned long long>(frames),
host.endReason().empty() ? "every thread ended" : host.endReason().c_str());
return host.endReason().rfind("FAULT", 0) == 0 ? 1 : 0;
};
game.stop = [&] { host.requestStop(); };
game.framesEnded = [&] { return host.framesEnded(); };
return bozo::app::runWindow(window, game, &pad);
}
+305
View File
@@ -0,0 +1,305 @@
# TMB on BozoEngine (phase 4, BozoEngine's docs/phase4-inventory.md): TMB's runtime/ built against BozoEngine instead
# of the PS2Recomp fork. Milestone M0: headless; M1: the window (tmb), the packs built from the disc.
#
# cmake -S . -B build/bozo -G Ninja -DBOZO_ENGINE_DIR=<BozoEngine> -DTMB_ELF=<SCUS_971.01>
# -DTMB_ISO=<the disc image> [-DBOZO_FFMPEG_ROOT=<kit>/ffmpeg] [-DTMB_WINDOW=OFF]
#
# Targets:
# - tmb: the game in a window, in real time (SDL3, OpenGL 3.3: BozoEngine's bozo_app; TMB_WINDOW, on by default).
# - tmb_packs: the texture and mesh packs (tools/tmb_texture_pack.py, tools/tmb_mesh_pack.py on BozoEngine's
# tools/native_pack) from the disc image's files, into <build>/packs; the runtime's built-in pack paths point there.
# - tmb-headless: the game on BozoEngine with no window (the free host: every library native, the disc image read,
# BozoEngine's own timing); it reports the frames and the game's state.
# - tmb-check: BozoEngine's call-log checker (bozo-run, tools/run/README.md) with TMB's overrides running natively:
# tmb-check <log.clg> --pinned --ref <run.ref> ...
#
# The generated code: bozo-recomp with the externals bozo-externals writes from the ELF (the stubs BozoEngine answers),
# recomp/tmb_stubs.txt and TMB's override list (tools/tmb_overrides_list.py, from runtime/*.cpp).
# BozoEngine: the submodule (BozoEngine/, at the commit TMB pins) unless BOZO_ENGINE_DIR names another tree (development).
set(BOZO_ENGINE_DIR "" CACHE PATH "BozoEngine's source tree (default: the BozoEngine submodule)")
if(NOT BOZO_ENGINE_DIR AND EXISTS "${CMAKE_SOURCE_DIR}/BozoEngine/CMakeLists.txt")
set(BOZO_ENGINE_DIR "${CMAKE_SOURCE_DIR}/BozoEngine" CACHE PATH "BozoEngine's source tree (default: the BozoEngine submodule)" FORCE)
endif()
set(TMB_ELF "" CACHE FILEPATH "TMB's executable (SCUS_971.01), extracted from the disc")
set(TMB_GEN_FILES 32 CACHE STRING "How many .cpp files the generated code is split into")
set(TMB_GEN_OPT "-O1" CACHE STRING "Optimisation of the generated code")
if(WIN32)
enable_language(RC)
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/app/utf8.rc" PROPERTIES
OBJECT_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/app/tmb.manifest")
endif()
function(tmb_native_manifest target)
if(WIN32)
target_sources(${target} PRIVATE "${CMAKE_SOURCE_DIR}/runtime/app/utf8.rc")
endif()
endfunction()
set(TMB_ISO "" CACHE FILEPATH "TMB's disc image (the packs are built from its files)")
set(TMB_DISC_DIR "" CACHE PATH "The packs' files already extracted from the disc (tools/tmb_build.py: <dir>/.extracted marks them done); else read from TMB_ISO here")
option(TMB_WINDOW "Build tmb, the game in a window (BozoEngine's bozo_app: SDL3, OpenGL 3.3)" ON)
if(NOT BOZO_ENGINE_DIR OR NOT EXISTS "${BOZO_ENGINE_DIR}/CMakeLists.txt")
message(FATAL_ERROR "TMB: set BOZO_ENGINE_DIR to BozoEngine's source tree")
endif()
if(NOT TMB_ELF OR NOT EXISTS "${TMB_ELF}")
message(FATAL_ERROR "TMB: set TMB_ELF to the game's executable (SCUS_971.01)")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# BozoEngine's own TMB generation (its call-log checks) is not wanted here: TMB generates its own.
set(BOZO_TMB_ELF "" CACHE FILEPATH "" FORCE)
set(BOZO_APP ${TMB_WINDOW} CACHE BOOL "" FORCE)
add_subdirectory("${BOZO_ENGINE_DIR}" bozo)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(gen_dir "${CMAKE_BINARY_DIR}/tmb_gen")
set(native_original_dir "${CMAKE_BINARY_DIR}/native_original")
set(overrides_list "${gen_dir}/tmb_overrides.txt")
set(externals "${gen_dir}/tmb_externals.txt")
file(GLOB TMB_RUNTIME_SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/*.cpp")
add_custom_command(
OUTPUT ${overrides_list}
COMMAND ${CMAKE_COMMAND} -E make_directory ${gen_dir}
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_overrides_list.py" "${CMAKE_SOURCE_DIR}/runtime" ${overrides_list}
DEPENDS "${CMAKE_SOURCE_DIR}/tools/tmb_overrides_list.py" ${TMB_RUNTIME_SOURCES}
COMMENT "Listing TMB's overrides")
add_custom_command(
OUTPUT ${externals}
COMMAND bozo-externals ${TMB_ELF} ${externals} --overrides ${overrides_list} --stubs "${CMAKE_SOURCE_DIR}/recomp/tmb_stubs.txt"
DEPENDS bozo-externals ${overrides_list} "${CMAKE_SOURCE_DIR}/recomp/tmb_stubs.txt" ${TMB_ELF}
COMMENT "Writing the externals list")
set(gen_files ${gen_dir}/tmb_functions.h ${gen_dir}/tmb_table.cpp)
math(EXPR last "${TMB_GEN_FILES} - 1")
foreach(i RANGE ${last})
string(LENGTH "${i}" len)
if(len EQUAL 1)
set(n "00${i}")
elseif(len EQUAL 2)
set(n "0${i}")
else()
set(n "${i}")
endif()
list(APPEND gen_files ${gen_dir}/tmb_${n}.cpp)
endforeach()
add_custom_command(
OUTPUT ${gen_files}
COMMAND bozo-recomp ${TMB_ELF} ${gen_dir} --prefix tmb --files ${TMB_GEN_FILES} --no-comments --externals ${externals}
DEPENDS bozo-recomp ${externals} ${TMB_ELF}
COMMENT "Recompiling TMB")
# The generated code alone (tools/tmb_build.py's recompile step, before the compile).
add_custom_target(tmb_recompile DEPENDS ${gen_files})
add_library(tmb_generated OBJECT ${gen_files})
add_custom_command(
OUTPUT ${native_original_dir}/tmb_hud_original.cpp ${native_original_dir}/tmb_hud_original.h
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py" ${gen_dir} hud ${native_original_dir}
DEPENDS ${gen_files} "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py"
COMMENT "Extracting original HUD blocks for optional comparisons")
target_sources(tmb_generated PRIVATE ${native_original_dir}/tmb_hud_original.cpp ${native_original_dir}/tmb_hud_original.h)
add_custom_command(
OUTPUT ${native_original_dir}/tmb_vehicle_original.cpp ${native_original_dir}/tmb_vehicle_original.h
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py" ${gen_dir} vehicle ${native_original_dir}
DEPENDS ${gen_files} "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py"
COMMENT "Extracting original vehicle blocks for optional comparisons")
target_sources(tmb_generated PRIVATE ${native_original_dir}/tmb_vehicle_original.cpp ${native_original_dir}/tmb_vehicle_original.h)
add_custom_command(
OUTPUT ${native_original_dir}/tmb_contact_original.cpp ${native_original_dir}/tmb_contact_original.h
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py" ${gen_dir} contact ${native_original_dir}
DEPENDS ${gen_files} "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py"
COMMENT "Extracting original terrain/contact blocks for optional comparisons")
target_sources(tmb_generated PRIVATE ${native_original_dir}/tmb_contact_original.cpp ${native_original_dir}/tmb_contact_original.h)
target_link_libraries(tmb_generated PUBLIC bozo_runtime_headers)
target_include_directories(tmb_generated PUBLIC ${gen_dir} ${native_original_dir})
target_compile_options(tmb_generated PRIVATE ${TMB_GEN_OPT} -w)
# TMB's runtime: an object library (its port registration, BOZO_PORT, must be linked whatever references it).
add_library(tmb_runtime OBJECT ${TMB_RUNTIME_SOURCES})
target_include_directories(tmb_runtime PUBLIC "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir} ${native_original_dir})
target_link_libraries(tmb_runtime PUBLIC bozo_port bozo_render bozo_libs bozo_runtime_core)
# The Cheats tab of the settings window (F2): ImGui's core and the tab list (bozo_ui, no SDL3; BOZO_SETTINGS_UI), with
# the window. The headless programs link it too and never draw it.
if(TMB_WINDOW)
target_link_libraries(tmb_runtime PUBLIC bozo_ui)
endif()
add_dependencies(tmb_runtime tmb_generated)
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/tmb_native_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_projection_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_hud_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_vehicle_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_hierarchy_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_scene.cpp" PROPERTIES
COMPILE_OPTIONS "-ffp-contract=off;-frounding-math")
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/tmb_contact_math.cpp" PROPERTIES
COMPILE_OPTIONS "-ffp-contract=off;-frounding-math")
target_compile_options(tmb_runtime PRIVATE -Wall -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable)
# The draw lists as the reference build (the fork) computed them (the PS2XREF1 `draws` field): it compiled TMB's runtime
# at -O2 (its RelWithDebInfo flags) and its native renderer library at -O3 (Release), both for AVX2 with FMA, and GCC
# fuses a * b + c there (-ffp-contract=fast, its default outside ISO mode) where its inlining lets it. The matrices and
# vertices TMB and the mesh submitter (BozoEngine's render/mesh_draw.cpp, moved from the fork) compute for the draws are
# those fused results, so the same flags here give the same draws (match1p: every frame; -O3 for the runtime or no FMA:
# the first difference within ten frames of the match's start). Nothing the game computes depends on them (the
# generated code and BozoEngine's libraries keep their own flags). A CPU without FMA (before 2013's Haswell, 2011's
# Bulldozer) cannot run it, as it could not run the fork's.
set(TMB_RUNTIME_ARCH "-mavx2;-mfma" CACHE STRING "Instruction set flags of TMB's runtime and the renderer (the reference build's)")
set(TMB_RUNTIME_OPT "-O2" CACHE STRING "Optimisation of TMB's runtime (the reference build's)")
target_compile_options(tmb_runtime PRIVATE ${TMB_RUNTIME_ARCH} ${TMB_RUNTIME_OPT})
target_compile_options(bozo_render PRIVATE ${TMB_RUNTIME_ARCH})
# The packs: from the disc image's files (only those they read: .TEX, .RTX, .NGP, .PTR), into the build folder; with
# TMB_DISC_DIR, from files already extracted there (tools/tmb_build.py). Both paths build the packs locally.
if(TMB_ISO OR TMB_DISC_DIR)
set(pack_dir "${CMAKE_BINARY_DIR}/packs")
set(disc_dir "${CMAKE_BINARY_DIR}/disc")
set(native_pack "${BOZO_ENGINE_DIR}/tools/native_pack")
file(GLOB native_pack_sources CONFIGURE_DEPENDS "${native_pack}/*.py")
if(TMB_DISC_DIR)
set(disc_dir "${TMB_DISC_DIR}")
else()
add_custom_command(
OUTPUT "${disc_dir}/.extracted"
COMMAND Python3::Interpreter "${native_pack}/ps2_disc.py" extract "${TMB_ISO}" "${disc_dir}" --ext .TEX,.RTX,.NGP,.PTR
COMMAND ${CMAKE_COMMAND} -E touch "${disc_dir}/.extracted"
DEPENDS "${TMB_ISO}" "${native_pack}/ps2_disc.py"
COMMENT "Reading the packs' files from the disc image")
endif()
add_custom_command(
OUTPUT "${pack_dir}/tmb_textures.pack"
COMMAND ${CMAKE_COMMAND} -E make_directory "${pack_dir}"
COMMAND ${CMAKE_COMMAND} -E env "BOZO_ENGINE_TOOLS=${BOZO_ENGINE_DIR}/tools"
"${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tools/tmb_texture_pack.py" "${disc_dir}" "${TMB_ELF}" "${pack_dir}/tmb_textures.pack"
DEPENDS "${disc_dir}/.extracted" "${CMAKE_SOURCE_DIR}/tools/tmb_texture_pack.py" ${native_pack_sources} "${TMB_ELF}"
COMMENT "Building the texture pack")
add_custom_command(
OUTPUT "${pack_dir}/tmb_meshes.pack"
COMMAND ${CMAKE_COMMAND} -E make_directory "${pack_dir}"
COMMAND ${CMAKE_COMMAND} -E env "BOZO_ENGINE_TOOLS=${BOZO_ENGINE_DIR}/tools"
"${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tools/tmb_mesh_pack.py" "${disc_dir}" "${pack_dir}/tmb_meshes.pack"
DEPENDS "${disc_dir}/.extracted" "${CMAKE_SOURCE_DIR}/tools/tmb_mesh_pack.py" ${native_pack_sources}
COMMENT "Building the mesh pack")
add_custom_target(tmb_packs ALL DEPENDS "${pack_dir}/tmb_textures.pack" "${pack_dir}/tmb_meshes.pack")
add_dependencies(tmb_runtime tmb_packs)
else()
message(FATAL_ERROR "Set TMB_ISO or TMB_DISC_DIR to build the native texture and mesh packs")
endif()
target_compile_definitions(tmb_runtime PRIVATE TMB_TEXTURE_PACK="${pack_dir}/tmb_textures.pack"
TMB_MESH_PACK="${pack_dir}/tmb_meshes.pack")
if(TARGET bozo_run)
add_executable(tmb-check bozo/tmb_check.cpp)
tmb_native_manifest(tmb-check)
target_link_libraries(tmb-check PRIVATE tmb_runtime tmb_generated bozo_run)
target_compile_definitions(tmb-check PRIVATE BOZO_RUN_DEFAULT_ELF="${TMB_ELF}")
# --window: the pinned run shown in BozoEngine's window, its chosen frames captured (milestone M5's pictures).
if(TMB_WINDOW)
target_link_libraries(tmb-check PRIVATE bozo_app)
target_compile_definitions(tmb-check PRIVATE TMB_CHECK_WINDOW=1)
endif()
if(MINGW)
target_link_options(tmb-check PRIVATE -static -Wl,--stack,268435456)
endif()
endif()
add_executable(tmb-headless bozo/tmb_headless.cpp)
tmb_native_manifest(tmb-headless)
target_link_libraries(tmb-headless PRIVATE tmb_runtime tmb_generated bozo_host)
target_compile_definitions(tmb-headless PRIVATE BOZO_RUN_DEFAULT_ELF="${TMB_ELF}")
# Explicit target: exact native matrix/ABI checks against the owner's generated leaf functions. No disc or game run.
add_executable(tmb-native-math-tests EXCLUDE_FROM_ALL tests/native_math_tests.cpp tests/native_direction_callers.cpp)
target_include_directories(tmb-native-math-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-math-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-math-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-math-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-hud-tests EXCLUDE_FROM_ALL tests/native_hud_tests.cpp)
target_include_directories(tmb-native-hud-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-hud-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-hud-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-hud-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-particle-tests EXCLUDE_FROM_ALL tests/native_particle_tests.cpp)
target_include_directories(tmb-native-particle-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_link_libraries(tmb-native-particle-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-particle-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-vehicle-tests EXCLUDE_FROM_ALL tests/native_vehicle_tests.cpp)
target_include_directories(tmb-native-vehicle-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-vehicle-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-vehicle-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-vehicle-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-hierarchy-tests EXCLUDE_FROM_ALL tests/native_hierarchy_tests.cpp tests/native_hierarchy_callers.cpp)
target_include_directories(tmb-native-hierarchy-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-hierarchy-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-hierarchy-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-hierarchy-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-contact-tests EXCLUDE_FROM_ALL tests/native_contact_tests.cpp tests/native_sphere_lod_callers.cpp)
target_include_directories(tmb-native-contact-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-contact-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-contact-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-contact-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-scene-tests EXCLUDE_FROM_ALL tests/native_scene_tests.cpp)
target_include_directories(tmb-native-scene-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-scene-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-scene-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-scene-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-projection-tests EXCLUDE_FROM_ALL tests/native_projection_tests.cpp)
target_include_directories(tmb-native-projection-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-projection-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-projection-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-projection-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-object-packet-tests EXCLUDE_FROM_ALL tests/native_object_packet_tests.cpp)
target_include_directories(tmb-native-object-packet-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-object-packet-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-object-packet-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-object-packet-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-texture-input-tests EXCLUDE_FROM_ALL tests/native_texture_input_tests.cpp)
target_include_directories(tmb-native-texture-input-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
target_compile_options(tmb-native-texture-input-tests PRIVATE -ffp-contract=off -frounding-math)
target_link_libraries(tmb-native-texture-input-tests PRIVATE tmb_runtime tmb_generated bozo_host)
if(MINGW)
target_link_options(tmb-native-texture-input-tests PRIVATE -static -Wl,--stack,268435456)
endif()
add_executable(tmb-native-shader-tests EXCLUDE_FROM_ALL tests/native_shader_tests.cpp)
target_include_directories(tmb-native-shader-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime")
target_compile_options(tmb-native-shader-tests PRIVATE ${TMB_RUNTIME_ARCH} ${TMB_RUNTIME_OPT})
if(MINGW)
target_link_options(tmb-native-shader-tests PRIVATE -static)
endif()
if(MINGW)
target_link_options(tmb-headless PRIVATE -static -Wl,--stack,268435456)
endif()
if(TMB_WINDOW)
add_executable(tmb bozo/tmb_window.cpp)
tmb_native_manifest(tmb)
target_link_libraries(tmb PRIVATE tmb_runtime tmb_generated bozo_host bozo_app)
target_compile_definitions(tmb PRIVATE BOZO_RUN_DEFAULT_ELF="${TMB_ELF}")
if(WIN32)
enable_language(RC)
target_sources(tmb PRIVATE "${CMAKE_SOURCE_DIR}/runtime/app/tmb.rc")
# A player's build (tools/tmb_build.py): a GUI-subsystem exe, no console window; started from a terminal it
# still prints there (bozo::app attaches to the parent's console).
option(TMB_GUI_SUBSYSTEM "tmb.exe without a console window (the players' build)" OFF)
if(TMB_GUI_SUBSYSTEM)
set_target_properties(tmb PROPERTIES WIN32_EXECUTABLE ON)
endif()
endif()
if(MINGW)
target_link_options(tmb PRIVATE -static -Wl,--stack,268435456)
endif()
endif()
+362 -71
View File
@@ -1,86 +1,377 @@
# Handoff (2026-11-01)
# TMB on BozoEngine — 2026-11-05
Where the work stands and how to pick it up on another machine. Details and history are in `RECOMP_NOTES.md`.
**Release update, 2026-11-06:** [v0.4.0 is published](https://github.com/TheBozos/TMB_Recomp/releases/tag/v0.4.0),
tagged at `eea175219b1e46a9c1699f640744279650c65a14`, with BozoEngine `9361960`.
The [tagged release workflow](https://github.com/TheBozos/TMB_Recomp/actions/runs/42133821321) passed and produced
both player ZIPs, their SHA-256 files, and the corresponding-source ZIP/hash. The publication notification workflow passed too.
Both downloaded player ZIPs pass the local audit/hash checks and contain the same 7,750 files; all three ZIP hashes
also match GitHub's asset digests. The published package updated the isolated accented-path portable installation,
preserved its player-data marker, reported launcher version 0.4.0 and rebuilt/played successfully.
Final release timing: EE/PC **1.0000**, **575,965 ticks/s**, **59.95 fields/s**, movies **30.00 pictures/s**.
The approved shared README format is restored. Campaign/hardware/reference-test limits below remain open.
## Goal
The goal is to remove the PS2Recomp fork from the project. This source tree now builds **only on BozoEngine**.
The earlier v0.3.2 release remains in Git history and on GitHub for comparison; it is not a runtime dependency.
The game smooth (its own 60 fps, the USA release only: the European one is dropped) and fully playable as a true PC
program: no PS2 hardware simulated where the PC can do the job itself. Locked runs on 2026-11-01: a 1P match
57.7-60.4 fps, 4P split screen 55.8-60.4. Earlier:
## Architecture and build
| Release | Path | fps mean | slowest tenth |
|---|---|---|---|
| USA (`SCUS-97101`, NTSC) | native (`scripts/run_native.sh`, 2x resolution) | 58.9 | 58.5 |
[`NATIVE_PERSISTENT_FORWARD.md`](NATIVE_PERSISTENT_FORWARD.md) adds the last three forwards: 269/269 forward returns are native.
[`NATIVE_BLOW_DEBRIS_FORWARD.md`](NATIVE_BLOW_DEBRIS_FORWARD.md) adds the BlowDebris forwards (one dead-W-slot RAM hash difference, proven).
[`NATIVE_HUD_LASER_FORWARD.md`](NATIVE_HUD_LASER_FORWARD.md) adds the HUD laser forwards.
[`NATIVE_UPDATE_LAUNCHER_FORWARD.md`](NATIVE_UPDATE_LAUNCHER_FORWARD.md) adds the UpdateLauncher forwards.
[`NATIVE_FIRE_TORCH_FORWARD.md`](NATIVE_FIRE_TORCH_FORWARD.md) adds the FireSpecial types c0/1e0/220 forwards.
[`NATIVE_FIRE_LOCKON_FORWARD.md`](NATIVE_FIRE_LOCKON_FORWARD.md) adds the FireSpecial type a0 lock-on forwards.
[`NATIVE_FIRE_SPECIAL_FORWARD.md`](NATIVE_FIRE_SPECIAL_FORWARD.md) adds the first FireSpecial forwards (types 20, 40, 60).
[`NATIVE_LOOPTANK_FORWARD.md`](NATIVE_LOOPTANK_FORWARD.md) adds the LoopTank segment forwards.
[`NATIVE_SPECIAL_TORCH_FORWARD.md`](NATIVE_SPECIAL_TORCH_FORWARD.md) adds the special-weapon torch forwards (UpdateSpecial complete).
[`NATIVE_FERRIS_BOSS_FORWARD.md`](NATIVE_FERRIS_BOSS_FORWARD.md) adds the Ferris wheel and final boss hit-test forwards.
[`NATIVE_WEAPON_HIT_FORWARD.md`](NATIVE_WEAPON_HIT_FORWARD.md) adds the RockHD/RicoHD hit-test forwards and the hd/DispatchHit W audit.
[`NATIVE_SPECIAL_ARCS_FORWARD.md`](NATIVE_SPECIAL_ARCS_FORWARD.md) adds the held-aim and lock-on arc special-weapon forwards.
[`NATIVE_SPECIAL_SWEEP_FORWARD.md`](NATIVE_SPECIAL_SWEEP_FORWARD.md) adds the three type-100 special-weapon forwards.
[`NATIVE_SPECIAL_VOLLEY_FORWARD.md`](NATIVE_SPECIAL_VOLLEY_FORWARD.md) adds the second batch of launcher special-weapon forwards.
[`NATIVE_SPECIAL_GUNS_FORWARD.md`](NATIVE_SPECIAL_GUNS_FORWARD.md) adds the first five launcher special-weapon forwards.
[`NATIVE_BOSS_MOVE_FORWARD.md`](NATIVE_BOSS_MOVE_FORWARD.md) adds the two FinalBoss movement forwards.
[`NATIVE_BOSS_SHOTS_FORWARD.md`](NATIVE_BOSS_SHOTS_FORWARD.md) adds the twelve FinalBoss gun-shot forwards.
[`NATIVE_PARTICLE_ARCS_FORWARD.md`](NATIVE_PARTICLE_ARCS_FORWARD.md) adds the two particle arc forwards.
[`NATIVE_AI_BEAD_FORWARD.md`](NATIVE_AI_BEAD_FORWARD.md) adds the AI hunt and bait forwards.
[`NATIVE_ZOOMIES_HAL_FORWARD.md`](NATIVE_ZOOMIES_HAL_FORWARD.md) adds the Zoomies and HalTrans weapon forwards.
[`NATIVE_COMBO_FORWARD.md`](NATIVE_COMBO_FORWARD.md) adds the five combo-launch forwards.
[`NATIVE_TIRE_ROTATION_FORWARD.md`](NATIVE_TIRE_ROTATION_FORWARD.md) adds the two tire-pair correction forwards.
[`NATIVE_MACHINE_GUN_FORWARD.md`](NATIVE_MACHINE_GUN_FORWARD.md) adds the two machine-gun muzzle forwards.
[`NATIVE_ENVHELI_PED_FORWARD.md`](NATIVE_ENVHELI_PED_FORWARD.md) adds the helicopter gun and walking pedestrian forwards.
[`NATIVE_JET_DEATH_FORWARD.md`](NATIVE_JET_DEATH_FORWARD.md) adds the six falling junk jet forwards.
[`NATIVE_BLIMP_DEATH_FORWARD.md`](NATIVE_BLIMP_DEATH_FORWARD.md) adds the sinking blimp drift and explosion forwards.
[`NATIVE_GASTANK_FORWARD.md`](NATIVE_GASTANK_FORWARD.md) adds the rolling and falling gas tank forwards.
[`NATIVE_FLYER_FORWARD.md`](NATIVE_FLYER_FORWARD.md) adds the junk jet and blimp flight forwards.
Coverage is 209/269 known forward returns (60 remain), with 134/134 known inverse returns native.
Windows, Ryzen 7 7800X3D, RTX 5070 Ti; scripted play through the menus into the first arena (`tools/play_script.py`).
[`NATIVE_HELI_DEATH_FORWARD.md`](NATIVE_HELI_DEATH_FORWARD.md) adds the two falling-helicopter forwards.
Coverage is 150/269 known forward returns (119 remain), with 134/134 known inverse returns native.
## Setting up a new machine
[`NATIVE_FERRIS_SMASHER_FORWARD.md`](NATIVE_FERRIS_SMASHER_FORWARD.md) adds the falling Ferris wheel car and
smasher hit-camera forwards. Coverage is 148/269 known forward returns (121 remain), with 134/134
known inverse returns native.
1. Install the requirements in the README (CMake, Ninja, GCC 13+, FFmpeg dev libs, X11/Wayland + OpenGL headers,
bsdtar, an AVX2 CPU). The native port draws with OpenGL 3.3. A Vulkan driver is only needed for the PS2 path's
paraLLEl-GS (`scripts/run.sh`), fetched by CMake with its shaders precompiled.
2. `git clone --recurse-submodules https://github.com/TheBozos/TMB_Recomp.git`. `PS2Recomp` is the fork
`TheBozos/PS2Recomp`; TMB pins a commit of its `native/renderer` branch (the native work, merged into `main` as it
settles).
3. The game data is not in the repository (never commit it). Put your own ISO at the repo root, then follow "Build and
run" in the README: `extract_iso.sh`, `build_tools.sh`, `recomp.sh`, `build_runtime.sh`, optionally
`iop_recomp.sh` (`game_us/`, `generated_us/`, `build/game_us`).
4. On Windows: MSYS2 UCRT64 with its GCC, as in the README's Windows section; `scripts/stage_dlls.sh` after a build
to start the runner outside the MSYS2 shell. No `perf`: use the fork's sampling profiler (`PS2X_PROFILE=<s>`).
5. The first build compiles about 3500 generated files. A change to `ps2_runtime.h`, `ps2_memory.h` or
`gs_frontend.h` rebuilds all of them.
[`NATIVE_ENVWEAPON_FORWARD.md`](NATIVE_ENVWEAPON_FORWARD.md) adds the two environment gun fire-point
forwards. Coverage is 146/269 known forward returns (123 remain), with 134/134 known inverse
returns native.
## Current state
[`NATIVE_COPSUV_AIM_FORWARD.md`](NATIVE_COPSUV_AIM_FORWARD.md) adds the two Cop SUV laser-aim
forwards. Coverage is 144/269 known forward returns (125 remain), with 134/134 known inverse
returns native.
- **Playable.** Boot, movies (the USA release's story cinematics too), menus, loading, matches (driving, weapons, AI,
sound, HUD, split screen), deaths, respawns, game over, saving and loading. Story mode: level 1 of 8 checked.
- **The native path** (`TMB_NATIVE=1`, `scripts/run_native.sh`):
- frames on the PC's clock (`timer1HandlerNative`, the fork's `FramePacer`; `TMB_NATIVE_FRAMES=0` for the vblanks);
- 3D from an offline mesh pack at the game's per-object hook, in the game's order, clipped to its own clip volume
(`runtime/tmb_meshes.cpp`); effects from the particle lists (`runtime/tmb_particles.cpp`); 2D builders rewritten
(`runtime/tmb_2d.cpp`); textures from an offline pack (`runtime/tmb_textures.cpp`); VU0 programs in C++
(`runtime/tmb_vu0.cpp`); no VU1 or VU0 interpreter;
- no GS front end: no GS object, memory or thread; the DMA kicks to GIF / VIF0 / VIF1 complete unread; the native
renderer presents the frame at 2x (`PS2X_GS_SCALE`);
- sound: the recompiled 989snd's libsd calls on the fork's native mixer, the SPU2 absent (`TMB_NATIVE_AUDIO=0`
brings it back);
- the IOP: no hardware model and no interpreted instruction (`[iop:hw]`); its kernel services answered natively.
- the settings window (F2): controls, video (resolution, windowed / fullscreen / borderless, render scale), cheats;
the window shows each game frame once (no periodic stutter).
- **Controls.** Rebindable to keys, controllers and the mouse: F2 in the game, saved to `input.ini`.
- **Known gaps.** Not checked yet: every arena and story level to the endings. Widescreen and frame rates above the
PS2's are not started (the game's update steps in whole fields).
[`NATIVE_LAUNCHER_AIM_FORWARD.md`](NATIVE_LAUNCHER_AIM_FORWARD.md) adds the Hearse, Minion and
Tanker launcher turret-aim forwards. Coverage is 142/269 known forward returns (127 remain),
with 134/134 known inverse returns native.
## Measuring
[`NATIVE_RICOCHET_FORWARD.md`](NATIVE_RICOCHET_FORWARD.md) adds the two ricochet movement
forwards, before its height test and after its reflection. Coverage is 139/269 known forward
returns (130 remain), with 134/134 known inverse returns native.
- **Check runs.** A pad script reaching the match about 150 s in: `PS2X_PAD_SCRIPT="$(tools/play_script.py 230)"`,
with `TMB_TRACE_FRAMES=1` (frame split and CPU per host thread every 100 frames; under native frames also the game's
fields per real second, 60 when it runs at its own speed). `PS2X_CAPTURE_DIR` saves the presented picture
every few seconds, `PS2X_CAPTURE_WINDOW_DIR` the window as shown, `PS2X_WINDOW_SIZE=1280x960` a bigger window.
- **Timeline.** `TMB_TRACE_TIMELINE=<file>`, then `tools/timeline.py <file> [frame] [count]`.
- **What is still read or emulated.** `TMB_TRACE_PACKETS=1`: per 250 frames, packets read, chains walked, VU0
interpreter runs (all 0 by default); `[audio] native mixer` lines every 10 s with the SPU2 counters (all 0).
- **Live diagnosis.** `TMB_LIVE_TOGGLES=<file>` (words read every 60 frames: nodepth, nofog, flat, noguard, dump...)
and F9 bursts of window captures: let the owner drive to a spot scripts can't reach.
- **Comparison modes.** `TMB_NATIVE_VIF=1` (+ `TMB_NATIVE_MESHES_CHECK=1`), `TMB_NATIVE_MESHES=0 TMB_NATIVE_CHECK=<n>`
(VU1's own output beside the translation), `PS2X_VU0_HLE_CHECK=1`, `PS2X_AUDIO_RECORD=<wav>` on either sound path.
- **Shared machine.** Only timed runs go through the bench lock (`tools/bench_lock.sh`); builds and visual checks run
freely. Discard the first run after a build on Windows (Defender scans the new files).
[`NATIVE_WEAPON_LOCK_FORWARD.md`](NATIVE_WEAPON_LOCK_FORWARD.md) adds six weapon lock-on,
look-ahead, skill-satellite and rock forwards, with actual aim, position and height-test consumers.
Coverage is 137/269 known forward returns (132 remain), with 134/134 known
inverse returns native.
## Next steps
[`NATIVE_MINION_FORWARD.md`](NATIVE_MINION_FORWARD.md) adds seven Minion shield-hit
forwards, with actual distance, health, HUD and hierarchy-switch consumers.
Coverage is 131/269 known forward returns (138 remain), with 134/134 known
inverse returns native.
1. Story levels 2-8 to the endings, fixing what shows up (the owner's reports first); every Challenge arena is checked
(the Cheats tab's Unlock everything, `TMB_UNLOCK_ALL=1`, opens the locked ones).
2. Widescreen; frame rates above the PS2's (interpolating between game updates).
3. Later, a bigger project: the PS2-shaped software layer the recompiled code still runs in (guest threads, DMA kicks,
the IOP modules' RPC) replaced by the game's systems as PC code.
[`NATIVE_ATTACHMENT_FORWARD.md`](NATIVE_ATTACHMENT_FORWARD.md) adds five helicopter,
cable and weapon movement forwards. Coverage is 124/269 known forward returns
(145 remain), with 134/134 known inverse returns native.
## Working conventions
[`NATIVE_COLLISION_FORWARD.md`](NATIVE_COLLISION_FORWARD.md) adds six vehicle-collision
forwards for velocity reconstruction, forces, impact offsets and morph hit placement.
Coverage is 119/269 known forward returns (150 remain), with 134/134 known inverses native.
- Commit as `Thomas Martin <[email protected]>`, never a personal e-mail. End commits with
the `Co-Authored-By` line used in the history.
- Fixes to the runtime, IOP or recompiler go into the fork `TheBozos/PS2Recomp`, not into workarounds here. Push the
fork first, then bump the submodule here.
- Run the fork tests before pushing (`ps2x_tests`, 610+ cases), and a TMB check run on the USA release.
- Push with Git for Windows (`/c/Program Files/Git/cmd/git.exe`): MSYS2's git hangs without credentials.
- Never edit a script a running or queued job will execute; clear a stale bench lock entry if a job dies holding it.
Native graphics DMA/register removal: implementation and validation details are in
[`NATIVE_GRAPHICS.md`](NATIVE_GRAPHICS.md). The source uses BozoEngine `4a8f70a`, including native graphics completion
and the current shared native port services. The published v0.4.0 package remains the earlier release described above.
The player runtime's two camera matrix products now use typed native records without VU context state.
[`NATIVE_MATH.md`](NATIVE_MATH.md) records exact helper/default-run comparisons, the traced HUD position.W
RAM difference, and the vehicle/hierarchy/inline VU work that remains.
The six inline HUD point/direction blocks also use native records; [`NATIVE_HUD.md`](NATIVE_HUD.md)
records the original-block comparisons, destination-W contract and targeting-warning coverage limit.
[`NATIVE_IMAGES.md`](NATIVE_IMAGES.md) records the shared image-builder retirement contributed by DC,
the TMB resident-binding audit, exact draw/sound comparisons and movie/loading/gameplay qualification.
[`NATIVE_VEHICLE.md`](NATIVE_VEHICLE.md) covers native vehicle spatial calculations and the audited skid
direction, exact full-frame records, original-caller tests and the remaining multi-step coverage limit.
[`NATIVE_SUSPENSION_TIRE.md`](NATIVE_SUSPENSION_TIRE.md) adds the suspension ride-height
and tire-height transform leaves, with complete generated scalar consumers and tire entry calls.
[`NATIVE_PARTICLE_EMISSION.md`](NATIVE_PARTICLE_EMISSION.md) adds the emitted-direction and
attached/relative emitter transforms, with real particle metadata consumers and complete emitter-coordinate entry calls.
[`NATIVE_SHADOWS.md`](NATIVE_SHADOWS.md) adds vehicle shadow vertices and weapon shadow motion/height-sample
transforms, with complete cached-height vertex loops and actual height-query XYZ staging consumers.
[`NATIVE_TOW_TRUCK.md`](NATIVE_TOW_TRUCK.md) adds the tow-truck launcher's forward/inverse transforms,
with complete positioning, smoothing, normalization, orientation and material-publication consumers.
[`NATIVE_ATTRACTOR_GROUPS.md`](NATIVE_ATTRACTOR_GROUPS.md) adds group-selection, center and random-position
inverse transforms, with complete consumers, seeded generated producers and an audited peel-out W boundary.
[`NATIVE_PEEL_OUT.md`](NATIVE_PEEL_OUT.md) retires that peel-out forward transform,
with complete producer-to-pose checks and a fresh audit of the four opaque W fields.
[`NATIVE_CAMERA_TRANSFORMS.md`](NATIVE_CAMERA_TRANSFORMS.md) adds all eight camera-update
forward transforms, rear-view positioning and the coupled inline XYZW position publication.
[`NATIVE_WEATHER_VIEWPORT.md`](NATIVE_WEATHER_VIEWPORT.md) adds the weather viewport's
forward transform, checked through full entry, fade/fog updates, grid alignment and projection.
[`NATIVE_WEAPON_SKID_TRANSFORMS.md`](NATIVE_WEAPON_SKID_TRANSFORMS.md) adds weapon translation
and skid-mark creation/stretch offsets, with complete positioning, list and vertex consumers.
[`NATIVE_COLLISION_DRIFT_INVERSES.md`](NATIVE_COLLISION_DRIFT_INVERSES.md) adds sixteen vehicle
collision and drift inverse returns, with full XYZW checks and explicit generated-consumer boundaries.
[`NATIVE_RIGID_BODY_INVERSES.md`](NATIVE_RIGID_BODY_INVERSES.md) adds seven rigid-body inverse
returns, with complete impulse/collision entries and point-velocity consumers.
[`NATIVE_RIGID_BODY_FORWARD.md`](NATIVE_RIGID_BODY_FORWARD.md) adds ten rigid-body forward
returns with complete force, torque, impulse and integration entries plus actual
point-velocity consumers and audited destination-W lifetimes.
[`NATIVE_DRIVER_FORWARD.md`](NATIVE_DRIVER_FORWARD.md) adds seven driver path-offset,
lookahead and driving-LOS forwards. Coverage is 113/269 known forward returns
(156 remain), with 134/134 known inverse returns native. Complete generated owners
retain actual collision queries, scalar state consumers and meaningful inverse W.
[`NATIVE_FINAL_INVERSES.md`](NATIVE_FINAL_INVERSES.md) completes native coverage of all 134 known
inverse-helper returns, with force-field/health-stand entries, HUD/radar consumers and
particle visibility/sorting checks. Unknown and historical ABI support remains.
[`NATIVE_VEHICLE_LIGHT_INVERSES.md`](NATIVE_VEHICLE_LIGHT_INVERSES.md) adds six tire, rollover,
weapon-damage and object-light inverse returns, with complete generated owner entries
and real scalar state-publication consumers.
[`NATIVE_DRIVER_BOSS_INVERSES.md`](NATIVE_DRIVER_BOSS_INVERSES.md) adds five driver/boss inverse
returns and their coupled boss forward publication, with complete/bounded generated consumers
and gameplay/loading/movie qualification.
[`NATIVE_AI_INVERSES.md`](NATIVE_AI_INVERSES.md) adds five AI inverse returns,
with steering, attack-range and shot-policy consumers plus real attack-state publication.
[`NATIVE_HIERARCHY.md`](NATIVE_HIERARCHY.md) covers native collision/height hierarchy sphere tests, audited
inverse transforms and BSP plane distances, their original-caller tests and RAM boundary.
[`NATIVE_DIRECTIONS.md`](NATIVE_DIRECTIONS.md) adds three hot BSP collision direction callers to the
native record path, with generated-continuation tests, complete gameplay comparisons and stack-W audit.
[`NATIVE_DIRECTION_CONSUMERS.md`](NATIVE_DIRECTION_CONSUMERS.md) extends that scope to vehicle collision
points, tire-height corrections and light nodes, including the scalar clamps and normalization consumers.
[`NATIVE_PARTICLE_CONTINUATIONS.md`](NATIVE_PARTICLE_CONTINUATIONS.md) records the timing-sensitive
flare fallback found during that qualification and its native dispatch fix across scheduler resumes.
[`NATIVE_BSP_INVERSES.md`](NATIVE_BSP_INVERSES.md) retires the paired BSP and vehicle inverse leaves,
checks untouched VU state through their continuations, and traces the bounded contact-position W
RAM difference through the remaining terrain copy chain.
[`NATIVE_TERRAIN_CONTACTS.md`](NATIVE_TERRAIN_CONTACTS.md) replaces the 27 inline terrain, node,
point-contact and ray-result vector blocks with native XYZ calculations, with generated-block and
scalar-continuation tests and the retained fourth-component RAM boundary.
[`NATIVE_SPHERE_LOD.md`](NATIVE_SPHERE_LOD.md) adds the three sphere/LOD difference blocks and six
collision hierarchy helper returns, with complete generated sphere/LOD callers, scalar consumer
sequences and qualified gameplay/loading/movie routes. It records the remaining raw-RAM audit limit.
[`NATIVE_HIERARCHY_HELPERS.md`](NATIVE_HIERARCHY_HELPERS.md) adds twelve segment-grid, control-node,
height/BSP and line-of-sight helper returns. It records generated consumer tails, historical ABI
checks, live-route coverage and the directly traced height-BSP temporary W difference.
[`NATIVE_HIERARCHY_QUERY_RESULTS.md`](NATIVE_HIERARCHY_QUERY_RESULTS.md) adds twelve point/line,
terrain, auxiliary BSP, animated-node and lighting/attachment returns, with generated packing,
normalization and colour-consumer checks and a paired line-result W trace.
[`NATIVE_BSP_CROSSINGS.md`](NATIVE_BSP_CROSSINGS.md) adds thirteen BSP point/segment-crossing
returns, including actual point emission, duplicate/capacity checks and comparison of meaningful
inverse W when it replaces an earlier forward record.
[`NATIVE_HIERARCHY_TRAVERSAL_SETUP.md`](NATIVE_HIERARCHY_TRAVERSAL_SETUP.md) adds thirteen database
traversal, older collision-node/terrain and animated matrix-stack setup returns, with real scalar
consumer boundaries and historical ABI checks.
[`NATIVE_LEGACY_BSP_HELPERS.md`](NATIVE_LEGACY_BSP_HELPERS.md) adds fifteen older BSP setup/result
and hierarchy root/grid/traversal returns, with generated normalization, segment construction,
packing and matrix-stack publication checks.
[`NATIVE_POINT_RAY_HELPERS.md`](NATIVE_POINT_RAY_HELPERS.md) adds eleven coordinate-system/root
and point-contact/ray result transforms, with complete scalar result tails and historical ABI
checks.
[`NATIVE_TERRAIN_INPUT_HELPERS.md`](NATIVE_TERRAIN_INPUT_HELPERS.md) adds eleven terrain-node,
height-query and material-query inverse returns, with actual height scans, aggregate bounds
publication and integer-grid consumer checks.
[`NATIVE_TERRAIN_QUERY_HELPERS.md`](NATIVE_TERRAIN_QUERY_HELPERS.md) adds ten terrain LOS,
cell-collision and ray inverse returns, with translated endpoint pairs and real result
normalization/publication consumers.
[`NATIVE_CAR_PARTICLE_HELPERS.md`](NATIVE_CAR_PARTICLE_HELPERS.md) adds the fourteen older
car-debug and hierarchy particle forward returns, with actual debug-line vertex records,
view lookup and scalar position consumers.
[`NATIVE_TERRAIN_FINAL_HELPERS.md`](NATIVE_TERRAIN_FINAL_HELPERS.md) adds eight terrain debug,
edit and wave inverse returns, with actual vertex records, grid/input consumers and wave
type/bounds dispatch. It closes this narrow hierarchy/terrain two-transform-helper inventory.
[`NATIVE_SCENE.md`](NATIVE_SCENE.md) covers the subsequent renderer hierarchy producer/consumer replacement:
native scene/frame/light records, zero VU0 program calls in both qualified routes, packet-buffer-only RAM
differences at the checked gameplay snapshot, and movie/loading/1P/4P validation. Other macro math and shader
parameter packing remained at that step; the published release has not been updated by these source changes.
[`NATIVE_SHADERS.md`](NATIVE_SHADERS.md) covers removal of the mesh shader's `VuImage` and point-light packing,
named native parameters and retained state, exact complete 1P/4P recordings, and a disc-free numerical suite
added to Windows/Linux CI. Other macro math, scalar packet builders and legacy extents remain.
[`NATIVE_PROJECTION.md`](NATIVE_PROJECTION.md) covers the next audited screen/weather projection and
identity boundaries, original helper/generated-caller checks, live comparison counts, and the remaining
peeling-out W-padding chain behind the raw-RAM differences.
[`NATIVE_OBJECT_PACKETS.md`](NATIVE_OBJECT_PACKETS.md) covers retirement of the per-object shader/header
output and RGB packet readbacks. [`NATIVE_TEXTURE_INPUTS.md`](NATIVE_TEXTURE_INPUTS.md) covers the subsequent
removal of its last three texture copies and the consumer's packet reads/patches. Game allocation/usage
bookkeeping and the separate upload-link builder still execute; no packet shadow or binding is added.
[`NATIVE_TEXTURE_UPLOADS.md`](NATIVE_TEXTURE_UPLOADS.md) covers the subsequent native upload-link leaf,
preserved CPU/cursor ABI, original fallback contracts and bounded gameplay/movie validation. It emits
no upload tag at the audited calls; game texture-manager bookkeeping and other packet helpers remain.
[`NATIVE_GRAPHICS_SERVICES.md`](NATIVE_GRAPHICS_SERVICES.md) records removal of the engine GS device/GIF
reader state and TMB's old packet-based flare adapter, independent/combined tests and unsupported readback limits.
- One submodule: `BozoEngine`. No PS2Recomp gitlink, legacy CMake branch, import fallback, IOP recompilation or old runner scripts.
- `tools/tmb_build.py`: verify → extract → configure → native tools → recompile → packs → compile → stage.
- `scripts/build_runtime.sh` and the other retained shortcuts use that same pipeline.
- Native frame pacing is unconditional. A legacy `TMB_NATIVE_FRAMES=0` environment setting cannot bypass it.
- Heat haze defaults on, as requested. `BOZO_HEAT_HAZE=0` is the comparison switch.
- Existing cards/settings keep their format and `%APPDATA%\TMB_Recomp` location. Agent runs must set a scratch `PS2X_USER_DIR`.
## Validation recorded in this continuation
- Engine: all 5 local CTest checks pass, including the corrected FMAC overflow case and its new boundary cases.
- Whole-function replay: **9,232/9,232 samples, 1,518/1,518 functions**, bit-exact.
- Real-time menu/movie diagnostic: EE/PC **1.0001**, **576,005 ticks/s**, **59.97 fields/s**; movies **29.93–30.00 pictures/s**.
The owner also said the freshly launched build no longer felt too fast. This measurement used the handoff build's existing clock fixes;
the continuation adds a regression guard and removes the unpaced legacy frame switch.
- Native story run without a call log: **26,000 frames**, stage progression, card files written, no fault.
- Boot pinned: **MATCH**, 3,000/3,000 state frames; draws 2,999/3,000 (the established last-record exception).
- 1P pinned: **MATCH**, 16,000/16,000 state frames; draws 15,999/16,000 (the same last-record exception).
- Stage 6 pinned: the old frame-7105 interrupt mismatch is resolved. **11,000/11,000 state and draw frames match with recorded IOP-time sound replies**.
Two events retain an ancestor pc in the reference; the checker accepts these only with an active inner call, matching function/caller,
and an **exact cycle and checkpoint count**, and reports them separately. It does not shift their timing.
- Release-tool regressions: 12 tests pass, including accelerated menus/movies, migration layout, retired source cleanup,
junction boundaries, configure retry and archive-pipe completion. No game data is needed by those tests.
- Engine and TMB Windows/Linux CI pass. The native package workflow's test run
[42121468079](https://github.com/TheBozos/TMB_Recomp/actions/runs/42121468079) also passed, including its bundled-toolchain smoke check.
### Packaged Windows build and updates
- Candidate `0.4.0-test.20261105.3`, code `b9c42cb`, engine `9361960`: both player ZIPs pass the archive audit and SHA-256 checks.
All **7,750 files** have identical contents between the two installation layouts. The corresponding-source ZIP's hash passes too.
- Built and played from `D:\BozoScratch\finish\Jérôme Jeux\TMB_Recomp_Bozo`, using only the bundled kit.
The final packaged launcher stopped the build at 40%, resumed it, staged the native executable and launched it.
The complete preparation took 126 seconds on this development PC; this is not a clean-OS performance promise.
- The launcher self-test completed normal Play/shutdown (exit 0), English/French settings screenshots,
and an intentional child crash with a usable report. Failure paths now fail the self-test instead of returning a false success.
- Final packaged menu/movie log: **1.0000** EE/PC, **575,964 ticks/s**, **59.97 fields/s**, movies **29.94–30.00 pictures/s**.
`tools/check_timing.py` passes with `TMB_NATIVE_FRAMES=0`. The fresh 2,400-frame accent-path run also passes.
- The **actual v0.3.2 updater** installed the unsuffixed migration ZIP. The subsequent new build removed the retired
`source/PS2Recomp` marker, preserved player-data sentinels, rebuilt, and started BozoEngine.
The new updater separately installed its `-bozo.zip` payload into an old-named `TMB_Recomp` folder and preserved its settings marker.
- This candidate-validation stage preceded publication; those test candidates were not published releases.
The final v0.4.0 delivery is recorded at the top of this document.
### Final gameplay and profiling checks (2026-11-06)
All runs use isolated user folders, the USA disc, engine `9361960` and the packaged build's game code.
These figures measure **game-thread work**, not the interval between displayed pictures:
| Scene | Measured frames | Mean work | Mean p95 | Maximum work | Over 16.7 ms |
|---|---:|---:|---:|---:|---:|
| 1P, bots active, after 125 s | 4,458 | 3.77 ms | 4.57 ms | 8.2 ms | 0 |
| Actual four-player split-screen, after 100 s | 3,136 | 4.51 ms | 5.40 ms | 12.5 ms | 0 |
| Effects-heavy story level 20, after 125 s | 4,098 | 2.72 ms | 3.54 ms | 11.2 ms | 0 |
- 1P and level 20 each completed 12,000 frames; four-player completed 9,000. Gameplay intervals hold about 60
updates/presents per second. Whole-run averages including loading are 59.7–59.9 updates/s. Occasional presentation
intervals over 20 ms still occur; do not describe this as zero hitches on all hardware.
- Repeated the handoff's exact 7,500-frame four-pad command, including captures at 6,000 and 7,000. Its old script
actually stays on opponent selection in this real-time build. The previous 42-present/s dip did not recur on that
same screen: frames 7,000–7,300 remained at 60 presents/s.
- For the real split-screen run, omitted player 1's initial `1292:CROSS/18` from the local `p1_frames.txt` input;
the native build has already reached the main menu there, so that old intro-skip press selects ONE PLAYER.
Kept all other four-pad events unchanged. Captures at 6,000 and 8,000 show all four views, driving and firing.
AI suppression was off; the four-human deathmatch itself has four human vehicles. Bot coverage comes from 1P.
- One further historical 1P timing pair (125–195 s) measured 3.77 ms native versus 5.49 ms on the previous runtime,
with no game-work frames over budget in either. This is a limited local comparison, not a cross-hardware speedup claim.
- Completed the previously unwritten raw-profile output and fixed `hitch.py`'s imported `__file__` namespace in the local
profiling tools. A 20-second sample contains 20,475 raw thread samples. Its game-thread pacer segmentation labels
100 of 1,129 segments over 16.7 ms, but work samples are similar in the two groups (2.1 versus 1.8 per segment).
The largest gaps line up with the profiler's 0.5-second thread enumeration; they cannot be counted as actual missed
game frames. The game's own statistics in that interval show 4.51 ms mean, 8.9 ms maximum, zero over budget.
Mesh submission and VU work remain the main CPU buckets. Mixer worker/COP2 inlining/GL batching remain optional
optimization opportunities; none was introduced without a demonstrated frame-budget problem.
- Restarted for 6,000 headless frames with a copy of the card written by the native story run. It reached gameplay
without a fault; the four existing card files remain intact. This is restart/readback coverage, not a full-campaign-ending claim.
- The new updater also passed in the accented `TMB_Recomp_Bozo` layout, **running from its own bundled Python**.
It safely set aside loaded Python DLLs, installed the payload, preserved the player-data marker, and the updated Python starts.
The source migration and README review are merged through [PR #3](https://github.com/TheBozos/TMB_Recomp/pull/3).
The retired fork checkout, Git metadata and both linked worktrees are preserved independently at
`D:\TMB_Retired\2026-11-05`; they are no longer an active submodule or local submodule configuration.
## Limits of the old reference comparisons
- Native 989SND uses its own timing. Default pinned story/4P/stage runs can differ on opaque play handles or the instant a sound ends.
Recorded sound replies let the remaining native game state/draws be checked. Those replies are a checker option and never used by the player build.
- The old pinned `save` recording still differs inside the test-only kill-enemies cheat's copied-context guest call at frame 5458.
The native campaign run does proceed through the kills, stage transitions and real card writes. Do not describe the old pinned save recording as MATCH.
- Audio sample hashes are diagnostic, not an enforced equality claim; the existing handoff documents the few-sample timing differences.
- A fresh standard-user Windows OS, SmartScreen/Mark of the Web, physical high-DPI displays and additional human/controller acceptance need real hardware testing.
## Packaging and updates
Both player ZIPs carry **the same BozoEngine build**:
| File | Root folder | Purpose |
|---|---|---|
| `TMB_Recomp-<version>-bozo.zip` | `TMB_Recomp_Bozo/` | Separate/new installation |
| `TMB_Recomp-<version>.zip` | `TMB_Recomp/` | Existing launcher's in-place Update |
The older ZIP name does not retain the older engine. The existing updater can install the migration ZIP;
the new launcher subsequently uses `-bozo.zip` updates regardless of its installation folder name.
The corresponding-source ZIP and every SHA-256 accompany a published release.
Requirements: Windows 10 version 1903 or newer / Windows 11, **AVX2 + FMA**, OpenGL 3.3, about 10 GB free. Only the USA disc is supported.
Follow [RELEASE_CHECKLIST.md](RELEASE_CHECKLIST.md). Do not publish a release tag merely because a test artifact builds.
## Working rules
- README follows the shared The Bozos project format: preserve its banner/badges, disc notice/hash, status screenshots,
milestone/native-layer tables, goal, architecture, requirements, build/run, controls/cheats, disc facts, layout and credits.
Updating stale facts is not permission to replace that presentation with a shorter standalone README.
- Clean-room rules in `BozoEngine/docs/PLAN.md` still apply: do not read the old fork, its generated code or emulator source when writing engine code.
- Push engine changes before the TMB pin; use reviewed branches/PRs and green CI. End commits with a `Co-Authored-By` line.
- Do not modify game/disc files or commit derived content. Never modify the owner's real user folder during agent runs.
- Keep scratch/builds on D:. Never edit a script while a job runs it, send input to other windows, or kill another project's processes.
- The shared benchmark mechanism is for timing runs only; builds and functional checks do not take it. Do not announce its state.
## Local evidence
Continuation scratch: `D:\BozoScratch\finish`. Source worktrees: `D:\TMB_bozo` and `D:\BozoEngine`.
Logs include `diag.log`, `ctest-final.log`, `replay/report.txt`, `pin-boot.log`, `pin-match1p.log`, `pin-stage6.log`,
`save-free.log` and the deliberately retained failing `save-fixes.log` comparison.
Final evidence: `final-launcher-shots/selftest.log`, `final-launcher-user/logs/TMB_Recomp.1.log`, `migration3.log`,
`native-update3.log`, `future-update3.log`, `scene-1p.log`, `four-player.log`, `scene-stage.log`, `hitch-report.txt`,
`scene-hitch.samples` (original), `scene-hitch-symbols.samples` (same samples with the Unicode module path resolved
through a hard link to the same executable), and `save-readback.log`.
+88
View File
@@ -0,0 +1,88 @@
# Native AI hunt and bait forward transforms
[Particle arc forwards](NATIVE_PARTICLE_ARCS_FORWARD.md) follow with the two particle arc sites.
Two AI-driving forward returns use native XYZ arithmetic after the
[Zoomies and HalTrans weapon forwards](NATIVE_ZOOMIES_HAL_FORWARD.md). Known forward
coverage grows from 178 to 180 of 269 returns (89 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `103534` | `Vehicle::aiPerformBeadOnHuntCs` (`103308`) | A side offset `(x,0,0)` through the vehicle's basis into frame `+10`, added to the driver's bead point and made relative to the vehicle for the steering angle |
| `106af0` | `Vehicle::aiUpdateBaitModeOld` (`1069f8`) | Offset `(0,130,0)` through the target vehicle's basis into frame `+10`, added to the target's position, used to pick the closest attractor point |
When hunting, the AI keeps a side offset. It is used as is when the AI info flag
at `+5b8` is set or the info distance at `+20` is at least 150, and otherwise clamped
to ±20. The offset is added to the bead point,
made relative to the vehicle, and `atan2f` of its X/Y becomes the steering heading.
The driver then checks speed or drives to attack range and turns smoothly.
In the old bait mode, once the target's counter at `+20d0` reaches 600 and no point
has been picked (`driver+20c` is -1), the AI projects a point 130 ahead of the
target. It hands that point
to `attractGetClosestPoint`, which reads it only through `mathfSubVector`. The
closest attractor point becomes the driver's new bead.
In both owners the result is the frame vector at `+10`. It is read only by
`mathfAddVector`, `mathfSubVector`, `attractGetClosestPoint` and scalar X/Y loads.
Frame `+1c` is never read. Neither owner reads VU registers, the accumulator or
flags. The existing native helper computes separately rounded XYZ, preserves
destination W and leaves VU state untouched. Unknown and historical callers keep
the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/ai-bead-forward`, against parent `71e5997`
(PR #72). Parent headless/window binaries are preserved there and match PR #72's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 283 and 284): helper-boundary continuations and owner entries, across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- Hunt entries start inside the owner at `1034c4`, right after the side offset is
built, with the frame as its prologue leaves it.
- From there they run the unclamped, +20 and -20 cases, the transform, the bead
addition, the vehicle-relative subtraction and `atan2f`.
- They stop at `aiDriveToAttackRange`; reaching it is asserted.
- Bait entries run from the owner's start through its counter and mode checks, the
transform and the real attractor search over two points, to the owner's return.
When a point has already been picked, they return without a transform.
- Both bases are fixture-known, so every case is checked against an independent
identity or quarter-turn result.
- Published values are asserted exactly against the original FPU arithmetic: the
hunt heading vector after both the addition and the subtraction, and the bait
point, the picked index and the bead pointer. The sites publish in 512 and 480
cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+1c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 705 → 706,
real libm errno cases 810 → 853). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 145,920 generated sequences / 7,104 whole-memory
comparisons. Historical forward ABI coverage is 10,944 / 684; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `71e5997`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. Neither AI return runs on these routes, so both are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 58.2 ms of silence in one-player, 35.7 ms in four-player and 24.3 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. AI hunting and baiting in actual play, full campaign and physical controller/hardware acceptance remain open.
+100
View File
@@ -0,0 +1,100 @@
# Native AI inverses
Five AI inverse-transform returns now use native record arithmetic, extending the
[rigid-body increment](NATIVE_RIGID_BODY_INVERSES.md). Inverse coverage grows
from 112 to 117 sites; forward coverage stays at 95. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Consumers |
| --- | --- | --- |
| `1029f8` | `aiMoveBetweenPoints` | Lateral correction, angle wrapping, smooth steering and control-pad updates |
| `102c20` | `aiUpdateControlPadForTwoStageAttack` | Lateral correction, smooth steering and composed attack-range update |
| `102d74` | `aiDriveToAttackRange` | Relative velocity, range prediction and throttle/brake selection |
| `105c68` | `aiCheckForGoodShot` | Target motion, weapon/range/angle gates, look policy and attack-state publication |
| `105eec` | `aiCheckForGoodRearShot` | Rear target motion, weapon class, look policy and attack-state publication |
The existing native inverse snapshots basis/input records, computes separately
rounded XYZ and copies first-basis W as meaningful data. All four output
components stay exact. Native calls leave VU registers, accumulator, flags and
data memory untouched. Unknown callers and historical hosts retain the original
ABI. AI branches, angle wrapping, driver steering and attack-state changes stay
compiled game code.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/ai-inverses`, against main `c7c798e` (PR #46).
Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons.
Aggregate coverage is 93,696 / 3,840. Four host rounding modes, denormal
controls, RAM aliases, rotated bases and arbitrary first-basis W are covered.
- Each return has 256 inverse-boundary cases through its real consumer/return
and 256 producer cases. Four owners have complete entries (1,024 cases).
The larger navigation owner starts at its bounded steering producer
`102944` (256 cases), then completes its real scalar tail; the whole navigation
state machine and its earlier pathfinding calls are outside these fixtures.
- Producer reach assertions distinguish active paths and pre-transform gates:
896 producer cases reach the selected inverse and 384 skip it. The navigation
prefix covers seven rejection gates and its active correction path. Two-stage
attack entries also run the real composed attack-range function.
- The real `boundFAngle` and `driverSmoothlyTurn` execute, including angle wraps,
left/right steering and control-pad stores. Range entries exercise throttle,
brake, special attack range, weapon range and predicted relative motion.
- Shot entries cover low/high turning rate, low target speed, lateral thresholds,
weapon classes, range/angle rejection, look policy and real attack-state stores.
The deterministic game-mode branch of look policy is used; its optional random
branch remains outside these fixtures. Successful attack-state publication is
required for both front and rear shots, not merely early rejection.
- CPU outside retired VU, outgoing host FP effects, clocks/checkpoints, per-site
inverse counts, steering/look/attack helper counts and final memory agree.
Native VU stays untouched through the complete consumers. No new W exclusion
or VU reconstruction is added; inverse XYZW is compared in full.
- Whole-memory producer samples select active transforms. Historical inverse ABI
coverage grows to 7,488 / 117 cases / whole-memory checks. Forward remains
5,504 / 344. Existing hierarchy coverage retains 786,432 helper cases / 384
whole-memory, 8,000 geometric edges, 1,024 complete BSP callers / 32 whole-memory
and 2,048 unknown ABI cases.
## Replay qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass. The final
caller suite requires successful front/rear attack-state publication in 392 / 352
comparison cases respectively.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical too. Strict/default recording files and snapshots are byte exact;
strict result comparisons report no mismatch. No new RAM-padding difference is
introduced relative to the rigid-body parent.
All five new sites execute in 1P: navigation 640 calls, two-stage steering 448,
attack range 1,370, front shot 1 and rear shot 1,473 (3,932 total). Four-player
makes no AI inverse calls in this four-human scenario. The front-shot runtime
sample is sparse; its broader branches and successful publication are qualified
by the generated-code fixtures.
## Window qualification
Fresh isolated runs complete 6,500 one-player, 6,500 actual four-player and
4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
AI opponents, driving/combat/effects, four simultaneous views, decoded intro
images and return to the menu. Each route has five distinct captures.
Windowed 1P reaches 2,545 new inverse calls: two-stage steering 292, attack range
1,412, front shot 1 and rear shot 840; the navigation inverse is cold in this
windowed sample but reached in the headless replay. Four-player and movies make
no AI inverse calls. Stereo 48 kHz WAV captures contain nonzero audio. Device
underruns remain: 60.2 ms silence in 1P, 33.6 ms in 4P and 17.6 ms in movies.
These are functional checks, not a timing or flawless-playback claim. Full
campaign, all navigation branches, random look-policy paths and physical
controller/hardware acceptance remain outside this increment.
## Remaining scope
Current generated source contains 134 inverse-helper and 269 forward-helper
returns. Of these two families, 17 inverse and 174 forward sites remain outside
the native allowlists: 191 total. This is a call-site inventory, not a count of
all remaining emulation. Remaining inverse groups include driver/boss helpers,
HUD/radar, rollover, damage, lighting, a tire helper and a particle helper.
Additional inline arithmetic and forward transforms remain separate work.
+105
View File
@@ -0,0 +1,105 @@
# Native attachment and environment forward transforms
Five attachment/environment forward returns use native XYZ arithmetic after the
[vehicle-collision forward increment](NATIVE_COLLISION_FORWARD.md). Coverage
grows from 119 to 124 of 269 known forward returns (145 remain). Known inverse
coverage stays 134 of 134. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `129e58` | `EnvHeli::UpdateTrans` | Translated helicopter position, height smoothing and real coordinate-system grid reparenting |
| `137cac` | `Cable::Update` | Parent-space offset, pickup/cable position, grid membership and lifetime/type-dispatch staging |
| `1b2d1c` | `Weapon::UpdateGasCanTrans` | Smoothed, frame-scaled movement, real height query, child position and lifetime fields |
| `1b3d30` | `Weapon::UpdateSawBladeTrans` | Smoothed, frame-scaled movement and translated coordinate-system position |
| `1b3e00` | `Weapon::UpdateTaxiSpikeTrans` | Smoothed, frame-scaled movement and translated coordinate-system position |
Native returns compute separately rounded XYZ, preserve destination W and leave
VU registers, accumulator, flags and data memory untouched. The original scalar
smoothing, frame accessors, angle updates, height queries and grid/lifetime logic
remain. Unknown/historical callers retain the original ABI. No engine or game
motion formula is changed.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/attachment-forward`, against parent `2ee3dc9`
(PR #54). Parent headless/window binaries are preserved there for diagnostics.
Generated bodies, retail data and runtime recordings stay outside Git.
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons.
Each return has 256 helper-boundary sequences through its real tail and 256
producer-entry sequences. Four rounding modes, FTZ/DAZ, RAM aliases, rotated
bases, zero/tiny/signed vectors, zero/one/two frame counts, arbitrary W payloads
and actual in-place scratch outputs are covered.
- Helicopter entries complete the original owner: local movement, world-position
addition, scalar height smoothing and `hdReparentCsGrid`. Enabled and disabled
grid gates are included.
- Cable entries retain the parent's offset transform, actual child-coordinate
position publication and grid update, disabled-child state and lifetime
increments through 301. Expiry cases start from the real owner and stop at
`ChangePickupType` after position/grid publication, timer reset and type-index
staging. Pickup replacement itself is not stubbed or claimed as complete-owner
coverage; other entries complete the owner.
- Grid entries execute real sphere-cell calculations, pool allocation, linked-list
insertion and old-cell removal/deallocation. Explicit bucket/node ownership and
cached-cell assertions verify translated positions reach the correct real cell.
There are 128 successful removal/reinsertion cases, plus disabled-grid cases.
- Gascan entries complete the original movement/smoothing/frame-count path,
parked three-angle update, query/publish gates, child-coordinate publication and
lifetime fields. Height fixtures use the actual `hdHatTest`, disabled-terrain
`terrainGetHAT` and an empty resident collision grid, preserving the original
miss/fallback behavior. They do not claim terrain-hit coverage. No height or
collision result is stubbed. Expired-state entries use the actual non-player
message gate; player-message dispatch is outside these fixtures.
- Saw/taxi entries complete the original smoothing, three actual frame-accessor
calls, local movement transform and world-coordinate addition.
- Explicit per-site and smoothing/frame/grid/query/angle counts are required.
Known position assertions pass 32 cases per owner, including gascan child
positions. Cable enabled/disabled and expiry states, gascan expiry state,
grid cache IDs, bucket pointers and node ownership are checked before any W
normalization. CPU outside retired VU, clocks/checkpoints, host FP effects,
action counts and final memory agree. Native VU stays untouched throughout.
- Opaque forward W is restricted to the real owner's `SP+0c`. Exact output counts
and addresses distinguish helper boundaries from complete-entry frames of
`0x30`, `0x40` or `0x60` bytes. Disabled producer gates have no exclusion. Original W
remains intact through every real consumer, then is normalized for comparison
only. Meaningful inverse W remains fully compared in the earlier suites.
No runtime RAM mask, recorded-hash normalization or VU-bank reconstruction is
introduced.
- Aggregate caller coverage is 117,248 generated sequences / 5,312 whole-memory
checks. Historical forward ABI coverage grows to 7,360 / 460; inverse remains
8,576 / 134. Existing hierarchy/BSP/edge/unknown-ABI coverage and earlier AI,
vehicle/light, final inverse, driver and collision assertions stay enabled.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass; every
previous publication assertion remains enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `2ee3dc9`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recording files and snapshots are byte exact,
with no strict mismatch. This increment adds no RAM-hash difference.
Default one-player reaches cable `137cac` 3,902 times and taxi-spike `1b3e00`
494 times; four-player reaches cable 3,798 times. Helicopter, gascan and saw-blade
sites are cold on these headless routes and are qualified by their generated
owners and real consumers described above.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
AI opponents, combat/effects, four simultaneous views, decoded intro footage and
return to the menu. Each route has five distinct captures. Stereo 48 kHz,
16-bit WAV recordings contain nonzero audio.
Windowed one-player reaches cable 1,706 times and gascan 46 times; four-player
reaches cable 1,816 times. Movies make no calls to these five sites. Helicopter
and saw-blade sites remain cold across these runtime routes, and taxi-spike
runtime reach comes from the headless one-player route. Complete generated
entries retain the stated cold-site coverage and expiry/query limits.
Device underruns remain: 30.2 ms silence in 1P, 29.5 ms in 4P and 18.4 ms in movies.
These are functional checks, not a timing or flawless-playback claim. Full
campaign, every attachment/terrain-hit/pickup-replacement configuration and
physical-controller/hardware acceptance remain outside this increment.
+118
View File
@@ -0,0 +1,118 @@
# Native attractor-group spatial transforms
Three inverse-transform returns now use native record calculations, extending
the [tow-truck increment](NATIVE_TOW_TRUCK.md). Forward coverage stays at 79 sites;
inverse coverage grows from 86 to 89. BozoEngine remains pinned to `4a8f70a`.
| Return PC of helper `1da1e8` | Owner | Consumers |
| --- | --- | --- |
| `108d6c` | `attractGetGroupTestPointIsIn` (`108c60`) | Local XY bounds and ordered group selection |
| `109870` | `attractGetCenterOfGroup` (`1097c8`) | Rotated half-extents plus group origin, then XYZ publication |
| `1099a0` | `attractGetRandomPositionInGroup` (`1098e8`) | Rotated random offsets plus group origin, then XYZ publication |
The existing native inverse calculation snapshots operands, computes separately
rounded XYZ and copies the first basis vector's W as data. Native calls leave VU
registers, accumulator, flags and data memory untouched. Historical hosts and
unknown callers keep the complete original ABI. Group ordering, height gates,
boundary comparisons, random generation, rotation construction and world-position
publication remain compiled game code.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/attractor-transforms`, against main
`0bf979a` (PR #39). Generated game code, retail data, recordings and captures stay
outside Git.
- Added coverage is 1,536 generated consumer sequences / 96 whole-memory
comparisons. Aggregate coverage is 71,168 / 2,432. All final fixture memory,
including W, is compared without a forward-W exclusion for the new cases.
CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and memory
agree; native VU stays untouched. Four host rounding modes, denormal controls,
RAM aliases and arbitrary opaque W payloads are covered.
- Every point-test case runs the complete selection tail and return, including
subsequent group iterations. Literal boundary fixtures verify the rotated
strict bounds, signed zero and values immediately inside/outside the upper
bound. Another 256 cases enter the actual function: empty/negative counts,
height rejection, rotated/unrotated groups, inclusive unrotated upper bounds,
first-match ordering and a third-group match after two rotated misses.
- Center and random-position cases run through their complete publication tails,
retaining destination W and publishing group Z. Another 256 cases for each
enter at the actual function entry, including zero rotation, positive/negative
rotation and zero/reversed extents. Rotation inputs stay within thirty degrees;
wider trigonometric argument reduction is outside these fixtures.
- Random-position entry cases execute the actual generated `mathfRandf` and
`rand`, with guest-backed generator state restored between comparison runs.
An explicit assertion verifies two real `rand` dispatches per entry. These
fixtures exercise the generated producer; runtime native-library behavior is
separately covered by the paired gameplay routes.
- Historical inverse coverage grows to 5,696 / 89 cases / whole-memory checks;
historical forward coverage stays at 4,480 / 280. Existing hierarchy coverage
retains 786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024
complete BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
- All eleven native suites and twelve Python tooling tests pass. Current emitted
inverse-transform vector results are stored before MXCSR restoration; the
original/native comparisons pass in all four caller rounding modes.
## Gameplay and RAM boundary
Default and strict builds complete 9,500 one-player and 8,500 actual four-player
frames. Strict/default recording files and full 32 MiB snapshots are identical.
Against the tow-truck baseline, every scratchpad, call, draw, sound, thread, count
and EE-clock field agrees. The entire four-player recording and both sampled full
RAM snapshots also agree. The three sites execute 14,567 / 25,280 / 3 times in
one-player respectively (39,850 total); all are cold in this four-player route.
Four-player therefore supplies general regression coverage, not site reach.
Default routes make zero original-helper comparisons and execute zero VU0
microprograms. Counts establish coverage, not a measured speedup.
One-player RAM hashes differ on 664 frames in intervals 7,621–7,629,
7,732–8,066 and 8,446–8,765. A temporary paired observer reproduces both complete
qualified recordings and every raw callback hash. Every difference is confined
to four `Vehicle+52c` peel-out vector W fields:
| RAM word | Baseline / native | Differing frames |
| --- | --- | --- |
| `26077c` | `00000000` / `02000200` | 9 |
| `26617c` | `00000000` / `02000200` | 9 |
| `268e7c` | `00000000` / `02000200` | 664 |
| `25da7c` | `00000000` / `42700000` | 23 |
Every differing word matches its last observed writer: the existing forward
return `1abd60` in `vehicleUpdatePeelingOut`. The inherited `VF16.W` supplies those
bits; XYZ is identical. Its `vehicleSetCsMat` consumer uses XYZ-only addition and
does not consume peel-out W. The complete generated coordinate-system consumer
tests now explicitly include all three observed W payloads across rounding modes
and matrix aliases, alongside the existing fuzz cases.
Replacing only these four words on a diagnostic RAM copy reproduces every
baseline frame hash, with zero unaccounted frames or writer-provenance mismatches.
No RAM mask or VU-state reconstruction ships. The three temporarily instrumented
production sources and their original object hashes were restored exactly; all
eleven rebuilt native suites pass again.
After observer removal, clean default/strict recordings and full snapshots
reproduce the qualified results byte-for-byte. Player, headless and checker
binaries contain no temporary observer markers.
Fresh 6,500-frame one-player and actual four-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, with isolated scratch
user data. Reviewed captures show decoded movie pictures (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), active one-player gameplay
(5,500 / 6,300), and four advancing snow-arena views with snow/tire effects
(four-player 5,500 / 6,300). Windowed one-player reaches the point-test and center
sites 6,613 / 11,993 times; random-position inverse is cold in that shorter route.
All three are cold in the four-player and movie routes. These captures establish
bounded functionality, not pixel-exact windowed or console parity.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
13.4 / 61.3 / 39.0 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound matches the baseline; flawless
device audio and subjective listening are not claimed.
## Remaining scope
These two helper inventories now contain 79 native forward and 89 native inverse
sites. Outside their allowlists remain 190 forward and 45 inverse sites, 235 in
total across the game. This is a structural source inventory, not a live cost
measurement, and excludes other helper families and inline VU operations. Full
campaign acceptance and console visual/audio parity remain separate work.
+95
View File
@@ -0,0 +1,95 @@
# Native sinking blimp forward transforms
[Falling junk jet forwards](NATIVE_JET_DEATH_FORWARD.md) follow with six more environment sites.
Two blimp death forward returns use native XYZ arithmetic after the
[gas tank forwards](NATIVE_GASTANK_FORWARD.md). Known forward coverage grows from
155 to 157 of 269 returns (112 remain). Known inverse coverage stays 134 of 134;
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `10eee0` | `Blimp::UpdateDeath` (`10ee18`) | The blimp's velocity at `+20` through its rebuilt coordinate-system basis, into the static vector `0x4fc200`, added to its position |
| `10efa0` | `Blimp::UpdateDeath` (`10ee18`) | A random explosion offset in `0x4fc200`, transformed in place, added to the position and handed to the effect and explosion sound |
While the blimp is more than 100 units above the ground (`hdHatTest`), it rolls
(smoothed speed, accumulated and clamped roll, `mathfRotMatrixRPH`), moves by the
transformed velocity and sinks by 0.5. A 1-in-9 roll then builds an explosion offset
(±80 by a raw `rand` bit, random Y/Z), transforms it in place and adds the position.
The result goes to `particleCreateFx` and `ExplosionSound::playBlimpExplosion`.
Cars within 150 (Manhattan, 2D) of the blimp are set on fire. Near the ground it
crash-lands instead, with no transform.
`0x4fc200` is a function-local static: no other code in the game references it.
Its W (`0x4fc20c`) is never read. After the first transform it is read only by
`mathfAddVector`. The explosion offset's X/Y/Z are rewritten before the second
transform, which reads only X/Y/Z. The explosion point is then read only through:
- `mathfAddVector` in `particleCreateFx` and its child effects;
- `mathfManhatDist` in `calculateRangedVolume`;
- `mathfSubVector` in `calculatePanAngle`, both reached from
`calcDualMonoMixVolPan`.
The owner reads no VU registers, accumulator or flags. The existing native helper
computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. It reads its input before writing, so the in-place transform is safe.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/blimp-death-forward`, against parent `bb68515`
(PR #65). Parent headless/window binaries are preserved there and match PR #65's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 260 and 261): helper-boundary continuations and full-owner entries, across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Full entries run the real `hdHatTest` on the fixture's empty height grid, with
the ground set either 1,030 below the blimp (drift) or 30 below (crash landing).
They then run the roll smoothing and clamping, matrix rebuild, transform, position
update and sink. The fixture seeds the game's actual libc `rand` state, so the
1-in-9 explosion roll is taken or skipped as intended. With no explosion, the
owner checks the empty vehicle lists and returns normally. Explosion and crash
cases stop at `particleCreateFx`.
- Helper-boundary outputs are checked against an independent identity or
quarter-turn result. Full entries rebuild the basis from the roll first, so those
are covered by the native/original comparison.
- The published values are asserted exactly against the original FPU arithmetic:
the drift position (X/Y, and Z after the 0.5 sink), and the explosion point in
`0x4fc200`. Cases where both transforms run check both, in order. The drift site
publishes in 704 cases, the explosion site in 544.
- The VU rule from the earlier weapon increments applies. Only the static's forward
W at `0x4fc20c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 714,
real libm errno cases 820 → 862). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 134,144 generated sequences / 6,368 whole-memory
comparisons. Historical forward ABI coverage is 9,472 / 592; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `bb68515`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. Neither blimp death return runs on these routes, so
both are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 58.5 ms of silence in one-player, 53.4 ms in four-player and 36.9 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. A blimp destroyed in actual play, full campaign and physical
controller/hardware acceptance remain open.
+107
View File
@@ -0,0 +1,107 @@
# Native BlowDebris forward transforms
[The last three persistent-field sites](NATIVE_PERSISTENT_FORWARD.md) complete the forward coverage.
The six `DebrisStuff::BlowDebris` forward returns use native XYZ arithmetic after the
[HUD laser batch](NATIVE_HUD_LASER_FORWARD.md). Known forward coverage grows from 260
to 266 of 269 returns (3 remain). Known inverse coverage stays 134 of 134; BozoEngine
stays at `4a8f70a`.
`DebrisStuff::BlowDebris` (`120480`) blows an object apart. The debris table at `s7`
has `0xb20` bytes per entry, and each piece's velocity sits at `+120 + 16k`. The
piece type (`*hierhead & 0x3f`) selects the branch:
| Return PC | Output | Producer and consumer |
| --- | --- | --- |
| `120788` | frame `+10` | Type 3: the piece's offset (hierhead `+10`) goes through the blast matrix at frame `+30`. Its X, Y, Z are added as scalars to a position into the piece's hierarchy node `+10`, then aimed (`mathfRotationFromVector`) |
| `120838` | velocity (persistent) | Type 3: a random spin vector in frame `+10` goes through the matrix into the piece's velocity |
| `1208dc` | frame `+10` | Type 4: like `120788`, in place |
| `1209a0` | velocity (persistent) | Type 4: like `120838` |
| `120b28` | velocity (persistent) | Other types: like `120838` |
| `120c3c` | frame `+20` | With a push requested: the push goes through the matrix; its X and Y are added to the velocity |
No code reads these outputs' W:
- **Frame outputs:** read as scalars X/Y/Z and by `mathfRotationFromVector` (XYZ).
The owner never loads frame `+1c` or `+2c`.
- **Debris velocity:** the debris init (`120228`, `120350`) and `Debris::Update`
(`120e20`) read and write only `+120/+124/+128`. Every other `+12c` load in the
generated code is an unrelated integer field or a stack slot.
The owner reads no VU registers, accumulator or flags. `1208dc` is in place, so the
input is read whole before the output is written. The existing native helper computes
separately rounded XYZ, preserves destination W and leaves VU state untouched.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/blow-debris-forward`, against parent `c6d7787`
(PR #90). Parent headless/window binaries are preserved there and match PR #90's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
kinds 365 to 370). They are helper-boundary continuations and entries at the
call-return label before each transform (`120774`, `12080c`, `1208c8`, `120974`,
`120aec`, `120c2c`), across four rounding modes, FTZ/DAZ, RAM aliases,
identity/quarter-turn bases and arbitrary W payloads.
- These outputs are not consumed by `mathfAddVector`. At each run's stop, the
harness therefore reads the pending transform's output back from its own
destination, untouched since, and records it with a zero base. The stops are
`mathfRotationFromVector`, `mathfCopyVector`, `mathfRPHFromMatrix` and
`mathfRand`.
- Every basis is fixture-known, so every site is checked against an independent
identity or quarter-turn result. Published values are asserted exactly against the
original FPU arithmetic: the hierarchy node position (`120788`, `1208dc`) and the
velocity after the push (`120c3c`). Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward W (frame
`+1c`, `+2c` or the velocity's `+12c`) is normalized for test comparison, after
every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 707 → 709,
real libm errno cases 859 → 819). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 189,952 generated sequences / 9,856 whole-memory
comparisons. Historical forward ABI coverage is 16,448 / 1,028; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Strict/default recordings and snapshots are byte exact; strict comparisons
report no mismatch. Four returns are live on the one-player route: `120788` and
`120838` run natively 7 times each, `1208dc` and `1209a0` 34 times each.
`120b28` and `120c3c` are cold on these routes and are qualified by the generated
owner suite above.
**One recorded difference, proven to be a dead W slot.** This applies the rule
accepted for the [machine-gun increment](NATIVE_MACHINE_GUN_FORWARD.md). Against
parent `c6d7787`, the four-player recording matches on every field. The one-player
recording matches on every field except the end-of-frame RAM hash. That hash differs
on 309 frames (6,899 to 7,207, then matches again), and the sampled RAM image
differs in the same single word.
- A RAM dump right after frame 6,899 shows exactly one differing word, `0x8fefdc`:
the parent has `00000000`, the native build `42700000`.
- A temporary logging build showed `1208dc`'s output at `0x8fefd0` (`sp =
0x8fefc0`), so the word is that transform's dead frame `+1c` W slot.
- The same temporary build wrote a NaN pattern into the W of every BlowDebris
output, including the persistent debris velocities. Over the full one-player
route only the RAM hash differed from the parent: calls, draws, sound, thread
state, EE timing and every count matched.
The experiment was not committed; the qualified binary was restored afterwards and
matches the recorded hash.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 55.8 ms of silence in one-player, 26.2 ms in four-player and 15.0 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Full campaign and physical controller/hardware acceptance remain open.
+76
View File
@@ -0,0 +1,76 @@
# Native FinalBoss movement forward transforms
[Launcher special-weapon forwards, first batch](NATIVE_SPECIAL_GUNS_FORWARD.md) follow with five UpdateSpecial sites.
Two FinalBoss movement forward returns use native XYZ arithmetic after the
[FinalBoss gun-shot forwards](NATIVE_BOSS_SHOTS_FORWARD.md). Known forward coverage
grows from 194 to 196 of 269 returns (73 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `111788` | `FinalBoss::UpdateTrans` (`111550`) | The boss velocity at `+50` (its Y just smoothed toward the forward speed) through the boss's own basis at `+a0` into frame `+0`, added to its coordinate-system position; the boss is then reparented in the grid |
| `111cc4` | `FinalBoss::UpdateDeath` (`111c50`) | The same velocity after the death roll rebuilds the coordinate-system matrix, added to the position, then probed with `hdHatTest` |
Both results are the frame vector at `+0`. It is read only by `mathfAddVector`.
`hdHatTest` receives the same slot only as an output, which it writes with
`mathfCopyVector`/`mathfSetFVector`. Frame `+0c` is never read. Neither owner reads
VU registers, the accumulator or flags. The existing native helper computes
separately rounded XYZ, preserves destination W and leaves VU state untouched.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
The third non-shot boss site, `FinalBoss::CheckCollision` (`11201c`), hands its
point to `hdPntSphereTest`. It stays with the deferred collision-system group
(Ferris wheel and RockHD).
## Generated comparisons
Evidence is under `D:/BozoScratch/boss-move-forward`, against parent `75e7827`
(PR #75). Parent headless/window binaries are preserved there and match PR #75's
qualified build. Generated bodies, retail data and runtime recordings
stay outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 299 and 300): helper-boundary continuations and owner entries, across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- `UpdateTrans` entries start after the forward-speed smoothing, at the label where
its result is stored into the velocity, and vary that speed's sign.
- `UpdateDeath` entries start after the death roll's `mathfRotMatrixRPH`.
- Each runs the transform and the position update. They stop at
`hdReparentCsGrid` (`UpdateTrans`) or `hdHatTest` (`UpdateDeath`); reaching it is
asserted.
- The boss basis is fixture-known, so every case is checked against an independent
identity or quarter-turn result. The new position is asserted exactly against the
original FPU addition. Each site publishes in 512 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 701,
real libm errno cases 859 → 830). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 154,112 generated sequences / 7,616 whole-memory
comparisons. Historical forward ABI coverage is 11,968 / 748; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `75e7827`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. Neither boss movement return runs on these routes, so both are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 57.7 ms of silence in one-player, 925.2 ms in four-player and 24.1 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The qualification four-player window run logged 925.2 ms of silence. Two back-to-back full reruns of that route gave 31.9 ms (new build) and 22.8 ms (parent), so this was machine load, not this change. The boss fight in actual play, full campaign and physical controller/hardware acceptance remain open.
+91
View File
@@ -0,0 +1,91 @@
# Native FinalBoss gun-shot forward transforms
[FinalBoss movement forwards](NATIVE_BOSS_MOVE_FORWARD.md) follow with the boss's two movement sites.
Twelve FinalBoss forward returns use native XYZ arithmetic after the
[particle arc forwards](NATIVE_PARTICLE_ARCS_FORWARD.md). Known forward coverage
grows from 182 to 194 of 269 returns (75 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
All twelve are in `FinalBoss::UpdateBoss` (`10f7c0`) and end a gun shot the same
way. A muzzle offset goes through the boss's coordinate system into the frame
vector at `+10`, and `mathfAddVector` adds the boss position. Some states then aim
at the target with `mathfRotationFromPointToPoint`. With shots enabled
(`gp-4538`), `Weapons::CreateStaticWeapon` is called with that frame vector as the
shot origin.
| Return PCs | Muzzle offset |
| --- | --- |
| `110114`, `110880` | The game's table at `235070` |
| `1101b0`, `11091c`, `110d9c` | The game's table at `235090` |
| `10febc`, `1103e4`, `1104e4`, `110a0c`, `110adc`, `110e8c`, `110f74` | A vector just built with `mathfSetFVector` |
The frame vector is read only by `mathfAddVector`, by `CreateStaticWeapon`, and,
with shots disabled, by `playHelicopterMachineGunSound`. Two earlier increments
cover these: the environment-gun increment showed that `CreateStaticWeapon` reads
only X/Y/Z, and the sound helper passes the point only to `calcDualMonoMixVolPan`,
which the [sinking blimp increment](NATIVE_BLIMP_DEATH_FORWARD.md) showed reads only
X/Y/Z.
Frame `+1c` is never read. The owner reads no VU registers, accumulator or flags.
The existing native helper computes separately rounded XYZ, preserves destination
W and leaves VU state untouched. It reads its input before writing, so the in-place
transforms are safe. Unknown and historical callers keep the original ABI. No
engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/boss-shots-forward`, against parent `1f22318`
(PR #74). Parent headless/window binaries are preserved there and match PR #74's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 6,144 generated sequences / 384 whole-memory comparisons
(caller kinds 287 to 298): helper-boundary continuations and owner entries,
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases
and arbitrary W payloads.
- The attack states pick their shots through random rolls and timers, so owner
entries start at the call-return label just before each shot. The frame is set
as the owner's prologue leaves it, as in the boss fixtures that test the inverse
transforms. Each entry is one of:
- right after the offset's `mathfSetFVector`;
- after the roll that gates the shot, entered with roll result 0;
- after the burst-interval check, entered with remainder 0.
From there each entry runs the transform, the position addition, any aiming, and
the call to `CreateStaticWeapon`, where the fixture stops; reaching it is
asserted.
- The boss basis is fixture-known in every case, so every output is checked against
an independent identity or quarter-turn result.
- The shot origin is asserted exactly against the original FPU addition, both in
the frame and as the origin `CreateStaticWeapon` receives. Each site publishes in
512 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+1c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 704 → 709,
real libm errno cases 838 → 859). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 153,088 generated sequences / 7,552 whole-memory
comparisons. Historical forward ABI coverage is 11,840 / 740; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `1f22318`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. None of the twelve boss returns runs on these routes, so they are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 52.0 ms of silence in one-player, 501.9 ms in four-player and 19.4 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. In the qualification four-player window run, the frame-1,000 capture was black and the run logged 501.9 ms of silence, from a stall early in the intro. Two back-to-back short reruns (new build, then parent) captured frames 900 to 1,100. Both show the intro at frame 1,000 and about 20 ms of silence each, so the stall was the machine, not this change. The boss fight in actual play, full campaign and physical controller/hardware acceptance remain open.
+93
View File
@@ -0,0 +1,93 @@
# Native BSP point and segment-crossing transforms
Thirteen further hierarchy returns use the existing native record calculations. Seven inverse
and six forward additions bring both allowlists to thirty-three entries. This extends the
[query/lighting increment](NATIVE_HIERARCHY_QUERY_RESULTS.md). BozoEngine remains pinned at
`4a8f70a`; no shared engine or renderer change is included.
| Helper | Return PCs | Owner |
|---|---|---|
| Inverse `1da1e8` | `1cdf80`, `1ce028`, `1ce220` | BSP point setup and normalization `1cdeb8` |
| Inverse `1da1e8` | `1ce644`, `1ce674` | Both-endpoints-outside crossing `1ce588` |
| Inverse `1da1e8` | `1ce7b4` | Start-outside crossing `1ce738` |
| Inverse `1da1e8` | `1cea40` | End-outside crossing `1ce958` |
| Forward `1da298` | `1cdf40`, `1cdfe4`, `1ce1cc` | BSP point setup `1cdeb8` |
| Forward `1da298` | `1ce37c`, `1ce3a4` | BSP point-result publication `1cdeb8` |
| Forward `1da298` | `1cdd3c` | BSP segment-result publication `1cd538` |
The player leaves snapshot operands before overlapping writes, retain separately rounded XYZ
arithmetic, and leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW
matches the original, including basis[0].W; forward XYZ matches while destination W is preserved.
Scalar normalization, axis tests, averages, crossing-point emission, duplicate/capacity guards,
packed result fields, clocks/checkpoints and query traversal remain compiled game code.
Historical hosts and unaudited callers retain their complete original helper ABI. Other helper
returns and inline VU operations remain; this is not complete VU removal.
## Numerical and generated-consumer checks
Local evidence is under `D:/BozoScratch/hierarchy-bsp-crossings`, against main `b3d03f6` (PR #27).
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
- The consumer harness grows from 12,288 to 18,944 generated sequences and from 384 to 592
complete-memory comparisons (6,656 / 208 added). Four host FP modes, denormal controls, RAM
aliases and arbitrary W payloads are covered. CPU outside retired VU, complete outgoing host
FP effects, clocks/checkpoints and other memory must match; native VU must be untouched.
- Original forward W and VU effects remain live throughout the real consumer sequences. Only
final unused forward-output W fields are normalized afterward. A full inverse write can reuse
that same record and replace opaque W with meaningful basis[0].W: the reference harness now
removes the earlier forward-W exclusion at that write, so the later inverse W is compared
exactly. No production arithmetic or W contract was changed for this fixture correction.
- BSP setup sequences retain their real point-mode, zero/copy, short-normalization and unit-box
decisions, then stop at the following segment-query dispatch. Exact/adjacent unit-axis values
are included. Point-result publication runs through packed material/flag fields and return;
the segment-result tail stops at its next point-loop boundary after scalar result addition.
- Both/start/end-outside sequences run through the actual generated point emitter and return,
including axis classifications, averaging, duplicate flags and counts 0, 48 and 49 at the
50-point capacity boundary. Start/end cases include exact/adjacent positive and negative
five-unit representations. These are helper-consumer tails, not complete query-root coverage.
- Historical forward checks grow to 1,536 cases / 96 complete-memory comparisons (384 / 24 added).
Historical inverse checks cover all thirty-three returns: 2,112 cases / 33 complete-memory checks.
The hierarchy suite retains 786,432 helper comparisons, 384 complete-memory checks, 8,000 geometric
edges, 1,024 recursive BSP callers / 32 complete-memory checks and 2,048 unknown-caller ABI cases.
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks and 2,048
unknown-caller ABI cases, including overlap, alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python
tooling tests pass.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Every
non-RAM frame-record field matches the baseline throughout: scratchpad, calls/counts, draws/counts,
sound/sample counts, thread state and EE clock. The entire four-player recording is also
byte-identical to the baseline, including every RAM frame. Strict contact, hierarchy, math and
projection checks pass; strict/default recordings and snapshots are identical for both routes.
Defaults perform zero original comparisons and zero VU0 microprogram calls.
The six new forward returns execute 23,889 / 0 times in one-player / four-player. The seven new
inverse returns execute 24,255 / 2 times. All thirteen sites run in one-player; four-player reaches
only `hdStartOut` and `hdEndOut`, once each, with other sites covered by generated consumers/units.
The batch retires another 48,144 / 2 original helper executions. These are counts, not timing or
FPS measurements.
One-player RAM hashes differ on 3,906 frames (5594 through 9499). A complete 32 MB snapshot at
frame 7000 differs by two bytes in one stack word, `8fedfc`: baseline zero versus native 1.0.
Paired baseline/native observers identify forwards `1cdf40` and `1cdfe4`, whose output temporary
is SP+`20` with unused W at SP+`2c`. The original stores inherited VF16.W (including transient
values); native preserves the existing 1.0. Diagnostic snapshots reproduce the qualified
baseline/native snapshots exactly. The following inverse consumes XYZ; its own later output W
is meaningful and checked exactly, as described above. The four-player frame-6000 snapshot is
baseline-identical. This is bounded snapshot/consumer evidence, not a classification of every
possible RAM difference or campaign consumer.
Temporary observers were removed, restored sources were forced to rebuild, and the native math
object matches its qualified hash. All three executables contain no observer marker; all eleven
native suites pass again. No new hash mask, padding restoration or shadow VU state is shipped.
Clean post-diagnostic default replays reproduce both complete qualified recordings and snapshots
byte-for-byte.
Fresh window runs complete 4,201 game frames for movies/menus and 6,501 each for one-player and
actual four-player. Reviewed captures show decoded movie pictures, Junkyard loading and active
rainy combat, and four advancing snow-arena views. Device logs report 27.4 / 50.9 / 175.3 ms of
silence (movie / one-player / four-player), with underruns and dropped audio frames. Deterministic
sound records match. Full campaign acceptance, flawless device audio and console visual parity
remain unclaimed.
+73
View File
@@ -0,0 +1,73 @@
# Native BSP and vehicle inverse directions
Four more `mathfMulVec` (`1da1e8`) returns use native record calculations: BSP collision setup
`1cd658`, `1cda84`, `1cdae8`, and vehicle collision-point offset `1170fc`. This extends the audited
inverse allowlist from eleven to fifteen entries. The existing inverse implementation snapshots its
inputs, preserves separate rounding, and writes all four output components, including basis[0].W.
The player leaf leaves VU registers, accumulator, flags and data memory untouched. Historical-host
and unknown-caller paths retain the original complete ABI. BozoEngine remains pinned at `4a8f70a`.
Together with the preceding forward-direction replacements, these BSP and vehicle setup sequences
now execute both transforms without VU context state. The surrounding scalar collision traversal,
terrain calculations and other inline VU operations still execute. This is not complete VU removal.
## Numerical and caller checks
Evidence is local under `D:/BozoScratch/bsp-inverses`, against main `4a65a8b` (PR #22).
Generated game code, disc data, captures and RAM dumps are not committed.
- The hierarchy suite passes 786,432 helper cases, rotating through all fifteen inverse sites;
384 complete flat-memory checks, 8,000 geometric edges, 1,024 recursive BSP caller cases
(32 complete-memory checks), and 2,048 unknown-caller ABI cases remain passing. Another 960
historical-host inverse cases (15 complete-memory checks) compare the full CPU/VU ABI and memory.
- The actual generated BSP continuations pass 1,536 paired forward/inverse cases and 48 full-memory
comparisons. Another 2,048 vehicle/light continuation cases and 64 full-memory comparisons cover
collision-point setup, tire loops/clamps and light normalization/attenuation. Both sets now require
the complete initial VU state to remain untouched. Inverse output W is compared exactly; only the
previously established forward-direction destination-W boundary is excluded.
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks, arbitrary input
bits, four host FP modes, denormal controls, overlap, RAM aliases, low address bits and scratchpad.
- A further 512 generated body-contact consumer cases (16 full-memory checks) vary position.W
independently through the actual XYZ subtraction, stopping at its next dot-product call. CPU,
VU, clocks/checkpoints, complete host FP effects and other memory must remain identical. This
proves that consumer boundary; it does not claim coverage of every possible contact consumer.
- Player, headless and historical checker builds, all ten native suites, and twelve Python tests pass.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. The new
sites retire another 653,080 / 60,768 original inverse-helper executions, respectively. The three
BSP returns execute in the one-player route; four-player exercises the vehicle return. Total native
inverse counts are 712,794 / 62,880. These counts are not a timing or FPS measurement.
Every non-RAM frame-record field matches the baseline throughout both routes: scratchpad, calls,
draws, sound, thread state, EE clock, and associated counts. Four-player RAM also matches throughout.
Default runs make zero original comparisons and zero VU0 microprogram calls. Strict math, hierarchy
and projection checks pass and reproduce each default recording byte-for-byte.
The one-player RAM hash differs on 3,781 frames, beginning at frame 5595. The complete 32 MB snapshot
at frame 7000 differs by six bytes in three words: `25e06c`, `263a6c`, `26946c`, each changing from
zero to `42700000` (60.0). These are position.W in the first 0x40-byte vehicle contact result at
Vehicle+`b10`, not position XYZ, radius, a matrix coefficient or a native inverse output mismatch.
The four-player frame-6000 snapshot is byte-for-byte identical.
Temporary local generated-store tracing identifies the copy at `hdTerrain` `1cc904`: it copies Z/W
from its temporary result into each contact record. The preceding inline transform at `1cc828`-
`1cc838` calculates XYZ into VF16 and stores its inherited W in the terrain query point at `5253b0`.
`terrainGetHAT` carries that W through its position copy (`1efb38`/`1efb3c` on the flat path), then
`hdTerrain` copies the result into the vehicle record. Retiring the inverse helper changes the old
VF16 residue. `collisCheckBodyResult` reads position through XYZ-only `mathfSubVector` (return
`118204`); the varied-W fixture above checks that boundary. The traced snapshot matches the ordinary
native run. All temporary generated instrumentation was restored byte-for-byte before the final
build. No RAM-hash mask, padding restoration or shadow VU state is added.
Windowed runs complete 4,201 movie/menu frames and 6,501 frames each of one-player and four-player.
Reviewed captures show the decoded opening movie, level loading, rainy combat with targeting and
vehicle effects, and all four snow-arena views advancing with driving/firing. Device logs report
330.1 / 54.2 / 33.1 ms of silence (movie / one-player / four-player) and dropped audio frames;
deterministic sound records remain exact. Flawless device audio, full-campaign acceptance and console
visual parity are not claimed by these bounded tests.
The subsequent [terrain/contact increment](NATIVE_TERRAIN_CONTACTS.md) replaces the inline vector
blocks in terrain, node, point-contact and ray-result construction. Scalar algorithms and other
inverse callers still need their own consumer audits before being replaced.
+114
View File
@@ -0,0 +1,114 @@
# Native camera and rear-view transforms
Nine forward-transform returns now use native record calculations, extending the
[peel-out increment](NATIVE_PEEL_OUT.md). Forward coverage grows from 80 to 89
sites; inverse coverage stays at 89. BozoEngine remains pinned to `4a8f70a`.
| Return PC | Owner | Checked consumer boundary |
| --- | --- | --- |
| `1137cc` | `Camera::Update` | Position addition and flag clearing through height-query handoff |
| `11398c` | `Camera::Update` | Coordinate-system position publication and camera-mode gate |
| `113a78` | `Camera::Update` | Position addition, target/history records, scalar state and matrix publication |
| `113b28` | `Camera::Update` | Position addition through rotation-from-points handoff |
| `113c2c` | `Camera::Update` | Position addition, three-axis smoothing, history and matrix publication |
| `113f28` | `Camera::Update` | Target reconstruction, vehicle-relative difference, history and smoothing through LOS handoff |
| `1142d8`, `114394` | `Camera::Update` | Left/right collision-probe positions through LOS handoff |
| `1fdd3c` | `viewSetRearViewPos` | Global position/orientation publication and complete return |
The existing native helper snapshots its operands, computes separately rounded
XYZ and retains destination W. Historical hosts and unknown callers retain the
complete original ABI. Selection, smoothing, angles, collision queries and game
checkpoints remain compiled game code.
## Coupled inline position consumer
The `11398c` path also replaces four instructions at `11399c..1139a8` before
their VU loads, addition and store. XYZ comes directly from vehicle position and
transformed offset records. Original `VADD.xyz` retains `VF13.W`, loaded from the
third camera-basis column by the immediately preceding transform. The native
consumer publishes that basis record's W directly. All inputs are read before
publication, including an in-place position alias. No register shadow,
inter-call cache or VU reconstruction is introduced. Published XYZW is exact.
## Generated comparisons
Evidence is under `D:/BozoScratch/camera-transforms`, against main `00b7414`
(PR #41). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 4,608 generated producer/consumer sequences / 288 whole-memory
comparisons. Aggregate coverage is 76,288 / 2,752. Four host rounding modes,
denormal controls, RAM aliases, all four camera slots, aliased camera/vehicle
coordinate systems and arbitrary basis/output W payloads are covered.
- Each camera site has 256 helper-boundary cases and 256 cases entering preceding
generated setup, covering offsets, vehicle dimensions, desired positions and
smoothing/history updates. They stop at the real boundaries in the table;
no query result is stubbed. These are not complete camera-update entry tests.
- Rear-view has 256 helper-boundary cases and 256 actual function entries,
including non-primary-player early returns, both layout branches,
positive/negative distances and real rotation/sine/cosine producers. Rotation
inputs stay within half a radian; wider argument reduction is outside these fixtures.
- CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and final
memory agree. Forward-output W in offset/desired-target records is excluded
only after real consumers run. The coupled coordinate-system position's W
is compared exactly. Native leaves and the new inline
consumer leave VU state untouched.
- Complete rear-view entries retain the original rotation producer's
`mathfUnitMatrixAsm` VU effects. A test captures state at entry to the native
leaf and checks it remains unchanged through that leaf and the entire scalar
consumer. This does not replace the identity producer or claim whole-function
VU removal.
- Historical forward ABI coverage grows to 5,120 / 320 cases / whole-memory
checks; inverse stays at 5,696 / 89. Existing hierarchy coverage retains
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
- Player, headless runner, historical checker and all test targets build.
All eleven native suites and twelve Python tooling tests pass. The hierarchy
suite passes again with arbitrary published basis-W payloads.
## Replay qualification
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent, including raw RAM,
scratchpad, calls, draws, sound, threads, counts and EE clocks. Both sampled full
32 MiB RAM snapshots match exactly. Strict/default recording files and snapshots
are identical. No observer, RAM mask or VU-state restoration is needed.
| New return | One-player calls | Four-player calls |
| --- | ---: | ---: |
| `113a78` | 2 | 4 |
| `113f28` | 3,900 | 15,188 |
| `1142d8` | 3,900 | 15,188 |
| `114394` | 3,900 | 15,188 |
| `1fdd3c` | 3,902 | 3,798 |
| Total | 15,604 | 49,366 |
The other four camera sites, including the coupled inline consumer, are cold in
these routes and qualified by generated comparisons. Total native forward calls
become 1,157,512 / 352,070. Default routes make zero original-helper comparisons
and execute zero VU0 microprograms. Counts establish reach, not a measured speedup.
Fresh 6,500-frame one-player and actual four-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, with isolated scratch
user data. Reviewed captures show decoded movie action (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), combat/movement with targeting and
effects (one-player 5,500 / 6,300), and four advancing snow-arena views
(four-player 5,500 / 6,300). These are bounded functional checks, not pixel-exact
windowed or console parity.
Windowed one-player reaches `113a78` once, the three hot camera sites 1,708 times
each, and rear-view 1,709 times: 6,834 new native calls. Four-player reaches them
4 / 7,192 each / 1,799 times respectively: 23,379 new calls. The other four sites
remain cold; all nine are cold in the movie route.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
20.9 / 82.9 / 30.3 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound is exact; flawless device audio
and subjective listening are not claimed.
## Remaining scope
These two helper inventories now contain 89 native forward and 89 native inverse
sites. Outside their allowlists remain 180 forward and 45 inverse sites, 225 in
total across the game. This structural inventory excludes other helper families
and inline VU operations. Full campaign, all camera modes in live play and
console visual/audio parity remain separate work.
+82
View File
@@ -0,0 +1,82 @@
# Native older car and hierarchy particle transforms
Fourteen remaining forward-helper returns use native XYZ record calculations, extending the
[terrain-query increment](NATIVE_TERRAIN_QUERY_HELPERS.md). The forward allowlist grows from
52 to 66; the inverse list stays at 74. BozoEngine remains pinned to `4a8f70a`.
| Return PCs of forward helper `1da298` | Owner |
|---|---|
| `1c8f10`, `1c8f3c`, `1c8fd8`, `1c9000`, `1c908c`, `1c90b4`, `1c9140`, `1c9168`, `1c91f4`, `1c921c` | Older car-collision debug corner pairs `1c8db0` |
| `1c959c`, `1c96e8` | Older car-collision debug point/normal records `1c8db0` |
| `1d4514`, `1d4560` | Initialized/new hierarchy particle-node positions `1d4498` |
The existing native leaf captures operands before overlapping writes, computes separately
rounded XYZ and preserves destination W without VU registers, accumulator, flags or data memory.
Historical hosts and unknown callers keep the complete original ABI. Collision queries, scalar
world-coordinate addition, debug-line record construction, view lookup, FX dispatch and game
checkpoints remain compiled game code.
## Generated consumer and numerical checks
Local evidence is under `D:/BozoScratch/hierarchy-car-particles`, against main `571020e` (PR #33).
Generated game code, retail assets, recordings, snapshots and captures are excluded from Git.
- Consumer coverage grows from 49,664 to 56,832 sequences and from 1,552 to 1,776 whole-memory
checks: 7,168 / 224 added. Four host rounding modes, denormal controls, RAM aliases and
arbitrary temporary W payloads remain covered. CPU outside retired VU, outgoing host FP
effects, clocks/checkpoints and other memory match; native VU is untouched.
- Each car corner pair runs the real generated transforms and scalar world sums, selects
either debug colour branch, then executes `terrainDrawLine` through actual `drawLines`
dispatch. Its real producer reads endpoint XYZ and explicitly writes W=1 for both vertices.
Colour RGBA, including meaningful alpha, is copied independently and compared exactly.
- The two later car returns run their transformed-point world sums and the same actual
debug-line producer through `drawLines` dispatch. Rendering beyond that dispatch remains
outside these bounded fixtures; no debug-GPU parity is claimed.
- The fixture now initializes, restores and compares the real debug records at
`7484f0`–`7485bf`, in addition to the existing stack/data/global regions. All older cases
rerun with that comparison; complete flat-memory checks remain too.
- Initialized particle nodes run the real view-index lookup and scalar XYZ sum through return.
New nodes run view lookup and in-place world-position addition through modeled-FX creation
dispatch. The complete FX allocator/emitter lifecycle is outside this fixture.
- Forward W is excluded only after the real scalar consumers have run. The debug producer's
complete XYZW records and all other writes remain exact; no production W repair is added.
- Historical forward coverage grows from 2,752 / 172 to 3,648 / 228 cases / whole-memory checks.
Historical inverse coverage stays at 4,736 / 74. The hierarchy suite retains 786,432 helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP callers / 32
whole-memory and 2,048 unknown-caller ABI cases. The math suite retains 1,048,576 helper cases
/ 512 whole-memory and 2,048 unknown-caller ABI cases.
- Player, headless and historical-checker builds and twelve Python tooling tests pass. Every
native test target was rebuilt/relinked against the current library; all eleven suites pass.
## Gameplay, loading and movies
Default and strict runs complete 9,500 one-player and 8,500 actual four-player frames.
Each complete default recording is byte-identical to the preceding main, including RAM,
scratchpad, library calls/counts, draws/counts, sound/sample counts, threads and EE clock.
The full 32 MB snapshots at one-player frame 7000 and four-player frame 6000 are also exact.
Strict contact, hierarchy, math and projection checks pass; their recordings and snapshots
match the default runs byte-for-byte. Default runs perform zero original comparisons and
zero VU0 microprogram calls. Strict diagnostic runs intentionally execute original oracles.
Optional forward-call tracing records 1,191,280 / 381,308 total helper calls in one-player /
four-player, with zero calls to any of the fourteen new returns in both default and strict
runs. These paths have generated-consumer, numerical and historical-ABI coverage, without
live-route reach. This batch does not claim retired gameplay executions or a measured speedup.
Fresh windowed runs complete the configured 4,200-frame movie/menu and 6,500-frame one-player
and actual four-player routes through clean exit, using isolated scratch user data. Reviewed
captures show decoded movie pictures, Junkyard loading, active one-player gameplay and four
advancing snow-arena views. Device logs report 31.0 / 31.6 / 7.5 ms of silence (movie /
one-player / four-player), with underruns and dropped frames; deterministic sound remains exact.
Flawless device audio, full campaign and console visual parity remain unclaimed.
## Remaining scope
The structural two-helper inventory is now 66 native forward and 74 native inverse sites,
with 203 / 60 sites outside their allowlists, 263 in total. This includes code inside otherwise
replaced functions; it is not a live cost measurement and excludes other helpers/inline VU.
The narrow hierarchy/collision owner range `1c0000`–`1dffff` and terrain range `1ef000`–`1f5fff`
now have no remaining forward sites for this helper. Eight inverses remain there: six terrain
debug-drawing calls and terrain modify/wave setup. This is not complete VU removal, full campaign
acceptance or console visual parity.
+86
View File
@@ -0,0 +1,86 @@
# Native vehicle collision and drift inverses
Sixteen inverse-transform returns now use native record arithmetic, extending the
[weapon/skid increment](NATIVE_WEAPON_SKID_TRANSFORMS.md). Inverse coverage grows
from 89 to 105 sites; forward coverage stays at 95. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Consumer |
| --- | --- | --- |
| `1161f4`, `116618` | `collisSetupHitPoints` | Local axis selection and hit-point records |
| `119090`, `11927c` | `collisAverageEnvironmentCollisions` | Hit location and slope response |
| `11985c`, `119870`, `119e64` | `collisReflectOffCollision` | Reflection decisions and local velocity |
| `11afb0`, `11b018` | `collisCalcCar2CarForces` | Local force scaling and force decisions |
| `11b9a8` | `collisSetCar2CarFlags` | Local velocity publication before hit dispatch |
| `11c38c`, `11c3c0` | `collisCar2CarMorph` | Velocity and normalized hit location |
| `11c540` | `collisCheckDrivableSlopeHit` | Slope accumulation and wheel response |
| `1ab558`, `1ab8f4`, `1abad4` | `vehicleUpdateDrift` | Drift exit, direction checks and velocity publication |
The existing inverse snapshots three basis columns and the input, calculates
separately rounded XYZ, and copies the first basis column's W as meaningful data.
All four result components remain exact. Native calls do not touch VU registers,
accumulator, flags or data memory. Unknown callers and historical hosts keep the
complete original ABI. Collision dispatch, force application, orientation/matrix
producers and tire-plane updates remain generated game code.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/collision-drift-inverses`, against main `a2905f2`
(PR #44). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 8,192 sequences / 512 whole-memory comparisons. Aggregate
coverage is 87,552 / 3,456. Four host rounding modes, denormal controls and
cached/uncached RAM aliases and arbitrary basis W payloads are covered.
- Each return has 256 inverse-boundary cases and 256 generated producer cases.
Producers comprise 3,712 bounded call-argument sequences and 384 complete
drift entries (128 exiting drift and 256 inactive drift).
- All sixteen sites have explicit original/native call counts and native leaf
VU-preservation assertions. CPU outside retired VU, outgoing host FP effects,
checkpoints, call counts and final memory agree. No new W exclusions are used.
- Ten tails run through their real return: averaged hit location, slope response,
reflected velocity, second car-force result, both morph inverses, drivable
slope and all three drift returns. Active drift direction fixtures continue
through slowdown and the final velocity inverse with tire-plane updates gated
off. Complete drift entries cover the speed threshold's reset/retain branches.
- Six tails have explicit boundaries: hit-point setup stops before its subsequent
forward-transform loop; the first two reflection decisions stop before the
displacement subtraction; the first car-force result is scaled and normalized
before the second matrix-from-normal producer; collision flags stop at hit-info
initialization after velocity publication. These fixtures do not claim full
collision dispatch, force application or all orientation/tire update paths.
- Historical inverse ABI coverage grows to 6,720 / 105 cases / whole-memory
checks. Forward remains 5,504 / 344. Existing hierarchy coverage retains
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical too. Strict/default recording files and snapshots are byte exact;
strict result comparisons report no mismatch. New native inverse calls total
34,927 in 1P and 15,194 in 4P. Return `11927c` remains cold in these replays and is
qualified by its reached generated-code fixture.
Fresh windowed checks use isolated user folders and complete 6,500 one-player,
6,500 four-player and 4,200 movie frames. Captures show level loading followed
by moving gameplay, four simultaneous views, driving/firing/effects, decoded
intro images and return to the menu. Each route has five distinct captures.
The new inverse calls total 16,872 / 7,202 in windowed 1P / 4P; movies make none.
Stereo 48 kHz WAV captures contain nonzero audio on all routes. Device underruns
remain: 53.4 ms silence in 1P, 25.4 ms in 4P and 270.5 ms in movies. The movie
run overlapped functional checks; this is not a clean timing comparison or a
claim of flawless device playback. Mixer records in the paired headless runs
remain exact. Full campaign, every collision dispatch path and physical
controller/hardware acceptance are outside this increment.
## Remaining scope
The current generated source contains 134 inverse-helper returns and 269 forward
returns. Of these two families, 29 inverse and 174 forward sites remain outside
the native allowlists: 203 total. This is a call-site inventory, not a count of
all remaining emulation. Rigid-body inverses, AI, driver/boss helpers, HUD/radar,
rollover, damage, lighting and additional inline arithmetic remain separate work.
+119
View File
@@ -0,0 +1,119 @@
# Native vehicle-collision forward transforms
Six vehicle-collision forward returns use native XYZ record arithmetic after the
[driver forward increment](NATIVE_DRIVER_FORWARD.md). Coverage grows from 113
to 119 of 269 known forward returns (150 remain). Known inverse coverage stays
134 of 134. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `11ad1c`, `11ada0` | `collisCar2CarCollision` | Vehicle velocity/speed reconstruction, real relative-mass and coupled force calculation, through the effects-dispatch boundary |
| `11b26c` | `collisApplyForce` | Complete velocity update, normalization, speed, matrix, rotation and state-flag publication |
| `11bba8`, `11bbe8` | `collisSetCar2CarFlags` | Heading/angle producer prefix, impact-offset selection, translated take-hit point publication and damage staging before hit dispatch |
| `11c368` | `collisCar2CarMorph` | Complete velocity difference, meaningful inverses, scaled hit position and hit-location/state publication |
Native arithmetic retains separately rounded XYZ, destination W and untouched VU
registers, accumulator, flags and data memory. The original scalar collision,
mass, force, rotation, angle and hit-location logic remains. Unknown/historical
callers keep the original ABI. No engine or collision tuning is changed.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/contact-forward`, against immediate parent
`555f9b3` (PR #52 plus its UTF-8 documentation correction, PR #53). Generated
bodies, retail data and runtime artifacts stay outside Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
Each return has 256 helper-boundary sequences through its actual consumers and
256 producer-entry sequences in four rounding modes, with FTZ/DAZ, RAM aliases,
rotated bases, zero/tiny/signed vectors and opaque basis/destination W payloads.
- Collision producer entries start at the actual owner entry and retain the
velocity-reconstruction type/enable gates, signed speed bookkeeping, actual
relative masses, both inverse projections and both coupled force applications.
Controlled fixture thresholds enable the force paths. They stop at `11b2e8`,
before the separate angles/effects owner. Effects, later collision flags and
hit clearing are not claimed as complete-owner coverage by these fixtures.
- Force entries complete the real owner, including retained/scaled velocity,
transformed force addition, normalization and mass-divided speed, matrix and
Euler rotation publication, and the state flag. Known entries require exact
velocities with identity and rotated bases.
- Impact producer prefixes start at `11ba50`, after unrelated early collision,
take-hit allocation and state work. They retain actual heading/trigonometry,
bounded-angle and directional-offset selection, type/enable gates, coordinate
translation, take-hit point pointer publication and scalar damage staging.
They stop at `142d98`, before dispatching damage/effects. Boundary cases run the
same real tails. Known prefixes require exact translated front/right points;
additional prefixes select rear/left offsets. Dispatch is not stubbed or skipped.
- Morph entries complete the real owner: forward velocity, subtraction, both
existing inverse leaves, sign/scaling branches and real hit classification.
Published location/state fields must agree, including meaningful first-basis W
in the vehicle inverse record and reused stack record.
- Original zero-vector rotation paths execute real libm domain handling. Fixtures
seed retail `_LIB_VERSION=1` (verified in the local ELF) and valid errno storage;
actual errno writes and FP effects are compared (828 sequences reach errno).
No libm/helper result is stubbed.
- Explicit per-return, relative-mass/force, normalization/matrix/rotation,
heading/angle and hit-location counts are required. Known-state publication
assertions cover 64 reconstructed velocities, 32 force updates, 64 impact
points and 256 complete morph locations. Native VU remains untouched through
the actual scalar producers and consumers.
- Forward W exclusions are restricted to reconstructed `Vehicle+1ec`, the real
nested force frame's `SP+1c`, direct force frame `SP+1c`, or impact scratch
`SP+1c`. Exact output counts/addresses account for actual frame sizes and reuse
of the nested force frame. Reference W stays intact through all real consumers
before comparison-only normalization. Morph inverse overwrites remove the
forward-W exclusion and compare full XYZW. No runtime RAM mask or VU-bank
reconstruction is introduced.
- Aggregate coverage is 114,688 generated caller sequences / 5,152 whole-memory
checks. Historical forward ABI coverage is 7,040 / 440; inverse stays 8,576 /
134. Existing hierarchy/BSP/edge/unknown-ABI coverage and earlier AI,
vehicle/light, final inverse and driver publication assertions remain enabled.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass; all earlier
publication assertions remain enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Draws, sound, scratchpad, calls, threads and EE timing/counts match the
parent in every frame. Four-player raw RAM hashes also match throughout. Both
sampled 32 MiB RAM images are exact. Strict/default recording files and snapshots
are byte exact, with no strict mismatch.
One-player has seven raw RAM-hash differences, at frames 5929, 6497, 6503-6506
and 8823. Isolated parent/native diagnostic executables retain the production
objects and substitute only the parent/native math object and identical diagnostic
frame-end observation. Their complete recordings match the corresponding
qualification recordings. Exact frame-end snapshots and direct call traces prove:
- Every affected snapshot differs only at `8ff2ac`: original zero, native `8ff270`.
Neighboring captured frames have no other differences.
- Matching calls to `11b26c` have real force `SP=8ff290`, input at SP and output at
`SP+10=8ff2a0`. Both enter with `W=8ff270`; the original writes zero, while
native code retains that exact prior value.
- The complete real force owner consumes only output XYZ in its velocity addition,
then uses normalized XYZ for speed/matrix/rotation and returns. Its local output
record is no longer live after that return. The surviving bytes are stack W
residue, not a physics/driver result. Existing meaningful inverse W stays exact.
- Production binaries and raw recordings are unchanged. No runtime RAM mask,
recorded-hash normalization or VU-state reconstruction is used. The exception
is documented explicitly rather than calling all one-player RAM hashes exact.
Default one-player reaches force `11b26c` 45 times and morph `11c368` 166 times;
velocity-reconstruction and impact-offset sites are cold on that route.
Four-player makes no calls to the six new sites. Fixtures qualify the cold paths
within the complete/bounded consumer scopes stated above.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
AI activity, vehicle rollover, simultaneous four-view driving/effects, decoded
intro footage and return to the menu. Each route has five distinct captures.
Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
Windowed one-player reaches the two velocity-reconstruction returns 14/8 times,
force 53 times and morph 178 times. Impact offsets remain cold. Four-player and
movies make no calls to these six sites. Device underruns remain: 46.9 ms silence
in 1P, 30.6 ms in 4P and 16.8 ms in movies. These are functional checks, not a
timing or flawless-playback claim. Full campaign, every collision/effects path
and physical-controller/hardware acceptance remain outside this increment.
+87
View File
@@ -0,0 +1,87 @@
# Native combo-launch forward transforms
[Zoomies and HalTrans weapon forwards](NATIVE_ZOOMIES_HAL_FORWARD.md) follow with four more weapon sites.
Five combo forward returns use native XYZ arithmetic after the
[tire-pair correction forwards](NATIVE_TIRE_ROTATION_FORWARD.md). Known forward
coverage grows from 169 to 174 of 269 returns (95 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
All five are in `Vehicle::vehicleCheckForCombos` (`1af4c0`). Each places the launch
point for a special triggered by a button combo:
| Return PC | Combo | Producer |
| --- | --- | --- |
| `1af700` | `1` | After `Launcher::GetLockOn`: offset `(0,8,2)` through the vehicle's coordinate-system basis, in place |
| `1af790` | `0x10304` | After `GetLockOn`: offset `(0,12,5)`, the same way (`+2270` is set for the first of its four `CreateWeapon` calls) |
| `1af890` | `4`, controller count above the threshold | The stored offset at `+2620` through the vehicle basis at `+d0` (sets `+2274`) |
| `1af8fc` | `4`, otherwise | The same offset, on the single-cost branch |
| `1af980` | `5` | The same offset (sets `+2274`) |
When `+580` is 1, the combo code is the first word of the controller block at
`+2000`; when it is 2, it is the word at `+418` of the block at `+2004`. Each combo compares the counter at `+2214` with
its cost. The transform result is the frame vector at `+0`, read only by
`mathfAddVector`, which adds the vehicle position into `+2760` and writes X/Y/Z
only. `TheGame::CreateWeapon` then launches the special. Frame `+0c` is never read
in any combo case, and the W of `+2760` is not written by this path at all. The
owner reads no VU registers, accumulator or flags. The existing native helper
computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. It reads its input before writing, so the in-place transforms are safe.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/combo-forward`, against parent `7627a52` (PR #70).
Parent headless/window binaries are preserved there and match PR #70's qualified
build. Generated bodies, retail data and runtime recordings stay outside Git.
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons
(caller kinds 274 to 278): helper-boundary continuations and full-owner entries,
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Full entries run from the owner's start: the `+580` check, the combo dispatch
and the energy-cost checks. Combos 1 and `0x10304` run the real
`Launcher::GetLockOn`, with nothing to lock on in empty vehicle lists. Combo 4
takes each branch by its controller count. Every launch stops at `CreateWeapon`;
reaching it is asserted. With no combo entered, the owner adds `+20c8` into the
counter at `+20e0` and returns without a transform.
- Both bases are fixture-known at entry as well as at the helper boundary, so every
case is checked against an independent identity or quarter-turn result.
- The launch position in `+2760` is asserted exactly against the original FPU
addition, together with the `+2270`/`+2274` flags. Each site publishes in 480
cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 700 → 708,
real libm errno cases 853 → 842). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 142,848 generated sequences / 6,912 whole-memory
comparisons. Historical forward ABI coverage is 10,560 / 660; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `7627a52`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The combo-4 return `1af8fc`
is live: it runs natively once on the one-player route with no recorded
difference. The other four returns are cold on these routes and are qualified by
the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 50.1 ms of silence in one-player, 39.8 ms in four-player and 19.8 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The other combos in actual play, full campaign and physical
controller/hardware acceptance remain open.
+83
View File
@@ -0,0 +1,83 @@
# Native Cop SUV laser-aim forward transforms
[Environment gun forwards](NATIVE_ENVWEAPON_FORWARD.md) follow with two more launcher sites.
The two `Launcher::UpdateCopSUV` (`14ff58`) forward returns use native XYZ
arithmetic after the [launcher turret-aim forwards](NATIVE_LAUNCHER_AIM_FORWARD.md).
Known forward coverage grows from 142 to 144 of 269 returns (125 remain). Known
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Branch | Producer and consumer |
| --- | --- | --- |
| `150094` | Mode `0x14` with a live player state | Laser offset table through the vehicle basis, in place, plus the shooter position, aimed at the player-state target |
| `1502cc` | Otherwise, a closest car within 600 units | Same offset and position, aimed at the car `GetClosestCar` chose |
As with the other launchers, the frame `+10` result is read only as XYZ, by
`mathfAddVector` and by the scalar `mathfRotationFromPointToPoint`. The owner never
reads frame `+1c` (the output W) and reads no VU registers, accumulator or flags.
The existing native helper computes separately rounded XYZ, preserves destination
W and leaves VU state untouched. Unknown and historical callers keep the original
ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/copsuv-aim-forward`, against parent `5135b43`
(PR #59). Parent headless/window binaries are preserved there and match PR #59's
qualified build. Generated bodies, retail data and runtime recordings stay
outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
(caller kinds 247 and 248): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Kind 247 sets the game mode to `0x14` with a live player state and a target
coordinate system, so full entries take the first branch even without a closest
car. Kind 248 places a car inside the laser's 600-unit range, so full entries take
the closest-car branch; that car's target flag (`+24bc`) is asserted, and the
no-target scenario returns normally without a transform. Producer reach is
asserted in every case.
- Both branches continue into `LauncherSound::startLaserSound` or
`stopLaserSound`, which call into the sound driver. Fixtures stop at those two
calls, after the aim point has been consumed, and assert that one of them was
reached; the laser sound and the turret matrix publication after it are not
executed here.
- Transform outputs are checked against an independent identity or quarter-turn
result in every reached case (the basis is the vehicle's own). The aim point
consumed by `mathfRotationFromPointToPoint` is asserted exactly against the
original FPU addition. The first site publishes in 512 cases, the second in 480.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
at frame `+1c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved again (vehicle tire jumps
704 → 715, real libm errno cases 833 → 850). All scenario-defined counts and
assertions are unchanged.
- Aggregate caller coverage is 127,488 generated sequences / 5,952 whole-memory
comparisons. Historical forward ABI coverage is 8,640 / 540; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `5135b43`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. The closest-car return `1502cc` is live: it runs
natively 1,638 times on the one-player route and 845 times on the four-player route
with no recorded difference. The player-state return `150094` is cold on these
routes and is qualified by the generated owner suite above.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames; `1502cc` runs natively 544 times in the one-player window
and 197 times in the four-player window. Reviewed captures show the intro and
credits, menus, vehicle and level selection, combat with the HUD and four
simultaneous views. Each route has five distinct captures. Stereo 48 kHz, 16-bit
WAV recordings contain nonzero audio.
Audio device underruns remain: 57.3 ms silence in one-player, 35.3 ms in
four-player and 15.2 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. The mode-`0x14` branch in actual play, full
campaign and physical controller/hardware acceptance remain open.
+81
View File
@@ -0,0 +1,81 @@
# Native BSP collision directions
The native player now calculates `mathfMulTransVec` (`1da298`) directly for three additional
`hdBspNode` return sites: `1cd618`, `1cda54` and `1cdabc`. Together they make 529,424 calls in the
qualified 1P route. The existing skid caller (`168b30`) remains native. These are caller-scoped
replacements; the other direction callers retain the original helper and its complete ABI.
BozoEngine remains at `4a8f70a`.
The calculation snapshots three basis columns and the input vector, computes separately rounded
basis-times-XYZ arithmetic and writes XYZ. Destination W is retained as opaque padding. Native code
neither reads nor maintains VU registers, accumulator, flags, microcode or data memory. Scalar CPU
registers and timing are unchanged, and the complete host floating-point control word is restored.
The existing rare-exponent record arithmetic, overlap, alignment and RAM-alias handling are reused.
## Consumer audit
The three calls create the local point/segment directions in `hdBspNode` (`1cd538..1cdeb4`). Their
output is the stack vector at `sp+40`; subsequent additions and copies consume XYZ. The inverse
transforms at `1cd658`, `1cda84` and `1cdae8` consume XYZ and produce the vector at `sp+50` before
scalar additions populate the segment endpoints. Those inverse helpers remain original at these
return sites; their output W comes from the inverse basis, independently of input W.
There are no direct VU register/control/flag reads in `hdBspNode`. Its scalar comparisons and BSP
classification continue in the generated code. This scope does not establish a W/flag contract for
other direction callers, nor replace the complete collision traversal.
`TMB_NATIVE_MATH_CHECK=1` compares native XYZ against the original leaf on a copied context and
restores memory before the native write. The normal player makes no such original calls for the
audited sites. The historical host retains the original helper even at these return addresses.
`TMB_NATIVE_DIRECTION_TRACE=1` optionally reports direction-helper frequencies by return address;
normal runs do not collect the caller map. Frequencies are not CPU timings.
## Validation
Evidence is local under `D:/BozoScratch/direction-callers`, against main `f946958` (PR #20).
No game code, captures, RAM dumps or disc data are committed.
- The matrix/direction suite passes 1,048,576 numerical/ABI comparisons and 512 complete flat-memory
comparisons, including 262,144 direction cases distributed across all four audited return sites.
Four host rounding modes, denormal controls, extreme/arbitrary input bits, overlap, aliases,
scratchpad and low address bits are covered. Native leaf VU state remains untouched. Another
2,048 comparisons retain the complete original ABI for unaudited callers.
- Another 1,536 cases run the real generated BSP continuations from each new direction call through
the scalar vector consumers and original inverse transforms, ending before the next result-buffer
operation. They include the two successive direction calls in the segment setup. The actual local
stack-vector layout is used. CPU state outside intentionally retired VU effects, cycle/checkpoint
counts, host FP control and all memory outside direction-output W agree. Forty-eight comparisons
check the entire flat memory; historical-host direction ABI comparisons are exact too.
- All nine native suites and all 12 release-tool tests pass. Player, headless and checker builds pass.
- Default 1P completes 9,500 frames with 533,524 native directions, versus 4,100 before this change.
That retires 529,424 more generated VU direction executions, about 44% of all direction calls in
this route. The 4P route completes 8,500 frames; these new BSP sites are not reached there, so its
native direction count remains 8,363. There is no measured speedup claim.
- Every frame's draw hashes/counts, deterministic sound hashes/sample counts, library calls/counts,
EE clocks, scratchpad and thread records match the baseline in both routes. All 4P RAM hashes match
too. Default runs make zero original comparisons and zero VU0 microprogram calls.
- Separate strict runs enable the native math, hierarchy and projection original comparisons.
All 533,524 / 8,363 native direction XYZ comparisons pass (1P / 4P). Both complete frame recordings
reproduce their corresponding default recordings byte-for-byte.
- Windowed default routes complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P.
Direct captures show the decoded opening movie, menus, the 1P loading screen, active textured combat
with rain, vehicle effects and HUD targeting, and all four snow-arena views after loading. Sound is
active; device logs report 22.5 / 56.6 / 26.3 ms of silence and some dropped frames. Deterministic
sound is exact; flawless device audio or subjective listening acceptance is not claimed.
## RAM boundary and remaining qualification
The 1P RAM hashes differ in 3,234 frames, first at 5593. At frame 7000 the complete 32 MB snapshot
differs in six bytes across just two stack W words: `8fef5c` and `8ff05c`. A temporary direction trace
identifies the corresponding outputs `8fef50` / `8ff050` at BSP frame bases `8fef10` / `8ff010`.
The original helper would store inherited VF16.W (`0`); the native helper retains the pre-existing
padding (`ffffffff` / `02000200`). There are no differences elsewhere at that snapshot. Temporary
watch tracing is removed from the production source and executable. No shadow VU state, padding
restoration or broader memory-hash mask is introduced.
Full campaign, console visual parity, unaudited direction callers and complete VU removal remain
outside this bounded qualification. Further BSP inverse directions and other hot direction callers
still need their own consumer audit.
The subsequent [`NATIVE_DIRECTION_CONSUMERS.md`](NATIVE_DIRECTION_CONSUMERS.md) increment adds the
vehicle collision-point, tire-height and light-node direction callers with their generated consumers.
+83
View File
@@ -0,0 +1,83 @@
# Native vehicle and light directions
The subsequent [BSP/vehicle inverse increment](NATIVE_BSP_INVERSES.md) also retires the inverse leaf
following vehicle return `11708c`, with unchanged VU state through the paired setup sequence.
This increment extends the native `mathfMulTransVec` (`1da298`) path to four more audited return sites:
| Return | Caller | Immediate consumers |
| --- | --- | --- |
| `11708c` | `Vehicle::collisSetupHitPoints` | XYZ point addition, then original inverse/scalar point setup |
| `1880e0` | `Vehicle::suspCheckTireHeight` | Z displacement, scalar suspension clamps and tire-height write |
| `1d4284` | `hierLightNode` | XYZ view translation and scalar normalization |
| `1d42e8` | `hierLightNode` | Scalar XYZ dot product and light attenuation |
It reuses the native basis-times-XYZ calculation and destination-W contract documented in
[`NATIVE_DIRECTIONS.md`](NATIVE_DIRECTIONS.md). No VU registers, accumulator, flags or data memory are
read or maintained on these native leaf paths. Other return sites and the historical host retain the
original helper's complete ABI. BozoEngine remains at `4a8f70a`.
## Consumer audit
The collision-point loop writes the direction to the local vector at `sp+10`. `mathfAddVector` reads
only XYZ to produce the vehicle's world point. The loop then replaces the temporary XYZ before its
original inverse transform and final scalar addition. Direction W contributes to no numerical result
in these consumers; the original inverse still loads the complete vector into its compatibility state.
The method has no direct VU register/control/flag reads.
The tire-height loop transforms the local tire point into `sp+10` and reads only its Z at `sp+18`.
Generated scalar code computes and clamps the displacement before writing the tire height. Remaining
tire iterations reuse that vector, including null/flagged-tire branches. There are no calls after the
direction helper in that loop except later direction iterations, and no direct VU state reads.
The light-node position and direction vectors are at `sp+10` and `sp+30`. Their consumers are scalar
XYZ addition, normalization and dot product; light record indices/flags and attenuation are written
explicitly. Their W components are not copied into light parameters. The generated continuation
retains view lookup, normalization's small-vector branch, light-type branches, count/cursor updates
and the saved-register epilogue. `hierLightNode` has no direct VU state reads.
These are scoped helper replacements, not complete native collision, suspension or light builders.
The existing optional original check and caller-frequency trace remain available. No measured speedup
is claimed from counts alone.
## Validation
Local evidence is under `D:/BozoScratch/collision-directions`, against main `5820992` (PR #21).
No generated game code, disc data, captures or RAM dumps are committed.
- The existing math suite passes 1,048,576 helper numerical/ABI comparisons and 512 full flat-memory
comparisons. Its 262,144 direction cases now cover all eight audited return sites, with arbitrary
input bits, extreme exponents, four host FP modes, denormal controls, record overlap, RAM aliases,
low address bits and scratchpad. Native leaf VU state and complete host MXCSR remain untouched.
- Another 2,048 cases execute the actual generated vehicle/light continuations, including collision
point addition/inverse setup through the next loop boundary, remaining tire loops and clamps,
and both light continuations through their epilogue. They check the CPU state outside intentionally
retired VU effects, complete memory outside direction-output W, exact cycles/checkpoints and host
FP effects. Sixty-four cases compare the complete flat memory. Historical-host helper ABI checks
are exact at all four new sites. The previous 1,536 BSP continuation cases still pass.
- The scalar normalization can raise host exception flags. Each reference/native caller test starts
from the same complete MXCSR and compares the original continuation's complete outgoing effects;
only the native leaf promises to leave MXCSR unchanged.
- All ten native suites and 12 release-tool tests pass. Player, headless and checker builds pass.
- Default 1P completes 9,500 frames with 855,975 native directions, up from 533,524. The actual 4P
route completes 8,500 frames with 207,441, up from 8,363. This retires another 322,451 / 199,078
generated direction-helper executions in these routes. All four new sites run in both routes.
- Every baseline frame-record field matches in both default routes, including RAM, scratchpad,
draw/sound hashes and counts, library calls/counts, EE clocks and thread state. Default runs make
no original comparisons and no VU0 microprogram calls.
- Strict runs enable native math, hierarchy and projection original checks. All 855,975 / 207,441
direction XYZ comparisons pass; both complete recordings reproduce their default files byte-for-byte.
- Complete 32 MB snapshots at 1P frame 7000 and 4P frame 6000 match the baseline byte-for-byte.
No additional memory-hash mask, padding restoration or shadow VU state is introduced.
Live 4P qualification also exposed a timing-sensitive native-flare continuation issue. The subsequent
fix and its additional native-particle regression target are documented in
[`NATIVE_PARTICLE_CONTINUATIONS.md`](NATIVE_PARTICLE_CONTINUATIONS.md). Final results below use both changes.
Windowed final runs complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P. Direct final
captures show the decoded opening movie, loading screen, active rainy combat with targeting/HUD and
vehicle effects, and all four snow-arena views with driving/firing. The 4P run advances through the
previous stall point. Device logs report 17.8 / 46.2 / 30.9 ms of silence (movie / 1P / 4P) and some
dropped frames; deterministic sound remains exact. Flawless device audio or subjective listening
acceptance is not claimed. Full campaign, console visual parity and complete VU removal remain
outside the bounded qualification.
+95
View File
@@ -0,0 +1,95 @@
# Native driver and boss inverses
Five driver/boss inverse returns now use native record arithmetic, following the
[AI increment](NATIVE_AI_INVERSES.md). The coupled final-boss forward transform
also becomes native, so the local offset can reach its real vehicle-position
consumer without VU transport. Inverse coverage grows from 117 to 122 of 134
sites, forward coverage from 95 to 96 of 269. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `1265a8`, `1265d0` | `driverGetOffsetFromPoint` | Path-point local offsets, Y comparison and probe staging |
| `1288b0`, `1288c4` | `driverCheckDrivingLOS` | Local X signs, LOS state, random steering choice and publication |
| `112118` | `FinalBoss::CheckCollision` | Captured-vehicle local offset and effect-coordinate staging |
| `11112c` (forward) | `FinalBoss::UpdateBoss` | Local offset to world XYZ, captured-vehicle position and attachment flags |
Inverse arithmetic is unchanged: separately rounded XYZ and meaningful first-basis
W remain exact. The forward writes XYZ and retains destination W; its sole scratch
W at `SP+1c` is audited after the actual XYZ publication and flag consumers.
No inverse W is excluded. Native calls leave VU registers, accumulator, flags and
data memory untouched. Unknown callers and historical hosts keep the original ABI.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/driver-boss-inverses`, against main `bd12a90`
(PR #47). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
Aggregate coverage is 96,768 / 4,032. Four rounding modes, denormal controls,
RAM aliases, rotated bases and arbitrary first-basis W are covered.
- Each of the six sites has 256 helper-boundary cases and 256 producer cases.
Path offsets include complete `126500` entries, six pre-transform rejection
gates, and active Y comparisons. The positive probe path stages its actual
150-unit vector and stops at forward helper `1da298`, before the unrelated
LOS query. The optional lateral-rotation producer is disabled in these fixtures.
- Driving-LOS producer fixtures begin at `128880`, after earlier geometry,
LOS and tire queries. They execute actual LOS-state publication, transform
gates, opposite/same/zero X tests, the generated seeded random helper and
steering-choice stores through the function return. Those earlier queries
are outside this bounded fixture; they are not replaced with test stubs.
- Boss inverse producers begin at `1120ec`: actual position subtraction,
in-place inverse, three real random calls and effect-coordinate staging execute
up to particle creation `1e6610`. The resulting local offset then enters the
real `UpdateBoss` position producer at `11110c`, transforms forward, translates,
publishes vehicle XYZ and updates attachment flags, stopping before the next
collision call `111f80`. Standalone forward cases cover that same consumer.
Identity and rotated bases must recover the known captured-vehicle position.
Earlier collision queries, hit dispatch, particle creation, sound and the rest
of the boss state machine are outside these fixtures.
- CPU outside retired VU, host FP effects, clocks/checkpoints, per-site inverse
counts, random-call counts and final memory agree. Native VU remains untouched
through these consumers. Only the audited forward scratch W is normalized in
the comparison after the real consumer; no runtime RAM mask or VU reconstruction
is introduced. Whole-memory producer samples select active transforms.
- Historical inverse ABI coverage is 7,808 / 122 cases / whole-memory checks;
historical forward coverage is 5,568 / 348. Existing coverage retains 786,432
hierarchy helper cases / 384 whole-memory checks, 8,000 geometric edges,
1,024 complete BSP callers / 32 whole-memory checks and 2,048 unknown ABI cases.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass. Existing
front/rear AI attack-publication assertions still pass (392 / 352 cases).
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recording files and snapshots are byte exact, with
no strict comparison mismatches.
One-player reaches all four new driver sites: 16 calls each to the path-offset
returns and 39 each to the driving-LOS returns (110 total). Four-player makes no
new driver/boss calls in this four-human scenario. The boss sites are cold in
these replay routes; their attachment behavior is qualified by the generated-code
fixtures above, not a complete boss fight.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
AI opponents, driving/combat/effects, four simultaneous views, decoded intro
images and return to the menu. Each route has five distinct captures.
Windowed one-player reaches the two path-offset sites nine times each. The
other new sites are cold in this shorter window sample; driving-LOS is reached
in the headless replay and boss publication in the generated fixtures.
Four-player and movies make no new driver/boss calls. Stereo 48 kHz, 16-bit WAV
captures contain nonzero audio. Device underruns remain: 55.0 ms silence in 1P,
28.3 ms in 4P and 27.8 ms in movies. These are functional checks, not a timing
or flawless-playback claim. Full campaign, a complete final-boss fight and
physical-controller/hardware acceptance remain outside this increment.
## Remaining scope
Of these two helper families, 12 inverse and 173 forward sites remain outside the
native allowlists: 185 total. This is a call-site inventory, not a count of all
remaining emulation. Additional inline arithmetic remains separate work.
+96
View File
@@ -0,0 +1,96 @@
# Native driver forward transforms
Seven driver forward returns use native XYZ record arithmetic after the
[rigid-body forward increment](NATIVE_RIGID_BODY_FORWARD.md). Coverage grows
from 106 to 113 of 269 known forward returns (156 remain). Known inverse coverage
stays 134 of 134; unknown/historical callers retain the original ABI.
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `126618` | `driverGetOffsetFromPoint` | 150-unit world probe, Manhattan gate, actual LOS query and path-offset publication |
| `1267f0` | `driverGetOffsetFromPoint` | Actual RPH rotation and bounded-angle producer, lateral path-offset publication |
| `1276a4` | `driverCalcLookahead` | Distance/speed prediction and translated target publication |
| `128704`, `128744` | `driverCheckDrivingLOS` | Special/ordinary world query start points |
| `1287dc`, `12880c` | `driverCheckDrivingLOS` | Special/ordinary world query endpoints, actual LOS and driver-state consumers |
Native arithmetic preserves separately rounded XYZ, destination W and the VU
registers, accumulator, flags and data memory. The original scalar driver logic,
collision queries, matrix/trigonometric/angle producers and meaningful inverse
outputs remain intact. This change extends the audited native return selection;
it does not change steering or collision policy.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/driver-forward`, against immediate parent
`94ad67d` (PR #51). Retail data, generated bodies and replay artifacts stay
outside Git.
- Added coverage is 3,584 generated sequences / 224 whole-memory comparisons:
each return has 256 helper-boundary sequences through its actual tail and 256
complete owner entries. Four rounding modes, FTZ/DAZ, RAM aliases, identity and
rotated bases, opaque W payloads, zero/tiny/signed vectors and speeds, and
lookahead outputs aliasing vehicle/target positions are covered.
- Path probes exercise active and gated entries, near/far Manhattan checks,
actual `hdLosTest`, `terrainCollision` and `hdWalkColGrid`, clear-path flags and
publication. Lateral entries execute real scalar RPH construction, original
sine/cosine calls and angle wrapping, zero-width/node gates, signed offsets and
path-node width scaling before the final vector addition.
- Lookahead entries cover missing targets, stopped targets, near-distance gates,
moving/reversing targets, rotated bases and aliased publication. Known complete
entries require exact translated results, alongside original/native comparison.
- Driving-LOS entries execute counter increment/wrap, actual point subtraction,
normalization and matrix construction, speed/height adjustments, short-target
endpoint selection, real queries and clear-state/mask publication. Existing
inverse consumers run where enabled and their full meaningful W is compared.
- Query fixtures use actual empty terrain and endpoints outside the collision
grid X bounds. No collision/query result is stubbed. These fixtures qualify
real clear-path consumers; they do not claim obstructed-world coverage.
Runtime reach is reported separately below.
- Explicit per-return and query/producer counts are required. Known-state
assertions publish 32 probe cases, 32 lateral offsets, 32 lookahead positions
and 64 LOS endpoint pairs. Whole-memory complete-entry samples reach active
transforms. CPU outside retired VU, clocks/checkpoints, host FP effects, query
endpoints and final RAM agree. Native VU remains untouched through complete
producers and consumers.
- Opaque forward W is restricted to the actual frame's `SP+ac` (probe), `SP+5c`
(lateral), `SP+1c` (lookahead), or `SP+1c`/`SP+2c` (LOS). Exact output counts
and addresses are asserted separately for boundary and complete-entry frames.
Original W stays live through all real consumers before comparison-only
normalization. Inverses replacing forward scratch remove that exclusion and
compare full XYZW. No runtime RAM mask or VU-bank reconstruction is added.
- Aggregate generated caller coverage is 111,616 sequences / 4,960 whole-memory
checks. Historical forward ABI coverage is 6,656 / 416; inverse stays 8,576 /
134. Existing hierarchy, geometric, BSP and unknown-ABI coverage remains.
Earlier AI, vehicle/light and final inverse publication assertions stay enabled.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass. Earlier AI,
vehicle/light and final inverse publication assertions remain enabled.
Default and strict runs complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches immediate parent `94ad67d`: raw RAM,
scratchpad, calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB
RAM images are identical. Strict/default recording files and snapshots are byte
exact; strict checks report no mismatch.
One-player reaches the new probe `126618` ten times and LOS sites `128704`,
`128744`, `1287dc`, `12880c` 198, 799, 136 and 799 times respectively. Lateral
`1267f0` and pursuit `1276a4` are cold on these replay routes and are qualified by
complete generated owners and their real scalar consumers. Four-player makes no
calls to any of these seven sites.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
AI opponents, combat/effects, four simultaneous views, decoded intro footage and
return to the menu. Each route has five distinct captures. Stereo 48 kHz,
16-bit WAV recordings contain nonzero audio.
Windowed one-player reaches the probe five times and the four LOS returns 112,
457, 93 and 457 times; lateral/lookahead remain cold. Four-player and movies make
no calls to these seven sites. Device underruns remain: 52.7 ms silence in 1P,
33.2 ms in 4P and 27.6 ms in movies. These are functional checks, not a timing or
flawless-playback claim. Full campaign, every driver/world configuration and
physical-controller/hardware acceptance remain outside this increment.
+103
View File
@@ -0,0 +1,103 @@
# Native helicopter gun and walking pedestrian forward transforms
[Machine-gun muzzle forwards](NATIVE_MACHINE_GUN_FORWARD.md) follow with the two weapon-initialization sites.
Two single-site forward returns use native XYZ arithmetic after the
[falling junk jet forwards](NATIVE_JET_DEATH_FORWARD.md). Known forward coverage
grows from 163 to 165 of 269 returns (104 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `129c48` | `EnvHeli::UpdateEnvHeli` (`1297e8`) | The gun's muzzle offset (game table `4e50d0`) through the helicopter's basis, in place, plus its position, passed to `Weapons::CreateStaticWeapon` as the shot origin |
| `10cc7c` | `AttractPed::updateTrans` (`10cbf0`) | A walking pedestrian's velocity, scaled by 60/update rate, through its basis, added to its position |
In attack mode, the environment helicopter takes the closest live car from the
game's vehicle array (`Launcher::GetClosestCar`). It turns toward the car with
`mathfRotationFromPointToPoint`, smoothing, and `UpdateRot` (`mathfRotMatrixH`,
`mathfRotMatrixRPH`). On every 30th update with the aim inside its tolerance, it
fires from the transformed muzzle point. The result is the frame vector at `+10`,
read only by `mathfAddVector` and by `CreateStaticWeapon`. The environment-gun
increment already established that `CreateStaticWeapon` reads only X/Y/Z. Frame
`+1c` is never read.
The attract-mode pedestrian, when its coordinate system is on, moves by the
transformed velocity. The probe is lifted by 5 for `hdHatTest`, then the height is
settled and the walk animation speed set. The result is the frame vector at `+10`.
It is read only by `mathfAddVector`. `hdHatTest` receives the same pointer as an
output and only writes it (`mathfCopyVector`, `mathfSetFVector`). Frame `+1c` is
never read.
Neither owner reads VU registers, the accumulator or flags. The existing native
helper computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. It reads its input before writing, so the in-place transform is safe.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/envheli-ped-forward`, against parent `ba9f83e`
(PR #67). Parent headless/window binaries are preserved there and match PR #67's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 268 and 269): helper-boundary continuations and full-owner entries, across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Helicopter entries cover the following, and reaching each stop is asserted:
- Car selection, the aim and the matrix rebuild, then the firing update, which
stops at `CreateStaticWeapon`.
- A non-firing update, which stops at `UpdateTrans` (it has its own native
transform).
- A non-attacking mode, which stops at its sound update.
- Pedestrian entries cover the update-rate scaling, the transform, the probe lift,
`hdHatTest` on the empty grid and both height-settling branches. They stop at
`getDbId`, ahead of the animation-speed tables. A pedestrian whose coordinate
system is off drifts without a transform and stops at its grid reparent.
- Helper-boundary outputs are checked against an independent identity or
quarter-turn result. Full entries rebuild or scale first, so those are covered by
the native/original comparison.
- Published values are asserted exactly against the original FPU addition:
- the shot origin passed to `CreateStaticWeapon`;
- the pedestrian's X/Y position, and the point `hdHatTest` received.
The helicopter site publishes in 448 cases, the pedestrian in 480.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+1c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 704 → 705,
real libm errno cases 813 → 828). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 138,240 generated sequences / 6,624 whole-memory
comparisons. Historical forward ABI coverage is 9,984 / 624; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `ba9f83e`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. The pedestrian return `10cc7c` is live: it runs
natively 390 times on the one-player route (default and strict) with no recorded
difference. The helicopter gun return `129c48` is cold on these routes and is
qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. In the qualification movie run, the frame-1,000 capture landed in a fade
and was nearly black. Two back-to-back short reruns (new build, then parent)
captured frames 900 to 1,100. Both show the same fade at 900 and the intro at
1,000, with comparable brightness. The black frame was real-time movie timing,
not this change. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
Audio device underruns: 55.8 ms of silence in one-player, 32.9 ms in four-player
and 37.7 ms in the movie run. These are functional checks, not a performance or
flawless-playback claim. The attacking helicopter in actual play, full campaign and
physical controller/hardware acceptance remain open.
+79
View File
@@ -0,0 +1,79 @@
# Native environment gun forward transforms
[Ferris wheel fall and smasher camera forwards](NATIVE_FERRIS_SMASHER_FORWARD.md) follow with two environment sites.
The two `Launcher::UpdateEnvWeapon` (`14d3a0`) forward returns use native XYZ
arithmetic after the [Cop SUV laser-aim forwards](NATIVE_COPSUV_AIM_FORWARD.md).
Known forward coverage grows from 144 to 146 of 269 returns (123 remain). Known
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Producer and consumer |
| --- | --- |
| `14d62c` | Muzzle offset table `23d240` through the gun's basis, plus the gun position, passed to `Weapons::CreateStaticWeapon` as the shot origin (toggle at `+f0` set) |
| `14d678` | Same with the alternate muzzle table `23d250` (toggle clear) |
The game-mode jump table at `4e71c0` selects the environment-gun case. It aims
the gun at the nearest valid vehicle and fires every tenth update, alternating
muzzles. The result is the owner's frame vector at `+0`. `mathfAddVector` reads its
XYZ, and `CreateStaticWeapon` (`1b7590`) reads the position only through two
scalar `mathfCopyVector` calls; its `InitWeapon` and `activateWeaponSound` calls do
not receive it. The owner never reads frame `+0c` (the output W) and reads no VU
registers, accumulator or flags. The existing native helper computes separately
rounded XYZ, preserves destination W and leaves VU state untouched. Unknown and
historical callers keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/envweapon-forward`, against parent `aadc76b`
(PR #60). Parent headless/window binaries are preserved there and match PR #60's
qualified build. Generated bodies, retail data and runtime recordings stay
outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
(caller kinds 249 and 250): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Full entries go through the real jump table, the nearest-vehicle search over the
game's embedded vehicle array, the aim smoothing and basis rebuild, and the fire
counter. Each fire stops at `CreateStaticWeapon`, whose position argument is
captured; the toggled muzzle state is asserted. The no-fire update count returns
normally without a transform. Producer reach is asserted in every case.
- Helper-boundary outputs are checked against an independent identity or
quarter-turn result. Full entries rebuild the gun basis from its aim angles first,
so those are covered by the native/original comparison. The shot origin passed
to `CreateStaticWeapon` is asserted exactly against the original FPU addition.
Each site publishes in 480 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
at frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 715 → 718,
real libm errno cases 850 → 802). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 128,512 generated sequences / 6,016 whole-memory
comparisons. Historical forward ABI coverage is 8,768 / 548; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `aadc76b`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. Both environment-gun sites are cold on these
routes, so the generated owner suite above is their qualification. The Cop SUV site `1502cc` still runs natively 1,638 times (one-player)
and 845 times (four-player), exact.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
vehicle and level selection, driving with the HUD and four simultaneous views.
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
contain nonzero audio.
Audio device underruns remain: 56.0 ms silence in one-player, 56.3 ms in
four-player and 15.7 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. A level with the environment gun firing,
full campaign and physical controller/hardware acceptance remain open.
+77
View File
@@ -0,0 +1,77 @@
# Native Ferris wheel and final boss hit-test forward transforms
[The special-weapon torch batch](NATIVE_SPECIAL_TORCH_FORWARD.md) follows with the last ten UpdateSpecial sites.
Four more hit-test forward returns use native XYZ arithmetic after the
[weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md). Known forward coverage grows
from 222 to 226 of 269 returns (43 remain). Known inverse coverage stays 134 of 134;
BozoEngine stays at `4a8f70a`.
| Return PC | Producer and consumer |
| --- | --- |
| `12a6d8` | `FerrisWheel::UpdateFerrisWheel` (`12a580`): the wheel's offset at `+30` goes through its coordinate system (pointer at `+90`) into frame `+0`. `mathfAddVector` adds it into the system's position, which is raised by 20 and height-tested (`hdHatTest`) |
| `12a930` | A random car offset in frame `+10` goes through the system into frame `+0`, plus the position. It becomes `hdPntSphereTest`'s point against the wheel; on a hit, `mathfSubVector` rewrites its XYZ and `DispatchHit` gets it |
| `12a9e8` | The seat offset in frame `+20` the same way, after the first test's hit dispatch: `hdPntSphereTest`, then `mathfSubVector` and `DispatchHit` |
| `11201c` | `FinalBoss::CheckCollision` (`111f80`): each collision point from the table at `+710` goes through the boss's coordinate system (`+e0`) into frame `+0`, plus the position. It becomes `hdPntSphereTest`'s point; on a hit, `mathfSubVector` and `DispatchHit` |
The consumers are the ones audited for the
[weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md): `hdPntSphereTest` and every
reader of its globals, all twelve `DispatchHit` handlers, and the XYZ helpers. They
read the point only as XYZ, and nothing copies its W. `12a6d8`'s result reaches only
`mathfAddVector`; `hdHatTest` gets the coordinate system's position, whose W no
forward writes. Neither owner ever loads frame `+0c`, and neither reads VU
registers, accumulator or flags. The existing native helper computes separately
rounded XYZ, preserves destination W and leaves VU state untouched. Unknown and
historical callers keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/ferris-boss-forward`, against parent `eefb151`
(PR #81). Parent headless/window binaries are preserved there and match PR #81's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 2,048 generated sequences / 128 whole-memory comparisons (caller
kinds 327 to 330): helper-boundary continuations and full entries, across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- `11201c` runs from the owner's start and stops at `hdPntSphereTest`. The Ferris
wheel sites start at the call-return label before each transform (`12a6c4`,
`12a918`, `12a9c8`); `12a6d8` stops at `hdHatTest`, the other two at
`hdPntSphereTest`.
- The harness requires each full entry to reach exactly its own transform. Every
basis is fixture-known, so every site is checked against an independent identity
or quarter-turn result.
- Published values are asserted exactly against the original FPU arithmetic: the
point each hit test receives, and that it receives that address; for `12a6d8`,
the position after the raise by 20. Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 718 → 709,
real libm errno cases 842 → 843). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 169,472 generated sequences / 8,576 whole-memory
comparisons. Historical forward ABI coverage is 13,888 / 868; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `eefb151`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The four returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 44.9 ms of silence in one-player, 26.9 ms in four-player and 21.7 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The Ferris wheel and final boss in actual play, full campaign and physical controller/hardware acceptance remain open.
+83
View File
@@ -0,0 +1,83 @@
# Native Ferris wheel fall and smasher camera forward transforms
[Falling helicopter forwards](NATIVE_HELI_DEATH_FORWARD.md) follow with two more environment sites.
Two environment forward returns use native XYZ arithmetic after the
[environment gun forwards](NATIVE_ENVWEAPON_FORWARD.md). Known forward coverage
grows from 146 to 148 of 269 returns (121 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `12aad4` | `FerrisWheel::UpdateFalling` (`12aa98`) | The falling car's velocity through its coordinate system, added to its position; the resulting height selects the landing state at `gp-312c` |
| `169ed0` | `Smashers::SmasherHit` (`169d48`) | Camera offset `(0, -200, 60)` through the slot camera's basis, added to the hit vehicle's position and handed to `TheGame::DetachCamera` |
The Ferris wheel result is the owner's frame vector at `+0`, read only by
`mathfAddVector`. Later stack use starts at `+10`, so frame `+0c` is never read.
The smasher result is at frame `+10`. `mathfAddVector` and `Camera::DetachCamera`
read it only as XYZ: a scalar `mathfCopyVector` into the camera, then the real
point-to-point rotation and matrix rebuild. Frame `+1c` is never read. Neither
owner reads VU registers, the accumulator or flags; `vehicleStunCar` only writes
one vehicle field. The existing native helper computes separately rounded XYZ,
preserves destination W and leaves VU state untouched. Unknown and historical
callers keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/ferris-smasher-forward`, against parent
`9057db2` (PR #61). Parent headless/window binaries are preserved there and match
PR #61's qualified build. Generated bodies, retail data and runtime recordings
stay outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
(caller kinds 251 and 252): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Ferris wheel full entries run the whole owner. Both landing states are covered
(still falling above height 10, landed below), and the published position and
state are asserted. All 512 cases publish.
- Smasher full entries run the stun, the slot search and the real
`Camera::DetachCamera`. A new 0x20-byte snapshot region covers the game's camera
mode table at `4ac0d0`, which DetachCamera writes. The camera's copied position,
the claimed smasher slot and the camera mode are asserted. The inactive-smasher,
no-camera-slot and occupied-slot scenarios return without a transform, and
producer reach is asserted in every case. 416 cases publish.
- Transform outputs are checked against an independent identity or quarter-turn
result in every reached case. Published points are exact against the original
FPU addition.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
(frame `+0c` and `+1c` respectively) is normalized for test comparison, after
every real consumer.
- New caller kinds and the new region shift the shared random fill for later
rounding modes, so two data-dependent counts in earlier fixtures moved (vehicle
tire jumps 718 → 715, real libm errno cases 802 → 830). All scenario-defined
counts and assertions are unchanged.
- Aggregate caller coverage is 129,536 generated sequences / 6,080 whole-memory
comparisons. Historical forward ABI coverage is 8,896 / 556; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `9057db2`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. Both new sites are cold on these routes, so the
generated owner suite above is their qualification. The Cop SUV site `1502cc`
still runs natively 1,638 times (one-player) and 845 times (four-player), exact.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
vehicle and level selection, combat with the HUD and four simultaneous views.
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
contain nonzero audio.
Audio device underruns remain: 46.1 ms silence in one-player, 69.8 ms in
four-player and 28.3 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. A level with a falling Ferris wheel car or
a smasher hit in actual play, full campaign and physical controller/hardware
acceptance remain open.
+121
View File
@@ -0,0 +1,121 @@
# Final native inverse-helper returns
The final six known inverse-helper returns now use native record arithmetic,
following the [vehicle/light increment](NATIVE_VEHICLE_LIGHT_INVERSES.md).
All 134 static return sites for `mathfMulVec` (`1da1e8`) are now in the native
allowlist. Forward coverage stays at 96 of 269. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `12d0b0` | `forceFieldTakeHit` | Axis scaling, normalization, scalar response and hit-state publication |
| `136ce8` | `healthStandInit` | Four local vertices transformed and translated into a stand record |
| `13f814` | `Hud::BuildRadarStuff` | Distance-dependent alpha and real packet stores |
| `13fe54` | `Hud::BuildRadarStuff` | Nearest-target distance/ID publication and draw-argument staging |
| `14037c` | `Hud::AddRadarSignal` | Range/direction placement, height flashing, color and signal-count stores |
| `1e9778` | `particleDraw` | Camera-space visibility and sorted depth/index publication |
The inverse implementation is unchanged: separately rounded XYZ and meaningful
first-basis W remain exact. No W exclusion is added. Native leaves do not write
VU registers, accumulator, flags or data memory. Unknown returns and historical
hosts keep the original ABI; the original implementation remains for those
contracts. This completes the known static inverse call-site inventory, not all
remaining emulation or all inline VU arithmetic.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/final-inverses`, against main `9298010`
(PR #49). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
Aggregate coverage is 102,912 / 4,416. Each return has 256 helper-boundary cases
through its actual consumer and 256 producer cases. Four host rounding modes,
denormal controls, RAM aliases, rotated bases and arbitrary basis W are covered.
Whole-memory producer samples select active transforms.
- Force-field fixtures include complete `12d038` entries and inactive/null-input
gates. The original inline VU subtraction before the inverse is retained;
its pre-inverse VU effects agree between original/native runs. The native leaf
and complete scalar tail preserve that producer state. Real normalization,
dot products, axis scaling, square-root response and hit-state publication run.
Meaningful inverse W is checked explicitly. Hit publication is required in
448 cases. This increment does not retire the inline subtraction itself.
- Health-stand fixtures execute the complete `136c70` entry and four-vertex loop,
including real scalar translations, record pointers and count update. Each
transformed vertex must match known identity/rotated positions, rather than
merely match a second implementation. Helper-boundary cases also complete all
four iterations. All inverse output lanes remain compared in memory.
- First radar-distance producers begin at `13f7b0`, after earlier viewport and
vehicle-loop setup. They run visibility/class gates, actual position subtraction,
inverse, square-root distance, scalar/double alpha interpolation and packet
stores, stopping at the next vehicle-loop checkpoint `13f378`. Five packet
records and exact near/interpolated/far alpha are required. Packet publication
occurs in 480 cases. Earlier HUD setup and the enclosing loop are outside these
bounded fixtures.
- Nearest-target producers begin at `13fd58`; actual visibility/class gates,
position subtraction, inverse and distance-to-target stores run. The fixtures
stop at draw helper `141af0` after real draw arguments are staged, or the next
loop checkpoint `13fb10` when drawing is skipped. Nearest-target publication
is required in 224 cases. The draw helper itself and full HUD loop are outside
this fixture; they are not replaced by test stubs.
- Signal fixtures execute complete `1402a0` entries, including disabled/self-point
gates, actual relative-position producers, inverse, distance scaling, directional
signal trigonometry, height flashing, real color helpers and signal-count stores.
Count publication is asserted. Near/far signals, direction-signal variants,
zero displacement and high/low relative height are covered. The full 100-signal
saturation/reporting path is outside these fixtures.
- Particle producers begin at the actual type traversal `1e9700`. They use real
view translation/matrix getters and position subtraction, inverse, frustum/type/
live-count gates, depth bias and actual insertion sorting. Two visible types
must publish indices `[1,0]` and exact depths `[8,4]` (32 producer cases); one-
and zero-visible cases are checked too. Getter counts must match transform
reach. Execution stops before texture setup `1f91e8`, or synchronization
`203c18` when none survive. Earlier FOV setup, texture/draw submission and the
optional lens-flare call are outside these bounded fixtures.
- Per-site reach assertions distinguish active transforms and gates. CPU outside
retired VU, host FP effects, clocks/checkpoints, helper/action counts and final
memory agree. Native VU stays untouched through the consumers, retaining the
force-field producer effects described above. No RAM masking or VU-state
reconstruction is introduced.
- Historical inverse ABI coverage grows to 8,576 cases / 134 whole-memory checks;
forward remains 5,568 / 348. Existing coverage retains 786,432 hierarchy helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
32 whole-memory and 2,048 unknown ABI cases.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass. Existing
front/rear AI publication assertions pass in 392 / 352 cases; vehicle/light
publication assertions remain enabled too.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recording files and snapshots are byte exact;
strict comparisons report no mismatch.
One-player reaches four health-stand calls, 5,133 calls to each HUD distance site
and 31,216 radar-signal calls. Four-player reaches 6,248 calls to each HUD distance
site and 45,576 radar-signal calls. Force-field and particle-draw inverse returns
are cold in these replay routes; their behavior is qualified by the generated
producer/consumer fixtures above, not claimed as runtime route coverage.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
combat/effects, AI opponents, four simultaneous views, decoded intro images and
return to the menu. Each route has five distinct captures.
Windowed 1P reaches four health-stand, 430 calls to each HUD distance return and
13,648 radar-signal calls. 4P reaches 3,296 calls to each HUD distance return and
21,588 radar-signal calls. Movies make no new inverse calls. Force-field/particle
inverse sites remain cold in these window routes. Stereo 48 kHz, 16-bit WAV
captures contain nonzero audio. Device underruns remain: 56.4 ms silence in 1P,
31.4 ms in 4P and 23.8 ms in movies. These are functional checks, not a timing or
flawless-playback claim. Full campaign, every HUD/particle/force-field state and
physical-controller/hardware acceptance remain outside this increment.
## Remaining scope
No known static inverse return remains outside the native allowlist. There are
still 173 forward returns outside its separate allowlist. Other inline arithmetic,
remaining hierarchy/VU helpers and historical/unknown ABI support are separate
work; this is not a claim that all emulation has been removed.
+84
View File
@@ -0,0 +1,84 @@
# Native FireSpecial forward transforms (type a0 lock-on launch points)
[The FireSpecial types c0/1e0/220 batch](NATIVE_FIRE_TORCH_FORWARD.md) follows with the last frame-output sites.
Six more `Launcher::FireSpecial` forward returns use native XYZ arithmetic after the
[first FireSpecial batch](NATIVE_FIRE_SPECIAL_FORWARD.md). Known forward coverage
grows from 243 to 249 of 269 returns (20 remain). Known inverse coverage stays 134 of
134; BozoEngine stays at `4a8f70a`.
Vehicle type `a0` fires at its locked-on target (`+2f4`) in three blocks. Each block
bounds a heading (frame `+120`, `+124`, `+128`) and uses its window thresholds
(`gp-6408`, `gp-63f0`, `gp-63d8`) to pick one of four table slots, frame `+50` to
`+80`. The slot goes through the target's coordinate system into frame `+40`:
| Return PC | Block | Producer and consumer |
| --- | --- | --- |
| `14a4d4` | first | Slot `+50`, `+60` or `+70` |
| `14a518` | first | Slot `+80` |
| `14a73c` | second | Slot `+50`, `+60` or `+70` |
| `14a780` | second | Slot `+80` |
| `14a98c` | third | Slot `+50`, `+60` or `+70` |
| `14a9d0` | third | Slot `+80` |
`mathfAddVector` then adds the target's position into frame `+40`. The first two
blocks emit particles at that point (`particleCreateFx`). The third block hands it
to the take-hit info and calls `DispatchHit`.
The take-hit point pointer is dereferenced only by `mathfManhatDist` and by
`forceFieldTakeHit`'s xyz-masked VU subtraction. `DispatchHit` itself gets a
different vector. None of these consumers reads W. FireSpecial never loads frame
`+4c`, 64 bits at `+48`, or 128 bits from its frame. It reads no VU registers,
accumulator or flags. The existing native helper computes separately rounded XYZ,
preserves destination W and leaves VU state untouched. Unknown and historical
callers keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/fire-lockon-forward`, against parent `8cd62cd`
(PR #85). Parent headless/window binaries are preserved there and match PR #85's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
kinds 348 to 353). They are helper-boundary continuations and entries at the
call-return label after each block's heading bound (`14a44c`, `14a6b4`,
`14a900`), across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- The real window comparisons select the slot from the heading. Each run stops at
`particleCreateFx` (first two blocks) or `DispatchHit` (third block), after
frame `+40` has been consumed.
- The harness requires each entry to reach exactly its own transform. Every basis is
fixture-known, so every site is checked against an independent identity or
quarter-turn result. The launch point in frame `+40` is asserted exactly against
the original FPU arithmetic. Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+4c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 711 → 714,
real libm errno cases 839 → 835). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 181,248 generated sequences / 9,312 whole-memory
comparisons. Historical forward ABI coverage is 15,360 / 960; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `8cd62cd`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The six returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 58.7 ms of silence in one-player, 35.4 ms in four-player and 23.6 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The type a0 special in actual play, full campaign and physical controller/hardware acceptance remain open.
+93
View File
@@ -0,0 +1,93 @@
# Native FireSpecial forward transforms (types 20, 40, 60)
[The FireSpecial type a0 batch](NATIVE_FIRE_LOCKON_FORWARD.md) follows with six lock-on launch points.
Five `Launcher::FireSpecial` forward returns use native XYZ arithmetic after the
[LoopTank batch](NATIVE_LOOPTANK_FORWARD.md). Known forward coverage grows from 238 to
243 of 269 returns (26 remain). Known inverse coverage stays 134 of 134; BozoEngine
stays at `4a8f70a`.
`Launcher::FireSpecial` (`149718`) dispatches on the vehicle type at `+20a8`:
| Return PC | Vehicle type | Producer and consumer |
| --- | --- | --- |
| `1499d4` | `20` | For each shot, the table offset at `23cfe0` goes through the vehicle's coordinate system into frame `+0`. `mathfAddVector` adds the vehicle position and stores the result in the launcher's `+620`, the weapon's start |
| `149bb8` | `40` | Each of eight table points is copied into frame `+0` with zero height. It goes through the aim matrix at frame `+50` in place; its height and its distance from frame `+30` (`mathfDist3`) aim the shot |
| `149c28` | `40` | The next table point goes through that matrix into frame `+0`, plus the vehicle position, into `+620` |
| `149d8c` | `60` | With a shot armed (`+27c`, `+374`): `23cfa0` goes through the vehicle's system, plus the vehicle position, into `+620` |
| `149e14` | `60` | `23cfb0` goes through the matrix rebuilt from the launcher's angles at frame `+50` into frame `+0`, added into `+620` |
A consumer audit covered every path from each return until the owner returns or the
slot is rewritten. It found these consumers:
- `mathfAddVector`;
- the 32-bit height load (`149bb8`);
- `mathfDist3`, which reads `+0/+4/+8` only.
The weapon constructors, `GetLockOn` and the sound calls do not receive the frame
vector. They copy `+620` with `mathfCopyVector`, and launcher `+62c` has no reader.
FireSpecial never loads frame `+0c`, never loads 64 bits at frame `+08`, and never
loads 128 bits from its frame. It reads no VU registers, accumulator or flags.
`149bb8` is in place, so the input is read whole before the output is written. The
existing native helper computes separately rounded XYZ, preserves destination W and
leaves VU state untouched. Unknown and historical callers keep the original ABI. No
engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/fire-special-forward`, against parent `3c65abe`
(PR #84). Parent headless/window binaries are preserved there and match PR #84's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons (caller
kinds 343 to 347). They are helper-boundary continuations and entries across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- Entries:
- `149d8c` runs from the owner's start through the type dispatch and the armed
check.
- The others start at the call-return label before their transform: `149998`,
`149ba0` and `149c14` (all after the type's hardware timer read), and `149e00`.
- Each run stops at the first call after its result is consumed: `boundFAngle`,
`mathfDist3` or `GetLockOn`. A transform read only by `mathfDist3` is recorded at
that call with a zero base.
- Every basis is fixture-known, so every site is checked against an independent
identity or quarter-turn result. Published values are asserted exactly against the
original FPU arithmetic:
- the launcher's `+620`;
- the point `mathfDist3` receives, and that it receives that address.
Publications: 512 for each site.
- The volley fixture from PR #78 now sets the two registers a trailing comment had
hidden. All of its assertions still pass unchanged.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 705 → 711,
real libm errno cases 802 → 839). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 178,176 generated sequences / 9,120 whole-memory
comparisons. Historical forward ABI coverage is 14,976 / 936; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `3c65abe`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. `149bb8` and `149c28` are live on the one-player route: each runs natively 8 times with no recorded difference. The other three are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 52.0 ms of silence in one-player, 20.6 ms in four-player and 29.0 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The first window qualification's one-player run stopped at frame 4,340 on the vehicle-select screen. The main loop was waiting in `switchThread` from `updateMpegMovieDecoding` for 600 fields: the menu's background movie decoder stalled, before any gameplay (FireSpecial cannot run there). Four reruns of the same route (three with this build, one with the parent) and the fresh qualification above completed normally. The stall has not been seen before and is tracked separately; the evidence is in `fault-run/`. The FireSpecial specials in actual play, full campaign and physical controller/hardware acceptance remain open.
+83
View File
@@ -0,0 +1,83 @@
# Native FireSpecial forward transforms (types c0, 1e0, 220)
[The UpdateLauncher batch](NATIVE_UPDATE_LAUNCHER_FORWARD.md) follows with its three aim and muzzle points.
Six more `Launcher::FireSpecial` forward returns use native XYZ arithmetic after the
[FireSpecial type a0 batch](NATIVE_FIRE_LOCKON_FORWARD.md). Known forward coverage
grows from 249 to 255 of 269 returns (14 remain). Known inverse coverage stays 134 of
134; BozoEngine stays at `4a8f70a`. With these, every frame-output forward return in
FireSpecial is native. The remaining one, `14aff4`, writes the persistent vehicle
velocity and is handled with the other persistent slots.
| Return PC | Vehicle type | Producer and consumer |
| --- | --- | --- |
| `14acf0` | `c0` | The offset at `+400` goes through the vehicle's coordinate system into frame `+0`, added to the vehicle position into the launcher's `+620` |
| `14b3ec` | `1e0` (Minion) | The nozzle at `+3a0` goes through the matrix rebuilt at frame `+90` into `+620`, plus the vehicle position |
| `14b424` | `1e0` | The offset at `+3b0` goes through the matrix at frame `+40` into frame `+0`, added into `+620` |
| `14b618` | `220` (Tanker) | `23d1f0` goes through the matrix at frame `+30` into `+620`, plus the vehicle position; then it is aimed at the target (`mathfRotationFromPointToPoint`) |
| `14b65c` | `220` | `23d200` goes through frame `+30` into frame `+0`. Its only consumer is the next transform |
| `14b670` | `220` | That point goes through the turret node's matrix (`+2a0`, `+10`) in place, then is added into `+620`. `mathfSubVector` measures from `+620` |
The consumers are `mathfAddVector`, the next transform's input (whose W the
transform ignores), `mathfRotationFromPointToPoint` and `mathfSubVector`. They read
only XYZ. The weapon constructors copy `+620` with `mathfCopyVector`, and launcher
`+62c` has no reader. FireSpecial never loads frame `+0c`, and it reads no VU
registers, accumulator or flags.
`14b670` is in place, so the input is read whole before the output is written. The
existing native helper computes separately rounded XYZ, preserves destination W and
leaves VU state untouched. Unknown and historical callers keep the original ABI. No
engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/fire-torch-forward`, against parent `0676443`
(PR #86). Parent headless/window binaries are preserved there and match PR #86's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
kinds 354 to 359). They are helper-boundary continuations and entries at the
call-return label before each transform (`14acdc`, `14b3dc`, `14b414`, `14b604`,
`14b648`, `14b65c`), across four rounding modes, FTZ/DAZ, RAM aliases,
identity/quarter-turn bases and arbitrary W payloads.
- Each run stops at the first call after its result is consumed: `GetLockOn`,
`mathfMulMatrix`, `mathfRotMatrixPH`, `mathfRotationFromPointToPoint` or
`mathfSubVector`.
- A run from `14b648` reaches both Tanker turret transforms. The first output is
recorded, with a zero base, when the second transform reads it.
- Every basis is fixture-known, so every site is checked against an independent
identity or quarter-turn result. The launcher's `+620` is asserted exactly
against the original FPU arithmetic. Publications: 512 for each site, and 1,024
for `14b670`, which every `14b648` run also reaches.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
(frame `+0c` or launcher `+62c`) is normalized for test comparison, after every
real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 714 → 708,
real libm errno cases 835 → 831). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 184,320 generated sequences / 9,504 whole-memory
comparisons. Historical forward ABI coverage is 15,744 / 984; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `0676443`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The six returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 56.7 ms of silence in one-player, 32.4 ms in four-player and 24.8 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The c0, Minion and Tanker specials in actual play, full campaign and physical controller/hardware acceptance remain open.
+89
View File
@@ -0,0 +1,89 @@
# Native junk jet and blimp flight forward transforms
[Gas tank forwards](NATIVE_GASTANK_FORWARD.md) follow with three more environment sites.
Two waypoint-flyer forward returns use native XYZ arithmetic after the
[falling helicopter forwards](NATIVE_HELI_DEATH_FORWARD.md). Known forward coverage
grows from 150 to 152 of 269 returns (117 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `143468` | `JunkJet::UpdateJet` (`143310`) | Speed vector at `+20` through the jet's freshly rebuilt coordinate-system basis, added to its position |
| `10eca0` | `Blimp::UpdateBlimp` (`10eae8`) | The same for the blimp |
Each frame, the flyer steers toward its current waypoint (`atan2f`, bounded and
smoothed heading/pitch) and rebuilds its matrix with `mathfRotMatrixRPH`. It
smooths its speed and moves by the transformed speed vector. It then measures the
Manhattan distance to the waypoint and advances it when close. The jet then
updates its engine sound and grid membership, the blimp its grid membership and
sound. The result is the owner's frame vector at `+0`, read only by
`mathfAddVector`; frame `+10`/`+14` hold angles, and `+0c` is never read. Neither
owner reads VU registers, the accumulator or flags. The existing native helper
computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. Unknown and historical callers keep the original ABI. No engine or
gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/flyer-forward`, against parent `7e19e2b` (PR #63).
Parent headless/window binaries are preserved there and match PR #63's qualified
build. Generated bodies, retail data and runtime recordings stay outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
(caller kinds 255 and 256): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Full entries run the steering, matrix rebuild, speed smoothing, transform,
position update and waypoint check, with both a distant and a nearby waypoint.
They stop at the jet's `JetSound::updateJetSound` or the blimp's
`hdReparentCsGrid`, and reaching that boundary is asserted. The parked scenario
(jet inactive, blimp switched off) returns without a transform. Producer reach is
asserted in every case.
- Helper-boundary outputs are checked against an independent identity or
quarter-turn result. Full entries rebuild the basis from the steering angles
first, so those are covered by the native/original comparison. The published
position is asserted exactly against the original FPU addition. Each site
publishes in 480 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
at frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 718,
real libm errno cases 827 → 847). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 131,584 generated sequences / 6,208 whole-memory
comparisons. Historical forward ABI coverage is 9,152 / 572; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `7e19e2b`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. The junk jet return `143468` is live: it runs
natively 3,902 times on the one-player route with no recorded difference. The
blimp return `10eca0` is cold on these routes and is qualified by the generated
owner suite above.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. In the qualification one-player window run, the game ran
at 15-30 game frames per second from about game frame 3,750 (607 audio underruns,
4.9 s of silence). Other desktop programs were using CPU at the time. Two
back-to-back reruns of that route under the same conditions separate the build
from the machine. The new build averaged 59.7 game frames per second after frame
3,700 (11 underruns, 58.9 ms). The parent build, run right after, averaged
47.8 (49 underruns, 248.5 ms). The junk jet site ran about 1,706 times in each.
The slowdown is therefore machine load, not this change. Reviewed captures show
the intro and credits, menus, vehicle and level selection, driving with the HUD
and four simultaneous views. Each route has five distinct captures. Stereo
48 kHz, 16-bit WAV recordings contain nonzero audio.
Audio device underruns in the other routes: 30.6 ms silence in four-player and
20.9 ms in the movie run. These are functional checks, not a performance or
flawless-playback claim. The blimp in actual play, full campaign and physical
controller/hardware acceptance remain open.
+100
View File
@@ -0,0 +1,100 @@
# Native gas tank forward transforms
[Sinking blimp forwards](NATIVE_BLIMP_DEATH_FORWARD.md) follow with two more environment sites.
Three gas tank forward returns use native XYZ arithmetic after the
[junk jet and blimp flight forwards](NATIVE_FLYER_FORWARD.md). Known forward coverage
grows from 152 to 155 of 269 returns (114 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `135cf8` | `GasTank::UpdateGasTank` (`135c20`) | The rolling tank's velocity at `+30` through its own stored basis at `+40`, added to its coordinate-system position |
| `136200` | `GasTank::UpdateFalling` (`135fd8`) | A burst offset `(0,140,0)` through a random-heading matrix, transformed in place and added to the tank's home position |
| `1362ec` | `GasTank::UpdateFalling` (`135fd8`) | The same with offset `(0,150,0)` on the second, independent roll |
`UpdateGasTank` smooths the tank's spin, moves it by the transformed velocity, then
accumulates its spin angles and rebuilds its matrix with `mathfRotMatrixRPH`. Below
the floor it bounces: the height is clamped, the position is copied to the frame
vector, and sparks and a bounce sound follow. Otherwise it measures the Manhattan
distance to its home position from the game's table and lands when close (switch,
animation, falling sound and debris). The transform result is the frame vector at
`+10`. It is read only by `mathfAddVector`, then overwritten by `mathfCopyVector`
or `mathfSetFVector` (both XYZ-only) before `particleCreateFx` sees it. Frame `+1c`
is never read.
`UpdateFalling` waits for the fall animation to pass 75%. Then, unless the tank is
already down, a 1-in-16 roll throws a burst 140 units up along a random heading
(`mathfRotMatrixH`), and a 1-in-9 roll throws one 150 units up. Each offset is
transformed in place in the frame vector at `+20`, added to the home position,
its height randomized, and handed to `particleCreateFx`. That function reads its
point only through `mathfAddVector`, including in `particlePostInitFx` and its
recursive child effects. Frame `+2c` is never read; `+20..+28` are always rewritten
by `memset`, the per-axis random stores or `mathfSetFVector` before each use.
Neither owner reads VU registers, the accumulator or flags. The existing native
helper computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. It reads its input before writing, so the in-place transforms are safe.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/gastank-forward`, against parent `7b71504` (PR #64).
Parent headless/window binaries are preserved there and match PR #64's qualified
build. Generated bodies, retail data and runtime recordings stay outside Git.
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons
(caller kinds 257 to 259): helper-boundary continuations and full-owner entries,
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Rolling-tank entries run the spin smoothing, transform, position update, matrix
rebuild and home check. Scenarios cover a free roll (normal return), a bounce
(stops at the spark effect; clamped height and bounce factor asserted), a landing
near home (stops at `hierSetSwitch`; landed flag asserted) and an inactive tank
(no transform).
- Falling-tank entries run the real animation query (no animation is loaded, so the
percentage is -1), the tank-down gate and the real libc `rand` rolls. The fixture
seeds the game's actual `rand` state so each roll takes the intended branch.
Entries cover the first burst, the second burst, neither roll (normal return) and
a tank already down (no transform). Burst cases stop at `particleCreateFx`.
- Helper-boundary outputs, and rolling-tank entries whose basis is fixture-known,
are checked against an independent identity or quarter-turn result. Falling
entries build a random-heading basis first, so those are covered by the
native/original comparison. The published position (rolling) or burst point X/Y
(falling) is asserted exactly against the original FPU addition. The rolling site
publishes in 480 cases, the bursts in 480 and 448.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
(frame `+1c` rolling, `+2c` falling) is normalized for test comparison, after
every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 718 → 709,
real libm errno cases 847 → 820). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 133,120 generated sequences / 6,304 whole-memory
comparisons. Historical forward ABI coverage is 9,344 / 584; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `7b71504`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. None of the three gas tank returns runs on these
routes, so they are qualified by
the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 73.0 ms of silence in one-player, 30.2 ms in four-player and 25.7 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Gas tanks in actual play, full campaign and physical controller/hardware
acceptance remain open.
+82
View File
@@ -0,0 +1,82 @@
# Native graphics submission and completion
The player no longer drives the graphics DMA/register model. This change removes that dependency from execution;
the original instructions and BozoEngine's register model remain available to the historical call-log checker.
## Submission and ownership
- Mesh, particle, font/HUD and loading-screen hooks copy their draws into the native renderer in the game's order.
- `hierCheckVifComplete` submits the current view and reports it reusable immediately. This is completion of the
**game-side copy**, not completion of GPU rendering. No GPU fence or `glFinish` is required to release that queue.
- `hierFlushObjQ` clears the game's queued-view flags directly. The split-view flush submits its view and clears
its pending flags directly. Neither sends a dummy transfer or waits for a fabricated DMA interrupt.
- Native VU0 routine selection happens explicitly at the three program-selection sites. No upload or channel state
is involved. VU0 calculations themselves retain their existing arithmetic and context.
- Movie images are handed to native presentation. Their held-picture flag and decoded-picture count are released
directly, including an empty presentation. Field parity comes from the native frame clock.
## Retired hardware output
`runtime/tmb_graphics.cpp` lists 109 instruction sites in the USA executable. `bozo:native` exports these
sites to `bozo-externals` and `bozo-recomp`. The generated code calls an inline native replacement **before** the
original memory operation; handled sites never enter the MMIO dispatcher. This also works in branch delay slots.
The native completion tests never read `CPCOND0`. There is no replacement register bank or packet-chain decoder.
The packet/data builders that feed native hooks can still run; removing their unused construction work is a separate
optimization. Native materials accompany the draws, so the player also skips `sceGsPutDrawEnv`'s register mirroring.
BozoEngine's free host faults if this port reaches a retired GIF/VIF register/FIFO, graphics DMA channel, VU1 memory,
GS privileged register, or legacy DMA-condition poll. An uncovered path therefore fails visibly instead of falling
back to the model. The checker host leaves native instruction replacements unhandled and executes the originals;
existing store patches retain their instruction PC in that path.
## Deliberately retained
- Movie **input** synchronization (channel 4 and the FFmpeg decoder's demand) is separate from graphics output.
- The game timer, scheduler, native VU0 calculations, guest memory and audio behavior are unchanged in scope.
- SDK functions can still build PS2-format structures that the game or native material hooks inspect. These are
data compatibility, rather than transfers to a graphics device.
## Validation
Local artifacts are under `D:/BozoScratch/native-graphics` and are not committed with game data.
- The first guarded headless comparison completed 8,500 frames, including boot movies, menus, a level load and
2,909 gameplay frame ends. There were no unknown-register accesses or retired-graphics faults.
- Batch and vertex counts match the previous runtime on all 8,500 frames. Draw hashes match on 8,450 frames.
A diagnostic comparison of the first differing frame (6853) found the same batch order, materials and counts;
one transform and one vertex batch differ in small floating-point values. This is **not** a bit-exact draw claim.
Sound hashes also differ after gameplay starts; removing simulated completion events changes the scheduling trace.
- The original 9,001-frame windowed 1P smoke run completed at about 60 updates/s. Captures show the intro movie,
menus, the loaded arena, bots, rain, weapons and explosions. The output WAV contains the native audio stream.
Device statistics report 49.7 ms of underrun silence across the 150.7-second run; this is not an audio-perfection claim.
Final-build checks (BozoEngine `f715d57`):
- All **5 CTest checks pass**, including all **146 instruction cases**. The six new cases cover inline output,
output in a delay slot, native completion and the checker's original-operation fallback. Address-isolation checks
keep movie input, the game timer and VU0 data outside the retired-graphics guard.
- A fresh 8,500-frame headless run matches the first native run on every draw hash, batch/vertex count, sound hash
and EE clock value. No retired-graphics access or unknown register is reported.
- A no-input, no-skip movie/menu run completes **4,201 frames** and returns to the main menu. Captures of the intro
and main menu were inspected. Clock checks pass: **1.0000x**, **575,962 menu ticks/s**, **59.97 fields/s**;
the two measured movie sequences deliver **29.9987 and 29.9948 pictures/s**.
- Actual four-player split-screen completes **9,001 frames** on the snow arena. Captures at 5,500 and 8,000 were
inspected: four views, vehicles, HUD, pickups, snow and movement. The native audio stream is non-silent stereo
48 kHz; device statistics report 27.7 ms of underrun silence across 150.9 seconds.
- The historical boot checker reports **MATCH** on all **3,000 state frames**, with the established final-record-only
draw exception (2,999/3,000 draw hashes). This validates the retained diagnostic path; it is not the native player's
execution of hardware-output instructions.
- The historical 1P checker also reports **MATCH** on all **16,000 state frames**, with 15,999/16,000 draw hashes
matching (the same final-record exception). Its existing pinned-event allowances remain in force, and sound hashes
are reported rather than checked. Both historical checkers and the final native run exit successfully.
Full campaign/endings and additional physical controllers/hardware remain outside this smoke-test coverage.
## Main integration
BozoEngine's graphics change is merged through [engine PR #3](https://github.com/TheBozos/BozoEngine/pull/3),
at `5bb4efb`. The combined tree includes the current shared native port services and passes all **8 local CTest
checks**, plus Windows/Linux CI. Its 8,500-frame native run reproduces the previously tested native build exactly
on RAM, scratchpad, draw hashes/counts, sound hashes and EE clocks. A further **6,501-frame** windowed run passes
boot movies, loading and four-player play; inspected captures show the intro and the four snow-arena views.
+47
View File
@@ -0,0 +1,47 @@
# Native graphics services and readback boundary
TMB pins BozoEngine main `4a8f70a`, the merge of
[engine PR #5](https://github.com/TheBozos/BozoEngine/pull/5), discussed and qualified with DC and VP2S.
The engine removes `Libraries::gs`, the privileged register bank and its runtime GIF readers. SDK DMA
configuration/completion uses native jobs and callbacks; unknown device accesses and unowned readbacks
fail explicitly. This does not claim that every TMB packet-only producer or VU calculation is removed.
TMB also retires its old `sceGsExecStoreImageOverride` and `patchFlareDepth` adapter. They scanned image
packets for BITBLTBUF/TRXPOS/TRXREG even though the default particle path already uses game screen
coordinates with `flareDepthBlock` / `Renderer::depthAt`. The retired adapter and its packet logger are
gone. Native flare sampling uses the direct renderer interface.
The old depth-off/original-particle comparison branches are not a native device backend. A request for
SDK readback through them now stops with `sceGsExecStoreImage requires a native renderer readback override`.
This was checked with `TMB_NATIVE_FLARE_DEPTH=0`; no packet/device shadow or fabricated readback is supplied.
Full native coverage of those diagnostic branches is separate work.
## Independent qualification
Artifacts are local under `D:/BozoScratch/engine-pr5-baseline`.
- Unchanged published TMB source `74fd638` was exported into a separate source/build directory and
compiled against engine candidate `0c980b29`. Its window, headless and historical-checker tools build.
- The 9,500-frame 1P and 8,500-frame 4P routes complete with baseline-exact draw hashes/counts, sound
hashes/sample counts, calls, EE clocks, scratchpad and thread records against engine `149bf90`.
RAM hashes differ after the retired SDK state/packet writes; whole-RAM equality is not claimed.
- Windowed movie/menu playback completes 4,201 frames; 1P and 4P each complete 6,501. Direct captures
show decoded movie pictures, textured 1P combat and all four snow-arena views after loading.
- The final candidate `94b688d5` has the identical runtime tree. Its compiler includes the separately
merged guarded-adaptation and explicit-entry options. With no new options enabled, all 34 TMB
generated files are byte-identical to the qualified build. The merged engine tree matches that head.
## Combined TMB integration
- Vehicle main `92a7cfb`, the merged engine and the packet-adapter removal build all player/check tools.
The three native math/HUD/vehicle suites pass, together with all 13 local engine CTest checks.
- Combined 1P (9,500 frames) and 4P (8,500) reproduce every field of the independently qualified engine
records, including RAM, draws, sound, calls and clocks. This is separate from the old-engine RAM claim.
- Another windowed 6,501-frame movie/menu/loading/4P run completes. Direct captures show all four views
with textures, HUD and effects. Its audio log records 31.2 ms of silence; the separate movie/1P/4P
windows record 21.5/60.4/29.2 ms. Deterministic sound is exact, without a flawless device-audio or
subjective listening claim.
These are bounded smoke routes, not full campaign or console visual-parity acceptance. The historical
checker executable still builds; obsolete readback/device paths are not promised as replay-compatible.
TMB does not enable the new compiler `--patches` or `--entries` options in this pin change.
+82
View File
@@ -0,0 +1,82 @@
# Native falling helicopter forward transforms
[Junk jet and blimp flight forwards](NATIVE_FLYER_FORWARD.md) follow with two more environment sites.
The two helicopter death forward returns use native XYZ arithmetic after the
[Ferris wheel fall and smasher camera forwards](NATIVE_FERRIS_SMASHER_FORWARD.md).
Known forward coverage grows from 148 to 150 of 269 returns (119 remain). Known
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `12a180` | `EnvHeli::UpdateDeath` (`12a0f0`) | Smoothed fall velocity through the craft's stored basis at `+40`, added to its coordinate-system position |
| `1392e4` | `Helicopter::UpdateDeath` (`139250`) | The same with the basis at `+50`; at death frame 60 it then bursts into debris |
While the death timer runs (under 120 frames), each owner sinks and rolls the
craft (rebuilding the coordinate system's matrix with `mathfRotMatrixRPH`), smooths
the fall speed and moves the craft by the transformed velocity. The result is the
owner's frame vector at `+0`, read only by `mathfAddVector`. Neither owner touches
its frame after that, so `+0c` is never read, and neither reads VU registers, the
accumulator or flags. The existing native helper computes separately rounded XYZ,
preserves destination W and leaves VU state untouched. Unknown and historical
callers keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/heli-death-forward`, against parent `9daca2b`
(PR #62). Parent headless/window binaries are preserved there and match PR #62's
qualified build. Generated bodies, retail data and runtime recordings stay
outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
(caller kinds 253 and 254): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Full entries run the sink, roll, matrix rebuild, fall-speed smoothing,
transform and position update. The timeout scenario (timer reaching 120) takes
no transform and stops at the original `BlowDebris` (EnvHeli) or `Regen`
(Helicopter). The Helicopter's frame-60 scenario stops at `BlowDebris` after the
position update, and reaching it is asserted. `BlowDebris` and `Regen` have their
own transforms and effects and are not claimed here. Producer reach is asserted
in every case.
- Transform outputs are checked against an independent identity or quarter-turn
result in every reached case. The published position is asserted exactly
against the original FPU addition. Each site publishes in 480 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
at frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 715 → 709,
real libm errno cases 830 → 827). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 130,560 generated sequences / 6,144 whole-memory
comparisons. Historical forward ABI coverage is 9,024 / 564; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `9daca2b`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. Both new sites are cold on these routes, so the
generated owner suite above is their qualification. The Cop SUV site `1502cc`
still runs natively 1,638 times (one-player) and 845 times (four-player), exact.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. The first four-player window run, made while both headless
replays were running, drifted from its frame-scripted pad input and stayed on the
opponent-selection menu. That run is kept under `first-four-player` in the evidence
folder. A solo rerun of the same route reached the four-way match as usual, with
`1502cc` running natively 197 times. Reviewed captures show the intro and credits,
menus, vehicle and level selection, driving with the HUD and four simultaneous
views. Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
contain nonzero audio.
Audio device underruns remain: 58.5 ms silence in one-player, 39.4 ms in the
four-player rerun and 21.5 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. A helicopter destroyed in actual play, full
campaign and physical controller/hardware acceptance remain open.
+104
View File
@@ -0,0 +1,104 @@
# Native hierarchy collision calculations
The later [BSP/vehicle inverse increment](NATIVE_BSP_INVERSES.md) extends the eleven-entry allowlist
described below to fifteen and records its paired continuation checks and contact-W RAM boundary.
The subsequent [sphere/LOD increment](NATIVE_SPHERE_LOD.md) adds five collision-node/point returns,
bringing the inverse allowlist to twenty, and qualifies their scalar consumers.
The later [helper-consumer increment](NATIVE_HIERARCHY_HELPERS.md) extends it to twenty-four and
also retires eight height/BSP/line-of-sight forward returns.
The subsequent [query/lighting increment](NATIVE_HIERARCHY_QUERY_RESULTS.md) extends the inverse
allowlist to twenty-six and the forward allowlist to twenty-seven.
The later [BSP crossing increment](NATIVE_BSP_CROSSINGS.md) brings both allowlists to thirty-three,
with actual scalar crossing-point emission and meaningful inverse-W overwrite checks.
This increment replaces three calculation boundaries in the USA collision/height hierarchy. The player path
uses game records directly and leaves VU registers, accumulator, flags and data memory untouched.
BozoEngine stays at the previously qualified `4a8f70a`; no engine API or renderer change is included.
- `hdHatSphereTestAsm` (`1cf7c0`) now calculates the height-test sphere/projection result directly. It retains
the game's strict boundary rules, separately rounded arithmetic and scalar large-object shortcut. The
shortcut returns without reading any vector pointers. Radius comes from the first record's W; the scalar
argument controls the shortcut. The old `0xab0` microprogram is not called on this player path.
- Eleven audited `mathfMulVec` (`1da1e8`) call sites in `hdColGrid`, `hdHatTraverse`, `hdTraverse` and animated
hierarchy nodes use native inverse direction transforms. Inputs are snapped before writing, including
overlapping records. All four output components match: W is copied from the first basis record.
- `bspPlaneTest2Vec` (`201660`) uses native plane-distance pairs for `bspVecTestIn` (return `20134c`). The
two dot products keep their different X/Y addition orders. Only XY belongs to the distance result; Z/W
remain the destination's existing payload. The BSP caller reads only XY and performs its interpolation,
recursive branches, classification writes, timing and checkpoints in the existing scalar generated code.
Other inverse-transform callers and other plane-helper entries retain their original complete ABI. In
particular, the unused `bspInterp` helper expects the old register inputs; it is not silently redirected.
The historical checker retains the original helpers. `TMB_NATIVE_HIERARCHY_CHECK=1` independently executes
original helpers on copied contexts and compares their meaningful outputs; normal player runs do not.
## Validation
Local artifacts are under `D:/BozoScratch/hierarchy`, against published TMB `ce7eb9f` / engine `4a8f70a`.
- `tmb-native-hierarchy-tests`: 786,432 original/native helper cases, 384 complete flat-memory comparisons,
8,000 geometric boundary/degenerate cases and 1,024 complete recursive BSP callers pass. Another 32
complete-memory comparisons cover the callers, with the documented XY/preserved-ZW record contract.
These check saved registers, scalar interpolation, classifications, return and exact cycle/checkpoint
counts. Another 2,048 cases check the original ABI of unaudited inverse/plane callers. Native helpers
make no microprogram calls, preserve VU state and restore the caller's complete MXCSR.
- Four host FP modes, denormal controls, record overlap, RAM aliases, low address bits and scratchpad are
covered. Inverse/plane comparisons include arbitrary input bits. Sphere geometry comparisons use finite
coordinates/radii, including extreme exponents, signed zero, tangencies and zero-length segments. They
do not promise the retired microprogram's incidental IEEE NaN payload/sign propagation.
- Existing native matrix/direction, HUD and vehicle suites pass, together with 12 release-tool regressions.
- Strict 1P (9,500 frames) and 4P (8,500) complete with 4,977,182 / 1,560,611 original helper comparisons
and zero mismatches. The sphere wrappers run 1,064,321 / 105,211 times (896,184 / 68,984 scalar shortcuts);
native BSP pairs run 3,853,147 / 1,453,288 times. Six inverse sites are reached by 1P and two by 4P;
the other five sites have differential unit coverage, without a live-route coverage claim.
- Separate default runs make zero original comparisons and reproduce both strict recordings byte-for-byte.
Against main, every frame has identical draw hashes/counts, sound hashes/sample counts, library call hashes/
counts, EE clocks, scratchpad and thread records. RAM differs from frame 5591 / 4700; see below. Default
runs avoid 168,137 / 36,227 height-test microprogram invocations; this is a call count, not a speedup claim.
- Windowed default runs complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P, through
loading into active arenas. Direct captures show decoded movie pictures, menus, textured combat, HUD,
effects and four snow-arena views with driving/firing. Audio logs report 15.9 / 34.7 / 29.4 ms of silence
and some dropped device frames. Deterministic sound is exact; flawless device audio or subjective
listening acceptance is not claimed. These are bounded smoke routes, not full campaign qualification.
## RAM boundary
Removing register clobbers deliberately changes raw RAM left by subsequent full-vector stores. A temporary
write trace identified `bspPlaneTest2Vec` at its audited caller storing stale VF12 Z/W into recursive stack
records. Its scalar caller reads only the two distances. The native helper now preserves those unused
destination components, without transferring register state.
At the 2,000-update gameplay snapshot, the final native build differs from main in 330 words: 329 in the
inactive stack range `8fdbe8..8ff358`, plus `23decc`. The latter is a fourth-component padding word copied
by `mathfMulMatrix3x3` (`1da428`, return `1ee020`) in `RigidBody::computeAuxiliarys`: the temporary input
matrix initializes only its three numerical rows/components. This trace is evidence for that snapshot,
not a whole-campaign proof that every raw-RAM difference is harmless. No stale register restoration,
padding restoration, shadow VU bank or widened memory-hash mask is added. Temporary tracing is absent
from the regenerated production output and the engine checkout remains clean.
## Remaining work
The later [traversal/setup increment](NATIVE_HIERARCHY_TRAVERSAL_SETUP.md) extends inverse/forward
qualification to database traversal and older collision, terrain and animated-node setup.
The [older BSP/root increment](NATIVE_LEGACY_BSP_HELPERS.md) adds setup/result transforms and
root/grid/traversal inverse leaves, retaining real query and traversal dispatch.
The [point/ray increment](NATIVE_POINT_RAY_HELPERS.md) adds coordinate-system/root inverses and
complete point-contact/ray result tails.
The [terrain-input increment](NATIVE_TERRAIN_INPUT_HELPERS.md) adds animated-node, terrain-bounds
and height/material-query inverse transforms, retaining scalar height and grid calculations.
The [terrain-query increment](NATIVE_TERRAIN_QUERY_HELPERS.md) adds LOS/cell/ray inputs and
result reconstruction, retaining the scalar query and normalized publication code.
The [car/particle increment](NATIVE_CAR_PARTICLE_HELPERS.md) adds the remaining older car-debug
and hierarchy particle forward returns, checking actual debug vertex and scalar position consumers.
The [final terrain-call increment](NATIVE_TERRAIN_FINAL_HELPERS.md) adds debug line/box,
edit and wave inverses. These two transform helpers now have no remaining original direct calls
in the audited hierarchy/terrain owner ranges; other helpers and inline VU remain.
The subsequent [`NATIVE_SCENE.md`](NATIVE_SCENE.md) increment replaces the renderer hierarchy's root/child
matrix stack, FOV, distance/LOD and point-light selection together with their producers, accessors and mesh
consumers. Other game math helpers and VU macro blocks remain. Neither increment claims complete VU
removal or full campaign/console visual parity.
The later [attractor-group increment](NATIVE_ATTRACTOR_GROUPS.md) adds point-in-group,
center and random-position inverse leaves, with complete selection/publication consumers,
generated random producers and an audited indirect peel-out W boundary.
+89
View File
@@ -0,0 +1,89 @@
# Native hierarchy helper consumers
The later [query/lighting increment](NATIVE_HIERARCHY_QUERY_RESULTS.md) adds twelve further returns,
bringing the inverse/forward allowlists to twenty-six / twenty-seven.
Twelve more hierarchy return sites use the existing native record calculations. The inverse
allowlist grows from twenty to twenty-four entries; forward directions grow from nine to seventeen.
BozoEngine remains pinned at `4a8f70a`. This change extends the
[sphere/LOD increment](NATIVE_SPHERE_LOD.md), without an engine or renderer change.
| Helper | Return PCs | Owner |
|---|---|---|
| Inverse `1da1e8` | `1d0de0`, `1d0dfc`, `1d12d8` | Segment collision grid `1d0988` |
| Inverse `1da1e8` | `1d4b94` | Control-node BSP segment setup `1d4ab8` |
| Forward `1da298` | `1cfd18`, `1cfde8` | Height collision-volume results `1cfb10` |
| Forward `1da298` | `1d0224`, `1d0250` | Height BSP results `1d0190` |
| Forward `1da298` | `1d25ec`, `1d261c` | Line-of-sight BSP results `1d2560` |
| Forward `1da298` | `1d2784`, `1d2804` | Line-of-sight volume results `1d26f0` |
The player leaves snapshot matrix/input records before writing, retain separately rounded XYZ
arithmetic, and leave VU registers, accumulator, flags and data memory untouched. Inverse output
matches all four components, including basis[0].W; forward output preserves destination W.
The actual scalar dot products, interpolation, result publication, squared-distance calculations,
packed metadata, traversal, callbacks, clocks/checkpoints and epilogues remain compiled game code.
Historical hosts and unaudited return sites retain the original complete helper ABI. Other helper
callers and inline VU operations remain; this is not complete VU removal.
## Numerical and consumer checks
Local evidence is under `D:/BozoScratch/hierarchy-helpers`, against main `4b36de2` (PR #25).
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
- `tmb-native-hierarchy-tests` adds 6,144 real generated consumer sequences and 192 complete-memory
comparisons across all twelve returns. They cover four host FP modes, denormal controls, RAM
aliases and arbitrary forward-output W payloads. CPU state outside retired VU, complete outgoing
host FP effects, clocks/checkpoints and other memory must match; native VU state must be untouched.
- The original forward helpers run with their actual W values and VU effects through every real
consumer in a sequence. Only the final unused forward-output W fields are normalized afterward.
W-dependent scalar results, register effects or other copied memory would therefore fail the
comparison. Inverse outputs are compared without a component mask.
- Grid sequences stop before the following matrix helper or hierarchy push; the control sequence
stops at the BSP query dispatch. Height normal publication runs through its following dot product
to the double-conversion boundary; its offset tail runs through scalar addition and return.
Both BSP result tails and the line-of-sight volume tail exercise their actual scalar publication,
distance/metadata branches and return. These tests start at helper calls, not at complete query roots.
- The hierarchy suite also retains 786,432 helper comparisons, 384 complete-memory checks, 8,000
geometric edges, 1,024 recursive BSP callers (32 complete-memory checks), 2,048 unknown-caller ABI
cases, and now 1,536 historical inverse cases across all twenty-four returns (24 complete-memory
checks). Another 512 historical forward cases/32 complete-memory checks cover the eight new returns.
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks and 2,048
unknown-caller ABI cases, with overlap, address alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python tooling
tests pass. After temporary diagnostics, restored sources were forced to rebuild; the native math
object matches its original qualified hash and the three executables contain no observer marker.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Every
non-RAM frame-record field matches the baseline throughout: scratchpad, calls/counts, draws/counts,
sound/sample counts, thread state and EE clock. Strict contact, hierarchy, math and projection
comparisons pass; strict/default recording and snapshot files are identical. Defaults make zero
original comparisons and zero VU0 microprogram calls.
After diagnostic removal, another clean default replay of both full routes reproduces the qualified
recording and snapshot files byte-for-byte; all eleven native suites also pass on the restored build.
The four new inverse returns retire another 185,191 / 65,299 original helper executions in
one-player / four-player. The control node accounts for 182,727 / 55,901; the first two grid returns
each account for 1,232 / 4,699. The third grid return `1d12d8` has generated-consumer/unit coverage
but is absent from these live routes. All eight new forward returns run in one-player, totaling
24,308 executions; four-player totals 692. Thus this batch retires another 209,499 / 65,991 original
helper executions. These counts are not timing or FPS measurements.
RAM hashes differ on 3,447 one-player frames (first 5591, last 9499) and 3,741 four-player frames
(4759 through 8499). Complete 32 MB snapshots at one-player frame 7000 and four-player frame 6000
each differ by two bytes in one stack word: `8ff21c` changes from 60.0 to zero; `8ff16c` from 89.0
to zero, respectively. Paired baseline/native observers directly trace both to forward return
`1d0250`, the height BSP temporary at SP+`10` with unused W at SP+`1c`. The original helper stores
inherited VF16.W; native XYZ publication preserves the existing zero. Diagnostic snapshots match
their corresponding qualified snapshots exactly. The scalar addition following this helper reads
only XYZ; generated consumer tails retain the complete CPU/FP/memory checks described above.
This is bounded snapshot/consumer evidence, not proof that every RAM difference or campaign path
has been exercised. No hash mask, padding restoration, shadow VU state or observer is shipped.
Fresh window runs complete 4,201 game frames for movies/menus and 6,502 each for one-player and
actual four-player (4,200 / 6,501 / 6,501 counted after the first presented picture). Reviewed captures
show decoded movie pictures, Junkyard loading and rainy combat, and four advancing snow-arena views.
Device logs report 21.6 / 49.9 / 40.3 ms of silence (movie / one-player / four-player), with underruns
and dropped audio frames. Deterministic sound records match. Full campaign acceptance, flawless
device audio and console visual parity remain unclaimed.
+97
View File
@@ -0,0 +1,97 @@
# Native hierarchy query and lighting transforms
The subsequent [BSP crossing increment](NATIVE_BSP_CROSSINGS.md) adds thirteen further returns,
bringing both inverse and forward allowlists to thirty-three.
Twelve further hierarchy returns use the existing native record implementations: ten forward
directions and two inverse directions. The audited allowlists now contain twenty-seven forward
and twenty-six inverse returns. This extends [the grid/result increment](NATIVE_HIERARCHY_HELPERS.md).
BozoEngine remains pinned at `4a8f70a`; no shared engine or renderer change is included.
| Helper | Return PCs | Owner |
|---|---|---|
| Inverse `1da1e8` | `1cd400` | Animated collision transform `1cd180` |
| Inverse `1da1e8` | `1cd768` | BSP auxiliary segment setup `1cd538` |
| Forward `1da298` | `1cbbc8`, `1cbc2c` | Point-contact result `hdPunt`, `1cba48` |
| Forward `1da298` | `1cc634`, `1cc6b4` | Line-contact result `1cc588` |
| Forward `1da298` | `1ccec8`, `1ccef8` | Terrain point check `1cce58` |
| Forward `1da298` | `1cd884`, `1cd8b4` | BSP auxiliary result publication `1cd538` |
| Forward `1da298` | `1d41c8` | Burning attachment point `1d4188` |
| Forward `1da298` | `1d9cac` | Light-volume colour coordinates `1d9c30` |
The leaves snapshot operands before overlapping writes and preserve the existing separately rounded
arithmetic. Inverse XYZW matches the original, including basis[0].W; forward XYZ matches while
destination W is preserved. The player path leaves VU registers, accumulator, flags and data memory
untouched. Scalar interpolation, normalization, result packing, matrix allocation/index bookkeeping,
colour sampling/interpolation, view lookup, clocks/checkpoints and callbacks remain compiled game
code. Historical hosts and unaudited callers retain their original full ABI. Other helper returns
and inline VU operations remain; this is not complete VU removal.
## Numerical and consumer checks
Local evidence is under `D:/BozoScratch/hierarchy-query-results`, against main `9a8e698` (PR #26).
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
- The hierarchy consumer harness grows from 6,144 to 12,288 generated sequences, with 384
complete-memory comparisons (6,144 / 192 added). Four host FP modes, denormal controls, RAM
aliases and arbitrary output W payloads are covered. The reference runs the real original
forward helpers and leaves their W/VU effects alive throughout each consumer sequence. Only
final unused forward-output W fields are normalized afterward. CPU outside retired VU, complete
outgoing host FP effects, clocks/checkpoints and other memory must match; native VU is untouched.
Inverse XYZW is compared without a component mask.
- Point and line tails run through scalar reconstruction, squared distance where applicable, packed
material/result fields and return. Terrain tails stop at result-buffer clearing after their actual
zero/copy, normalization and unit-box branches; exact and adjacent axis limits are included.
- The animated-node tail exercises matrix-capacity values 0, 1199 and 1200, the retained scalar matrix
product and model-mode index publication through return. BSP inverse setup stops at its segment
query dispatch; auxiliary result publication stops at the next point-loop boundary after metadata
writes. These are helper-consumer sequences, not complete query-root/callback coverage.
- The burning-attachment sequence runs view lookup and XYZ addition to the burning-point callback
dispatch. The light-volume sequence runs the full remaining colour tail, including wrapping,
disabled sampling, four-texel interpolation, double-precision scalar helpers and RGBA packing.
Half-texel neighbouring representations and independent colour payloads are included. This does
not claim a new particle producer or a replacement for the complete light-volume owner.
- Historical forward checks grow to 1,152 cases / 72 complete-memory comparisons (640 / 40 added).
The hierarchy suite retains 786,432 helper comparisons, 384 complete-memory checks, 8,000 geometric
edges, 1,024 recursive BSP callers / 32 complete-memory checks and 2,048 unknown-caller ABI cases.
Historical inverse checks now cover all twenty-six returns: 1,664 cases / 26 complete-memory checks.
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks and 2,048
unknown-caller ABI cases, including overlap, alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python tooling
tests pass. After temporary diagnostics, restored sources are forced to rebuild; the math object
matches its original qualified hash, all three executables lack observer markers and all eleven
suites pass again on the restored build.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Every
non-RAM frame-record field matches the baseline throughout: scratchpad, calls/counts, draws/counts,
sound/sample counts, thread state and EE clock. Strict contact, hierarchy, math and projection
comparisons pass; strict/default recordings and snapshots are identical. Defaults perform zero
original comparisons and zero VU0 microprogram calls.
After diagnostic removal, clean default replays of both full routes reproduce the qualified
recording and snapshot files byte-for-byte.
The new forward returns retire 59,521 / 21,822 original helper executions in one-player / four-player;
all ten run in one-player. The two new inverse returns execute 15,991 and 7 times in one-player,
and are absent from the four-player route, with differential consumer/unit coverage retained.
The batch therefore retires another 75,519 / 21,822 original helper executions. These are counts,
not timing or FPS measurements.
RAM hashes differ on 3,421 one-player frames (first 5594, last 9499) and 2,713 four-player frames
(first 4703, last 8499). Complete 32 MB snapshots at one-player frame 7000 and four-player frame
6000 each differ by one byte in a stack W word: `8fedcc` is zero versus native bits `000000d6`;
`8fef6c` is zero versus native bits `00000007`, respectively. Paired observers directly identify
line-result return `1cc6b4`, whose output is SP+`20` and unused W is SP+`2c`. At identical EE clocks,
the original overwrites the existing integer payload with inherited VF16.W zero; native preserves
it. Diagnostic snapshots exactly reproduce their corresponding baseline/native snapshots.
The following scalar consumers use XYZ, with complete tail checks above. This is bounded snapshot
evidence, not a classification of every raw-RAM difference or campaign consumer. No new hash mask,
padding restoration, shadow VU state or observer is shipped.
Fresh window runs complete 4,201 game frames for movies/menus and 6,501 each for one-player and
actual four-player. Reviewed captures show decoded movie pictures, Junkyard loading and rainy
combat, and four advancing snow-arena views. Device logs report 25.2 / 64.5 / 27.8 ms of silence
(movie / one-player / four-player), with underruns and dropped audio frames. Deterministic sound
records match. Full campaign acceptance, flawless device audio and console visual parity remain
unclaimed.
+93
View File
@@ -0,0 +1,93 @@
# Native traversal and older collision setup transforms
Thirteen more hierarchy returns use the existing native record calculations: nine inverse and
four forward sites bring the allowlists to forty-two and thirty-seven entries respectively.
This extends the [BSP crossing increment](NATIVE_BSP_CROSSINGS.md). BozoEngine remains pinned at
`4a8f70a`; no engine or renderer change is included.
| Helper | Return PCs | Owner |
|---|---|---|
| Inverse `1da1e8` | `1c0684`, `1c0884`, `1c0a70` | Database traversal `1c0300` |
| Inverse `1da1e8` | `1c5d0c` | Older collision grid `1c5470` |
| Inverse `1da1e8` | `1c639c` | Older hierarchy traversal `1c60e8` |
| Inverse `1da1e8` | `1c6bf4`, `1c6c94`, `1c6f04` | Older collision node `1c6ad0` |
| Inverse `1da1e8` | `1c7620` | Older animated node `1c73a0` |
| Forward `1da298` | `1c6bac`, `1c6c54` | Older collision node `1c6ad0` |
| Forward `1da298` | `1c7134`, `1c7160` | Older terrain setup `1c70c0` |
Native leaves snapshot inputs before overlapping writes, calculate separately rounded XYZ and
leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW is exact, including
meaningful basis[0].W; forward XYZ is exact while existing destination W is preserved. Unknown
callers and historical hosts retain the full original helper ABI. Scalar matrix products,
normalization, callbacks, query dispatch, clocks and checkpoints remain compiled game code.
Other helper returns and inline VU operations remain; this is not complete VU removal.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/hierarchy-traversal-setup`, against main `a29c09f` (PR #28).
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
- The consumer harness grows from 18,944 to 25,600 sequences and from 592 to 800 whole-memory
comparisons (6,656 / 208 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
other memory match; native VU remains untouched.
- Database continuations run actual matrix copying/products into the indirect callback boundary,
or scalar vector addition into the modeled-effect creation boundary. Tests stop before callback
or particle dispatch; they do not claim complete traversal or modeled-particle producer coverage.
- Grid/traversal tails retain capacity-counter updates at 0 and 1199 and compare the next scalar
matrix-product arguments. Animated-node tails run that product, index publication and return,
including capacity 0, 1199 and 1200. General child traversal is outside these fixtures.
- Collision-node sequences run world/local additions, paired transforms, point-mode selection,
zero/copy/normalization and unit-box decisions through the first plane-dot dispatch. Exact and
adjacent unit-axis values are included. Terrain sequences run both world-point sums through
the next zeroing-call boundary. Complete collision/terrain queries are outside these fixtures.
- Reference forward W and VU effects stay live throughout real consumers. Only final unused
forward-output W fields are normalized afterward; any later inverse overwrite retires that
exclusion so meaningful inverse W remains compared exactly.
- Historical forward checks grow to 1,792 cases / 112 whole-memory comparisons (256 / 16 added).
Historical inverse checks cover all forty-two returns: 2,688 cases / 42 whole-memory comparisons.
The hierarchy suite retains 786,432 helper cases, 384 whole-memory checks, 8,000 geometric edges,
1,024 recursive BSP callers / 32 whole-memory checks and 2,048 unknown-caller ABI cases.
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python
tooling tests pass.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Strict
contact, hierarchy, math and projection checks pass; strict/default recordings and snapshots are
byte-identical. Every non-RAM frame-record field matches baseline throughout: scratchpad,
calls/counts, draws/counts, sound/sample counts, thread state and EE clock. The entire four-player
recording is also baseline-byte-identical, including RAM. Default runs perform zero original
comparisons and zero VU0 microprogram calls.
All thirteen added sites execute in one-player: 20,086 inverse and 11,521 forward calls. Four-player
reaches the first two database traversal inverses, 820 calls combined; the other sites have
generated-consumer and historical-ABI coverage. This retires another 31,607 / 820 original helper
executions in one-player / four-player. These are counts, not timing or FPS measurements.
One-player RAM hashes differ on 2,058 frames, first at 7003 and last at 9499. The complete 32 MB
snapshot at frame 7000 is baseline-identical, as is four-player at frame 6000. A paired late
snapshot at frame 9499 differs by ten bytes in four W words: `23deac`, `23defc`, `23e38c`, `23e3dc`.
Temporary write observers identify scalar `mathfMulMatrix3x3` (`1da428`, return `1ee020`) copying
SP+`0c` (`8ff0cc`) into the first W of the two matrices, then original inverse calls (`1ee030`
and `1ed6c4`) copying basis[0].W into their result W. The matrix owner
`RigidBody::computeAuxiliarys` initializes only three components in each temporary row; the
scalar product copies the untouched W independently of its numerical 3x3 calculation. Baseline
words are `42700000` / `c4f00000`; native words are `02000200` / zero. These are inherited
temporary-padding differences, not changed XYZ products. The original inverses preserve their
full ABI and copy those W values exactly. This is a bounded source/snapshot/write-chain audit,
not a classification of every RAM difference or possible campaign consumer.
Paired observer recordings and snapshots reproduce both late qualified runs exactly. Observers
were removed, restored sources forced to rebuild, the generated object matches its original
hash, and all three executables contain no observer markers. No padding restoration, hash mask
or shadow VU state is shipped. All eleven native suites pass again, and clean default replays
reproduce both complete qualified recordings and snapshots byte-for-byte.
Fresh window routes complete 4,201 movie/menu frames and 6,501 each for one-player and actual
four-player. Reviewed captures show decoded movie pictures, Junkyard loading and active rainy
combat, and four advancing snow-arena views. Device logs report 19.2 / 52.0 / 28.4 ms of silence
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound records
match; flawless device audio, full campaign acceptance and console visual parity remain unclaimed.
+69
View File
@@ -0,0 +1,69 @@
# Native HUD point and direction transforms
`updateHUDPosition` now computes its six inline transforms directly over game records. The three point
blocks apply a basis to XYZ and add the current translation; the three direction blocks apply only the
basis. Each block snapshots its inputs at its existing final store, after earlier writes, then writes XYZ.
The destination's fourth component remains unchanged. It is an opaque payload here, rather than an
output from an unrelated VU register. The point-projection and vector-add consumers use XYZ.
| Original block | Final store | Calculation |
| --- | --- | --- |
| `13ce74..13ce98` | `13ce98` | Position plus translation |
| `13ceb4..13ced8` | `13ced8` | Projected HUD point plus translation |
| `13d03c..13d060` | `13d060` | Second HUD position plus translation |
| `13d210..13d22c` | `13d22c` | Targeting direction |
| `13d308..13d324` | `13d324` | Targeting direction |
| `13d408..13d424` | `13d424` | Warning direction |
The 54 original load/arithmetic/store instructions are lowered through the existing native instruction
dispatcher. The player path neither loads VU registers nor transports accumulator/flag state. Ordinary
CPU branches, calls and checkpoints retain their existing positions. The number-format and separately
rounded SIMD arithmetic follow [`NATIVE_MATH.md`](NATIVE_MATH.md).
## Independent original comparisons
`tools/tmb_hud_fixture.py` extracts the exact fallback instruction bodies from fresh BozoEngine output
in the build tree. It rejects missing, duplicate or non-straight-line memory/vector instructions.
No generated code or game data is committed. The historical host retains its original instruction path.
`TMB_NATIVE_HUD_CHECK=1` runs the extracted original block on a copied context and temporarily saved
output, compares XYZ, then restores the output before the native write. W is deliberately outside the
numeric comparison: the original store copies a stale register lane, whereas the native store preserves
the destination payload. Default execution never invokes the original block or reads VU state.
Build and run `tmb-native-hud-tests` for the original-block/production-dispatcher comparisons:
- 196,608 cases across all six blocks and four host FP modes compare every arena byte against the
original calculation with the documented W-preservation contract. Inputs include arbitrary bits,
finite game values, extreme exponents, denormals, scratchpad, address aliases, low address bits and
partial/identical overlaps. Every CPU/VU context byte and the host MXCSR remain unchanged.
- 192 cases compare the complete flat guest memory. Before the final store, the original load/arithmetic
sites leave memory unchanged on the native path.
- 1,024 two-block overlap cases require the second calculation to read the first block's updated input
or basis. A function-entry snapshot would fail these cases.
- The existing 524,288 camera-matrix cases and 12 release-tool regressions still pass.
## Gameplay validation and limits
Local artifacts are under `D:/BozoScratch/native-hud`.
- The 9,500-frame 1P route checks each affine block 3,904 times, without an XYZ mismatch.
- The 8,500-frame 4P route checks each affine block 22,782 times, without an XYZ mismatch.
- Against the prior native-matrix main build, every comparable 1P and 4P draw hash, batch/vertex count,
sound hash/sample count, call, EE cycle, scratchpad and thread record matches.
- The three direction blocks pass the generated-original tests above but were not reached by these
ordinary gameplay scripts. Targeting-warning gameplay coverage and full campaign acceptance remain
open. This is not a whole-function native claim: other HUD callees still contain compatibility math.
Separate default runs reproduce all strict 1P/4P frame records exactly, without invoking original HUD
blocks. RAM hashes differ because the native stores preserve destination W. At point 8500 the complete
1P RAM dump differs at two words (`4a1ebc`, `4a1f5c`); the 4P dump differs at five (`4a187c`, `4a191c`,
`4a19bc`, `4a1a5c`, `4a1c3c`). All are position.W in coordinate records reached through the two HUD
pointer arrays at `23c548` and `23c558`; the native value is the preserved zero in each. No other RAM
word differs at those snapshots, and no VU shadow restoration is used.
Windowed default runs complete 4,201 movie/menu frames and 9,001 frames each for 1P and 4P. Captures
directly show the opening movie and active gameplay after loading, including all split-screen views.
The window audio logs report 13.6/50.0/6.5 ms of silence respectively; deterministic sound records are
exact, but this is not a flawless device-audio or subjective listening claim. These are bounded smoke
checks, not full campaign or console visual-parity acceptance. Windows/Linux CI passes.
+72
View File
@@ -0,0 +1,72 @@
# Native HUD laser forward transforms
[The BlowDebris batch](NATIVE_BLOW_DEBRIS_FORWARD.md) follows with the debris pieces' six sites.
The two `Hud::BuildLaserStuff` forward returns use native XYZ arithmetic after the
[UpdateLauncher batch](NATIVE_UPDATE_LAUNCHER_FORWARD.md). Known forward coverage
grows from 258 to 260 of 269 returns (9 remain). Known inverse coverage stays 134 of
134; BozoEngine stays at `4a8f70a`. The nine that remain write persistent object
fields and are handled together.
`Hud::BuildLaserStuff` (`1425b8`) draws the laser sight of the HUD's vehicle (`+5e0`)
when the vehicle carries a laser (`+2438`):
| Return PC | Producer and consumer |
| --- | --- |
| `142640` | The table offset `4e6ef0` (copied to frame `+70`) goes through the vehicle's coordinate system into frame `+10`. `mathfAddVector` adds the vehicle position into frame `+90` |
| `1426cc` | `4e6f00` (frame `+80`) goes through the aim matrix rebuilt at frame `+30` into frame `+10`. It is added into frame `+90`, which `mathfTransform3dTo2d` projects |
`mathfAddVector` reads its operands as XYZ and writes XYZ, so the forward W is not
carried into frame `+9c`. The projection's input is frame `+90`, not the transform
output. The owner never loads frame `+1c`, and it reads no VU registers, accumulator
or flags. The existing native helper computes separately rounded XYZ, preserves
destination W and leaves VU state untouched. Unknown and historical callers keep the
original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/hud-laser-forward`, against parent `0fb62aa`
(PR #89). Parent headless/window binaries are preserved there and match PR #89's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 363 and 364): helper-boundary continuations and entries, across four rounding
modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W payloads.
- `142640` runs from the owner's start: the current view, the table copies and the
laser check. It stops at the following `boundFAngle`. `1426cc` starts at the
call-return label after the aim matrix rebuild (`1426bc`) and stops at
`mathfTransform3dTo2d`.
- Every basis is fixture-known, so both sites are checked against an independent
identity or quarter-turn result. Frame `+90` is asserted exactly against the
original FPU arithmetic. Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+1c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 711 → 707,
real libm errno cases 810 → 859). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 186,880 generated sequences / 9,664 whole-memory
comparisons. Historical forward ABI coverage is 16,064 / 1,004; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `0fb62aa`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. Both returns are live on the four-player route: each runs natively 88 times with no recorded difference.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 47.0 ms of silence in one-player, 28.8 ms in four-player and 20.4 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Full campaign and physical controller/hardware acceptance remain open.
+35
View File
@@ -0,0 +1,35 @@
# Native image-builder completion
BozoEngine's native graphics mode returns zero from `sceGsSetDefLoadImage` and
`sceGsSetDefStoreImage` without constructing unused image packets or reading the output pointer.
Generic SDK callers keep their existing output ABI. The shared implementation is
[`64f6b22`, engine PR #4](https://github.com/TheBozos/BozoEngine/pull/4), contributed by the DC port
after discussion with TMB and VP2S. The first adoption pinned engine main `149bf90`, whose source tree
exactly matches that tested implementation. The later graphics-services pin and packet-reader retirement
are recorded in [`NATIVE_GRAPHICS_SERVICES.md`](NATIVE_GRAPHICS_SERVICES.md). Neither adds image readback support.
TMB's `tmb_textures.cpp::sceGsSetDefLoadImageOverride` still binds resident RTX records and advances
the ordinal before calling the SDK builder. The shared guard runs after those game-owned updates.
Movies use decoded native pictures through `loadImageOverride`; they do not consume the skipped packet.
No TMB texture-manager layout was copied from DC.
## Validation
Local artifacts are under `D:/BozoScratch/native-images`, compared with the retained HUD-main build
at `5b5cd57` (engine `5bb4efb`).
- Nine engine CTest checks pass, including native/generic image builders and inaccessible-output guards.
- The existing HUD and camera math suites pass on the new engine head.
- A 9,500-frame 1P run and an 8,500-frame 4P run have exact baseline draw hashes, batch/vertex counts,
sound hashes/sample counts, calls, EE clocks, scratchpad and thread records.
- Both routes reproduce all six baseline texture-initialization diagnostic lines exactly, including
resident texture ordinals and file identities. No texture-number mismatch was observed.
- RAM hashes differ because the SDK packet writes are absent. Whole-RAM equality is not claimed.
- Windowed default runs complete 4,201 movie/menu frames, 6,501 1P frames and 6,501 4P frames.
Direct captures show the opening movie, active 1P combat and all four snow-arena views after loading,
with resident textures and HUD present. The window logs record brief audio underruns; deterministic
sound comparisons are exact, but this is not a flawless device-audio or subjective listening claim.
- All 12 release-tool tests and Windows/Linux engine CI pass.
The change retires two packet serializers in the default native path. Other game-owned unused builders,
compatibility data and VU0 math remain separate work. It does not claim full campaign or console parity.
+107
View File
@@ -0,0 +1,107 @@
# Native falling junk jet forward transforms
[Helicopter gun and walking pedestrian forwards](NATIVE_ENVHELI_PED_FORWARD.md) follow with two single-site owners.
Six junk jet death forward returns use native XYZ arithmetic after the
[sinking blimp forwards](NATIVE_BLIMP_DEATH_FORWARD.md). Known forward coverage
grows from 157 to 163 of 269 returns (106 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
All six are in `JunkJet::UpdateDeath` (`143728`) and transform through the jet's
coordinate-system basis into the owner's frame vector at `+0`:
| Return PC | Path | Producer and consumer |
| --- | --- | --- |
| `143864` | Every frame | The velocity at `+20`, added to the jet's position |
| `143940` | High (above 50), 1-in-7 roll | A random explosion offset (±80, random Y/Z), transformed in place, added to the position, handed to `particleCreateFx` |
| `1439bc` | Low (0 to 50) | Fixed offset `(0,300,-20)`, the same way |
| `143a18` | Low | Fixed offset `(0,150,0)` |
| `143b0c` | Crash (at or below 0) | Fixed offset `(0,200,-20)` |
| `143b60` | Crash | Fixed offset `(0,100,0)` |
Each frame the falling jet steers toward its crash target (`atan2f`,
`boundFAngle`, `smoothEasyInAngle`), accumulates its roll, rebuilds its matrix with
`mathfRotMatrixRPH` and moves by the transformed velocity. The height then picks a
path. High, an occasional explosion. Low, two fixed bursts and one at the jet.
Crashing:
1. Nearby cars are damaged (`BlowCarsInJetCrash`).
2. The switch is set and debris thrown (`BlowDebris`).
3. Two fixed bursts and one at the jet.
4. The jet sound stops, its effects are killed and `junkyardAddPointsAfterJetCrash`
runs.
The frame vector is read only by `mathfAddVector` and `particleCreateFx`. The
effect reads its point only through `mathfAddVector`, including in
`particlePostInitFx` and its recursive child effects. Frame `+0c` is never read; the
offsets' X/Y/Z are always rewritten before each in-place transform. The owner reads
no VU registers, accumulator or flags. The existing native helper computes
separately rounded XYZ, preserves destination W and leaves VU state untouched. It
reads its input before writing, so the in-place transforms are safe. Unknown and
historical callers keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/jet-death-forward`, against parent `17bc13a`
(PR #66). Parent headless/window binaries are preserved there and match PR #66's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
kinds 262 to 267): helper-boundary continuations and full-owner entries, across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- The fixtures turn the particle system off (`gp-2f40 = 0`), as the game's own
`particleCreateFx` allows. Each effect call then returns at once without reading
its point, and the owner runs on to its real return. The test captures each
effect's point as the call is made.
- Full entries run the steering, matrix rebuild, transform and position update. The
height picks the path: high with and without the explosion roll, low, or
crashing. The fixture seeds the game's actual libc `rand` state for the 1-in-7
roll. High and low entries return normally. Crashing entries stop at
`BlowCarsInJetCrash`, so the two crash points are covered from their helper
boundaries. Those runs go through both crash bursts and the burst at the jet, and
stop at `terminateJetSound`; reaching it is asserted.
- Helper-boundary outputs are checked against an independent identity or
quarter-turn result. Full entries rebuild the basis from the steering angles
first, so those are covered by the native/original comparison.
- Every published value is asserted exactly against the original FPU addition: the
jet's position, and every effect point in call order. Cases where several
transforms run check each one in order.
- Publication counts per site:
| `143864` | `143940` | `1439bc` | `143a18` | `143b0c` | `143b60` |
| ---: | ---: | ---: | ---: | ---: | ---: |
| 1,792 | 544 | 1,024 | 1,280 | 256 | 512 |
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 714 → 704,
real libm errno cases 862 → 813). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 137,216 generated sequences / 6,560 whole-memory
comparisons. Historical forward ABI coverage is 9,856 / 616; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `17bc13a`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. None of the six jet death returns runs on these
routes, so they are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 62.6 ms of silence in one-player, 39.3 ms in four-player and 24.3 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. A junk jet shot down in actual play, full campaign and physical
controller/hardware acceptance remain open.
+90
View File
@@ -0,0 +1,90 @@
# Native launcher turret aim forward transforms
[Cop SUV laser-aim forwards](NATIVE_COPSUV_AIM_FORWARD.md) follow with two more launcher sites.
Three launcher turret-aim forward returns use native XYZ arithmetic after the
[ricochet forwards](NATIVE_RICOCHET_FORWARD.md). Known forward coverage grows from
139 to 142 of 269 returns (127 remain). Known inverse coverage stays 134 of 134;
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `150efc` | `Launcher::UpdateHearse` (`150e68`) | Turret offset table through the vehicle basis, in place, added to the shooter position |
| `1511ec` | `Launcher::UpdateMinion` (`151060`) | Launcher offset through the aim basis built from the vehicle's roll/pitch/heading |
| `1513f4` | `Launcher::UpdateTanker` (`151358`) | Turret offset table through the same kind of aim basis |
Each result is the owner's frame vector at `+10`. `mathfAddVector` adds the
shooter position, and the real `mathfRotationFromPointToPoint` (`1dbd58`, scalar
subtract and angles) turns it into turret angles toward the target that
`Launcher::GetClosestCar` chose. Those angles are bounded, smoothed and published
through `mathfRotMatrixRPHNoTrans` into the turret node. Frame `+1c` (the output
W) is never read, and the owners read no VU registers, accumulator or flags. The
existing native helper computes separately rounded XYZ, preserves destination W
and leaves VU state untouched. Unknown and historical callers keep the original
ABI. No engine or gameplay formula changes.
`Launcher::UpdateZoomies` (`14d294`) was examined and left for later: its
consumer continues into `GetLockOn` and `TheGame::CreateWeapon`.
## Generated comparisons
Evidence is under `D:/BozoScratch/launcher-aim-forward`, against parent `3e3740f`
(PR #58). Parent headless/window binaries are preserved there and match PR #58's
qualified build. Generated bodies, retail data and runtime recordings stay
outside Git.
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons
(caller kinds 244 to 246): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Full entries run the real `GetClosestCar` over one live candidate in the game
object's embedded vehicle array. A new 0x2600-byte snapshot region covers that
array, including the Hearse's target flag at `+24bc`, which is asserted. The
no-target scenario (a type-5 launcher with no car within 50 units, or the
Minion's alternate type-5 path) skips the transform, and producer reach is
asserted in every case.
- Transform inputs and outputs are captured at the real helper and
`mathfAddVector` boundaries and checked against an independent identity or
quarter-turn result wherever the fixture knows the basis: all Hearse cases, and
helper-boundary Minion/Tanker cases. Full Minion/Tanker entries build their aim
basis with `mathfRPHFromMatrix`/`mathfRotMatrixRPH`; those are covered by the
native/original comparison. The aim point consumed by
`mathfRotationFromPointToPoint` is asserted exactly against the original FPU
addition. Each site publishes in 480 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
at frame `+1c` is normalized for test comparison, after every real consumer.
- New fixture regions and new caller kinds both change the shared random fill
sequence that later cases see (the loop runs every kind within each rounding
mode), so two data-dependent counts in earlier fixtures moved (vehicle tire jumps
711 → 704, real libm errno cases 825 → 833). All scenario-defined counts and
assertions are unchanged.
- Aggregate caller coverage is 126,464 generated sequences / 5,888 whole-memory
comparisons. Historical forward ABI coverage is 8,512 / 532; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `3e3740f`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. The three launcher sites are cold on these routes
(no Hearse, Minion or Tanker special is fired), so the generated owner suite above
is their qualification. The earlier ricochet site `1b2fb0` still runs natively
319 times on the one-player route, exact.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
vehicle and level selection, driving with the HUD and four simultaneous views.
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
contain nonzero audio.
Audio device underruns remain: 54.0 ms silence in one-player, 31.2 ms in
four-player and 17.1 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. A visible Hearse, Minion or Tanker
special firing, full campaign and physical controller/hardware acceptance remain
open.
+97
View File
@@ -0,0 +1,97 @@
# Native older BSP and hierarchy setup helpers
Fifteen more hierarchy returns use the existing native record calculations: eight inverse and
seven forward additions bring the allowlists to fifty and forty-four entries respectively.
This extends the [traversal/setup increment](NATIVE_HIERARCHY_TRAVERSAL_SETUP.md). BozoEngine stays
at `4a8f70a`; no engine or renderer change is included.
| Helper | Return PCs | Owner |
|---|---|---|
| Inverse `1da1e8` | `1c7860`, `1c7904`, `1c7ae4`, `1c7d00` | Older BSP node `1c7758` |
| Inverse `1da1e8` | `1c9984`, `1c9b3c` | Hierarchy roots `1c9858` |
| Inverse `1da1e8` | `1ca3b8` | Collision grid `1c9bf8` |
| Inverse `1da1e8` | `1caa48` | Hierarchy traversal `1ca798` |
| Forward `1da298` | `1c7818`, `1c78c4`, `1c7a90` | Older BSP point/segment setup `1c7758` |
| Forward `1da298` | `1c7bc8`, `1c7bf8`, `1c7de8`, `1c7e14` | Older BSP result publication `1c7758` |
Native leaves snapshot inputs before overlapping writes, retain separately rounded XYZ arithmetic
and leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW is exact,
including meaningful basis[0].W. Forward XYZ is exact while destination W is preserved. Historical
hosts and unknown callers retain the complete original helper ABI. Scalar normalization, matrix
products, result packing, traversal/query dispatch, clocks and checkpoints remain compiled game
code. Other helper returns and inline VU operations remain; this is not complete VU removal.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/hierarchy-legacy-bsp`, against main `c0d2fc7` (PR #29).
Generated game code, disc data, recordings, RAM dumps and captures are excluded from the commit.
- The consumer harness grows from 25,600 to 33,280 sequences and from 800 to 1,040 whole-memory
comparisons (7,680 / 240 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
other memory match exactly; native VU remains untouched.
- BSP setup runs paired local/world transforms, point-mode selection, zero/copy/normalization,
exact/adjacent unit-axis decisions, real scalar additions and segment construction, then stops
at the next BSP query dispatch. It does not replace or claim complete query-root coverage.
- Both result paths run scalar endpoint reconstruction and packed material/flag publication. The
looped point path stops at the next point iteration; the segment path runs through return.
- Root continuations publish real packed matrix-stack state and arguments before stopping at
traversal push. Grid/traversal continuations retain capacity-counter updates at 0 and 1199 and
compare the following scalar matrix-product arguments. General traversal is outside these
fixtures; its existing compiled functions remain responsible for children and callbacks.
- Reference forward W and VU effects remain live through real consumers. Only final unused
forward-output W is normalized afterward; a later inverse write retires that exclusion so
meaningful inverse W remains compared exactly. No production W contract or arithmetic changes.
- Historical forward checks grow to 2,240 cases / 140 whole-memory comparisons (448 / 28 added).
Historical inverse checks cover all fifty returns: 3,200 cases / 50 whole-memory comparisons.
The hierarchy suite retains 786,432 helper cases, 384 whole-memory checks, 8,000 geometric edges,
1,024 recursive BSP callers / 32 whole-memory checks and 2,048 unknown-caller ABI cases.
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python
tooling tests pass.
## Gameplay, loading and movies
The default one-player route completes 9,500 frames and actual four-player completes 8,500.
Every non-RAM frame-record field matches baseline throughout: scratchpad, calls/counts,
draws/counts, sound/sample counts, thread state and EE clock. Four-player's entire recording,
including every RAM frame, is baseline-byte-identical. Default runs perform zero original
comparisons and zero VU0 microprogram calls.
Strict contact, hierarchy, math and projection checks pass. Strict/default complete recordings
and snapshots are byte-identical for both routes.
One-player executes seven of the eight new inverse sites, 45,829 calls combined, and all seven
new forward sites, 12,663 calls. Root return `1c9984` has generated-consumer and historical-ABI
coverage without a live-route claim. Four-player reaches only root return `1c9b3c`, 9,685 calls.
The batch retires another 58,492 / 9,685 original helper executions in one-player / four-player.
These are counts, not timing or FPS measurements.
One-player RAM hashes differ on 529 frames in three intervals: 5900–5937, 8018–8290 and
9135–9352. The complete 32 MB snapshot at frame 7000 is baseline-identical, as is four-player at
frame 6000. A targeted frame-8150 snapshot differs by six bytes in two W words, `8ff13c` and
`5253ec`: baseline zero versus native `008ff050`. Paired observers identify forward return
`1c7818` writing inherited VF16.W in the original, while native preserves the destination's
existing payload. The output temporary is SP+`20`, with unused W at SP+`2c`.
That stack slot is later reused by the collision-node path: the existing native XYZ addition
at `1cb540` preserves W in the result record at `8ff130`, and the following full-record GPR
copy carries it into `5253e0`. The two snapshots' changed W values follow this same write chain.
All 20,895 observed contact-copy events pair at equal cycles; the 1,865 differing copies read
that same stack record and carry zero / `008ff050`, with no changed XYZ computation. Both
observer passes reproduce the qualified baseline/native recordings and targeted snapshots
exactly. This is bounded snapshot/consumer evidence, not a classification of every RAM
difference or possible campaign consumer.
Observers were removed, restored sources forced to rebuild, and both the native math and
generated objects match their original qualified hashes. All three executables contain no
observer markers. No padding restoration, hash mask or shadow VU state is shipped.
All eleven native suites pass again. Final clean default replays reproduce both complete
qualified recordings and snapshots byte-for-byte.
Fresh window routes complete 4,201 movie/menu frames and 6,501 each for one-player and actual
four-player. Reviewed captures show decoded movie pictures, Junkyard loading and active rainy
combat, and four advancing snow-arena views. Device logs report 16.4 / 53.1 / 37.9 ms of silence
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound
matches; flawless device audio, full campaign acceptance and console visual parity remain unclaimed.
+85
View File
@@ -0,0 +1,85 @@
# Native LoopTank forward transforms
[The first FireSpecial batch](NATIVE_FIRE_SPECIAL_FORWARD.md) follows with vehicle types 20, 40 and 60.
The two `LoopTank::update` forward returns use native XYZ arithmetic after the
[special-weapon torch batch](NATIVE_SPECIAL_TORCH_FORWARD.md). Known forward coverage
grows from 236 to 238 of 269 returns (31 remain). Known inverse coverage stays 134 of
134; BozoEngine stays at `4a8f70a`.
`LoopTank::update` (`1517a8`) copies a table of six segments (`4e7250`) into frame
`+80..+13f`. A loop then sends both points of each segment through the loop's
matrix at frame `+40`, in place:
| Return PC | Producer and consumer |
| --- | --- |
| `151c08` | The segment's first point (frame `+80 + 0x20k`) |
| `151c18` | Its second point (frame `+90 + 0x20k`) |
After both transforms, `mathfAddVector` adds the tank's position (coordinate system
at `+80`) to each point. After the loop, the segment selected by `+14` is
line-tested (`hdLosCsTest`). On a hit, `mathfSubVector` reads both points and
`DispatchHit` gets the difference.
The take-hit info's point pointer is set to the segment's first point. Only
`FinalBoss::TakeHit` and the Minion take-hit path dereference that pointer:
- `mathfManhatDist` reads it as XYZ.
- `forceFieldTakeHit` loads 128 bits but subtracts with the VU XYZ mask, so the W
lane is not used.
All other readers of the take-hit info use other fields. The owner never loads any of
the array's W slots, and it reads no VU registers, accumulator or flags. The existing
native helper computes separately rounded XYZ, preserves destination W and leaves VU
state untouched. Unknown and historical callers keep the original ABI. No engine or
gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/looptank-forward`, against parent `fa84a39`
(PR #83). Parent headless/window binaries are preserved there and match PR #83's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 341 and 342). They are helper-boundary continuations and entries at the
call-return label after `drawInit` (`151bc8`), across four rounding modes,
FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W payloads.
- Each run transforms the first segment's two points, adds the position to each and
stops when the selected segment is marked (`mathfSetFVector`). By then both
points have been consumed.
- The harness pairs each addition with the transform that wrote its first operand,
because both transforms run before either addition and the point is the
addition's first operand. The first segment's W slots (frame `+8c`, `+9c`) are
the only forward W normalized for test comparison.
- Every basis is fixture-known, so both points are checked against an independent
identity or quarter-turn result. Both world points are asserted exactly against
the original FPU arithmetic. Publications: 768 for `151c08` and 1,024 for
`151c18`.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 703 → 705,
real libm errno cases 816 → 802). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 175,616 generated sequences / 8,960 whole-memory
comparisons. Historical forward ABI coverage is 14,656 / 916; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `fa84a39`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The two returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 172.4 ms of silence in one-player, 8.9 ms in four-player and 40.2 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The one-player window run reported 172.4 ms of silence. A back-to-back one-player rerun of new and parent builds gave 50.7 ms and 33.7 ms at 59.7 frames/s. The loop tank in actual play, full campaign and physical controller/hardware acceptance remain open.
+101
View File
@@ -0,0 +1,101 @@
# Native machine-gun muzzle forward transforms
[Tire-pair correction forwards](NATIVE_TIRE_ROTATION_FORWARD.md) follow with two vehicle-orientation sites.
Two weapon-initialization forward returns use native XYZ arithmetic after the
[helicopter gun and walking pedestrian forwards](NATIVE_ENVHELI_PED_FORWARD.md).
Known forward coverage grows from 165 to 167 of 269 returns (102 remain). Known
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `1b79f8` | `Weapon::InitWeapon` (`1b77d0`), weapon type 0 | The vehicle's first muzzle offset (`+2510`) through the new weapon's coordinate-system basis, added to its position |
| `1b7a14` | The same | The second muzzle offset (`+2520`), on the alternate barrel |
When a vehicle fires its machine gun, `InitWeapon` sets up the new round. The
game's weapon-type jump table selects the machine-gun case. It aims the round
(only when no lock is held, using `mathfPitchFromPointToPoint` and
`mathfRotMatrixPH`), sets its timers and speeds from game tables, and updates the
vehicle's counter at `+22c4`. It then places the round at one of the vehicle's two
muzzles. The vehicle's toggle at `+2230` alternates
the barrel each shot. The result is the frame vector at `+0`, read only by
`mathfAddVector`. The round is then linked into the hierarchy
(`hierSetCsEpNode`). Frame `+0c` is never read in this or any other weapon-type
case of the owner. The owner reads no VU registers, accumulator or flags.
The existing native helper computes separately rounded XYZ, preserves destination
W and leaves VU state untouched. Unknown and historical callers keep the original
ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/machine-gun-forward`, against parent `e298f20`
(PR #68). Parent headless/window binaries are preserved there and match PR #68's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 270 and 271): helper-boundary continuations and full-owner entries, across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Full entries run the weapon-type dispatch, the locked and unlocked aim gates, and
the `+22c4` counter branch. Each places the round and stops at
`hierSetCsEpNode`; reaching it is asserted. A non-gun weapon type returns
without a transform.
- The weapon's basis is fixture-known at entry as well as at the helper boundary,
so every case is checked against an independent identity or quarter-turn result.
- The round's position is asserted exactly against the original FPU addition, and
the barrel toggle is asserted for each barrel. Each site publishes in 480 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so one
data-dependent count in earlier fixtures moved (real libm errno cases 828 → 853).
All scenario-defined counts and assertions are unchanged.
- Aggregate caller coverage is 139,264 generated sequences / 6,688 whole-memory
comparisons. Historical forward ABI coverage is 10,112 / 632; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Both sites are live on the one-player route, running natively 81 (`1b79f8`)
and 82 (`1b7a14`) times. Strict mode compares every native XYZ against the original
leaf and reports no mismatch. Strict/default recordings and snapshots are byte
exact.
**One recorded difference, and why it is expected.** Against parent `e298f20`,
the four-player recording matches on every field and its 32 MiB snapshot is
identical. The one-player recording matches on every field except the RAM hash.
That hash differs on 354 of 9,500 frames (from frame 5,674, in bursts while the gun
fires), and the frame-7,000 snapshot is identical.
- A RAM dump right after frame 5,674 shows exactly one differing word, `0x8ff32c`.
The parent has `00000000`, the stale VU W that the original leaf stores; the
native build has `00333373`, the previous stack contents, which the native helper
leaves in place.
- Logging the destination in a temporary build showed `InitWeapon`'s output at
`sp = 0x8ff320`. So `0x8ff32c` is its dead frame `+0c` W slot, which nothing
reads; it is overwritten by later stack use.
- To show nothing reads it, the same temporary build wrote a NaN pattern
(`7fc0dead`) into that W after each of these two transforms. Over the full
one-player route, every recorded field still matched the parent except the RAM
hash: calls, draws, sound, thread state, EE timing and every count.
- Earlier live sites were byte exact only because their dead W slots happened to be
overwritten within the same frame. This is the first site where the stale word
survives until the end-of-frame RAM hash.
The experiment was not committed. The qualified binaries were rebuilt from the
committed source, and both headless routes were rerun on them with the same result.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 55.6 ms of silence in one-player, 26.0 ms in four-player and 22.6 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Full campaign and physical controller/hardware acceptance remain open.
+76
View File
@@ -0,0 +1,76 @@
# Native camera matrix products
The player runtime calculates `vu0MulMatrixTP3x3` (`0x1dcc68`) and `vu0MulMatrix4x4`
(`0x1dcd50`) directly over typed column-major game records. Their current callers are in `viewUpdate`.
The default path reads both input matrices before writing the output, supports overlapping records,
and does not read or update VU registers, accumulator, flags, microcode or VU data memory.
Host SIMD performs separately rounded multiplication and addition, with contraction disabled. A scoped
floating-point control setting handles denormals and restores the caller's complete MXCSR. Rare values
outside IEEE's finite exponent range use the existing scalar number-format operations on record bits;
they do not create processor state. The transposed product preserves the original moved-component
normalization and final fourth column. All four output components are checked, including W.
The historical call-log host retains the generated helpers. `TMB_NATIVE_MATH_CHECK=1` compares the native
result with an original helper on a copied context, restoring the output before the native write. This is
an opt-in diagnostic; the normal player path never invokes the original helper.
## Validation
Artifacts are local under `D:/BozoScratch/native-math`; no game data is committed.
- Build and run the explicit `tmb-native-math-tests` target. Its 524,288 original/native cases compare
record bytes, CPU return state, untouched VU state and restored host floating-point control across four
host rounding modes. Inputs include finite game-like numbers, arbitrary bits, extreme exponents,
denormals, overlapping inputs/outputs, address aliases, low address bits and scratchpad records.
Another 256 comparisons check the complete flat guest memory, rather than just the output arena.
- A 9,500-frame strict gameplay route checks 28,906 transposed and 43,359 full products, with zero
mismatches. A separate default run makes zero original-helper comparisons and produces identical
per-frame records to the strict run.
- Against the native graphics main baseline, all 8,500 comparable frame records have identical draw
hashes, batches, vertices, sound hashes/sample counts, calls, scratchpad, threads and EE cycles.
- The separate 4P route checks 70,136 transposed and 105,204 full products with zero mismatches.
Every one of its 8,500 frames matches the baseline's draw/sound/call/clock/scratchpad/thread fields.
A separate default run reproduces all 8,500 strict-run records exactly.
- With original comparisons disabled, the windowed no-input movie route completes 4,201 frames and
the scripted 1P and 4P routes each complete 9,001. Direct captures show the opening movie, menus,
vehicle selection and active gameplay, including all four split-screen views after loading. These
are bounded smoke checks, not full campaign or console visual-parity acceptance. WAVs contain active
output; window logs report 21.8/33.2/34.6 ms of silence respectively, so this is not a flawless
device-audio or subjective listening claim. Deterministic sound hashes above are exact.
- All 12 release-tool tests and eight engine CTest checks pass. Windows and Linux PR CI pass.
## Matrix-only state difference (before native HUD transforms)
This is not a whole-RAM equivalence claim. RAM hashes differ from frame 5594 onward. Full 32 MB dumps
at gameplay points 5600 and 8500 each differ in exactly one word: `0x4a1f5c`, a HUD coordinate-system
position's fourth component. `updateHUDPosition` writes it at `0x13ce98`: the calculation writes XYZ,
then stores the full vector with W inherited from unrelated earlier VU work. Removing the camera helper's
register clobbers changes that inherited value. The traced reader is `hierCsUpdateAsm` (`0x201e98`),
whose camera-position calculation uses XYZ. No shadow VU writes or artificial W restoration are added.
The tested render/sound/state observations above remain exact; they do not prove every campaign path.
For 4P, RAM hashes start differing at frame 4703. The point-8500 dump has exactly four differing words:
`0x4a1afc`, `0x4a1b9c`, `0x4a1c3c` and `0x4a1cdc`. These are position.W in four coordinate records;
the four HUD pointers at `0x23c548..0x23c554` point to those records, and `updateHUDPosition` loads
that array at `0x13cd1c`. Thus the final 4P snapshot isolates the same inherited-W store for each view.
The six inline HUD transforms are lowered separately; [`NATIVE_HUD.md`](NATIVE_HUD.md) records their
W-preservation contract, validation and limits. [`NATIVE_VEHICLE.md`](NATIVE_VEHICLE.md) covers the vehicle
3x3 product, inline vehicle calculations and audited skid direction. Other helper callers, hierarchy
routines and VU0 compatibility state still need wider caller/dataflow replacements.
These increments do not claim that all VU0 work uses native records yet.
[`NATIVE_HIERARCHY.md`](NATIVE_HIERARCHY.md) now covers the collision/height hierarchy's native sphere test,
audited inverse directions and BSP plane-distance pairs. [`NATIVE_SCENE.md`](NATIVE_SCENE.md) covers the
subsequent coordinated replacement of the renderer hierarchy's coupled matrix/FOV/light stack. Other
direction/helper callers and VU macro blocks remain.
[`NATIVE_PROJECTION.md`](NATIVE_PROJECTION.md) covers the subsequent native row-wise projection and
weather identity boundaries, including their original reduction order and caller-specific scope.
[`NATIVE_DIRECTIONS.md`](NATIVE_DIRECTIONS.md) extends native direction math to the three hot BSP
collision setup callers, with generated-consumer checks and an explicit stack-W boundary.
[`NATIVE_CAMERA_TRANSFORMS.md`](NATIVE_CAMERA_TRANSFORMS.md) subsequently adds camera-update
and rear-view forward transforms, including the coupled inline position consumer's exact W contract.
+87
View File
@@ -0,0 +1,87 @@
# Native Minion shield forward transforms
Seven `Vehicle::minionTakeHit` forward returns use native XYZ arithmetic after
[attachment/environment forwards](NATIVE_ATTACHMENT_FORWARD.md). Known forward
coverage grows from 124 to 131 of 269 returns (138 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Producer and consumer |
| --- | --- |
| `1ada84` | First shield offset through the vehicle basis, world translation and hit-distance check |
| `1adb8c`, `1adba0` | Second shield offset through vehicle and shield bases, then world translation and hit-distance check |
| `1adca8`, `1adcbc` | Third shield offset through both bases and hit-distance check |
| `1addc4`, `1addd8` | Fourth shield offset through both bases and hit-distance check |
The existing native helper computes separately rounded XYZ, preserves destination
W and leaves VU registers, accumulator, flags and data memory untouched. Original
point-table producers, distance formula, damage/health logic, hierarchy switches,
HUD queue/primary messages and return behavior remain. Unknown/historical callers
retain the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/minion-forward`, against parent `cafd3f7`
(PR #55). Parent headless/window binaries are preserved there. Generated bodies,
retail data and runtime recordings stay outside Git.
- Added coverage is 3,584 generated sequences / 224 whole-memory comparisons.
Each return has 256 helper-boundary sequences through its real continuation and
256 full-owner-entry sequences. All seven sites are required to execute, with
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases, arbitrary
matrix/source/destination W payloads and the actual in-place second transforms.
- Full entries execute the original point-table loads, inactive force-field
bookkeeping, one or two basis transforms per shield, translation and the real
distance approximation. Independent exact world coordinates are asserted at
each distance call, then compared between native and original executions.
- All four shields have successful damage and destruction cases. Health changes
from 100 to 80 on ordinary hits; the actual game/HUD calls publish primary and
queued message IDs `d2` through `d5` in all four HUD slots. Retained-shield return
values are checked. Exact 50-unit and distant misses leave health/UI unchanged.
- Destruction changes health from 10 to -10 and executes the real hierarchy switch
update. Those cases stop at `figureOutForceField` after health/switch publication.
Force-field rebuilding, effects and sound beyond that boundary are not stubbed
or claimed as complete-owner coverage. Non-destruction fixtures complete the
original owner with the impact-sound gate disabled and the force field inactive.
- Damage publications pass 176/240/240/240 cases across the four shields;
destruction/switch publications pass the same counts. There are 896 exact
distance-boundary rejection cases. Actual transform/field/distance/message/
switch counts and distance inputs must agree before final memory comparison.
- Only forward scratch W at the owner's `SP+0c` is normalized for test comparison,
after every real consumer. Full-entry frames are `0xd0` bytes; helper-boundary
frames retain their actual stack position. Original W/VU writes stay live
through the original consumers. CPU outside retired VU, clocks/checkpoints,
host FP effects and memory agree; native VU remains untouched throughout.
No runtime RAM mask, recording normalization or VU-state reconstruction is added.
- Aggregate caller coverage is 120,832 generated sequences / 5,536 whole-memory
comparisons. Historical forward ABI coverage is 7,808 / 488; inverse remains
8,576 / 134. Existing hierarchy/BSP/edge/unknown-ABI coverage and all earlier
publication assertions remain enabled.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `cafd3f7`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. No new recorded-RAM difference is introduced.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show vehicle/level selection, level
loading, advancing driving, opponents/effects, four simultaneous views, decoded
intro footage and return to the menu. Each route has five distinct captures.
Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
All seven Minion sites are cold on these runtime routes, including movies.
Their direct qualification is the generated-owner/consumer suite above, not a
visible Minion boss encounter. Active force-field hits, destruction effects,
sound dispatch and the subsequent force-field rebuild remain outside the new
fixtures; their original implementations are retained.
Audio device underruns remain: 47.4 ms silence in one-player and 27.2 ms in
four-player; this movie run logs zero underruns. These are functional checks,
not a performance or flawless-playback claim. Full campaign and physical
controller/hardware acceptance remain open.
+76
View File
@@ -0,0 +1,76 @@
# Native object shader output
The subsequent [native texture-input increment](NATIVE_TEXTURE_INPUTS.md) removes the three texture
copies retained at this step, together with their consumer's packet reads and patches. The evidence
below records this earlier shader/header increment.
The native mesh path already submits named shader inputs from game/scene records. This increment
retires 38 scalar/header output stores in `pktAddVu1ObjAsm` (`1eaae8`), alongside the 18 VU payload
stores retired by the Scene increment. It replaces the three RGB packet readbacks at `1ead74`,
`1ead7c` and `1ead8c` with direct reads of their source game records. There is no packet image or
shadow register bank for these shader parameters. BozoEngine remains at `4a8f70a`.
The colour source is the object's aligned 128-bit colour record, with nonnegative signed RGB indices
selecting the instance's float table. Negative indices retain the object colour. The original scalar
car multiplications, flags and CPU/FPU clobbers stay in the generated builder. Its copy-source loads,
loops, checkpoints, program choice, cursor at control `+8`, and texture cache pointer at scratchpad
`+94` are retained. The historical checker host executes the original instructions.
## Texture boundary
At this step the three texture payload stores at `1eabd0`, `1eabd4` and `1eabd8` intentionally remain. After traversal,
`hier` calls `texmGetTextureAddrs` (`1f90b0`) on those copied records. That helper reads their format
and may activate a texture, update game texture-manager state and patch the copied texture record.
Removing that producer alone changes the helper's branches and subsequent draw/sound hashes.
The producer and this consumer must be replaced together; retaining an unused hardware header would
not satisfy that dependency. The new tests require these texture copies to match exactly while all
retired output bytes stay untouched.
## Validation
Evidence is under `D:/BozoScratch/object-packets`, against main `165c6f2`, using the same USA disc,
engine, build and input scripts. Every run uses a private user folder. These are functional checks
with no performance claim.
- `tmb-native-object-packet-tests` executes the actual generated builder with the existing published
adaptations, then with this increment. All 8,192 full-builder comparisons pass across four host
FP modes, object word alignments, signed colour indices, instance/bones, textures, matrix changes,
car tint, fog, points, extra records and clip/program states. Complete CPU/FPU/context, MXCSR,
cursor/cache metadata, scratchpad and memory outside retired bytes match. There are 32 complete
flat-memory checks. All 41 new instruction sites are reached.
- Another 233 cases use an inaccessible packet output pointer with zero textures, checking that
shader stores/RGB readbacks cannot reach a device, with unchanged tint/FPU results and extents.
Textured cases retain their required producer and are excluded from this inaccessible-pointer test.
- All eight native suites and 12 release-tool tests pass; player, headless and historical checker build.
- Default 1P (9,500 frames) and actual 4P (8,500) match main on every draw hash/count, sound hash/sample
count, library call field, EE clock, scratchpad and thread record. Separate strict/default recordings
are byte-identical. Default VU0 program counts remain zero. No hash mask is widened.
- The two default routes retire 30,092,181 / 41,383,590 stores and perform 1,646,466 / 3,341,874 direct
RGB reads. RAM hashes differ on 9,496 / 8,496 frames. Full 32 MB snapshots at 1P frame 7,000 and 4P
frame 6,000 isolate every differing byte to the four named packet buffers below; there are zero
differences outside these buffers at those snapshots.
| Buffer interval | 1P differing bytes | 4P differing bytes |
| --- | ---: | ---: |
| `564a80..5eca80` (`hierObjPkt`) | 995 | 590 |
| `5eca80..630a80` (`hierObjPkt2`) | 39,069 | 18,042 |
| `630a80..64ea80` (`hierAlphaPkt`) | 12,252 | 4,029 |
| `64ea80..66ca80` (`hierAlphaPkt2`) | 13,944 | 4,179 |
Intervals are half-open. The snapshot boundary is bounded evidence, not proof of all campaign consumers.
Windowed movie/menu (4,201 frames), 1P (6,502) and 4P (6,501) complete through loading into active arenas.
Direct capture inspection covers decoded movie action, readable vehicle/level selection and loading,
the rainy 1P arena with targeting/HUD/vehicles, and four independent snowy views. This is visual smoke
evidence, not console or pixel parity. Device logs retain 25.3 / 58.6 / 8.8 ms of inserted silence in
movie/1P/4P, and dropped frames in movie/1P. Exact deterministic sound does not imply flawless device
audio or subjective listening acceptance.
## Remaining scope
The texture activation/patching dependency above is addressed by the subsequent native texture-input
increment linked at the top. Alpha link records, scalar
builder bookkeeping, source copy loops, legacy packet extents, other mixed graphics builders and
unconverted VU macro helper callers remain. This is shader-output retirement, not removal of the
complete builder or all packet code. The earlier player release is unchanged. Full campaign coverage,
console visual parity and flawless device audio are not claimed.
+106
View File
@@ -0,0 +1,106 @@
# Native particle arc forward transforms
[FinalBoss gun-shot forwards](NATIVE_BOSS_SHOTS_FORWARD.md) follow with twelve boss sites.
Two particle forward returns use native XYZ arithmetic after the
[AI hunt and bait forwards](NATIVE_AI_BEAD_FORWARD.md). Known forward coverage grows
from 180 to 182 of 269 returns (87 remain). Known inverse coverage stays 134 of 134;
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `1e7e08` | `particleFlatArcs` (`1e7c00`) | A random flat offset (scaled by 20, Z 0) through a basis built from the arc's Z direction, into the particle's point array, plus the start point; the point's W is then rewritten with a fresh random value |
| `1e77e8` | `particleElectricArc` (`1e74c0`) | A random offset on a ring through the A→B basis into the frame vector at `+0`, scaled and added to A for each segment end |
Both owners take a free particle from the game's particle list. They build a basis
with `utilGenerateMatrixFromZvector`, fill the particle's point array and hand the
particle to `1e22f0`.
- **`particleFlatArcs`** throws ten points. Each transform writes the point slot;
`mathfAddVector` adds the start point (X/Y/Z only), and the owner then stores a new
W into the same slot before anything reads it. The transform's W can therefore
never be observed.
- **`particleElectricArc`** writes the frame vector at `+0`, read only by
`mathfScaleVector`. Frame `+0c` is never read, and the segment points' W values are
written explicitly.
Neither owner reads VU registers, the accumulator or flags. The existing native
helper computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. Unknown and historical callers keep the original ABI. No engine or
gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/particle-arcs-forward`, against parent `c265cfd`
(PR #73). Parent headless/window binaries are preserved there and match PR #73's
qualified build. Generated bodies, retail data and runtime recordings stay
outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 285 and 286): helper-boundary continuations and full-owner entries, across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Full entries run from the owner's start:
- the real free-list allocation, the basis construction, the random-vector and
seed helpers, and `sinf`/`cosf` with `sqrt` for the electric ring;
- every point of the particle.
They stop at `1e22f0`; reaching it is asserted. No free particle returns without
a transform, and an electric arc with no segments skips its loop.
- `particleFlatArcs` rewrites each point's W itself, so its cases compare memory
exactly, with no W exclusion at all. Its full entries check all ten points in
order.
- Helper-boundary FlatArcs outputs are checked against an independent identity or
quarter-turn result. ElectricArc scales its result before the addition, so its
published segment end is asserted against the original FPU arithmetic instead.
The sites publish in 2,496 and 448 cases.
- The VU rule from the earlier weapon increments applies. Only ElectricArc's forward
scratch W at frame `+0c` is normalized for test comparison, after every real
consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 706 → 704,
real libm errno cases 853 → 838). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 146,944 generated sequences / 7,168 whole-memory
comparisons. Historical forward ABI coverage is 11,072 / 692; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. The ElectricArc return `1e77e8` is live: it runs natively 640 times on the
one-player route and 864 times on the four-player route. Strict mode compares every
native XYZ against the original leaf and reports no mismatch. Strict/default
recordings and snapshots are byte exact. The FlatArcs return `1e7e08` is cold on
these routes and is qualified by the generated owner suite above.
**One recorded difference, proven to be a dead W slot.** This applies the rule
accepted for the [machine-gun increment](NATIVE_MACHINE_GUN_FORWARD.md). Against
parent `c265cfd`, the four-player recording matches on every field. The one-player
recording matches on every field except the end-of-frame RAM hash, which differs on
391 of 9,500 frames (from frame 5,655), and the 32 MiB snapshot is identical.
- A RAM dump right after frame 5,655 shows exactly one differing word, `0x8ff36c`:
the parent has `00000000`, the native build `ffffffff`.
- A temporary logging build showed ElectricArc's output at `sp = 0x8ff360`, so the
word is its dead frame `+0c` W slot.
- The same temporary build wrote a NaN pattern into that slot after every
ElectricArc transform. Over the full one-player route only the RAM hash differed
from the parent: calls, draws, sound, thread state, EE timing and every count
matched.
The experiment was not committed; the qualified binary was restored afterwards.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 53.1 ms of silence in one-player, 41.5 ms in four-player and 15.9 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Flat arcs in actual play, full campaign and physical controller/hardware
acceptance remain open.
+52
View File
@@ -0,0 +1,52 @@
# Native particles across scheduler continuations
During qualification of the vehicle/light direction changes, the 4P window stopped advancing at
frame 4915. Its UI remained responsive because the game thread had raised an uncaught C++ exception
and was waiting for the crash dialog. The crash stack reached the guarded `sceGsExecStoreImage`
from a lens-flare helper dispatched directly by the scheduler. A fresh unchanged-main 4P window
completed 6,501 frames, so the live trigger is timing-sensitive.
The original particle wrapper set `g_flaresNative` around a C++ call into generated `particleDraw`.
A checkpoint can unwind that call before the lens helper runs. When the scheduler later enters the
helper directly, the scope flag has already been cleared; the old branch executes the generated
flare code and reaches the retired SDK readback. A flag tied to that C++ stack is not a durable
native-backend selection. Host-time freshness was also unsuitable for selecting native effects
and deciding whether native depth sampling was available after a long frame.
## Change
The normal native backend now selects the existing native flare test/render routines from its
backend and explicit particle options, independently of that transient call scope. Native particle
draw selection also survives a host-time gap. Native depth availability follows the enabled native
renderer and explicit depth option; it no longer expires when the last match frame is over 100 ms
old. Actual samples still come from the previous native renderer frame via `depthAt`; missing
coverage retains the existing far-depth behavior.
No SDK image descriptor is decoded, no fake image or completion interrupt is added, and the SDK
guard remains in place. Explicit legacy particle diagnostics retain their existing compatibility
selection. BozoEngine stays at `4a8f70a`; this change is owned by TMB.
## Regression evidence and validation
Local artifacts are under `D:/BozoScratch/collision-directions`. The initial failed window log,
scratch-user crash report, successful unchanged-main comparison, and `stall-runtime-evidence.json`
are retained there. REA observation `ev_fe6c8e868562f51268869b7c3a7baf210ff7b424a388ecfcdc58767f026c3e91`
records the waiting exception/dialog threads; `ev_9dffc412844e6e3efdc03fab1756e20be96683f4c5ad5e8242e036a0a737375b`
records the selected process image/base and thread context. Their provider reports no artifact
digest or OS/architecture identity, so executable attribution additionally uses the exact owned
process path, crash report module offsets and the built executable's local symbol table. Both
observations were ephemeral and detached; no live analysis session is retained.
`tmb-native-particle-tests` enters both native flare leaves without a live `particleDraw` scope or
any recent frame marker. The old code fails by entering generated/runtime-service code. The fixed
code passes eight test/render pairs across all four views, including visible and culled points,
projection records, missing-depth behavior, visibility, complete native CPU ABI (including VU and
clocks) and untouched legacy packet output. The leaf test does not claim GPU occlusion parity.
Final gameplay/movie/loading reruns and audio limits are recorded in
[`NATIVE_DIRECTION_CONSUMERS.md`](NATIVE_DIRECTION_CONSUMERS.md). This is bounded regression coverage;
full campaign, console visual parity and explicit legacy diagnostic modes are not qualified by it.
[Native particle-emission transforms](NATIVE_PARTICLE_EMISSION.md) subsequently retire five
emitted-direction and emitter-coordinate helper returns. That increment preserves this
backend selection and adds generated emission/metadata and emitter-coordinate consumer checks.
+116
View File
@@ -0,0 +1,116 @@
# Native particle-emission transforms
Five particle-emission helper returns now use native record calculations, extending
the [suspension/tire increment](NATIVE_SUSPENSION_TIRE.md). Forward coverage grows
from 68 to 70 sites and inverse coverage from 82 to 85. BozoEngine stays at `4a8f70a`.
| Helper / return PC | Owner | Consumer |
| --- | --- | --- |
| Forward `1da298` / `1e4818` | `particleEmit` (`1e4400`) | In-place direction used for emitted position and velocity XYZ |
| Forward `1da298` / `1e42d8` | `utilUpdateEmitterMatrices` (`1e4298`) | Attached emitter offset, followed by scalar world/relative position construction |
| Inverse `1da1e8` / `1e435c`, `1e43b4` | `utilUpdateEmitterMatrices` | Attached and unattached relative emitter positions |
| Inverse `1da1e8` / `1e43c8` | `utilUpdateEmitterMatrices` | Relative emitter direction |
The existing forward calculation captures inputs before writes, computes XYZ and
retains destination W. Its stack W outputs are unused by the real consumers. The
inverse preserves exact XYZW, including meaningful basis[0].W. Neither native path
transports VU registers, accumulator, flags or data memory. Historical hosts and
unknown callers retain the complete original ABI.
Scalar matrix composition, attachment dispatch, RNG and range selection, particle
position/velocity publication, bounds, lifetime and metadata remain compiled game
code. The Burning Man emission variant and emitter movement contain no direct calls
to these two transform helpers or inline VU arithmetic in the audited generated
functions; they are not rewritten by this increment.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/particle-emission`, against main `017908b`
(PR #36). Generated game code, retail data, snapshots and captures stay outside Git.
- Added coverage is 2,560 consumer sequences / 128 whole-memory comparisons.
Aggregate coverage reaches 64,512 / 2,080. Four host FP modes, denormal controls,
RAM aliases, in-place direction outputs and arbitrary meaningful inverse-W
payloads are covered. CPU outside retired VU, outgoing host FP effects,
clocks/checkpoints and consumer memory match; native VU stays untouched.
- Emission runs its complete real scalar tail through return. First and later
particle slots, types 1/2/3/7/8/9, fixed and random lifetime ranges, bounds
initialization/extension, spawn-time conversion and per-particle metadata are
exercised. Position/velocity fourth components are real metadata and compared
exactly. Only the unused forward-transform stack W is normalized, after all
actual consumers finish.
- Of the emission cases, 256 enter at `1e4714`, before the actual position/velocity
range RNG branches, and execute the in-place transform through return. Random
normalized-direction generation, timer-driven entry and additional loop
iterations are outside this bounded fixture; gameplay exercises those paths.
- Another 512 cases execute the complete emitter-coordinate function from entry,
including all four attached/unattached and relative/world combinations, actual
scalar matrix composition, both position paths and direction publication. The
other new cases enter at individual helper boundaries and complete their tails.
- Historical forward coverage grows to 3,904 / 244 cases / whole-memory checks;
inverse coverage grows to 5,440 / 85. The hierarchy suite retains 786,432 helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP
callers / 32 whole-memory and 2,048 unknown ABI cases. The math suite retains
1,048,576 / 512 and 2,048 unknown ABI cases.
- Player, headless, historical checker and native test targets rebuild. All eleven
native suites and twelve Python tooling tests pass. The final meaningful-W and
in-place consumer additions also pass the rebuilt hierarchy suite.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. All non-RAM frame fields match the preceding main: scratchpad, calls/counts,
draws/counts, sound/sample counts, threads and EE clock. The entire four-player
recording matches baseline. One-player has one RAM-hash difference, at frame 8457;
all other RAM hashes match. Full 32 MB snapshots at one-player frame 7000 and
four-player frame 6000 are exact. Strict contact, hierarchy, math and projection
checks pass; strict/default recordings and snapshots are identical. Default runs
perform zero original comparisons and zero VU0 programs; strict intentionally
executes original oracles.
An initial graphics-frame snapshot misses the transient hash point. A paired
headless frame-boundary observer captures frame 8457 exactly: each dump's hash
matches its qualified frame record, and each complete observer record prefix
reproduces the qualified baseline/native route. The only changed word is
`8ff38c`, attached-emitter output `SP+5c`: original writes inherited `VF16.w`
bits `02000200`, native retains zero. The actual scalar matrix composition is
independent of that temporary W; subsequent vector consumers read XYZ only.
Across 1,754 paired helper events near that frame, 12 writes at `1e42d8` show this
difference. Another 39 at `1e4818` show emission output `SP+4c` (`8ff43c`) retaining
`3f800000` from the real normalized-direction producer, where original writes
`02000200`. Its position/velocity and metadata consumers also read only XYZ.
That second temporary does not survive to the captured frame hash. No production
mask or VU-state reconstruction is introduced. This is bounded unused-W evidence,
not raw-RAM identity or console parity. Temporary runtime/headless sources are
restored and all three original object hashes verified.
Forward returns `1e42d8` / `1e4818` execute 9,209 / 32,822 times in one-player and
13,467 / 9,990 times in four-player: 42,031 / 23,457 new native executions overall.
Total native forward counts become 1,102,044 / 283,936. The three new inverse sites
remain cold in these routes; they have generated-consumer and complete emitter
entry coverage. These are reached call counts, not measured speedups.
After observer removal, all eleven rebuilt suites pass again. Clean default/strict
replays reproduce the same complete results above, and the player, headless and
checker binaries contain no observer markers.
Fresh configured 4,200-frame movie/menu and 6,500-frame one-player / actual
four-player windowed routes complete through clean exit, with isolated scratch
user data. Reviewed captures show decoded movie pictures (1000), return to menu
(1800), Junkyard loading (one-player 4500), active one-player gameplay (5500/6300)
and four advancing snow-arena views with snow/tire effects (four-player 5500/6300).
The windowed one-player / four-player runs reach 12,807 / 11,678 new native forward
calls. All three stereo 48 kHz WAV recordings contain audio. Device logs report
20.2 / 59.6 / 27.8 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound matches; flawless device audio,
subjective listening and full campaign/console parity are not claimed.
## Remaining scope
These two helper inventories now have 70 native forward and 85 native inverse
sites. Outside their allowlists remain 199 forward and 49 inverse sites, 248 in
total across the game, including sites inside otherwise replaced functions. This
is a structural source inventory, not a live cost measurement, and excludes other
helper families and inline VU operations. Full campaign acceptance and console
visual/audio parity remain separate work.
+101
View File
@@ -0,0 +1,101 @@
# Native vehicle peel-out transform
The forward-transform return `1abd60` in `vehicleUpdatePeelingOut` (`1abb18`)
now uses native record arithmetic, extending the
[attractor-group increment](NATIVE_ATTRACTOR_GROUPS.md). Forward coverage grows
from 79 to 80 sites; inverse coverage stays at 89. BozoEngine stays at `4a8f70a`.
The existing native helper snapshots its operands, computes separately rounded
XYZ and retains destination W. Its result at `Vehicle+520` feeds the XYZ-only
addition in `vehicleSetCsMat`; the coordinate-system position retains its own W.
Native calls leave VU registers, accumulator, flags and data memory untouched.
Historical hosts and unknown callers retain the complete original ABI. Peel-out
selection, timer parity, steering, phase/amplitude updates, sine, smoothing and
vehicle-pose publication remain compiled game code.
## Generated producer and consumer checks
Evidence is under `D:/BozoScratch/peel-out-transform`, against main `81d72db`
(PR #40). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 512 composed producer/consumer sequences / 32 whole-memory
comparisons. Aggregate coverage is 71,680 / 2,464. Each case completes the
peel-out tail and then the real generated `vehicleSetCsMat` consumer, including
its production native matrix products and inline XYZ addition. Both reference
and native producer runs use that production consumer; the separate vehicle
suite qualifies the consumer against its original implementation.
- 256 cases enter the actual peel-out function across 16 scenarios: inactive
offsets, fast/smoothed decay, snap-to-zero, speed gates, reset/reuse, timer
parity, steering direction, phase clamps and amplitude growth. The actual
timer, bound-angle, smoothing and sine routines execute. Trigonometric inputs
are bounded to half a radian; wider argument reduction is outside these fixtures.
- Another 256 cases start at the helper boundary with signed zero, signed
subnormals and positive/negative unit and fractional local offsets. Four host
rounding modes, denormal controls, RAM aliases, coordinate-system/matrix
aliases and arbitrary opaque W payloads are covered.
- CPU outside retired VU state, outgoing host FP effects, clocks/checkpoints and
final memory agree. Native VU stays untouched through the complete chain.
Only the source `Vehicle+52c` W is excluded, after all real consumers run;
an assertion restricts that exclusion to this exact word. No published pose
component is excluded.
- Historical forward coverage grows to 4,544 / 284 cases / whole-memory checks;
inverse stays at 5,696 / 89. Existing hierarchy coverage retains 786,432 helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
32 whole-memory and 2,048 unknown ABI cases.
- Player, headless runner, historical checker and all test targets build.
All eleven native suites and twelve Python tooling tests pass.
## Gameplay and RAM boundary
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Strict/default recording files and full 32 MiB snapshots are identical.
Every scratchpad, call, draw, sound, thread, count and EE-clock field matches the
immediate parent. The four-player frame records and both sampled full RAM
snapshots also match it exactly.
One-player RAM hashes differ on 664 frames, first 7,621 and last 8,765. A fresh
passive observer reproduces the production recording and checks all 9,500 frames
against the previous increment's qualified immediate-parent observer ledger.
Replacing only the following four words on a diagnostic RAM copy reproduces
every parent RAM hash, with zero unexplained differences:
| RAM word (`Vehicle+52c`) | Parent / native | Differing frames |
| --- | --- | --- |
| `26077c` | `02000200` / `00000000` | 9 |
| `26617c` | `02000200` / `00000000` | 9 |
| `268e7c` | `02000200` / `00000000` | 664 |
| `25da7c` | `42700000` / `00000000` | 23 |
These reverse the [previously traced peel-out W writes](NATIVE_ATTRACTOR_GROUPS.md):
the original producer borrowed `VF16.W`; the native producer retains destination
W. The real coordinate-system consumer uses only XYZ. Both complete frame-record
payloads now also match the older pre-attractor tow-truck baseline. No RAM mask
or VU reconstruction ships. Temporary headless observer source and its original
object were restored exactly; production binaries contain no observer markers.
The new site executes 3,890 / 7,374 times in headless one-player / four-player.
Total native forward calls become 1,141,908 / 302,704. Default routes make zero
original-helper comparisons and execute zero VU0 microprograms. These are
coverage counts, not a measured speedup.
Fresh 6,500-frame one-player and actual four-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, using isolated scratch
user data. Reviewed captures show decoded movie playback (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), advancing one-player gameplay
(5,500 / 6,300), and four advancing snow-arena views with snow/tire effects
(four-player 5,500 / 6,300). The new site executes 1,809 / 3,510 times in windowed
one-player / four-player; it is cold in the movie route. These checks establish
bounded functionality, not pixel-exact windowed or console parity.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
26.6 / 62.8 / 31.4 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound matches the parent; flawless
device audio and subjective listening are not claimed.
## Remaining scope
These two helper inventories now contain 80 native forward and 89 native inverse
sites. Outside their allowlists remain 189 forward and 45 inverse sites, 234 in
total across the game. This is a structural inventory, not a live cost
measurement, and excludes other helper families and inline VU operations.
Full campaign acceptance and console visual/audio parity remain separate work.
+81
View File
@@ -0,0 +1,81 @@
# Native persistent-field forward transforms (last three)
The last three forward returns use native XYZ arithmetic after the
[BlowDebris batch](NATIVE_BLOW_DEBRIS_FORWARD.md). Known forward coverage reaches
**269 of 269 returns**; known inverse coverage stays 134 of 134. BozoEngine stays at
`4a8f70a`. Every inventoried forward-transform (`mathfMulTransVec`, `1da298`) return
is now native. Unknown and historical callers keep the original ABI.
Each of these writes a long-lived object field, not the stack:
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `14aff4` | `Launcher::FireSpecial`, type `1a0` | The horn push in frame `+30` goes through the vehicle basis copied to `+190` into the vehicle's velocity `+1e0`. Nothing reads it before the horn sound and the owner's return |
| `112524` | `BurnMan::Spawn` | The spawn offset in frame `+10` goes through the new pedestrian's coordinate system into its position (`cs +10`). `mathfAddVector` adds the vehicle position (the output is its first operand); the grid reparent and later updates read it as XYZ |
| `117710` | `Vehicle::collisCheapTires` (free fall) | The tire offset in frame `+0` goes through the plane matrix at frame `+10` into tire 0's `+50`. `smoothEasyIn` reads its three components as scalars |
An audit looked for readers of each field's W anywhere in the generated code:
- **Vehicle velocity W (`+1ec`):** no 32-bit load has a vehicle base, there are no
64-bit loads at `+1e8`, and every place that passes `+1e0` on reads XYZ only.
`vehicleUpdatePosition` rewrites the whole field with a 128-bit store each frame
before reading it.
- **Pedestrian position (`cs +1c`):** `hierInitCs` never writes it, and the hierarchy
update (native here) ignores it. `requestScream` copies the whole position into a
streaming-sound slot, but that slot's W (`+3c`) has no reader: the sound code reads
the position only as XYZ.
- **Tire offset (`+5c`):** no reader of `+5c` on a tire, or of the absolute offsets
of the four tires.
The owners read no VU registers, accumulator or flags after these calls. The native
helper computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/persistent-forward`, against parent `363eb61`
(PR #91). Parent headless/window binaries are preserved there and match PR #91's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons (caller
kinds 371 to 373). They are helper-boundary continuations and entries at the
call-return label before each transform (`14afd8`, `1124ec`, `117700`), across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Each run stops at the first consumer after the result: the horn sound,
`hdReparentCsGrid` and `smoothEasyIn`. The velocity and tire results are read
back from their fields at the stop. The pedestrian's position (output plus
vehicle position) is asserted exactly against the original FPU arithmetic.
Publications: 512 for each site.
- Every basis is fixture-known, so every site is checked against an independent
identity or quarter-turn result. Only the forward W of each field (`+1ec`, `cs
+1c`, tire `+5c`) is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 712,
real libm errno cases 819 → 842). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 191,488 generated sequences / 9,952 whole-memory
comparisons. Historical forward ABI coverage is 16,640 / 1,040; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `363eb61`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. `112524` (BurnMan spawn) is live on the one-player route: it runs natively once with no recorded difference. `14aff4` and `117710` are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 49.8 ms of silence in one-player, 7.5 ms in four-player and 0.0 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Full campaign and physical controller/hardware acceptance remain open.
+98
View File
@@ -0,0 +1,98 @@
# Native point-contact, ray and root helper transforms
Eleven further hierarchy returns use the existing native record calculations. Three inverse
and eight forward additions bring the allowlists to fifty-three and fifty-two entries.
This extends the [older BSP increment](NATIVE_LEGACY_BSP_HELPERS.md). BozoEngine stays at
`4a8f70a`; no engine or renderer change is included.
| Helper | Return PCs | Owner |
|---|---|---|
| Inverse `1da1e8` | `1c4fe0` | Coordinate-system collision setup `1c4ec0` |
| Inverse `1da1e8` | `1c51dc`, `1c53b4` | Older hierarchy roots `1c50a0` |
| Forward `1da298` | `1c8094`, `1c80ac` | Point-contact result normal `1c7eb0` |
| Forward `1da298` | `1c8120`, `1c8150` | Point-contact result position `1c7eb0` |
| Forward `1da298` | `1c85cc`, `1c85e0` | Ray result normal `1c8280` |
| Forward `1da298` | `1c8608`, `1c863c` | Ray result position `1c8280` |
Native leaves snapshot operands before overlapping writes, retain separately rounded XYZ
arithmetic and leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW
matches the original, including meaningful basis[0].W. Forward XYZ matches while destination W
is preserved. Historical hosts and unknown callers retain the full original helper ABI.
Scalar contact reconstruction, world sums, result packing, traversal dispatch, clocks and
checkpoints remain compiled game code. Other helper returns and inline VU operations remain;
this is not complete VU removal.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/hierarchy-point-ray`, against main `e7cdaff` (PR #30).
Generated game code, disc data, recordings, RAM dumps and captures are excluded from the commit.
- The consumer harness grows from 33,280 to 38,912 sequences and from 1,040 to 1,216 whole-memory
comparisons (5,632 / 176 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
other memory match exactly; native VU remains untouched.
- Point-contact continuations retain the selected plane distance, scalar contact reconstruction,
offset subtraction, paired normal/position transforms, world-space addition, packed material/
flags and return. Both indexed and single-result modes are covered, with four result slots and
direct-node versus inherited material metadata.
- Ray continuations retain selected endpoint subtraction, paired normal/position transforms,
world-space addition, metadata publication and return, including stack-owned inputs and four
selected point offsets/result slots. These are real result tails, not complete query-root tests.
- Coordinate-system/root continuations run real packed matrix-stack setup into the actual
traversal-push boundary. Child traversal and callbacks remain outside those fixtures.
- Reference forward W and VU effects stay live throughout real consumers. Only final unused
forward-output W is normalized afterward; a later inverse write retires that exclusion so
meaningful inverse W stays compared exactly. No production arithmetic or W contract changes.
- Historical forward checks grow to 2,752 cases / 172 whole-memory comparisons (512 / 32 added).
Historical inverse checks cover all fifty-three returns: 3,392 cases / 53 whole-memory comparisons.
The hierarchy suite retains 786,432 helper cases, 384 whole-memory checks, 8,000 geometric edges,
1,024 recursive BSP callers / 32 whole-memory checks and 2,048 unknown-caller ABI cases.
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python
tooling tests pass.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Strict
contact, hierarchy, math and projection checks pass; strict/default recordings and snapshots
are byte-identical. Every non-RAM frame-record field matches baseline throughout: scratchpad,
calls/counts, draws/counts, sound/sample counts, thread state and EE clock. Four-player's entire
recording and frame-6000 snapshot also match baseline byte-for-byte. Default runs perform zero
original comparisons and zero VU0 microprogram calls.
One-player executes inverse return `1c53b4` 2,047 times and all eight new forward returns 528
times combined. Returns `1c4fe0` and `1c51dc` have generated-consumer/historical-ABI coverage
without a live-route claim. Four-player reaches none of the eleven new sites. This retires
another 2,575 original helper executions in the one-player route; it is a count, not a timing
or FPS measurement.
One-player RAM hashes differ on 3,047 frames, first at 5810 and last at 9499. The complete
32 MB frame-7000 snapshot differs by 46 bytes in 23 fourth-component words: twelve records at
`4062ec..40639c`, ten at `406e0c..406e9c`, and stack word `8fefdc`. Baseline words are zero;
native words contain `42700000`. Paired observers identify all their writes in the existing
original forward helper, at debris callers `120838`, `1208dc` and `1209a0`. All 44 watched
forward calls pair at identical cycles; 32 differing stores cover exactly those 23 addresses.
They store inherited VF16.W. The retired root inverse at `1c53b4` used to overwrite VF16.W;
the native inverse leaves VU untouched while retaining exact meaningful output XYZW.
The global fields belong to debris velocity records. The compiled debris update consumes
their XYZ at offsets `120`, `124`, `128`, with no fourth-component numerical input in that
update. The intermediate stack forward at `1208dc` similarly feeds scalar XYZ position sums.
These debris callers remain outside the native allowlist and retain their original complete
ABI. Both observer recordings and snapshots reproduce the qualified baseline/native files
exactly. This is bounded source/write/snapshot evidence, not a classification of every RAM
difference or possible campaign consumer.
Observers were removed and restored sources forced to rebuild. Both native math/hierarchy
objects match their original qualified hashes, and all three executables contain no observer
markers. All eleven native suites pass again. Final clean default replays reproduce both
complete qualified recordings and snapshots byte-for-byte. No padding restoration, hash mask
or shadow VU state is shipped.
Fresh windows run the configured 4,200-frame movie/menu route and 6,500-frame one-player and
actual four-player routes through clean exit. Reviewed captures show decoded movie pictures,
Junkyard loading and active rainy gameplay, and four advancing snow-arena views. Device logs
report 18.1 / 52.6 / 35.4 ms of silence (movie / one-player / four-player), with underruns and
dropped frames. Deterministic sound matches. Flawless device audio, full campaign acceptance
and console visual parity remain unclaimed.
+68
View File
@@ -0,0 +1,68 @@
# Native projection and weather helpers
This increment replaces `mathfMulVec4x4` (`1da238`) at the audited returns `1dc438`
(`mathfTransform3dTo2d`) and `1e8cfc` (`particleUpdateRainViewport`). It also replaces
`mathfUnitMatrixAsm` (`1db0f0`) at the weather path's identity return `1e8c48`.
Other callers and the historical checker retain the original complete ABI. Engine `4a8f70a` is unchanged.
The point helper takes ordinary matrix/point records and writes all four numerical output components.
Input W is ignored; each matrix row's fourth component is its translation. Separately rounded products
and cyclic reduction order are retained: `a+(b+(c+d))`, `b+(c+(d+a))`, `c+(d+(a+b))`, `d+(a+(b+c))`.
Inputs are snapped before output writes, including overlap. The identity path writes a native identity
record and the constant CPU ABI results previously returned alongside it.
Neither path reads or changes VU registers, accumulator, flags or data memory. Host FP control is
restored completely. Explicit `TMB_NATIVE_PROJECTION_CHECK=1` runs the original generated leaf on a
copied context and compares the complete output record; normal player runs do not execute that oracle.
## Validation
Evidence: `D:/BozoScratch/math-helpers`, against main `a415f42`, with the same disc, engine, build and input
scripts. Agent runs use private user directories. These are functional checks with no timing claim.
- `tmb-native-projection-tests` passes 786,432 original/native helper cases across four host FP modes,
bounded values, arbitrary bit patterns, denormal/extended values, overlap, RAM aliases, low address
bits and scratchpad. There are 192 complete flat-memory helper comparisons. CPU ABI, preserved VU
state and complete restored MXCSR are checked.
- 2,048 generated caller cases cover complete `mathfTransform3dTo2d`, including null-pointer bypasses,
actual view getters, perspective division and output writes; and the active weather continuation
from `1e8c50` through scalar matrix setup, projection, depth adjustment and epilogue. Another 64
complete flat-memory comparisons cover these cases. This is not a whole-weather-function fixture.
- 4,096 fallback cases check unknown callers and the historical host's complete original ABI. Another
1,024 actual helper/consumer sequences reproduce the padding chain below. The same suite also passes
with the strict copied-context oracle enabled, including the identity helper's diagnostic path.
- All seven native suites and 12 release-tool tests pass; player, headless and historical checker build.
- Default 1P (9,500 frames) and actual 4P (8,500) match main on every draw hash/count, sound hash/sample
count, library call field, EE clock, scratchpad and thread record. Separate strict/default recordings
are byte-identical. RAM differences are bounded below; no hash mask is widened.
- The native point path executes 58,574 screen / 5,560 weather transforms in 1P and 114,110 / 15,192 in
4P. Strict runs perform 64,134 / 129,302 original point comparisons. The owned identity return has
zero live hits in these routes: its native and diagnostic coverage is fixture-only. Other identity
callers still execute their original implementation. Default VU0 program counts remain zero.
- Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) complete through loading. Direct capture
inspection covers decoded movies, readable loading, arena vehicles/effects, targeting labels/health
bars and four snowy views. These are bounded smoke checks, not console or pixel parity.
Device logs retain dropped frames and 24.8 / 55.0 / 21.8 ms of silence; deterministic sound is exact,
without a flawless-device-audio or subjective listening claim.
## RAM boundary and remaining work
RAM hashes differ on 1P frames `6998..7026` (29 frames) and 4P frames `4730..8499` (3,770 frames).
The checked 32 MB snapshots isolate one differing word at 1P frame 7,000 (`26077c`), and two at 4P
frame 6,000 (`25da7c`, `26077c`), with no other differences. These are `Vehicle+52c`, W of its peeling-out
offset at `+520`.
The original projection leaves its fourth result in VF16.W. The unconverted direction helper `1da298`,
called from `vehicleUpdatePeelingOut` at return `1abd64`, calculates XYZ but stores that old VF16.W too.
The native vehicle offset consumer at `1ab29c..1ab2a8` reads XYZ only and preserves its destination W.
The sequence fixture executes the actual original/native projection, the original direction ABI and
the production native vehicle consumer: the offset's W is the sole differing memory word, while XYZ
and the consumed output remain identical. No artificial VF16 or padding restoration is added.
This evidence bounds the checked snapshots/dataflow, not all possible campaign consumers. Other VU
macro helper callers, scalar packet builders and legacy graphics buffers/extents remain separate work.
The published player release and engine pin are not changed by this source increment.
[`NATIVE_WEATHER_VIEWPORT.md`](NATIVE_WEATHER_VIEWPORT.md) subsequently retires the
viewport's forward transform and qualifies complete entries through its existing
native identity/projection branches, including fade/fog and grid-placement consumers.
+87
View File
@@ -0,0 +1,87 @@
# Native ricochet forward transforms
[Launcher turret-aim forwards](NATIVE_LAUNCHER_AIM_FORWARD.md) follow with three launcher sites.
Two `Weapon::UpdateRicoTrans` (`1b2ee0`) forward returns use native XYZ
arithmetic after the [weapon lock-on, satellite and rock forwards](NATIVE_WEAPON_LOCK_FORWARD.md).
Known forward coverage grows from 137 to 139 of 269 returns (130 remain). Known
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Producer and consumer |
| --- | --- |
| `1b2fb0` | Per-frame velocity through the weapon basis, in place, added to the ricochet position before its height test; the stack vector then receives the height-test normal and is read by `Weapons::ComputeReflection` |
| `1b3118` | Speed vector through the basis the owner rebuilt from the reflected direction, added to the ricochet position |
Both results are the owner's stack vector at frame `+0`, read only as XYZ:
`mathfAddVector` (`1daef0`), `hdHatTest` (which writes only XYZ into it), and
`ComputeReflection` (`1b7200`), whose subtract, normalize and dot-product helpers
are scalar. The owner never reads frame `+0c`, and reads no VU registers,
accumulator or flags. The existing native helper computes separately rounded XYZ,
preserves destination W and leaves VU state untouched. Unknown and historical
callers keep the original ABI. No engine or gameplay formula changes.
`Weapon::RockHD` (`1b6cd8`, `1b6d3c`) was examined and left on the original path:
its transformed point is handed to `hdPntSphereTest`, which publishes the pointer
to the `hdHier` hierarchy traversal. That consumer needs its own audit.
## Generated comparisons
Evidence is under `D:/BozoScratch/ricochet-forward`, against parent `4d863cd`
(PR #57). Parent headless/window binaries are preserved there and match PR #57's
manifest. Generated bodies, retail data and runtime recordings stay outside Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
(caller kinds 242 and 243): helper-boundary continuations and full-owner
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
bases and arbitrary W payloads.
- Full entries execute the real height test and, when the resulting height is
low, the real reflection branch: `ComputeReflection`, `mathfRotationFromVector`
and `mathfRotMatrixPH` rebuild the basis before the second transform. The
frame-count-zero scenario skips that branch. Producer reach is asserted for
both sites in every case.
- Transform inputs and outputs are captured at the real helper and
`mathfAddVector` boundaries. Where the fixture knows the basis (the first site,
and second-site helper-boundary cases), the output is checked against an
independent identity or quarter-turn result; the owner-rebuilt basis is covered
by the native/original comparison. The published point is asserted exactly
against the original FPU addition: X/Y at `hdHatTest` (Z is lifted for the
test) and the final position after the second transform. The first site
publishes in 768 cases, the second in 960.
- The VU rule from the previous increment applies: exact outside the original
leaf's write set; inside it, the original's later write or the native leaf's
entry value. Only forward scratch W at frame `+0c` is normalized for test
comparison, after every real consumer.
- The particle effect paths of the ricochet's launch state stay on the original
path and are not reached by these fixtures.
- The fixture fix also restores a satellite setup line from PR #57 that a
misplaced comment had disabled (`vehicle+0x2370` now gets its fixed point
instead of fill data). All earlier counts and assertions are unchanged.
- Aggregate caller coverage is 124,928 generated sequences / 5,792 whole-memory
comparisons. Historical forward ABI coverage is 8,320 / 520; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `4d863cd`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. The first ricochet return `1b2fb0` is live: it runs
natively 319 times on the one-player route with no recorded difference (the rock's
`1b3ef8` still runs 1,569 times, also exact). The reflection-branch return `1b3118`
is cold on these routes and is qualified by the generated owner suite above.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames; `1b2fb0` runs natively 67 times in the one-player window.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
Audio device underruns remain: 55.9 ms silence in one-player, 40.7 ms in
four-player and 18.0 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. A visible ricochet bounce off a wall, full
campaign and physical controller/hardware acceptance remain open.
+106
View File
@@ -0,0 +1,106 @@
# Native rigid-body forward transforms
Ten rigid-body forward returns now use native record arithmetic, after
[completion of the known inverse sites](NATIVE_FINAL_INVERSES.md).
Forward coverage grows from 96 to 106 of 269 returns; inverse coverage stays
134 of 134. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `1ed478` | `applyLocalForce(force)` | World-force accumulator |
| `1ed4c4`, `1ed4dc` | `applyLocalForce(force, point)` | Force and point transforms, world-force and torque accumulators |
| `1ed544`, `1ed55c` | `applyLocalTorque(force, point)` | World torque and angular-state consumers |
| `1ed708` | `applyLocalImpulse(impulse)` | Momentum and linear velocity |
| `1ed754`, `1ed76c` | `applyLocalImpulse(impulse, point)` | Linear/angular momentum, meaningful inverse result and angular velocity |
| `1edf38` | `resolveForces` | Integrated coordinate-system position |
| `1ee07c` | `computeX` | Published world position and point velocity |
Forward arithmetic is unchanged: native calls calculate separately rounded XYZ,
retain destination W and leave VU registers, accumulator, flags and data memory
untouched. Original scalar consumers use XYZ. Unknown callers and historical
hosts retain the original full ABI. No engine or integration formula is changed.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/rigid-body-forward`, against main `79acf14`
(PR #50). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 5,120 generated sequences / 320 whole-memory comparisons.
Aggregate coverage is 108,032 / 4,736. Each return has 256 helper-boundary cases
through its actual tail and 256 complete owner entries. Four rounding modes,
denormal controls, RAM aliases, rotated bases, zero/nonzero vectors, signed
forces, zero/nonzero inverse mass and source aliases with momentum/position
records are covered. Whole-memory entry samples reach active transforms.
- Complete force/torque entries execute both transforms where present, actual
world-point translation, world-force accumulation, point subtraction, cross
product and torque accumulation. Impulse entries also execute actual momentum
addition, mass scaling and the existing native inverse angular-velocity leaf.
Explicit per-site counts and world-consumer counts are required.
- Complete `resolveForces` entries retain skew-matrix construction, scalar matrix
operations and their store/alias order, orthonormalization, momentum updates,
actual `computeAuxiliarys`, the final forward and coordinate-system position
subtraction. Zero and nonzero time steps run. The original matrix/integration
behavior is compared directly; a guessed integration equation is not substituted.
- `computeX` entries execute the actual local-to-world position publication.
Every new case then reads the resulting body state through the real
`getPointVelocity`, including its position subtraction, angular cross product
and linear-velocity addition. This happens before any comparison-only W
normalization.
- Known simple entries require exact force/torque accumulation, momentum and
linear/angular velocity publication with identity/rotated bases. Zero-step
integration must preserve the seeded momenta. Computed world points must equal
known translated positions. These assertions supplement original/native
comparisons; they do not replace the original scalar consumers.
- The only opaque forward W locations are the actual owner's stack `SP+0c`,
`SP+1c`, integration scratch `SP+7c`, or `RigidBody+4c` for `computeX`.
Helper-boundary and complete-entry stack bases differ by their real frame sizes;
exact output counts and allowed addresses are asserted. Reference W remains
intact through all real consumers, including point velocity, then is normalized
for comparison only. Meaningful inverse W is never excluded. No runtime RAM
mask or VU-state reconstruction is introduced.
- CPU outside retired VU, host FP effects, clocks/checkpoints, per-site forward
counts, world/action counts and final memory agree. Native VU stays untouched
through the complete consumers.
- Historical forward ABI coverage grows to 6,208 cases / 388 whole-memory checks;
inverse stays at 8,576 / 134. Existing coverage retains 786,432 hierarchy helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
32 whole-memory and 2,048 unknown ABI cases. Previous AI, vehicle/light and final
inverse publication assertions remain enabled.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass. Earlier
AI, vehicle/light and final-inverse publication assertions remain enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recording files and snapshots are byte exact;
strict comparisons report no mismatch.
One-player reaches `resolveForces` 738 times and `computeX` ten times. The eight
local force/torque/impulse sites are cold on these replay routes, and four-player
makes no calls to the ten new forward returns. Those local paths are qualified
by complete generated entries and their scalar state consumers, not claimed as
runtime route coverage.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
AI opponents, combat/effects, four simultaneous views, decoded intro images and
return to the menu. Each route has five distinct captures.
Windowed 1P reaches `resolveForces` 583 times and `computeX` four times; the other
eight new sites remain cold. Four-player and movies make no calls to these ten
sites. Stereo 48 kHz, 16-bit WAV captures contain nonzero audio. Device underruns
remain: 50.5 ms silence in 1P, 132.8 ms in 4P and 20.7 ms in movies. These runs
are functional checks, not a timing or flawless-playback claim. Full campaign,
every rigid-body configuration and physical-controller/hardware acceptance
remain outside this increment.
## Remaining scope
There are 163 forward returns outside the native allowlist, with no known static
inverse return remaining. Other inline arithmetic, remaining hierarchy/VU helpers
and historical/unknown ABI support remain separate work. This is a call-site
inventory, not a count of all remaining emulation.
+113
View File
@@ -0,0 +1,113 @@
# Native rigid-body inverses
Seven rigid-body inverse-transform returns now use native record arithmetic,
extending the [collision/drift increment](NATIVE_COLLISION_DRIFT_INVERSES.md).
Inverse coverage grows from 105 to 112 sites; forward coverage stays at 95.
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Result and consumers |
| --- | --- | --- |
| `1ed6c4` | `RigidBody::applyWorldImpulse` with application point | Published angular velocity, then real point velocity |
| `1ed8ec`, `1ed92c` | Two-body `resolveCollision` | Cross/dot products, impulse magnitude and both bodies' impulses |
| `1edaec`, `1edc04` | Fixed-surface `resolveCollision` | Normal impulse, tangent normalization, friction choice and friction impulse |
| `1edd94` | Moving-surface `resolveCollision` | Relative velocity, impulse magnitude and impulse application |
| `1ee030` | `RigidBody::computeAuxiliarys` | Published angular velocity, then real point velocity |
The existing native inverse snapshots its operands, computes separately rounded
XYZ and copies the first basis column's W as data. All four output components
remain exact. Native calls leave VU registers, accumulator, flags and data memory
untouched. Historical hosts and unknown callers retain the full original ABI.
Scalar inertia/matrix production, collision decisions, cross/dot products,
friction and impulse application remain generated game code.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/rigid-body-inverses`, against main `a36c634`
(PR #45). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 3,584 sequences / 224 whole-memory comparisons. Aggregate
coverage is 91,136 / 3,680. Four host rounding modes, denormal controls,
cached/uncached RAM aliases and arbitrary first-basis W payloads are covered.
- Each site has 256 inverse-boundary cases through its real return and 256
complete generated function entries. The 1,792 entries include 1,472 reached
inverse paths and 320 separating-contact/small-speed rejection paths.
Per-site original/native call counts distinguish those paths explicitly.
- World-impulse entries run actual momentum addition, scaling, lever-arm cross
products and angular velocity publication. Auxiliary entries run the actual
inertia/matrix producer. Both feed the published velocity through the real
`getPointVelocity` function, including its lever-arm cross/add consumer.
- Two-body collision entries apply impulses to both bodies. Fixed-surface
entries exercise normal/tangent response, zero velocity, both friction
coefficient branches and final impulse application. Moving-surface entries
include aliased reference velocity; world impulses include an aliased impulse
input. Zero impulses, restitution values 0/0.5/1 and rotated coordinate bases
are covered. These are bounded record fixtures, not every possible scene.
- All seven new consumers and complete entries run to return without service
stubs or early checkpoint boundaries. CPU outside retired VU, outgoing host
FP effects, clocks/checkpoints, call counts and final memory agree. Native
VU stays untouched through the complete sequences. No new W exclusions are
used; all four inverse-result components remain compared exactly.
- Historical inverse ABI coverage grows to 7,168 / 112 cases / whole-memory
checks. Forward remains 5,504 / 344. Existing hierarchy coverage retains
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Four-player recordings match the parent on every field. One-player
records match on draw, sound, calls, scratchpad, threads and timing/counts; raw
RAM hashes differ on 85 frames only. Strict/default native files and snapshots
are byte exact and strict result comparisons report no mismatch. The sampled
frame-7000 1P and frame-6000 4P RAM images match their parent byte for byte.
One-player reaches 2,221 new inverse calls. The two-body returns `1ed8ec` and
`1ed92c` stay cold in these replays and are qualified by complete-entry fixtures.
Four-player makes no calls to these seven rigid-body inverse sites.
### RAM provenance
The 1P RAM difference is bounded to opaque stack padding:
- Frames 7714-7743 differ at `8ff19c`; frames 8521-8575 at `8ff1dc`.
Each slot holds `02000200` in the parent and zero in the native run. Dumps at
the first affected frame in each interval identify only those two bytes.
- The inverse at `1ee030` publishes identical full XYZW, including meaningful
basis W `02000200`. Its native implementation leaves VF16 untouched.
The unchanged forward helper at return `1edf38` then spills stale VF16.W into
a temporary while its actual scalar displacement consumer reads XYZ only.
- A generated-store trace identifies the first slot's later writer as
`mathfMulMatrixTP3x3`, return `1ede74`. `createSkewSymmetric` writes only 3x3
arithmetic fields; the matrix helper copies its residual first-column W from
`8ff1dc` into `8ff19c`. The subsequent matrix scale/add consumes the 3x3 fields.
This explains the padding's movement without adding a register shadow.
- Diagnostic runs hash a copied 32 MiB RAM image on all 85 affected frames after
clearing just the identified four-byte slot for that frame. All other bytes
match by hash. These diagnostics do not modify game RAM or production checks.
Their original recording files match the qualified baseline/native recordings
byte for byte; the writer trace's 7,800-frame payload also matches its baseline.
- Temporary source instrumentation was removed. Original generated/runtime
object hashes match exactly, and the qualified headless executable was
restored byte for byte. Raw RAM hash differences remain reported, not hidden.
Fresh isolated windowed runs complete 6,500 one-player, 6,500 four-player and
4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
driving/combat/effects, four simultaneous views, decoded intro images and return
to the menu. Each route has five distinct captures. Windowed 1P reaches 853 new
inverse calls; 4P and movies make none. Stereo 48 kHz WAV captures contain nonzero
audio. Device underruns remain: 54.9 ms silence in 1P, 23.4 ms in 4P and 16.2 ms
in movies. These are functional checks, not a timing or flawless-playback claim.
Full campaign, every scene and physical controller/hardware acceptance remain
outside this increment.
## Remaining scope
Current generated source has 134 inverse-helper returns and 269 forward returns.
Of these two families, 22 inverse and 174 forward sites remain outside the native
allowlists: 196 total. This is a call-site inventory, not a count of all remaining
emulation. Remaining inverse groups include AI, driver/boss helpers, HUD/radar,
rollover, damage, lighting, a tire helper and a particle helper. Additional inline
arithmetic and forward transforms remain separate work.
+91
View File
@@ -0,0 +1,91 @@
# Native renderer hierarchy
The USA player's renderer hierarchy now uses typed scene, frame, matrix, clip and light records. Its
producers, traversal decisions, C getters/setters and mesh consumers change together. There is no
compatibility register bank, addressable VU memory, uploaded image selector or microprogram dispatch in
this calculation path. BozoEngine remains at the independently qualified `4a8f70a`.
## Boundaries
`runtime/tmb_scene.cpp` contains record calculations; `runtime/tmb_scene_hooks.cpp` connects 197 audited
instruction sites to the existing scalar game traversal. These cover view-cache inputs, root/coordinate/
child transforms, inner/outer FOV tests, object projection, light selection, scaled distance/LOD,
position save/restore and matrix accessors. Scalar branches, bookkeeping, checkpoints and game memory
records retain their existing owners. Packet-only vector payload stores are retired.
`tmb_meshes.cpp` consumes the native object matrix, directional/selected point lights and alpha depth.
Its original context reads are confined to the historical checker host. Each player runtime owns a
scene through a game-thread `Binding`; destruction releases it and a subsequent run starts fresh.
Windowed hosts bind inside `game.run`, where traversal actually executes. C setters may initialise a
frame one basis at a time; reads require the requested basis and traversal requires the complete frame.
Invalid indices, incomplete light lists and uninitialised frames fail explicitly.
The owner ELF has 21 `callms` sites: 14 are replaced here; the native height helper already bypasses one;
the six old 2D helper sites reject if reached. All 21 sites are therefore adapted or guarded. Ordinary
native overlays do not use those six helpers in the qualified routes. Reaching another unsupported
route is an error, rather than silently invoking compatibility microcode. Only explicit
`TMB_NATIVE_HIERARCHY_CHECK=1` permits the existing height oracle to execute the original helper on a
copied context; that diagnostic saves/restores its library image state, including on exception.
Arithmetic retains the shipped separately rounded/truncated operations, including the scaled-X factor
on the light-selection Y-squared term. The eighth input colour originally aliases the first selected
colour: selection clears that slot, then the first accepted light replaces it. Native records preserve
this particular dependency without retaining its memory layout. Unused light-position slots and their
padding are zeroed; active numerical lanes and resulting shading are compared below.
## Validation
Local artifacts: `D:/BozoScratch/renderer-hierarchy`, compared with TMB main `31f54d1` and the same engine,
disc, scripts and build configuration. All game runs use isolated scratch user directories. These are
functional checks, with no timing or speedup claim.
- `tmb-native-scene-tests` passes 32,768 complete root/camera/three-child/FOV/object/LOD sequences in four
host FP modes against the original hierarchy programs, plus 32,768 light selections and 96,684 actual
point-shading comparisons. Geometry uses finite inputs; arbitrary IEEE NaN payload/sign propagation
is not promised. Only inactive position lanes/padding are excluded from light-record comparisons;
the complete rendered colours are compared without that exclusion.
- The actual freshly generated view-cache, coordinate, child and getter/setter helpers execute through
the production instruction dispatcher with no microprogram/device service. Complete VU context and
4 KB VU-memory sentinels stay untouched. Partial frame construction, rejection of an unsupported
program, separate runtime owners and destruction/address reuse pass.
- Existing native matrix/direction, HUD, vehicle and collision-hierarchy suites pass, as do all 12
release-tool regressions. Player, headless and historical checker targets build successfully.
- Default 1P (9,500 frames) and 4P (8,500) complete with **zero VU0 program calls**. Every frame's draw
hash/count, sound hash/sample count, library calls, EE clocks, scratchpad and thread records match
main. RAM is different, as bounded below. This does not imply zero hardware accesses throughout the
rest of the port.
- Separate strict runs reproduce both default recordings byte-for-byte. Their copied-context collision
helpers perform 4,977,182 / 1,560,611 original comparisons, including 168,137 / 36,227 diagnostic-only
height microprogram calls. Scene comparisons are in the dedicated test suite, not this live flag.
- The 1P route executes 949,504 coordinate transforms, 433,552 child transforms, 4,998,340 FOV tests,
1,436,327 object projections, 879,562 light selections and 894,750 LOD calculations. The 4P route
executes 1,319,416 / 648,187 / 6,524,809 / 1,982,686 / 0 / 769,035 respectively. Live point-light
coverage therefore comes from 1P; unit tests also exercise eight-input selection and the colour alias.
- Windowed default runs finish 4,201 movie/menu frames and 6,501 frames each for 1P and actual 4P,
through loading into active arenas. Direct capture inspection covers decoded movie pictures, menus,
the stage-loading screen, textured gameplay, vehicle/HUD effects and four independent snowy views.
Audio logs report 18.0 / 35.9 / 54.5 ms of inserted silence and dropped device frames. Deterministic
sound remains exact; flawless device audio or subjective listening acceptance is not claimed.
## RAM boundary and remaining work
Raw RAM differs from frame 2 because retired vector stores no longer populate unused graphics payloads.
At the 2,000-update gameplay snapshot, all 17,256 differing words lie in the owner's named packet-storage
intervals (names and starts from the USA ELF symbols):
| Packet storage | Interval, end exclusive | Different words |
|---|---|---:|
| `hierObjPkt` | `564a80..5eca80` | 154 |
| `hierObjPkt2` | `5eca80..630a80` | 8,595 |
| `hierAlphaPkt` | `630a80..64ea80` | 4,554 |
| `hierAlphaPkt2` | `64ea80..66ca80` | 3,953 |
There are zero differences outside these intervals at that snapshot. `hierGetBigBufAddr` also returns
`564a80`. This evidence bounds that snapshot, not every intermediate frame or campaign path. No stale
packet/vector restoration, shadow register bank or broader memory-hash mask is added.
Other game math helpers and VU macro instructions remain. The subsequent
[`NATIVE_SHADERS.md`](NATIVE_SHADERS.md) increment removes `VuImage` and the scene's light packing, using
named native shader inputs instead. Scalar packet-building code still survives around several hooks.
The historical checker/original program implementation remains for comparison. These increments do
not claim total VU/emulation removal, full campaign qualification or console visual parity.
+59
View File
@@ -0,0 +1,59 @@
# Native mesh shader parameters
The native mesh path no longer builds or reads a `VuImage`. `tmb_shader_parameters.h` defines named
object/camera/clip matrices, directional and point lights, tint, texture offsets, depth scale, fog and
morph weight. `tmb_shading.h` consumes those records directly for strips, sprites, ribbons, skin colours
and reflections. There is no quadword address, wraparound, `setQw`, word bank or packed-input fallback
in this runtime path. BozoEngine remains pinned at `4a8f70a`.
Scene light selection now produces per-light direction, position, colour, cone and attenuation fields
directly. It retains selection's four-light limit, the shipped shader's three-light contribution, the
eighth-input colour alias and the original off-diagonal move rounding. The old eleven-row light packing
is gone; the fourth selection's colour is a normal light field rather than other colours' W components.
Each object gets fresh parameters. The scene's run owns the last opaque transform/directions and retained
morph weight. Alpha headers do not replace the opaque cache. A pool-less rigid resume retains its setup,
projection and lights under the existing rules; a morph without a new instance keeps the last weight.
View setup refreshes default directions and invalidates the previous draw. Historical checker inputs
are decoded from their original context ABI into the same native parameter types; player hosts read
scene records. An unused `Drawn.check` snapshot of packed constants is also removed.
The previous project-owned shading implementation, including its packed input, is retained only under
`tests/fixtures`. It is a numerical reference, not a runtime adapter or microprogram interpreter.
## Validation
Local evidence: `D:/BozoScratch/shader-parameters`, against main `9d7372f`, the same USA disc, engine and
input scripts. All runs use isolated user folders. Builds and checks here are functional, not timing runs.
- All six native suites and 12 release-tool tests pass. The player, headless and historical checker build.
- The new disc-free shader suite compares 32,768 synthetic parameter sets in four host FP modes with
the previous packed implementation: all three strip colour modes, lit/unlit skin colours, scaled and
unscaled projection, fog, 16,401 visible sprites, 147,912 emitted ribbon vertices and dry/water
reflections agree bit-for-bit. Ribbon fixtures cover emitted geometry, parity and clipping. These
finite inputs do not establish arbitrary NaN payload equivalence.
- The scene suite still passes 32,768 complete transform/FOV/LOD sequences, 32,768 original light
selections and 96,684 actual point-shading comparisons. Active light fields are checked directly;
unused positions and the fourth selection's unconsumed geometry are excluded. Binding isolation and
destruction/reuse now also check retained morph state. Generated-helper routing and VU sentinels pass.
- The shader suite also builds/runs directly with GCC and only the runtime include folder: no disc,
generated game C++, SDL or engine library is needed. Windows/Linux CI runs this standalone check.
- Default 1P (9,500 frames) and actual 4P (8,500) recordings are byte-for-byte identical to main's complete
recordings, including RAM hashes, scratchpad, draws/counts, sound/samples, calls, clocks and threads.
Both corresponding strict recordings are also identical to main and to their default runs. Native
defaults still execute zero VU0 programs; strict collision diagnostics retain their explicit oracle.
- Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) finish through loading into active arenas.
Captures were inspected directly for decoded movies, readable menus/loading, textured vehicles,
lighting, fog, HUD/effects and four independent snowy views. All five movie captures exactly match
the prior batch's PNGs. Real-time gameplay captures vary even between two runs of the unchanged
saved baseline executable; they are visual smoke evidence, not a pixel-parity assertion.
- Device logs retain dropped frames and 23.4 / 55.5 / 26.4 ms of inserted silence in movie/1P/4P runs.
Exact deterministic sound is not a claim of flawless device audio or subjective listening acceptance.
## Remaining scope
Other generated VU macro math and game helper callers still remain, as do scalar packet builders,
legacy graphics extents and game-owned constant buffers used by several hooks. This change removes
the mesh shader's compatibility parameter storage; it does not claim total emulation removal, full
campaign qualification, console visual parity or a performance improvement. It publishes source
changes without updating the earlier player release or migrating the engine pin.
+112
View File
@@ -0,0 +1,112 @@
# Native shadow transforms
Six forward-transform helper returns now use native XYZ record calculations,
extending the [particle-emission increment](NATIVE_PARTICLE_EMISSION.md). Forward
coverage grows from 70 to 76 sites; inverse coverage stays at 85. BozoEngine remains
pinned to `4a8f70a`.
| Return PC of helper `1da298` | Owner | Consumer |
| --- | --- | --- |
| `15e1b8` | `shadowUpdate` (`15df38`) | Vehicle shadow world vertices, height offset and packed XYZ publication |
| `1b42c8` | `UpdateShadowTrans` (`1b41d0`) | In-place weapon motion direction, then coordinate-system position update |
| `1b430c`, `1b43a8`, `1b4434`, `1b44c0` | `UpdateShadowTrans` | Four world-space points for shadow height sampling |
The existing native calculation snapshots operands before overlapping writes,
computes separately rounded XYZ and retains destination W. Actual following world
sums, packed vertex writes and the first height-query vector copy consume XYZ only.
Later terrain-height code also copies complete vectors, retaining opaque W in
temporary endpoints and the flat-height result; its height/normal consumers use XYZ. VU
registers, accumulator, flags and data memory stay untouched. Historical hosts and
unknown callers retain the complete original ABI. Shadow selection, matrix
construction, height queries, pitch/orientation, smoothing and game checkpoints
remain compiled game code.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/shadow-transforms`, against main `0de15eb`
(PR #37). Generated game code, retail data, recordings and captures stay outside Git.
- Added coverage is 3,072 consumer sequences / 128 whole-memory comparisons.
Aggregate coverage is 67,584 / 2,208. CPU outside retired VU, outgoing host FP
effects, clocks/checkpoints and consumer memory agree; native VU stays untouched.
Four host FP modes, denormal controls, RAM aliases and arbitrary opaque stack-W
payloads are covered. Original forward W is normalized only after all actual
consumers have run.
- Vehicle coverage includes 256 complete cached-height vertex loops / 16 extra
whole-memory cases, with one to four vertices, actual successive helper calls,
world sums, negative-height clamp, packed XYZ vertices and shadow-center
publication through return. Signed zero, signed subnormals and heights around
one are included. Shadow/matrix selection and uncached terrain queries are
outside these loop fixtures.
- The remaining vehicle cases and every weapon transform run through the actual
`hdHatTest` prefix: its XYZ copy, downward-ray Z adjustment and global point
publication, stopping at its first `memset` dispatch. Terrain collision beyond
that point is outside these bounded fixtures; no height-query stub is used.
- Another 256 weapon cases / 16 extra whole-memory enter at `1b429c`, execute the
actual movement-Z producer, in-place transform, coordinate-system position
update and first transformed corner through the same height-query prefix.
The other weapon cases enter at individual helper boundaries. Coordinate-system
position W is retained and compared exactly. Later height results, pitch and
smoothing are not exercised by these consumer fixtures.
- Historical forward coverage grows to 4,288 / 268 cases / whole-memory checks;
inverse coverage stays at 5,440 / 85. The hierarchy suite retains 786,432 helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP
callers / 32 whole-memory and 2,048 unknown ABI cases. The math suite retains
1,048,576 / 512 and 2,048 unknown ABI cases.
- Player, headless, historical checker and all native test targets rebuild. All
eleven native suites and twelve Python tooling tests pass.
## Gameplay, loading and movies
The default and strict-check builds complete 9,500 one-player frames and 8,500
actual four-player frames. Strict/default recordings and full 32 MiB snapshots
are byte-exact. Against the previous increment, all scratchpad, call, draw, sound,
thread, count and EE-clock fields agree on every frame; the four-player recording
and both full snapshots also agree exactly.
One-player RAM hashes differ on 3,599 frames, first at 5,593. A temporary paired
store observer reproduces both complete qualified recordings and every raw frame
hash. All differences are confined to four opaque stack-W words: vehicle output
`8ff57c`, terrain-height temporary endpoints `8ff38c` / `8ff39c`, and the
flat-height result `8ff43c`. The latter three are actual 64-bit vector copies in
`terrainGetHAT` (`1efa38`), reached through `hdHatTest` return `1ced28` and flat
height return `1efb24`. Height calculations and the following normal copy consume
XYZ. Each differing word matches its last traced writer; replacing these four
words on a diagnostic RAM copy reproduces every baseline frame hash, with zero
unaccounted frames. No observer, RAM mask or VU-state restoration ships. All 32
generated sources and 35 production object hashes were restored exactly afterward.
The vehicle site runs 25,186 times in the one-player route and is cold in the
four-player route. The five weapon sites are cold in both; their acceptance comes
from generated-consumer comparisons, not a claim that these routes cover them.
Total native forward calls are 1,127,230 / 283,936 (one-player / four-player).
Default runs make zero original-helper comparisons and execute zero VU0
microprograms. These counts are coverage evidence, not a speedup measurement.
After observer removal, the player, headless runner, historical checker and all
eleven native suites rebuild; all suites pass again. The three production
binaries contain no temporary observer markers.
Fresh 6,500-frame actual four-player and one-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, using isolated scratch
user data. Reviewed captures show decoded movie playback (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), active one-player gameplay and vehicle
shadows (5,500 / 6,300), and four advancing snow-arena views with snow/tire effects
(four-player 5,500 / 6,300). The windowed one-player route reaches the new vehicle
site 11,942 times; the weapon sites remain cold. These captures establish bounded
functional coverage, not pixel-exact windowed or console parity.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
27.7 / 77.2 / 29.2 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound matches the previous increment;
flawless device audio, subjective listening and full campaign acceptance are not
claimed.
## Remaining scope
The two helper inventories now have 76 native forward and 85 native inverse sites.
Outside their allowlists remain 193 forward and 49 inverse sites, 242 in total
across the game, including sites inside otherwise replaced functions. This is a
structural source inventory, not a live cost measurement, and excludes other helper
families and inline VU operations. Full campaign acceptance and console visual/audio
parity remain separate work.
+79
View File
@@ -0,0 +1,79 @@
# Native launcher special-weapon forward transforms (held aim and lock-on arcs)
[The weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md) follows with six RockHD/RicoHD sites.
Seven more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
the [type-100 sweep batch](NATIVE_SPECIAL_SWEEP_FORWARD.md). Known forward coverage
grows from 209 to 216 of 269 returns (53 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
All seven are in `Launcher::UpdateSpecial` (`14dae0`):
| Return PC | Producer and consumer |
| --- | --- |
| `14ed94` | Vehicle type `100` with a shot held (`+284`): the turret is turned, no animation is running, and the aim point at `+350` is smoothed toward `(0, gp-629c, 0)`. It goes through the vehicle's coordinate system into frame `+0`, plus the vehicle system's position, into the position of the object at `+34c`; the owner then returns |
| `14e2d0`, `14e320` | Vehicle type `a0` lock-on arc: a side offset in frame `+0` goes through the vehicle's coordinate system into frame `+20`, plus the vehicle position. That is the arc's first point |
| `14e498`, `14e4dc` | With a target at `+2f4`, a heading-selected table slot (frame `+40` or `+70`) goes through the target's coordinate system into frame `+30`, plus the target's position. That is the arc's second point |
| `14e6a8`, `14e6ec` | The second type `a0` block: the same heading-selected slots through the target's system into frame `+30`, plus the target's position, arcing from the vehicle position |
Every arc ends in `particleElectricArc`, which reads its two points only as XYZ.
`mathfAddVector` reads its operands only as XYZ. The owner never reads frame `+0c`,
`+2c` or `+3c`, and it reads no VU registers, accumulator or flags. The existing
native helper computes separately rounded XYZ, preserves destination W and leaves
VU state untouched. Unknown and historical callers keep the original ABI. No engine
or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/special-arcs-forward`, against parent `2d3c0f4`
(PR #79). Parent headless/window binaries are preserved there and match PR #79's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 3,584 generated sequences / 224 whole-memory comparisons (caller
kinds 314 to 320): helper-boundary continuations and full entries, across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- `14ed94` runs from the owner's start: the type dispatch, the turret step and
bound, the node-matrix rebuild, the animation check and the aim-point smoothing,
to the owner's real return. The arc entries start at the call-return label before
each transform (`14e2b8`, `14e308`, `14e3f8`, `14e608`): the heading bounding and
the window thresholds select the slot, and the fixture stops at
`particleElectricArc` after `rand`.
- The harness requires each full entry to reach exactly its own transform. The
vehicle and target bases are fixture-known, so every site is checked against an
independent identity or quarter-turn result.
- Published values are asserted exactly against the original FPU arithmetic: the
aimed object's position, and the arc end in frame `+20` or `+30` at the arc
call. Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
(frame `+0c`, `+2c` or `+3c`) is normalized for test comparison, after every real
consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 715 → 709,
real libm errno cases 829 → 830). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 164,352 generated sequences / 8,256 whole-memory
comparisons. Historical forward ABI coverage is 13,248 / 828; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `2d3c0f4`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The seven returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 31.4 ms of silence in one-player, 652.5 ms in four-player and 20.9 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The four-player window run overlapped other work on the machine (39 to 48 frames/s around frame 3,300). A back-to-back four-player rerun of new and parent builds then gave 35.1 ms and 103.1 ms of silence at 59.3 frames/s. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
+84
View File
@@ -0,0 +1,84 @@
# Native launcher special-weapon forward transforms (first batch)
[The second special-weapon batch](NATIVE_SPECIAL_VOLLEY_FORWARD.md) follows with vehicle types 1c0 and 140.
Five `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after the
[FinalBoss movement forwards](NATIVE_BOSS_MOVE_FORWARD.md). Known forward coverage
grows from 196 to 201 of 269 returns (68 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
`Launcher::UpdateSpecial` (`14dae0`) runs each vehicle's special weapon, dispatched
on the vehicle type at `+20a8`. This batch covers three of its branches:
| Return PC | Vehicle type | Producer and consumer |
| --- | --- | --- |
| `14dc44` | `60` | Table offset `23cfa0` through the vehicle's coordinate system, added to the vehicle position into the launcher's `+620` |
| `14dccc` | `60` | Table offset `23cfb0` through a matrix at frame `+40`, built from the turret angles (`+290` plus the vehicle's), added to `+620`; then `Weapons::CreateWeapon` |
| `14dea8` | `120` | Table offset `23cfc0` through the vehicle's coordinate system, added into `+620` |
| `14df2c` | `120` | Table offset `23cfd0` through the turret matrix at frame `+30`, added to `+620`; then `CreateStaticWeapon` from `+620` |
| `14e020` | `c0` | The launcher's offset at `+400` through the vehicle's coordinate system into `+620`; after `GetLockOn`, `TheGame::CreateWeapon` |
Each fires when its countdown at `+98` runs out. Every result is the frame vector at
`+0`, read only by `mathfAddVector`, which writes X/Y/Z into `+620`. The
environment-gun increment showed that `CreateStaticWeapon` reads only X/Y/Z.
Frame `+0c` is never read in the owner, and the W of `+620` is not written by
these paths. The owner reads no VU registers, accumulator or flags. The existing
native helper computes separately rounded XYZ, preserves destination W and leaves
VU state untouched. Unknown and historical callers keep the original ABI. No engine
or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/special-guns-forward`, against parent `8f0fdf3`
(PR #76). Parent headless/window binaries are preserved there and match PR #76's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons
(caller kinds 301 to 305): helper-boundary continuations and owner entries,
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Owner entries for types `60` and `c0` run from the owner's start: the type
dispatch, the countdown, both transforms of a pair with the real angle bounding
and `mathfRotMatrixRPH`, and for `c0` the real `GetLockOn`. Type `120` entries
start right after the branch's `UpdateHearse` call, whose own forward transform is
covered by its earlier increment. Each stops at its weapon creation; reaching it
is asserted. Without a countdown, types `60`/`c0` return, and type `120` stops at
its gun-sound update.
- The first transform of each pair uses the fixture's vehicle basis, and so does
`c0`, so their cases are checked against an independent identity or quarter-turn
result. The second transform's matrix is rebuilt from the turret angles, so it is
checked independently only when a case starts at its own helper boundary.
- The final launch point in `+620` is asserted exactly against the original FPU
addition, and for type `120` also as the origin `CreateStaticWeapon` receives.
Publications: 704/960, 704/960 and 480.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 701 → 702,
real libm errno cases 830 → 801). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 156,672 generated sequences / 7,776 whole-memory
comparisons. Historical forward ABI coverage is 12,288 / 768; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `8f0fdf3`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The type-60 returns `14dc44` and `14dccc` are live: each runs natively 66 times on the one-player route with no recorded difference. The other three are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 53.8 ms of silence in one-player, 29.6 ms in four-player and 21.3 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
+78
View File
@@ -0,0 +1,78 @@
# Native launcher special-weapon forward transforms (type 100)
[The held-aim and lock-on arc batch](NATIVE_SPECIAL_ARCS_FORWARD.md) follows with seven sites.
Three more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
the [second special-weapon batch](NATIVE_SPECIAL_VOLLEY_FORWARD.md). Known forward
coverage grows from 206 to 209 of 269 returns (60 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
All three are in the vehicle type `100` branch of `Launcher::UpdateSpecial`
(`14dae0`). The branch runs while no shot is held (`+284`) and the turret angle at
`+290` (stepped down by `gp-62b0`) stays above `gp-42a0`:
| Return PC | Producer and consumer |
| --- | --- |
| `14eb9c` | The turret node's matrix (node at `+2a0`, matrix at `+10`) is rebuilt from that angle with `mathfRotMatrixRPHNoTrans`; table offset `23d070` goes through it into frame `+0`, plus `23d060`, into frame `+20` |
| `14ec04` | The global sweep angle at `gp-3090` (stepped and bounded) builds a matrix at frame `+30`; table offset `23d0a0` goes through it into frame `+0`, added to frame `+20` |
| `14ec70` | The launcher's aim point at `+350`, smoothed toward frame `+20`, goes through the vehicle's coordinate system into frame `+0`, plus the vehicle position; this becomes the position of the object at `+34c` |
When the angle runs below the limit, the branch instead fires from the table
(`CreateStaticWeapon`), with no transform. All three results are the frame vector
at `+0`, read only by `mathfAddVector`. Frame `+20` is read by `mathfAddVector` and
as scalar `smoothEasyIn` targets. The owner never reads frame `+0c` or `+2c`. It
reads no VU registers, accumulator or flags. The existing native helper computes
separately rounded XYZ, preserves destination W and leaves VU state untouched.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/special-sweep-forward`, against parent `e1cf669`
(PR #78). Parent headless/window binaries are preserved there and match PR #78's
qualified build. Generated bodies, retail data and runtime
recordings stay outside Git.
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons (caller
kinds 311 to 313): helper-boundary continuations and full-owner entries, across
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Full entries run from the owner's start: the type dispatch, the angle step, the
real node-matrix rebuild, all three transforms with the angle bounding,
`mathfRotMatrixRPH` and the aim-point smoothing, to the owner's real return. With
the angle below its limit they fire instead and stop at `CreateStaticWeapon`.
- The vehicle basis is fixture-known, so `14ec70` is always checked against an
independent identity or quarter-turn result. The other two use rebuilt matrices,
so they are checked independently only from their own helper boundary.
- Published values are asserted exactly against the original FPU arithmetic: the
sweep point in frame `+20`, and the aimed object's position. Publications:
928, 1,184 and 1,440.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so one
data-dependent count in an earlier fixture moved (real libm errno cases 835 →
829). All scenario-defined counts and assertions are unchanged.
- Aggregate caller coverage is 160,768 generated sequences / 8,032 whole-memory
comparisons. Historical forward ABI coverage is 12,800 / 800; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `e1cf669`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The three type `100` returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 49.1 ms of silence in one-player, 31.8 ms in four-player and 14.4 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. A first window run on a loaded machine reported 9.7 s of one-player silence and a late capture. A back-to-back one-player rerun of parent and new builds then gave 43.8 ms and 51.2 ms at 59.7 frames/s, and the fresh window run above was taken after it. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
+100
View File
@@ -0,0 +1,100 @@
# Native launcher special-weapon torch forward transforms
[The LoopTank batch](NATIVE_LOOPTANK_FORWARD.md) follows with its two segment points.
Ten more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
the [Ferris wheel and final boss batch](NATIVE_FERRIS_BOSS_FORWARD.md). Known forward
coverage grows from 226 to 236 of 269 returns (33 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`. With these, every forward return in
`Launcher::UpdateSpecial` (`14dae0`) is native.
They are the flame-torch specials of three vehicle types:
| Return PC | Vehicle type | Producer and consumer |
| --- | --- | --- |
| `14f190` | `180` (tank car) | A locked-on target within 250: the offset in frame `+60` goes through the turret matrix at frame `+80`, plus the vehicle position, and is line-tested from the vehicle (`hdLosCsTest` end point) |
| `14f1c4` | `180` | Without a close target: the same offset through the vehicle's coordinate system, then the same line test |
| `14f3e8` | `180` | On a line-test hit: `(0, 5, 0)` in frame `+0` goes through the vehicle's system and is handed to `DispatchHit` |
| `14f654` | `1e0` (Minion) | The nozzle offset at `+3a0` goes through the matrix at frame `+80` into the launcher's `+620`, plus the vehicle position |
| `14f68c` | `1e0` | The offset at `+3b0` goes through the matrix at frame `+40` into frame `+0` and is added into `+620`. That point is then aimed at the target (`mathfRotationFromPointToPoint`), measured and line-tested |
| `14f72c` | `1e0` | The flame offset in frame `+20` goes through the torch matrix at `+2b0`, plus `+620`, and is line-tested from `+620` |
| `14f954` | `1e0` | On a hit: `(0, 5, 0)` through the vehicle's system, handed to `DispatchHit` |
| `14fb7c` | `220` (Tanker) | The table offset `23d1f0` goes through the matrix at frame `+70` into `+620`, plus the vehicle position |
| `14fbb8` | `220` | `23d200` goes through the matrix at frame `+30` into frame `+0`, added into `+620` |
| `14fc24` | `220` | Like `14f72c`, line-tested from `+620` |
A consumer audit followed every path from each return until the owner returns or
the slot is rewritten whole. It found these consumers:
- `mathfAddVector`.
- `hdLosCsTest`, whose readers use the points only as XYZ (see the
[weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md)).
- `DispatchHit` and all of its handlers.
- `mathfRotationFromPointToPoint`.
- `particleCreateFx` and `particleTruncateFlameThrower`. The latter passes the point
only to `mathfSubVector`.
- `Weapons::CreateWeapon`, which copies `+620` with `mathfCopyVector`.
The torch sound updaters get other fields. None of these reads W.
The owner never loads frame `+0c`, `+2c` or `+6c`. Launcher `+62c`, the W of the
persistent `+620`, has no reader anywhere. The owner reads no VU registers,
accumulator or flags. The existing native helper computes separately rounded XYZ,
preserves destination W and leaves VU state untouched. Unknown and historical callers
keep the original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/special-torch-forward`, against parent `366c6b2`
(PR #82). Parent headless/window binaries are preserved there and match PR #82's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 5,120 generated sequences / 320 whole-memory comparisons (caller
kinds 331 to 340): helper-boundary continuations and entries at the call-return
label before each transform. They run across four rounding modes, FTZ/DAZ, RAM
aliases, identity/quarter-turn bases and arbitrary W payloads. The entry labels are
`14f17c`, `14f0d4` (with the target distance at least 250), `14f3d4`, `14f644`,
`14f67c`, `14f718`, `14f940`, `14fb68`, `14fba4` and `14fc10`.
- Each run stops at the first call after the result has been consumed:
- `hdLosCsTest` for the line tests;
- `DispatchHit` for the hits;
- `mathfMulMatrix` after the `+620` launch points;
- `mathfRotationFromPointToPoint` after the frame `+0` additions.
- A transform read only by `DispatchHit` is recorded at that call with a zero base.
- Every basis is fixture-known, so every site is checked against an independent
identity or quarter-turn result.
- Published values are asserted exactly against the original FPU arithmetic: the
launcher's `+620`, the line-test end point (and that `hdLosCsTest` receives that
address), and `DispatchHit`'s point and address. Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
(frame `+0c`, `+2c`, `+6c` or launcher `+62c`) is normalized for test comparison,
after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 703,
real libm errno cases 843 → 816). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 174,592 generated sequences / 8,896 whole-memory
comparisons. Historical forward ABI coverage is 14,528 / 908; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `366c6b2`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The ten returns are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 907.3 ms of silence in one-player, 35.5 ms in four-player and 26.4 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The one-player window run overlapped a long read-only audit on the machine and reported 907.3 ms of silence. A back-to-back one-player rerun of new and parent builds then gave 78.4 ms and 59.9 ms at 59.4 and 59.7 frames/s. The torch specials in actual play, full campaign and physical controller/hardware acceptance remain open.
+90
View File
@@ -0,0 +1,90 @@
# Native launcher special-weapon forward transforms (second batch)
[The type-100 special-weapon batch](NATIVE_SPECIAL_SWEEP_FORWARD.md) follows with three sweep sites.
Five more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
the [first special-weapon batch](NATIVE_SPECIAL_GUNS_FORWARD.md). Known forward
coverage grows from 201 to 206 of 269 returns (63 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Vehicle type | Producer and consumer |
| --- | --- | --- |
| `14ee10` | `1c0` | A volley shot's table offset (`23d150`, with the launcher's `+4` set) through the vehicle's coordinate system into frame `+0` |
| `14ee2c` | `1c0` | The same with table `23d0b0` (`+4` clear) |
| `14ee48` | `1c0` | That frame vector, in place, through the basis of the vehicle part at `+1ec8`, added to the vehicle position into the launcher's `+620`; then `Weapons::CreateWeapon` |
| `14ef50` | `140` | A constant offset (`gp-6298`) written into `+620`, transformed in place through the vehicle's coordinate system, plus the vehicle position; then `Weapons::CreateWeapon` |
| `14ef80` | `140` | The launcher's `+400` offset through the vehicle's coordinate system into `+620`, plus the vehicle position |
The type `1c0` volley fires ten shots once its countdown runs out. Each shot chains
two transforms in the frame vector at `+0` and then adds the vehicle position. The
frame vector is read only by the second transform (X/Y/Z input) and
`mathfAddVector`, and frame `+0c` is never read in the owner.
The type `140` sites write `+620`, which is the vehicle's `+2760` launch point,
since the launcher sits at `vehicle+2140`. There the transform's W persists. No code
in the game reads `vehicle+276c` (or a 64-bit or 128-bit block covering it) at a
fixed offset. `Weapons::CreateWeapon` copies the launch point with
`mathfCopyVector` (X/Y/Z only), and the owner hands `+620` only to
`mathfAddVector`.
The owner reads no VU registers, accumulator or flags. The existing native helper
computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. It reads its input before writing, so the in-place transforms are safe.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/special-volley-forward`, against parent
`c4a4fac` (PR #77). Parent headless/window binaries are preserved there and match
PR #77's qualified build. Generated bodies, retail data and runtime recordings stay
outside Git.
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons
(caller kinds 306 to 310): helper-boundary continuations and owner entries,
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Type `140` entries run from the owner's start through the type dispatch,
countdown and flag. A launcher still counting down returns without a transform.
- Type `1c0` entries start right after the volley's `timerGetCurTics` call. That
call reads the hardware timer, which the harness does not model. From there each
entry runs the first shot of the volley, both transforms and the addition, and
stops at `Weapons::CreateWeapon`.
- The volley's two transforms chain without an addition between them. For these
kinds, the test records the first transform's output as the second transform's
input, and checks both.
- Every basis is fixture-known (the vehicle's coordinate system and the part's
basis), so every case is checked against an independent identity or quarter-turn
result. The final launch point in `+620` is asserted exactly against the original
FPU addition. Publications: 640/640/1,536 and 480/480.
- The VU rule from the earlier weapon increments applies. Only the forward W (frame
`+0c`, or `+62c` for type `140`) is normalized for test comparison, after every
real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 702 → 715,
real libm errno cases 801 → 835). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 159,232 generated sequences / 7,936 whole-memory
comparisons. Historical forward ABI coverage is 12,608 / 788; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `c4a4fac`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The volley returns `14ee2c` and `14ee48` are live: each runs natively 20 times on the one-player route with no recorded difference. The other three are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 56.7 ms of silence in one-player, 32.5 ms in four-player and 18.3 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
+90
View File
@@ -0,0 +1,90 @@
# Native sphere/LOD and collision helper calculations
The subsequent [hierarchy helper increment](NATIVE_HIERARCHY_HELPERS.md) adds twelve more returns,
with generated consumer tails and a paired trace of height-BSP temporary W.
Three inline difference blocks now use native XYZ records: `hdSphereTest` at `1c6710`,
`hdLodNode` at `1c69a0`, and the sphere overload at `1cadb8`. Their instruction ranges are
`1c6714..1c6720`, `1c69bc..1c69c8`, and `1cadc4..1cadd0`. Together with the preceding
[terrain/contact increment](NATIVE_TERRAIN_CONTACTS.md), the contact handler owns thirty blocks
covering 162 instruction sites. It snapshots operands, computes XYZ once at the final store,
preserves destination W, and leaves VU state untouched. The existing scalar sphere radius tests,
LOD thresholds, selected-child metadata, return ABI and checkpoints remain compiled game code.
Six additional helper returns also use the existing audited native implementations:
| Helper | Return PCs | Consumer |
|---|---|---|
| Forward direction `1da298` | `1cb19c` | Collision node setup |
| Inverse direction `1da1e8` | `1cb1e4`, `1cb4a4`, `1cb530` | Collision node point/normal setup |
| Inverse direction `1da1e8` | `1cb770`, `1cb834` | Point-contact setup and scalar axis tests |
The inverse allowlist now has twenty entries; the forward-direction allowlist has nine.
Inverse output matches all four components, including the first basis record's W. Forward output
retains its established XYZ/preserved-destination-W contract. Historical hosts and unaudited
returns retain the original complete helper ABI. This does not replace every remaining helper
caller or all VU operations. Renderer hierarchy LOD calculation was already native in
[the scene increment](NATIVE_SCENE.md); this change handles the separate collision LOD selector.
BozoEngine remains pinned at `4a8f70a`; no engine or renderer change is included.
## Numerical and generated-caller checks
Evidence is local under `D:/BozoScratch/sphere-lod`, against main `90c9e21` (PR #24).
Generated game code, disc data, captures and RAM dumps are excluded from the commit.
- The contact suite passes 983,040 original-block comparisons and 960 complete-memory checks.
Existing scalar contact continuations retain 3,584 cases, 112 complete-memory checks and
1,024 ordered-alias cases.
- Another 6,144 complete generated sphere/LOD callers, including 48 complete-memory checks,
exercise sphere class/minimum-radius branches, exact and neighbouring radius boundaries,
LOD selection limits and metadata. Only the unused local difference W is normalized in the
reference comparison. CPU state outside retired VU, complete outgoing host FP effects,
clocks/checkpoints, decisions and other memory must match; native VU state must be untouched.
- Another 3,072 generated helper-consumer sequences, with 96 complete-memory checks, exercise
the six new return sites through their following scalar/vector setup or query boundary.
Cases include zero/copy, normalization and unit-box axis branches. Inverse XYZW is exact;
only the existing forward destination-W contract is normalized before continuation.
These are bounded consumer sequences, not complete collision-query executions.
- Checks cover four host rounding modes, denormal controls and RAM aliases. The hierarchy suite
retains 786,432 helper cases, 384 complete-memory checks, 8,000 geometric edges, 1,024 recursive
BSP callers and 2,048 unknown-caller ABI cases. Its historical-host coverage now rotates
through all twenty inverse sites (1,280 cases, twenty complete-memory checks). Another 64
cases/four complete-memory checks prove the new forward site's historical CPU/VU ABI.
- Player, headless and historical checker builds, all eleven native suites and twelve Python
tooling tests pass. Temporary diagnostics were removed; restored contact/forward compiled
objects match their saved pre-diagnostic hashes, and all three binaries contain no trace markers.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames.
Every non-RAM frame-record field matches the baseline throughout: scratchpad, library calls and
counts, draws and counts, sound and sample counts, thread state and EE clock. Strict contact,
hierarchy, math and projection comparisons pass and reproduce the default recording files
byte-for-byte. A clean rebuild after diagnostic removal reproduces all four qualified recording
files byte-for-byte. Default runs perform zero original comparisons and zero VU0 microprogram calls.
The three new inline blocks execute 1,283,655 / 54,166 times in one-player / four-player. All three
are reached in one-player; four-player reaches only the sphere overload. The five new inverse
sites execute 52,688 / 13,904 times; the new forward site executes 9,779 / 140 times. Thus the
six helper sites retire another 62,467 / 14,044 original helper executions. These are execution
counts, not timing or FPS measurements.
RAM hashes differ on 2,242 one-player frames (5593 through 9499) and 3,798 four-player frames
(4702 through 8499). A complete 32 MB snapshot at one-player frame 7000 is identical. At four-player
frame 6000 exactly three bytes differ, in words `8ff0dc`, `8ff1fc` and `8ff35c`: baseline zero versus
native integer bits 9. The first two are directly traced to unused sphere temporary W stores at
`1cadd0`, returning to `1cb138` and `1ca85c`. The third is a reused stack word: loading writes the
decompressor's scratch count there, and traversal also reuses it for matrix storage. Its complete
last-write divergence chain has not been established. Consequently these snapshots do not prove
every RAM difference harmless or every possible consumer covered. No new hash mask, padding
restoration, shadow VU state or generated-code instrumentation is shipped. An additional snapshot
requested at one-player frame 5593 is baseline-exact; strict/default snapshots are identical too.
Window runs complete 4,201 movie/menu frames and 6,501 frames each for one-player and four-player.
Reviewed captures show decoded movies, loading, active Junkyard combat and four snow-arena views.
Initial device logs report 447.8 / 57.7 / 39.4 ms of silence (movie / one-player / four-player).
A clean movie-only rerun without concurrent builds completes 4,201 game frames with decoded
captures and reports 22.4 ms of silence, three underruns and 1,712 dropped audio frames. This is
additional device evidence, not proof of the cause of the initial underruns. Deterministic sound
records match. Full campaign acceptance, flawless device audio and console visual parity remain
unclaimed.
+92
View File
@@ -0,0 +1,92 @@
# Native suspension and tire-height transforms
Two hot vehicle calls of forward helper `1da298` now use the existing native XYZ
calculation. The forward allowlist grows from 66 to 68; inverse coverage stays at
82. BozoEngine remains pinned to `4a8f70a`.
| Return PC | Owner | Actual consumer |
| --- | --- | --- |
| `1888e8` | `suspCreateSuspensionMat` (`188738`) | Transformed Z contributes to suspension ride height at vehicle + `55c` |
| `18b4c0` | `tireUpdateCarHeight` (`18b420`) | Pivot reconstruction, vehicle position and coordinate-system publication, then height smoothing/clamp |
The native transform snapshots its operands, writes XYZ and preserves destination
W. It leaves VU registers, accumulator, flags and data memory untouched. Historical
hosts and unknown callers retain the original complete ABI. Suspension angle/RPH
matrix generation, tire pivot selection, scalar vector consumers, smoothing and
physics remain compiled game code; this increment replaces their transform leaves.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/suspension-tire`, compared with main
`9156063` (PR #35). Generated code, retail assets and runtime captures stay outside Git.
- Both new consumer tails run through their actual generated return. Suspension
consumes only output Z; tire-height consumes XYZ through real subtract/add/copy
routines, including the coordinate-system position and height update. Their
output W words are unused by these consumers. Meaningful coordinate-system W
remains unchanged and is compared.
- Added coverage is 1,024 sequences / 48 whole-memory comparisons, including 256
complete tire-height entry calls / 16 whole-memory comparisons. These execute
actual pivot selection, lowest-tire selection, input construction, transform and
complete scalar tail. The remaining new cases enter at the transform boundary.
Suspension angle/matrix production is outside the generated-consumer fixture.
- Four host FP modes, RAM aliases, arbitrary W payloads, signed zero/subnormal and
integer-adjacent suspension inputs, four tire selections, and values immediately
around the -3 height clamp are covered. CPU outside retired VU, outgoing host FP
effects, clocks/checkpoints and consumer memory agree. Native VU stays untouched.
Original forward W is normalized only after the complete real consumer has run.
- Aggregate consumer coverage is 61,952 sequences / 1,952 whole-memory comparisons.
Historical forward coverage is 3,776 / 236; inverse coverage stays at 5,248 / 82.
The hierarchy suite retains 786,432 helper cases / 384 whole-memory, 8,000 geometric
edges, 1,024 complete recursive BSP callers / 32 whole-memory and 2,048 unknown ABI
cases. The math suite retains 1,048,576 / 512 and 2,048 unknown ABI cases.
- Player, headless, historical checker and all native test targets rebuild. All
eleven native suites and twelve Python tooling tests pass.
## Gameplay, loading and movies
Default and strict runs complete 9,500 one-player and 8,500 actual four-player
frames. All non-RAM frame fields match the preceding main: scratchpad, calls/counts,
draws/counts, sound/sample counts, threads and EE clock. One-player RAM hashes match
at every frame. Four-player has one RAM-hash difference, at recording frame 4702.
Full 32 MB snapshots at one-player frame 7000 and four-player frame 6000 are exact.
Strict contact, hierarchy, math and projection checks pass; their recordings and
snapshots are byte-identical to default. Default performs zero original comparisons
and zero VU0 microprogram calls; strict intentionally runs original oracles.
A focused paired replay localizes the transient difference to one stack word,
`8ff2ec`: tire-height transform output `SP+1c`. The original writes inherited
`VF16.w` (zero); native retains destination bits `0000000c`. Eight paired writes
across two logical frames identify return `18b4c0` as the writer, at matching EE
cycles. The generated tail's subtract/add/copy consumers read only XYZ. Paired
observer recordings reproduce the qualified baseline/native prefixes exactly,
and observer snapshots reproduce the corresponding one-word-difference snapshots.
The snapshot uses graphics frame 4703; the differing recording index is 4702.
This is a bounded unused-W difference, not raw-RAM identity or console parity.
No production mask or VU-state reconstruction is introduced. Observer sources are
restored, original math/hierarchy object hashes verified and clean binaries rebuilt.
All eleven suites and both complete default/strict routes pass again after restoration;
the player, headless and checker binaries contain no observer markers.
The two new native returns execute 61,829 times in one-player and 30,384 times in
four-player. Total native forward counts are 1,060,013 / 260,479. These are reached
call counts, not a measured speedup.
Fresh windowed routes complete 4,200 movie/menu frames and 6,500 frames each for
one-player and actual four-player, through clean exit with isolated scratch user
data. Reviewed captures show decoded movie pictures (frame 1000), Junkyard loading
(one-player 4500), active combat (one-player 6300), and four advancing snow-arena
views (four-player 5500/6300). All three stereo 48 kHz WAV recordings contain audio.
Device logs report 26.1 / 64.2 / 36.6 ms of silence (movie / one-player / four-player),
with underruns and dropped frames. Deterministic gameplay sound matches; flawless
device audio, subjective listening and full campaign/console parity are not claimed.
## Remaining scope
The two helper inventories now contain 68 native forward and 82 native inverse
sites. Outside those allowlists remain 201 forward and 52 inverse sites: 253 across
the game, including sites inside otherwise replaced functions. This is a structural
source inventory, not a live cost measurement, and excludes other helper families
and inline VU operations. The previously closed narrow hierarchy/terrain direct-call
inventory remains closed. Other helpers, particle/camera callers, full campaign
acceptance and console visual parity remain separate work.
+89
View File
@@ -0,0 +1,89 @@
# Native inline terrain and contact calculations
The subsequent [sphere/LOD increment](NATIVE_SPHERE_LOD.md) extends this handler to thirty blocks
and replaces six additional collision hierarchy helper returns.
The player now calculates all 27 inline vector blocks in these four collision owners from native
matrix/vector records. There are no VU register loads, arithmetic, accumulator/flag updates or
register stores on these block paths. The 150 retired instruction sites include 48 arithmetic VU
operations. Other code in these functions remains compiled, including branches, allocation/result
bookkeeping, scalar query consumers and calls to separately implemented helpers.
| Owner | Blocks | Calculations |
| --- | ---: | --- |
| `hdColNode` (`1cb0d8`) | 8 | Two basis products and six point/offset sums |
| `hdColNodeCheckPt` (`1cb690`) | 8 | Two basis products, five sums and one difference |
| `hdRayTest` (`1cbd00`) | 8 | Two basis products, five differences and one sum |
| `hdTerrain` (`1cc7a0`) | 3 | Basis products with translation for terrain query points |
`tmb_contact_math.h` names each input/output record boundary. The last instruction of each block
reads its current records, snapshots aliased inputs, calculates separately rounded XYZ and writes
only those twelve bytes. An earlier block can change a later block's inputs; no result or register
image is cached across blocks, branches or scheduler continuations. Destination W remains its
existing payload. The complete CPU/VU context and host FP control state are unchanged by a block.
The historical checker still executes the original instructions. `TMB_NATIVE_CONTACT_CHECK=1`
compares native XYZ against independent original blocks extracted from fresh generated output;
those diagnostics and game instruction bodies stay in the build tree.
BozoEngine remains at the qualified `4a8f70a`. This does not remove the remaining sphere/LOD inline
math, unaudited inverse/helper entries, scalar collision algorithms or all VU emulation globally.
## Numerical and continuation validation
The local evidence directory is `D:/BozoScratch/terrain-contacts`; final expanded runs use the
`final27-` prefix. The baseline is main `75b6b35` (PR #23). Earlier unprefixed files record the
initial nineteen-block increment, before the downstream ray-result builder was included.
- `tmb-native-contact-tests` passes 884,736 comparisons against actual generated instruction blocks
and 864 complete flat-memory checks. Cases include arbitrary/extreme number bits, signed zero,
denormals, four host FP modes, denormal controls, record overlap, RAM aliases, low address bits
and scratchpad. Native CPU/VU state, complete host MXCSR and destination W must remain untouched.
- Another 1,024 ordered alias cases overwrite a later point input or basis column before its
calculation. Each reference block adopts the same explicit destination-W contract.
- 3,584 generated continuation cases and 112 full-memory checks execute seven scalar boundaries:
terrain point setup through zero-buffer dispatch, terrain point pairs through quick-height query
dispatch, node/point contact setup through the next inverse query, ray setup through normalization
dispatch, and the complete ray-contact result-building tail through metadata writes and epilogue.
CPU, clocks/checkpoints, complete outgoing FP effects and other memory match outside retired VU
and destination-W effects. Native VU state stays unchanged through each tested continuation.
These are bounded segments, not complete end-to-end collision-algorithm replacements.
- Player, headless and historical checker build. All eleven native suites and twelve Python
release-tool tests pass. Generated instruction fixtures and test inputs require the local game
ELF; they are not committed or run by the game-free GitHub CI jobs.
## Gameplay and RAM boundary
Default and strict one-player runs complete 9,500 frames; actual four-player runs complete 8,500.
Every non-RAM frame-record field matches the baseline throughout both routes: scratchpad, library
calls and counts, draws and counts, sound and sample counts, thread state and EE clock. Default
runs perform no original comparisons and no VU0 microprogram calls. Strict contact, math, hierarchy
and projection comparisons pass, reproducing both default recording files byte-for-byte.
The native blocks execute 609,504 times in one-player and 254,389 times in four-player. All 27 run
in one-player; four-player exercises 26 (the alternate point sum ending `1cb904` is absent).
These are execution counts, not a timing or FPS measurement.
Raw RAM hashes differ on 3,907 one-player frames (starting at 5593) and 3,798 four-player frames
(starting at 4702). Complete 32 MB snapshots at one-player frame 7000 and four-player frame 6000
differ by 72 bytes in 35 words / 15 bytes in six words, respectively. Every differing word is a
fourth vector component:
- One-player has 27 contact-position W words in the vehicle `b10` result arrays and one cached
contact-position W at Vehicle+`1e8c`. Those change from inherited 60.0 to zero. The cache copy
is the retained scalar Z/W load/store at `189f98`/`189f9c`; it copies the preceding contact record.
- Four query-vector W words at `5253bc`/`5253cc`/`5253dc`/`5253ec` and three stack-vector W words
account for the remaining one-player differences. Four-player differs in `5253ec` and five
stack-vector W words. Existing destination payloads survive where the old block stored VU residue.
- The terrain-to-contact copy chain documented in [the inverse increment](NATIVE_BSP_INVERSES.md)
remains compiled. Native terrain XYZ calculations stop injecting the inherited VF16.W into that
chain. The prior generated body-result XYZ consumer test still passes with arbitrary input W.
The snapshot classification is bounded evidence, not a claim that every raw RAM byte is identical
or that every possible campaign consumer has been exercised. No new memory-hash mask, padding
restoration, shadow VU state or generated-code instrumentation is used for this change.
Window qualification covers 4,201 movie/menu frames and 6,501 frames each for one-player and
four-player. Reviewed captures show decoded movie pictures, level loading, rainy combat and four
advancing snow-arena views. Device logs report 23.8 / 60.6 / 35.8 ms of silence (movie / one-player /
four-player), with dropped frames and underruns; deterministic sound records match.
Full-campaign acceptance, flawless device audio and console visual parity remain unclaimed.
+90
View File
@@ -0,0 +1,90 @@
# Native terrain debug, edit and wave transforms
Eight more inverse-helper returns use native record calculations, extending the
[car/particle increment](NATIVE_CAR_PARTICLE_HELPERS.md). The inverse allowlist grows from
74 to 82; the forward list stays at 66. BozoEngine remains pinned to `4a8f70a`.
| Return PCs of inverse helper `1da1e8` | Owner |
|---|---|
| `1f5414`, `1f5458` | Terrain grid-space debug line `1f53e0` |
| `1f54f4`, `1f5538` | Terrain grid-space two-colour line `1f54b8` |
| `1f55d4`, `1f5618` | Terrain grid-space debug box `1f55a0` |
| `1f56a8` | Terrain modification coordinates `1f5678` |
| `1f5904` | Terrain wave coordinates `1f5898` |
The existing native inverse snapshots operands before overlapping writes, preserves exact
output XYZW (including meaningful basis[0].W), and leaves VU registers, accumulator, flags
and data memory untouched. Historical hosts and unknown callers retain the complete original
ABI. Scalar translation, debug records, grid indexing, input polling, wave metadata/type
dispatch and game checkpoints remain compiled game code.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/hierarchy-terrain-final`, against main `199d9a6` (PR #34).
Generated game code, retail assets, recordings, snapshots and captures are excluded from Git.
- Consumer coverage grows from 56,832 to 60,928 sequences and from 1,776 to 1,904 whole-memory
comparisons: 4,096 / 128 added. Four host rounding modes, denormal controls, RAM aliases
and arbitrary meaningful W payloads remain covered. CPU outside retired VU, outgoing host
FP effects, clocks/checkpoints and memory match exactly; native VU stays untouched.
- Paired debug endpoints run both inverse transforms and scalar world sums through the real
line or two-colour vertex builder and actual `drawLines` dispatch. The box also runs real
corner construction and its first line producer to the same dispatch. Complete colour RGBA
and vertex XYZW are compared; rendering and subsequent box edges remain outside the fixture.
- The compared debug region expands to `7484f0`–`74870f`, covering the actual two-colour line
records. The actual input-map word `66fcc4` is also initialized/restored/compared. The fixture
uses a common region table; all older consumers rerun with the expanded memory checks.
- Terrain editing runs to return: translated XYZ, actual integer conversion/row-stride cell
lookup, protected-cell branch, and real `inputGetInput` disabled-device branches. Both
protected and unprotected cells are covered on a 9x9 grid, with coordinates around integer
boundaries, zero and a subnormal. Button-driven height changes remain outside this fixture.
- Wave inputs use the actual six-entry type table: types 0/1/4/5 run scalar translation and
the real rounded bounds/extent metadata to timer dispatch; type 2 reaches undulate dispatch,
and type 3 reaches the random-number dispatch before shock-wave work. Four wave slots,
radii 0/0.25/0.5/1/9.5/10.5, signed integer-adjacent coordinates and general bases are covered.
Timer input, special-wave effects and later height-cache population are outside the fixture.
- Historical inverse coverage grows from 4,736 / 74 to 5,248 / 82 cases / whole-memory checks.
Forward coverage stays at 3,648 / 228. The hierarchy suite retains 786,432 helper cases / 384
whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP callers / 32 whole-memory
and 2,048 unknown-caller ABI cases. The math suite retains 1,048,576 cases / 512 whole-memory
and 2,048 unknown-caller ABI cases.
- Player, headless, historical-checker and every native test target rebuild successfully;
all eleven native suites and twelve Python tooling tests pass.
## Gameplay, loading and movies
Default and strict runs complete 9,500 one-player and 8,500 actual four-player frames.
Each complete default recording is byte-identical to the preceding main, including RAM,
scratchpad, library calls/counts, draws/counts, sound/sample counts, threads and EE clock.
Full 32 MB snapshots at one-player frame 7000 and four-player frame 6000 are exact too.
Strict contact, hierarchy, math and projection checks pass; their recordings and snapshots
are byte-identical to default. Default runs perform zero original comparisons and zero VU0
microprogram calls; strict diagnostic runs intentionally execute original oracles.
All eight new inverse counters remain zero in both default and strict routes. These sites
have generated-consumer, numerical and historical-ABI coverage without live-route reach.
This increment does not claim retired gameplay executions or a measured speedup.
Fresh windowed runs complete the configured 4,200-frame movie/menu route and 6,500-frame
one-player and actual four-player routes through clean exit, using isolated scratch user data.
Reviewed captures show decoded movie pictures, Junkyard loading, active one-player gameplay
and four advancing snow-arena views. Device logs report 17.7 / 42.4 / 76.2 ms of silence
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound
remains exact; flawless device audio, full campaign and console visual parity remain unclaimed.
## Remaining scope
A structural scan of the two helpers now counts 66 native forward and 82 native inverse
sites. Outside their allowlists remain 203 forward and 52 inverse sites, 255 in total across
the game, including code inside otherwise replaced functions. This is a source inventory,
not a live cost measurement, and excludes other helper families and inline VU operations.
Within the narrow hierarchy/collision owner range `1c0000`–`1dffff` and terrain range
`1ef000`–`1f5fff`, every direct call to these two transform helpers is now native. Other
helpers, inline VU, full campaign acceptance and console visual parity remain separate work.
The qualified routes still execute 193,096 / 151,213 original forward calls outside those
ranges in one-player / four-player. Active candidates include suspension return `1888e8`,
tire-height return `18b4c0`, particle emission `1e4818`, and camera returns `113f28` / `1142d8` /
`114394`. Their W/state consumers require separate audits before native routing. These are
reach counts, not timing measurements; local caller/owner evidence is in `remaining-forward-reach.json`.
+102
View File
@@ -0,0 +1,102 @@
# Native terrain bounds and query-input transforms
Eleven further inverse-helper returns use the existing native record calculation. The inverse
allowlist grows from fifty-three to sixty-four entries; the forward list stays at fifty-two.
This extends the [point/ray increment](NATIVE_POINT_RAY_HELPERS.md). BozoEngine stays at
`4a8f70a`; no engine or renderer change is included.
| Return PCs of inverse helper `1da1e8` | Owner |
|---|---|
| `1ef318` | Terrain animated-node setup `1ef090` |
| `1ef44c`, `1ef484`, `1ef4c0`, `1ef4fc` | Terrain-node corner bounds `1ef3c0` |
| `1ef68c`, `1ef6d4` | Terrain-node height extrema `1ef3c0` |
| `1efc5c`, `1efca0` | Terrain height-query endpoints `1efb98` |
| `1efef8` | Quick height-query coordinates `1efe10` |
| `1f06b4` | Material-query coordinates `1f0550` |
Native leaves snapshot operands before overlapping writes, retain separately rounded XYZ
arithmetic and leave VU registers, accumulator, flags and data memory untouched. All output
XYZW matches the original, including meaningful basis[0].W. Historical hosts and unknown
callers retain the complete original helper ABI. Scalar height scans, bounds publication,
integer grid math, traversal/query dispatch, clocks and checkpoints remain compiled game code.
Other helper returns and inline VU operations remain; this is not complete VU removal.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/hierarchy-terrain-inputs`, against main `279e3a1` (PR #31).
Generated game code, disc data, recordings, RAM dumps and captures are excluded from the commit.
- The consumer harness grows from 38,912 to 44,544 sequences and from 1,216 to 1,392 whole-memory
comparisons (5,632 / 176 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
other memory match exactly; native VU remains untouched.
- Terrain-node continuations run through return: corner transformation/addition, scalar XY
minima/maxima, actual unsigned-height scan, transformed height extrema, per-node table writes
and aggregate bounds. Width/height 0, 1, 2 and 3, first/subsequent node publication and heights
0, `561e`, `561f`, `ffff` exercise empty grids and the original minimum-height sentinel.
- The compared fixture region now starts at `4c0000` rather than `4d0000`, retaining the same
upper bound and explicitly covering the terrain bounds table at `4ce290`. All older consumer
cases rerun with this expanded memory comparison; complete flat-memory checks remain too.
- Animated-node continuations run packed material/state publication and either return or stop
at the actual child-push boundary. Height endpoints retain real context translation, paired
transforms and integer-cell arguments before the terrain-cell query dispatch.
- Quick-height/material continuations retain context translation, valid-grid bounds checks and
integer coordinate conversion through the real row-stride multiplication dispatch. Identity
bases and stored values adjacent to integer 1 and 7, zero and a positive subnormal are covered.
Complete terrain-cell/interpolation queries remain outside those bounded fixtures.
- Historical inverse checks cover all sixty-four returns: 4,096 cases / 64 whole-memory checks.
Historical forward checks remain 2,752 / 172. The hierarchy suite retains 786,432 helper cases,
384 whole-memory checks, 8,000 geometric edges, 1,024 recursive BSP callers / 32 whole-memory
checks and 2,048 unknown-caller ABI cases.
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
- Player, headless and historical checker builds, all eleven native suites and twelve Python
tooling tests pass.
## Gameplay, loading and movies
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Strict
contact, hierarchy, math and projection checks pass; strict/default recordings and snapshots
are byte-identical. Every non-RAM frame-record field matches baseline throughout: scratchpad,
calls/counts, draws/counts, sound/sample counts, thread state and EE clock. Default runs perform
zero original comparisons and zero VU0 microprogram calls.
The six terrain-node returns execute once each in both routes. Material-query return `1f06b4`
executes 500,428 / 250,178 times in one-player / four-player, retiring 500,434 / 250,184 helper
executions in total. Animated-node, paired height-query and quick-height returns have generated-
consumer/historical coverage without live-route coverage. These are counts, not timing or FPS
measurements.
RAM hashes differ on 3,906 one-player frames (5593–9499) and 3,797 four-player frames
(4703–8499). The complete 32 MB snapshots at one-player frame 7000 and four-player frame 6000
differ by four and nine bytes respectively, in two and three fourth-component words.
- One-player `4a26dc`: the original forward at BurnMan spawn return `112524` stores inherited
VF16.W, baseline `42700000` versus native zero. Its following scalar vector addition consumes
XYZ. This forward remains outside the native allowlist and retains its complete original ABI.
- One-player `40a85c`: `AmbientSoundManager::requestScream` copies that same position from
`4a26d0` into its position record with two 64-bit stores. A direct copy observer confirms the
changed high word at destination `40a85c` at identical cycle 35028251672 in both runs.
- Four-player `3a7d9c`, `3a7dac`, `3a7dbc`: the original camera forward at return `113f28`
stores inherited VF16.W, baseline `42b20000` versus native `c51bc000`. All 11,391 watched calls
pair at identical cycles, 3,797 for each field. The following scalar vector sums consume XYZ.
This forward also retains the original complete ABI.
Retiring the inverse's VU clobbers changes the register payload later original forwards inherit;
the new inverses' actual output XYZW remains exact. All observer recordings and snapshots
reproduce their qualified baseline/native files byte-for-byte in both routes, including a
separate one-player sound-position copy trace. This is bounded source/write/snapshot evidence,
not a classification of every RAM difference or possible campaign consumer.
Observers were removed and restored sources forced to rebuild. The native math, hierarchy and
generated objects match their original qualified hashes; all three executables contain no
observer markers. All eleven native suites pass again. Final clean default replays reproduce
both complete qualified recordings and snapshots byte-for-byte. No padding restoration, hash
mask or shadow VU state is shipped.
Fresh windows complete the configured 4,200-frame movie/menu route and 6,500-frame one-player
and actual four-player routes through clean exit. Reviewed captures show decoded movie pictures,
Junkyard loading and active rainy gameplay, and four advancing snow-arena views. Device logs
report 22.2 / 51.2 / 30.1 ms of silence (movie / one-player / four-player), with underruns and
dropped frames. Deterministic sound matches. Flawless device audio, full campaign acceptance
and console visual parity remain unclaimed.
+115
View File
@@ -0,0 +1,115 @@
# Native terrain LOS, cell and ray transforms
Ten further inverse-helper returns use native record calculations, extending the
[terrain-input increment](NATIVE_TERRAIN_INPUT_HELPERS.md). The inverse allowlist grows
from 64 to 74; the forward list stays at 52. BozoEngine remains at `4a8f70a`.
| Return PCs of inverse helper `1da1e8` | Owner |
|---|---|
| `1f11a8`, `1f11ec` | Terrain line-of-sight endpoint setup `1f10c0` |
| `1f1b88`, `1f1c38` | Terrain line-of-sight result reconstruction `1f10c0` |
| `1f2480`, `1f24c0` | Terrain cell BSP endpoint setup `1f2370` |
| `1f2e4c`, `1f2ef8` | Terrain cell result reconstruction `1f2370` |
| `1f3110`, `1f315c` | Terrain ray grid endpoints `1f30a0` |
The existing native inverse calculation preserves all output XYZW, including meaningful
basis[0].W, without VU register, accumulator, flag or data-memory state. Overlapping operands
are captured before writes. Historical hosts and unknown callers keep the complete original
helper ABI. Translation, grid walking, scalar intersection tests, normalization, metadata,
query dispatch and checkpoints remain compiled game code.
## Numerical and generated-consumer checks
Local evidence is under `D:/BozoScratch/hierarchy-terrain-los`, against main `c4afff2` (PR #32).
Generated code, retail assets, recordings, RAM dumps and captures are excluded from Git.
- The consumer harness grows from 44,544 to 49,664 sequences and from 1,392 to 1,552
whole-memory checks. Four host rounding modes, denormal controls, RAM aliases and W
payloads remain covered. CPU outside retired VU, outgoing host FP effects, clocks,
checkpoints and memory match; native VU is untouched.
- Paired LOS/ray endpoint tests retain both inverse transforms and real context translations
through segment-subtraction dispatch. They do not run the complete grid walk.
- Cell BSP inputs run both transforms, translation and actual segment record publication,
including the indexed BSP pointer lookup, through real BSP query dispatch.
- LOS result tails retain translated position copy, normal construction, actual normalization,
normal copy and distance publication through debug-normal draw dispatch.
- Cell result tails run to return, including translated position/meaningful W copy, normal
normalization, distance and packed result flags. Both result branches are exercised.
- Historical inverse coverage grows to 4,736 cases / 74 whole-memory checks. Forward coverage
stays at 2,752 / 172. The hierarchy suite retains 786,432 helper cases / 384 whole-memory,
8,000 geometric edges, 1,024 complete recursive BSP callers / 32 whole-memory and 2,048
unknown-caller ABI cases. The math suite retains 1,048,576 helper cases / 512 whole-memory
and 2,048 unknown-caller ABI cases.
- Player, headless and historical-checker builds, all eleven native suites and twelve Python
tooling tests pass. All eleven native suites pass again after removing local observers.
## Gameplay, loading and movies
Default and strict runs complete 9,500 one-player and 8,500 actual four-player frames.
Strict contact, hierarchy, math and projection comparisons pass; strict/default recordings
and snapshots are byte-identical. All non-RAM frame fields match the preceding main throughout:
scratchpad, library calls/hash/counts, draws/hash/counts, sound/hash/sample counts, threads and
EE clock. Default runs make zero original comparisons and zero VU0 microprogram calls.
| New return | One-player executions | Four-player executions |
|---|---:|---:|
| `1f2480`, `1f24c0` | 3,319 each | 435,307 each |
| `1f2e4c` | 931 | 0 |
| `1f2ef8` | 828 | 0 |
| `1f3110`, `1f315c` | 192,000 each | 140,024 each |
| **Total** | **392,397** | **1,150,662** |
The four LOS returns have generated-consumer and historical coverage without live reach in
these routes. These are helper execution counts, not a measured speedup.
RAM hashes differ on 3,769 one-player frames (5731–9499) and 3,797 four-player frames
(4703–8499). Full 32 MB snapshots at frames 7000 / 6000 differ by 62 / 9 bytes in 31 / 3
fourth-component words. Paired temporary observers identify the original helpers writing them:
- One-player `26bb7c`: peeling-out forward return `1abd60`, output at Vehicle+`520`.
Its inherited VF16.W is `c4f00000` in the sampled baseline versus zero natively. The
audited later vehicle-coordinate sum consumes XYZ via the already-native vehicle block.
- One-player `4062ec`–`40640c` and `406e0c`–`406e9c`, stride 16: debris velocity vectors
written by the original `BlowDebris` forwards `120838` / `1209a0`. Sampled W is `42700000`
or `c4f00000` versus zero. `Debris::Update` reads velocity XYZ at offsets `120`/`124`/`128`
for scalar integration; its fourth component is not part of those calculations.
- One-player `8fefdc`: shared stack temporary, last written by original debris forward
`1208dc`; sampled W is `42700000` versus zero. Immediate position reconstruction reads
XYZ. The same address also receives native ray inverse output earlier, whose W agrees.
- Four-player `3a7d9c`, `3a7dac`, `3a7dbc`: original camera forward return `113f28`.
All 11,391 watched writes pair at identical cycles, 3,797 per field, with inherited W
`c51bc000` versus zero; following scalar vector additions consume XYZ.
The one-player traces pair all 92 watched calls at identical cycles, with 57 differing W
writes: six peeling-out, 34 / seven debris-velocity and ten debris-temporary writes. Every one
of the 31 differing snapshot words equals its last watched helper write before the snapshot
in both runs. All four observer recordings and snapshots reproduce the corresponding qualified
baseline/native files byte-for-byte. Those original forwards remain outside the allowlist and
retain their complete ABI. Retiring inverse VU clobbers changes the payload they later inherit;
the newly native inverses' output XYZW is exact.
This is bounded writer/consumer/snapshot evidence, not a classification of all RAM differences
or all possible campaign consumers. No W restoration, memory-hash mask or shadow VU is added.
Observers were removed; original qualified math/hierarchy object hashes were restored and the
player, headless and checker executables contain no observer markers. Fresh observer-free
default replays reproduce both complete qualified recordings and snapshots byte-for-byte.
Fresh windowed runs complete the configured 4,200-frame movie/menu route and 6,500-frame
one-player and actual four-player routes through clean exit, using isolated scratch user data.
Reviewed captures show decoded movie pictures, Junkyard loading, active one-player gameplay
and four advancing snow-arena views. Device logs report 20.8 / 37.9 / 38.6 ms of silence
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound is
exact; flawless device audio, full campaign acceptance and console visual parity remain unclaimed.
## Remaining scope
A structural scan of direct generated call sites before this increment counted 269 forward
and 134 inverse sites for these two helpers, of which 52 / 64 were native. This increment
leaves 217 / 60 sites outside their allowlists, 277 in total. This is a source inventory,
including paths inside otherwise replaced functions, not a live cost or speedup measurement.
It excludes other helper families and inline VU operations.
Within owners in the hierarchy/collision range `1c0000`–`1dffff` and terrain range
`1ef000`–`1f5fff`, 22 sites remain: twelve older `hdCarTest` forward returns, two
`hierParticleNode` forward returns, six debug terrain drawing inverses, and the terrain
modify/wave setup inverses. This is not complete VU removal or campaign/console parity.
+81
View File
@@ -0,0 +1,81 @@
# Native texture consumer inputs
The subsequent [native upload-link increment](NATIVE_TEXTURE_UPLOADS.md) replaces the separate upload
leaf at its audited callers. The evidence below records the earlier texture-input increment.
The traversal's texture activation path now reads its parameters directly from the source object.
This removes the last three `pktAddVu1ObjAsm` payload stores (`1eabd0`, `1eabd4`, `1eabd8`) that the
[previous increment](NATIVE_OBJECT_PACKETS.md) retained. The complete per-object builder now emits no
output packet bytes in the native player. Its scalar source-copy loops, context results and cursor/cache
bookkeeping remain. BozoEngine stays at `4a8f70a`; the earlier player release is unchanged.
## Producer and consumer boundary
Both assembly traversals enqueue an object and a cursor for its old texture copy. Their four audited
texture-helper returns are `1d330c`, `1d3340`, `1d2d84` and `1d2db8`. At those returns, the native input
handler resolves the object and texture index from the game's actual queue and saved helper frame.
The source qword alignment matches the original builder's aligned loads.
Four reads in `texmGetTextureAddrs`/`texmActivateTexture` use the original base/filter/flag fields directly.
Six writes that only patched the retired copy or its mip table are skipped. The filtering read and
zero-texture patch are branch delay-slot sites `1f9130` and `1f9158`; the native guards run at those
instructions, preserving their enclosing branches. Unknown callers, the C builder's `1d3afc` return,
and the historical checker retain the original complete behavior.
The input handler has no binding, cached parameter image, packet-address map or register shadow.
Activation and mip helpers validate their own saved return before resolving the enclosing texture
helper's frame. Consequently, the handler can run from a suspended/resumed context without relying
on an earlier native function invocation or a live C++ local. Each read uses the owning runtime's memory.
The game's allocation, eviction, resident flags, last-used counters, loaded-texture updates and upload
cursor still execute in the original statically compiled helper chain, with unchanged checkpoints.
`pktAddVu1Tex` still builds its separate upload link. Those scalar helpers and that separate builder are
remaining work; this increment removes the per-object copy/read/patch transport, not the texture manager.
The native renderer continues to use its existing texture pack and material records.
## Validation
Evidence: `D:/BozoScratch/texture-inputs`, against main `3fd4257`, using the same USA disc, engine and
input scripts. All game runs have private user folders. These are functional checks, without a
performance or full-campaign claim.
- The new `tmb-native-texture-input-tests` executes the actual generated consumer, activation,
allocator, eviction, last-used, mip and upload-tag helpers. 8,192 cases pass across four host FP modes,
all four returns, object word alignments, texture formats, zero IDs, resident/new/evicted textures,
zero through seven mip levels and filtering switches. Complete CPU/context/host control, stack,
source data, texture-manager state and cursors match outside the sole retired 48-byte texture output.
There are 32 complete flat-memory checks; all ten new instruction sites are reached.
- 268 cases use an inaccessible texture output pointer: the helper completes without a device access,
with identical manager/loaded-texture state and upload cursor. 136 fallback cases retain the original
caller/historical ABI. Another 320 reconstructed-context cases cover every site, return, object word
alignment and two independent runtime owners, without any prior producer or scoped binding.
- The existing object-builder suite now checks all 41 output stores plus three RGB reads, with the
complete output arena untouched. Its 8,192 cases, 32 full-memory checks and 1,158 inaccessible-output
cases pass, including textured cases previously excluded by the retained producer.
- All nine native suites and 12 release-tool tests pass; player, headless and historical checker build.
- Default 1P (9,500 frames) and actual 4P (8,500) match main on every non-RAM field: scratchpad, draws
and counts, sound and samples, calls, threads and EE clocks. Default VU0 program counts remain zero.
Strict/default recordings are byte-identical. No hash mask is widened. RAM hashes differ on
9,496 / 8,496 frames.
- The two default routes perform 526,557 / 484,986 direct texture reads and skip 398,778 / 273,524
obsolete texture patches. Total per-object stores retired are 34,979,313 / 49,034,910; the three
newly retired copy stores account for 4,887,132 / 7,651,320 of those.
Full 32 MB snapshots at 1P frame 7,000 and 4P frame 6,000 isolate every differing byte to these buffers,
with zero differences elsewhere:
| Half-open interval | 1P differing bytes | 4P differing bytes |
| --- | ---: | ---: |
| `564a80..5eca80` (`hierObjPkt`) | 689 | 613 |
| `5eca80..630a80` (`hierObjPkt2`) | 29,303 | 15,482 |
| `630a80..64ea80` (`hierAlphaPkt`) | 7,467 | 2,116 |
| `64ea80..66ca80` (`hierAlphaPkt2`) | 5,750 | 2,756 |
This snapshot boundary does not prove all possible campaign paths. Other packet builders/alpha links,
legacy extents, game texture-manager bookkeeping and unconverted VU macro helper callers remain.
Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) finish through loading into active arenas.
Direct captures show decoded movie action, readable loading, textured vehicles/rain/HUD in the 1P arena
and four snowy views with distinct vehicles, effects and targeting. These are visual smoke checks,
not console/pixel parity. Device logs retain dropped frames and 22.0 / 67.3 / 24.0 ms of inserted silence
in movie/1P/4P. Exact deterministic sound is not flawless-device-audio or subjective listening acceptance.
+60
View File
@@ -0,0 +1,60 @@
# Native texture upload-link completion
`pktAddVu1Tex` (`1ea5c8`) now uses a native leaf at its two audited activation/mip returns, `1f947c`
and `1f977c`. Texture content is already supplied by the native pack/material path. The native leaf
advances control `+8` by 16 bytes and preserves the original CPU caller results; it reads no upload
descriptor and emits or dispatches no hardware tag. Its three former output stores are gone from
this native path. No graphics register bank, transfer queue or synthetic interrupt is added.
The original leaf has no checkpoints. Its complete context ABI is retained: low 64-bit results in
registers 2/3/5/6/7, the original full-register clear of register 3, return PC, and untouched CPU/FPU/VU
state, clocks and checkpoint count. Native completion preserves the game's legacy extent metadata;
it is not a GPU fence or a new rendering operation.
Unknown callers and the historical checker execute the original complete leaf. Deliberate overlap
between the output writes and the 20-byte control record also retains the original behavior, because
the old writes can change subsequent cursor loads. The guard compares physical flat-memory spans,
including RAM aliases. Ordinary disjoint records need no mapped output pointer.
## Validation
Evidence: `D:/BozoScratch/texture-uploads`, against main `6341d9b`, with the same USA disc, engine and
input scripts. All game runs use private user directories. BozoEngine stays at `4a8f70a`; the earlier
player release is unchanged. These are functional checks, with no performance claim.
- The expanded texture-input suite checks 4,096 original/native leaf cases in four FP modes, five
RAM views, scratchpad, word-aligned controls/cursors and arbitrary descriptor arguments.
Complete CPU/FPU/VU/context, host FP control, clocks/checkpoints, cursor and other memory match, with
the native output arena untouched. There are 32 complete flat-memory checks.
- 128 inaccessible-output cases complete with exact pointer-relative CPU results and no device
access. 128 unknown/historical cases retain the original output/context behavior. Another 16 cases
compare complete flat memory and context for overlapping control/output records through RAM aliases.
- The actual consumer/activation/allocator/mip chain still passes 8,192 cases, 32 full-memory checks,
268 inaccessible texture-output cases, 136 input fallback cases and 320 reconstructed-context/owner
cases. Its only memory exclusions are the explicitly retired 48-byte object texture output and
the exact number of 16-byte upload links formerly appended at the upload cursor.
- All nine native suites and 12 release-tool tests pass; player, headless and historical checker build.
- Complete 1P (9,500 frames) and actual 4P (8,500) recordings match main on every non-RAM field:
scratchpad, draws/counts, sound/samples, library calls, threads and EE clocks. Separate strict/default
recordings are byte-identical. Default VU0 program counts remain zero. No hash mask is widened.
- The two routes execute 36 / 13 native upload leaves, retiring 108 / 39 tag stores. This is a small
execution count, not evidence of a meaningful performance improvement.
RAM hashes differ on 1P frames `5593..9499` (3,907 frames), and on seven 4P frames: `4704`, `4731`,
`4793..4795`, `5747`, `5865`. The checked 32 MB snapshots isolate ten differing bytes in `hierAlphaPkt`
at 1P frame 7,000, five in that same buffer at 4P frame 4,794, and zero differences at 4P frame 6,000.
There are no differing bytes outside that packet buffer in these snapshots. Old untouched tag bytes
are not cleared or restored artificially. The snapshots are bounded evidence, not a campaign-wide proof.
Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) finish through loading into active arenas.
Direct captures show movie action, readable loading, rainy combat with targeting/health/HUD/fire/effects,
and four snowy views with distinct vehicles. These are visual smoke checks, not console/pixel parity.
Device logs retain dropped frames and 29.2 / 54.9 / 25.1 ms of inserted silence in movie/1P/4P; exact
deterministic sound does not imply flawless device audio or subjective listening acceptance.
## Remaining scope
Game texture allocation/eviction/last-used bookkeeping, per-object source-copy loops and legacy
extents remain. Placeholder tags, alpha-link builders and other mixed packet helpers remain separate
work, along with unconverted VU macro helper callers. This increment replaces the audited upload-link
leaf rather than claiming complete packet/emulation removal or console visual parity.
+90
View File
@@ -0,0 +1,90 @@
# Native tire-pair correction forward transforms
[Combo-launch forwards](NATIVE_COMBO_FORWARD.md) follow with five vehicle combo sites.
Two vehicle-orientation forward returns use native XYZ arithmetic after the
[machine-gun muzzle forwards](NATIVE_MACHINE_GUN_FORWARD.md). Known forward coverage
grows from 167 to 169 of 269 returns (100 remain). Known inverse coverage stays 134
of 134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `18b10c` | `Vehicle::tireUpdateCarRotation` (`18adb8`) | The first axle's height correction `(0,0,-c)` (`c` at `+1e58`) through the vehicle basis at `+d0`, into frame `+50`, added to that tire pair's midpoint into frame `+70` |
| `18b19c` | The same | The second axle's correction (`c` at `+1e68`), added into frame `+80` |
`tireUpdateCarRotation` rebuilds a vehicle's orientation from its tires each frame.
For the 4- and 5-wheel layouts (`+1790`), each axle with a nonzero correction moves
its tire-pair midpoint along the vehicle's up direction. Instead, layout 6 scales
the up vector (`mathfScaleVector`) for the first axle and layout 3 for the second,
with no transform. Then it:
1. rebuilds the forward axis from the corrected midpoints (difference, average,
`mathfNormalize`);
2. rebuilds the side and up axes with `mathfCrossProduct`;
3. applies the per-layout tilt (`mathfRotMatrixRPH`) and `mathfMulMatrix` through
the vehicle's coordinate system.
Both transforms write frame `+50`. It is read only by `mathfAddVector`; on the other
paths `mathfScaleVector` and `mathfSetFVector` write only its X/Y/Z. Frame `+5c` is
never read. The corrected midpoints in frame `+70`/`+80` are read only by
`mathfSubVector`. The owner reads no VU registers, accumulator or flags. The
existing native helper computes separately rounded XYZ, preserves destination W
and leaves VU state untouched. Unknown and historical callers keep the original
ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/tire-rotation-forward`, against parent `027357a`
(PR #69). Parent headless/window binaries are preserved there and match PR #69's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
kinds 272 and 273): helper-boundary continuations and owner entries, across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary
W payloads.
- Owner entries start inside the owner at `18b088`, right after its up-vector
normalize, with the frame and saved registers as its prologue leaves them. This
is the same approach as the earlier boss fixture. The earlier part of the owner
contains no transform and is not run.
- From that point, each entry runs both axle blocks and the whole rebuild through
the real math helpers to the owner's real return.
- Scenarios cover both 4- and 5-wheel layouts, each axle on its own, layout 6
(scale only) and a 2-wheel layout (no corrections).
- The basis at `+d0` is fixture-known in every case, so every output is checked
against an independent identity or quarter-turn result.
- Both corrected midpoints are asserted exactly against the original FPU addition,
after the owner has finished. Cases where both run check both, in order. The
sites publish in 608 and 864 cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+5c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so one
data-dependent count in earlier fixtures moved (vehicle tire jumps 705 → 700).
All scenario-defined counts and assertions are unchanged.
- Aggregate caller coverage is 140,288 generated sequences / 6,752 whole-memory
comparisons. Historical forward ABI coverage is 10,240 / 640; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `027357a`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The first-axle return
`18b10c` is live: it runs natively 17 times on the one-player route with no
recorded difference. The second-axle return `18b19c` is cold on these routes and
is qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 63.2 ms of silence in one-player, 27.3 ms in four-player and 23.2 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Full campaign and physical controller/hardware acceptance remain open.
+95
View File
@@ -0,0 +1,95 @@
# Native tow-truck launcher transforms
Four transform returns in `UpdateTowTruck` (`150b60`) now use native record
calculations, extending the [shadow increment](NATIVE_SHADOWS.md). Forward
coverage grows from 76 to 79 sites and inverse coverage from 85 to 86.
BozoEngine remains pinned to `4a8f70a`.
| Return PC | Helper | Following consumers |
| --- | --- | --- |
| `150bc8` | Forward `1da298` | Base-position XYZ addition and publication |
| `150cc0` | Forward `1da298` | Offset addition and three-axis position smoothing |
| `150d2c` | Forward `1da298` | Vehicle-space conversion and attachment-position publication |
| `150d98` | Inverse `1da1e8` | Local-direction subtraction, normalization and orientation construction |
The existing native forward calculation snapshots operands, computes separately
rounded XYZ and retains destination W. The inverse snapshots its operands and
publishes the first basis vector's W as data. The shared forward temporary is
consumed as XYZ and then completely replaced by the real inverse. Native paths
leave VU registers, accumulator, flags and data memory untouched. Historical
hosts and unknown callers keep the complete original ABI. Launcher selection,
tilt/clamping, rotation construction, smoothing, normalization, material selection
and game checkpoints remain compiled game code.
## Generated consumers and numerical checks
Local evidence is under `D:/BozoScratch/tow-truck-transforms`, against main
`f1118f4` (PR #38). Generated game code, retail data, recordings and captures stay
outside Git.
- Added coverage is 2,048 complete generated consumer sequences / 128 whole-memory
comparisons. Aggregate coverage is 69,632 / 2,336. The tow-truck cases compare
all final memory, including stack W, without any forward-W exclusion: an
explicit assertion checks that the inverse has overwritten the shared temporary.
- Every new site runs through the complete scalar tail and return: vector
addition/subtraction, smoothing, normalized direction, orientation matrix,
attachment position, material-pointer selection and visibility-byte writes.
Zero-length and vertical directions exercise the actual normalization and
orientation fallback branches. Consumers and trigonometry run their actual
generated code. The visibility byte starts nonzero, making clearing and
retention observable, including the disabled early returns.
- 512 of those cases enter at the actual function entry: 256 complete
updates, 192 updates reusing the existing launcher position and 64 disabled
early returns. The complete updates include all four transform calls. Another
256 start at the real tilt/clamp and rotation producer; 256 start at the final
smoothed-Z producer. Rotation inputs stay within half a radian; wider argument
reduction is outside these consumer fixtures.
- Four host FP modes, denormal controls, RAM aliases and arbitrary opaque W
payloads are covered. CPU outside retired VU state, outgoing host FP effects,
clocks/checkpoints and memory agree. Native VU stays untouched through the
complete consumers. Inverse W is compared exactly as meaningful data.
- Historical forward coverage grows to 4,480 / 280 cases / whole-memory checks;
historical inverse coverage grows to 5,504 / 86. Existing hierarchy coverage
retains 786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024
complete recursive BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
- Player, headless runner, historical checker and all native test targets build.
All eleven native suites and twelve Python tooling tests pass. The hierarchy
suite passes again with the explicit no-W-exclusion assertion enabled.
## Gameplay, loading and movies
Default and strict-check builds complete 9,500 one-player frames and 8,500 actual
four-player frames. Every recorded frame field agrees with the shadow baseline,
including raw RAM, scratchpad, calls, draws, sound, threads, counts and EE clocks.
Both full 32 MiB snapshots also agree. Strict/default recording files and snapshots
are byte-identical. No observer, RAM mask or VU-state restoration is needed.
Each of the four new sites executes 3,596 times in one-player and 3,798 times in
four-player: 14,384 / 15,192 new native executions in total. Total native forward
calls become 1,138,018 / 295,330. Default routes make zero original-helper
comparisons and execute zero VU0 microprograms. These are coverage counts, not a
measured speedup.
Fresh 6,500-frame one-player and actual four-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, using isolated scratch
user data. Reviewed captures show decoded movie playback (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), active one-player gameplay with the
tow-truck launcher (5,500 / 6,300), and four advancing snow-arena views with
snow/tire effects and the attached tow-truck launcher (four-player 5,500 / 6,300).
Each new site runs 1,706 / 1,799 times in windowed one-player / four-player:
6,824 / 7,196 new native executions in total. These captures establish bounded
functional coverage, not pixel-exact windowed or console parity.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
21.0 / 54.5 / 8.0 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound matches the shadow baseline;
flawless device audio and subjective listening are not claimed. Production player,
headless and checker binaries contain no prior temporary observer markers.
## Remaining scope
These two helper inventories now contain 79 native forward and 86 native inverse
sites. Outside their allowlists remain 190 forward and 48 inverse sites, 238 in
total across the game. This is a structural source inventory, not a live cost
measurement, and excludes other helper families and inline VU operations. Full
campaign acceptance and console visual/audio parity remain separate work.
+78
View File
@@ -0,0 +1,78 @@
# Native UpdateLauncher forward transforms
[The HUD laser batch](NATIVE_HUD_LASER_FORWARD.md) follows with the laser sight's two points.
The three `Launcher::UpdateLauncher` forward returns use native XYZ arithmetic after
the [FireSpecial types c0/1e0/220 batch](NATIVE_FIRE_TORCH_FORWARD.md). Known forward
coverage grows from 255 to 258 of 269 returns (11 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
`Launcher::UpdateLauncher` (`147260`) has the launcher in `s1` and the vehicle in
`s3`:
| Return PC | Producer and consumer |
| --- | --- |
| `147a8c` | The aim offset in frame `+0` goes through the vehicle's coordinate system in place. `mathfAddVector` adds it to the vehicle position into the launcher's `+230`, which is height-tested (`hdHatTest`) and copied on with `mathfCopyVector` |
| `147cc8` | The current weapon's muzzle offset (`+3f0` indexed by the weapon number at `+0`) goes through the vehicle's system into frame `+0`, plus the vehicle position, into `+620`. Then `FireCurrentWeapon` fires |
| `147cf4` | For vehicle type `1c0`, that point first goes through the turret part's matrix (`+1ec8`, `+10`) in place |
The consumers are `mathfAddVector` and the next transform's input (whose W the
transform ignores). `hdHatTest`, `mathfCopyVector` and `FireCurrentWeapon` get
launcher fields, not the frame vector; launcher `+62c` has no reader. UpdateLauncher
never loads frame `+0c`, 64 bits at `+08` or 128 bits from its frame. It reads no VU
registers, accumulator or flags.
`147a8c` and `147cf4` are in place, so the input is read whole before the output is
written. The existing native helper computes separately rounded XYZ, preserves
destination W and leaves VU state untouched. Unknown and historical callers keep the
original ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/update-launcher-forward`, against parent `24ef197`
(PR #87). Parent headless/window binaries are preserved there and match PR #87's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons (caller
kinds 360 to 362). They are helper-boundary continuations and entries at the
call-return label before each transform (`147a78`, `147ca8`, `147cc8`), across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- Each run stops after its result is consumed: at `hdHatTest` (`147a8c`) or at
`FireCurrentWeapon`. The type-`1c0` check is real: `147cc8` runs use another type
and skip the turret transform.
- Every basis is fixture-known, so every site is checked against an independent
identity or quarter-turn result. Published values are asserted exactly against the
original FPU arithmetic: the launcher's `+230` (at `hdHatTest`) and `+620` (at
`FireCurrentWeapon`). Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 708 → 711,
real libm errno cases 831 → 810). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 185,856 generated sequences / 9,600 whole-memory
comparisons. Historical forward ABI coverage is 15,936 / 996; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `24ef197`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. `147cc8` and `147cf4` are live on the one-player route: they run natively 17 and 6 times with no recorded difference. `147a8c` is cold on these routes and is qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 101.9 ms of silence in one-player, 33.8 ms in four-player and 19.4 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The one-player window run, made while a read-only audit was running, reported 101.9 ms of silence. A back-to-back one-player rerun of new and parent builds then gave 48.1 ms and 53.0 ms at 59.5 and 59.7 frames/s. Full campaign and physical controller/hardware acceptance remain open.
+117
View File
@@ -0,0 +1,117 @@
# Native vehicle spatial calculations
[Minion shield forwards](NATIVE_MINION_FORWARD.md) adds seven hit-point sites with
actual distance, health, HUD and hierarchy-switch publication consumers.
[Attachment/environment forwards](NATIVE_ATTACHMENT_FORWARD.md) adds five helicopter,
cable, gascan, saw-blade and taxi-spike sites with actual grid/query/publication consumers.
[Collision forward transforms](NATIVE_COLLISION_FORWARD.md) adds six velocity,
force, impact-offset and morph-placement sites with actual state consumers.
[Driver forward transforms](NATIVE_DRIVER_FORWARD.md) adds seven path-offset,
lookahead and driving-LOS sites with complete generated owners and real queries.
[Rigid-body forward transforms](NATIVE_RIGID_BODY_FORWARD.md) adds ten sites for local
forces/torques/impulses, integration and world-point publication.
[Final inverse returns](NATIVE_FINAL_INVERSES.md) completes all 134 known inverse sites,
including force-field, health-stand, HUD/radar and particle visibility/sorting consumers.
[Vehicle/light inverses](NATIVE_VEHICLE_LIGHT_INVERSES.md) adds six native inverse sites
with complete tire/rollover/damage/light entries and state-publication checks.
[Driver/boss inverses](NATIVE_DRIVER_BOSS_INVERSES.md) adds five native inverse sites
and the coupled boss forward publication, with actual driver and attachment consumers.
[AI inverses](NATIVE_AI_INVERSES.md) adds five native inverse call sites with steering,
attack-range and front/rear shot-policy comparisons.
[Rigid-body inverses](NATIVE_RIGID_BODY_INVERSES.md) adds seven native inverse call sites
with complete collision/impulse entries and downstream point-velocity checks.
[Collision/drift inverses](NATIVE_COLLISION_DRIFT_INVERSES.md) adds sixteen native inverse call sites,
including drift velocity publication and collision-force coordinates, with full XYZW comparisons.
The player runtime now calculates the vehicle basis product (`vu0MulMatrix3x3`, `1dcc08`) directly over
matrix records. Its three calls are in `vehicleUpdatePosition` and `vehicleSetCsMat`. All four output
components and the final identity column retain the original ordered arithmetic and alias behavior.
Thirteen inline blocks in those two functions also use native records: four direction transforms,
seven sums and two differences. Their 68 load/arithmetic/store instructions no longer transport VU
registers, accumulator or flags. Each block snapshots its current operands at its existing store, then
writes XYZ while retaining the destination's fourth component. CPU branches, loops and checkpoints
stay at their original locations. This does not replace all the functions they call.
| Store | Calculation |
| --- | --- |
| `1aadc4` | Selected attachment transform |
| `1aaddc` | Attachment world position |
| `1aae44` | Repeated movement-step sum |
| `1aaf8c` | Attachment transform |
| `1aafa0` | Combined position |
| `1aafb4` | Position difference |
| `1aafc4` | Position update |
| `1aaff8` | Direction transform |
| `1ab008` | Position update |
| `1ab01c` | Position difference |
| `1ab140` | Light offset transform |
| `1ab150` | Light position |
| `1ab2a8` | Coordinate-system position |
The audited skid-mark call of `mathfMulTransVec` (`1da298`, return address `168b30`) uses the same native
direction calculation. The helper's other callers retain the generated path until their contracts are
audited. This distinction matters: the original stores an inherited `VF16.w`; its following skid-mark
vector-add consumer uses only XYZ. A memory trace found this store writing the four tire-position W
words after removing vehicle register clobbers. The native record boundary retains those destinations
without reconstructing any VU state. The resulting tested frame records match the baseline completely.
## Validation
Artifacts are local under `D:/BozoScratch/native-vehicle`, compared with main `74fd638` / engine `149bf90`.
- `tmb-native-vehicle-tests`: 425,984 comparisons against extracted generated blocks, 416 complete-memory
cases and 1,024 ordered overlapping-block cases pass. Four host FP modes, arbitrary/extreme values,
RAM aliases, scratchpad and quadword alignment are covered. Every CPU/VU byte and host MXCSR remain
unchanged for the inline replacements.
- Another 1,024 tests execute the complete generated `vehicleSetCsMat` caller, including both helper
calls, overlapping matrix input/output, saved registers, scalar tail, return and its exact 16 cycles /
two checkpoints. Context and memory agree with the documented XYZ/destination-W contract; native
VU state stays untouched.
- The matrix/direction suite passes 1,048,576 cases and 512 whole-memory comparisons. This includes
262,144 skid-direction cases. Another 2,048 cases verify the complete original ABI for other callers.
- Original block extraction now writes to `native_original`, outside the recompiler's prefix-cleaned
output folder. A forced recompiler regeneration followed by full game/test builds passes.
- The 9,500-frame 1P and 8,500-frame 4P strict routes exactly reproduce **every** baseline frame-record
field: RAM, scratchpad, draw/sound hashes and counts, calls, threads and EE clocks.
- Live strict comparisons pass for 92,744 / 45,576 vehicle basis products, 187,011 / 60,768 inline blocks
and 4,100 / 8,363 skid directions (1P / 4P). Twelve inline sites run in 1P; four run in 4P. The repeated
movement-step sum at `1aae44` has original-block tests but was not reached by these scripts.
Independent default 1P/4P runs reproduce the strict records byte-for-byte, with zero original comparisons.
Windowed default runs complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P. Captures
directly show combat, movement, effects and all four snow-arena views after loading. The window logs
record 22.8/54.4/28.7 ms of silence respectively; deterministic sound is exact, but this is not a flawless
device-audio or subjective listening claim.
Existing camera/HUD tests and the 12 release-tool regressions pass. Full campaign, rare multi-step
movement, other direction-helper callers and the remaining hierarchy/VU math are not claimed qualified.
[The suspension/tire-height increment](NATIVE_SUSPENSION_TIRE.md) subsequently adds the two
forward transform leaves used by suspension ride-height and tire pivot reconstruction, with
generated consumer tails and complete tire-height entry-call comparisons.
[Native shadow transforms](NATIVE_SHADOWS.md) subsequently add the vehicle shadow vertex
transform and five weapon shadow motion/height-sample transforms, with generated vertex-loop
and height-query staging comparisons.
[Native tow-truck launcher transforms](NATIVE_TOW_TRUCK.md) subsequently add three forward
and one inverse site, with complete generated positioning, smoothing and orientation consumers.
[Native peel-out transform](NATIVE_PEEL_OUT.md) subsequently adds the vehicle's
visual-offset forward transform, checked through the full producer and the real
coordinate-system consumer, including matrix aliases and the opaque source W boundary.
[Native weapon/skid transforms](NATIVE_WEAPON_SKID_TRANSFORMS.md) subsequently add
weapon translation and skid creation/stretch offsets, including complete scalar
vertex publication, material/list bookkeeping and stationary/moving entry checks.
+114
View File
@@ -0,0 +1,114 @@
# Native vehicle and object-light inverses
Six more inverse returns use native record arithmetic, following the
[driver/boss increment](NATIVE_DRIVER_BOSS_INVERSES.md). Inverse coverage grows
from 122 to 128 of 134 returns. Forward coverage stays at 96 of 269, and
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Qualified consumer |
| --- | --- | --- |
| `18bc9c` | `tireCalcLastRotChange` | Local angular delta, previous-delta XYZ copy and meaningful output W |
| `1ac85c` | `vehicleInitRollOver` | Rollover angular response, trigonometric/clamp branches and angular-state copies |
| `1af120`, `1af148` | `vehicleReactToWeaponDamage` | Direction normalization, tire-jump decisions and damage-state publication |
| `1eb4d4`, `1eb58c` | `plightInObject` | Local light position/direction, distance/dot consumers and lighting-table publication |
The existing inverse implementation preserves separately rounded XYZ and copies
first-basis W as meaningful data. All four output components remain exact; no W
exclusion is added. Native calls leave VU registers, accumulator, flags and data
memory untouched. Unknown callers and historical hosts retain the original ABI.
Game branches and scalar consumers remain compiled game code.
## Generated-code comparisons
Evidence is under `D:/BozoScratch/remaining-inverses`, against main `99efa7f`
(PR #48). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
Aggregate coverage is 99,840 / 4,224. Each site has 256 helper-boundary cases
through its actual tail and 256 complete owner-entry cases. Four host rounding
modes, denormal controls, RAM aliases, rotated bases and arbitrary basis W
are covered. Whole-memory entry samples reach active transforms.
- Tire entries execute the actual matrices-to-axis, axis-to-matrix and
matrix-to-RPH producers before the inverse. Successful delta publication and
the XYZ copy to the previous-delta record are required, with meaningful W
checked explicitly. A special vehicle/state gate skips the transform.
The separate boolean path that calls rollover is outside these tire fixtures;
rollover itself has its own complete-entry fixtures.
- Rollover entries execute the actual normal-to-matrix producer, inverse,
scalar trigonometric/threshold/clamp consumers and both angular-state copies.
Signed lateral inputs, positive/negative roll rates, tilted/flat vehicles,
vehicle-class scaling and the early state gate are covered. Successful state
publication is required in 224 entry cases.
- Weapon-damage entries execute both upright-basis and generated-normal-basis
routes, sign changes, real normalization, Z clamp, the four-tire loop and
real tire-jump/free-fall helpers. Fixtures include zero vectors, blocked tires,
existing positive tire velocity, damage below/above 50 and the damage-scaling
flag. Switched vehicle classes require the other inverse site to execute.
Successful tire-jump execution occurs in 707 comparison cases. The optional
`collisSlideVehicle` call is avoided by the fixture inputs; its composed path
and all weapon types are not claimed here.
- Lighting entries execute the complete eight-slot/four-output loop, including
scalar position producers, both inverses, squared-distance rejection, actual
dot consumers, attenuation, ambient/nonambient stores, the fourth output lane
and the published-light flag. Fixtures include one/four active lights,
missing indices, disabled lighting, oversized radius and invisible coordinate
systems. Four-light nonambient cases require four real dot consumers.
Successful light publication occurs in 192 entry cases. Arbitrary light-table
contents and all spatial overlap configurations are outside these fixtures.
- Per-site reach assertions distinguish active transforms from gates. CPU outside
retired VU, host FP effects, clocks/checkpoints, helper/action counts and final
memory agree. Native VU remains untouched through the complete scalar tails.
No runtime RAM masking or VU-state reconstruction is introduced.
- Historical inverse ABI coverage grows to 8,192 cases / 128 whole-memory checks;
forward stays at 5,568 / 348. Existing coverage retains 786,432 hierarchy helper
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
32 whole-memory and 2,048 unknown ABI cases. Front/rear AI attack-publication
assertions still pass in 392 / 352 cases.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recording files and snapshots are byte exact;
strict comparisons report no mismatch.
One-player reaches 11 tire-delta calls, one rollover call and 14 upright-damage
calls. Four-player reaches four tire-delta calls. The alternate damage inverse
and both lighting inverses are cold in these replay routes; their behavior is
qualified by the complete generated owner entries, not claimed as runtime route
coverage. The one-call rollover sample is sparse; broader branch coverage comes
from its fixtures.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
AI opponents, driving/combat effects and vehicle rollover, four simultaneous
views, decoded intro images and return to the menu. Each route has five distinct
captures. Windowed 1P reaches nine tire-delta, eight rollover and nine upright
damage calls; 4P reaches four tire-delta calls. The other new sites are cold in
these window routes and covered by generated entries.
Stereo 48 kHz, 16-bit WAV captures contain nonzero audio. Device underruns remain:
46.7 ms silence in 1P, 38.7 ms in 4P and 24.8 ms in movies. These are functional
checks, not a timing or flawless-playback claim. Full campaign, all vehicle/weapon
combinations and physical-controller/hardware acceptance remain outside this
increment.
## Remaining scope
Six inverse returns remain outside the native allowlist:
| Return PC | Owner |
| --- | --- |
| `12d0b0` | `forceFieldTakeHit` |
| `136ce8` | `healthStandInit` |
| `13f814`, `13fe54` | `Hud::BuildRadarStuff` |
| `14037c` | `Hud::AddRadarSignal` |
| `1e9778` | `particleDraw` |
Together with 173 remaining forward returns, these two families have 179 sites
outside the native allowlists. This is a call-site inventory, not a count of all
remaining emulation. Additional inline arithmetic remains separate work.
+95
View File
@@ -0,0 +1,95 @@
# Native weapon hit-test forward transforms (RockHD and RicoHD)
[The Ferris wheel and final boss batch](NATIVE_FERRIS_BOSS_FORWARD.md) follows with four more hit-test sites.
Six weapon hit-test forward returns use native XYZ arithmetic after the
[held-aim and lock-on arc batch](NATIVE_SPECIAL_ARCS_FORWARD.md). Known forward
coverage grows from 216 to 222 of 269 returns (47 remain). Known inverse coverage
stays 134 of 134; BozoEngine stays at `4a8f70a`.
These are the first forwards whose results feed the hd collision system. Their
consumers were audited first:
- `hdPntSphereTest` (`1c4e70`) keeps *pointers* to its point and sphere in gp
globals (`gp-3024`, `gp-3020`). Every reader of those globals (`hdHier`,
`hdColGrid`, `hdColNode`, `hdTerrain`, `hdBspNode`, `terrainCollision`)
reads the point only through XYZ helpers or as separate `x`/`y`/`z` words.
Nothing copies the point with its W.
- `Interactives::DispatchHit` (`142d98`) only passes the point on. All twelve
jump-table handlers ignore it, pass it on, or read it only as XYZ: the vehicle,
fodder, destructible, final boss, loop tank and pedestrian strategy handlers,
`vehicleReactToWeaponDamage`, `GenericTakeHit` and `DoEffect`. No object field or
global receives its W.
- `mathfSubVector`, `mathfAddVector`, `mathfNormalize` and
`mathfRotationFromVector` load and store only `+0/+4/+8`.
`updateRichochetBounce` gets the coordinate system's position, whose W no
forward writes.
| Return PC | Producer and consumer |
| --- | --- |
| `1b6cd8`, `1b6d3c` | `Weapon::RockHD` (`1b6bf0`): with `+1c` set and a nonzero fall speed at `+98`, or with `+1c` clear, a fixed offset goes through the weapon's basis at `+d0` into frame `+0`, plus its coordinate system's position. It becomes `hdPntSphereTest`'s point; on a hit, `mathfSubVector` rewrites its XYZ and `DispatchHit` gets it |
| `1b5168` | `Weapon::RicoHD` (`1b50f0`): a fixed offset through the basis into frame `+10`, plus the position; then `hdPntSphereTest`, the hit's `mathfSubVector` and `DispatchHit` |
| `1b52c0` | After a hit, the reflection rebuilds the basis; the direction at `+90` goes through it into frame `+10`, added into the coordinate system's position, which goes to `updateRichochetBounce` |
| `1b5528` | With no hit, a new offset goes through the basis into frame `+10`, plus the position, and is tested again (`hdPntSphereTest`, `mathfSubVector` and `mathfRotationFromVector`) |
| `1b5630` | The second reflection: the direction at `+90` into frame `+10`; the coordinate system's position becomes `+80` plus it |
Every result is written in place in the frame. RockHD never loads frame `+0c`, and
RicoHD never loads frame `+1c`. Neither reads VU registers, accumulator or flags.
The existing native helper computes separately rounded XYZ, preserves destination
W and leaves VU state untouched. Unknown and historical callers keep the original
ABI. No engine or gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/weapon-hit-forward`, against parent `4847649`
(PR #80). Parent headless/window binaries are preserved there and match PR #80's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
kinds 321 to 326): helper-boundary continuations and full entries, across four
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
payloads.
- `1b6cd8`, `1b6d3c` and `1b5168` run from the owner's start through the real
branch selection and offset setup, and stop at `hdPntSphereTest`. The other three
start at the call-return label before each transform (`1b52a4`, `1b5518`,
`1b5614`). `1b52c0` stops at `updateRichochetBounce`, `1b5528` at
`hdPntSphereTest`, and `1b5630` runs to the owner's real return.
- The harness requires each full entry to reach exactly its own transform. Every
basis is fixture-known, so every site is checked against an independent identity
or quarter-turn result.
- Published values are asserted exactly against the original FPU arithmetic: the
point `hdPntSphereTest` receives (and that it receives that frame address), the
position handed to `updateRichochetBounce`, and the returned position.
Publications: 512 for each site.
- The VU rule from the earlier weapon increments applies. Only forward scratch W
(frame `+0c` or `+1c`) is normalized for test comparison, after every real
consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 718,
real libm errno cases 830 → 842). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 167,424 generated sequences / 8,448 whole-memory
comparisons. Historical forward ABI coverage is 13,632 / 852; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `4847649`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. Four returns are live on the one-player route and run natively there with no recorded difference: `1b6d3c` 1,569 times, `1b5168` and `1b5528` 319 times each and `1b52c0` 5 times. `1b6cd8` and `1b5630` are cold on these routes and are qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 59.3 ms of silence in one-player, 29.0 ms in four-player and 27.5 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
+84
View File
@@ -0,0 +1,84 @@
# Native weapon lock-on, satellite and rock forward transforms
[Ricochet forwards](NATIVE_RICOCHET_FORWARD.md) follow with two more weapon sites.
Six weapon forward returns use native XYZ arithmetic after the
[Minion shield forwards](NATIVE_MINION_FORWARD.md). Known forward coverage grows
from 131 to 137 of 269 returns (132 remain). Known inverse coverage stays 134 of
134; BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `1b1700` | `Weapon::UpdateLockOnVehicle` (`1b16a8`) | Weapon offset through the target vehicle basis, added to the target position for the heading/pitch/distance aim |
| `1b1bbc` | `Weapon::UpdateLockAheadOfVehicle` (`1b1ae0`) | Same offset added to the predicted lead point for the aim |
| `1b339c` | `Weapon::UpdateSkillSatTrans` (`1b3350`) | Launch offset through the weapon basis, added to the satellite position (state 0) |
| `1b3634`, `1b371c` | `Weapon::UpdateSkillSatTrans` | Per-frame velocity through the satellite basis, in place, added to its position (states 1-2 and 3) |
| `1b3ef8` | `Weapon::UpdateRockTrans` (`1b3e28`) | Per-frame velocity through the weapon basis, in place, added to the rock position before its height test |
Every result is a stack-local vector read only through scalar XYZ code:
`mathfAddVector` (`1daef0`), and afterwards the rock's `hdHatTest`, which only
writes XYZ into that buffer. The destination W is never read again. None of the
owners reads VU registers, the accumulator or flags directly. Three sites transform
in place; the native helper reads its input before writing. The existing native
helper computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. Unknown and historical callers keep the original ABI. No engine or
gameplay formula changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/weapon-lock-forward`, against parent `145964b`
(PR #56). Parent headless/window binaries are preserved there. Generated bodies,
retail data and runtime recordings stay outside Git.
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons:
for each return, 256 helper-boundary sequences through the real continuation and
256 full-owner entries, across four rounding modes, FTZ/DAZ, RAM aliases,
identity/quarter-turn bases and arbitrary W payloads.
- Each reached transform's input and output are captured at the real helper and
`mathfAddVector` boundaries and checked against an independent identity or
quarter-turn result. Full satellite entries rebuild their basis from zero angles
through the real `mathfRotMatrixPH`, so they are checked against identity.
- The published point is asserted exactly against the original FPU addition:
lock-on and look-ahead aim points at `mathfHeadingFromPointToPoint`, the
satellite position written back to its coordinate system, and the rock X/Y at
`hdHatTest` (Z is lifted for the test). The real height-test consumer executes.
Lock-on and look-ahead full entries also cover the no-target, inactive-state and
copy-path gates without a transform (416 publishing cases each).
Satellites and rock publish in all 512 cases each.
- Weapon owners reach real libm and matrix helpers that use VU0 themselves. Their
VU state must match the original exactly, except the original leaf's write set
(VF11-13, VF15, VF16, ACC, MAC/status). In that set, each word must be either the
original's later real write or the value the native leaf found at its entry.
Only forward scratch W at each owner's frame `+0c` is normalized for test
comparison, after every real consumer.
- The rock's impact effect, weapon removal and impact sound are kept on the
original path but not reached by these fixtures.
- Aggregate caller coverage is 123,904 generated sequences / 5,728 whole-memory
comparisons. Historical forward ABI coverage is 8,192 / 512; inverse remains
8,576 / 134. All earlier publication assertions remain enabled.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `145964b`: raw RAM, scratchpad,
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
are identical. Strict/default recordings and snapshots are byte exact; strict
comparisons report no mismatch. The rock return `1b3ef8` runs natively 1,569 times
on the one-player route with no recorded difference; the other five sites are cold
on these routes, qualified by the generated owner/consumer suite above.
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
vehicle and level selection, driving with the HUD and four simultaneous views.
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
contain nonzero audio. None of the six sites is reached within these window
lengths.
Audio device underruns remain: 51.4 ms silence in one-player, 32.9 ms in
four-player and 20.8 ms in the movie run. These are functional checks, not a
performance or flawless-playback claim. A visible satellite or lock-on weapon
encounter, full campaign and physical controller/hardware acceptance remain open.
+109
View File
@@ -0,0 +1,109 @@
# Native weapon translation and skid-mark transforms
[Weapon lock-on, satellite and rock forwards](NATIVE_WEAPON_LOCK_FORWARD.md) later add six more
weapon owners: lock-on/look-ahead aim points and skill-satellite/rock movement.
Five forward-transform returns now use native record arithmetic, extending the
[weather viewport increment](NATIVE_WEATHER_VIEWPORT.md). Forward coverage grows
from 90 to 95 sites; inverse coverage stays at 89. BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Consumers |
| --- | --- | --- |
| `1b28cc` | `Weapon::UpdateTranslation` | Weapon-local offset followed by position addition |
| `1b28e8` | `Weapon::UpdateTranslation` | Coordinate-system offset followed by position addition |
| `168ca0` | `skidmarkAddSkidMark` | Half-width offsets, four vertices, material/colour and mark metadata |
| `1691b0` | `skidmarkStretchOldSkidMark` | Stationary left/right endpoint adjustment and completion flags |
| `169378` | `skidmarkStretchOldSkidMark` | Moving forward/reverse vertex pairs and orientation history |
The earlier creation return `168b30` was already native. The existing forward
helper snapshots operands, calculates separately rounded XYZ and retains
destination W. Historical hosts and unknown callers retain the complete original
ABI. All five new results are consumed as XYZ; native calls leave VU registers,
accumulator, flags and data memory untouched. Smoothing, timers, material gates,
list operations, travel-direction checks and vertex publication stay compiled
game code. No register shadow or VU reconstruction is added.
## Complete generated consumers and entries
Evidence is under `D:/BozoScratch/weapon-skid-transforms`, against main `c5888d2`
(PR #43). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 2,560 sequences / 160 whole-memory comparisons. Aggregate
coverage is 79,360 / 2,944. Four host rounding modes, denormal controls, RAM
aliases, all four tires/mark slots and arbitrary position/vertex W are covered.
- Each site has 256 helper-boundary cases through the complete consumer/return,
plus 256 actual function entries: 512 generic weapon updates, 256 skid
creation updates and 512 stationary/moving stretch updates in total.
- Weapon entries exercise both basis-selection modes, zero/nonzero prior
translation, real smoothing and timer-scaled offsets. Generic types 0–3 and
the terrain-adjustment-disabled tail are covered. Special weapon update
routines and the optional height-query branches are outside these fixtures.
- Creation entries cover disabled generation, invalid material, tire rejection,
overload rejection, both travel directions, removal from the free list and
insertion into the used list, and reuse with an empty free list. Actual
material, timer and intrusive-list routines run without stubs. RGB packing,
mark-index publication and all four vertex records are compared.
- Stretch entries cover material/direction rejection, distance and accumulated
angle gates, retained short marks, both moving directions, stationary
left/right updates and completion flags. The actual software-double
conversion/multiply/conversion width producer executes before moving offsets.
Explicit per-site reach assertions distinguish active paths from early exits.
- CPU outside retired VU, outgoing host FP effects, clocks/checkpoints, call
counts and final memory agree. Native VU stays untouched through the complete
consumers. W exclusions occur only after all real consumers run and are
restricted to the audited stack offset records and creation's tire-position
W. Published coordinate-system and vertex W remain compared exactly.
- Whole-memory entry samples cover active weapon translations, new mark creation,
stationary stretching and moving vertex updates. Historical forward ABI
coverage grows to 5,504 / 344 cases / whole-memory checks; inverse stays at
5,696 / 89. Existing hierarchy coverage retains 786,432 helper cases / 384
whole-memory, 8,000 geometric edges, 1,024 complete BSP callers / 32 whole-memory
and 2,048 unknown ABI cases.
- Player, headless runner, historical checker and all test targets build.
All eleven native suites and twelve Python tooling tests pass.
## Replay qualification
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames.
Every recorded field matches the immediate parent: raw RAM, scratchpad, calls,
draws, sound, threads, counts and EE clocks. Both sampled full 32 MiB RAM snapshots
match exactly. Strict/default recording files and snapshots are byte-identical.
No observer, RAM mask or VU restoration is needed.
| New return | One-player calls | Four-player calls |
| --- | ---: | ---: |
| `1b28e8` | 5,648 | 0 |
| `168ca0` | 1,522 | 1,449 |
| `169378` | 2,578 | 6,914 |
| Total | 9,748 | 8,363 |
Weapon-local `1b28cc` and stationary `1691b0` are cold in these routes and are
qualified by the generated comparisons. Total native forward calls become
1,172,820 / 375,625. Default routes make zero original-helper comparisons and
execute zero VU0 microprograms. Counts establish reach, not a measured speedup.
Fresh 6,500-frame one-player and actual four-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, with isolated scratch
user data. Reviewed captures show decoded movie action (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), movement and active combat with
weapon effects (one-player 5,500 / 6,300), and four advancing snow-arena views
with skid effects (four-player 5,500 / 6,300). These are bounded functional
checks, not pixel-exact windowed or console parity.
Windowed one-player reaches coordinate-system weapon translation 1,718 times,
skid creation 450 times and moving stretch 778 times: 2,946 new native calls.
Four-player reaches creation/stretch 825 / 3,195 times: 4,020 new calls. The two
fixture-qualified cold sites remain cold here; all five are cold in the movie route.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
25.6 / 53.4 / 31.2 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound is exact; flawless device audio
and subjective listening are not claimed.
## Remaining scope
The two inventories now contain 95 native forward and 89 native inverse sites.
Outside their allowlists remain 174 forward and 45 inverse sites, 219 in total
across the game. This structural count excludes other helper families and inline
VU operations. Full campaign, every weapon/special attack and console visual/audio
parity remain separate work.
+85
View File
@@ -0,0 +1,85 @@
# Native weather viewport transform
The forward-transform return `1e8a34` in `particleUpdateRainViewport` (`1e87a0`)
now uses native record arithmetic, extending the
[camera increment](NATIVE_CAMERA_TRANSFORMS.md). Forward coverage grows from 89
to 90 sites; inverse coverage stays at 89. BozoEngine stays pinned to `4a8f70a`.
The existing native helper snapshots its operands, calculates separately rounded
XYZ and retains destination W. Its stack result is consumed as XYZ by camera
translation, weather-position publication, grid quantization and projection
setup. The complete tail never reads that temporary W. Published projection
XYZW, grid-scale W and explicit coordinate-system matrix W remain meaningful
data and are compared exactly. No register shadow or VU reconstruction is added.
Historical hosts and unknown callers retain the complete original ABI.
## Complete viewport comparisons
Evidence is under `D:/BozoScratch/weather-viewport`, against main `1067036`
(PR #42). Generated code, retail data, recordings and captures stay outside Git.
- Added coverage is 512 generated sequences / 32 whole-memory comparisons.
Aggregate coverage is 76,800 / 2,784. Four host rounding modes, denormal
controls, all four viewport slots, RAM aliases, three seeded weather records
and aliased coordinate-system/projection output are covered.
- 256 cases start at the transform boundary and run the entire remaining
viewport through return. They include signed zero/subnormal inputs and
values at and adjacent to weather-cell boundaries, preserving the original
negative-coordinate quantization order.
- Another 256 cases enter the actual viewport function across 16 scenarios:
disabled weather (16 early returns), fade updates enabled/disabled, null and
supplied coordinate systems, counters 0/1/20/21/unsigned-negative values,
timer steps 1/2, fog updates and identity/projected publication. The timer,
fog and view accessors execute their real generated code; none is stubbed.
- Both comparison runs use the existing production-native point projection and
weather identity helpers. Their original implementations are independently
qualified by the projection suite. Explicit assertions check transform reach
and the selected identity/projection branch. Whole-memory entry samples cover
active fog updates and aliased projection output.
- CPU outside retired VU state, outgoing host FP effects, clocks/checkpoints
and final memory agree. Native VU registers, accumulator, flags and data
memory remain untouched through the full viewport. Only the transform's
stack W is excluded after all real consumers execute; an assertion restricts
the exclusion to that word in the appropriate entry/continuation frame.
- Historical forward ABI coverage grows to 5,184 / 324 cases / whole-memory
checks; inverse stays at 5,696 / 89. Existing hierarchy coverage retains
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
- Player, headless runner, historical checker and all test targets build.
All eleven native suites and twelve Python tooling tests pass. The hierarchy
suite also passes with the explicit branch-reach and active whole-memory samples.
## Replay qualification
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames.
Every recorded field matches the immediate parent: raw RAM, scratchpad, calls,
draws, sound, threads, counts and EE clocks. Both sampled full 32 MiB RAM
snapshots match exactly. Strict/default recording files and snapshots are
byte-identical. No observer, RAM mask or VU restoration is needed.
The new site executes 5,560 / 15,192 times in one-player / four-player. Total
native forward calls become 1,163,072 / 367,262. Default routes make zero
original-helper comparisons and execute zero VU0 microprograms. These establish
coverage, not a measured speedup.
Fresh 6,500-frame one-player and actual four-player windowed routes and a
4,200-frame movie/menu route complete through clean exit, with isolated scratch
user data. Reviewed captures show decoded movie action (1,000), return to menu
(1,800), Junkyard loading (one-player 4,500), advancing gameplay and rain
(one-player 5,500 / 6,300), and four advancing snow-arena views
(four-player 5,500 / 6,300). The new site executes 1,706 / 7,196 times in windowed
one-player / four-player and is cold in the movie route. These are bounded
functional checks, not pixel-exact windowed or console parity.
All three stereo 48 kHz WAV recordings contain audio. Device logs report
29.1 / 50.8 / 35.6 ms of silence (movie / one-player / four-player), with underruns
and dropped frames. Deterministic gameplay sound is exact; flawless device audio
and subjective listening are not claimed.
## Remaining scope
The two transform inventories now contain 90 native forward and 89 native inverse
sites. Outside their allowlists remain 179 forward and 45 inverse sites, 224 in
total across the game. This structural count excludes other helper families and
inline VU operations. Other weather functions, full campaign acceptance and
console visual/audio parity remain separate work.
+91
View File
@@ -0,0 +1,91 @@
# Native Zoomies and HalTrans weapon forward transforms
[AI hunt and bait forwards](NATIVE_AI_BEAD_FORWARD.md) follow with two AI-driving sites.
Four weapon forward returns use native XYZ arithmetic after the
[combo-launch forwards](NATIVE_COMBO_FORWARD.md). Known forward coverage grows from
174 to 178 of 269 returns (91 remain). Known inverse coverage stays 134 of 134;
BozoEngine stays at `4a8f70a`.
| Return PC | Owner | Producer and consumer |
| --- | --- | --- |
| `14d294` | `Launcher::UpdateZoomies` (`14d238`) | The launcher's muzzle offset at `+4c0` through the vehicle's coordinate system, added to its position into the launcher's `+620` before `GetLockOn` and `CreateWeapon` |
| `1b3874` | `Weapon::UpdateHalTrans` (`1b3778`), state 0 | The weapon's velocity (`+90`, scaled by the fields since the last update) through its basis at `+d0`, in place, added to its position |
| `1b39a4` | The same, state 1, target vehicle rolling | The vehicle's offset at `+2460` through the vehicle's coordinate system, added to the vehicle's position |
| `1b3b00` | The same, state 1, otherwise | A copy of the vehicle's `+2450` offset, the same way |
`UpdateZoomies` fires on every period-th update. The period is the global at
`gp-42f8`, and the counter is `+25c`. The result is the frame vector at `+0`, read
only by `mathfAddVector`, which writes X/Y/Z into `+620`. Frame `+0c` is never read.
`UpdateHalTrans` flies the weapon in state 0. In state 1 it follows its target
vehicle: when that vehicle's `+475` byte is clear, it smooths its position toward
the transformed point. X and Y go through `smoothEasyIn`, Z is stored directly,
then the angles are smoothed and the matrix is rebuilt
(`mathfRotMatrixRPHNoTrans`). The rolling test is `|cs+64|` against a limit. The
results are the frame vector at `+0`, read only by `mathfAddVector` and by scalar
X/Y/Z loads. Frame `+0c` is never read.
Neither owner reads VU registers, the accumulator or flags. The existing native
helper computes separately rounded XYZ, preserves destination W and leaves VU state
untouched. It reads its input before writing, so the in-place transform is safe.
Unknown and historical callers keep the original ABI. No engine or gameplay formula
changes.
## Generated comparisons
Evidence is under `D:/BozoScratch/zoomies-hal-forward`, against parent `2b4f79b`
(PR #71). Parent headless/window binaries are preserved there and match PR #71's
qualified build. Generated bodies, retail data and runtime recordings stay outside
Git.
- Added coverage is 2,048 generated sequences / 128 whole-memory comparisons
(caller kinds 279 to 282): helper-boundary continuations and full-owner entries,
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
arbitrary W payloads.
- Zoomies entries run the fire counter, the transform, the real
`Launcher::GetLockOn` (nothing to lock on) and stop at `CreateWeapon`. A
non-firing update checks the burst length and returns.
- HalTrans entries run state 0 to its return. In state 1 they run both branches
through the real smoothing helpers and the matrix rebuild to the owner's return.
State 2 and the no-target case return without a transform.
- Every basis is fixture-known at entry as well as at the helper boundary, so every
case is checked against an independent identity or quarter-turn result.
- Published values are asserted exactly against the original FPU addition: the
Zoomies launch point in `+620`, the flying weapon's position, and the attached
weapon's directly stored height. The sites publish in 480, 480, 448 and 448
cases.
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
frame `+0c` is normalized for test comparison, after every real consumer.
- New caller kinds shift the shared random fill for later rounding modes, so two
data-dependent counts in earlier fixtures moved (vehicle tire jumps 708 → 705,
real libm errno cases 842 → 810). All scenario-defined counts and assertions are
unchanged.
- Aggregate caller coverage is 144,896 generated sequences / 7,040 whole-memory
comparisons. Historical forward ABI coverage is 10,816 / 676; inverse remains
8,576 / 134.
## Replay and window qualification
Player, headless runner, historical checker and all eleven native test targets
build. All eleven native suites and twelve Python tooling tests pass, with every
previous publication assertion enabled.
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
frames. Every recording field matches parent `2b4f79b`, including the RAM hash on
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
are byte exact; strict comparisons report no mismatch. The HalTrans state-0 return
`1b3874` is live: it runs natively 18 times on the one-player route with no
recorded difference. The other three returns are cold on these routes and are
qualified by the generated owner suite above.
Fresh isolated window runs, started after the headless replays had finished,
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
Reviewed captures show the intro and credits, menus, vehicle and level selection,
driving with the HUD and four simultaneous views. Each route has five distinct
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
underruns: 52.1 ms of silence in one-player, 22.0 ms in four-player and 23.7 ms in
the movie run. These are functional checks, not a performance or flawless-playback
claim. Zoomies and an attached HalTrans weapon in actual play, full campaign and
physical controller/hardware acceptance remain open.
Loaded 100 of 199 files, more files were not shown because too many files have changed in this diff. Show more