diff options
| author | Sylvie <35663410+Rangi42@users.noreply.github.com> | 2024-09-23 23:51:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-23 23:51:44 -0400 |
| commit | 8f1dcf07e598c6e3d34b5d255f04faff1667d83b (patch) | |
| tree | fe962b2c23dd40ad3d69f7145a46a002c3285a76 /audio | |
| parent | Remove the Discord webhook and tools/unnamed.py (diff) | |
| download | pokeyellow-8f1dcf07e598c6e3d34b5d255f04faff1667d83b.tar.gz pokeyellow-8f1dcf07e598c6e3d34b5d255f04faff1667d83b.tar.xz pokeyellow-8f1dcf07e598c6e3d34b5d255f04faff1667d83b.zip | |
Identify more flag bits (#464)
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/engine_1.asm | 10 | ||||
| -rw-r--r-- | audio/engine_2.asm | 16 | ||||
| -rw-r--r-- | audio/engine_3.asm | 10 | ||||
| -rw-r--r-- | audio/low_health_alarm.asm | 14 |
4 files changed, 25 insertions, 25 deletions
diff --git a/audio/engine_1.asm b/audio/engine_1.asm index 99d47f37..e9642b32 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 @@ -197,7 +197,7 @@ Audio1_sound_ret: .dontDisable jr .afterDisable .returnFromCall - res 1, [hl] + res BIT_SOUND_CALL, [hl] ld d, $0 ld a, c add a @@ -377,8 +377,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: diff --git a/audio/engine_2.asm b/audio/engine_2.asm index bcaab694..2f11c027 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -17,9 +17,9 @@ Audio2_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 @@ -163,8 +163,8 @@ Audio2_PlayNextNote: ld a, c cp CHAN5 jr nz, .beginChecks - ld a, [wLowHealthAlarm] ; low health alarm enabled? - bit 7, a + ld a, [wLowHealthAlarm] + bit BIT_LOW_HEALTH_ALARM, a ret nz .beginChecks ; --- @@ -208,7 +208,7 @@ Audio2_sound_ret: .dontDisable jr .afterDisable .returnFromCall - res 1, [hl] + res BIT_SOUND_CALL, [hl] ld d, $0 ld a, c add a @@ -388,8 +388,8 @@ Audio2_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 Audio2_sound_ret Audio2_vibrato: @@ -978,7 +978,7 @@ Audio2_ResetCryModifiers: cp CHAN5 jr nz, .skip ld a, [wLowHealthAlarm] - bit 7, a + bit BIT_LOW_HEALTH_ALARM, a jr z, .skip xor a ld [wFrequencyModifier], a diff --git a/audio/engine_3.asm b/audio/engine_3.asm index e5d285a3..f524875f 100644 --- a/audio/engine_3.asm +++ b/audio/engine_3.asm @@ -15,9 +15,9 @@ Audio3_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 @@ -197,7 +197,7 @@ Audio3_sound_ret: .dontDisable jr .afterDisable .returnFromCall - res 1, [hl] + res BIT_SOUND_CALL, [hl] ld d, $0 ld a, c add a @@ -377,8 +377,8 @@ Audio3_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 Audio3_sound_ret Audio3_vibrato: diff --git a/audio/low_health_alarm.asm b/audio/low_health_alarm.asm index 35fe1815..728f5f65 100644 --- a/audio/low_health_alarm.asm +++ b/audio/low_health_alarm.asm @@ -1,12 +1,12 @@ Music_DoLowHealthAlarm:: ld a, [wLowHealthAlarm] - cp $ff + cp DISABLE_LOW_HEALTH_ALARM jr z, .disableAlarm - bit 7, a ;alarm enabled? - ret z ;nope + bit BIT_LOW_HEALTH_ALARM, a + ret z - and $7f ;low 7 bits are the timer. + and LOW_HEALTH_TIMER_MASK jr nz, .notToneHi ;if timer > 0, play low tone. call .playToneHi @@ -19,15 +19,15 @@ Music_DoLowHealthAlarm:: call .playToneLo ;actually set the sound registers. .noTone - ld a, $86 + ld a, CRY_SFX_END ld [wChannelSoundIDs + CHAN5], a ;disable sound channel? ld a, [wLowHealthAlarm] - and $7f ;decrement alarm timer. + and LOW_HEALTH_TIMER_MASK dec a .resetTimer ; reset the timer and enable flag. - set 7, a + set BIT_LOW_HEALTH_ALARM, a ld [wLowHealthAlarm], a ret |
