changeset 1163:b251899f2b97

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
author Michael Pavone <pavone@retrodev.com>
date Mon, 09 Jan 2017 19:24:11 -0800
parents c4ea535cf57e
children 21df13266e6a
files vdp.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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))