summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-01-09 19:24:11 -0800
committerMichael Pavone <pavone@retrodev.com>2017-01-09 19:24:11 -0800
commit5201d916e0603adad4960f52f537ac6d6a2a6763 (patch)
tree3b2708f5fe7a08074bc1fe98a25b9576bd28c60b
parent85f9c54dc10bdab8d7ca09f2d928dfd8b5eb2a24 (diff)
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
-rw-r--r--vdp.c12
1 files changed, 6 insertions, 6 deletions
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))