Skip to content

Commit 1054884

Browse files
committed
Add PAL note table
The PAL note table is only included if the PAL label is defined somewhere. Uncomment line 9 in pong.asm to enable the PAL table.
1 parent 0a6cb0e commit 1054884

File tree

2 files changed

+164
-0
lines changed

2 files changed

+164
-0
lines changed

note_table_pal.i

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
;PAL Period Lookup Table. Thanks Celius!
2+
;http://www.freewebs.com/the_bott/NotesTablePAL.txt
3+
note_table:
4+
; C Db D Eb E F Gb G Ab A Bb B
5+
.word $0760, $06F6, $0692 ; A1-B1 ($00-$02)
6+
.word $0634, $05DB, $0586, $0537, $04EC, $04A5, $0462, $0423, $03E8, $03B0, $037B, $0349 ; C2-B2 ($03-$0E)
7+
.word $0319, $02ED, $02C3, $029B, $0275, $0252, $0231, $0211, $01F3, $01D7, $01BD, $01A4 ; C3-B3 ($0F-$1A)
8+
.word $018C, $0176, $0161, $014D, $013A, $0129, $0118, $0108, $00F9, $00EB, $00DE, $00D1 ; C4-B4 ($1B-$26)
9+
.word $00C6, $00BA, $00B0, $00A6, $009D, $0094, $008B, $0084, $007C, $0075, $006E, $0068 ; C5-B5 ($27-$32)
10+
.word $0062, $005D, $0057, $004E, $0049, $0045, $0045, $0041, $003E, $003A, $0037, $0034 ; C6-B6 ($33-$3E)
11+
.word $0031, $002E, $002B, $0029, $0026, $0024, $0022, $0020, $001E, $001D, $001B, $0019 ; C7-B7 ($3F-$4A)
12+
.word $0018, $0016, $0015, $0014, $0013, $0012, $0011, $0010, $000F, $000E, $000D, $000C ; C8-B8 ($4B-$56)
13+
.word $000B, $000B, $000A, $0009, $0009, $0008, $0008 ; C9-F#9 ($57-$5D)
14+
15+
;Note: octaves in music traditionally start at C, not A
16+
A1 = $00 ;the "1" means Octave 1
17+
As1 = $01 ;the "s" means "sharp"
18+
Bb1 = $01 ;the "b" means "flat" A# == Bb, so same value
19+
B1 = $02
20+
21+
C2 = $03
22+
Cs2 = $04
23+
Db2 = $04
24+
D2 = $05
25+
Ds2 = $06
26+
Eb2 = $06
27+
E2 = $07
28+
F2 = $08
29+
Fs2 = $09
30+
Gb2 = $09
31+
G2 = $0A
32+
Gs2 = $0B
33+
Ab2 = $0B
34+
A2 = $0C
35+
As2 = $0D
36+
Bb2 = $0D
37+
B2 = $0E
38+
39+
C3 = $0F
40+
Cs3 = $10
41+
Db3 = $10
42+
D3 = $11
43+
Ds3 = $12
44+
Eb3 = $12
45+
E3 = $13
46+
F3 = $14
47+
Fs3 = $15
48+
Gb3 = $15
49+
G3 = $16
50+
Gs3 = $17
51+
Ab3 = $17
52+
A3 = $18
53+
As3 = $19
54+
Bb3 = $19
55+
B3 = $1a
56+
57+
C4 = $1b
58+
Cs4 = $1c
59+
Db4 = $1c
60+
D4 = $1d
61+
Ds4 = $1e
62+
Eb4 = $1e
63+
E4 = $1f
64+
F4 = $20
65+
Fs4 = $21
66+
Gb4 = $21
67+
G4 = $22
68+
Gs4 = $23
69+
Ab4 = $23
70+
A4 = $24
71+
As4 = $25
72+
Bb4 = $25
73+
B4 = $26
74+
75+
C5 = $27
76+
Cs5 = $28
77+
Db5 = $28
78+
D5 = $29
79+
Ds5 = $2a
80+
Eb5 = $2a
81+
E5 = $2b
82+
F5 = $2c
83+
Fs5 = $2d
84+
Gb5 = $2d
85+
G5 = $2e
86+
Gs5 = $2f
87+
Ab5 = $2f
88+
A5 = $30
89+
As5 = $31
90+
Bb5 = $31
91+
B5 = $32
92+
93+
C6 = $33
94+
Cs6 = $34
95+
Db6 = $34
96+
D6 = $35
97+
Ds6 = $36
98+
Eb6 = $36
99+
E6 = $37
100+
F6 = $38
101+
Fs6 = $39
102+
Gb6 = $39
103+
G6 = $3a
104+
Gs6 = $3b
105+
Ab6 = $3b
106+
A6 = $3c
107+
As6 = $3d
108+
Bb6 = $3d
109+
B6 = $3e
110+
111+
C7 = $3f
112+
Cs7 = $40
113+
Db7 = $40
114+
D7 = $41
115+
Ds7 = $42
116+
Eb7 = $42
117+
E7 = $43
118+
F7 = $44
119+
Fs7 = $45
120+
Gb7 = $45
121+
G7 = $46
122+
Gs7 = $47
123+
Ab7 = $47
124+
A7 = $48
125+
As7 = $49
126+
Bb7 = $49
127+
B7 = $4a
128+
129+
C8 = $4b
130+
Cs8 = $4c
131+
Db8 = $4c
132+
D8 = $4d
133+
Ds8 = $4e
134+
Eb8 = $4e
135+
E8 = $4f
136+
F8 = $50
137+
Fs8 = $51
138+
Gb8 = $51
139+
G8 = $52
140+
Gs8 = $53
141+
Ab8 = $53
142+
A8 = $54
143+
As8 = $55
144+
Bb8 = $55
145+
B8 = $56
146+
147+
C9 = $57
148+
Cs9 = $58
149+
Db9 = $58
150+
D9 = $59
151+
Ds9 = $5a
152+
Eb9 = $5a
153+
E9 = $5b
154+
F9 = $5c
155+
Fs9 = $5d
156+
Gb9 = $5d

pong.asm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
.include "ram.asm"
77

8+
; Uncomment the following line for PAL (corrects audio)
9+
;PAL
10+
811
; Main code
912
.bank 0
1013
.org $8000
@@ -427,7 +430,12 @@ UnPausedAttributes:
427430
;.db $08, $C0, $0F
428431
;.db $00
429432

433+
434+
.ifdef PAL
435+
.include "note_table_pal.i"
436+
.else
430437
.include "note_table.i"
438+
.endif
431439

432440
; Vectors (interupts?)
433441
.org $FFFA ; first of three vectors starts here

0 commit comments

Comments
 (0)