Rangi42 / tilemap-studio

A tilemap editor for Game Boy, Color, Advance, DS, and SNES projects. Written in C++ with FLTK.
https://hax.iimarckus.org/topic/7691/
Other
381 stars 30 forks source link

Support the Sega Genesis #66

Closed Rangi42 closed 2 years ago

Rangi42 commented 2 years ago

Like the competing SNES and TG16, the Genesis had 8x8-pixel tiles and 16-color palettes (but only four of them). From https://segaretro.org/Plane:

The format of the name table is simple - one word per 8x8 tile, that word having the format PCCV HAAA AAAA AAAA, where P is the high priority flag, CC is the palette line to use, V and H are the vertical and horizontal flip flags, respectively, and AAA AAAA AAAA is the tile index of the 8x8 tile (i.e. VRAM location / $20).

(The documentation should possibly mention "nametable" as a common synonym for "tilemap".)

To do: verify whether the two bytes per tile are in big- or little-endian order (PCCV'HAAA AAAA'AAAA or AAAA'AAAA PCCV'HAAA).

Rangi42 commented 2 years ago

https://www.princed.org/wiki/SEGA_Genesis_format:

Byte order: Big-endian (Motorola, network) byte order is used, unless noted otherwise. This is the native endianness of the Motorola 68k CPU in the SEGA Genesis.