From 85283ac5324a69eff69ad03bf0f9bb1eceb4a424 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Sat, 10 Apr 2010 15:50:08 +0000 Subject: [PATCH] Fixed RTL opcode in-bank issue in the G65816 CPU core [Angelo Salese] --- src/emu/cpu/g65816/g65816op.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/cpu/g65816/g65816op.h b/src/emu/cpu/g65816/g65816op.h index c456b7244f7..6c281125129 100644 --- a/src/emu/cpu/g65816/g65816op.h +++ b/src/emu/cpu/g65816/g65816op.h @@ -210,7 +210,7 @@ INLINE uint g65816i_pull_24(g65816i_cpu_struct *cpustate) { uint res = g65816i_pull_8(cpustate); res |= g65816i_pull_8(cpustate) << 8; - return res | (g65816i_pull_8(cpustate) << 16); + return ((res + 1) & 0xffff) | (g65816i_pull_8(cpustate) << 16); } @@ -1505,7 +1505,7 @@ INLINE uint EA_SIY(g65816i_cpu_struct *cpustate) {return MAKE_UINT_16(read_16_ #undef OP_RTL #define OP_RTL() \ CLK(6); \ - g65816i_jump_24(cpustate, g65816i_pull_24(cpustate)+1) + g65816i_jump_24(cpustate, g65816i_pull_24(cpustate)) /* M6502 Return from Subroutine */ /* Unusual behavior: Gets PC and increments */