Commit 8c3a1f9
committed
HLE CD_read: honour D0 bit 31 (re-seek only) + mirror data into cart space
Two related fixes for boot stubs that issue multiple CD_read calls:
1. Re-seek (D0 bit 31 set) is now a no-op transfer. Per
docs/cd-bios-calling-convention.md, bit 31 means "skip hardware
init, just re-seek; the GPU data area is already configured by
the prior call." We were treating these as full reads, computing
byteCount from A0/A1 (which hold stale or garbage values in
re-seek mode) and falling back to a default \$5BC00 transfer that
stomped the boot stub's just-loaded code/data with raw audio
sectors. Hover Strike previously crashed to PC=\$FFFFFFFF at
frame 86 because its 4th and 5th CD_reads (D0=\$80657374,
\$80F652B9) overwrote 750KB of memory; with this fix it now runs
to a clean wait loop at \$065B36 with 19 unique PCs.
2. Loaded data is now mirrored into cart space at the same offset.
On real Jaguar CD hardware the CD cart's onboard buffer maps into
cart space (\$800000-\$DFFFFF); some boot stubs scan cart-space
addresses (e.g. BrainDead 13 reads A0=\$00851644) for the universal
"ATRI" header. Cart space is otherwise empty in HLE mode, so the
mirror is harmless when not needed.
Test diagnostic upgrade: when the run barely moves we also dump 32
bytes of the current memory at A0/A1 (using the libretro core's
jagMemSpace[] symbol so cart space is visible), so the wait loop's
read target shows up alongside the PC bytes.
Result: 4 PASS / 5 FAIL. Hover Strike no longer crashes (now a
wait-loop FAIL); other failures unchanged for now.
Made-with: Cursor1 parent 6e423f0 commit 8c3a1f9
2 files changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
222 | 241 | | |
223 | 242 | | |
224 | 243 | | |
| |||
438 | 457 | | |
439 | 458 | | |
440 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
441 | 473 | | |
442 | 474 | | |
443 | 475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
254 | 282 | | |
255 | 283 | | |
256 | 284 | | |
| |||
0 commit comments