# HG changeset patch # User Michael Pavone # Date 1484018651 28800 # Node ID b251899f2b97904c3802c85967840e8456cbbb51 # Parent c4ea535cf57eb261bfe201c2fecbf9a30ff73af8 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 diff -r c4ea535cf57e -r b251899f2b97 vdp.c --- a/vdp.c Sun Jan 08 16:55:30 2017 -0800 +++ b/vdp.c Mon Jan 09 19:24:11 2017 -0800 @@ -1530,12 +1530,6 @@ 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 @@ 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))