@@ 11,6 11,12 @@ WITH REGARD TO THIS SOFTWARE.
#include "ppu.h"
+static uint8_t blending[4][16] = {
+ {0, 0, 0, 0, 1, 0, 1, 1, 2, 2, 0, 2, 3, 3, 3, 0},
+ {0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3},
+ {1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1},
+ {2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2}};
+
static inline void
render(Ppu *p, int offset, int count)
{
@@ 64,7 70,7 @@ screen_blit(Ppu *p, uint8_t fg, uint16_t x, uint16_t y, uint8_t *sprite, uint8_t
fg,
x + (flipx ? 7 - h : h),
y + (flipy ? 7 - v : v),
- color * ch);
+ blending[ch][color]);
}
}
}