Turns out it was my old test that was flawed with line 240/241. It actually is line 240 (via 0-240), not line 241.
The correct line (counting from 0 and up) is line 240 ($f0).
Sorry for the mis-information, I failed to catch it because I didn't understand the differing dot lengths that I describe below.
I also verified the longer dots, and what happens on scanline 240, during interlace and non-interlace.
First off, I realized that we were both wrong about which dots have 6 master cycles. The correct dots are 322 and 326, sort of.
It's really hard to explain, so take a look at the following table:
Code: Select all
Legend: { nop count, lda $00 count, lda $2100 count, lda $0000 count, frame count, I/NI (interlace status) } = { x result (what it should be if all cycles were 4 dots, not what it really returns), y result } = cycles (actual returned dot position (real x result))
{ 0, 0, 22, 10, 0, NI } = { 321, 0 } = 980 (321)
{ 0, 0, 21, 11, 0, NI } = { 321, 0 } = 982 (321)
{ 0, 0, 20, 12, 0, NI } = { 322, 0 } = 984 (322/321) --\
{ 0, 0, 19, 13, 0, NI } = { 322, 0 } = 986 (322) |
{ 0, 0, 18, 14, 0, NI } = { 323, 0 } = 988 (322/323) --/
{ 0, 0, 17, 15, 0, NI } = { 323, 0 } = 990 (323)
{ 0, 0, 16, 16, 0, NI } = { 324, 0 } = 992 (323)
{ 0, 0, 15, 17, 0, NI } = { 324, 0 } = 994 (324)
{ 0, 0, 14, 18, 0, NI } = { 325, 0 } = 996 (324)
{ 0, 0, 13, 19, 0, NI } = { 325, 0 } = 998 (325)
{ 0, 0, 12, 20, 0, NI } = { 326, 0 } = 1000 (325)
{ 0, 0, 11, 21, 0, NI } = { 326, 0 } = 1002 (326/325) --\
{ 0, 0, 10, 22, 0, NI } = { 327, 0 } = 1004 (326) |
{ 0, 0, 9, 23, 0, NI } = { 327, 0 } = 1006 (326/327) --/
{ 0, 0, 8, 24, 0, NI } = { 328, 0 } = 1008 (327)
{ 0, 0, 7, 25, 0, NI } = { 328, 0 } = 1010 (327)
As you can see, dots 321-323 can have anywhere from 4-6 cycles each. Only one of them actually get 6 cycles per scanline, the other two get 4. Which one is actually 6 cycles changes all the time. Try { 0, 0, 20, 12, 0, NI } on my test program and just keep hitting reset, the x result will keep changing between 321 and 322. I say that 322 is the long dot only because it's in the middle. There does not seem to be one dot that gets hit more than the other two, nor is there any discernable pattern about which will be hit. It could just alternate between the three every frame, and this counter may not be reset when the SNES is reset (like the latch counters and frame counter (frame number) are). My test program lacks the ability to determine this. Care to come up with a better one?
Dots 325-327 act the same as 321-323.
This happens exactly the same in interlace and non-interlace mode.
This does not happen on odd frame/scanline 240 in non-interlace mode. All dots are 4 cycles long, and the highest latchable value is 339. The entire scanline is 1360(-40 DRAM refresh) cycles long. You were correct in your assumptions of this line, anomie.
The longer dots do occur in interlace mode line 240 odd frames.
DRAM refresh: Your notes were confirmed. Every other scanline the SNES alternates between starting DRAM refresh at cycle 534 and 538.
Code: Select all
non-interlace/even frame/scanline 0:
(1324*0)+532=532-264=268
(2*14) + (8*30) = 268
{ 2, 0, 8, 0, 0, NI } = { 133, 0 } = 532
{ 2, 0, 7, 1, 0, NI } = { 143, 0 } = 534
non-interlace/even frame/scanline 1:
(1324*1)+532=1856-264=1592
(20*30) + (31*32) = 1592
{ 0, 0, 20, 31, 0, NI } = { 133, 1 } = 532
{ 0, 0, 19, 32, 0, NI } = { 133, 1 } = 534
{ 0, 0, 18, 33, 0, NI } = { 134, 1 } = 536
{ 0, 0, 17, 34, 0, NI } = { 144, 1 } = 538
http://setsuna.the2d.com/files/dot_and_dram_timing.txt