Skip to content

Commit bc6ccd7

Browse files
committed
Release test suite v3
1 parent e3b1878 commit bc6ccd7

File tree

4 files changed

+64
-61
lines changed

4 files changed

+64
-61
lines changed

bin/chip8-test-suite.8o

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,24 @@
3030
clear
3131

3232
v1 := 1
33-
show 8 logo-part1
34-
show 16 logo-part2
35-
show 24 logo-part3
36-
show 32 logo-part4
37-
show 40 logo-part5
38-
show 48 logo-part6
33+
show 8 splash-0-0
34+
show 16 splash-1-0
35+
show 24 splash-2-0
36+
show 32 splash-3-0
37+
show 40 splash-4-0
38+
show 48 splash-5-0
3939

4040
v1 := 16
41-
show 8 logo-part7
42-
show 16 logo-part8
43-
show 24 logo-part9
44-
show 32 logo-part10
45-
show 40 logo-part11
46-
show 48 logo-part12
41+
show 8 splash-0-1
42+
show 16 splash-1-1
43+
show 24 splash-2-1
44+
show 32 splash-3-1
45+
show 40 splash-4-1
46+
show 48 splash-5-1
4747

4848
jump select-test
4949

5050

51-
5251
# After that, if the user auto-started a test, run it:
5352

5453
: select-test
@@ -86,7 +85,6 @@
8685
if v0 == 16 then return
8786
jump -
8887

89-
9088
# A cute little menu to select a test
9189

9290
: menu-after-keypress
@@ -201,7 +199,6 @@
201199
: menu-choose-jump
202200
0 0 # jump <item>
203201

204-
205202
# Font rendering code and character data
206203
# Kept this very simplistic and fast
207204

@@ -236,7 +233,6 @@
236233
return
237234

238235

239-
240236
# Include all available tests:
241237

242238
# Disassembly of the famous "IBM logo" program, published here before:
@@ -278,7 +274,6 @@
278274

279275
jump menu-after-keypress # Address 552 / 0x228
280276

281-
282277
# Corax89's chip8-test-rom, published here before:
283278
# https://github.com/corax89/chip8-test-rom
284279

@@ -690,12 +685,12 @@
690685

691686
# Shift right (with LSB)
692687
opcode 0x86
693-
vF := 7
694-
vF >>= vF # 3 (0x3), but should be overwritten by flag, so 1
688+
vF := 27
689+
vF >>= vF # 13 (0xD), but should be overwritten by flag, so 1
695690
v3 := vF
696-
v2 := 3
697-
v2 >>= v2 # 1 (0x1)
698-
expect-v2-vf-v3 1 1 1
691+
v2 := 27
692+
v2 >>= v2 # 13 (0xD)
693+
expect-v2-vf-v3 13 1 1
699694

700695
# Subtraction in the other direction (with carry)
701696
opcode 0x87
@@ -733,7 +728,6 @@
733728

734729
jump menu-after-keypress
735730

736-
737731
# Quirks test
738732

739733
# This is a visual adaptation of some of the tests I wrote for Silicon8
@@ -777,32 +771,30 @@
777771
: quirks-run-tests
778772
waitKeyRelease
779773

780-
# Determine frames per second
774+
# Determine frames per second for dispQuirk
781775
clear
782-
v0 := 120
783-
delay := v0
784776
i := quirks-values
785777
load v4
786778
i := quirks-image
779+
vF := 120
780+
delay := vF
787781
loop
788-
v5 := 32
782+
v5 := 30
789783
loop
790-
sprite v0 v1 8
784+
sprite v0 v1 1
791785
v5 -= 1
792-
if v5 != 0 then again
786+
if v5 != 0 then
787+
again
793788
v2 += v4
794789
v3 += vF
795790
vE := delay
796791
if vE != 0 then again
797792

798-
vE := 128
799-
v2 >>= v2
800-
v3 >>= v3
801-
if vF == 1 then v2 |= vE
802-
793+
# We expect the inner loop with 30 `sprite`s to have been able to run four
794+
# times in the timespan of 120 interrupts
803795
v0 := 1
804796
if v3 != 0 then v0 := 0
805-
if v2 != 2 then v0 := 0
797+
if v2 != 4 then v0 := 0
806798
i := scratchpad-plus-1
807799
save v0
808800

@@ -1036,7 +1028,6 @@
10361028

10371029
jump menu-after-keypress
10381030

1039-
10401031
# Keypad test
10411032
# A fresh new implementation for this test suite
10421033

@@ -1138,34 +1129,33 @@
11381129
sprite v0 v1 3
11391130
jump menu-after-keypress
11401131

