commit 1d694c43ea5cfb65499406252b47838fbaf8d4e7
parent 3b3386b5445974d68e0385b729febbf52c3a8ab1
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Sun, 6 Mar 2022 20:39:21 +0000
Fix sprite address check.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/devices/screen.c b/src/devices/screen.c
@@ -166,7 +166,7 @@ screen_deo(Device *d, Uint8 port)
n = d->dat[0x6] >> 4;
dx = (d->dat[0x6] & 0x01) << 3;
dy = (d->dat[0x6] & 0x02) << 2;
- if(addr > 0xfff8 - twobpp * 8 * (n + 1))
+ if(addr > 0x10000 - ((n + 1) << (3 + twobpp)))
return;
for(i = 0; i <= n; i++) {
screen_blit(&uxn_screen, layer, x + dy * i, y + dx * i, &d->u->ram[addr], d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20, twobpp);