uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit c02dc5b0e27879f043da435d630a21490601911e
parent c494e42cf2bdee38e842002f2a38e4108f869378
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed, 29 Sep 2021 21:00:18 -0700

Fixed transparency

Diffstat:
Msrc/devices/ppu.c | 18++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/devices/ppu.c b/src/devices/ppu.c @@ -65,11 +65,21 @@ ppu_write(Ppu *p, Uint8 layer, Uint16 x, Uint16 y, Uint8 color) int original = p->pixels[row]; Uint8 next = 0x0; if(x % 2) { - next |= original & 0xf0; - next |= color << (layer * 2); + if(layer) { + next |= original & 0xf3; + next |= color << 0x02; + } else { + next |= original & 0xfc; + next |= color; + } } else { - next |= original & 0x0f; - next |= color << (4 + (layer * 2)); + if(layer) { + next |= original & 0x3f; + next |= color << 0x06; + } else { + next |= original & 0xcf; + next |= color << 0x04; + } } p->pixels[row] = next; p->reqdraw = 1;