Mercurial > repos > blastem
comparison vdp.c @ 1366:c74a2f31ae5f
Fix regression in horizontal interrupt timing that was breaking the "water" palette swap in the Sonic series and other games
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 22 May 2017 21:11:13 -0700 |
parents | 6dd2c3edd0b5 |
children | 4c5a78555209 |
comparison
equal
deleted
inserted
replaced
1365:6dd2c3edd0b5 | 1366:c74a2f31ae5f |
---|---|
3281 if (hint_line > context->inactive_start) { | 3281 if (hint_line > context->inactive_start) { |
3282 hint_line = context->regs[REG_HINT]; | 3282 hint_line = context->regs[REG_HINT]; |
3283 if (hint_line > context->inactive_start) { | 3283 if (hint_line > context->inactive_start) { |
3284 return 0xFFFFFFFF; | 3284 return 0xFFFFFFFF; |
3285 } | 3285 } |
3286 if (hint_line >= context->vcounter) { | |
3287 //Next interrupt is for a line in the next frame that | |
3288 //is higher than the line we're on now so just passing | |
3289 //that line number to vdp_cycles_to_line will yield the wrong | |
3290 //result | |
3291 return context->cycles + vdp_cycles_to_line(context, 0) + hint_line * MCLKS_LINE - HINT_FUDGE; | |
3292 } | |
3286 } | 3293 } |
3287 } else { | 3294 } else { |
3288 uint32_t jump_start, jump_dst; | 3295 uint32_t jump_start, jump_dst; |
3289 get_jump_params(context, &jump_start, &jump_dst); | 3296 get_jump_params(context, &jump_start, &jump_dst); |
3290 if (hint_line >= jump_start && context->vcounter < jump_dst) { | 3297 if (hint_line >= jump_start && context->vcounter < jump_dst) { |