StringUtil cleanup. Nothing seems broken.
[dolphin.git] / Source / UnitTests / AudioJitTests.cpp
blob4991eeb485581e78b3f119f10370ea3cb56e08fd
1 #include "DSPJitTester.h"
3 void nx_dr()
5 DSPJitTester tester(0x8000, 0x0004);
6 tester.AddTestData(DSP_REG_AR0);
7 tester.AddTestData(DSP_REG_WR0);
8 tester.TestAll();
9 tester.Report();
12 void nx_ir()
14 DSPJitTester tester(0x8000, 0x0008);
15 tester.AddTestData(DSP_REG_AR0);
16 tester.AddTestData(DSP_REG_WR0);
17 tester.TestAll();
18 tester.Report();
21 void nx_nr()
23 DSPJitTester tester(0x8000, 0x000c);
24 tester.AddTestData(DSP_REG_AR0);
25 tester.AddTestData(DSP_REG_WR0);
26 tester.AddTestData(DSP_REG_IX0);
27 tester.TestAll(true);
28 tester.Report();
31 void nx_mv()
33 DSPJitTester tester(0x8000, 0x0010);
34 tester.AddTestData(DSP_REG_ACL0);
35 tester.AddTestData(DSP_REG_AXL0);
36 tester.TestAll(true);
37 tester.Report();
40 void dar()
42 DSPJitTester tester(0x0004);
43 tester.AddTestData(DSP_REG_AR0);
44 tester.AddTestData(DSP_REG_WR0);
45 tester.TestAll();
46 tester.Report();
48 void iar()
50 DSPJitTester tester(0x0008);
51 tester.AddTestData(DSP_REG_AR0);
52 tester.AddTestData(DSP_REG_WR0);
53 tester.TestAll();
54 tester.Report();
56 void subarn()
58 DSPJitTester tester(0x000c);
59 tester.AddTestData(DSP_REG_AR0);
60 tester.AddTestData(DSP_REG_WR0);
61 tester.AddTestData(DSP_REG_IX0);
62 tester.TestAll();
63 tester.Report();
65 void addarn()
67 DSPJitTester tester(0x0010);
68 tester.AddTestData(DSP_REG_AR0);
69 tester.AddTestData(DSP_REG_WR0);
70 tester.AddTestData(DSP_REG_IX0);
71 tester.TestAll();
72 tester.Report();
74 void sbclr()
76 DSPJitTester tester(0x1200);
77 tester.AddTestData(DSP_REG_SR);
78 tester.TestAll();
79 tester.Report();
81 void sbset()
83 DSPJitTester tester(0x1300);
84 tester.AddTestData(DSP_REG_SR);
85 tester.TestAll();
86 tester.Report();
89 void nx_s()
91 DSPJitTester tester(0x8000, 0x0020);
92 tester.AddTestData(DSP_REG_AR0);
93 tester.AddTestData(DSP_REG_WR0);
94 tester.AddTestData(DSP_REG_ACL0);
95 tester.TestAll(true);
96 tester.Report();
99 void nx_sn()
101 DSPJitTester tester(0x8000, 0x0024);
102 tester.AddTestData(DSP_REG_AR0);
103 tester.AddTestData(DSP_REG_WR0);
104 tester.AddTestData(DSP_REG_IX0);
105 tester.AddTestData(DSP_REG_ACL0);
106 tester.TestAll(true);
107 tester.Report();
110 void nx_l()
113 DSPJitTester tester(0x8000, 0x0040);
114 tester.AddTestData(DSP_REG_AR0);
115 tester.AddTestData(DSP_REG_WR0);
116 tester.AddTestData(DSP_REG_AXL0);
117 tester.TestAll(true);
118 tester.Report();
121 void set16_l()
124 DSPJitTester tester(0x8e00, 0x0070);
125 tester.AddTestData(DSP_REG_SR, 0);
126 tester.AddTestData(DSP_REG_SR, SR_40_MODE_BIT);
127 tester.AddTestData(DSP_REG_AR0);
128 tester.AddTestData(DSP_REG_WR0);
129 tester.AddTestData(DSP_REG_ACM0);
130 tester.TestAll(true);
131 tester.Report();
134 void nx_ln()
136 DSPJitTester tester(0x8000, 0x0044);
137 tester.AddTestData(DSP_REG_AR0);
138 tester.AddTestData(DSP_REG_WR0);
139 tester.AddTestData(DSP_REG_IX0);
140 tester.AddTestData(DSP_REG_AXL0);
141 tester.TestAll(true);
142 tester.Report();
145 void nx_ls()
147 DSPJitTester tester1(0x8000, 0x0080);
148 tester1.AddTestData(DSP_REG_ACM0);
149 tester1.AddTestData(DSP_REG_AR0);
150 tester1.AddTestData(DSP_REG_WR0);
151 tester1.TestAll(true);
152 tester1.Report();
154 DSPJitTester tester2(0x8000, 0x0080);
155 tester2.AddTestData(DSP_REG_ACM0);
156 tester2.AddTestData(DSP_REG_AR3);
157 tester2.AddTestData(DSP_REG_WR3);
158 tester2.TestAll(true);
159 tester2.Report();
162 void nx_lsn()
164 DSPJitTester tester1(0x8000, 0x0084);
165 tester1.AddTestData(DSP_REG_ACM0);
166 tester1.AddTestData(DSP_REG_AR0);
167 tester1.AddTestData(DSP_REG_WR0);
168 tester1.AddTestData(DSP_REG_IX0);
169 tester1.TestAll(true);
170 tester1.Report();
172 DSPJitTester tester2(0x8000, 0x0084);
173 tester2.AddTestData(DSP_REG_ACM0);
174 tester2.AddTestData(DSP_REG_AR3);
175 tester2.AddTestData(DSP_REG_WR3);
176 tester2.TestAll(true);
177 tester2.Report();
180 void nx_lsm()
182 DSPJitTester tester1(0x8000, 0x0088);
183 tester1.AddTestData(DSP_REG_ACM0);
184 tester1.AddTestData(DSP_REG_AR0);
185 tester1.AddTestData(DSP_REG_WR0);
186 tester1.TestAll(true);
187 tester1.Report();
189 DSPJitTester tester2(0x8000, 0x0088);
190 tester2.AddTestData(DSP_REG_ACM0);
191 tester2.AddTestData(DSP_REG_AR3);
192 tester2.AddTestData(DSP_REG_WR3);
193 tester2.AddTestData(DSP_REG_IX3);
194 tester2.TestAll(true);
195 tester2.Report();
198 void nx_lsnm()
200 DSPJitTester tester1(0x8000, 0x008c);
201 tester1.AddTestData(DSP_REG_ACM0);
202 tester1.AddTestData(DSP_REG_AR0);
203 tester1.AddTestData(DSP_REG_WR0);
204 tester1.AddTestData(DSP_REG_IX0);
205 tester1.TestAll(true);
206 tester1.Report();
208 DSPJitTester tester2(0x8000, 0x008c);
209 tester2.AddTestData(DSP_REG_ACM0);
210 tester2.AddTestData(DSP_REG_AR3);
211 tester2.AddTestData(DSP_REG_WR3);
212 tester2.AddTestData(DSP_REG_IX3);
213 tester2.TestAll(true);
214 tester2.Report();
217 void nx_sl()
219 DSPJitTester tester1(0x8000, 0x0082);
220 tester1.AddTestData(DSP_REG_ACM0);
221 tester1.AddTestData(DSP_REG_AR0);
222 tester1.AddTestData(DSP_REG_WR0);
223 tester1.TestAll(true);
224 tester1.Report();
226 DSPJitTester tester2(0x8000, 0x0082);
227 tester2.AddTestData(DSP_REG_ACM0);
228 tester2.AddTestData(DSP_REG_AR3);
229 tester2.AddTestData(DSP_REG_WR3);
230 tester2.TestAll(true);
231 tester2.Report();
234 void nx_sln()
236 DSPJitTester tester1(0x8000, 0x0086);
237 tester1.AddTestData(DSP_REG_ACM0);
238 tester1.AddTestData(DSP_REG_AR0);
239 tester1.AddTestData(DSP_REG_WR0);
240 tester1.AddTestData(DSP_REG_IX0);
241 tester1.TestAll(true);
242 tester1.Report();
244 DSPJitTester tester2(0x8000, 0x0086);
245 tester2.AddTestData(DSP_REG_ACM0);
246 tester2.AddTestData(DSP_REG_AR3);
247 tester2.AddTestData(DSP_REG_WR3);
248 tester2.TestAll(true);
249 tester2.Report();
252 void nx_slm()
254 DSPJitTester tester1(0x8000, 0x008a);
255 tester1.AddTestData(DSP_REG_ACM0);
256 tester1.AddTestData(DSP_REG_AR0);
257 tester1.AddTestData(DSP_REG_WR0);
258 tester1.TestAll(true);
259 tester1.Report();
261 DSPJitTester tester2(0x8000, 0x008a);
262 tester2.AddTestData(DSP_REG_ACM0);
263 tester2.AddTestData(DSP_REG_AR3);
264 tester2.AddTestData(DSP_REG_WR3);
265 tester2.AddTestData(DSP_REG_IX3);
266 tester2.TestAll(true);
267 tester2.Report();
270 void nx_slnm()
272 DSPJitTester tester1(0x8000, 0x008e);
273 tester1.AddTestData(DSP_REG_ACM0);
274 tester1.AddTestData(DSP_REG_AR0);
275 tester1.AddTestData(DSP_REG_WR0);
276 tester1.AddTestData(DSP_REG_IX0);
277 tester1.TestAll(true);
278 tester1.Report();
280 DSPJitTester tester2(0x8000, 0x008e);
281 tester2.AddTestData(DSP_REG_ACM0);
282 tester2.AddTestData(DSP_REG_AR3);
283 tester2.AddTestData(DSP_REG_WR3);
284 tester2.AddTestData(DSP_REG_IX3);
285 tester2.TestAll(true);
286 tester2.Report();
289 void nx_ld()
291 DSPJitTester tester1(0x8000, 0x00c0);
292 tester1.AddTestData(DSP_REG_AXL0,0xdead);
293 tester1.AddTestData(DSP_REG_AXL1,0xbeef);
294 tester1.AddTestData(DSP_REG_AR0);
295 tester1.AddTestData(DSP_REG_WR0);
296 tester1.AddTestData(DSP_REG_IX0);
297 tester1.TestAll(true);
298 tester1.Report();
300 DSPJitTester tester2(0x8000, 0x00c0);
301 tester2.AddTestData(DSP_REG_AXL0,0xdead);
302 tester2.AddTestData(DSP_REG_AXL1,0xbeef);
303 tester2.AddTestData(DSP_REG_AR3);
304 tester2.AddTestData(DSP_REG_WR3);
305 tester2.AddTestData(DSP_REG_IX3);
306 tester2.TestAll(true);
307 tester2.Report();
310 void AudioJitTests()
312 DSPJitTester::Initialize();
313 dar();
314 iar();
315 subarn();
316 addarn();
317 sbclr();
318 sbset();
320 nx_ir();
321 nx_dr();
322 nx_nr();
323 nx_mv();
325 set16_l();
327 nx_s();
328 nx_sn();
329 nx_l();
330 nx_ln();
331 nx_ls();
332 nx_lsn();
333 nx_lsm();
334 nx_lsnm();
335 nx_sl();
336 nx_sln();
337 nx_slm();
338 nx_slnm();
339 nx_ld();
342 //required to be able to link against DSPCore
343 void DSPHost_UpdateDebugger() { }
344 unsigned int DSPHost_CodeLoaded(unsigned const char*, int) { return 0; }
345 void DSPHost_InterruptRequest() { }
346 bool DSPHost_OnThread() { return false; }
347 void DSPHost_WriteHostMemory(unsigned char, unsigned int) { }
348 unsigned char DSPHost_ReadHostMemory(unsigned int) { return 0; }