diff --git a/Source/Core/DSPCore/Src/DSPHWInterface.cpp b/Source/Core/DSPCore/Src/DSPHWInterface.cpp index 13cf6edeb5..8185f0071a 100644 --- a/Source/Core/DSPCore/Src/DSPHWInterface.cpp +++ b/Source/Core/DSPCore/Src/DSPHWInterface.cpp @@ -23,8 +23,6 @@ ====================================================================*/ -#include - #include "Thread.h" #include "MemoryUtil.h" diff --git a/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp b/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp index 75c72920c8..9b439dade8 100644 --- a/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp +++ b/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp @@ -157,6 +157,8 @@ bool CheckCondition(u8 _Condition) { switch (_Condition & 0xf) { + case 0xf: // Always true. + return true; case 0x0: // GE - Greater Equal return !isLess(); case 0x1: // L - Less @@ -187,8 +189,6 @@ bool CheckCondition(u8 _Condition) return isLogicZero(); case 0xe: // 0 - Overflow return isOverflow(); - case 0xf: // Empty - always true. - return true; default: return true; } diff --git a/Source/Core/DSPCore/Src/DSPInterpreter.cpp b/Source/Core/DSPCore/Src/DSPInterpreter.cpp index f2b1c8f181..54c2f60322 100644 --- a/Source/Core/DSPCore/Src/DSPInterpreter.cpp +++ b/Source/Core/DSPCore/Src/DSPInterpreter.cpp @@ -23,9 +23,6 @@ ====================================================================*/ -#include -#include - #include "DSPTables.h" #include "DSPHost.h" #include "DSPCore.h" diff --git a/Source/Core/DSPCore/Src/DSPMemoryMap.cpp b/Source/Core/DSPCore/Src/DSPMemoryMap.cpp index 659c179122..408cb48465 100644 --- a/Source/Core/DSPCore/Src/DSPMemoryMap.cpp +++ b/Source/Core/DSPCore/Src/DSPMemoryMap.cpp @@ -23,8 +23,6 @@ ====================================================================*/ -#include - #include "DSPInterpreter.h" #include "DSPMemoryMap.h" #include "DSPHWInterface.h" @@ -36,8 +34,10 @@ u16 dsp_imem_read(u16 addr) { case 0: // 0xxx IRAM return g_dsp.iram[addr & DSP_IRAM_MASK]; + case 8: // 8xxx IROM - contains code to receive code for IRAM, and a bunch of mixing loops. return g_dsp.irom[addr & DSP_IROM_MASK]; + default: // Unmapped/non-existing memory ERROR_LOG(DSPLLE, "%04x DSP ERROR: Executing from invalid (%04x) memory", g_dsp.pc, addr); return 0; @@ -72,10 +72,6 @@ void dsp_dmem_write(u16 addr, u16 val) g_dsp.dram[addr & DSP_DRAM_MASK] = val; break; - case 0x1: // 1xxx COEF - ERROR_LOG(DSPLLE, "Illegal write to COEF (pc = %02x)", g_dsp.pc); - break; - case 0xf: // Fxxx HW regs gdsp_ifx_write(addr, val); break; diff --git a/Source/Core/DSPCore/Src/DSPTables.h b/Source/Core/DSPCore/Src/DSPTables.h index 889e85c18a..06bfcaa519 100644 --- a/Source/Core/DSPCore/Src/DSPTables.h +++ b/Source/Core/DSPCore/Src/DSPTables.h @@ -106,7 +106,7 @@ extern const DSPOPCTemplate opcodes_ext[]; extern const int opcodes_ext_size; extern const DSPOPCTemplate cw; -#define WRITEBACKLOGSIZE 7 +#define WRITEBACKLOGSIZE 5 extern const DSPOPCTemplate *opTable[OPTABLE_SIZE]; extern const DSPOPCTemplate *extOpTable[EXT_OPTABLE_SIZE]; diff --git a/Source/Core/DSPCore/Src/DspIntMultiplier.cpp b/Source/Core/DSPCore/Src/DspIntMultiplier.cpp index f4b9ad5115..a4e4594ea4 100644 --- a/Source/Core/DSPCore/Src/DspIntMultiplier.cpp +++ b/Source/Core/DSPCore/Src/DspIntMultiplier.cpp @@ -33,11 +33,11 @@ inline s64 dsp_get_multiply_prod(u16 a, u16 b, u8 sign) s64 prod; if ((sign == 1) && (g_dsp.r[DSP_REG_SR] & SR_MUL_UNSIGNED)) //unsigned - prod = (u64)a * (u64)b; + prod = a * b; else if ((sign == 2) && (g_dsp.r[DSP_REG_SR] & SR_MUL_UNSIGNED)) //mixed - prod = (u64)a * (s64)(s16)b; + prod = a * (s16)b; else - prod = (s64)(s16)a * (s64)(s16)b; //signed + prod = (s16)a * (s16)b; //signed // Conditionally multiply by 2. if ((g_dsp.r[DSP_REG_SR] & SR_MUL_MODIFY) == 0) @@ -60,7 +60,7 @@ inline s64 dsp_multiply_add(u16 a, u16 b, u8 sign = 0) inline s64 dsp_multiply_sub(u16 a, u16 b, u8 sign = 0) { - s64 prod = dsp_get_long_prod() - dsp_get_multiply_prod(a, b, sign); + s64 prod = dsp_get_long_prod() - dsp_get_multiply_prod(a, b, sign); return prod; } @@ -71,9 +71,9 @@ inline s64 dsp_multiply_mulx(u8 axh0, u8 axh1, u16 val1, u16 val2) if ((axh0==0) && (axh1==0)) result = dsp_multiply(val1, val2, 1); // unsigned support ON if both ax?.l regs are used else if ((axh0==0) && (axh1==1)) - result = dsp_multiply(val1, val2, 2); // mixed support ON (u64)axl.0 * (s64)(s16)axh.1 + result = dsp_multiply(val1, val2, 2); // mixed support ON (u16)axl.0 * (s16)axh.1 else if ((axh0==1) && (axh1==0)) - result = dsp_multiply(val2, val1, 2); // mixed support ON (u64)axl.1 * (s64)(s16)axh.0 + result = dsp_multiply(val2, val1, 2); // mixed support ON (u16)axl.1 * (s16)axh.0 else result = dsp_multiply(val1, val2, 0); // unsigned support OFF if both ax?.h regs are used diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/DSPHost.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/DSPHost.cpp index 98dd1be44a..3f9b387baa 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/DSPHost.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/DSPHost.cpp @@ -66,7 +66,10 @@ void DSPHost_InterruptRequest() u32 DSPHost_CodeLoaded(const u8 *ptr, int size) { u32 crc = GenerateCRC(ptr, size); + +#if defined(_DEBUG) || defined(DEBUGFAST) DumpDSPCode(ptr, size, crc); +#endif // HLE plugin uses this crc method u32 ector_crc = HashEctor(ptr, size);