Question about Mode 3 and the 8bpp palette

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
SNES AYE
Posts: 201
Joined: Mon Nov 07, 2022 11:28 am

Question about Mode 3 and the 8bpp palette

Post by SNES AYE »

Similar to how you can have a background tile in any of the regular background modes and then just change the palette it's using to have a variety of the same but different-coloured tiles that only take up one tile's worth of memory in VRAM on the tilemap, at least as I understand it, if I have a background tile in the 8bpp mode, can I use the same tile with different colours from the single 256-colour palette to have a variety of the same but different-coloured tiles without them all being separate tiles in VRAM on the tilemap?

Example:
8bpp.png
8bpp.png (1.21 KiB) Viewed 1615 times
Ideally this would just be one tile in the tilemap and I could use various colours from the single 8bpp palette to effectively have a whole bunch of different-looking chests throughout the level at really no extra cost.

I was thinking of this when looking at the recent port of DuckTales from NES to SNES, and the idea was it could maybe be made to run in Mode 3 and then, as an example, say every repeated tile of the wall in the background in the clip below could basically look different just by using variations of the colours used in the single 256-colour palette, so there would be zero chance of it even getting near the max tiles allowed on-screen and in VRAM for an 8bpp background yet still look like it had a huge amount of visual variety via subtle differences in colouring in lots of the tiles.

https://youtu.be/-QHp7gc79Kc?t=1409

And, if it works like that, since NES games only have a single background layer and really very few but widely repeated background tiles and not too many sprites tiles with not a load of animation frames, meaning very little unique 8bpps background tiles along with not that many 4bpp sprite tiles to worry about fitting into VRAM and memory in general, it would maybe be a fun way to use Mode 3's 8bpp capabilities to do something rather interesting visually on the SNES versions of these NES games.
Last edited by SNES AYE on Sat Aug 05, 2023 8:30 am, edited 1 time in total.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Question about Mode 3 and the 8bpp palette

Post by tepples »

In mode 3, only tiles in the 4bpp layer can appear in the same scene with different color palettes. Tiles in the 8bpp layer cannot.

If you're dead-set on using 8bpp and recolored tiles, you can:
  1. draw the palette-swapped things as objects (sprites) instead of background; or
  2. give up parallax scrolling, set the 8bpp and 4bpp layers' scroll positions the same, and put the palette-swapped things in the 4bpp layer.
SNES AYE
Posts: 201
Joined: Mon Nov 07, 2022 11:28 am

Re: Question about Mode 3 and the 8bpp palette

Post by SNES AYE »

tepples wrote: Sat Aug 05, 2023 6:32 am In mode 3, only tiles in the 4bpp layer can appear in the same scene with different color palettes. Tiles in the 8bpp layer cannot.

If you're dead-set on using 8bpp and recolored tiles, you can:
  1. draw the palette-swapped things as objects (sprites) instead of background; or
  2. give up parallax scrolling, set the 8bpp and 4bpp layers' scroll positions the same, and put the palette-swapped things in the 4bpp layer.
Ah, now that last option is an interesting one for maybe doing a mostly 8bpp upgrade of the DuckTales port on SNES then (and any of the NES to SNES ports for that matter), really just to see what's visually possible with such a simple one-background non-parallax game and this large amount of colours. And, given the 4bpp layer's tiles can be mixed with the 8bpp layer via either just cutting out some pixels or even colour math, it really could be a nice end result. Then it would just be making sure to not go above any tile limits overall, which should be fine given DuckTales started as a NES game and had to originally fit within all the tile limits on that console in the first place.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Question about Mode 3 and the 8bpp palette

Post by tepples »

If you're using mode 3 without parallax scrolling, another thing that lets you do is use priority to put each individual tile of the 4bpp layer either in front of or behind the 8bpp layer.


Now would the Terra-Firmians of the African Mines accept Libbet from my GB port of Magic Floor into their fold?
Attachments
Libbet_webcolor.png
Libbet_webcolor.png (18.68 KiB) Viewed 1559 times
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Question about Mode 3 and the 8bpp palette

Post by creaothceann »

SNES AYE wrote: Sat Aug 05, 2023 3:39 am Similar to how you can have a background tile in any of the regular background modes and then just change the palette it's using to have a variety of the same but different-coloured tiles that only take up one tile's worth of memory in VRAM on the tilemap, at least as I understand it, if I have a background tile in the 8bpp mode, can I use the same tile with different colours from the single 256-colour palette to have a variety of the same but different-coloured tiles without them all being separate tiles in VRAM on the tilemap?

Example:
8bpp.png

Ideally this would just be one tile in the tilemap and I could use various colours from the single 8bpp palette to effectively have a whole bunch of different-looking chests throughout the level at really no extra cost.
You can easily change 2- and 4-bit tile's colors by "palette-swapping". That is, you tell it to use a different part of the global 256-color palette that is available on the SNES.

8-bit tiles already use 2⁸ = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = 256 colors of the global palette.

That's actually why Direct Color mode was invented - to make use of the otherwise useless palette bits in the tilemap entries of 256-color backgrounds.

One other way to change the color of these tiles is to use color addition/subtraction with the fixed color (which can be changed between scanlines). Together with the window registers it'd even be possible to restrict it to one or two sections of a scanline.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Post Reply