Why different split delay when no second background loaded?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
basiktyler
Posts: 1
Joined: Fri Apr 21, 2017 3:02 am

Why different split delay when no second background loaded?

Post by basiktyler »

Hello, this ain't so newbie of a question, but I am.
Anyway, I was working on a game three weeks ago and something bugged me.
I had split the screen after 64 scanlines when sprite0 hit. At the split I enable scrolling, wait 64 more scanlines, and there I have the screen scrolling the opposite way by decrimenting xscroll. That lasts 64 more scanlines, then I turn off scoll for the rest of the screen. But the weird thing was that the wait amount for the first and the second scrolling area was not the same. And when I added the second nametable of background graphics, then the two wait times were the same.
So I guess if the second table is empy, somehow the ppu takes less time to get down?
I can post the source if this is confusing. I suspect it's well known, like for title screens that scroll on from both sides, maybe. Not using scanline irq counters.
No excuse for not searching this one. I'm sorry.
Tyler
User avatar
Nioreh
Posts: 115
Joined: Sun Jan 22, 2012 11:46 am
Location: Stockholm, Sweden

Re: Why different split delay when no second background load

Post by Nioreh »

How did you wait 64 scanlines after the sprite-0 hit?

The PPU always takes the same amount of time, otherwise it would not be able to keep up and create a valid video signal.
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Why different split delay when no second background load

Post by Quietust »

Make sure the loops in your 64-scanline delay code are not crossing a page boundary.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Why different split delay when no second background load

Post by dougeff »

I agree with Quietust.

Probably, the one version of code aligned so it had no page-crossings and the second version, managed to have a page-crossing, thus making it take just a little bit more, and screwing up your timing.

Branching and addressing with X or Y take just a little longer if they cross past the low byte, and the upper byte needs to be increased.

2fe 2ff (boundary) 300 301
nesdoug.com -- blog/tutorial on programming for the NES
Post Reply