summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vdp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/vdp.c b/vdp.c
index af04a05..0f772d0 100644
--- a/vdp.c
+++ b/vdp.c
@@ -251,8 +251,13 @@ static void render_sprite_cells_mode4(vdp_context * context)
int x = d->x_pos & 0xFF;
for (int i = 28; i >= 0; i -= 4, x++)
{
- if (context->linebuf[x]) {
- context->flags2 |= FLAG2_SPRITE_COLLIDE;
+ if (context->linebuf[x] && (pixels >> i & 0xF)) {
+ if (
+ ((context->regs[REG_MODE_1] & BIT_SPRITE_8PX) && x > 8)
+ || ((!(context->regs[REG_MODE_1] & BIT_SPRITE_8PX)) && x < 256)
+ ) {
+ context->flags2 |= FLAG2_SPRITE_COLLIDE;
+ }
} else {
context->linebuf[x] = pixels >> i & 0xF;
}