Closed Rangi42 closed 4 years ago
Why not?! 👍
@Rangi42 Decided to add GBA support now. Reading the nocash GBATEK docs, it seems like color 0 is always transparent, similar to how SNES works: http://problemkaputt.de/gbatek.htm#lcdcolorpalettes
While your comment suggests each subpalette should get its own, usable, color. I haven't programmed GBA personally, so at the moment I'm unsure how I should handle palettes...
Color 0 of all BG and OBJ palettes is transparent. Even though palettes are described as 16 (256) color palettes, only 15 (255) colors are actually visible.
If the 256 colors are being used as 16 palettes of 16 colors each, all 16 palettes have their own color #0 which is transparent.
Example:
The leftmost colors are all transparent, for both BG and OBJ tiles.
OK, thanks. That sounds very much like SNES, then. In the SNES case, palette position 0 is used as the background color (ie. it's the color shown if everything on that pixel is transparent). Is that the case also on GBA?
Yes, I think so.
Cool. I’ll make a release with preliminary support tonight or so, and I’ll catch possible incorrectness if anything is found.
I added GBA support today, with an extra gba_affine
mode which is analogous to the snes_mode7
mode (very similar limitations too, with the 256 tile limit without attributes): v0.9.1
For now I haven't tested the output, except for looking at it in an hex editor without being shocked by the result. 🤔
It looks accurate to me too. Files open as expected in Tilemap Studio.
Thanks for adding this!
Thumbs up!
The GBA 4bpp tilemap format is similar to the SNES 2bpp mode, but with a fourth palette bit instead of a priority bit:
Also, each 16-color subpalette has its own color 0.