diff options
| author | dannye <33dannye@gmail.com> | 2024-09-25 00:45:00 -0500 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2024-09-25 00:45:00 -0500 |
| commit | a02a98ee7ada1a658e28698484058be2796dc0df (patch) | |
| tree | 945986054565bd8b5212fc755415096050d1d3a8 /audio | |
| parent | Use long option flags for rgbgfx, same as tools/gfx (diff) | |
| parent | Use `const_skip` (diff) | |
| download | pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/engine_1.asm | 17 | ||||
| -rw-r--r-- | audio/engine_2.asm | 4 | ||||
| -rw-r--r-- | audio/low_health_alarm.asm | 14 |
3 files changed, 18 insertions, 17 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 diff --git a/audio/engine_2.asm b/audio/engine_2.asm index 902db361..2b5a219c 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -198,7 +198,7 @@ INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm" Audio2_InitMusicVariables:: xor a - ld [wUnusedC000], a + ld [wUnusedMusicByte], a ld [wDisableChannelOutputWhenSfxEnds], a ld [wMusicTempo + 1], a ld [wMusicWaveInstrument], a @@ -376,7 +376,7 @@ Audio2_StopAllAudio:: ld a, $77 ldh [rNR50], a ; full volume xor a - ld [wUnusedC000], a + ld [wUnusedMusicByte], a ld [wDisableChannelOutputWhenSfxEnds], a ld [wMuteAudioAndPauseMusic], a ld [wMusicTempo + 1], a 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 |
