aboutsummaryrefslogtreecommitdiffstats
path: root/audio/engine_1.asm
diff options
context:
space:
mode:
Diffstat (limited to 'audio/engine_1.asm')
-rw-r--r--audio/engine_1.asm17
1 files changed, 9 insertions, 8 deletions
diff --git a/audio/engine_1.asm b/audio/engine_1.asm
index c155dda6..fc70c73d 100644
--- a/audio/engine_1.asm
+++ b/audio/engine_1.asm
@@ -15,9 +15,9 @@ Audio1_UpdateMusic::
ld a, [wMuteAudioAndPauseMusic]
and a
jr z, .applyAffects
- bit 7, a
+ bit BIT_MUTE_AUDIO, a
jr nz, .nextChannel
- set 7, a
+ set BIT_MUTE_AUDIO, a
ld [wMuteAudioAndPauseMusic], a
xor a ; disable all channels' output
ldh [rNR51], a
@@ -161,7 +161,7 @@ Audio1_PlayNextNote:
cp $4
jr nz, .asm_918c
ld a, [wLowHealthAlarm]
- bit 7, a
+ bit BIT_LOW_HEALTH_ALARM, a
jr z, .asm_918c
call Audio1_EnableChannelOutput
ret
@@ -206,7 +206,7 @@ Audio1_sound_ret:
.dontDisable
jr .afterDisable
.returnFromCall
- res 1, [hl]
+ res BIT_SOUND_CALL, [hl]
ld d, $0
ld a, c
add a
@@ -386,8 +386,8 @@ Audio1_toggle_perfect_pitch:
ld hl, wChannelFlags1
add hl, bc
ld a, [hl]
- xor $1
- ld [hl], a ; flip bit 0 of wChannelFlags1
+ xor 1 << BIT_PERFECT_PITCH
+ ld [hl], a
jp Audio1_sound_ret
Audio1_vibrato:
@@ -841,7 +841,8 @@ Audio1_note_pitch:
bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
jr z, .skipFrequencyInc
inc e ; if yes, increment the frequency by 1
- jr nc, .skipFrequencyInc
+ jr nc, .skipFrequencyInc ; Likely a mistake, because `inc` does not set flag C.
+ ; Fortunately this does not seem to affect any notes that actually occur.
inc d
.skipFrequencyInc
ld hl, wChannelFrequencyLowBytes
@@ -971,7 +972,7 @@ Audio1_ApplyWavePatternAndFrequency:
cp $4
ret nz
ld a, [wLowHealthAlarm]
- bit 7, a
+ bit BIT_LOW_HEALTH_ALARM, a
ret z
xor a
ld [wFrequencyModifier], a