Because of this, I assume my PPU/CPU are in good working order and everything is synched up. Battletoads and every other "hard to emulate" game seems to be working fine also, which leads me to...
I am having issues with The Fantastic Adventures of Dizzy, during the "unrolling scroll" part in the very beginning. I have isolated the code which is causing the commotion, and it is this:
Code: Select all
200AE: A2 E0 LDX #$E0
200B0: 8E 01 20 STX $2001
200B3: 8C 06 20 STY $2006
200B6: 8D 06 20 STA $2006
200B9: A9 F8 LDA #$F8
200BB: 8D 01 20 STA $2001
So, question #1 is... do we really know what happens when the PPU's render flags are turned off mid-scanline? On the console, I just stop what I'm doing and enter an idle loop on the state machine, and when it's re-enabled, it picks back up where it was, which can cause issues with corrupted graphics and such. This probably isn't right, but I'm not sure about what a real PPU does.
There's a couple options I can think of.
1) it does what I do, that is, when rendering is disabled, the state machine just drops like a rock and halts wherever it was.
2) It only lets rendering halt/start every 2 pixels (or 1 memory fetch)
3) It only lets rendering halt/start every 8 pixels (or 4 memory fetches)
4) something else entirely
For information purposes, I hooked the red colour emphasis bit up to the "render enable" flag on my PPU which turns the bit on when both rendering flags are turned off. I noticed that codemaster's code isn't 100% cycle timed apparently. The red emphasis line creeps left on susccessive scanlines until it's touching the rendered pixels. Not surprisingly, it's a bit more "Tear-ey" at the bottom.
--------
And on a related note, this brings me to the game Final Lap. If you run this on nintendulator, it has the same tearing problem that I have exactly. The first player's display area is fine, while the second player's is not. There's some tearing every 2-4 scanlines or so. This game works by altering 2006 every scanline to shift the "road" around.
So, question #2 is... is there some kind of unresolved timing issues that we haven't thoroughly inspected on a real PPU?
I'm stumped on both of these problems at the moment, and I don't have alot to go on.