This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Having it so a fragment of the BG scrolls...

Having it so a fragment of the BG scrolls...
by on (#38940)
Ok. I have implemented save rooms and such, and I wanted to have it so part of the BG would scroll aside and have a box come in that says "Saved" or whatnot. This would avoid having to write the necessary BG tiles to memory backups.

So, how would I go about having maybe a 32 pixel tall area scroll entirely off screen so part of $2400 is visible on-screen?

by on (#38941)
Is it fine if the 32-pixel-tall window is as wide as the screen? Because if so, you can use a scroll split, which involves sprite 0 and timed code that writes to the scrolling registers.

by on (#38943)
tepples wrote:
Is it fine if the 32-pixel-tall window is as wide as the screen? Because if so, you can use a scroll split, which involves sprite 0 and timed code that writes to the scrolling registers.


Yeah, basically I want this particular box to be 256 pixels wide, so basically you've got a black rectangle on-screen for a moment saying "Game saved" or some message.

by on (#38955)
Yeah, basically what Tepples said. You'd probably want to set the proper scroll to show the right (side) name table starting at the beginning of the frame, and set a tile below where you want the status bar to end that will trigger the hit. You know, then put a sprite there to do the sprite #0 hit. I'm not sure if you know how to do this, but all you have to do is read bit 6 of $2002 and wait for it to be set. Once it's set, set the scroll back to show the left name table.

by on (#38964)
Quote:
Yeah, basically I want this particular box to be 256 pixels wide, so basically you've got a black rectangle on-screen for a moment saying "Game saved" or some message.

I don't know if which direction your game scrolls or how you handle the scrolling, but you'll have to write to $2005, and possibly to $2006 to get that effect.
Horizontal scrolling can be changed any time via $2000.0 and $2005. For vertical scrolling, you have to write the adress of the tile you want to point to $2006 (two writes involved). Since this only allows coarse scrolling, you can use the highest 2 bits of adress for fine scrolling (it doesn't select from pattern tables to nametable any more).