diff options
| author | nakeee <nakeee@gmail.com> | 2009-08-20 07:01:04 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2009-08-20 07:01:04 +0000 |
| commit | 56c4eea4c1773ee14f46238c124e918534fd6bca (patch) | |
| tree | 848f00d23e19b8395d594b3ce1db2e274b8211e7 /Source/Core/DSPCore/Src/DSPIntExtOps.cpp | |
| parent | b787f5f8f7709cff763c2f3a13b90455a0c8ee18 (diff) | |
DSPLLE: trying to optimize a bit (based on drkrazi's suggestion)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4019 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPIntExtOps.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPIntExtOps.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/Core/DSPCore/Src/DSPIntExtOps.cpp b/Source/Core/DSPCore/Src/DSPIntExtOps.cpp index 37e803bdb3..124869ca8e 100644 --- a/Source/Core/DSPCore/Src/DSPIntExtOps.cpp +++ b/Source/Core/DSPCore/Src/DSPIntExtOps.cpp @@ -378,21 +378,22 @@ void nop(const UDSPInstruction& opc) } // end namespace ext } // end namespace DSPInterpeter -void applyWriteBackLog() +void applyWriteBackLog() { - for (int i=0;i < WRITEBACKLOGSIZE;i++) { - - if (writeBackLogIdx[i] != -1) { - dsp_op_write_reg(writeBackLogIdx[i], g_dsp.r[writeBackLogIdx[i]] | writeBackLog[i]); - // Clear back log - writeBackLogIdx[i] = -1; - } + //always make sure to have an extra entry at the end w/ -1 to avoid + //infinitive loops + for (int i=0;writeBackLogIdx[i]!=-1;i++) { + dsp_op_write_reg(writeBackLogIdx[i], g_dsp.r[writeBackLogIdx[i]] | writeBackLog[i]); + // Clear back log + writeBackLogIdx[i] = -1; } -} +} void zeroWriteBackLog() { - for (int i=0;i < WRITEBACKLOGSIZE;i++) - if (writeBackLogIdx[i] != -1) - dsp_op_write_reg(writeBackLogIdx[i], 0); + //always make sure to have an extra entry at the end w/ -1 to avoid + //infinitive loops + for (int i=0;writeBackLogIdx[i]!=-1;i++) + dsp_op_write_reg(writeBackLogIdx[i], 0); } + |
