From 986b3641a1110e7dd1994c76ecb592420877f8f5 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 6 Oct 2016 09:34:31 -0700 Subject: Add support for specifying a reset handler in the M68K core. Adjust memory map initialization to handle extra field. Improved handling of out of bounds execution. --- trans.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'trans.c') diff --git a/trans.c b/trans.c index 7dd21fd..bdde49c 100644 --- a/trans.c +++ b/trans.c @@ -27,6 +27,14 @@ m68k_context * sync_components(m68k_context * context, uint32_t address) return context; } +m68k_context *reset_handler(m68k_context *context) +{ + m68k_print_regs(context); + exit(0); + //unreachable + return context; +} + int main(int argc, char ** argv) { long filesize; @@ -60,7 +68,7 @@ int main(int argc, char ** argv) memmap[1].buffer = malloc(64 * 1024); memset(memmap[1].buffer, 0, 64 * 1024); init_m68k_opts(&opts, memmap, 2, 1); - m68k_context * context = init_68k_context(&opts); + 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; -- cgit v1.2.3