Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

GB: counter interrupt pushes off OAM Stat interrupt far enough to crash Pinball Deluxe (EU) #165

Open
redacted173 opened this issue Aug 2, 2020 · 0 comments

Comments

@redacted173
Copy link

Pinball Deluxe (EU) and Pinball Fantasies (US, EU) are really timing sensitive and use the counter interrupt, OAM Stat interrupt, and LYC Stat interrupt along with the V-Blank interrupt. The counter interrupt, $50, can occur early in a scan line which pushes off the OAM Stat interrupt. The OAM Stat interrupt, $48, polls on the Stat mode for display (non H-Blank) but, in the case of Pinball Deluxe (EU), can miss it and spill into the next scanline. This leads into a delay of Stat interrupts which eventually results in the stack over flowing and the game crashing. Looks like delaying H-Blank by a few (4?) dot clocks may fix the problem so the LDH sees the right Stat mode. It's not clear what the correct solution is, though.

Pinball Fantasies seems to catch the mode in time. Not sure what is different with Pinball Deluxe.

The following breakpoint can help find the problem before the crash:
Break on: Execution
Address: $48
Condition: Cycle > 128 && Scanline < 144 && SP < $DFF0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant