summaryrefslogtreecommitdiff
path: root/blastem.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-05-19 23:23:53 -0700
committerMichael Pavone <pavone@retrodev.com>2015-05-19 23:23:53 -0700
commitb06a76dab4014a5ea1046eee6e4fdd819dbe7cbb (patch)
tree3967b196028b888d3c5a32109742b516ee0357db /blastem.c
parent9c11d06c90e3d1f8e1c7bfbd5478b5852fcae876 (diff)
Small correction to VBLANK flag timing. Fixed some inconsistencies in interrupt timing calculation.
Diffstat (limited to 'blastem.c')
-rw-r--r--blastem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/blastem.c b/blastem.c
index 56f3ca9..48f1883 100644
--- a/blastem.c
+++ b/blastem.c
@@ -125,6 +125,7 @@ uint16_t read_dma_value(uint32_t address)
void adjust_int_cycle(m68k_context * context, vdp_context * v_context)
{
+ //static int old_int_cycle = CYCLE_NEVER;
genesis_context *gen = context->system;
if (context->sync_cycle - context->current_cycle > gen->max_cycles) {
context->sync_cycle = context->current_cycle + gen->max_cycles;
@@ -147,6 +148,10 @@ void adjust_int_cycle(m68k_context * context, vdp_context * v_context)
}
}
}
+ /*if (context->int_cycle != old_int_cycle) {
+ printf("int cycle changed to: %d, level: %d @ %d(%d), frame: %d, vcounter: %d, hslot: %d, mask: %d, hint_counter: %d\n", context->int_cycle, context->int_num, v_context->cycles, context->current_cycle, v_context->frame, v_context->vcounter, v_context->hslot, context->status & 0x7, v_context->hint_counter);
+ old_int_cycle = context->int_cycle;
+ }*/
context->target_cycle = context->int_cycle < context->sync_cycle ? context->int_cycle : context->sync_cycle;
/*printf("Cyc: %d, Trgt: %d, Int Cyc: %d, Int: %d, Mask: %X, V: %d, H: %d, HICount: %d, HReg: %d, Line: %d\n",
@@ -242,6 +247,7 @@ m68k_context * sync_components(m68k_context * context, uint32_t address)
context->sync_cycle = gen->frame_end;
//printf("Set sync cycle to: %d @ %d, vcounter: %d, hslot: %d\n", context->sync_cycle, context->current_cycle, v_context->vcounter, v_context->hslot);
if (context->int_ack) {
+ printf("acknowledging %d @ %d:%d, vcounter: %d, hslot: %d\n", context->int_ack, context->current_cycle, v_context->cycles, v_context->vcounter, v_context->hslot);
vdp_int_ack(v_context, context->int_ack);
context->int_ack = 0;
}