Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/constants/audio_constants.asm
1270 views
1
; pitch
2
; Audio[1|2|3]_Pitches indexes (see audio/notes.asm)
3
const_def
4
const C_ ; 0
5
const C# ; 1
6
const D_ ; 2
7
const D# ; 3
8
const E_ ; 4
9
const F_ ; 5
10
const F# ; 6
11
const G_ ; 7
12
const G# ; 8
13
const A_ ; 9
14
const A# ; A
15
const B_ ; B
16
DEF NUM_NOTES EQU const_value
17
18
; channel
19
; Audio[1|2|3]_HWChannelBaseAddresses, Audio[1|2|3]_HWChannelDisableMasks,
20
; and Audio[1|2|3]_HWChannelEnableMasks indexes (see audio/engine_[1|2|3].asm)
21
const_def
22
const CHAN1 ; 0
23
const CHAN2 ; 1
24
const CHAN3 ; 2
25
const CHAN4 ; 3
26
DEF NUM_MUSIC_CHANS EQU const_value
27
const CHAN5 ; 4
28
const CHAN6 ; 5
29
const CHAN7 ; 6
30
const CHAN8 ; 7
31
DEF NUM_NOISE_CHANS EQU const_value - NUM_MUSIC_CHANS
32
DEF NUM_CHANNELS EQU const_value
33
34
; HW sound channel register base addresses
35
DEF HW_CH1_BASE EQU LOW(rAUD1SWEEP)
36
DEF HW_CH2_BASE EQU LOW(rAUD2LEN) - 1
37
DEF HW_CH3_BASE EQU LOW(rAUD3ENA)
38
DEF HW_CH4_BASE EQU LOW(rAUD4LEN) - 1
39
40
; HW sound channel enable bit masks
41
DEF HW_CH1_ENABLE_MASK EQU %00010001
42
DEF HW_CH2_ENABLE_MASK EQU %00100010
43
DEF HW_CH3_ENABLE_MASK EQU %01000100
44
DEF HW_CH4_ENABLE_MASK EQU %10001000
45
46
; HW sound channel disable bit masks
47
DEF HW_CH1_DISABLE_MASK EQU (~HW_CH1_ENABLE_MASK & $ff)
48
DEF HW_CH2_DISABLE_MASK EQU (~HW_CH2_ENABLE_MASK & $ff)
49
DEF HW_CH3_DISABLE_MASK EQU (~HW_CH3_ENABLE_MASK & $ff)
50
DEF HW_CH4_DISABLE_MASK EQU (~HW_CH4_ENABLE_MASK & $ff)
51
52
const_def 1
53
const REG_DUTY_SOUND_LEN ; 1
54
const REG_VOLUME_ENVELOPE ; 2
55
const REG_FREQUENCY_LO ; 3
56
57
; wChannelFlags1 constants
58
const_def
59
const BIT_PERFECT_PITCH ; 0 ; controlled by toggle_perfect_pitch command
60
const BIT_SOUND_CALL ; 1 ; if in sound call
61
const BIT_NOISE_OR_SFX ; 2 ; if channel is the music noise channel or an SFX channel
62
const BIT_VIBRATO_DIRECTION ; 3 ; if the pitch is above or below normal (cycles)
63
const BIT_PITCH_SLIDE_ON ; 4 ; if pitch slide is active
64
const BIT_PITCH_SLIDE_DECREASING ; 5 ; if the pitch slide frequency is decreasing (instead of increasing)
65
const BIT_ROTATE_DUTY_CYCLE ; 6 ; if rotating duty cycle
66
67
; wChannelFlags2 constant (only has one flag)
68
DEF BIT_EXECUTE_MUSIC EQU 0 ; if in execute music
69
70
; wMuteAudioAndPauseMusic
71
DEF BIT_MUTE_AUDIO EQU 7
72
73
; wLowHealthAlarm
74
DEF BIT_LOW_HEALTH_ALARM EQU 7
75
DEF LOW_HEALTH_TIMER_MASK EQU %01111111
76
DEF DISABLE_LOW_HEALTH_ALARM EQU $ff
77
78