Editing Art - RetroKoH/S1Fixed GitHub Wiki
There are numerous tools you can use to edit art in Sonic 1-3K, and S1Fixed. Flex2 is ideal for editing palettes and art tiles used for object sprites, while SonLvl is ideal for editing level art. Both offer support for importing art, and using art of various compression formats.
By default, Sonic 1 makes use of two compression formats with regards to art tiles: Nemesis and Kosinski format. Some art is also uncompressed within the ROM. You can find these files in the artnem, artkos, artunc folders, respectively, with files having the extensions .nem
, .kos
, and .bin
(or .unc
), respectively.
Editing Color Palettes
It's not ideal to edit palettes by hex, but it's not too difficult, and if you are planning to write a tool that needs to read and/or edit color palettes, it doesn't hurt to know how to do it. If we open palettes/Sonic.bin, we can see the following hex data:
0000 0000 0822 0A44 0C66 0E88 0EEE 0AAA 0888 0444 08AE 046A 000E 0008 0004 00EE
Each cluster of 4 digits is 2 bytes (Remember that 1 byte consists of 2 digits, or nybbles). Each cluster starts with 0, and follows the format of 0BGR. B = Blue, G = Green, and R = Red. Each nybble is a color component with a value ranging from 2 to $E (14). Odd values are never used, so only the following values are accepted:
0 2 4 6 8 A C E
The color black is represented with 0000, while the color white is represented with 0EEE.
You'll notice that there are 16 clusters. This means there are 16 colors in Sonic's palette, though the first color is never seen by the player. Sonic's palette is usually loaded into the first of 4 palette lines. These 4 palette lines mean that there are up to 64 palettes that can be displayed at one time (without the use of various techniques.) If you are simply editing palettes for characters or levels, you need not create a palette with more than 64 clusters/colors.
Editing Art
You're unlikely to ever need to edit art by hex, but once again, it's good to know how these things work, so let's get to it. Every art tile in a Sega Mega Drive/Genesis game is made up of 64 pixels (8x8 pixels). The actual art data does NOT contain any color data, however. Instead, it is composed of a series of indices ranging from 0 to $F (15). Each digit/nybble represents one pixel in an art tile, and the value points to the index in a color palette line that should be used to color in that pixel. Therefore, art tiles and color palettes are used in conjunction with one another to make the art we see on screen.
If you are using Flex2 to edit art, you can draw out tiles by clicking the mappings tab at the top, scrolling down, and selecting DRAWING MODE to begin drawing directly onto the art. Palette color menus can be found at the top right of the drawing field.
NOTE: Be careful not to right-click and left-click together while in DRAWING MODE. This triggers a bug in which changes made to art tiles will not be reflected on screen. To fix this issue, immediately save the art (Files Tab) and then immediately reload the art.
Imagery will be added to this guide later.