Hmmm... my SNES gives dot 327 here, not dot 326. What are your 5c77 and 5c78 version numbers?
Wow, my test ROM does? Interesting...
I have a first-generation style Japanese SNES. I'll read the chip versions later on tonight.
I guess this really doesn't matter too much, huh? Although checking for this would make a great regional lockout, I'm completely certain that emulating the correct dot based on system isn't neccesary.
For the record, though. What versions are your 5c77/5c78? Which region/style SNES?
I'll probably add a toggle, like with $21c2/$21c3. By the way, I tried the SNES Test Program on my copier, and it loops on initializing the scroll registers on that one tests forever there, too. So that's another SNES-model specific difference.
I'm starting to doubt my old assertion that the WRAM refresh waits until the current instruction completes. Would it give the same results to make it pause hard at cycle 536? Hrm... a test: do LDA $37 (with D=2100) and LDA $002137 both have a last-value of 534? Or does one have 526 and the other 542?
Hmm, you're right. My test wouldn't really assert that sort of thing. Let me play around with the other three opcodes on my test program and see what all I can latch.
I seem to have forgotten this...
For NTSC, it is (315/88)*6mhz. With that speed, you end up with ~60.1fps for non-interlace, and ~50.98fps for interlace.
Formula for non-interlace: (((315/88)*6*1000000)/(1364*262+1364*261+1360))*2 = ~60.0988fps
Formula for interlace: (((315/88)*6*1000000)/(1364*525))*2 = ~59.98fps
This means the clock rate is six times the NTSC color subcarrier. I believe this is the case because having an even multiple of the color subcarrier would allow the SNES to better sync with an NTSC TV. Also, the clock chips are probably extremely common in multiples of NTSC, due to how popular televions are. So I wouldn't put this past a cost savings thing for Nintendo.
Keeping in mind that's the refresh rate for each individual frame. There would only be ~29.9920 full frames per second in interlace-mode.
These match the timing results you got yesterday.
Results: Non-interlace mode takes ~2129.981788 seconds to run 128000 frames. Interlace takes ~2133.850515. That's ~60.09 and ~59.98 fps.
Neither speeds match NTSC interlace mode, so the only thing we have to be careful of is if the APU ever gets out of sync with the CPU (e.g. there's a pause) between the end of one frame and the start of the next, or the same with scanlines. This seems unlikely, and I honestly suspect the SNES refresh rate is just slightly higher than NTSC, and TVs still work ok with it. But do we have proof either way, yet?
---
The next thing I would like to take care of is initial latch values, if possible. On my emulator, I always seem to end up latching a value that is ~8 dots higher than a real SNES, when I latch with:
- lda $4212 : bpl - : -lda $4212 : bmi - : lda $2137
This little anomaly makes direct cycle-to-cycle count comparison tests in my emulator vs. the snes impossible. Since the value is a constant every reset, it should be possible to end up with the same start position in emulators.