summaryrefslogtreecommitdiff
path: root/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp
diff options
context:
space:
mode:
authorMarko Pusljar <LM1234@gmail.com>2010-03-24 14:51:04 +0000
committerMarko Pusljar <LM1234@gmail.com>2010-03-24 14:51:04 +0000
commit095f81e2f91844fe697f48d6bffd1f9476190f0e (patch)
tree219d1c753376a9e5397be15a1068b26c3bbebd29 /Source/Core/DSPCore/Src/DSPIntCCUtil.cpp
parent47239ce0f4bd61e3e95fb04bc185ae11d4872db4 (diff)
DSPLLE - 5 new conditions added (not used atm), 4 used ones are now correct
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5231 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPIntCCUtil.cpp')
-rw-r--r--Source/Core/DSPCore/Src/DSPIntCCUtil.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp b/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp
index f71f870452..fe19f57390 100644
--- a/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp
+++ b/Source/Core/DSPCore/Src/DSPIntCCUtil.cpp
@@ -128,8 +128,16 @@ inline bool isCarry() {
return (g_dsp.r[DSP_REG_SR] & SR_CARRY) ? true : false;
}
+inline bool isOverflow() {
+ return (g_dsp.r[DSP_REG_SR] & SR_OVERFLOW) ? true : false;
+}
+
+inline bool isOverS32() {
+ return (g_dsp.r[DSP_REG_SR] & SR_OVER_S32) ? true : false;
+}
+
inline bool isLess() {
- return ((g_dsp.r[DSP_REG_SR] & SR_OVERFLOW) != (g_dsp.r[DSP_REG_SR] & SR_SIGN));
+ return ((bool)(g_dsp.r[DSP_REG_SR] & SR_OVERFLOW) != (bool)(g_dsp.r[DSP_REG_SR] & SR_SIGN));
}
inline bool isZero() {
@@ -140,6 +148,10 @@ inline bool isLogicZero() {
return (g_dsp.r[DSP_REG_SR] & SR_LOGIC_ZERO) ? true : false;
}
+inline bool isConditionA() {
+ return (((g_dsp.r[DSP_REG_SR] & SR_OVER_S32) || (g_dsp.r[DSP_REG_SR] & SR_TOP2BITS)) && !(g_dsp.r[DSP_REG_SR] & SR_ARITH_ZERO)) ? true : false;
+}
+
//see gdsp_registers.h for flags
bool CheckCondition(u8 _Condition)
{
@@ -161,11 +173,20 @@ bool CheckCondition(u8 _Condition)
return !isCarry();
case 0x7: // C - Carry
return isCarry();
+ case 0x8: // ? - Not over s32
+ return !isOverS32();
+ case 0x9: // ? - Over s32
+ return isOverS32();
+ case 0xa: // ?
+ return isConditionA();
+ case 0xb: // ?
+ return !isConditionA();
case 0xc: // LNZ - Logic Not Zero
return !isLogicZero();
case 0xd: // LZ - Logic Zero
return isLogicZero();
-
+ case 0xe: // 0 - Overflow
+ return isOverflow();
case 0xf: // Empty - always true.
return true;
default: