My post is from an NES programmer's point of view, not an emulator programmer's point of view. I am aware of these closed-source test cases. But I'm looking for something with available source code so that I can see the right sequence of reads and writes to get the IRQ 1. properly enabled and then 2. properly acknowledged. What I have so far fails differently in FCE Ultra (the emulator on an Ubuntu PC with CA65 installed), Nintendulator (the emulator on the other PC that runs Windows), and my PowerPak, making it an absolute pain to debug. Should I post my non-working source code and then have the rest of you pick it apart to see why it doesn't work?
Right now, I'm puzzling through
the sawtooth demo.
I guess my questions are as follows: How do I know my IRQ handler is getting called? And after that, how do I know that the main thread of execution is resuming, as opposed to the IRQ handler just getting called again immediately after the RTI instruction at its end?
EDIT: I got it to work, mostly. It still fails when I press the NES's reset button, but it works when I hold the NES's reset button to go back to the PowerPak main menu.