gbdev / rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
https://rgbds.gbdev.io
MIT License
1.33k stars 175 forks source link

Allow RGBGFX to output SNES attribute maps #1247

Open Rangi42 opened 10 months ago

Rangi42 commented 10 months ago

Tilemaps can store 8-bit tile IDs. Attribute maps store any high Tile bits, plus Palette ID (0-7) and X and Y flip. (There are other bits, liek priority, but they're not relevant to RGBGFX.)

Attribute map byte formats:

RGBGFX could have a --snes flag to output SNES attribute maps. This flag would imply -N 1024,0, and the high two bits of tile IDs would go in the attribute map, not the tile map. (There could be a warning/error if the user explicitly specifies -N, or outputs a tilemap but no attrmap.)

Rangi42 commented 10 months ago

This would go well with -d 4 support (#1095).

Rangi42 commented 10 months ago

If we're keeping a GBC focus, this could be --sgb not --snes, implying -N 256,0 -d 4 (plus max 3 palettes with IDs 4-7).