diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-01-04 23:05:37 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-01-04 23:05:37 -0800 |
commit | d8bb1db03b5f3c3beb86dce633f89872d05318a5 (patch) | |
tree | a67dea583909060b8cd0f1597432a524703b33f1 /vdp.c | |
parent | 52fb42428540e149d7ae6b53bdb52603b8e1947f (diff) |
Some small synchronization improvements that do not seem to fix anything
Diffstat (limited to 'vdp.c')
-rw-r--r-- | vdp.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1627,7 +1627,7 @@ int vdp_control_port_write(vdp_context * context, uint16_t value) if (!context->double_res) { context->framebuf = context->oddbuf; } - } + } context->cd &= 0x3C; } } else { @@ -1892,7 +1892,7 @@ uint32_t vdp_cycles_to_line(vdp_context * context, uint32_t target) return MCLKS_LINE * (lines - 1) + vdp_cycles_next_line(context); } -uint32_t vdp_cycles_to_frame_end(vdp_context * context) +uint32_t vdp_frame_end_line(vdp_context * context) { uint32_t frame_end; if (context->flags2 & FLAG2_REGION_PAL) { @@ -1908,7 +1908,18 @@ uint32_t vdp_cycles_to_frame_end(vdp_context * context) frame_end = NTSC_INACTIVE_START + 8; } } - return context->cycles + vdp_cycles_to_line(context, frame_end); + return frame_end; +} + +uint32_t vdp_cycles_to_frame_end(vdp_context * context) +{ + return context->cycles + vdp_cycles_to_line(context, vdp_frame_end_line(context)); +} + +uint8_t vdp_is_frame_over(vdp_context * context) +{ + uint32_t frame_end = vdp_frame_end_line(context); + return context->vcounter >= frame_end && context->vcounter < (frame_end + 8); } uint32_t vdp_next_hint(vdp_context * context) |