From 92d4c55e14ea1f91a56d294a7372a11dfaaa0beb Mon Sep 17 00:00:00 2001 From: nakeee Date: Thu, 20 Aug 2009 22:09:54 +0000 Subject: [PATCH] DSPLLE small sign fix git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4023 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPIntUtil.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Core/DSPCore/Src/DSPIntUtil.h b/Source/Core/DSPCore/Src/DSPIntUtil.h index 86ba5f316b..36af7021a5 100644 --- a/Source/Core/DSPCore/Src/DSPIntUtil.h +++ b/Source/Core/DSPCore/Src/DSPIntUtil.h @@ -58,10 +58,10 @@ inline u16 ToMask(u16 a) return a | (a >> 1); } -inline u16 dsp_increment_addr_reg(int reg, int value = -1) +inline s16 dsp_increment_addr_reg(int reg, s32 value = -1) { u16 tmb = ToMask(g_dsp.r[DSP_REG_WR0 + reg]); - u16 tmp; + s16 tmp; if (value == -1) tmp = g_dsp.r[reg]; else @@ -76,9 +76,9 @@ inline u16 dsp_increment_addr_reg(int reg, int value = -1) } // See http://code.google.com/p/dolphin-emu/source/detail?r=3125 -inline u16 dsp_decrement_addr_reg(int reg, int value = -1) +inline s16 dsp_decrement_addr_reg(int reg, s32 value = -1) { - u16 tmp; + s16 tmp; if (value == -1) tmp = g_dsp.r[reg]; else @@ -93,9 +93,9 @@ inline u16 dsp_decrement_addr_reg(int reg, int value = -1) return tmp; } -inline u16 dsp_increase_addr_reg(int reg, s16 value) +inline s16 dsp_increase_addr_reg(int reg, s16 value) { - u16 tmp = - 1; + s16 tmp = - 1; // TODO: DO RIGHT! if (value > 0) { @@ -106,7 +106,8 @@ inline u16 dsp_increase_addr_reg(int reg, s16 value) for (int i = 0; i < (int)(-value); i++) { tmp = dsp_decrement_addr_reg(reg, tmp); } - } + } else + tmp = g_dsp.r[reg]; return tmp; }