summaryrefslogtreecommitdiff
path: root/Source/UnitTests/AudioJitTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/UnitTests/AudioJitTests.cpp')
-rw-r--r--Source/UnitTests/AudioJitTests.cpp166
1 files changed, 83 insertions, 83 deletions
diff --git a/Source/UnitTests/AudioJitTests.cpp b/Source/UnitTests/AudioJitTests.cpp
index 2247f529b5..db17e24926 100644
--- a/Source/UnitTests/AudioJitTests.cpp
+++ b/Source/UnitTests/AudioJitTests.cpp
@@ -1,84 +1,84 @@
-#include "DSPJitTester.h"
-
-void nx_dr()
-{
- SDSP test_dsp;
- DSPJitTester tester(0x40, 0x04);
-
- for (u16 input_reg = 0; input_reg < 50; input_reg++)
- for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
- {
- memset(&test_dsp, 0, sizeof(SDSP));
- test_dsp.r[DSP_REG_WR0] = input_wr0;
- test_dsp.r[0] = input_reg;
- if (!tester.Test(test_dsp))
- {
- printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
- tester.GetInstructionName(),
- input_reg, input_wr0,
- tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
- }
- }
- tester.Report();
-}
-
-void nx_ir()
-{
- SDSP test_dsp;
- DSPJitTester tester(0x40, 0x08);
-
- for (u16 input_reg = 0; input_reg < 50; input_reg++)
- for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
- {
- memset(&test_dsp, 0, sizeof(SDSP));
- test_dsp.r[DSP_REG_WR0] = input_wr0;
- test_dsp.r[0] = input_reg;
- if (!tester.Test(test_dsp))
- {
- printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
- tester.GetInstructionName(),
- input_reg, input_wr0,
- tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
- }
- }
- tester.Report();
-}
-
-void nx_nr()
-{
- SDSP test_dsp;
- DSPJitTester tester(0x40, 0x0c);
-
- for (u16 input_reg = 0; input_reg < 50; input_reg++)
- for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
- {
- memset(&test_dsp, 0, sizeof(SDSP));
- test_dsp.r[DSP_REG_WR0] = input_wr0;
- test_dsp.r[0] = input_reg;
- if (!tester.Test(test_dsp))
- {
- printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
- tester.GetInstructionName(),
- input_reg, input_wr0,
- tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
- }
- }
- tester.Report();
-}
-
-void AudioJitTests()
-{
- DSPJitTester::Initialize();
-
- nx_ir();
- nx_dr();
- //nx_nr();
-}
-
-//required to be able to link against DSPCore
-void DSPHost_UpdateDebugger() { }
-unsigned int DSPHost_CodeLoaded(unsigned const char*, int) { return 0; }
-void DSPHost_InterruptRequest() { }
-bool DSPHost_OnThread() { return false; }
-void DSPHost_WriteHostMemory(unsigned char, unsigned int) { }
+#include "DSPJitTester.h"
+
+void nx_dr()
+{
+ SDSP test_dsp;
+ DSPJitTester tester(0x40, 0x04);
+
+ for (u16 input_reg = 0; input_reg < 50; input_reg++)
+ for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
+ {
+ memset(&test_dsp, 0, sizeof(SDSP));
+ test_dsp.r[DSP_REG_WR0] = input_wr0;
+ test_dsp.r[0] = input_reg;
+ if (!tester.Test(test_dsp))
+ {
+ printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
+ tester.GetInstructionName(),
+ input_reg, input_wr0,
+ tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
+ }
+ }
+ tester.Report();
+}
+
+void nx_ir()
+{
+ SDSP test_dsp;
+ DSPJitTester tester(0x40, 0x08);
+
+ for (u16 input_reg = 0; input_reg < 50; input_reg++)
+ for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
+ {
+ memset(&test_dsp, 0, sizeof(SDSP));
+ test_dsp.r[DSP_REG_WR0] = input_wr0;
+ test_dsp.r[0] = input_reg;
+ if (!tester.Test(test_dsp))
+ {
+ printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
+ tester.GetInstructionName(),
+ input_reg, input_wr0,
+ tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
+ }
+ }
+ tester.Report();
+}
+
+void nx_nr()
+{
+ SDSP test_dsp;
+ DSPJitTester tester(0x40, 0x0c);
+
+ for (u16 input_reg = 0; input_reg < 50; input_reg++)
+ for (u16 input_wr0 = 0; input_wr0 < 10; input_wr0++)
+ {
+ memset(&test_dsp, 0, sizeof(SDSP));
+ test_dsp.r[DSP_REG_WR0] = input_wr0;
+ test_dsp.r[0] = input_reg;
+ if (!tester.Test(test_dsp))
+ {
+ printf("%s Test failed: in = 0x%04x, wr0 = 0x%04x > int = 0x%04x, jit = 0x%04x\n",
+ tester.GetInstructionName(),
+ input_reg, input_wr0,
+ tester.GetLastInterpreterDSP().r[0], tester.GetLastJitDSP().r[0]);
+ }
+ }
+ tester.Report();
+}
+
+void AudioJitTests()
+{
+ DSPJitTester::Initialize();
+
+ nx_ir();
+ nx_dr();
+ //nx_nr();
+}
+
+//required to be able to link against DSPCore
+void DSPHost_UpdateDebugger() { }
+unsigned int DSPHost_CodeLoaded(unsigned const char*, int) { return 0; }
+void DSPHost_InterruptRequest() { }
+bool DSPHost_OnThread() { return false; }
+void DSPHost_WriteHostMemory(unsigned char, unsigned int) { }
unsigned char DSPHost_ReadHostMemory(unsigned int) { return 0; } \ No newline at end of file