-
Notifications
You must be signed in to change notification settings - Fork 7
/
7-beep.8o
74 lines (66 loc) · 1.14 KB
/
7-beep.8o
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Beep test
# This is a new test for this test suite, that allows you to test if your buzzer
# is working. It will beep SOS in morse code and flash a speaker icon on the
# display in the same pattern. If you press the CHIP-8 B button it will give you
# manual control over the buzzer.
: main
i := pattern
load v0
v2 := 1
v3 := v0
v4 := 0xB
vA := 28
vB := 12
loop
i := pattern
i += v2
load v1
i := speaker
sprite vA vB 7
buzzer := v0
delay := v0
wait-for-delay
sprite vA vB 7
delay := v1
wait-for-delay
v2 += 2
if v2 != v3 then
again
jump main
: wait-for-delay
if v4 key then jump manual-control
v0 := delay
if v0 != 0 then jump wait-for-delay
return
: manual-control
v0 := 0
v1 := 60
v2 := 0xB
clear
loop
i := speaker
sprite vA vB 7
loop
buzzer := v1
if v2 key then
again
sprite vA vB 7
loop
buzzer := v0
if v2 -key then
again
again
:segment data
: pattern
19
10 5 10 5 10 20
30 5 30 5 30 20
10 5 10 5 10 60
: speaker
0b00011001
0b00101010
0b11001000
0b10001011
0b11001000
0b00101010
0b00011001