What are ROM Nametables useful for?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
scrimpeh
Posts: 11
Joined: Tue Aug 02, 2011 3:11 am

What are ROM Nametables useful for?

Post by scrimpeh »

This is something I've been wondering about for a while and can't find an answer for.

Certain mappers like 19, 24 and 209 can map CHR ROM into Nametable RAM, but I never understood why this feature exists. The only reason I can think of would be to quickly show static screens, but that doesn't seem worth the extra hardware when you can easily write the nametable yourself.

What's a good use for it. Anyone have an idea?
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What are ROM Nametables useful for?

Post by NewRisingSun »

It's used by games with a 3-D perspective such as Final Lap and After Burner II.
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: What are ROM Nametables useful for?

Post by Quietust »

scrimpeh wrote: Tue Nov 24, 2020 2:37 pm This is something I've been wondering about for a while and can't find an answer for.

Certain mappers like 19, 24 and 209 can map CHR ROM into Nametable RAM, but I never understood why this feature exists. The only reason I can think of would be to quickly show static screens, but that doesn't seem worth the extra hardware when you can easily write the nametable yourself.

What's a good use for it. Anyone have an idea?
If you want to display a full-screen animation that's reasonably short (e.g. less than a dozen or so frames), then ROM nametables will allow you to run that animation as fast as you want - if your nametables were located in RAM, then you'd be limited to around 10-12 frames per second on NTSC because there's only enough video bandwidth to update about 150-200 bytes in a single VBLANK period (and a single nametable is 1024 bytes).
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: What are ROM Nametables useful for?

Post by aquasnake »

The significance of mapping ntrom to ciram is that it can display graphics quickly without waiting to write to ciram

After all, the hardware remapping is much faster than the software operation of $2006-$2007 loops.

This technique is usually in junction with switching the 8K pattern of CROM to improve the display frame rate
User avatar
scrimpeh
Posts: 11
Joined: Tue Aug 02, 2011 3:11 am

Re: What are ROM Nametables useful for?

Post by scrimpeh »

Thanks for the responses, everyone!

After Burner II especially is a really good use case that I hadn't considered. It's a very interesting game.
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: What are ROM Nametables useful for?

Post by puppydrum64 »

I'm guessing ROM nametables are put into the PRG ROM like any other tile map?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What are ROM Nametables useful for?

Post by lidnariq »

No, ROM nametables are in CHR ROM. That's what makes them useful: they're extra nametables that the game can bank in instantly.

A bunch of games store an uncompressed nametable or two in PRG-ROM, but it's not particularly useful and it's quite wasteful, compared to any compression at all. (Nametables usually compress extremely well.)
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: What are ROM Nametables useful for?

Post by Bregalad »

I don't remember inspecting the internal funtionning of any game using ROM Nametables, so I can't answer directly. However, it's clear that while ROM nametables could be used for title screens, game over screens, and other static screens, they are little useful in these case because :

1) It is not possible to compress the screen (all blank areas would have to be fully populated by blank tiles in CHR-ROM)
2) It is not possible to use any dynamic element on the screen (such as a blinking "Press Start" caption, or a high score) witout resstorting exclusively to sprites
3) There is no advantage over copying it to VRAM whatsoever, except that you can spare the code doing that (which is not a very significant advantage)

That being said, there's one case where ROM nametables are probably immensely useful : When the existing 2 nametables are insufficiant and you want a 3rd (or 4th, 5th, etc...) one, and switching mid-screen (or even mid-scanline). In that particular case, possibilities are almost endless, from simply blanking out scrolling glitches to allow for pseudo-3D effects or displaying text in Kanji or whatsoever.

With a mapper allowing for IRQs each line it would even be possible to quickly change nametables with a finer grain than 8x8, allowing for almost infinite possibilities.
Useless, lumbering half-wits don't scare us.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: What are ROM Nametables useful for?

Post by Dwedit »

For ROM Nametables to be useful, you need to have a static screen that will never change, and a need to switch between multiple static screens quickly.
Thus, they were used for Flight-Sim type games like After Burner, or Racing games. I think one of the Street Fighter bootlegs also uses ROM Nametables for the backgrounds.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: What are ROM Nametables useful for?

