What happens to the 4 cpu cycles between line 239 and 240

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
What happens to the 4 cpu cycles between line 239 and 240
by on (#94399)
I was trying to get Antarctic Adventure to run on my emulator and comparing a log from Nintendulator with mine when I noticed 4 cycles were skipped between line 239 and 240:

Code:
F829  E6 81     INC $81 = 21                    A:00 X:00 Y:03 P:27 SP:F9 CYC:324 SL:239
F82B  88        DEY                             A:00 X:00 Y:03 P:25 SP:F9 CYC:339 SL:239
F82C  D0 F8     BNE $F826                       A:00 X:00 Y:02 P:25 SP:F9 CYC:  4 SL:240
F826  20 31 F8  JSR $F831                       A:00 X:00 Y:02 P:25 SP:F9 CYC: 13 SL:240


So what happened? Thanks.

by on (#94402)
I don't see any missing cycles.

After X=324, INC dd takes 5 cycles, which advances 5*3=15 dots to X=339.
After X=339, DEY takes 2 cycles, which advances 2*3=6 dots to X=345, but because the scanline is 341 dots long, X=345-341=4 and Y increases to 240.
After X=4, BNE taken takes 3 cycles, which advances 3*3=9 dots to X=13.
After X=13, JSR aaaa takes 6 cycles, which advances 3*3=18 dots to X=31.

The only "missing cycle" is the last dot of line -1, removed every other field if rendering is turned on.

by on (#94405)
Oh yes you are right! How can I miss that? Now I can finally match the cycle number column in the log. Thank you very much.