gc_bba_test: fix inverted EXI error checks; builds clean
libogc's EXI functions return '1 on success, <=0 on error', but every call site tested '== 0'. A -1 error return therefore read as success, so a failed EXI_Lock or EXI_Select would fall through and the subsequent transfer would produce garbage reported as a misleading test failure rather than an EXI error. All six call sites now test <= 0. Also retries EXI_Lock for ~100 ms: it fails outright rather than blocking when another subsystem holds the channel, and Swiss or a libogc driver may hold it briefly -- without the retry a transient collision surfaces as a test failure. Builds clean with devkitPPC 16.1.0 / GCC 16, no warnings: 172 KB .dol. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,3 +65,10 @@ fault. `bba_read()` clocks exactly `len`; don't "round up" for convenience.
|
||||
**TXDATA takes one byte per transaction.** The register file's effective
|
||||
address auto-increments per data byte, so a 4-byte write to 0x48 would spill
|
||||
into 0x49–0x4B. `bba_tx_bytes()` does it correctly.
|
||||
|
||||
## Build status
|
||||
|
||||
Builds clean (no warnings) with devkitPPC 16.1.0 / GCC 16 in the devcontainer:
|
||||
`gc_bba_test.dol`, ~172 KB, entry `0x80003100`.
|
||||
|
||||
`.gitignore` excludes the build products — run `make` to produce the `.dol`.
|
||||
|
||||
Reference in New Issue
Block a user