From 4e80fcf1c5b363cd04927988c2cbdbe26b6e01a5 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Tue, 29 Jan 2013 23:27:08 +0000 Subject: [PATCH] Illegal opcode is the start of the undefined address --- src/emu/cpu/sh2/sh2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c index a9754df8a08..88156208635 100644 --- a/src/emu/cpu/sh2/sh2.c +++ b/src/emu/cpu/sh2/sh2.c @@ -848,11 +848,11 @@ INLINE void EXTUW(sh2_state *sh2, UINT32 m, UINT32 n) /* ILLEGAL */ INLINE void ILLEGAL(sh2_state *sh2) { - logerror("SH2.%s: Illegal opcode at %08x\n", sh2->device->tag(), sh2->pc); + logerror("SH2.%s: Illegal opcode at %08x\n", sh2->device->tag(), sh2->pc - 2); sh2->r[15] -= 4; WL( sh2, sh2->r[15], sh2->sr ); /* push SR onto stack */ sh2->r[15] -= 4; - WL( sh2, sh2->r[15], sh2->pc ); /* push PC onto stack */ + WL( sh2, sh2->r[15], sh2->pc - 2 ); /* push PC onto stack */ /* fetch PC */ sh2->pc = RL( sh2, sh2->vbr + 4 * 4 );