Commit f88a393
committed
fix: real-BIOS CD boot — trampoline, buffer, static reset
Three fixes that take real-BIOS CD boot from 0/9 to 5/9 passing:
1. Boot stub trampoline ($080000): The BIOS always does JSR $080000
after authentication, but most games' boot stubs load at $004000,
$006000, or $124000. When the load address differs from $080000,
install a JMP trampoline at $080000 pointing to the actual address.
2. Boot stub buffer (256KB -> 600KB): Battle Morph's boot stub is
414KB — exceeds the old 256KB buffer. Matches the HLE path's 600KB.
3. Static flag reset: cdAuthBypassInstalled and cdBootStubInjected
are now module-level statics reset in JaguarReset() via
JaguarResetCDHooks(), preventing stale state across core reloads.
Also adds frozen-OOB diagnostic snapshots to test_cd_bios_boot.c:
captures registers, prev-PC bytes, stack, A0/A1 memory at the exact
moment the PC first leaves valid memory, before OP/blitter can corrupt
the post-mortem evidence.
Real-BIOS baseline (600 frames, 9 CUE discs):
PASS: BrainDead 13, Dragon's Lair, Highlander, Hover Strike, Space Ace
FAIL: Baldies (BIOS init OOB), Battle Morph (BIOS init OOB),
Iron Soldier 2 (self-loop $006AC0),
Primal Rage (self-loop at CD_read $003616)
Made-with: Cursor1 parent 1271317 commit f88a393
2 files changed
Lines changed: 122 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
171 | 180 | | |
172 | 181 | | |
173 | | - | |
174 | 182 | | |
175 | | - | |
| 183 | + | |
176 | 184 | | |
177 | 185 | | |
178 | 186 | | |
| |||
182 | 190 | | |
183 | 191 | | |
184 | 192 | | |
185 | | - | |
| 193 | + | |
186 | 194 | | |
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
191 | | - | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
542 | 550 | | |
543 | 551 | | |
544 | 552 | | |
545 | | - | |
546 | | - | |
| 553 | + | |
547 | 554 | | |
548 | | - | |
| 555 | + | |
549 | 556 | | |
550 | | - | |
| 557 | + | |
551 | 558 | | |
552 | 559 | | |
553 | 560 | | |
554 | 561 | | |
555 | 562 | | |
556 | 563 | | |
557 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
558 | 589 | | |
559 | 590 | | |
560 | 591 | | |
| |||
1058 | 1089 | | |
1059 | 1090 | | |
1060 | 1091 | | |
1061 | | - | |
1062 | | - | |
| 1092 | + | |
| 1093 | + | |
1063 | 1094 | | |
1064 | 1095 | | |
1065 | 1096 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
| |||
168 | 182 | | |
169 | 183 | | |
170 | 184 | | |
| 185 | + | |
171 | 186 | | |
172 | 187 | | |
173 | 188 | | |
| |||
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
184 | 237 | | |
185 | 238 | | |
186 | 239 | | |
187 | 240 | | |
| 241 | + | |
188 | 242 | | |
189 | 243 | | |
190 | 244 | | |
| |||
383 | 437 | | |
384 | 438 | | |
385 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
386 | 467 | | |
387 | 468 | | |
388 | 469 | | |
| |||
0 commit comments