From daf44bcdc706dd84bf291b207a8f720bc2b26159 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 17 Feb 2024 08:48:09 +0100 Subject: Fix DRW collision detection --- src/ahoy/emulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ahoy/emulator.c b/src/ahoy/emulator.c index 980a0a7..04816cf 100644 --- a/src/ahoy/emulator.c +++ b/src/ahoy/emulator.c @@ -212,6 +212,7 @@ opexec(uint16_t op) unsigned y = (op & 0x00F0) >> 4; unsigned n = (op & 0x000F) >> 0; + c8.V[0xF] = 0; c8.needs_redraw = true; if (c8.I + n > lengthof(mem)) diex("%s: attempted to draw sprite beyond bounds of RAM", filename); @@ -224,7 +225,7 @@ opexec(uint16_t op) break; msk = ((uint64_t)spr_row << (64 - 8)) >> c8.V[x]; - c8.V[0xF] = (bool)(c8.screen[scr_row] & msk); + c8.V[0xF] |= (bool)(c8.screen[scr_row] & msk); c8.screen[scr_row] ^= msk; } -- cgit v1.2.3