diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-05-22 21:11:13 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-05-22 21:11:13 -0700 |
commit | 004750f57466d8df289f43566cd5710082200780 (patch) | |
tree | 0480311f73d488df1022194f45196a54ac000e28 | |
parent | 50e7961c813f3663f7688a47c47491e9ed9dea00 (diff) |
Fix regression in horizontal interrupt timing that was breaking the "water" palette swap in the Sonic series and other games
-rw-r--r-- | vdp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -3283,6 +3283,13 @@ uint32_t vdp_next_hint(vdp_context * context) if (hint_line > context->inactive_start) { return 0xFFFFFFFF; } + if (hint_line >= context->vcounter) { + //Next interrupt is for a line in the next frame that + //is higher than the line we're on now so just passing + //that line number to vdp_cycles_to_line will yield the wrong + //result + return context->cycles + vdp_cycles_to_line(context, 0) + hint_line * MCLKS_LINE - HINT_FUDGE; + } } } else { uint32_t jump_start, jump_dst; |