# HG changeset patch # User Mike Pavone # Date 1354677954 28800 # Node ID 4717146a7606329561d03a7dfad92e703f3007bb # Parent 3e7bfde7606e72191108ae0f596b9e7d48cb87fc Initial support for M68k reset vector, rather than starting at an arbitrary address diff -r 3e7bfde7606e -r 4717146a7606 fib.s68 --- a/fib.s68 Tue Dec 04 19:13:12 2012 -0800 +++ b/fib.s68 Tue Dec 04 19:25:54 2012 -0800 @@ -1,4 +1,5 @@ - lea 0, a7 + dc.l $0, start +start: moveq #10, d0 bsr fib illegal diff -r 3e7bfde7606e -r 4717146a7606 m68k_to_x86.c --- a/m68k_to_x86.c Tue Dec 04 19:13:12 2012 -0800 +++ b/m68k_to_x86.c Tue Dec 04 19:25:54 2012 -0800 @@ -786,6 +786,14 @@ m68k_start_context(addr, context); } +void m68k_reset(m68k_context * context) +{ + //TODO: Make this actually use the normal read functions + context->aregs[7] = context->mem_pointers[0][0] << 16 | context->mem_pointers[0][1]; + uint32_t address = context->mem_pointers[0][2] << 16 | context->mem_pointers[0][3]; + start_68k_context(context, address); +} + void init_x86_68k_opts(x86_68k_options * opts) { opts->flags = 0; diff -r 3e7bfde7606e -r 4717146a7606 trans.c --- a/trans.c Tue Dec 04 19:13:12 2012 -0800 +++ b/trans.c Tue Dec 04 19:25:54 2012 -0800 @@ -34,6 +34,6 @@ //work RAM context.mem_pointers[1] = malloc(64 * 1024); translate_m68k_stream(transbuf, transbuf + size, 0, &context); - start_68k_context(&context, 0); + m68k_reset(&context); return 0; }