debug: add generic boot write-range tracing - #91
Merged
Conversation
Extract the useful diagnostic from PR #13 into an opt-in, title-agnostic boot write-range trace with TCP-queryable context. Co-authored-by: NyperYuhgard <93950153+NyperYuhgard@users.noreply.github.com>
SDL_main.h is a single-header implementation in SDL3. Include it only from the translation unit that owns main so MinGW emits one WinMain instead of one per SDL-using source.
mstan
marked this pull request as ready for review
August 1, 2026 17:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the remaining useful Crash Bash diagnostic from #13 / NyperYuhgard's
b07cb79251ecdca85aca94ba5dbfd731b67e10a7without taking the title-specifichard-code or the unrelated stale branch:
PSX_WTRACE_BOOT=lo,hi[;lo,hi...]for caller-selected, half-open RAMranges armed before guest execution;
address/value/width, PC, RA, registers, frame, and DMA attribution;
The companion generic misaligned-dispatch diagnostics from the source commit
were already extracted in #28.
Co-authored with and credited to @NyperYuhgard.
Crash Bash assessment
The original report is mechanically plausible, but its specific corrupt-value
diagnosis is not independently reproduced.
With a verified local retail Greatest Hits build and
PSX_WTRACE_BOOT=0x000B3A80,0x000B3B00, the watched range is genuinely active.At physical
0x000B3AC4, however, the observed nonzero write was the loadedMIPS instruction
0x8C65B690, from guest PC0x80048FA8at frame 395; not thereported
0x6766BD35pointer. That supports preserving the diagnostic as ageneric tool, but not encoding the address or interpretation in the runtime.
Validation
character select, the hub, and live Crashball gameplay. Survived two
deterministic fuzz phases (540 input pulses, frame 24594), with audio
active, zero unsupported mid-block executions, and zero unknown dispatch
tails.
db2302c): title, memory-card slot chooser, village gameplay, anddeterministic fuzz passed.
fa6a75d): title, load-slot chooser, seaside gameplay, anddeterministic fuzz passed.
83e2ee0): full memory-card read path and intro-stagegameplay passed; deterministic fuzz plus extended input skipping reached
live combat.
564a86e): Load Game, full memory-card read path, openingsequence/gameplay, and deterministic fuzz passed.
mid-block executions and 0 unknown dispatch tails. All matched runs held
normal 16.683 ms frame pacing and active audio. Mega Man X6 and Ape Escape
each completed 72/72 card reads with no aborts.
The previously noted default SDL3/MinGW failure is resolved in this PR.
SDL_main.his SDL3's single-header entry-point implementation and was beingincluded through the shared compatibility header, emitting one
WinMainfromevery SDL-using translation unit. It now has one owner in
main.cpp, protectedby a source-invariant test. A clean fetched-SDL 3.4.10 MinGW build linked and
smoke-ran Crash Bash through SDL3/OpenGL to frame 1374 with normal 16.683 ms
pacing and a clean report.
Validated and ready to merge.