Ports in mode on change audio samples (CPU cycles of the original are not spent) #11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while validating
battle/Rand(first port, branchregistry).Route
tests/inputs/newgame_first_battle.txt, 12 000 frames, US v1.0:BC2A27B4AA629945), audio hash differs (DDA5EA5278AFFED9vs86CF3C9222C5400D).Cause (to confirm): the bridge runs the C instantly, without the cycles the original routine spends. The SPC700 runs in parallel on its own clock synchronised to CPU cycles, so later APU port writes reach it a few cycles earlier and the resampled output shifts. This is the Chrono Trigger lesson in
lessons.md(APU handshakes depend on timing the per-call shadow cannot see) and consistent with decision D1 (native timing differs from the original).Plan:
rom.ports.*now checks picture + all memories each frame and reports audio).Measured with the test
rom.ports.US_V10(PR #12), portbattle/Randon vs interpreter, same seed and inputs:Randcall$7E:131E4D vs 4E$7E:131Eis the CPU-side sound driver's transfer state (sound code runs with D=$1300). So it is not only PCM resampling: game state that depends on the CPU/SPC700 handshake timing takes another path when a port does not spend the original's cycles (timing census case E8).Decision taken (documented in
docs/validation.md): the per-call shadow is the exact criterion for a port; the on-mode divergence is reported by the test, not required. Whole-game behaviour is validated by routes and semantic checkpoints (decision D1).Left open: whether scaffold builds should keep frame-exactness by charging the original's cycles in bridges (rejected by the brief as "per-port cycle cost estimation"; would only matter for scaffold-phase frame comparisons). Keeping this issue open until routes/checkpoints exist to confirm game behaviour does not diverge (e.g. battle outcome identical).
Closed by PR #21. With
battle/Randon, the behaviour-driven routetitle_to_first_battle_winreaches its goal at the same frame as the interpreter-only movie, with identical semantic checkpoints and even identical end picture/WRAM/SRAM hashes (US 10253, JP 9556). The divergence of the blind input script (sound driver$7E:131E, audio) stays reported byrom.ports.*; whole-game behaviour is guarded by the newroute_ports_on.*tests.