From 5201d916e0603adad4960f52f537ac6d6a2a6763 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 9 Jan 2017 19:24:11 -0800 Subject: Fix disagreement on line change location between vdp_h32_mode4 and vdp_run_context that was causing the first line to be garbage in some cases --- vdp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 6e24cb1..fa69188 100644 --- a/vdp.c +++ b/vdp.c @@ -1530,12 +1530,6 @@ static void vdp_advance_line(vdp_context *context) CHECK_ONLY #define MODE4_CHECK_SLOT_LINE(slot) \ - if ((slot) == LINE_CHANGE_MODE4) {\ - vdp_advance_line(context);\ - if (context->vcounter == 192) {\ - return;\ - }\ - }\ if (context->flags & FLAG_DMA_RUN) { run_dma_src(context, -1); } \ if ((slot) == 147) {\ context->hslot = 233;\ @@ -1543,6 +1537,12 @@ static void vdp_advance_line(vdp_context *context) context->hslot++;\ }\ context->cycles += slot_cycles;\ + if ((slot+1) == LINE_CHANGE_MODE4) {\ + vdp_advance_line(context);\ + if (context->vcounter == 192) {\ + return;\ + }\ + }\ CHECK_ONLY #define CALC_SLOT(slot, increment) ((slot+increment) > 147 && (slot+increment) < 233 ? (slot+increment-148+233): (slot+increment)) -- cgit v1.2.3