Mercurial > repos > blastem
diff trans.c @ 2053:3414a4423de1 segacd
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 15 Jan 2022 13:15:21 -0800 |
parents | 7d4df6b74263 |
children | 638eb2d25696 339eff5dc350 |
line wrap: on
line diff
--- a/trans.c Sat Jan 05 00:58:08 2019 -0800 +++ b/trans.c Sat Jan 15 13:15:21 2022 -0800 @@ -4,7 +4,11 @@ BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. */ #include "68kinst.h" +#ifdef NEW_CORE +#include "m68k.h" +#else #include "m68k_core.h" +#endif #include "mem.h" #include <stdio.h> #include <stdlib.h> @@ -19,20 +23,28 @@ { } +#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; } return context; } +#endif 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; @@ -74,11 +86,17 @@ m68k_context * context = init_68k_context(&opts, reset_handler); context->mem_pointers[0] = memmap[0].buffer; context->mem_pointers[1] = memmap[1].buffer; - context->target_cycle = context->sync_cycle = 0x80000000; - uint32_t address; - address = filebuf[2] << 16 | filebuf[3]; - translate_m68k_stream(address, context); +#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 + m68k_execute(context, 8000); + puts("hit cycle limit"); +#endif return 0; }