If only 1 write to $2006, what address to use for $2007 ?

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
User avatar
Posts: 311
Joined: Mon Dec 22, 2008 10:45 pm
Location: Argentina

If only 1 write to $2006, what address to use for $2007 ?

Post by Petruza » Sat May 29, 2010 11:46 pm

If only one write was made to $2006, thus specifying only its high byte, what address should be used when reading or writing to $2007?

1) The address low byte should be 0
2a) The address low byte should be all screwed up from last render which used it for internal tasks
2b) The address low byte remains the same as the last time it was set by a second write to $2006 (provided no render happened in between)

In the same sense, what vertical scrolling should be used if only one write was issued to $2005 and the time comes to begin (or continue) rendering?

User avatar
Posts: 4352
Joined: Fri Nov 19, 2004 7:35 pm

Post by Dwedit » Sun May 30, 2010 12:06 am

If you only do the first write to 2006, the "PPU address" V won't change. Some bits of T will change, that affects scrolling. The V=T still happens at 304 of the prerender scanline if rendering is enabled.

Two bits of Fine Y scroll are changed, top bit of Fine Y scroll is cleared, Top two bits of Coarse Y scroll are changed, Y nametable selection is changed, X nametable selection is changed.

If you just do the first write to 2006 while rendering, the only change you'll actually see is the X nametable selection change, as if you had written to 2000. Then the other bits will be affected on the next frame by the V=T

So the address for 2007 writes won't change at all until 304 of the prerender scanline if you just do one write to 2006.

Read the loopy document.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
Posts: 7951
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Sun May 30, 2010 1:53 am

I think the first write will have absolutely no effect before the second write. I might be wrong tough. Anyway you shouldn't rely on this when coding a game, and should always write pair of bytes to $2006.
Useless, lumbering half-wits don't scare us.

Post Reply