Post by puppydrum64 »

Bregalad wrote: Mon May 31, 2021 1:39 am
With a mapper allowing for IRQs each line it would even be possible to quickly change nametables with a finer grain than 8x8, allowing for almost infinite possibilities.
For some reason I thought scanlines were 8 pixels tall. So essentially we could have a "direct draw screen" like GBA, Commodore 64, etc? Sort of? Let's say I had room on my cartridge for 240 ROM nametables and each scanline I can use an IRQ to change which nametable I am drawing. That way scanline 0 is drawing the 0th row of nametable 0, scanline 1 is drawing the 1st row of nametable 1, etc. In theory I could create the Sonic 3D Blast style opening on NES?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What are ROM Nametables useful for?

Post by lidnariq »

It's the exact same argument with nametables as with pattern tables. RAM is more versatile than ROM, but ROM is cheaper than RAM; bankswitching doesn't have to be correlated with either, but historical commercial games almost always came with at most 8KB of RAM (exceptions: VideoMation and Oeka Kids) and almost never made use of bankswitching RAM (exception: Lagrange Point).

If you want to see what ROM nametables are good for, compare the NES port of After Burner to the SMS port.
puppydrum64 wrote: Mon May 31, 2021 10:22 am Let's say I had room on my cartridge for 240 ROM nametables and each scanline I can use an IRQ to change which nametable I am drawing.
Some of that same information is also being stored in the pattern tables; you don't need a full 240 ROM nametables.

I used only 16 ROM nametables to specify a different attribute table for each scanline in this.
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: What are ROM Nametables useful for?

Post by puppydrum64 »

lidnariq wrote: Mon May 31, 2021 10:58 am It's the exact same argument with nametables as with pattern tables. RAM is more versatile than ROM, but ROM is cheaper than RAM; bankswitching doesn't have to be correlated with either, but historical commercial games always came with at most 8KB of RAM and almost never made use of bankswitching RAM (i.e. Lagrange Point).

If you want to see what ROM nametables are good for, compare the NES port of After Burner to the SMS port.
puppydrum64 wrote: Mon May 31, 2021 10:22 am Let's say I had room on my cartridge for 240 ROM nametables and each scanline I can use an IRQ to change which nametable I am drawing.
Some of that same information is also being stored in the pattern tables; you don't need a full 240 ROM nametables.

I used only 16 ROM nametables to specify a different attribute table for each scanline in this.
That is incredible. Could this technique create FMV on the NES? Someone made a Zelda homebrew with FMV clips from N64 and Gamecube, they were only 2 colors but it was really impressive.
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

Re: What are ROM Nametables useful for?

Post by kuja killer »

Do you mean infidelity's "zelda ledgend of link" romhack ??

I absolutely LOVE what he did in the opening story intro thing with that graphic of the N64 Ocarina of Time graphic. That was like 15 or 20 or so frames of animation ..just simply swaping the CHR-ROM bank page number for all the frames. :)

https://www.youtube.com/watch?v=dWxFHYlafDQ - at about 1:00
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: What are ROM Nametables useful for?

Post by Controllerhead »

kuja killer wrote: Mon May 31, 2021 1:34 pm N64 Ocarina of Time graphic
That 2BPP video looks awesome! Neat trick. I think that's actually from Super Smash Bros =p
Image
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What are ROM Nametables useful for?

Post by lidnariq »

puppydrum64 wrote: Mon May 31, 2021 1:27 pm That is incredible. Could this technique create FMV on the NES? Someone made a Zelda homebrew with FMV clips from N64 and Gamecube, they were only 2 colors but it was really impressive.
I ... personally really disagree. To me the art style is incongruous and I find the dithering to be rather ugly.

The only improvement ROM nametables would provide here is the ability to give a little bit more colors. But it's still really limited by the PPU: you still have to use the same 3-color palette for each 16x1 pixel region, and when pixel artists come by they usually tell us that using non-square color regions is harder to design around.
Post Reply