Added a way to only run documented Z80 instruction tests

This commit is contained in:
transistor 2023-05-13 10:14:47 -07:00
parent b2b9d73375
commit d8638c6f82
3 changed files with 707 additions and 960 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,659 @@
Last run on 2023-05-12 at commit b2b9d73375d0ae7822cd3b1376b706f94b0b4456
00.json completed, all passed!
01.json completed, all passed!
02.json completed, all passed!
03.json completed, all passed!
04.json completed, all passed!
05.json completed, all passed!
06.json completed, all passed!
07.json completed, all passed!
08.json completed, all passed!
09.json completed, all passed!
0a.json completed, all passed!
0b.json completed, all passed!
0c.json completed, all passed!
0d.json completed, all passed!
0e.json completed, all passed!
0f.json completed, all passed!
10.json completed, all passed!
100.json completed, all passed!
101.json completed, all passed!
11.json completed, all passed!
12.json completed, all passed!
13.json completed, all passed!
14.json completed, all passed!
15.json completed, all passed!
16.json completed, all passed!
17.json completed, all passed!
18.json completed, all passed!
19.json completed, all passed!
1a.json completed, all passed!
1b.json completed, all passed!
1c.json completed, all passed!
1d.json completed, all passed!
1e.json completed, all passed!
1f.json completed, all passed!
20.json completed, all passed!
21.json completed, all passed!
22.json completed: 999 passed, 1 FAILED
23.json completed, all passed!
24.json completed, all passed!
25.json completed, all passed!
26.json completed, all passed!
27.json completed: 0 passed, 1000 FAILED
28.json completed, all passed!
29.json completed, all passed!
2a.json completed, all passed!
2b.json completed, all passed!
2c.json completed, all passed!
2d.json completed, all passed!
2e.json completed, all passed!
2f.json completed, all passed!
30.json completed, all passed!
31.json completed, all passed!
32.json completed, all passed!
33.json completed, all passed!
34.json completed, all passed!
35.json completed, all passed!
36.json completed, all passed!
37.json completed, all passed!
38.json completed, all passed!
39.json completed, all passed!
3a.json completed, all passed!
3b.json completed, all passed!
3c.json completed, all passed!
3d.json completed, all passed!
3e.json completed, all passed!
3f.json completed, all passed!
40.json completed, all passed!
41.json completed, all passed!
42.json completed, all passed!
43.json completed, all passed!
44.json completed, all passed!
45.json completed, all passed!
46.json completed, all passed!
47.json completed, all passed!
48.json completed, all passed!
49.json completed, all passed!
4a.json completed, all passed!
4b.json completed, all passed!
4c.json completed, all passed!
4d.json completed, all passed!
4e.json completed, all passed!
4f.json completed, all passed!
50.json completed, all passed!
51.json completed, all passed!
52.json completed, all passed!
53.json completed, all passed!
54.json completed, all passed!
55.json completed, all passed!
56.json completed, all passed!
57.json completed, all passed!
58.json completed, all passed!
59.json completed, all passed!
5a.json completed, all passed!
5b.json completed, all passed!
5c.json completed, all passed!
5d.json completed, all passed!
5e.json completed, all passed!
5f.json completed, all passed!
60.json completed, all passed!
61.json completed, all passed!
62.json completed, all passed!
63.json completed, all passed!
64.json completed, all passed!
65.json completed, all passed!
66.json completed, all passed!
67.json completed, all passed!
68.json completed, all passed!
69.json completed, all passed!
6a.json completed, all passed!
6b.json completed, all passed!
6c.json completed, all passed!
6d.json completed, all passed!
6e.json completed, all passed!
6f.json completed, all passed!
70.json completed, all passed!
71.json completed, all passed!
72.json completed, all passed!
73.json completed, all passed!
74.json completed, all passed!
75.json completed, all passed!
76.json completed, all passed!
77.json completed, all passed!
78.json completed, all passed!
79.json completed, all passed!
7a.json completed, all passed!
7b.json completed, all passed!
7c.json completed, all passed!
7d.json completed, all passed!
7e.json completed, all passed!
7f.json completed, all passed!
80.json completed, all passed!
81.json completed, all passed!
82.json completed, all passed!
83.json completed, all passed!
84.json completed, all passed!
85.json completed, all passed!
86.json completed, all passed!
87.json completed, all passed!
88.json completed: 999 passed, 1 FAILED
89.json completed, all passed!
8a.json completed, all passed!
8b.json completed, all passed!
8c.json completed, all passed!
8d.json completed: 999 passed, 1 FAILED
8e.json completed, all passed!
8f.json completed, all passed!
90.json completed, all passed!
91.json completed, all passed!
92.json completed, all passed!
93.json completed, all passed!
94.json completed, all passed!
95.json completed, all passed!
96.json completed, all passed!
97.json completed, all passed!
98.json completed: 998 passed, 2 FAILED
99.json completed: 999 passed, 1 FAILED
9a.json completed: 998 passed, 2 FAILED
9b.json completed: 999 passed, 1 FAILED
9c.json completed: 999 passed, 1 FAILED
9d.json completed: 999 passed, 1 FAILED
9e.json completed: 998 passed, 2 FAILED
9f.json completed: 996 passed, 4 FAILED
a0.json completed, all passed!
a1.json completed, all passed!
a2.json completed, all passed!
a3.json completed, all passed!
a4.json completed, all passed!
a5.json completed, all passed!
a6.json completed, all passed!
a7.json completed, all passed!
a8.json completed, all passed!
a9.json completed, all passed!
aa.json completed, all passed!
ab.json completed, all passed!
ac.json completed, all passed!
ad.json completed, all passed!
ae.json completed, all passed!
af.json completed, all passed!
b0.json completed, all passed!
b1.json completed, all passed!
b2.json completed, all passed!
b3.json completed, all passed!
b4.json completed, all passed!
b5.json completed, all passed!
b6.json completed, all passed!
b7.json completed, all passed!
b8.json completed, all passed!
b9.json completed, all passed!
ba.json completed, all passed!
bb.json completed, all passed!
bc.json completed, all passed!
bd.json completed, all passed!
be.json completed, all passed!
bf.json completed, all passed!
c0.json completed, all passed!
c1.json completed, all passed!
c2.json completed, all passed!
c3.json completed, all passed!
c4.json completed, all passed!
c5.json completed, all passed!
c6.json completed, all passed!
c7.json completed, all passed!
c8.json completed, all passed!
c9.json completed, all passed!
ca.json completed, all passed!
cb 00.json completed, all passed!
cb 01.json completed, all passed!
cb 02.json completed, all passed!
cb 03.json completed, all passed!
cb 04.json completed, all passed!
cb 05.json completed, all passed!
cb 06.json completed, all passed!
cb 07.json completed, all passed!
cb 08.json completed, all passed!
cb 09.json completed, all passed!
cb 0a.json completed, all passed!
cb 0b.json completed, all passed!
cb 0c.json completed, all passed!
cb 0d.json completed, all passed!
cb 0e.json completed, all passed!
cb 0f.json completed, all passed!
cb 10.json completed, all passed!
cb 11.json completed, all passed!
cb 12.json completed, all passed!
cb 13.json completed, all passed!
cb 14.json completed, all passed!
cb 15.json completed, all passed!
cb 16.json completed, all passed!
cb 17.json completed, all passed!
cb 18.json completed, all passed!
cb 19.json completed, all passed!
cb 1a.json completed, all passed!
cb 1b.json completed, all passed!
cb 1c.json completed, all passed!
cb 1d.json completed, all passed!
cb 1e.json completed, all passed!
cb 1f.json completed, all passed!
cb 20.json completed, all passed!
cb 21.json completed, all passed!
cb 22.json completed, all passed!
cb 23.json completed, all passed!
cb 24.json completed, all passed!
cb 25.json completed, all passed!
cb 26.json completed, all passed!
cb 27.json completed, all passed!
cb 28.json completed, all passed!
cb 29.json completed, all passed!
cb 2a.json completed, all passed!
cb 2b.json completed, all passed!
cb 2c.json completed, all passed!
cb 2d.json completed, all passed!
cb 2e.json completed, all passed!
cb 2f.json completed, all passed!
cb 38.json completed, all passed!
cb 39.json completed, all passed!
cb 3a.json completed, all passed!
cb 3b.json completed, all passed!
cb 3c.json completed, all passed!
cb 3d.json completed, all passed!
cb 3e.json completed, all passed!
cb 3f.json completed, all passed!
cb 40.json completed: 244 passed, 756 FAILED
cb 41.json completed: 238 passed, 762 FAILED
cb 42.json completed: 262 passed, 738 FAILED
cb 43.json completed: 223 passed, 777 FAILED
cb 44.json completed: 244 passed, 756 FAILED
cb 45.json completed: 253 passed, 747 FAILED
cb 46.json completed: 239 passed, 761 FAILED
cb 47.json completed: 249 passed, 751 FAILED
cb 48.json completed: 256 passed, 744 FAILED
cb 49.json completed: 244 passed, 756 FAILED
cb 4a.json completed: 234 passed, 766 FAILED
cb 4b.json completed: 250 passed, 750 FAILED
cb 4c.json completed: 252 passed, 748 FAILED
cb 4d.json completed: 248 passed, 752 FAILED
cb 4e.json completed: 254 passed, 746 FAILED
cb 4f.json completed: 253 passed, 747 FAILED
cb 50.json completed: 256 passed, 744 FAILED
cb 51.json completed: 268 passed, 732 FAILED
cb 52.json completed: 261 passed, 739 FAILED
cb 53.json completed: 281 passed, 719 FAILED
cb 54.json completed: 238 passed, 762 FAILED
cb 55.json completed: 243 passed, 757 FAILED
cb 56.json completed: 254 passed, 746 FAILED
cb 57.json completed: 263 passed, 737 FAILED
cb 58.json completed: 252 passed, 748 FAILED
cb 59.json completed: 244 passed, 756 FAILED
cb 5a.json completed: 254 passed, 746 FAILED
cb 5b.json completed: 242 passed, 758 FAILED
cb 5c.json completed: 233 passed, 767 FAILED
cb 5d.json completed: 256 passed, 744 FAILED
cb 5e.json completed: 256 passed, 744 FAILED
cb 5f.json completed: 258 passed, 742 FAILED
cb 60.json completed: 265 passed, 735 FAILED
cb 61.json completed: 236 passed, 764 FAILED
cb 62.json completed: 258 passed, 742 FAILED
cb 63.json completed: 256 passed, 744 FAILED
cb 64.json completed: 231 passed, 769 FAILED
cb 65.json completed: 234 passed, 766 FAILED
cb 66.json completed: 252 passed, 748 FAILED
cb 67.json completed: 251 passed, 749 FAILED
cb 68.json completed: 237 passed, 763 FAILED
cb 69.json completed: 251 passed, 749 FAILED
cb 6a.json completed: 253 passed, 747 FAILED
cb 6b.json completed: 265 passed, 735 FAILED
cb 6c.json completed: 236 passed, 764 FAILED
cb 6d.json completed: 230 passed, 770 FAILED
cb 6e.json completed: 237 passed, 763 FAILED
cb 6f.json completed: 264 passed, 736 FAILED
cb 70.json completed: 245 passed, 755 FAILED
cb 71.json completed: 238 passed, 762 FAILED
cb 72.json completed: 248 passed, 752 FAILED
cb 73.json completed: 261 passed, 739 FAILED
cb 74.json completed: 260 passed, 740 FAILED
cb 75.json completed: 247 passed, 753 FAILED
cb 76.json completed: 252 passed, 748 FAILED
cb 77.json completed: 238 passed, 762 FAILED
cb 78.json completed: 243 passed, 757 FAILED
cb 79.json completed: 242 passed, 758 FAILED
cb 7a.json completed: 262 passed, 738 FAILED
cb 7b.json completed: 246 passed, 754 FAILED
cb 7c.json completed: 256 passed, 744 FAILED
cb 7d.json completed: 251 passed, 749 FAILED
cb 7e.json completed: 258 passed, 742 FAILED
cb 7f.json completed: 260 passed, 740 FAILED
cb 80.json completed, all passed!
cb 81.json completed, all passed!
cb 82.json completed, all passed!
cb 83.json completed, all passed!
cb 84.json completed, all passed!
cb 85.json completed, all passed!
cb 86.json completed, all passed!
cb 87.json completed, all passed!
cb 88.json completed, all passed!
cb 89.json completed, all passed!
cb 8a.json completed, all passed!
cb 8b.json completed, all passed!
cb 8c.json completed, all passed!
cb 8d.json completed, all passed!
cb 8e.json completed, all passed!
cb 8f.json completed, all passed!
cb 90.json completed, all passed!
cb 91.json completed, all passed!
cb 92.json completed, all passed!
cb 93.json completed, all passed!
cb 94.json completed, all passed!
cb 95.json completed, all passed!
cb 96.json completed, all passed!
cb 97.json completed, all passed!
cb 98.json completed, all passed!
cb 99.json completed, all passed!
cb 9a.json completed, all passed!
cb 9b.json completed, all passed!
cb 9c.json completed, all passed!
cb 9d.json completed, all passed!
cb 9e.json completed, all passed!
cb 9f.json completed, all passed!
cb a0.json completed, all passed!
cb a1.json completed, all passed!
cb a2.json completed, all passed!
cb a3.json completed, all passed!
cb a4.json completed, all passed!
cb a5.json completed, all passed!
cb a6.json completed, all passed!
cb a7.json completed, all passed!
cb a8.json completed, all passed!
cb a9.json completed, all passed!
cb aa.json completed, all passed!
cb ab.json completed, all passed!
cb ac.json completed, all passed!
cb ad.json completed, all passed!
cb ae.json completed, all passed!
cb af.json completed, all passed!
cb b0.json completed, all passed!
cb b1.json completed, all passed!
cb b2.json completed, all passed!
cb b3.json completed, all passed!
cb b4.json completed, all passed!
cb b5.json completed, all passed!
cb b6.json completed, all passed!
cb b7.json completed, all passed!
cb b8.json completed, all passed!
cb b9.json completed, all passed!
cb ba.json completed, all passed!
cb bb.json completed, all passed!
cb bc.json completed, all passed!
cb bd.json completed, all passed!
cb be.json completed, all passed!
cb bf.json completed, all passed!
cb c0.json completed, all passed!
cb c1.json completed, all passed!
cb c2.json completed, all passed!
cb c3.json completed, all passed!
cb c4.json completed, all passed!
cb c5.json completed, all passed!
cb c6.json completed, all passed!
cb c7.json completed, all passed!
cb c8.json completed, all passed!
cb c9.json completed, all passed!
cb ca.json completed, all passed!
cb cb.json completed, all passed!
cb cc.json completed, all passed!
cb cd.json completed, all passed!
cb ce.json completed, all passed!
cb cf.json completed, all passed!
cb d0.json completed, all passed!
cb d1.json completed, all passed!
cb d2.json completed, all passed!
cb d3.json completed, all passed!
cb d4.json completed, all passed!
cb d5.json completed, all passed!
cb d6.json completed, all passed!
cb d7.json completed, all passed!
cb d8.json completed, all passed!
cb d9.json completed, all passed!
cb da.json completed, all passed!
cb db.json completed, all passed!
cb dc.json completed, all passed!
cb dd.json completed, all passed!
cb de.json completed, all passed!
cb df.json completed, all passed!
cb e0.json completed, all passed!
cb e1.json completed, all passed!
cb e2.json completed, all passed!
cb e3.json completed, all passed!
cb e4.json completed, all passed!
cb e5.json completed, all passed!
cb e6.json completed, all passed!
cb e7.json completed, all passed!
cb e8.json completed, all passed!
cb e9.json completed, all passed!
cb ea.json completed, all passed!
cb eb.json completed, all passed!
cb ec.json completed, all passed!
cb ed.json completed, all passed!
cb ee.json completed, all passed!
cb ef.json completed, all passed!
cb f0.json completed, all passed!
cb f1.json completed, all passed!
cb f2.json completed, all passed!
cb f3.json completed, all passed!
cb f4.json completed, all passed!
cb f5.json completed, all passed!
cb f6.json completed, all passed!
cb f7.json completed, all passed!
cb f8.json completed, all passed!
cb f9.json completed, all passed!
cb fa.json completed, all passed!
cb fb.json completed, all passed!
cb fc.json completed, all passed!
cb fd.json completed, all passed!
cb fe.json completed, all passed!
cb ff.json completed, all passed!
cc.json completed, all passed!
cd.json completed, all passed!
ce.json completed: 998 passed, 2 FAILED
cf.json completed, all passed!
d0.json completed, all passed!
d1.json completed, all passed!
d2.json completed, all passed!
d3.json completed, all passed!
d4.json completed, all passed!
d5.json completed, all passed!
d6.json completed, all passed!
d7.json completed, all passed!
d8.json completed, all passed!
d9.json completed, all passed!
da.json completed, all passed!
db.json completed: 0 passed, 1000 FAILED
dc.json completed, all passed!
dd 09.json completed, all passed!
dd 19.json completed, all passed!
dd 29.json completed, all passed!
dd 36.json completed, all passed!
dd 39.json completed, all passed!
dd 46.json completed, all passed!
dd 4e.json completed, all passed!
dd 56.json completed, all passed!
dd 5e.json completed, all passed!
dd 66.json completed, all passed!
dd 6e.json completed, all passed!
dd 70.json completed, all passed!
dd 71.json completed, all passed!
dd 72.json completed, all passed!
dd 73.json completed, all passed!
dd 74.json completed, all passed!
dd 75.json completed, all passed!
dd 77.json completed, all passed!
dd 7e.json completed, all passed!
dd 8e.json completed: 998 passed, 2 FAILED
dd 9e.json completed, all passed!
dd ae.json completed, all passed!
dd b6.json completed, all passed!
dd be.json completed, all passed!
dd c6.json completed: 0 passed, 1000 FAILED
dd ce.json completed: 0 passed, 1000 FAILED
dd d6.json completed: 0 passed, 1000 FAILED
dd de.json completed: 0 passed, 1000 FAILED
dd e1.json completed, all passed!
dd e3.json completed, all passed!
dd e5.json completed, all passed!
dd e6.json completed: 0 passed, 1000 FAILED
dd e9.json completed, all passed!
dd ee.json completed: 0 passed, 1000 FAILED
dd f9.json completed, all passed!
dd fe.json completed: 0 passed, 1000 FAILED
de.json completed: 998 passed, 2 FAILED
df.json completed, all passed!
e0.json completed, all passed!
e1.json completed, all passed!
e2.json completed, all passed!
e3.json completed, all passed!
e4.json completed, all passed!
e5.json completed, all passed!
e6.json completed, all passed!
e7.json completed, all passed!
e8.json completed, all passed!
e9.json completed, all passed!
ea.json completed, all passed!
eb.json completed, all passed!
ec.json completed, all passed!
ed 40.json completed: 0 passed, 1000 FAILED
ed 41.json completed: 0 passed, 1000 FAILED
ed 42.json completed: 765 passed, 235 FAILED
ed 43.json completed, all passed!
ed 44.json completed, all passed!
ed 45.json completed: 0 passed, 1000 FAILED
ed 46.json completed, all passed!
ed 47.json completed, all passed!
ed 48.json completed: 0 passed, 1000 FAILED
ed 49.json completed: 0 passed, 1000 FAILED
ed 4a.json completed: 723 passed, 277 FAILED
ed 4b.json completed, all passed!
ed 4c.json completed, all passed!
ed 4d.json completed: 0 passed, 1000 FAILED
ed 4e.json completed, all passed!
ed 4f.json completed, all passed!
ed 50.json completed: 0 passed, 1000 FAILED
ed 51.json completed: 0 passed, 1000 FAILED
ed 52.json completed: 746 passed, 254 FAILED
ed 53.json completed, all passed!
ed 54.json completed, all passed!
ed 55.json completed: 0 passed, 1000 FAILED
ed 56.json completed, all passed!
ed 57.json completed: 0 passed, 1000 FAILED
ed 58.json completed: 0 passed, 1000 FAILED
ed 59.json completed: 0 passed, 1000 FAILED
ed 5a.json completed: 743 passed, 257 FAILED
ed 5b.json completed, all passed!
ed 5c.json completed, all passed!
ed 5d.json completed: 0 passed, 1000 FAILED
ed 5e.json completed, all passed!
ed 5f.json completed: 2 passed, 998 FAILED
ed 60.json completed: 0 passed, 1000 FAILED
ed 61.json completed: 0 passed, 1000 FAILED
ed 62.json completed, all passed!
ed 63.json completed, all passed!
ed 64.json completed, all passed!
ed 65.json completed: 0 passed, 1000 FAILED
ed 66.json completed, all passed!
ed 67.json completed: 0 passed, 1000 FAILED
ed 68.json completed: 0 passed, 1000 FAILED
ed 69.json completed: 0 passed, 1000 FAILED
ed 6a.json completed: 486 passed, 514 FAILED
ed 6b.json completed, all passed!
ed 6c.json completed, all passed!
ed 6d.json completed: 0 passed, 1000 FAILED
ed 6e.json completed, all passed!
ed 6f.json completed: 0 passed, 1000 FAILED
ed 70.json completed: 0 passed, 1000 FAILED
ed 71.json completed: 0 passed, 1000 FAILED
ed 72.json completed: 744 passed, 256 FAILED
ed 73.json completed, all passed!
ed 74.json completed, all passed!
ed 75.json completed: 0 passed, 1000 FAILED
ed 76.json completed, all passed!
ed 77.json completed, all passed!
ed 78.json completed: 0 passed, 1000 FAILED
ed 79.json completed: 0 passed, 1000 FAILED
ed 7a.json completed: 760 passed, 240 FAILED
ed 7b.json completed, all passed!
ed 7c.json completed, all passed!
ed 7d.json completed: 0 passed, 1000 FAILED
ed 7e.json completed, all passed!
ed 7f.json completed, all passed!
ed a0.json completed, all passed!
ed a1.json completed: 0 passed, 1000 FAILED
ed a2.json completed: 0 passed, 1000 FAILED
ed a3.json completed: 0 passed, 1000 FAILED
ed a8.json completed, all passed!
ed a9.json completed: 0 passed, 1000 FAILED
ed aa.json completed: 0 passed, 1000 FAILED
ed ab.json completed: 0 passed, 1000 FAILED
ed b0.json completed, all passed!
ed b1.json completed: 0 passed, 1000 FAILED
ed b2.json completed: 0 passed, 1000 FAILED
ed b3.json completed: 0 passed, 1000 FAILED
ed b8.json completed, all passed!
ed b9.json completed: 0 passed, 1000 FAILED
ed ba.json completed: 0 passed, 1000 FAILED
ed bb.json completed: 0 passed, 1000 FAILED
ee.json completed, all passed!
ef.json completed, all passed!
f0.json completed, all passed!
f1.json completed, all passed!
f2.json completed, all passed!
f3.json completed, all passed!
f4.json completed, all passed!
f5.json completed, all passed!
f6.json completed, all passed!
f7.json completed, all passed!
f8.json completed, all passed!
f9.json completed, all passed!
fa.json completed, all passed!
fb.json completed, all passed!
fc.json completed, all passed!
fd 09.json completed: 0 passed, 1000 FAILED
fd 19.json completed: 0 passed, 1000 FAILED
fd 29.json completed: 0 passed, 1000 FAILED
fd 36.json completed, all passed!
fd 39.json completed: 0 passed, 1000 FAILED
fd 46.json completed, all passed!
fd 4e.json completed, all passed!
fd 56.json completed, all passed!
fd 5e.json completed, all passed!
fd 66.json completed, all passed!
fd 6e.json completed, all passed!
fd 70.json completed, all passed!
fd 71.json completed, all passed!
fd 72.json completed, all passed!
fd 73.json completed, all passed!
fd 74.json completed, all passed!
fd 75.json completed, all passed!
fd 77.json completed, all passed!
fd 7e.json completed, all passed!
fd 8e.json completed: 999 passed, 1 FAILED
fd 9e.json completed: 999 passed, 1 FAILED
fd ae.json completed, all passed!
fd b6.json completed, all passed!
fd be.json completed, all passed!
fd c6.json completed: 0 passed, 1000 FAILED
fd ce.json completed: 0 passed, 1000 FAILED
fd d6.json completed: 0 passed, 1000 FAILED
fd de.json completed: 0 passed, 1000 FAILED
fd e1.json completed, all passed!
fd e3.json completed: 999 passed, 1 FAILED
fd e5.json completed, all passed!
fd e6.json completed: 0 passed, 1000 FAILED
fd e9.json completed, all passed!
fd ee.json completed: 0 passed, 1000 FAILED
fd f9.json completed, all passed!
fd fe.json completed: 0 passed, 1000 FAILED
fe.json completed, all passed!
ff.json completed, all passed!
passed: 543908, failed: 110092, total 83%
completed in 12m 50s

