diff options
Diffstat (limited to 'trans.c')
-rw-r--r-- | trans.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -26,8 +26,9 @@ void render_infobox(char * title, char * buf) #ifndef NEW_CORE m68k_context * sync_components(m68k_context * context, uint32_t address) { - if (context->current_cycle > 0x80000000) { - context->current_cycle -= 0x80000000; + if (context->current_cycle >= context->target_cycle) { + puts("hit cycle limit"); + exit(0); } if (context->status & M68K_STATUS_TRACE || context->trace_pending) { context->target_cycle = context->current_cycle; @@ -39,6 +40,11 @@ m68k_context * sync_components(m68k_context * context, uint32_t address) m68k_context *reset_handler(m68k_context *context) { m68k_print_regs(context); +#ifdef NEW_CORE + printf("cycles: %d\n", context->cycles); +#else + printf("cycles: %d\n", context->current_cycle); +#endif exit(0); //unreachable return context; @@ -80,16 +86,16 @@ int main(int argc, char ** argv) m68k_context * context = init_68k_context(&opts, reset_handler); context->mem_pointers[0] = memmap[0].buffer; context->mem_pointers[1] = memmap[1].buffer; -#ifndef NEW_CORE - context->target_cycle = context->sync_cycle = 0x80000000; +#ifdef NEW_CORE + context->cycles = 40; +#else + context->current_cycle = 40; + context->target_cycle = context->sync_cycle = 8000; #endif m68k_reset(context); #ifdef NEW_CORE - for (;;) - { - m68k_execute(context, 0x80000000); - context->cycles = 0; - } + m68k_execute(context, 8000); + puts("hit cycle limit"); #endif return 0; } |