diff options
-rw-r--r-- | vdp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; } |