comparison vdp.c @ 1155:da6a1f156f24

Fix Mode 4 sprite collision flag
author Michael Pavone <pavone@retrodev.com>
date Thu, 05 Jan 2017 00:42:11 -0800
parents c83ec07ddbac
children b519965f6394
comparison
equal deleted inserted replaced
1154:c83ec07ddbac 1155:da6a1f156f24
249 pixels |= planar_to_chunky[context->vdpmem[address]] << 3; 249 pixels |= planar_to_chunky[context->vdpmem[address]] << 3;
250 pixels |= planar_to_chunky[context->vdpmem[address + 1]] << 2; 250 pixels |= planar_to_chunky[context->vdpmem[address + 1]] << 2;
251 int x = d->x_pos & 0xFF; 251 int x = d->x_pos & 0xFF;
252 for (int i = 28; i >= 0; i -= 4, x++) 252 for (int i = 28; i >= 0; i -= 4, x++)
253 { 253 {
254 if (context->linebuf[x]) { 254 if (context->linebuf[x] && (pixels >> i & 0xF)) {
255 context->flags2 |= FLAG2_SPRITE_COLLIDE; 255 if (
256 ((context->regs[REG_MODE_1] & BIT_SPRITE_8PX) && x > 8)
257 || ((!(context->regs[REG_MODE_1] & BIT_SPRITE_8PX)) && x < 256)
258 ) {
259 context->flags2 |= FLAG2_SPRITE_COLLIDE;
260 }
256 } else { 261 } else {
257 context->linebuf[x] = pixels >> i & 0xF; 262 context->linebuf[x] = pixels >> i & 0xF;
258 } 263 }
259 } 264 }
260 context->sprite_index--; 265 context->sprite_index--;