Hey
I've been reading up on this stuff a number of times but gave up halfway through it every time. I think this time I'm pretty close to getting the general idea. Right now, I'm trying to crack how scrolling works, but there's so many questions popping up in my head.
As I've understood it, the NES can only hold 2 full screens of background simultaneously. These are "mirrored", depending on how you set the A10 and A11 "registers" of the PPU. 5 bits somewhere are used to tell it how many tiles you want to scroll to the right. If these 5 bits are all 0 then the first background fills the whole screen. If they are all 1, you are scrolled 31 tiles to the right, and the second background fills the whole screen, minus 8 pixels which you will also have to scroll using some other bits somewhere, but you can get only 7 of those, since they're set using 3 bits. So you can scroll only 255 pixels to the right. Please correct me if any of this is not correct.
1. Assuming it is correct, and I want to make a game that scrolls from left to right, and I'm scrolled 255 pixels to the right, then what? Do I load the second nametable into $2000 (where the first one used to be), reset the tile and pixel scrolls to 0 and load a new nametable into $2X00 (where the second nametable used to be, not sure if it's 2C00 or 2800 in this case)?
2. Can I do this the other way around to scroll from right to left, loading nametable 2 into $2X00, nametable 1 back into $2000, and maxing out the scroll to 255 pixels (31*8 + 7)? Or is there some reason why this wouldn't work without some mapper? Were Nintendo just lazy when they didn't make SMB scroll both ways, or is there a hardware limitation that makes this impossible?
3. What happens if I change the vertical scrolling in this situation? How are the nametables "mirrored"? If I scroll 30 tiles "down", do I get the same thing but upside down, or not upside down?
4. Can scrolling directions be changed mid-game? I understand mappers are necessary for diagonal scrolling, but what about doing it horizontally some of the time and vertically some of the time?
Thanks for any help. I'm sure this information is already available somewhere, but it feels like so many of these docs keep repeating the same info without ever getting to the stuff I need.
I've been reading up on this stuff a number of times but gave up halfway through it every time. I think this time I'm pretty close to getting the general idea. Right now, I'm trying to crack how scrolling works, but there's so many questions popping up in my head.
As I've understood it, the NES can only hold 2 full screens of background simultaneously. These are "mirrored", depending on how you set the A10 and A11 "registers" of the PPU. 5 bits somewhere are used to tell it how many tiles you want to scroll to the right. If these 5 bits are all 0 then the first background fills the whole screen. If they are all 1, you are scrolled 31 tiles to the right, and the second background fills the whole screen, minus 8 pixels which you will also have to scroll using some other bits somewhere, but you can get only 7 of those, since they're set using 3 bits. So you can scroll only 255 pixels to the right. Please correct me if any of this is not correct.
1. Assuming it is correct, and I want to make a game that scrolls from left to right, and I'm scrolled 255 pixels to the right, then what? Do I load the second nametable into $2000 (where the first one used to be), reset the tile and pixel scrolls to 0 and load a new nametable into $2X00 (where the second nametable used to be, not sure if it's 2C00 or 2800 in this case)?
2. Can I do this the other way around to scroll from right to left, loading nametable 2 into $2X00, nametable 1 back into $2000, and maxing out the scroll to 255 pixels (31*8 + 7)? Or is there some reason why this wouldn't work without some mapper? Were Nintendo just lazy when they didn't make SMB scroll both ways, or is there a hardware limitation that makes this impossible?
3. What happens if I change the vertical scrolling in this situation? How are the nametables "mirrored"? If I scroll 30 tiles "down", do I get the same thing but upside down, or not upside down?
4. Can scrolling directions be changed mid-game? I understand mappers are necessary for diagonal scrolling, but what about doing it horizontally some of the time and vertically some of the time?
Thanks for any help. I'm sure this information is already available somewhere, but it feels like so many of these docs keep repeating the same info without ever getting to the stuff I need.