Converting an animated GIF to multicolor C64 sprites
23 Mar 2018Recently I stumbled upon a nice little GitHub project that converts animated GIFs to Commodore 64 sprites. That tool converts to high resolution sprites, so I wrote a .NET tool that converts to multicolor sprites.
As described by C64-Wiki, in multicolor sprites the bits are grouped in pairs, and since each such multicolor pixel is defined by two bits of data rather than one, each pixel can do one of four things:
- Pixels with a bit pair of
00
appear transparent, like “0” bits do in high resolution mode - Pixels with a bit pair of
01
will have the color specified in address $d025 - Pixels with a bit pair of
11
will have the color specified in address $d026 - Pixels with a bit pair of
10
will have the color specified assigned to the sprite in question in the range $d027–d02e
Thus each color corresponds to a specific delegate that takes the bit position of the pixel and returns a value to add to the byte that the pixel belongs to:
In this method, colorsString
is a four characters string of hex numbers defining the color in each of the registers $d020, $d025, $d026, $d027.
Party Parrots
Party parrots in Slack are animated drawings of Sirocco the kakapo parrot. I converted some of the lovely parrots on http://cultofthepartyparrot.com/ and let these little fellas slide in to the screen.
The result was pretty funny:
The repo contains a simple C64 demo so you can go try it out yourself!