diff options
| author | hrydgard <hrydgard@gmail.com> | 2010-01-12 21:38:39 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2010-01-12 21:38:39 +0000 |
| commit | af08186daa2265763424dc79a77f6690f910dd5a (patch) | |
| tree | c17550efa80a544b8132430eae3affb386ed8e7e /Source/Core/DSPCore/Src/DSPIntExtOps.cpp | |
| parent | 532ab905c452bd848e9c82c57dbd68f51b22c02e (diff) | |
DSP comments & minor reorganization (moved all DSP state into the g_dsp struct). No functionality change.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4813 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPIntExtOps.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPIntExtOps.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/Core/DSPCore/Src/DSPIntExtOps.cpp b/Source/Core/DSPCore/Src/DSPIntExtOps.cpp index 69145be540..a843d2c1e7 100644 --- a/Source/Core/DSPCore/Src/DSPIntExtOps.cpp +++ b/Source/Core/DSPCore/Src/DSPIntExtOps.cpp @@ -427,11 +427,15 @@ void nop(const UDSPInstruction& opc) } // end namespace ext } // end namespace DSPInterpeter + +// The Writebacklog needs more commenting. It seems to be a way of writing values from the +// "beginning" of the execution of an instruction, at the end of the execution. + void applyWriteBackLog() { - //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++) { + // 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; @@ -440,9 +444,13 @@ void applyWriteBackLog() void zeroWriteBackLog() { - //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++) + // always make sure to have an extra entry at the end w/ -1 to avoid + // infinitive loops + + // What does this actually do? It just writes zeroes to registers that are + // mentioned in the write back log, without checking that the indexes aren't -1. + // Doesn't really seem sane - shouldn't it check for -1, at least? + for (int i = 0; writeBackLogIdx[i] != -1; i++) dsp_op_write_reg(writeBackLogIdx[i], 0); } |
