From 8e6dd97fda77ef339e8b9d30968c28bf40c291e2 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Wed, 5 Oct 2011 01:30:01 +0000 Subject: [PATCH] Fixed some typos made in sh4.c - trap behavior definitely needs checking. According to both the sh3 and sh4 docs what we're doing was wrong. From Haze (nw) --- src/emu/cpu/sh4/sh4.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index 3aa94f92ec0..8aef285bc7c 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -1708,13 +1708,15 @@ INLINE void TRAPA(sh4_state *sh4, UINT32 i) { UINT32 imm = i & 0xff; + /* << 2 according to docs, but this doesn't seem to work any better? */ + if (sh4->cpu_type == CPU_TYPE_SH4) { - sh4->m[SH3_TRA] = imm; + sh4->m[TRA] = imm << 2; } else /* SH3 */ { - sh4->m_sh3internal_upper[SH3_TRA] = imm; + sh4->m_sh3internal_upper[SH3_TRA] = imm << 2; } @@ -1733,7 +1735,7 @@ INLINE void TRAPA(sh4_state *sh4, UINT32 i) if (sh4->cpu_type == CPU_TYPE_SH4) { - sh4->m[SH3_EXPEVT] = 0x00000160; + sh4->m[EXPEVT] = 0x00000160; } else /* SH3 */ {