diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-12-22 19:51:25 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-12-22 19:51:25 -0800 |
commit | b5e17ec13a758bf4aaa660dae72b02614f2528b1 (patch) | |
tree | 3e6f1052eb5ef26e1af6d90bc35e9b0ff140dee4 /z80_to_x86.c | |
parent | 0ce85adad77df67b6637d2160fdeccefbfd4790d (diff) |
Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Diffstat (limited to 'z80_to_x86.c')
-rw-r--r-- | z80_to_x86.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c index ee472f7..df7baeb 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -3476,7 +3476,7 @@ void init_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t call(code, options->gen.load_context); jmp_r(code, options->gen.scratch1); - options->run = (z80_run_fun)code->cur; + options->run = code->cur; tmp_stack_off = code->stack_off; save_callee_save_regs(code); #ifdef X86_64 @@ -3525,8 +3525,8 @@ void z80_run(z80_context * context, uint32_t target_cycle) } while (context->current_cycle < context->sync_cycle) { - if (context->int_pulse_end < context->current_cycle || context->int_pulse_end == CYCLE_NEVER) { - z80_next_int_pulse(context); + if (context->next_int_pulse && (context->int_pulse_end < context->current_cycle || context->int_pulse_end == CYCLE_NEVER)) { + context->next_int_pulse(context); } if (context->iff1) { context->int_cycle = context->int_pulse_start < context->int_enable_cycle ? context->int_enable_cycle : context->int_pulse_start; @@ -3623,7 +3623,9 @@ void z80_adjust_cycles(z80_context * context, uint32_t deduction) if (context->int_pulse_end < deduction) { context->int_pulse_start = context->int_pulse_end = CYCLE_NEVER; } else { - context->int_pulse_end -= deduction; + if (context->int_pulse_end != CYCLE_NEVER) { + context->int_pulse_end -= deduction; + } if (context->int_pulse_start < deduction) { context->int_pulse_start = 0; } else { |