Hi, so far I've understood this:
Vertical mirroring means both bottom nametables are a copy ( mirror ) of the top nametables, where you write to, and you can scroll between them horizontally.
Horizontal mirroring is the opposite.
And third, you can have 2way scrolling which has no mirroring, and you can write to the 4 nametables.
Is this right?
Why is mirroring so important?
Trying to understand nametable mirroring
Moderator: Moderators
Re: Trying to understand nametable mirroring
Yes, except what you call "2way scrolling" is called "four-screen".Petruza wrote:Vertical mirroring means [something]
Horizontal mirroring is the opposite.
And third, you can have 2way scrolling which has no mirroring, and you can write to the 4 nametables.
Is this right?
The NES had only enough VRAM for two nametables. Four-screen wasn't used often because it needed a couple more chips on the cartridge board, and those chips made Game Paks more costly to replicate.Why is mirroring so important?
Re: Trying to understand nametable mirroring
As far as the PPU is concerned, there are always 4 name tables, arranged in a 2x2 grid. However, there are only 2KB of actual memory for them, enough for only 2 name tables, so the PPU sees the same 2KB twice.Petruza wrote:Why is mirroring so important?
Depending on how the address lines are wired, the 2 unique name tables can be arranged vertically or horizontally. Earlier carts have that setting hardwired, and programmers selected the type of mirroring that was more suited to the kind of game they were making. Newer boards have mappers capable of changing that selection on the fly.
From a programming point of view, mirroring is important because it has a great impact on how the name tables must be updated during scrolling animations. Mirroring is only important in programs that scroll: horizontal scrollers benefit from a wide drawing area, so vertical mirroring is used, while vertical scrollers benefit from a tall drawing area and horizontal mirroring.
When both types of scrolling are used in the same program, one of them will cause visible glitches, unless tricks are done to hide them. Another option to hide such glitches is including an extra 2KB of RAM in the cart for 2 more name tables, which allows for 4 name tables and eliminates mirroring altogether. Very few games had that, and most games that scroll in both directions have visible glitches at the edges of the screen.
Thanks, it's like I suspected, my doubt was about why was mirroring mentioned instead of scrolling, that made me think mirroring was in itself important.
Everywhere "vertical mirroring" is metioned, what really matters, from the point of view of the programmer, is "horizontal scrolling", I realize that there's mirroring because there aren't 4 physical unique addresable memory areas available, the fact that the two bottom nametables are mirrors of the other two, is irrelevant, they could be unaccessable, or be always $FF or whatever.
But because everyone mentioned the mirroring instead of the scrolling, I thought mirroring was in some way used for something.[/quote]
Everywhere "vertical mirroring" is metioned, what really matters, from the point of view of the programmer, is "horizontal scrolling", I realize that there's mirroring because there aren't 4 physical unique addresable memory areas available, the fact that the two bottom nametables are mirrors of the other two, is irrelevant, they could be unaccessable, or be always $FF or whatever.
But because everyone mentioned the mirroring instead of the scrolling, I thought mirroring was in some way used for something.[/quote]
The iNES spec calls it "vertical mirroring", and I guess emulators just follow that. But most of Nintendo's discrete boards (NROM, C*ROM, U*ROM, B*ROM) have "H" and "V" solder pads for horizontal arrangement and vertical arrangement of the nametables, which is opposite the convention that the iNES spec uses.
As for calling horizontal arrangement "horizontal scrolling", the scrolling direction is independent of the nametable. Super Mario Bros. 3 uses vertical arrangement (horizontal mirroring) in the vast majority of levels, but you don't see any vertical scrolling at all in 1-2, or in 1-1 until Mario gets the tail.
As for calling horizontal arrangement "horizontal scrolling", the scrolling direction is independent of the nametable. Super Mario Bros. 3 uses vertical arrangement (horizontal mirroring) in the vast majority of levels, but you don't see any vertical scrolling at all in 1-2, or in 1-1 until Mario gets the tail.
...as well as vertical! Since the game has two types of scrolling, and only one type of mirroring can be used at a time, one type of scrolling is gonna take the hit. Some programmers prefer to introduce vertical glitches, others horizontal. In SMB3, notice how the left 8 pixels of the screen are masked (to hide glitches) and the left actually shows color glitches as the screen scrolls. Like you said, the screen on the right is a mirror of the one on the left, so as soon as tiles scroll out from the left, they are introduced on the right. The glitches exist because the attributes must be changed in front of the player's eyes. The 8 pixel mask can hide tile glitches though, as tiles are 8 pixels wide.Petruza wrote:But it does horizontal scrolling ( obviously )...
In fact, as tepples said, the mirroring doesn't dictate the type of scrolling used. Mirroring is just something the programmer has to take into consideration when designing the scrolling engine, but any type of mirroring can be used for any type of scrolling, even if there are a few glitches visible as a result.
With vertical mirroring, a horizontal (only horizontal!) scroller can be programmed without any visible glitches. But if for any reason the programmer wants to use the second name table for something else, say, a status screen or something else he doesn't want to be overwritten by the scrolling, he might very well use horizontal mirroring and use only 1 name table for the actual game, which will introduce glitches at the left and right of the screen (unless tricks are done to hide them).
So, "horizontal scrolling" is not interchangeable with "vertical mirroring", even though this is true in many cases. I do think that it would make much more sense if we used Nintendo's terminology though, since many people get confused because the H and V on the boards do not match our mirroring terminology. We'd have to stop using the word "mirroring" and start calling it "arrangement", like tepples did.