diff trans.c @ 1082:2ec5e6eaf81d

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.
author Michael Pavone <pavone@retrodev.com>
date Thu, 06 Oct 2016 09:34:31 -0700
parents 124a58fdcf3a
children 208803173ebc
line wrap: on
line diff
--- a/trans.c	Thu Oct 06 09:25:43 2016 -0700
+++ b/trans.c	Thu Oct 06 09:34:31 2016 -0700
@@ -27,6 +27,14 @@
 	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 @@
 	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;