Post

Now have smooth palette fades working in Petris for the #casioloopy. (video tearing is emu + linux 😅) Instead of using Bresenham's algorithm as in the GBC version, decided to try 5.5 fixed point per R/G/B. Can pack all the bits for a color into a single u32, which is the cpu's register size.

The fixed point version is packed like this: RRRRRrrrrrxGGGGGgggggxBBBBBbbbbb A cool thing is the fade steps for R,G,B are done all at once in a single add: palette_cached[c] += palette_increments[c]; // Mask bits that rolled over between the channels palette_cached_[c] &= PALETTE_INCREMENT_MASK;

0 reposts1 like

No replies yet.