summaryrefslogtreecommitdiff
path: root/vdp.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-10-29 00:03:11 -0700
committerMike Pavone <pavone@retrodev.com>2013-10-29 00:03:11 -0700
commit2f5d44553a78ac5af6045e66f2061a25103f660c (patch)
tree7cfd7e01e175f3804fb5d5415e4536b8461e943a /vdp.c
parentd0b2a6deb5c48fc0f40a979401ea8e99eea7a65e (diff)
parent6d63c50747b7747dc1d15eb7fdcca94e7be71298 (diff)
Merge
Diffstat (limited to 'vdp.c')
-rw-r--r--vdp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/vdp.c b/vdp.c
index e962a67..87a752b 100644
--- a/vdp.c
+++ b/vdp.c
@@ -159,10 +159,16 @@ void render_sprite_cells(vdp_context * context)
context->cur_slot--;
for (uint16_t address = d->address; address != ((d->address+4) & 0xFFFF); address++) {
if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) {
+ if (context->linebuf[x] && (context->vdpmem[address] >> 4)) {
+ context->flags2 |= FLAG2_SPRITE_COLLIDE;
+ }
context->linebuf[x] = (context->vdpmem[address] >> 4) | d->pal_priority;
}
x += dir;
if (x >= 0 && x < 320 && !(context->linebuf[x] & 0xF)) {
+ if (context->linebuf[x] && (context->vdpmem[address] & 0xF)) {
+ context->flags2 |= FLAG2_SPRITE_COLLIDE;
+ }
context->linebuf[x] = (context->vdpmem[address] & 0xF) | d->pal_priority;
}
x += dir;
@@ -1542,6 +1548,14 @@ uint16_t vdp_control_port_read(vdp_context * context)
if (context->flags2 & FLAG2_VINT_PENDING) {
value |= 0x80;
}
+ if (context->flags & FLAG_DOT_OFLOW) {
+ value |= 0x40;
+ }
+ if (context->flags2 & FLAG2_SPRITE_COLLIDE) {
+ value |= 0x20;
+ //TODO: Test when this is actually cleared
+ context->flags2 &= ~FLAG2_SPRITE_COLLIDE;
+ }
if ((context->regs[REG_MODE_4] & BIT_INTERLACE) && context->framebuf == context->oddbuf) {
value |= 0x10;
}
@@ -1560,7 +1574,6 @@ uint16_t vdp_control_port_read(vdp_context * context)
value |= 0x1;
}
//printf("status read at cycle %d returned %X\n", context->cycles, value);
- //TODO: Sprite overflow, sprite collision, odd frame flag
return value;
}