Default Nametable Mirroring?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Default Nametable Mirroring?
by on (#92809)
Did a quick search and couldn't find the answer, so I'm sorry if this has been asked before (and it probably has).

If the map controller doesn't specify a mirroring mode, what does the NES default to? I have it in my emulator as defaulting to horizontal, but not sure if that's accurate.

Yes, this is kind of pointless since the INES header specifies a mirroring to use for every game, I was just curious what the answer was. :)

by on (#92812)
Mirroring control is not done in the NES, but on the cartridge ! There is no default. The mirroring was usually controlled by electric contacts, and latter, by mappers.

Electric contacs has no default values obviously.

The mappers do it on a multiplexer selecting A10 or A11 to send to the CIRAM A10 line, somewhat "to simulate an electric contact that can be reprogrammed at runtime."

The command of the multiplexer will be based on an internal flip-flop, and flip-flops are typically uninitialized, they can be either value at power up.
This also applies to PRG and CHR banks switched at power on, to RAM, VRAM, etc....

If you absolutely want an answer, I'd tell the FDS BIOS default to horizontal mirroring - probably for the simple reason it's what it uses for the copyright scrolltext before booting games.

by on (#92814)
Thanks Bregalad!

I was assuming it would be Horizontal, or NTA for both tables. But what I get from your answer is that it's unpredictable? I suppose I'll stick with my "default to horizontal" behavior :)

by on (#92815)
Yes, on mappers that can control the mirroring it's unpredictable.
One cart could default to vertical while another could default to horizontal, just like one chip can default a memory bit to '1' while another chip can default to '0'.

Almost all emulators in existance, including the so-called accurate ones like Nestopia and Nintendulator, default all RAM and VRAM to 0x00, and probably initialize mappers regs as well, but this is not what happens on real hardware.

by on (#92827)
I'm tempted to say to default to whatever the mirroring bit in the iNES header is, except for mappers that actually initialize their mirroring to something.

by on (#92828)
In games with mapper-controlled mirroring, the default setting will actually depend on the mapper. I imagine that most of the time it's unpredictable though, as I doubt mappers would bother with initializing the mirroring (i.e. why waste hardware resources with something the software will have to initialize anyway?).

This is the kind of things that games just have to initialize before using, and any program that relies on default values is flawed.

by on (#92830)
More often than not registers are initialized to 0 (yes in hardware) if anything, which more often than not means vertical mirroring/horizontal scrolling. Also there are more games out there using vertical mirroring, plus logically it's the "default" mirroring because it means VRAM A10 is connected to PPU A10 instead of A11.