(screen.c) Blending 00 only clears in accordance to sprite at addr

This commit is contained in:
Devine Lu Linvega 2023-07-23 19:32:41 -07:00
parent 867883409e
commit 26bc456a1b
2 changed files with 2 additions and 2 deletions

View File

@ -307,10 +307,10 @@ JMP2r
@update-cursor ( color addr* -- ) @update-cursor ( color addr* -- )
[ LIT2 00 -Screen/auto ] DEO [ LIT2 00 -Screen/auto ] DEO
.Screen/addr DEO2
#40 draw-cursor #40 draw-cursor
.Mouse/x DEI2 ,draw-cursor/x STR2 .Mouse/x DEI2 ,draw-cursor/x STR2
.Mouse/y DEI2 ,draw-cursor/y STR2 .Mouse/y DEI2 ,draw-cursor/y STR2
.Screen/addr DEO2
@draw-cursor ( color -- ) @draw-cursor ( color -- )

View File

@ -49,7 +49,7 @@ screen_fill(Uint8 *layer, int x1, int y1, int x2, int y2, int color)
static void static void
screen_blit(Uint8 *layer, Uint8 *ram, Uint16 addr, int x1, int y1, int color, int flipx, int flipy, int twobpp) screen_blit(Uint8 *layer, Uint8 *ram, Uint16 addr, int x1, int y1, int color, int flipx, int flipy, int twobpp)
{ {
int v, h, width = uxn_screen.width, height = uxn_screen.height, opaque = (color % 5) || !color; int v, h, width = uxn_screen.width, height = uxn_screen.height, opaque = (color % 5);
for(v = 0; v < 8; v++) { for(v = 0; v < 8; v++) {
Uint16 c = ram[(addr + v) & 0xffff] | (twobpp ? (ram[(addr + v + 8) & 0xffff] << 8) : 0); Uint16 c = ram[(addr + v) & 0xffff] | (twobpp ? (ram[(addr + v + 8) & 0xffff] << 8) : 0);
Uint16 y = y1 + (flipy ? 7 - v : v); Uint16 y = y1 + (flipy ? 7 - v : v);