diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-05-10 21:26:27 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-05-10 21:26:27 -0700 |
commit | 924eb3bc27ae38901da618cb9d5c0ee82d651749 (patch) | |
tree | 41748887641eadff9d04e79e0a47bd845148b7a8 | |
parent | bfc49a8c524c098f5df0244e7329dfe5d6702acb (diff) |
Fix PC value pushed to stack for A and F line traps
-rw-r--r-- | m68k_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/m68k_core.c b/m68k_core.c index 799102e..812e00a 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -334,11 +334,12 @@ void translate_m68k_rtr(m68k_options *opts, m68kinst * inst) void translate_m68k_trap(m68k_options *opts, m68kinst *inst) { code_info *code = &opts->gen.code; - uint32_t vector; + uint32_t vector, pc = inst->address; switch (inst->op) { case M68K_TRAP: vector = inst->src.params.immed + VECTOR_TRAP_0; + pc += 2; break; case M68K_A_LINE_TRAP: vector = VECTOR_LINE_1010; @@ -348,7 +349,7 @@ void translate_m68k_trap(m68k_options *opts, m68kinst *inst) break; } ldi_native(opts, vector, opts->gen.scratch2); - ldi_native(opts, inst->address+2, opts->gen.scratch1); + ldi_native(opts, pc, opts->gen.scratch1); jmp(code, opts->trap); } |