4-screen VRAM and mappers

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
ajb
Posts: 3
Joined: Thu Apr 08, 2021 12:37 pm

4-screen VRAM and mappers

Post by ajb » Thu Apr 08, 2021 12:51 pm

Heya, new to NES dev, but not coding. Been hacking a few days, working through examples from 8bitworkshop and NESDoug. Love the forum here!

Looking to get deeper into background scrolling and read lots here on techniques. Playing with it a bit, 4-screen VRAM seems way easier than dealing with nametable mirroring.

My question is on hardware compatibility. If I just set NES_MIRRORING to 8 in an nrom cfg, Mesen will give me four screen VRAM, but I guess that might break on other emulators?
And I guess even on flash carts (getting an N8 Pro), mappers are emulated? So it may or may not work there?

IIUC, MMC3 is the only mapper that supports 4-screen? So should I use MMC3? Is the the only option if I want to work on HW? And eventually make a physical cart?

Thanks in advance.

lidnariq
Posts: 10435
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: 4-screen VRAM and mappers

Post by lidnariq » Thu Apr 08, 2021 1:36 pm

There are rather few mappers that explicitly can provide 4 nametables:

NES-commerical era:
mapper 4/206 = MMC3 or its simpler predecessor Namco 108
mapper 77
Games released for the "Vs System" arcade cabinets (and not at home)
Modern homebrew era:
mapper 30 = UNROM512 (INL 4sc variant)
mapper 111 = GTROM

In practice, the cost of an additional memory chip was very rarely economically excusable, mostly restricted to games released in the Chinese market that therefore needed RAM to display the text for the game.

Plenty of emulators don't gracefully handle other mappers being declared with 4 nametables, for example initially working and then irrevocably throwing away the other nametables. And there's historical precedent for emulators parsing the flag to mean "alternative" nametable arrangements, such as lumping mappers that differ only in whether they have the ability to change nametables at runtime or are fixed layout.

So ... for an "authentic" (scare quotes) NESdev experience, part of the challenge is making things work with just the 2 nametables that the NES provides for you already.

If you want a physical release, you really should stick with one of the five mappers above, or figure out how to work with just 2 nametables.

ajb
Posts: 3
Joined: Thu Apr 08, 2021 12:37 pm

Re: 4-screen VRAM and mappers

Post by ajb » Thu Apr 08, 2021 8:36 pm

Gotcha.
Thank you!

ajb
Posts: 3
Joined: Thu Apr 08, 2021 12:37 pm

Re: 4-screen VRAM and mappers

Post by ajb » Sat Apr 10, 2021 10:42 pm

Ok, got it working relatively easily, thanks to nesdoug's MMC3 code. (rom attached; dpad for action)

Well, except for one bit: on Mesen it works perfectly, but on hardware, there's a few blocks where it looks like the palette is different. I clear all 4 attribute tables at startup, so I imagine it has to be a stray write later.

Oh, my hardware is a N8 Pro & Nt Mini Noir - don't know if that's relevant.

Would love some hints on how to debug this.
Attachments
test_mmc3_scroll4_update2.zip
(7.59 KiB) Downloaded 12 times

Post Reply