summaryrefslogtreecommitdiff
path: root/vdp.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-05-13 21:52:33 -0700
committerMike Pavone <pavone@retrodev.com>2013-05-13 21:52:33 -0700
commitc29e81eccf519d3d1e70791ae0a9baf80929c404 (patch)
tree2933fe5c70927cfb57f57883006dc98bd5fda13c /vdp.c
parent4f47b27f1bfaa75abeaf008dfd6ab4d8035fe56c (diff)
Implement first line/last line weirdness in VDP
Diffstat (limited to 'vdp.c')
-rw-r--r--vdp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/vdp.c b/vdp.c
index 58cfe40..ff1df70 100644
--- a/vdp.c
+++ b/vdp.c
@@ -770,12 +770,14 @@ void vdp_h40(uint32_t line, uint32_t linecyc, vdp_context * context)
case 0:
context->cur_slot = MAX_DRAWS-1;
memset(context->linebuf, 0, LINEBUF_SIZE);
- render_sprite_cells(context);
- break;
case 1:
case 2:
case 3:
- render_sprite_cells(context);
+ if (line == 0xFF) {
+ external_slot(context);
+ } else {
+ render_sprite_cells(context);
+ }
break;
//sprite attribute table scan starts
case 4:
@@ -922,12 +924,14 @@ void vdp_h32(uint32_t line, uint32_t linecyc, vdp_context * context)
case 0:
context->cur_slot = MAX_DRAWS_H32-1;
memset(context->linebuf, 0, LINEBUF_SIZE);
- render_sprite_cells(context);
- break;
case 1:
case 2:
case 3:
- render_sprite_cells(context);
+ if (line == 0xFF) {
+ external_slot(context);
+ } else {
+ render_sprite_cells(context);
+ }
break;
//sprite attribute table scan starts
case 4:
@@ -1126,7 +1130,7 @@ void vdp_run_context(vdp_context * context, uint32_t target_cycles)
context->flags2 |= FLAG2_VINT_PENDING;
}
}
- if (line < active_lines && context->regs[REG_MODE_2] & DISPLAY_ENABLE) {
+ if ((line < active_lines || (line == active_lines && linecyc < (context->latched_mode & BIT_H40 ? 64 : 80))) && context->regs[REG_MODE_2] & DISPLAY_ENABLE) {
//first sort-of active line is treated as 255 internally
//it's used for gathering sprite info for line
line = (line - 1) & 0xFF;