I suspect I already know the answer to this, but I just want to make sure.
Does the system need to load an actual blank tile into the PPU in order to have a blank tile in the scene? Or can a game actually just not display something in a given square?
To be clear, I mean among the artwork loaded into the system, with all the graphics used to build a background, I'm talking about having one such tile contain nothing but a solid black/transparency color.
I would assume that I would need an actual blank tile; I cannot fathom how this could be pointed at outside of one of the 256 tiles loaded into the memory bank. Plus looking at various games, I haven't found one that doesn't have at least one blank tile loaded in the memory.
But, well, you know what happens when you assume.
So, I'm formally asking.
If I want a blank tile in my game's background, do I need to reserve a blank tile among the artwork?
And on that subject, what about a solid color? I would even more-so assume these need an actual tile made out of solid color, but I might as well check.
Normally you do need a blank tile. There are a few other things that can be done but are usually not satisfactory. To just add one or more blank tiles into the pattern table is generally best.
It needs actual blank tiles, except when displaying an entire blank or solid screen, or a split screen with background disabled for a few scanlines.
Or, for some reasons, you sacrifice a whole sub-palette making up of the same colour as the background colour, so that tiles using that sub-palette in the attribute table will appear "blank" regardless of the content of the tiles.
I can actually think of some scenarios that this may be useful (for example, to display some random picture which uses at most 3 sub-palettes on screen, such as a frame of a FMV, that uses all 256 tiles) but in general use: "WHY?"
This is why I love this forum.
I asked a question that could have had a simple yes-or-no answer, but I got some more detailed responses that addressed various extra circumstances.
Cartridge hardware could also disable the CHR-ROM when a certain tile range is accessed and use resistor pulldowns to simulate a blank tile. Yes this is ridiculous, but I actually tought about that for my single-chip mapper idea (where CIRAM is used as a 64-tile CHR-RAM) in order to get a 65th tile for free. Finally I decided not to use that.
Some CNROM boards can disable the CHR-ROM, they however do not have any resistors pull-downs, an they do not do that automatically for a given adressed tile, so this is actually worthless.
zz038's answer was the most straightforward. When you load up an NES emulator, its CHR-RAM and the name table might be all zeroes and look "blank". But on the real NES hardware, RAM and the NT are often filled with random garbage. You will thus need to make one complete tile of all zeroes (in CHR-ROM or RAM) and fill the name table with that character.
Gilbert wrote:
Or, for some reasons, you sacrifice a whole sub-palette making up of the same colour as the background colour, so that tiles using that sub-palette in the attribute table will appear "blank" regardless of the content of the tiles.
I can actually think of some scenarios that this may be useful
I wonder if this is how Ultima 3+4 hide/reveal large portions of the screen when the player moves. It would be much more efficient to edit large sections of the attribute table rather than the name table every frame.
I've never really analyse them, but this is also possible how the Dragon Quest games do similar thing in dungeons (though I suspect they really just modify the name-tables).
Also,
Ys, together with sprite overlays to make the visible area circular I think.
DQ1 handles the dark caves by actually treating the two nametables as a double-buffer; when you move, it blits the currently-visible tiles to the offscreen nametable and then switches to it. All of the dark tiles are just blank tiles.
Ultima 3 does use attribute tables to darken squares, but Ultima 4 does not even have limited visibility.
Super Mario Bros. 3 uses a combination of black attributes, and some black sprites overlaid on top to do a visibility circle on part of the World 8 map.
Bucky O'Hare does something similar in a few screens too.
Drag wrote:
DQ1
Yes. I know that, as the visibility of a dungeon is so low in the first game, it wouldn't cost much to update the nametable anyway.
In DQ3 and DQ4, some of the branches in a dungeon are obscured by darkness until you reach an opening, though I still think it's more probably done by messing with the nametable, not the attribute table.
Most likely, because in other parts of the game, the same effect is used when you enter buildings; The interior is drawn over the background, and then the exterior is erased. That's indeed a nametable update instead of just an attribute table update.
Interestingly, Final Fantasy 1 achieves a similar effect by using the palette. One attribute is set to be all a solid color, and when you enter a room, that attribute is changed to a visible palette and the rest of the palette is darkened. The interior of the room uses only that attribute, obviously.