diff options
| author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2025-06-30 12:47:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-30 12:47:22 -0400 |
| commit | 56c405de09ce267c4cfbc68a15c37b2ff51c635a (patch) | |
| tree | 47d25c237e9af824f7a57295a2d2e298b194a8e6 /audio | |
| parent | Distinguish single trainer pics section from Pokemon pics (diff) | |
| download | pokeyellow-56c405de09ce267c4cfbc68a15c37b2ff51c635a.tar.gz pokeyellow-56c405de09ce267c4cfbc68a15c37b2ff51c635a.tar.xz pokeyellow-56c405de09ce267c4cfbc68a15c37b2ff51c635a.zip | |
Replace hardware_constants.asm with hardware.inc (#511)
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/engine_1.asm | 78 | ||||
| -rw-r--r-- | audio/engine_2.asm | 78 | ||||
| -rw-r--r-- | audio/engine_3.asm | 78 | ||||
| -rw-r--r-- | audio/low_health_alarm.asm | 2 | ||||
| -rw-r--r-- | audio/wave_samples.asm | 2 |
5 files changed, 119 insertions, 119 deletions
diff --git a/audio/engine_1.asm b/audio/engine_1.asm index e9642b32..57eb12ed 100644 --- a/audio/engine_1.asm +++ b/audio/engine_1.asm @@ -20,10 +20,10 @@ Audio1_UpdateMusic:: set BIT_MUTE_AUDIO, a ld [wMuteAudioAndPauseMusic], a xor a ; disable all channels' output - ldh [rNR51], a - ldh [rNR30], a + ldh [rAUDTERM], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a jr .nextChannel .applyAffects call Audio1_ApplyMusicAffects @@ -183,9 +183,9 @@ Audio1_sound_ret: jr nz, .skipSfxChannel3 ; restart hardware channel 3 (wave channel) output ld a, $0 - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a .skipSfxChannel3 jr nz, .dontDisable ld a, [wDisableChannelOutputWhenSfxEnds] @@ -219,9 +219,9 @@ Audio1_sound_ret: .disableChannelOutput ld hl, Audio1_HWChannelDisableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] and [hl] - ldh [rNR51], a + ldh [rAUDTERM], a .afterDisable ld a, [wChannelSoundIDs + CHAN5] cp CRY_SFX_START @@ -241,7 +241,7 @@ Audio1_sound_ret: ret c .skipRewind ld a, [wSavedVolume] - ldh [rNR50], a + ldh [rAUDVOL], a xor a ld [wSavedVolume], a .skipCry @@ -548,7 +548,7 @@ Audio1_volume: cp volume_cmd jr nz, Audio1_execute_music call Audio1_GetNextMusicByte - ldh [rNR50], a ; store volume + ldh [rAUDVOL], a ; store volume jp Audio1_sound_ret Audio1_execute_music: @@ -638,7 +638,7 @@ Audio1_pitch_sweep: bit BIT_EXECUTE_MUSIC, [hl] jr nz, Audio1_note ; no call Audio1_GetNextMusicByte - ldh [rNR10], a + ldh [rAUD1SWEEP], a jp Audio1_sound_ret Audio1_note: @@ -770,9 +770,9 @@ Audio1_note_pitch: ld b, 0 ld hl, Audio1_HWChannelDisableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] and [hl] - ldh [rNR51], a ; disable hardware channel 3's output + ldh [rAUDTERM], a ; disable hardware channel 3's output jr .done .notChannel3 ld b, REG_VOLUME_ENVELOPE @@ -845,7 +845,7 @@ Audio1_EnableChannelOutput: ld b, 0 ld hl, Audio1_HWChannelEnableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] or [hl] ; set this channel's bits ld d, a ld a, c @@ -867,7 +867,7 @@ Audio1_EnableChannelOutput: add hl, bc and [hl] ld d, a - ldh a, [rNR51] + ldh a, [rAUDTERM] ld hl, Audio1_HWChannelDisableMasks add hl, bc and [hl] ; reset this channel's output bits @@ -875,7 +875,7 @@ Audio1_EnableChannelOutput: ld d, a .skip ld a, d - ldh [rNR51], a + ldh [rAUDTERM], a ret Audio1_ApplyDutyCycleAndSoundLength: @@ -926,10 +926,10 @@ Audio1_ApplyWavePatternAndFrequency: ld e, [hl] inc hl ld d, [hl] - ld hl, rWave_0 + ld hl, _AUD3WAVERAM ld b, $f ld a, $0 ; stop hardware channel 3 - ldh [rNR30], a + ldh [rAUD3ENA], a .loop ld a, [de] inc de @@ -939,7 +939,7 @@ Audio1_ApplyWavePatternAndFrequency: and a jr nz, .loop ld a, $80 ; start hardware channel 3 - ldh [rNR30], a + ldh [rAUD3ENA], a pop de .notChannel3 ld a, d @@ -1400,17 +1400,17 @@ Audio1_PlaySound:: ld a, $ff ld [wStereoPanning], a xor a - ldh [rNR50], a + ldh [rAUDVOL], a ld a, $8 - ldh [rNR10], a + ldh [rAUD1SWEEP], a ld a, 0 - ldh [rNR51], a + ldh [rAUDTERM], a xor a - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $77 - ldh [rNR50], a + ldh [rAUDVOL], a jp .playSoundCommon .playSfx @@ -1556,7 +1556,7 @@ Audio1_PlaySound:: cp CHAN5 jr nz, .skipSweepDisable ld a, $8 - ldh [rNR10], a ; sweep off + ldh [rAUD1SWEEP], a ; sweep off .skipSweepDisable ld a, c and a @@ -1566,22 +1566,22 @@ Audio1_PlaySound:: .stopAllAudio ld a, $80 - ldh [rNR52], a ; sound hardware on - ldh [rNR30], a ; wave playback on + ldh [rAUDENA], a ; sound hardware on + ldh [rAUD3ENA], a ; wave playback on xor a - ldh [rNR51], a ; no sound output - ldh [rNR32], a ; mute channel 3 (wave channel) + ldh [rAUDTERM], a ; no sound output + ldh [rAUD3LEVEL], a ; mute channel 3 (wave channel) ld a, $8 - ldh [rNR10], a ; sweep off - ldh [rNR12], a ; mute channel 1 (pulse channel 1) - ldh [rNR22], a ; mute channel 2 (pulse channel 2) - ldh [rNR42], a ; mute channel 4 (noise channel) + ldh [rAUD1SWEEP], a ; sweep off + ldh [rAUD1ENV], a ; mute channel 1 (pulse channel 1) + ldh [rAUD2ENV], a ; mute channel 2 (pulse channel 2) + ldh [rAUD4ENV], a ; mute channel 4 (noise channel) ld a, $40 - ldh [rNR14], a ; counter mode - ldh [rNR24], a - ldh [rNR44], a + ldh [rAUD1HIGH], a ; counter mode + ldh [rAUD2HIGH], a + ldh [rAUD4GO], a ld a, $77 - ldh [rNR50], a ; full volume + ldh [rAUDVOL], a ; full volume xor a ld [wUnusedMusicByte], a ld [wDisableChannelOutputWhenSfxEnds], a @@ -1700,10 +1700,10 @@ Audio1_PlaySound:: ld a, [wSavedVolume] and a jr nz, .done - ldh a, [rNR50] + ldh a, [rAUDVOL] ld [wSavedVolume], a ld a, $77 - ldh [rNR50], a ; full volume + ldh [rAUDVOL], a ; full volume .done ret diff --git a/audio/engine_2.asm b/audio/engine_2.asm index 2f11c027..a7c8692a 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -22,10 +22,10 @@ Audio2_UpdateMusic:: set BIT_MUTE_AUDIO, a ld [wMuteAudioAndPauseMusic], a xor a ; disable all channels' output - ldh [rNR51], a - ldh [rNR30], a + ldh [rAUDTERM], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a jr .nextChannel .applyAffects call Audio2_ApplyMusicAffects @@ -194,9 +194,9 @@ Audio2_sound_ret: jr nz, .skipSfxChannel3 ; restart hardware channel 3 (wave channel) output ld a, $0 - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a .skipSfxChannel3 jr nz, .dontDisable ld a, [wDisableChannelOutputWhenSfxEnds] @@ -230,9 +230,9 @@ Audio2_sound_ret: .disableChannelOutput ld hl, Audio2_HWChannelDisableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] and [hl] - ldh [rNR51], a + ldh [rAUDTERM], a .afterDisable ld a, [wChannelSoundIDs + CHAN5] cp CRY_SFX_START @@ -252,7 +252,7 @@ Audio2_sound_ret: ret c .skipRewind ld a, [wSavedVolume] - ldh [rNR50], a + ldh [rAUDVOL], a xor a ld [wSavedVolume], a .skipCry @@ -559,7 +559,7 @@ Audio2_volume: cp volume_cmd jr nz, Audio2_execute_music call Audio2_GetNextMusicByte - ldh [rNR50], a ; store volume + ldh [rAUDVOL], a ; store volume jp Audio2_sound_ret Audio2_execute_music: @@ -649,7 +649,7 @@ Audio2_pitch_sweep: bit BIT_EXECUTE_MUSIC, [hl] jr nz, Audio2_note ; no call Audio2_GetNextMusicByte - ldh [rNR10], a + ldh [rAUD1SWEEP], a jp Audio2_sound_ret Audio2_note: @@ -781,9 +781,9 @@ Audio2_note_pitch: ld b, 0 ld hl, Audio2_HWChannelDisableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] and [hl] - ldh [rNR51], a ; disable hardware channel 3's output + ldh [rAUDTERM], a ; disable hardware channel 3's output jr .done .notChannel3 ld b, REG_VOLUME_ENVELOPE @@ -856,7 +856,7 @@ Audio2_EnableChannelOutput: ld b, 0 ld hl, Audio2_HWChannelEnableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] or [hl] ; set this channel's bits ld d, a ld a, c @@ -878,7 +878,7 @@ Audio2_EnableChannelOutput: add hl, bc and [hl] ld d, a - ldh a, [rNR51] + ldh a, [rAUDTERM] ld hl, Audio2_HWChannelDisableMasks add hl, bc and [hl] ; reset this channel's output bits @@ -886,7 +886,7 @@ Audio2_EnableChannelOutput: ld d, a .skip ld a, d - ldh [rNR51], a + ldh [rAUDTERM], a ret Audio2_ApplyDutyCycleAndSoundLength: @@ -937,10 +937,10 @@ Audio2_ApplyWavePatternAndFrequency: ld e, [hl] inc hl ld d, [hl] - ld hl, rWave_0 + ld hl, _AUD3WAVERAM ld b, $f ld a, $0 ; stop hardware channel 3 - ldh [rNR30], a + ldh [rAUD3ENA], a .loop ld a, [de] inc de @@ -950,7 +950,7 @@ Audio2_ApplyWavePatternAndFrequency: and a jr nz, .loop ld a, $80 ; start hardware channel 3 - ldh [rNR30], a + ldh [rAUD3ENA], a pop de .notChannel3 ld a, d @@ -1463,17 +1463,17 @@ Audio2_PlaySound:: ld a, $ff ld [wStereoPanning], a xor a - ldh [rNR50], a + ldh [rAUDVOL], a ld a, $8 - ldh [rNR10], a + ldh [rAUD1SWEEP], a ld a, 0 - ldh [rNR51], a + ldh [rAUDTERM], a xor a - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $77 - ldh [rNR50], a + ldh [rAUDVOL], a jp .playSoundCommon .playSfx @@ -1619,7 +1619,7 @@ Audio2_PlaySound:: cp CHAN5 jr nz, .skipSweepDisable ld a, $8 - ldh [rNR10], a ; sweep off + ldh [rAUD1SWEEP], a ; sweep off .skipSweepDisable ld a, c and a @@ -1629,22 +1629,22 @@ Audio2_PlaySound:: .stopAllAudio ld a, $80 - ldh [rNR52], a ; sound hardware on - ldh [rNR30], a ; wave playback on + ldh [rAUDENA], a ; sound hardware on + ldh [rAUD3ENA], a ; wave playback on xor a - ldh [rNR51], a ; no sound output - ldh [rNR32], a ; mute channel 3 (wave channel) + ldh [rAUDTERM], a ; no sound output + ldh [rAUD3LEVEL], a ; mute channel 3 (wave channel) ld a, $8 - ldh [rNR10], a ; sweep off - ldh [rNR12], a ; mute channel 1 (pulse channel 1) - ldh [rNR22], a ; mute channel 2 (pulse channel 2) - ldh [rNR42], a ; mute channel 4 (noise channel) + ldh [rAUD1SWEEP], a ; sweep off + ldh [rAUD1ENV], a ; mute channel 1 (pulse channel 1) + ldh [rAUD2ENV], a ; mute channel 2 (pulse channel 2) + ldh [rAUD4ENV], a ; mute channel 4 (noise channel) ld a, $40 - ldh [rNR14], a ; counter mode - ldh [rNR24], a - ldh [rNR44], a + ldh [rAUD1HIGH], a ; counter mode + ldh [rAUD2HIGH], a + ldh [rAUD4GO], a ld a, $77 - ldh [rNR50], a ; full volume + ldh [rAUDVOL], a ; full volume xor a ld [wUnusedMusicByte], a ld [wDisableChannelOutputWhenSfxEnds], a @@ -1763,10 +1763,10 @@ Audio2_PlaySound:: ld a, [wSavedVolume] and a jr nz, .done - ldh a, [rNR50] + ldh a, [rAUDVOL] ld [wSavedVolume], a ld a, $77 - ldh [rNR50], a ; full volume + ldh [rAUDVOL], a ; full volume .done ret diff --git a/audio/engine_3.asm b/audio/engine_3.asm index f524875f..76115420 100644 --- a/audio/engine_3.asm +++ b/audio/engine_3.asm @@ -20,10 +20,10 @@ Audio3_UpdateMusic:: set BIT_MUTE_AUDIO, a ld [wMuteAudioAndPauseMusic], a xor a ; disable all channels' output - ldh [rNR51], a - ldh [rNR30], a + ldh [rAUDTERM], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a jr .nextChannel .applyAffects call Audio3_ApplyMusicAffects @@ -183,9 +183,9 @@ Audio3_sound_ret: jr nz, .skipSfxChannel3 ; restart hardware channel 3 (wave channel) output ld a, $0 - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a .skipSfxChannel3 jr nz, .dontDisable ld a, [wDisableChannelOutputWhenSfxEnds] @@ -219,9 +219,9 @@ Audio3_sound_ret: .disableChannelOutput ld hl, Audio3_HWChannelDisableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] and [hl] - ldh [rNR51], a + ldh [rAUDTERM], a .afterDisable ld a, [wChannelSoundIDs + CHAN5] cp CRY_SFX_START @@ -241,7 +241,7 @@ Audio3_sound_ret: ret c .skipRewind ld a, [wSavedVolume] - ldh [rNR50], a + ldh [rAUDVOL], a xor a ld [wSavedVolume], a .skipCry @@ -548,7 +548,7 @@ Audio3_volume: cp volume_cmd jr nz, Audio3_execute_music call Audio3_GetNextMusicByte - ldh [rNR50], a ; store volume + ldh [rAUDVOL], a ; store volume jp Audio3_sound_ret Audio3_execute_music: @@ -638,7 +638,7 @@ Audio3_pitch_sweep: bit BIT_EXECUTE_MUSIC, [hl] jr nz, Audio3_note ; no call Audio3_GetNextMusicByte - ldh [rNR10], a + ldh [rAUD1SWEEP], a jp Audio3_sound_ret Audio3_note: @@ -770,9 +770,9 @@ Audio3_note_pitch: ld b, 0 ld hl, Audio3_HWChannelDisableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] and [hl] - ldh [rNR51], a ; disable hardware channel 3's output + ldh [rAUDTERM], a ; disable hardware channel 3's output jr .done .notChannel3 ld b, REG_VOLUME_ENVELOPE @@ -845,7 +845,7 @@ Audio3_EnableChannelOutput: ld b, 0 ld hl, Audio3_HWChannelEnableMasks add hl, bc - ldh a, [rNR51] + ldh a, [rAUDTERM] or [hl] ; set this channel's bits ld d, a ld a, c @@ -867,7 +867,7 @@ Audio3_EnableChannelOutput: add hl, bc and [hl] ld d, a - ldh a, [rNR51] + ldh a, [rAUDTERM] ld hl, Audio3_HWChannelDisableMasks add hl, bc and [hl] ; reset this channel's output bits @@ -875,7 +875,7 @@ Audio3_EnableChannelOutput: ld d, a .skip ld a, d - ldh [rNR51], a + ldh [rAUDTERM], a ret Audio3_ApplyDutyCycleAndSoundLength: @@ -926,10 +926,10 @@ Audio3_ApplyWavePatternAndFrequency: ld e, [hl] inc hl ld d, [hl] - ld hl, rWave_0 + ld hl, _AUD3WAVERAM ld b, $f ld a, $0 ; stop hardware channel 3 - ldh [rNR30], a + ldh [rAUD3ENA], a .loop ld a, [de] inc de @@ -939,7 +939,7 @@ Audio3_ApplyWavePatternAndFrequency: and a jr nz, .loop ld a, $80 ; start hardware channel 3 - ldh [rNR30], a + ldh [rAUD3ENA], a pop de .notChannel3 ld a, d @@ -1400,17 +1400,17 @@ Audio3_PlaySound:: ld a, $ff ld [wStereoPanning], a xor a - ldh [rNR50], a + ldh [rAUDVOL], a ld a, $8 - ldh [rNR10], a + ldh [rAUD1SWEEP], a ld a, 0 - ldh [rNR51], a + ldh [rAUDTERM], a xor a - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $80 - ldh [rNR30], a + ldh [rAUD3ENA], a ld a, $77 - ldh [rNR50], a + ldh [rAUDVOL], a jp .playSoundCommon .playSfx @@ -1556,7 +1556,7 @@ Audio3_PlaySound:: cp CHAN5 jr nz, .skipSweepDisable ld a, $8 - ldh [rNR10], a ; sweep off + ldh [rAUD1SWEEP], a ; sweep off .skipSweepDisable ld a, c and a @@ -1566,22 +1566,22 @@ Audio3_PlaySound:: .stopAllAudio ld a, $80 - ldh [rNR52], a ; sound hardware on - ldh [rNR30], a ; wave playback on + ldh [rAUDENA], a ; sound hardware on + ldh [rAUD3ENA], a ; wave playback on xor a - ldh [rNR51], a ; no sound output - ldh [rNR32], a ; mute channel 3 (wave channel) + ldh [rAUDTERM], a ; no sound output + ldh [rAUD3LEVEL], a ; mute channel 3 (wave channel) ld a, $8 - ldh [rNR10], a ; sweep off - ldh [rNR12], a ; mute channel 1 (pulse channel 1) - ldh [rNR22], a ; mute channel 2 (pulse channel 2) - ldh [rNR42], a ; mute channel 4 (noise channel) + ldh [rAUD1SWEEP], a ; sweep off + ldh [rAUD1ENV], a ; mute channel 1 (pulse channel 1) + ldh [rAUD2ENV], a ; mute channel 2 (pulse channel 2) + ldh [rAUD4ENV], a ; mute channel 4 (noise channel) ld a, $40 - ldh [rNR14], a ; counter mode - ldh [rNR24], a - ldh [rNR44], a + ldh [rAUD1HIGH], a ; counter mode + ldh [rAUD2HIGH], a + ldh [rAUD4GO], a ld a, $77 - ldh [rNR50], a ; full volume + ldh [rAUDVOL], a ; full volume xor a ld [wUnusedMusicByte], a ld [wDisableChannelOutputWhenSfxEnds], a @@ -1700,10 +1700,10 @@ Audio3_PlaySound:: ld a, [wSavedVolume] and a jr nz, .done - ldh a, [rNR50] + ldh a, [rAUDVOL] ld [wSavedVolume], a ld a, $77 - ldh [rNR50], a ; full volume + ldh [rAUDVOL], a ; full volume .done ret diff --git a/audio/low_health_alarm.asm b/audio/low_health_alarm.asm index 728f5f65..e14e21cb 100644 --- a/audio/low_health_alarm.asm +++ b/audio/low_health_alarm.asm @@ -49,7 +49,7 @@ Music_DoLowHealthAlarm:: ;update sound channel 1 to play the alarm, overriding all other sounds. .playTone - ld hl, rNR10 ;channel 1 sound register + ld hl, rAUD1SWEEP ;channel 1 sound register ld c, $5 xor a diff --git a/audio/wave_samples.asm b/audio/wave_samples.asm index 941ced53..166f79e5 100644 --- a/audio/wave_samples.asm +++ b/audio/wave_samples.asm @@ -13,7 +13,7 @@ ; these are the definitions for the channel 3 instruments ; each instrument definition is made up of 32 points (nibbles) that form ; the graph of the wave -; the current instrument is copied to rWave_0--rWave_f +; the current instrument is copied to _AUD3WAVERAM .wave0 dn 0, 2, 4, 6, 8, 10, 12, 14, 15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 4, 3, 3, 2, 2, 1, 1 |
