Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
So if I'm right Color 0 is always transparent for sprites and mapping or whatever is zero and If I made a tile map will that be transparent as well? the way I look at Dr Mario GB game it has a blue for first then white as second but it's not transparent for the blue color sprites!
how could this be if the sprites are laid out on a map would Color 0 be transparent? I'm basically redrawing the sprites to into it to my Dr Mario Like game that is under my own engine title Headache, it's bascially crazy that the map has blue sprites under color 0 and it's not transparent.
I'm confused on this as I dig into the game and build something similar to the Dr Mario Engine.
Also it's universal with Gameboy Color so how to work the BG palettes so they all work together with the mapping like the title screen and stuff?
Last edited by Alexander the bat (2017-04-21 00:34:58)
Offline
There's transparency on neither of the background or the window.
The renderer more or less checks for which pixel to render in this order :
Sprite pixel, if there is a sprite with a non-color 0 pixel
Window pixel, if the window is present on that pixel
BG pixel, always.
There's only transparency for sprites.
Example with images, taken from BGB's VRAM viewer :
Both of the sprites displayed in the top-left corner of the screen use OBJ palette 0 :
Now, OBJ palette 0 has the following colors, which includes a blue-green color 0 :
The tile display shows the tiles as having the blue-green color :
But on-screen, every pixel which you would expect to have that color lets the background pixel "below" appear.
Which essentially means that sprite color palettes have only three colors.
But there's no such mechanic for the background, so all four colors of a background palette will be rendered.
Example :
- This tile uses orange, brown and black (colors 0, 1 and 3)
- This one uses orange, brown and light blue (colors 0, 1 and 2).
Full color palette :
(Having only three different colors on one tile is a design choice, not a hardware limitation)
Offline
There is a mechanic for drawing sprites behind the background. By using the "OBJ-to-BG Priority" bit on the sprite attribute you can display OBJ behind the background colors 1-3, color 0 is always rendered behind the OBJ.
From the pandocs "VRAM Sprite Attribute Table (OAM)"
Byte3 - Attributes/Flags:
Bit7 OBJ-to-BG Priority (0=OBJ Above BG, 1=OBJ Behind BG color 1-3)
(Used for both BG and Window. BG color 0 is always behind OBJ)
Bit6 Y flip (0=Normal, 1=Vertically mirrored)
Bit5 X flip (0=Normal, 1=Horizontally mirrored)
Bit4 Palette number **Non CGB Mode Only** (0=OBP0, 1=OBP1)
Bit3 Tile VRAM-Bank **CGB Mode Only** (0=Bank 0, 1=Bank 1)
Bit2-0 Palette number **CGB Mode Only** (OBP0-7)
I've seen this technique used in a couple games. Metroid II uses it in the intro area to display the ship in front of samus. Donkey Kong Land uses it in one of the early bonus areas where the player swims behind a pillar.
Last edited by ssjason123 (2017-04-21 19:55:10)
Offline
Also (in CGB Mode only) you can set a bit for a specific tile to be rendered above all sprites. It generates the same effect, but is set for a specific tile instead of a specific sprite.
Offline
what About doing the Capcom Way like they did with Megaman Games that tricks the NES that is more then four colors? I know they use a trick to make more color by splitting megman up with a body and face....I'm wonderin' how I can do that if I need it and program it in!
Offline