From 1d694c43ea5cfb65499406252b47838fbaf8d4e7 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Sun, 6 Mar 2022 20:39:21 +0000 Subject: [PATCH] Fix sprite address check. --- src/devices/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/screen.c b/src/devices/screen.c index 83cfeab..a261051 100644 --- 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);