-
Notifications
You must be signed in to change notification settings - Fork 0
/
slides.txt
163 lines (111 loc) · 3.04 KB
/
slides.txt
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
FPGABoy by Kai Tamkun
_____________
| _"_________ |
||.---------.||
||| |||
||| |||
||| |||
||| |||
||'---------'/|
| """"""""""` |
| || ^^^ () |
|[ ] () |
| || |
| |
| |
| _ _ |
| :::|
jgs | .::`/
'"""""""""""""
Image Credit: Joan Stark
\s
Project
- Made a Game Boy sound chip
- Accuracy nice but not a requirement
- Clocks and CDC are finicky
- Got bored, implemented NES APU too
\s
Pokmon Card GB2 (GR duel music)
\s
The Legend of Zelda (title screen)
\s
Generators
- Created some nice generators
(TableGen, TriangleGen, NoiseGen,
FPSummer, DynamicClocker, Divider)
and proceeded to never use them
- Used SquareGenExternal, StaticClocker
and PeriodClocker in APUs
- Used some generators for the graphics
- Can very conveniently prefill Vecs
with sine wave values
\s
Interfaces
- Standard buttons, switches and LEDs
- Code produces 9-bit audio
- Audio is output over HDMI and aux
\s
Incremental Development
1. Implemented square and sine waves
2. Multi-cycle channel mixer
3. Top-level Verilog
4. Basic audio over aux
5. VGM tools
6. State machine
7. Game Boy channels: 1, 2, 4, 3
8. HDMI output: video, audio
9. Presentation slides
10. NES channels: 1, 2, 3, 4
11. Silly graphics stuff
\s
Testing
- Testing? Never heard of it #yolo
- test:main ratio < 20%
- Tests mostly just generate VCD output
for manual inspection in GTKWave
- Divider was exhaustively tested for
8-bit inputs
\s
Inner Workings
- State machine writes to registers,
channel modules read and interpret
- State machine input stored in BRAM
\s
Presentation
- I forgot there were two projectors
- Slides stored as ASCII(-ish) in BRAM
- Rendered by FPGA
- okLch to RGB conversion by lookup
table
- Typeface might look familiar
- Why not use an NES controller too?
\s
Game Boy APU
- Game Boy and Game Boy Color use the
same sound chip
- Channel 1: square wave with frequency
sweeper, envelope, length counter and
duty cycler
- Channel 2: channel 1 without sweeper
- Channel 3: output arbitrary waveforms
from registers
- Channel 4: LFSR-based noise generator
\s
NES APU
- Similar to Game Boy APU
- Channels: 2 square waves, triangle
wave, noise, delta modulation channel
- DMC unimplemented due to format
constraints
- Not very commonly used anyway
- Triggering based on register writes,
not designated bits
\s
Conclusion
- 171+ hours well spent
- Definitely avoid using 6+ different
clocks if you can
\s
Thanks for a great quarter! =)
Repo @ https://heimskr.gay/apu
Discord: Heimskr#0001