thefox wrote:In PPU-timing-dependent tests like this, it would be nice to have a piece of code which detects the CPU-PPU synchronization and prints it somewhere.
(I don't know if anybody has implemented a routine like that, blargg may have. Would be nice to have for various test authors, though.)
Blargg does have some code syncs the cpu with the ppu. It has too many macros and files for me to read, but maybe it can simply be used as is somehow.
@fred: You should clear the nametable in your test, otherwise you may get random garbage on screen (also, attributes will be ~random).
Ok, will do.
Edit: Think i made some progress. Borrowed the nmi sync loop from blargg and tinkered some with it. Currently the 2006 write instruction starts at either dot 250 or 252, alternating between the two. I'll see if I can easily adjust it tomorrow.
Edit2: The variance is down to 1 dot. Pretty good! Let's see what's next...
Edit3: It's now possible to toggle scanlines and dots for precise writes. Here's a cheat sheet for what cycles sta $2006 starts on in nintendulator.
Code: Select all
y,x
dot,dot+1
y= toggle scanline (up/down)
x= toggle dot*3 (left/right)
0,0 0,1 0,2
240,241 243,244 246,247
1,0 1,1 1,2
241,242 244,245 247,248
2,0 2,1 2,2
242,243 245,246 248,249
I guess there's still some things to do, like setting up a known start point. Right now it just wings it and works in nintendulator, unsure if alignment makes a difference.
Also the graphics output, which was already cryptic, makes no sense right now since it doesn't take changing scanlines into account.