1141-
1142-
1143-
1144-
: logo-part1
1132+
: splash-0-0
11451133
0x0f 0x02 0x02 0x02 0x02 0x02 0x00 0x00 0x1f 0x3f 0x71 0xe0 0xe5 0xe0 0xe8
1146-
: logo-part2
1134+
: splash-1-0
11471135
0xa0 0x0d 0x2a 0x28 0x28 0x28 0x00 0x00 0x18 0xb8 0xb8 0x38 0x38 0x3f 0xbf
1148-
: logo-part3
1136+
: splash-2-0
11491137
0x00 0x19 0xa5 0xbd 0xa1 0x9d 0x00 0x00 0x0c 0x1d 0x1d 0x01 0x0d 0x1d 0x9d
1150-
: logo-part4
1138+
: splash-3-0
11511139
0x01 0xc7 0x29 0x29 0x29 0x27 0x00 0x00 0xf8 0xfc 0xce 0xc6 0xc6 0xc6 0xc6
1152-
: logo-part5
1140+
: splash-4-0
11531141
0x00 0x49 0x4a 0x49 0x48 0x3b 0x00 0x00 0x00 0x01 0x03 0x03 0x03 0x01 0xf0
1154-
: logo-part6
1142+
: splash-5-0
11551143
0x30 0x90 0x00 0x00 0x80 0x00 0x00 0x00 0xfe 0xc7 0x83 0x83 0x83 0xc6 0xfc
1156-
: logo-part7
1144+
: splash-0-1
11571145
0xe7 0xe0 0xe0 0xe0 0xe0 0x71 0x3f 0x1f 0x00 0x00 0x07 0x02 0x02 0x02 0x02
1158-
: logo-part8
1146+
: splash-1-1
11591147
0x39 0x38 0x38 0x38 0x38 0xb8 0xb8 0x38 0x00 0x00 0x31 0x4a 0x79 0x40 0x3b
1160-
: logo-part9
1148+
: splash-2-1
11611149
0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0x00 0x00 0xa0 0x38 0x20 0xa0 0x18
1162-
: logo-part10
1150+
: splash-3-1
11631151
0xce 0xfc 0xf8 0xc0 0xc0 0xca 0xca 0xc4 0x00 0x00 0x30 0x44 0x24 0x14 0x63
1164-
: logo-part11
1165-
0xf1 0x03 0x07 0xc7 0x27 0x47 0x83 0xe1 0x00 0x00 0x28 0x8e 0xa8 0xa8 0xa6
1166-
: logo-part12
1152+
: splash-4-1
1153+
0xf1 0x03 0x07 0xc7 0x27 0x47 0x23 0xc1 0x00 0x00 0x28 0x8e 0xa8 0xa8 0xa6
1154+
: splash-5-1
11671155
0xce 0x87 0x03 0x03 0x03 0x87 0xfe 0xfc 0x00 0x00 0x60 0x90 0xf0 0x80 0x70
11681156

1157+
1158+
11691159
: scratchpad
11701160
0
11711161
: scratchpad-plus-1
@@ -1177,6 +1167,7 @@
11771167
: scratchpad-plus-16
11781168
0
11791169

1170+
11801171
: menu-main
11811172
10 8 :pointer ibm-logo
11821173
10 13 :pointer corax89
@@ -1201,6 +1192,7 @@
12011192
0b11000000
12021193
0b11000000
12031194

1195+
12041196
# Positive and negative images
12051197
: imageok
12061198
0xEA 0xAC 0xAA 0xEA
@@ -1372,6 +1364,7 @@
13721364
0b00000000
13731365
0b01000000
13741366

1367+
13751368
: ibm-logo-part1
13761369
0xFF 0x00 0xFF 0x00 0x3C 0x00 0x3C 0x00 0x3C 0x00 0x3C 0x00 0xFF 0x00 0xFF
13771370
: ibm-logo-part2
@@ -1385,13 +1378,15 @@
13851378
: ibm-logo-part6
13861379
0xE0 0x00 0xE0 0x00 0x80 0x00 0x80 0x00 0x80 0x00 0x80 0x00 0xE0 0x00 0xE0
13871380

1381+
13881382
: flags-no-carry
13891383
str "HAPPY" 0
13901384
: flags-carry
13911385
str "CARRY" 0
13921386
: flags-other
13931387
str "OTHER" 0
13941388

1389+
13951390
: quirks-menu
13961391
12 13 :pointer quirks-chip8
13971392
12 18 :pointer quirks-schip
@@ -1427,9 +1422,10 @@
14271422
str "ERR" 0
14281423

14291424
: quirks-values
1430-
28 12 0 0 1
1425+
32 12 0 0 1
14311426
: quirks-image
1432-
0x3C 0x7E 0xFF 0xDB 0xFF 0xDB 0x66 0x3C
1427+
0b10000000
1428+
14331429

14341430
: keypad-menu
14351431
4 13 :pointer keypad-down
@@ -1493,6 +1489,7 @@
14931489
0b11111110
14941490
0b11111110
14951491

1492+
14961493
# Jump quirk targets:
14971494
:org 0xE87
14981495
# We jump here when using v0 in the `jump0` quirks test
@@ -1501,4 +1498,4 @@
15011498
:org 0xE8B
15021499
# We jump here when using vE in the `jump0` quirks test
15031500
v5 := 1
1504-
jump quirks-resume
1501+
jump quirks-resume

bin/chip8-test-suite.ch8

0 Bytes
Binary file not shown.

docs/index.html

Lines changed: 12 additions & 6 deletions
Large diffs are not rendered by default.

pictures/splash.png

435 Bytes
Loading

0 commit comments

Comments
 (0)