aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-17 08:48:09 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-17 08:48:09 +0100
commitdaf44bcdc706dd84bf291b207a8f720bc2b26159 (patch)
tree423095b01f94258d3bb8884f7f158f630fa61b41 /src
parentd648d6fbe8bf984ea623bcdafc41d029e26a4cba (diff)
Fix DRW collision detection
Diffstat (limited to 'src')
-rw-r--r--src/ahoy/emulator.c3
1 files changed, 2 insertions, 1 deletions
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;
}