diff options
| author | Marko Pusljar <LM1234@gmail.com> | 2010-08-14 09:07:28 +0000 |
|---|---|---|
| committer | Marko Pusljar <LM1234@gmail.com> | 2010-08-14 09:07:28 +0000 |
| commit | 0a606d73565963fcdc4f5d7f209c61853e5bf1d0 (patch) | |
| tree | 07c732a3885b0c3522f3e0f3dad9db505ef045ac /Source/Core | |
| parent | 5cef906467217d308dd0d8224dea3d3feeb0d2fa (diff) | |
fixes for my previous commits
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6095 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPCore.h | 2 | ||||
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPIntExtOps.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPIntUtil.h | 22 |
3 files changed, 10 insertions, 24 deletions
diff --git a/Source/Core/DSPCore/Src/DSPCore.h b/Source/Core/DSPCore/Src/DSPCore.h index aa14272447..92cb8516bf 100644 --- a/Source/Core/DSPCore/Src/DSPCore.h +++ b/Source/Core/DSPCore/Src/DSPCore.h @@ -163,7 +163,7 @@ #define SR_INT_ENABLE 0x0200 // Not 100% sure but duddie says so. This should replace the hack, if so. #define SR_400 0x0400 // unknown #define SR_EXT_INT_ENABLE 0x0800 // Appears in zelda - seems to disable external interupts -#define SR_ROUNDING_MODE 0x1000 // 0 - convergent rounding, 1 - twos complement rounding (source: motorola DSP56?00FM.pdf-s) +#define SR_1000 0x1000 // unknown #define SR_MUL_MODIFY 0x2000 // 1 = normal. 0 = x2 (M0, M2) #define SR_40_MODE_BIT 0x4000 // 0 = "16", 1 = "40" (SET16, SET40) Controls sign extension when loading mid accums. #define SR_MUL_UNSIGNED 0x8000 // 0 = normal. 1 = unsigned (CLR15, SET15) If set, treats operands as unsigned. Tested with mulx only so far. diff --git a/Source/Core/DSPCore/Src/DSPIntExtOps.cpp b/Source/Core/DSPCore/Src/DSPIntExtOps.cpp index 0928d57af7..0486d2a238 100644 --- a/Source/Core/DSPCore/Src/DSPIntExtOps.cpp +++ b/Source/Core/DSPCore/Src/DSPIntExtOps.cpp @@ -74,12 +74,7 @@ void mv(const UDSPInstruction opc) u8 sreg = (opc & 0x3) + DSP_REG_ACL0; u8 dreg = ((opc >> 2) & 0x3); -#if 0 //more tests - if ((sreg >= DSP_REG_ACM0) && (g_dsp.r[DSP_REG_SR] & SR_40_MODE_BIT)) - writeToBackLog(0, dreg + DSP_REG_AXL0, ((u16)dsp_get_acc_h(sreg-DSP_REG_ACM0) & 0x0080) ? 0x8000 : 0x7fff); - else -#endif - writeToBackLog(0, dreg + DSP_REG_AXL0, g_dsp.r[sreg]); + writeToBackLog(0, dreg + DSP_REG_AXL0, g_dsp.r[sreg]); } // S @$arD, $acS.S @@ -475,7 +470,8 @@ void zeroWriteBackLog() } } -//needed for 0x3... +//needed for 0x3... cases when main and extended are modifying the same ACC +//games are not doing that + in motorola (similar dsp) dox this is forbidden to do //ex. corner case -> 0x3060: main opcode modifies .m, and extended .l -> .l shoudnt be zeroed because of .m write... void zeroWriteBackLogPreserveAcc(u8 acc) { diff --git a/Source/Core/DSPCore/Src/DSPIntUtil.h b/Source/Core/DSPCore/Src/DSPIntUtil.h index fa0c0e3ebe..8e8e286ff7 100644 --- a/Source/Core/DSPCore/Src/DSPIntUtil.h +++ b/Source/Core/DSPCore/Src/DSPIntUtil.h @@ -214,15 +214,10 @@ inline s64 dsp_get_long_prod_round_prodl() { s64 prod = dsp_get_long_prod(); - if (g_dsp.r[DSP_REG_SR] & SR_ROUNDING_MODE) + if (prod & 0x10000) prod = (prod + 0x8000) & ~0xffff; - else - { - if (prod & 0x10000) - prod = (prod + 0x8000) & ~0xffff; - else - prod = (prod + 0x7fff) & ~0xffff; - } + else + prod = (prod + 0x7fff) & ~0xffff; return prod; } @@ -280,15 +275,10 @@ inline s64 dsp_convert_long_acc(s64 val) // s64 -> s40 inline s64 dsp_round_long_acc(s64 val) { - if (g_dsp.r[DSP_REG_SR] & SR_ROUNDING_MODE) + if (val & 0x10000) val = (val + 0x8000) & ~0xffff; - else - { - if (val & 0x10000) - val = (val + 0x8000) & ~0xffff; - else - val = (val + 0x7fff) & ~0xffff; - } + else + val = (val + 0x7fff) & ~0xffff; return val; } |
