comparison z80_to_x86.c @ 1117:928a65750345

Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
author Michael Pavone <pavone@retrodev.com>
date Thu, 22 Dec 2016 19:51:25 -0800
parents fe8c79f82c22
children 8f14767661fa
comparison
equal deleted inserted replaced
1116:fe8c79f82c22 1117:928a65750345
3474 pop_r(code, options->gen.context_reg); 3474 pop_r(code, options->gen.context_reg);
3475 mov_rr(code, RAX, options->gen.scratch1, SZ_PTR); 3475 mov_rr(code, RAX, options->gen.scratch1, SZ_PTR);
3476 call(code, options->gen.load_context); 3476 call(code, options->gen.load_context);
3477 jmp_r(code, options->gen.scratch1); 3477 jmp_r(code, options->gen.scratch1);
3478 3478
3479 options->run = (z80_run_fun)code->cur; 3479 options->run = code->cur;
3480 tmp_stack_off = code->stack_off; 3480 tmp_stack_off = code->stack_off;
3481 save_callee_save_regs(code); 3481 save_callee_save_regs(code);
3482 #ifdef X86_64 3482 #ifdef X86_64
3483 mov_rr(code, RDI, options->gen.context_reg, SZ_PTR); 3483 mov_rr(code, RDI, options->gen.context_reg, SZ_PTR);
3484 #else 3484 #else
3523 if (!context->native_pc) { 3523 if (!context->native_pc) {
3524 context->native_pc = z80_get_native_address_trans(context, context->pc); 3524 context->native_pc = z80_get_native_address_trans(context, context->pc);
3525 } 3525 }
3526 while (context->current_cycle < context->sync_cycle) 3526 while (context->current_cycle < context->sync_cycle)
3527 { 3527 {
3528 if (context->int_pulse_end < context->current_cycle || context->int_pulse_end == CYCLE_NEVER) { 3528 if (context->next_int_pulse && (context->int_pulse_end < context->current_cycle || context->int_pulse_end == CYCLE_NEVER)) {
3529 z80_next_int_pulse(context); 3529 context->next_int_pulse(context);
3530 } 3530 }
3531 if (context->iff1) { 3531 if (context->iff1) {
3532 context->int_cycle = context->int_pulse_start < context->int_enable_cycle ? context->int_enable_cycle : context->int_pulse_start; 3532 context->int_cycle = context->int_pulse_start < context->int_enable_cycle ? context->int_enable_cycle : context->int_pulse_start;
3533 } else { 3533 } else {
3534 context->int_cycle = CYCLE_NEVER; 3534 context->int_cycle = CYCLE_NEVER;
3621 } 3621 }
3622 if (context->int_pulse_start != CYCLE_NEVER) { 3622 if (context->int_pulse_start != CYCLE_NEVER) {
3623 if (context->int_pulse_end < deduction) { 3623 if (context->int_pulse_end < deduction) {
3624 context->int_pulse_start = context->int_pulse_end = CYCLE_NEVER; 3624 context->int_pulse_start = context->int_pulse_end = CYCLE_NEVER;
3625 } else { 3625 } else {
3626 context->int_pulse_end -= deduction; 3626 if (context->int_pulse_end != CYCLE_NEVER) {
3627 context->int_pulse_end -= deduction;
3628 }
3627 if (context->int_pulse_start < deduction) { 3629 if (context->int_pulse_start < deduction) {
3628 context->int_pulse_start = 0; 3630 context->int_pulse_start = 0;
3629 } else { 3631 } else {
3630 context->int_pulse_start -= deduction; 3632 context->int_pulse_start -= deduction;
3631 } 3633 }