View File

@ -41,6 +41,9 @@ struct Args {
/// Check the Half Carry, F3, and F5 flags for accuracy /// Check the Half Carry, F3, and F5 flags for accuracy
#[clap(short = 'f', long)] #[clap(short = 'f', long)]
check_extra_flags: bool, check_extra_flags: bool,
/// Check undocumented instructions
#[clap(short = 'u', long)]
check_undocumented: bool,
/// Directory to the test suite to run /// Directory to the test suite to run
#[clap(long, default_value = DEFAULT_RAD_TESTS)] #[clap(long, default_value = DEFAULT_RAD_TESTS)]
testsuite: String, testsuite: String,
@ -329,13 +332,19 @@ fn run_all_tests(args: &Args) {
continue; continue;
} }
let name = path.file_name().unwrap().to_str().unwrap();
// If specified, only test files that start with a given string // If specified, only test files that start with a given string
if let Some(filter) = &args.filter { if let Some(filter) = &args.filter {
if !path.file_name().unwrap().to_str().unwrap().starts_with(filter) { if !name.starts_with(filter) {
continue; continue;
} }
} }
if !args.check_undocumented && is_undocumented_instruction(name) {
continue;
}
// Run every test in the file // Run every test in the file
let (test_passed, test_failed, message) = test_json_file(path, args); let (test_passed, test_failed, message) = test_json_file(path, args);
@ -362,3 +371,38 @@ fn run_all_tests(args: &Args) {
println!("completed in {}m {}s", elapsed_secs / 60, elapsed_secs % 60); println!("completed in {}m {}s", elapsed_secs / 60, elapsed_secs % 60);
} }
fn is_undocumented_instruction(name: &str) -> bool {
let mut opcodes: Vec<u8> = name
.splitn(3, &[' ', '.'])
.filter_map(|s| u8::from_str_radix(s, 16).ok())
.collect();
opcodes.extend(vec![0; 3 - opcodes.len()]);
match (opcodes[0], opcodes[1]) {
(0xCB, _) => {
opcodes[1] >= 0x30 && opcodes[1] <= 0x37
},
(0xDD, 0xCB) |
(0xFD, 0xCB) => {
!(opcodes[2] & 0x07 == 0x06 && opcodes[2] != 0x36)
},
(0xDD, _) |
(0xFD, _) => {
let op = opcodes[1];
let upper3 = op & 0x70;
let upper4 = op & 0xF0;
let lower = op & 0x0F;
!(lower == 0x06 && upper3 >= 0x30 && upper3 <= 0x60) &&
!(lower == 0x0E && upper4 >= 0x40 && upper3 <= 0xB0) &&
!(op >= 0x70 && op <= 0x77 && op != 0x76) &&
!(op >= 0x21 && op <= 0x23 && op >= 0x34 && op <= 0x36 && op >= 0x29 && op <= 0x2B) &&
!(lower == 0x09 && upper4 <= 0x30) &&
!(op == 0xE1 || op == 0xE3 || op == 0xE5 || op == 0xE9 || op == 0xF9)
},
//0xED => {
//},
_ => false
}
}