Swapping Gameboy Palette globally to specific colours


Hi all, I'm making a gameboy themed game right now and was wondering if there would be a way to globally change the palette used for the game's sprites without using the build in blend functions since I want to specify the colours used in the palettes.


Yeah, use a palette swap shader. You'll also need shader to reduce the number of colors on the screen down to 4, if your screen has more than 4 colors.

But the Game Boy games are shaded differently depending upon whether they are being played in a Game Boy (original Game Boy or Game Boy pocket), a Super Game Boy, or a Game Boy Color. If you haven't done the research, here's a brief (oversimplified) explanation:

1.) The Game Boy screen uses 4 shades of green. The Game Boy Pocket screen uses 4 shades of gray. Basically, you're limited to 4 shades of a single color (whatever color the physical screen is).

2.) The Super Game Boy uses 15-bit BGR color.
- If the game was not designed to be played on the Super Game Boy, then the Super Game Boy uses a single palette of 4 colors. (Pretty much the same idea as the Game Boy, but using 4 separate colors rather than 4 shades.)
- If the Game Boy game was designed for the Super Game Boy, then it can use four palettes of 4 colors each, for a total of 13 colors on the screen at any given time (should be 16 colors, but color #0 is shared between all four palettes). But you can't just put the 13 colors wherever you want: you need to follow these rules: First you render the screen in 4 colors as if it were a regular Game Boy. Then you divide the screen into a grid of 20 columns by 18 rows, in which each grid cell (i.e. each 8x8-pixel region) is assigned one of the four palettes. The 4 colors within that cell are then re-rendered according to that cell's palette.

3.) I'm not sure what kind of color the Game Boy Color uses. (Probably 24-bit RGB, but maybe some sort of indexed coloring? I have no idea.)
- If the game was not designed to be played on the Game Boy Color (i.e. if it's a gray cartridge game), then the game is displayed using three separate palettes (called 'BG0', 'OBJ0', and 'OBJ1'). Each of these three palettes contains 4 colors each, for a total of 10 colors on the screen at any given time (should be 12, but color#0 is rendered as transparent in 'OBJ0' and 'OBJ1'). This is hard to explain... basically, the background layer is first rendered using the 'BG0' palette, then each sprite is rendered using either the 'OBJ0' or the 'OBJ1' palette depending upon a variable in the sprite itself (each sprite has its own variable controlling which palette it uses). (And when I say 'sprite', I'm referring to sprites in Game Boy terminology, not GameMaker terminology. The idea is a little different.)
- I don't know how Game Boy Color games work. (i.e. black or clear cartridge games)

Hopefully all the information I posted is correct.

Also note, many games actually use less colors than what I said above.
e.g. When Pokémon Red Version (which was designed for Super Game Boy) is played on the Super Game Boy, it only ever uses 10 colors, not 13. This is because color #3 is also shared between all four palettes in addition to color #0.
Also, when Pokémon Red Version (which was not designed to be played on the Game Boy Color) is played on the Game Boy Color, there are only ever 6 colors on the screen at any given time. This is because the 'OBJ0' palette is identical to the 'BG0' palette, apart from transparency. Though, you can change the palette when the game is starting up. I think down+B might use 8 colors. I don't think any of the default palettes use all 10 colors though.
Last edited: