diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-10-06 09:34:31 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-10-06 09:34:31 -0700 |
commit | 986b3641a1110e7dd1994c76ecb592420877f8f5 (patch) | |
tree | c6079b2fcbe228e3957dc435bad7d6e92e8a3c63 /trans.c | |
parent | 9b16317e1842af9b71837a43ffba04ca45689dcc (diff) |
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.
Diffstat (limited to 'trans.c')
-rw-r--r-- | trans.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |