Skip to content

Commit 253f5de

Browse files
authored
Merge pull request #12 from Timendus/separate-tests
Working on the release of v4.0
2 parents af78298 + a2e4db3 commit 253f5de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10692
-2141
lines changed

README.md

Lines changed: 239 additions & 217 deletions
Large diffs are not rendered by default.

bin/1-chip8-logo.8o

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# CHIP-8 logo ROM by Timendus, published here before:
2+
# https://github.com/Timendus/chip-8/blob/master/octo/CHIP-8%20logo.8o
3+
4+
# 132 bytes, 20 cycles to show "CHIP-8" on the screen
5+
#
6+
# This ROM is simpler than the IBM logo in two ways:
7+
# a) It does not use the addition instruction
8+
# b) It only renders aligned sprites (all coordinates are multiples of 8)
9+
#
10+
# Uses only these five instructions:
11+
# * Clear the screen
12+
# * Load normal register with immediate value
13+
# * Load i register with immediate value
14+
# * Draw sprite to screen (only aligned)
15+
# * Jump (at the end, so kinda optional)
16+
17+
:macro show X address {
18+
v0 := X
19+
i := address
20+
sprite v0 v1 15
21+
}
22+
23+
: main
24+
clear
25+
26+
v1 := 1
27+
show 8 splash-0-0
28+
show 16 splash-1-0
29+
show 24 splash-2-0
30+
show 32 splash-3-0
31+
show 40 splash-4-0
32+
show 48 splash-5-0
33+
34+
v1 := 16
35+
show 8 splash-0-1
36+
show 16 splash-1-1
37+
show 24 splash-2-1
38+
show 32 splash-3-1
39+
show 40 splash-4-1
40+
show 48 splash-5-1
41+
42+
loop again
43+
: splash-0-0
44+
0x0f 0x02 0x02 0x02 0x02 0x02 0x00 0x00 0x1f 0x3f 0x71 0xe0 0xe5 0xe0 0xe8
45+
: splash-1-0
46+
0xa0 0x0d 0x2a 0x28 0x28 0x28 0x00 0x00 0x18 0xb8 0xb8 0x38 0x38 0x3f 0xbf
47+
: splash-2-0
48+
0x00 0x19 0xa5 0xbd 0xa1 0x9d 0x00 0x00 0x0c 0x1d 0x1d 0x01 0x0d 0x1d 0x9d
49+
: splash-3-0
50+
0x01 0xc7 0x29 0x29 0x29 0x27 0x00 0x00 0xf8 0xfc 0xce 0xc6 0xc6 0xc6 0xc6
51+
: splash-4-0
52+
0x00 0x49 0x4a 0x49 0x48 0x3b 0x00 0x00 0x00 0x01 0x03 0x03 0x03 0x01 0xf0
53+
: splash-5-0
54+
0x30 0x90 0x00 0x00 0x80 0x00 0x00 0x00 0xfe 0xc7 0x83 0x83 0x83 0xc6 0xfc
55+
: splash-0-1
56+
0xe7 0xe0 0xe0 0xe0 0xe0 0x71 0x3f 0x1f 0x00 0x00 0x07 0x02 0x02 0x02 0x02
57+
: splash-1-1
58+
0x39 0x38 0x38 0x38 0x38 0xb8 0xb8 0x38 0x00 0x00 0x31 0x4a 0x79 0x40 0x3b
59+
: splash-2-1
60+
0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0x00 0x00 0xa0 0x38 0x20 0xa0 0x18
61+
: splash-3-1
62+
0xce 0xfc 0xf8 0xc0 0xd4 0xdc 0xc4 0xc5 0x00 0x00 0x30 0x44 0x24 0x14 0x63
63+
: splash-4-1
64+
0xf1 0x03 0x07 0x07 0x77 0x57 0x53 0x71 0x00 0x00 0x28 0x8e 0xa8 0xa8 0xa6
65+
: splash-5-1
66+
0xce 0x87 0x03 0x03 0x03 0x87 0xfe 0xfc 0x00 0x00 0x60 0x90 0xf0 0x80 0x70
67+

bin/1-chip8-logo.ch8

260 Bytes
Binary file not shown.

bin/2-ibm-logo.8o

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Disassembly of the famous "IBM logo" program, published here before:
2+
# https://github.com/Timendus/chip-8/blob/master/octo/IBM%20logo.8o
3+
4+
# Annotated and converted to Octo mnemonics by Timendus, in the hope that it
5+
# will be useful to people trying to debug their CHIP-8 interpreters
6+
#
7+
# Original "IBM logo" MD5 hash: 2dbace8066709ac9a264d23281820d32
8+
# MD5 hash of binary from this code: 2dbace8066709ac9a264d23281820d32
9+
#
10+
# Unfortunately adding the version number to the image data changed the MD5
11+
# hash of the final binary, but functionally absolutely nothing changed.
12+
13+
: main
14+
clear # Address 512 / 0x200
15+
16+
i := ibm-0-0 # Address 514 / 0x202
17+
v0 := 12 # Address 516 / 0x204
18+
v1 := 8
19+
sprite v0 v1 15 # Address 520 / 0x208
20+
21+
v0 += 9 # Address 522 / 0x20A
22+
i := ibm-1-0
23+
sprite v0 v1 15
24+
25+
i := ibm-2-0 # Interesting mixup here, swapping the operations
26+
v0 += 8
27+
sprite v0 v1 15
28+
29+
v0 += 4
30+
i := ibm-3-0
31+
sprite v0 v1 15
32+
33+
v0 += 8
34+
i := ibm-4-0
35+
sprite v0 v1 15
36+
37+
v0 += 8
38+
i := ibm-5-0
39+
sprite v0 v1 15
40+
41+
loop again # Address 552 / 0x228
42+
43+
# What's interesting about this image data is that the author could have
44+
# precisely stored the full image in 5 by 15 bytes. Yet they have chosen a way
45+
# to pack the image which needs 6 by 15 bytes. The most obvious explanation for
46+
# this that I can come up with is that they approached the challenge one letter
47+
# at a time. Maybe it was easier to do the conversions from bits to hexadecimal
48+
# this way.
49+
50+
: ibm-0-0
51+
0xff 0x00 0xff 0x00 0x3c 0x00 0x3c 0x00 0x3c 0x00 0x3c 0x00 0xff 0x00 0xff
52+
: ibm-1-0
53+
0xff 0x00 0xff 0x00 0x38 0x00 0x3f 0x00 0x3f 0x00 0x38 0x00 0xff 0x00 0xff
54+
: ibm-2-0
55+
0x80 0x00 0xe0 0x00 0xe0 0x00 0x80 0x00 0x80 0x00 0xe0 0x00 0xe0 0x00 0x80
56+
: ibm-3-0
57+
0xf8 0x00 0xfc 0x00 0x3e 0x00 0x3f 0x00 0x3b 0x00 0x39 0x00 0xf8 0x00 0xf8
58+
: ibm-4-0
59+
0x03 0x00 0x07 0x00 0x0f 0x00 0xbf 0x00 0xfb 0x00 0xf3 0x00 0xe3 0x00 0x43
60+
: ibm-5-0
61+
0xe5 0x05 0xe2 0x00 0x85 0x07 0x81 0x01 0x80 0x02 0x80 0x07 0xe5 0x05 0xe7
62+

bin/2-ibm-logo.ch8

132 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)