diff options
author | dannye <corrnondacqb@yahoo.com> | 2015-07-22 10:22:46 -0500 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2015-07-22 10:22:46 -0500 |
commit | a6f04b434980f2176cb275a7c3ba50d5cbcd6ace (patch) | |
tree | 9852f73ea539b2392ea4c30f61c8879e978ae677 | |
parent | b4081e851ac4b7ce5cf1fa7c9fc83a490a4c83ec (diff) |
Unify audio bank references
2→1
8→2
1f→3
-rw-r--r-- | audio.asm | 48 | ||||
-rw-r--r-- | audio/engine_1.asm | 372 | ||||
-rw-r--r-- | audio/engine_2.asm | 380 | ||||
-rw-r--r-- | audio/engine_3.asm | 372 | ||||
-rwxr-xr-x | audio/headers/musicheaders1.asm (renamed from audio/headers/musicheaders02.asm) | 0 | ||||
-rwxr-xr-x | audio/headers/musicheaders2.asm (renamed from audio/headers/musicheaders08.asm) | 0 | ||||
-rwxr-xr-x | audio/headers/musicheaders3.asm (renamed from audio/headers/musicheaders1f.asm) | 0 | ||||
-rw-r--r-- | audio/headers/sfxheaders1.asm (renamed from audio/headers/sfxheaders02.asm) | 2 | ||||
-rw-r--r-- | audio/headers/sfxheaders2.asm (renamed from audio/headers/sfxheaders08.asm) | 2 | ||||
-rw-r--r-- | audio/headers/sfxheaders3.asm (renamed from audio/headers/sfxheaders1f.asm) | 2 | ||||
-rwxr-xr-x | audio/sfx/pokeflute_ch1_ch2.asm (renamed from audio/sfx/sfx_08_pokeflute.asm) | 0 | ||||
-rwxr-xr-x | audio/sfx/pokeflute_ch3.asm (renamed from audio/sfx/sfx_08_pokeflute_ch3.asm) | 0 | ||||
-rwxr-xr-x | audio/sfx/unused2_2.asm (renamed from audio/sfx/sfx_08_unused2.asm) | 0 | ||||
-rwxr-xr-x | audio/sfx/unused_1.asm (renamed from audio/sfx/sfx_02_unused.asm) | 0 | ||||
-rwxr-xr-x | audio/sfx/unused_2.asm (renamed from audio/sfx/sfx_08_unused.asm) | 0 | ||||
-rwxr-xr-x | audio/sfx/unused_3.asm (renamed from audio/sfx/sfx_1f_unused.asm) | 0 | ||||
-rw-r--r-- | constants/music_constants.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/healing_machine.asm | 2 | ||||
-rw-r--r-- | home/audio.asm | 44 | ||||
-rw-r--r-- | home/init.asm | 2 | ||||
-rw-r--r-- | home/vblank.asm | 22 | ||||
-rwxr-xr-x | scripts/ssanne7.asm | 2 |
22 files changed, 626 insertions, 626 deletions
@@ -7,24 +7,24 @@ INCLUDE "constants.asm" SECTION "Sound Effect Headers 1", ROMX, BANK[AUDIO_1] -INCLUDE "audio/headers/sfxheaders02.asm" +INCLUDE "audio/headers/sfxheaders1.asm" SECTION "Sound Effect Headers 2", ROMX, BANK[AUDIO_2] -INCLUDE "audio/headers/sfxheaders08.asm" +INCLUDE "audio/headers/sfxheaders2.asm" SECTION "Sound Effect Headers 3", ROMX, BANK[AUDIO_3] -INCLUDE "audio/headers/sfxheaders1f.asm" +INCLUDE "audio/headers/sfxheaders3.asm" SECTION "Music Headers 1", ROMX, BANK[AUDIO_1] -INCLUDE "audio/headers/musicheaders02.asm" +INCLUDE "audio/headers/musicheaders1.asm" SECTION "Music Headers 2", ROMX, BANK[AUDIO_2] -INCLUDE "audio/headers/musicheaders08.asm" +INCLUDE "audio/headers/musicheaders2.asm" SECTION "Music Headers 3", ROMX, BANK[AUDIO_3] -INCLUDE "audio/headers/musicheaders1f.asm" +INCLUDE "audio/headers/musicheaders3.asm" @@ -50,7 +50,7 @@ INCLUDE "audio/sfx/muted_snare2_1.asm" INCLUDE "audio/sfx/muted_snare3_1.asm" INCLUDE "audio/sfx/muted_snare4_1.asm" -Music2_WavePointers: INCLUDE "audio/wave_instruments.asm" +Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm" INCLUDE "audio/sfx/start_menu_1.asm" INCLUDE "audio/sfx/pokeflute.asm" @@ -86,7 +86,7 @@ INCLUDE "audio/sfx/push_boulder_1.asm" INCLUDE "audio/sfx/ss_anne_horn_1.asm" INCLUDE "audio/sfx/withdraw_deposit_1.asm" INCLUDE "audio/sfx/safari_zone_pa.asm" -INCLUDE "audio/sfx/sfx_02_unused.asm" +INCLUDE "audio/sfx/unused_1.asm" INCLUDE "audio/sfx/cry09_1.asm" INCLUDE "audio/sfx/cry23_1.asm" INCLUDE "audio/sfx/cry24_1.asm" @@ -149,7 +149,7 @@ INCLUDE "audio/sfx/muted_snare2_2.asm" INCLUDE "audio/sfx/muted_snare3_2.asm" INCLUDE "audio/sfx/muted_snare4_2.asm" -Music8_WavePointers: INCLUDE "audio/wave_instruments.asm" +Audio2_WavePointers: INCLUDE "audio/wave_instruments.asm" INCLUDE "audio/sfx/press_ab_2.asm" INCLUDE "audio/sfx/start_menu_2.asm" @@ -162,7 +162,7 @@ INCLUDE "audio/sfx/ball_poof.asm" INCLUDE "audio/sfx/faint_thud.asm" INCLUDE "audio/sfx/run.asm" INCLUDE "audio/sfx/dex_page_added.asm" -INCLUDE "audio/sfx/sfx_08_pokeflute_ch3.asm" +INCLUDE "audio/sfx/pokeflute_ch3.asm" INCLUDE "audio/sfx/peck.asm" INCLUDE "audio/sfx/faint_fall.asm" INCLUDE "audio/sfx/battle_09.asm" @@ -211,7 +211,7 @@ INCLUDE "audio/sfx/battle_33.asm" INCLUDE "audio/sfx/battle_34.asm" INCLUDE "audio/sfx/battle_35.asm" INCLUDE "audio/sfx/battle_36.asm" -INCLUDE "audio/sfx/sfx_08_unused.asm" +INCLUDE "audio/sfx/unused_2.asm" INCLUDE "audio/sfx/cry09_2.asm" INCLUDE "audio/sfx/cry23_2.asm" INCLUDE "audio/sfx/cry24_2.asm" @@ -274,7 +274,7 @@ INCLUDE "audio/sfx/muted_snare2_3.asm" INCLUDE "audio/sfx/muted_snare3_3.asm" INCLUDE "audio/sfx/muted_snare4_3.asm" -Music1f_WavePointers: INCLUDE "audio/wave_instruments.asm" +Audio3_WavePointers: INCLUDE "audio/wave_instruments.asm" INCLUDE "audio/sfx/start_menu_3.asm" INCLUDE "audio/sfx/cut_3.asm" @@ -318,7 +318,7 @@ INCLUDE "audio/sfx/slots_stop_wheel.asm" INCLUDE "audio/sfx/slots_reward.asm" INCLUDE "audio/sfx/slots_new_spin.asm" INCLUDE "audio/sfx/shooting_star.asm" -INCLUDE "audio/sfx/sfx_1f_unused.asm" +INCLUDE "audio/sfx/unused_3.asm" INCLUDE "audio/sfx/cry09_3.asm" INCLUDE "audio/sfx/cry23_3.asm" INCLUDE "audio/sfx/cry24_3.asm" @@ -408,12 +408,12 @@ Music_RivalAlternateStart:: ; 0x9b47 call PlayMusic ld hl, wc006 ld de, Music_MeetRival_branch_b1a2 - call Music2_OverwriteChannelPointer + call Audio1_OverwriteChannelPointer ld de, Music_MeetRival_branch_b21d - call Music2_OverwriteChannelPointer + call Audio1_OverwriteChannelPointer ld de, Music_MeetRival_branch_b2b5 -Music2_OverwriteChannelPointer: ; 0x9b60 +Audio1_OverwriteChannelPointer: ; 0x9b60 ld a, e ld [hli], a ld a, d @@ -427,14 +427,14 @@ Music_RivalAlternateTempo:: ; 0x9b65 call PlayMusic ld hl, wc006 ld de, Music_MeetRival_branch_b119 - jp Music2_OverwriteChannelPointer + jp Audio1_OverwriteChannelPointer ; applies both the alternate start and alternate tempo Music_RivalAlternateStartAndTempo:: ; 0x9b75 call Music_RivalAlternateStart ld hl, wc006 ld de, Music_MeetRival_branch_b19b - jp Music2_OverwriteChannelPointer + jp Audio1_OverwriteChannelPointer ; an alternate tempo for Cities1 which is used for the Hall of Fame room Music_Cities1AlternateTempo:: ; 0x9b81 @@ -450,7 +450,7 @@ Music_Cities1AlternateTempo:: ; 0x9b81 call PlayMusic ld hl, wc006 ld de, Music_Cities1_branch_aa6f - jp Music2_OverwriteChannelPointer + jp Audio1_OverwriteChannelPointer SECTION "Audio Engine 2", ROMX, BANK[AUDIO_2] @@ -544,12 +544,12 @@ Music_PokeFluteInBattle:: ; 22306 (8:6306) ; then immediately overwrtie the channel pointers ld hl, wc00e ld de, SFX_08_PokeFlute_Ch1 - call Music8_OverwriteChannelPointer + call Audio2_OverwriteChannelPointer ld de, SFX_08_PokeFlute_Ch2 - call Music8_OverwriteChannelPointer + call Audio2_OverwriteChannelPointer ld de, SFX_08_PokeFlute_Ch3 -Music8_OverwriteChannelPointer: ; 2231d (8:631d) +Audio2_OverwriteChannelPointer: ; 2231d (8:631d) ld a, e ld [hli], a ld a, d @@ -632,8 +632,8 @@ INCLUDE "audio/music/pokecenter.asm" SECTION "Music 2", ROMX, BANK[AUDIO_2] -INCLUDE "audio/sfx/sfx_08_pokeflute.asm" -INCLUDE "audio/sfx/sfx_08_unused2.asm" +INCLUDE "audio/sfx/pokeflute_ch1_ch2.asm" +INCLUDE "audio/sfx/unused2_2.asm" INCLUDE "audio/music/gymleaderbattle.asm" INCLUDE "audio/music/trainerbattle.asm" INCLUDE "audio/music/wildbattle.asm" diff --git a/audio/engine_1.asm b/audio/engine_1.asm index fd74b16d..9a302ef3 100644 --- a/audio/engine_1.asm +++ b/audio/engine_1.asm @@ -1,6 +1,6 @@ ; The first of three duplicated sound engines. -Music2_UpdateMusic:: ; 0x9103 +Audio1_UpdateMusic:: ; 0x9103 ld c, CH0 .loop ld b, $0 @@ -26,7 +26,7 @@ Music2_UpdateMusic:: ; 0x9103 ld [$ff1a], a jr .nextChannel .asm_912e - call Music2_ApplyMusicAffects + call Audio1_ApplyMusicAffects .nextChannel ld a, c inc c ; inc channel number @@ -42,13 +42,13 @@ Music2_UpdateMusic:: ; 0x9103 ; 3: a toggle used only by this routine for vibrato ; 4: pitchbend flag ; 6: dutycycle flag -Music2_ApplyMusicAffects: ; 0x9138 +Audio1_ApplyMusicAffects: ; 0x9138 ld b, $0 ld hl, wc0b6 ; delay until next note add hl, bc ld a, [hl] cp $1 ; if the delay is 1, play next note - jp z, Music2_PlayNextNote + jp z, Audio1_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a ld a, c @@ -65,7 +65,7 @@ Music2_ApplyMusicAffects: ; 0x9138 add hl, bc bit 6, [hl] ; dutycycle jr z, .checkForExecuteMusic - call Music2_ApplyDutyCycle + call Audio1_ApplyDutyCycle .checkForExecuteMusic ld b, $0 ld hl, wc036 @@ -81,7 +81,7 @@ Music2_ApplyMusicAffects: ; 0x9138 add hl, bc bit 4, [hl] ; pitchbend jr z, .checkVibratoDelay - jp Music2_ApplyPitchBend + jp Audio1_ApplyPitchBend .checkVibratoDelay ld hl, wc04e ; vibrato delay add hl, bc @@ -141,14 +141,14 @@ Music2_ApplyMusicAffects: ; 0x9138 .done ld d, a ld b, $3 - call Music2_9838 + call Audio1_9838 ld [hl], d ret ; this routine executes all music commands that take up no time, ; like tempo changes, duty changes etc. and doesn't return ; until the first note is reached -Music2_PlayNextNote: ; 0x91d0 +Audio1_PlayNextNote: ; 0x91d0 ld hl, wc06e add hl, bc ld a, [hl] @@ -159,14 +159,14 @@ Music2_PlayNextNote: ; 0x91d0 add hl, bc res 4, [hl] res 5, [hl] - call Music2_endchannel + call Audio1_endchannel ret -Music2_endchannel: ; 0x91e6 - call Music2_GetNextMusicByte +Audio1_endchannel: ; 0x91e6 + call Audio1_GetNextMusicByte ld d, a cp $ff ; is this command an endchannel? - jp nz, Music2_callchannel ; no + jp nz, Audio1_callchannel ; no ld b, $0 ; yes ld hl, wc02e add hl, bc @@ -216,7 +216,7 @@ Music2_endchannel: ; 0x91e6 inc de ld a, [de] ld [hl], a ; loads channel address to return to - jp Music2_endchannel + jp Audio1_endchannel .asm_923f ld hl, Unknown_9b1f add hl, bc @@ -238,7 +238,7 @@ Music2_endchannel: ; 0x91e6 ld a, c cp CH4 jr z, .asm_9265 - call Music2_96c7 + call Audio1_96c7 ret c .asm_9265 ld a, [wc005] @@ -251,12 +251,12 @@ Music2_endchannel: ; 0x91e6 ld [hl], b ret -Music2_callchannel: ; 0x9274 +Audio1_callchannel: ; 0x9274 cp $fd ; is this command a callchannel? - jp nz, Music2_loopchannel ; no - call Music2_GetNextMusicByte ; yes + jp nz, Audio1_loopchannel ; no + call Audio1_GetNextMusicByte ; yes push af - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld d, a pop af ld e, a @@ -286,12 +286,12 @@ Music2_callchannel: ; 0x9274 ld hl, wc02e add hl, bc set 1, [hl] ; set the call flag - jp Music2_endchannel + jp Audio1_endchannel -Music2_loopchannel: ; 0x92a9 +Audio1_loopchannel: ; 0x92a9 cp $fe ; is this command a loopchannel? - jp nz, Music2_notetype ; no - call Music2_GetNextMusicByte ; yes + jp nz, Audio1_notetype ; no + call Audio1_GetNextMusicByte ; yes ld e, a and a jr z, .infiniteLoop @@ -303,17 +303,17 @@ Music2_loopchannel: ; 0x92a9 jr nz, .loopAgain ld a, $1 ; if no more loops to make, ld [hl], a - call Music2_GetNextMusicByte ; skip pointer - call Music2_GetNextMusicByte - jp Music2_endchannel + call Audio1_GetNextMusicByte ; skip pointer + call Audio1_GetNextMusicByte + jp Audio1_endchannel .loopAgain ; inc loop count inc a ld [hl], a ; fall through .infiniteLoop ; overwrite current address with pointer - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte push af - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld b, a ld d, $0 ld a, c @@ -324,12 +324,12 @@ Music2_loopchannel: ; 0x92a9 pop af ld [hli], a ld [hl], b - jp Music2_endchannel + jp Audio1_endchannel -Music2_notetype: ; 0x92e4 +Audio1_notetype: ; 0x92e4 and $f0 cp $d0 ; is this command a notetype? - jp nz, Music2_toggleperfectpitch ; no + jp nz, Audio1_toggleperfectpitch ; no ld a, d ; yes and $f ld b, $0 @@ -339,7 +339,7 @@ Music2_notetype: ; 0x92e4 ld a, c cp CH3 jr z, .noiseChannel ; noise channel has 0 params - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld d, a ld a, c cp CH2 @@ -368,24 +368,24 @@ Music2_notetype: ; 0x92e4 add hl, bc ld [hl], d .noiseChannel - jp Music2_endchannel + jp Audio1_endchannel -Music2_toggleperfectpitch: ; 0x9323 +Audio1_toggleperfectpitch: ; 0x9323 ld a, d cp $e8 ; is this command a toggleperfectpitch? - jr nz, Music2_vibrato ; no + jr nz, Audio1_vibrato ; no ld b, $0 ; yes ld hl, wc02e add hl, bc ld a, [hl] xor $1 ld [hl], a ; flip bit 0 of wc02e - jp Music2_endchannel + jp Audio1_endchannel -Music2_vibrato: ; 0x9335 +Audio1_vibrato: ; 0x9335 cp $ea ; is this command a vibrato? - jr nz, Music2_pitchbend ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_pitchbend ; no + call Audio1_GetNextMusicByte ; yes ld b, $0 ld hl, wc04e add hl, bc @@ -393,7 +393,7 @@ Music2_vibrato: ; 0x9335 ld hl, wc06e add hl, bc ld [hl], a ; store delay - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld d, a and $f0 swap a @@ -414,24 +414,24 @@ Music2_vibrato: ; 0x9335 swap a or d ld [hl], a ; store depth as both high and low nibbles - jp Music2_endchannel + jp Audio1_endchannel -Music2_pitchbend: ; 0x936d +Audio1_pitchbend: ; 0x936d cp $eb ; is this command a pitchbend? - jr nz, Music2_duty ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_duty ; no + call Audio1_GetNextMusicByte ; yes ld b, $0 ld hl, wc076 add hl, bc ld [hl], a ; store first param - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld d, a and $f0 swap a ld b, a ld a, d and $f - call Music2_9858 + call Audio1_9858 ld b, $0 ld hl, wc0a6 add hl, bc @@ -443,14 +443,14 @@ Music2_pitchbend: ; 0x936d ld hl, wc02e add hl, bc set 4, [hl] ; set pitchbend flag - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld d, a - jp Music2_notelength + jp Audio1_notelength -Music2_duty: ; 0x93a5 +Audio1_duty: ; 0x93a5 cp $ec ; is this command a duty? - jr nz, Music2_tempo ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_tempo ; no + call Audio1_GetNextMusicByte ; yes rrca rrca and $c0 @@ -458,17 +458,17 @@ Music2_duty: ; 0x93a5 ld hl, wc03e add hl, bc ld [hl], a ; store duty - jp Music2_endchannel + jp Audio1_endchannel -Music2_tempo: ; 0x93ba +Audio1_tempo: ; 0x93ba cp $ed ; is this command a tempo? - jr nz, Music2_stereopanning ; no + jr nz, Audio1_stereopanning ; no ld a, c ; yes cp CH4 jr nc, .sfxChannel - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld [wc0e8], a ; store first param - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld [wc0e9], a ; store second param xor a ld [wc0ce], a ; clear RAM @@ -477,9 +477,9 @@ Music2_tempo: ; 0x93ba ld [wc0d1], a jr .musicChannelDone .sfxChannel - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld [wc0ea], a ; store first param - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld [wc0eb], a ; store second param xor a ld [wc0d2], a ; clear RAM @@ -487,22 +487,22 @@ Music2_tempo: ; 0x93ba ld [wc0d4], a ld [wc0d5], a .musicChannelDone - jp Music2_endchannel + jp Audio1_endchannel -Music2_stereopanning: ; 0x93fa +Audio1_stereopanning: ; 0x93fa cp $ee ; is this command a stereopanning? - jr nz, Music2_unknownmusic0xef ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_unknownmusic0xef ; no + call Audio1_GetNextMusicByte ; yes ld [wc004], a ; store panning - jp Music2_endchannel + jp Audio1_endchannel ; this appears to never be used -Music2_unknownmusic0xef: ; 0x9407 +Audio1_unknownmusic0xef: ; 0x9407 cp $ef ; is this command an unknownmusic0xef? - jr nz, Music2_dutycycle ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_dutycycle ; no + call Audio1_GetNextMusicByte ; yes push bc - call Music2_9876 + call Audio1_9876 pop bc ld a, [wc003] and a @@ -512,12 +512,12 @@ Music2_unknownmusic0xef: ; 0x9407 xor a ld [wc02d], a .skip - jp Music2_endchannel + jp Audio1_endchannel -Music2_dutycycle: ; 0x9426 +Audio1_dutycycle: ; 0x9426 cp $fc ; is this command a dutycycle? - jr nz, Music2_volume ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_volume ; no + call Audio1_GetNextMusicByte ; yes ld b, $0 ld hl, wc046 add hl, bc @@ -529,48 +529,48 @@ Music2_dutycycle: ; 0x9426 ld hl, wc02e add hl, bc set 6, [hl] ; set dutycycle flag - jp Music2_endchannel + jp Audio1_endchannel -Music2_volume: ; 0x9444 +Audio1_volume: ; 0x9444 cp $f0 ; is this command a volume? - jr nz, Music2_executemusic ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_executemusic ; no + call Audio1_GetNextMusicByte ; yes ld [$ff24], a ; store volume - jp Music2_endchannel + jp Audio1_endchannel -Music2_executemusic: ; 0x9450 +Audio1_executemusic: ; 0x9450 cp $f8 ; is this command an executemusic? - jr nz, Music2_octave ; no + jr nz, Audio1_octave ; no ld b, $0 ; yes ld hl, wc036 add hl, bc set 0, [hl] - jp Music2_endchannel + jp Audio1_endchannel -Music2_octave: ; 0x945f +Audio1_octave: ; 0x945f and $f0 cp $e0 ; is this command an octave? - jr nz, Music2_unknownsfx0x20 ; no + jr nz, Audio1_unknownsfx0x20 ; no ld hl, wc0d6 ; yes ld b, $0 add hl, bc ld a, d and $f ld [hl], a ; store low nibble as octave - jp Music2_endchannel + jp Audio1_endchannel -Music2_unknownsfx0x20: ; 0x9472 +Audio1_unknownsfx0x20: ; 0x9472 cp $20 ; is this command an unknownsfx0x20? - jr nz, Music2_unknownsfx0x10 ; no + jr nz, Audio1_unknownsfx0x10 ; no ld a, c cp CH3 ; is this a noise or sfx channel? - jr c, Music2_unknownsfx0x10 ; no + jr c, Audio1_unknownsfx0x10 ; no ld b, $0 ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music2_unknownsfx0x10 ; no - call Music2_notelength ; yes + jr nz, Audio1_unknownsfx0x10 ; no + call Audio1_notelength ; yes ld d, a ld b, $0 ld hl, wc03e @@ -579,56 +579,56 @@ Music2_unknownsfx0x20: ; 0x9472 or d ld d, a ld b, $1 - call Music2_9838 + call Audio1_9838 ld [hl], d - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld d, a ld b, $2 - call Music2_9838 + call Audio1_9838 ld [hl], d - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte ld e, a ld a, c cp CH7 ld a, $0 jr z, .sfxNoiseChannel ; only two params for noise channel push de - call Music2_GetNextMusicByte + call Audio1_GetNextMusicByte pop de .sfxNoiseChannel ld d, a push de - call Music2_9629 - call Music2_95f8 + call Audio1_9629 + call Audio1_95f8 pop de - call Music2_964b + call Audio1_964b ret -Music2_unknownsfx0x10: +Audio1_unknownsfx0x10: ld a, c cp CH4 - jr c, Music2_note ; if not a sfx + jr c, Audio1_note ; if not a sfx ld a, d cp $10 ; is this command a unknownsfx0x10? - jr nz, Music2_note ; no + jr nz, Audio1_note ; no ld b, $0 ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music2_note ; no - call Music2_GetNextMusicByte ; yes + jr nz, Audio1_note ; no + call Audio1_GetNextMusicByte ; yes ld [$ff10], a - jp Music2_endchannel + jp Audio1_endchannel -Music2_note: +Audio1_note: ld a, c cp CH3 - jr nz, Music2_notelength ; if not noise channel + jr nz, Audio1_notelength ; if not noise channel ld a, d and $f0 cp $b0 ; is this command a dnote? - jr z, Music2_dnote ; yes - jr nc, Music2_notelength ; no + jr z, Audio1_dnote ; yes + jr nc, Audio1_notelength ; no swap a ld b, a ld a, d @@ -639,24 +639,24 @@ Music2_note: push bc jr asm_94fd -Music2_dnote: +Audio1_dnote: ld a, d and $f push af push bc - call Music2_GetNextMusicByte ; get dnote instrument + call Audio1_GetNextMusicByte ; get dnote instrument asm_94fd ld d, a ld a, [wc003] and a jr nz, .asm_9508 ld a, d - call Music2_9876 + call Audio1_9876 .asm_9508 pop bc pop de -Music2_notelength: ; 0x950a +Audio1_notelength: ; 0x950a ld a, d push af and $f @@ -668,7 +668,7 @@ Music2_notelength: ; 0x950a add hl, bc ld a, [hl] ld l, b - call Music2_9847 + call Audio1_9847 ld a, c cp CH4 jr nc, .sfxChannel @@ -682,7 +682,7 @@ Music2_notelength: ; 0x950a ld e, $0 cp CH7 jr z, .skip ; if noise channel - call Music2_9693 + call Audio1_9693 ld a, [wc0ea] ld d, a ld a, [wc0eb] @@ -693,7 +693,7 @@ Music2_notelength: ; 0x950a ld hl, wc0ce add hl, bc ld l, [hl] - call Music2_9847 + call Audio1_9847 ld e, l ld d, h ld hl, wc0ce @@ -706,15 +706,15 @@ Music2_notelength: ; 0x950a ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music2_notepitch + jr nz, Audio1_notepitch ld hl, wc02e add hl, bc bit 2, [hl] - jr z, Music2_notepitch + jr z, Audio1_notepitch pop hl ret -Music2_notepitch: ; 0x9568 +Audio1_notepitch: ; 0x9568 pop af and $f0 cp $c0 ; compare to rest @@ -744,7 +744,7 @@ Music2_notepitch: ; 0x9568 jr .done .notSfxChannel3 ld b, $2 - call Music2_9838 + call Audio1_9838 ld a, $8 ld [hli], a inc hl @@ -758,13 +758,13 @@ Music2_notepitch: ; 0x9568 ld hl, wc0d6 add hl, bc ld b, [hl] - call Music2_9858 + call Audio1_9858 ld b, $0 ld hl, wc02e add hl, bc bit 4, [hl] jr z, .asm_95b8 - call Music2_978f + call Audio1_978f .asm_95b8 push de ld a, c @@ -787,10 +787,10 @@ Music2_notepitch: ; 0x9568 add hl, bc ld d, [hl] ld b, $2 - call Music2_9838 + call Audio1_9838 ld [hl], d - call Music2_9629 - call Music2_95f8 + call Audio1_9629 + call Audio1_95f8 pop de ld b, $0 ld hl, wc02e @@ -804,10 +804,10 @@ Music2_notepitch: ; 0x9568 ld hl, wc066 add hl, bc ld [hl], e - call Music2_964b + call Audio1_964b ret -Music2_95f8: ; 0x95f8 +Audio1_95f8: ; 0x95f8 ld b, $0 ld hl, Unknown_9b27 add hl, bc @@ -841,7 +841,7 @@ Music2_95f8: ; 0x95f8 ld [$ff25], a ret -Music2_9629: ; 0x9629 +Audio1_9629: ; 0x9629 ld b, $0 ld hl, wc0b6 add hl, bc @@ -861,11 +861,11 @@ Music2_9629: ; 0x9629 ld d, a .channel3 ld b, $1 - call Music2_9838 + call Audio1_9838 ld [hl], d ret -Music2_964b: ; 0x964b +Audio1_964b: ; 0x964b ld a, c cp CH2 jr z, .channel3 @@ -883,7 +883,7 @@ Music2_964b: ; 0x964b add a ld d, $0 ld e, a - ld hl, Music2_WavePointers + ld hl, Audio1_WavePointers add hl, de ld e, [hl] inc hl @@ -909,15 +909,15 @@ Music2_964b: ; 0x964b and $c7 ld d, a ld b, $3 - call Music2_9838 + call Audio1_9838 ld [hl], e inc hl ld [hl], d - call Music2_96b5 + call Audio1_96b5 ret -Music2_9693: ; 0x9693 - call Music2_96e5 +Audio1_9693: ; 0x9693 + call Audio1_96e5 jr nc, .asm_96ab ld d, $0 ld a, [wc0f2] @@ -937,8 +937,8 @@ Music2_9693: ; 0x9693 .asm_96b4 ret -Music2_96b5: ; 0x96b5 - call Music2_96e5 +Audio1_96b5: ; 0x96b5 + call Audio1_96e5 jr nc, .asm_96c6 ld a, [wc0f1] add e @@ -953,8 +953,8 @@ Music2_96b5: ; 0x96b5 .asm_96c6 ret -Music2_96c7: ; 0x96c7 - call Music2_96e5 +Audio1_96c7: ; 0x96c7 + call Audio1_96e5 jr nc, .asm_96e2 ld hl, wc006 ld e, c @@ -976,7 +976,7 @@ Music2_96c7: ; 0x96c7 ccf ret -Music2_96e5: ; 0x96e5 +Audio1_96e5: ; 0x96e5 ld a, [wc02a] cp $14 jr nc, .asm_96ee @@ -993,7 +993,7 @@ Music2_96e5: ; 0x96e5 scf ret -Music2_ApplyPitchBend: ; 0x96f9 +Audio1_ApplyPitchBend: ; 0x96f9 ld hl, wc02e add hl, bc bit 5, [hl] @@ -1083,7 +1083,7 @@ Music2_ApplyPitchBend: ; 0x96f9 add hl, bc ld [hl], d ld b, $3 - call Music2_9838 + call Audio1_9838 ld a, e ld [hli], a ld [hl], d @@ -1095,7 +1095,7 @@ Music2_ApplyPitchBend: ; 0x96f9 res 5, [hl] ret -Music2_978f: ; 0x978f +Audio1_978f: ; 0x978f ld hl, wc096 add hl, bc ld [hl], d @@ -1184,7 +1184,7 @@ Music2_978f: ; 0x978f ld [hl], a ret -Music2_ApplyDutyCycle: ; 0x980d +Audio1_ApplyDutyCycle: ; 0x980d ld b, $0 ld hl, wc046 add hl, bc @@ -1195,14 +1195,14 @@ Music2_ApplyDutyCycle: ; 0x980d and $c0 ld d, a ld b, $1 - call Music2_9838 + call Audio1_9838 ld a, [hl] and $3f or d ld [hl], a ret -Music2_GetNextMusicByte: ; 0x9825 +Audio1_GetNextMusicByte: ; 0x9825 ld d, $0 ld a, c add a @@ -1220,7 +1220,7 @@ Music2_GetNextMusicByte: ; 0x9825 ld [hl], d ret -Music2_9838: ; 0x9838 +Audio1_9838: ; 0x9838 ld a, c ld hl, Unknown_9b17 add l @@ -1234,7 +1234,7 @@ Music2_9838: ; 0x9838 ld h, $ff ret -Music2_9847: ; 0x9847 +Audio1_9847: ; 0x9847 ld h, $0 .loop srl a @@ -1249,13 +1249,13 @@ Music2_9847: ; 0x9847 .done ret -Music2_9858: ; 0x9858 +Audio1_9858: ; 0x9858 ld h, $0 ld l, a add hl, hl ld d, h ld e, l - ld hl, Music2_Pitches + ld hl, Audio1_Pitches add hl, de ld e, [hl] inc hl @@ -1274,16 +1274,16 @@ Music2_9858: ; 0x9858 ld d, a ret -Music2_9876:: ; 0x9876 +Audio1_9876:: ; 0x9876 ld [wc001], a cp $ff - jp z, Music2_9a34 + jp z, Audio1_9a34 cp $b9 - jp z, Music2_994e - jp c, Music2_994e + jp z, Audio1_994e + jp c, Audio1_994e cp $fe jr z, .asm_988d - jp nc, Music2_994e + jp nc, Audio1_994e .asm_988d xor a ld [wc000], a @@ -1293,53 +1293,53 @@ Music2_9876:: ; 0x9876 ld [wc0e7], a ld d, $8 ld hl, wc016 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc006 - call FillMusicRAM2 + call FillAudioRAM1 ld d, $4 ld hl, wc026 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc02e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc03e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc046 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc04e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc056 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc05e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc066 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc06e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc036 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc076 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc07e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc086 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc08e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc096 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc09e - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc0a6 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc0ae - call FillMusicRAM2 + call FillAudioRAM1 ld a, $1 ld hl, wc0be - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc0b6 - call FillMusicRAM2 + call FillAudioRAM1 ld hl, wc0c6 - call FillMusicRAM2 + call FillAudioRAM1 ld [wc0e8], a ld a, $ff ld [wc004], a @@ -1355,16 +1355,16 @@ Music2_9876:: ; 0x9876 ld [$ff1a], a ld a, $77 ld [$ff24], a - jp Music2_9a8f + jp Audio1_9a8f -Music2_994e: ; 0x994e +Audio1_994e: ; 0x994e ld l, a ld e, a ld h, $0 ld d, h add hl, hl add hl, de - ld de, SFX_Headers_02 + ld de, SFX_Headers_1 add hl, de ld a, h ld [wc0ec], a @@ -1504,11 +1504,11 @@ Music2_994e: ; 0x994e .asm_9a2b ld a, c and a - jp z, Music2_9a8f + jp z, Audio1_9a8f dec c jp .asm_9967 -Music2_9a34: ; 0x9a34 +Audio1_9a34: ; 0x9a34 ld a, $80 ld [$ff26], a ld [$ff1a], a @@ -1536,11 +1536,11 @@ Music2_9a34: ; 0x9a34 ld [wc0e7], a ld d, $a0 ld hl, wc006 - call FillMusicRAM2 + call FillAudioRAM1 ld a, $1 ld d, $18 ld hl, wc0b6 - call FillMusicRAM2 + call FillAudioRAM1 ld [wc0e8], a ld [wc0ea], a ld a, $ff @@ -1548,7 +1548,7 @@ Music2_9a34: ; 0x9a34 ret ; fills d bytes at hl with a -FillMusicRAM2: ; 0x9a89 +FillAudioRAM1: ; 0x9a89 ld b, d .loop ld [hli], a @@ -1556,7 +1556,7 @@ FillMusicRAM2: ; 0x9a89 jr nz, .loop ret -Music2_9a8f: ; 0x9a8f +Audio1_9a8f: ; 0x9a8f ld a, [wc001] ld l, a ld e, a @@ -1564,7 +1564,7 @@ Music2_9a8f: ; 0x9a8f ld d, h add hl, hl add hl, de - ld de, SFX_Headers_02 + ld de, SFX_Headers_1 add hl, de ld e, l ld d, h @@ -1637,7 +1637,7 @@ Music2_9a8f: ; 0x9a8f ld [hli], a ld [hl], a ld hl, wc012 ; sfx noise channel pointer - ld de, Noise2_endchannel + ld de, Noise1_endchannel ld [hl], e inc hl ld [hl], d ; overwrite pointer to point to endchannel @@ -1651,7 +1651,7 @@ Music2_9a8f: ; 0x9a8f .asm_9b15 ret -Noise2_endchannel: ; 0x9b16 +Noise1_endchannel: ; 0x9b16 endchannel Unknown_9b17: ; 0x9b17 @@ -1666,7 +1666,7 @@ Unknown_9b27: ; 0x9b27 db $11, $22, $44, $88 ; channels 0-3 db $11, $22, $44, $88 ; channels 4-7 -Music2_Pitches: ; 0x9b2f +Audio1_Pitches: ; 0x9b2f dw $F82C ; C_ dw $F89D ; C# dw $F907 ; D_ diff --git a/audio/engine_2.asm b/audio/engine_2.asm index 5940b55a..62b82cec 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -1,6 +1,6 @@ ; The second of three duplicated sound engines. -Music8_UpdateMusic:: ; 21879 (8:5879) +Audio2_UpdateMusic:: ; 21879 (8:5879) ld c, CH0 .loop ld b, $0 @@ -26,7 +26,7 @@ Music8_UpdateMusic:: ; 21879 (8:5879) ld [$ff1a], a jr .nextChannel .applyAffects - call Music8_ApplyMusicAffects + call Audio2_ApplyMusicAffects .nextChannel ld a, c inc c @@ -42,13 +42,13 @@ Music8_UpdateMusic:: ; 21879 (8:5879) ; 3: a toggle used only by this routine for vibrato ; 4: pitchbend flag ; 6: dutycycle flag -Music8_ApplyMusicAffects: ; 218ae (8:58ae) +Audio2_ApplyMusicAffects: ; 218ae (8:58ae) ld b, $0 ld hl, wc0b6 ; delay until next note add hl, bc ld a, [hl] cp $1 ; if the delay is 1, play next note - jp z, Music8_PlayNextNote + jp z, Audio2_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a ld a, c @@ -65,7 +65,7 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) add hl, bc bit 6, [hl] ; dutycycle jr z, .checkForExecuteMusic - call Music8_ApplyDutyCycle + call Audio2_ApplyDutyCycle .checkForExecuteMusic ld b, $0 ld hl, wc036 @@ -81,7 +81,7 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) add hl, bc bit 4, [hl] ; pitchbend jr z, .checkVibratoDelay - jp Music8_ApplyPitchBend + jp Audio2_ApplyPitchBend .checkVibratoDelay ld hl, wc04e ; vibrato delay add hl, bc @@ -141,14 +141,14 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) .done ld d, a ld b, $3 - call Music8_21ff7 + call Audio2_21ff7 ld [hl], d ret ; this routine executes all music commands that take up no time, ; like tempo changes, duty changes etc. and doesn't return ; until the first note is reached -Music8_PlayNextNote: ; 21946 (8:5946) +Audio2_PlayNextNote: ; 21946 (8:5946) ld hl, wc06e add hl, bc ld a, [hl] @@ -166,14 +166,14 @@ Music8_PlayNextNote: ; 21946 (8:5946) bit 7, a ret nz .beginChecks - call Music8_endchannel + call Audio2_endchannel ret -Music8_endchannel: ; 21967 (8:5967) - call Music8_GetNextMusicByte +Audio2_endchannel: ; 21967 (8:5967) + call Audio2_GetNextMusicByte ld d, a cp $ff ; is this command an endchannel? - jp nz, Music8_callchannel ; no + jp nz, Audio2_callchannel ; no ld b, $0 ; yes ld hl, wc02e add hl, bc @@ -223,7 +223,7 @@ Music8_endchannel: ; 21967 (8:5967) inc de ld a, [de] ld [hl], a ; loads channel address to return to - jp Music8_endchannel + jp Audio2_endchannel .asm_219c0 ld hl, Unknown_222de add hl, bc @@ -245,7 +245,7 @@ Music8_endchannel: ; 21967 (8:5967) ld a, c cp CH4 jr z, .asm_219e6 - call Music8_21e6d + call Audio2_21e6d ret c .asm_219e6 ld a, [wc005] @@ -258,12 +258,12 @@ Music8_endchannel: ; 21967 (8:5967) ld [hl], b ret -Music8_callchannel: ; 219f5 (8:59f5) +Audio2_callchannel: ; 219f5 (8:59f5) cp $fd ; is this command a callchannel? - jp nz, Music8_loopchannel ; no - call Music8_GetNextMusicByte ; yes + jp nz, Audio2_loopchannel ; no + call Audio2_GetNextMusicByte ; yes push af - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld d, a pop af ld e, a @@ -293,12 +293,12 @@ Music8_callchannel: ; 219f5 (8:59f5) ld hl, wc02e add hl, bc set 1, [hl] ; set the call flag - jp Music8_endchannel + jp Audio2_endchannel -Music8_loopchannel: ; 21a2a (8:5a2a) +Audio2_loopchannel: ; 21a2a (8:5a2a) cp $fe ; is this command a loopchannel? - jp nz, Music8_notetype ; no - call Music8_GetNextMusicByte ; yes + jp nz, Audio2_notetype ; no + call Audio2_GetNextMusicByte ; yes ld e, a and a jr z, .infiniteLoop @@ -310,17 +310,17 @@ Music8_loopchannel: ; 21a2a (8:5a2a) jr nz, .loopAgain ld a, $1 ; if no more loops to make, ld [hl], a - call Music8_GetNextMusicByte ; skip pointer - call Music8_GetNextMusicByte - jp Music8_endchannel + call Audio2_GetNextMusicByte ; skip pointer + call Audio2_GetNextMusicByte + jp Audio2_endchannel .loopAgain ; inc loop count inc a ld [hl], a ; fall through .infiniteLoop ; overwrite current address with pointer - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte push af - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld b, a ld d, $0 ld a, c @@ -331,12 +331,12 @@ Music8_loopchannel: ; 21a2a (8:5a2a) pop af ld [hli], a ld [hl], b - jp Music8_endchannel + jp Audio2_endchannel -Music8_notetype: ; 21a65 (8:5a65) +Audio2_notetype: ; 21a65 (8:5a65) and $f0 cp $d0 ; is this command a notetype? - jp nz, Music8_toggleperfectpitch ; no + jp nz, Audio2_toggleperfectpitch ; no ld a, d ; yes and $f ld b, $0 @@ -346,7 +346,7 @@ Music8_notetype: ; 21a65 (8:5a65) ld a, c cp CH3 jr z, .noiseChannel ; noise channel has 0 params - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld d, a ld a, c cp CH2 @@ -375,24 +375,24 @@ Music8_notetype: ; 21a65 (8:5a65) add hl, bc ld [hl], d .noiseChannel - jp Music8_endchannel + jp Audio2_endchannel -Music8_toggleperfectpitch: ; 21aa4 (8:5aa4) +Audio2_toggleperfectpitch: ; 21aa4 (8:5aa4) ld a, d cp $e8 ; is this command a toggleperfectpitch? - jr nz, Music8_vibrato ; no + jr nz, Audio2_vibrato ; no ld b, $0 ; yes ld hl, wc02e add hl, bc ld a, [hl] xor $1 ld [hl], a ; flip bit 0 of wc02e - jp Music8_endchannel + jp Audio2_endchannel -Music8_vibrato: ; 21ab6 (8:5ab6) +Audio2_vibrato: ; 21ab6 (8:5ab6) cp $ea ; is this command a vibrato? - jr nz, Music8_pitchbend ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_pitchbend ; no + call Audio2_GetNextMusicByte ; yes ld b, $0 ld hl, wc04e add hl, bc @@ -400,7 +400,7 @@ Music8_vibrato: ; 21ab6 (8:5ab6) ld hl, wc06e add hl, bc ld [hl], a ; store delay - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld d, a and $f0 swap a @@ -421,24 +421,24 @@ Music8_vibrato: ; 21ab6 (8:5ab6) swap a or d ld [hl], a ; store depth as both high and low nibbles - jp Music8_endchannel + jp Audio2_endchannel -Music8_pitchbend: ; 21aee (8:5aee) +Audio2_pitchbend: ; 21aee (8:5aee) cp $eb ; is this command a pitchbend? - jr nz, Music8_duty ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_duty ; no + call Audio2_GetNextMusicByte ; yes ld b, $0 ld hl, wc076 add hl, bc ld [hl], a ; store first param - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld d, a and $f0 swap a ld b, a ld a, d and $f - call Music8_22017 + call Audio2_22017 ld b, $0 ld hl, wc0a6 add hl, bc @@ -450,14 +450,14 @@ Music8_pitchbend: ; 21aee (8:5aee) ld hl, wc02e add hl, bc set 4, [hl] ; set pitchbend flag - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld d, a - jp Music8_notelength + jp Audio2_notelength -Music8_duty: ; 21b26 (8:5b26) +Audio2_duty: ; 21b26 (8:5b26) cp $ec ; is this command a duty? - jr nz, Music8_tempo ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_tempo ; no + call Audio2_GetNextMusicByte ; yes rrca rrca and $c0 @@ -465,17 +465,17 @@ Music8_duty: ; 21b26 (8:5b26) ld hl, wc03e add hl, bc ld [hl], a ; store duty - jp Music8_endchannel + jp Audio2_endchannel -Music8_tempo: ; 21b3b (8:5b3b) +Audio2_tempo: ; 21b3b (8:5b3b) cp $ed ; is this command a tempo? - jr nz, Music8_stereopanning ; no + jr nz, Audio2_stereopanning ; no ld a, c ; yes cp CH4 jr nc, .sfxChannel - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld [wc0e8], a ; store first param - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld [wc0e9], a ; store second param xor a ld [wc0ce], a ; clear RAM @@ -484,9 +484,9 @@ Music8_tempo: ; 21b3b (8:5b3b) ld [wc0d1], a jr .musicChannelDone .sfxChannel - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld [wc0ea], a ; store first param - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld [wc0eb], a ; store second param xor a ld [wc0d2], a ; clear RAM @@ -494,22 +494,22 @@ Music8_tempo: ; 21b3b (8:5b3b) ld [wc0d4], a ld [wc0d5], a .musicChannelDone - jp Music8_endchannel + jp Audio2_endchannel -Music8_stereopanning: ; 21b7b (8:5b7b) +Audio2_stereopanning: ; 21b7b (8:5b7b) cp $ee ; is this command a stereopanning? - jr nz, Music8_unknownmusic0xef ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_unknownmusic0xef ; no + call Audio2_GetNextMusicByte ; yes ld [wc004], a ; store panning - jp Music8_endchannel + jp Audio2_endchannel ; this appears to never be used -Music8_unknownmusic0xef: ; 21b88 (8:5b88) +Audio2_unknownmusic0xef: ; 21b88 (8:5b88) cp $ef ; is this command an unknownmusic0xef? - jr nz, Music8_dutycycle ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_dutycycle ; no + call Audio2_GetNextMusicByte ; yes push bc - call Music8_22035 + call Audio2_22035 pop bc ld a, [wc003] and a @@ -519,12 +519,12 @@ Music8_unknownmusic0xef: ; 21b88 (8:5b88) xor a ld [wc02d], a .skip - jp Music8_endchannel + jp Audio2_endchannel -Music8_dutycycle: ; 21ba7 (8:5ba7) +Audio2_dutycycle: ; 21ba7 (8:5ba7) cp $fc ; is this command a dutycycle? - jr nz, Music8_volume ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_volume ; no + call Audio2_GetNextMusicByte ; yes ld b, $0 ld hl, wc046 add hl, bc @@ -536,48 +536,48 @@ Music8_dutycycle: ; 21ba7 (8:5ba7) ld hl, wc02e add hl, bc set 6, [hl] ; set dutycycle flag - jp Music8_endchannel + jp Audio2_endchannel -Music8_volume: ; 21bc5 (8:5bc5) +Audio2_volume: ; 21bc5 (8:5bc5) cp $f0 ; is this command a volume? - jr nz, Music8_executemusic ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_executemusic ; no + call Audio2_GetNextMusicByte ; yes ld [$ff24], a ; store volume - jp Music8_endchannel + jp Audio2_endchannel -Music8_executemusic: ; 21bd1 (8:5bd1) +Audio2_executemusic: ; 21bd1 (8:5bd1) cp $f8 ; is this command an executemusic? - jr nz, Music8_octave ; no + jr nz, Audio2_octave ; no ld b, $0 ; yes ld hl, wc036 add hl, bc set 0, [hl] - jp Music8_endchannel + jp Audio2_endchannel -Music8_octave: ; 21be0 (8:5be0) +Audio2_octave: ; 21be0 (8:5be0) and $f0 cp $e0 ; is this command an octave? - jr nz, Music8_unknownsfx0x20 ; no + jr nz, Audio2_unknownsfx0x20 ; no ld hl, wc0d6 ; yes ld b, $0 add hl, bc ld a, d and $f ld [hl], a ; store low nibble as octave - jp Music8_endchannel + jp Audio2_endchannel -Music8_unknownsfx0x20: ; 21bf3 +Audio2_unknownsfx0x20: ; 21bf3 cp $20 ; is this command an unknownsfx0x20? - jr nz, Music8_unknownsfx0x10 ; no + jr nz, Audio2_unknownsfx0x10 ; no ld a, c cp CH3 ; is this a noise or sfx channel? - jr c, Music8_unknownsfx0x10 ; no + jr c, Audio2_unknownsfx0x10 ; no ld b, $0 ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music8_unknownsfx0x10 ; no - call Music8_notelength + jr nz, Audio2_unknownsfx0x10 ; no + call Audio2_notelength ld d, a ld b, $0 ld hl, wc03e @@ -586,56 +586,56 @@ Music8_unknownsfx0x20: ; 21bf3 or d ld d, a ld b, $1 - call Music8_21ff7 + call Audio2_21ff7 ld [hl], d - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld d, a ld b, $2 - call Music8_21ff7 + call Audio2_21ff7 ld [hl], d - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte ld e, a ld a, c cp CH7 ld a, $0 jr z, .sfxNoiseChannel ; only two params for noise channel push de - call Music8_GetNextMusicByte + call Audio2_GetNextMusicByte pop de .sfxNoiseChannel ld d, a push de - call Music8_21daa - call Music8_21d79 + call Audio2_21daa + call Audio2_21d79 pop de - call Music8_21dcc + call Audio2_21dcc ret -Music8_unknownsfx0x10: ; 21c40 (8:5c40) +Audio2_unknownsfx0x10: ; 21c40 (8:5c40) ld a, c cp CH4 - jr c, Music8_note ; if not a sfx + jr c, Audio2_note ; if not a sfx ld a, d cp $10 ; is this command a unknownsfx0x10? - jr nz, Music8_note ; no + jr nz, Audio2_note ; no ld b, $0 ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music8_note ; no - call Music8_GetNextMusicByte ; yes + jr nz, Audio2_note ; no + call Audio2_GetNextMusicByte ; yes ld [$ff10], a - jp Music8_endchannel + jp Audio2_endchannel -Music8_note: ; 21c5c (8:5c5c) +Audio2_note: ; 21c5c (8:5c5c) ld a, c cp CH3 - jr nz, Music8_notelength ; if not noise channel + jr nz, Audio2_notelength ; if not noise channel ld a, d and $f0 cp $b0 ; is this command a dnote? - jr z, Music8_dnote ; yes - jr nc, Music8_notelength ; no + jr z, Audio2_dnote ; yes + jr nc, Audio2_notelength ; no swap a ld b, a ld a, d @@ -646,24 +646,24 @@ Music8_note: ; 21c5c (8:5c5c) push bc jr asm_21c7e -Music8_dnote: ; 21c76 (8:5c76) +Audio2_dnote: ; 21c76 (8:5c76) ld a, d and $f push af push bc - call Music8_GetNextMusicByte ; get dnote instrument + call Audio2_GetNextMusicByte ; get dnote instrument asm_21c7e ld d, a ld a, [wc003] and a jr nz, .asm_21c89 ld a, d - call Music8_22035 + call Audio2_22035 .asm_21c89 pop bc pop de -Music8_notelength: ; 21c8b (8:5c8b) +Audio2_notelength: ; 21c8b (8:5c8b) ld a, d push af and $f @@ -675,7 +675,7 @@ Music8_notelength: ; 21c8b (8:5c8b) add hl, bc ld a, [hl] ld l, b - call Music8_22006 + call Audio2_22006 ld a, c cp CH4 jr nc, .sfxChannel @@ -689,7 +689,7 @@ Music8_notelength: ; 21c8b (8:5c8b) ld e, $0 cp CH7 jr z, .skip ; if noise channel - call Music8_21e2f + call Audio2_21e2f ld a, [wc0ea] ld d, a ld a, [wc0eb] @@ -700,7 +700,7 @@ Music8_notelength: ; 21c8b (8:5c8b) ld hl, wc0ce add hl, bc ld l, [hl] - call Music8_22006 + call Audio2_22006 ld e, l ld d, h ld hl, wc0ce @@ -713,15 +713,15 @@ Music8_notelength: ; 21c8b (8:5c8b) ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music8_notepitch + jr nz, Audio2_notepitch ld hl, wc02e add hl, bc bit 2, [hl] - jr z, Music8_notepitch + jr z, Audio2_notepitch pop hl ret -Music8_notepitch: ; 21ce9 (8:5ce9) +Audio2_notepitch: ; 21ce9 (8:5ce9) pop af and $f0 cp $c0 ; compare to rest @@ -751,7 +751,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9) jr .done .notSfxChannel3 ld b, $2 - call Music8_21ff7 + call Audio2_21ff7 ld a, $8 ld [hli], a inc hl @@ -765,13 +765,13 @@ Music8_notepitch: ; 21ce9 (8:5ce9) ld hl, wc0d6 add hl, bc ld b, [hl] - call Music8_22017 + call Audio2_22017 ld b, $0 ld hl, wc02e add hl, bc bit 4, [hl] jr z, .asm_21d39 - call Music8_21f4e + call Audio2_21f4e .asm_21d39 push de ld a, c @@ -794,10 +794,10 @@ Music8_notepitch: ; 21ce9 (8:5ce9) add hl, bc ld d, [hl] ld b, $2 - call Music8_21ff7 + call Audio2_21ff7 ld [hl], d - call Music8_21daa - call Music8_21d79 + call Audio2_21daa + call Audio2_21d79 pop de ld b, $0 ld hl, wc02e @@ -811,10 +811,10 @@ Music8_notepitch: ; 21ce9 (8:5ce9) ld hl, wc066 add hl, bc ld [hl], e - call Music8_21dcc + call Audio2_21dcc ret -Music8_21d79: ; 21d79 (8:5d79) +Audio2_21d79: ; 21d79 (8:5d79) ld b, $0 ld hl, Unknown_222e6 add hl, bc @@ -848,7 +848,7 @@ Music8_21d79: ; 21d79 (8:5d79) ld [$ff25], a ret -Music8_21daa: ; 21daa (8:5daa) +Audio2_21daa: ; 21daa (8:5daa) ld b, $0 ld hl, wc0b6 add hl, bc @@ -868,11 +868,11 @@ Music8_21daa: ; 21daa (8:5daa) ld d, a .channel3 ld b, $1 - call Music8_21ff7 + call Audio2_21ff7 ld [hl], d ret -Music8_21dcc: ; 21dcc (8:5dcc) +Audio2_21dcc: ; 21dcc (8:5dcc) ld a, c cp CH2 jr z, .channel3 @@ -890,7 +890,7 @@ Music8_21dcc: ; 21dcc (8:5dcc) add a ld d, $0 ld e, a - ld hl, Music8_WavePointers + ld hl, Audio2_WavePointers add hl, de ld e, [hl] inc hl @@ -916,18 +916,18 @@ Music8_21dcc: ; 21dcc (8:5dcc) and $c7 ld d, a ld b, $3 - call Music8_21ff7 + call Audio2_21ff7 ld [hl], e inc hl ld [hl], d ld a, c cp CH4 jr c, .musicChannel - call Music8_21e56 + call Audio2_21e56 .musicChannel ret -Music8_21e19: ; 21e19 (8:5e19) +Audio2_21e19: ; 21e19 (8:5e19) ld a, c cp CH4 jr nz, .asm_21e2e @@ -941,10 +941,10 @@ Music8_21e19: ; 21e19 (8:5e19) .asm_21e2e ret -Music8_21e2f: ; 21e2f (8:5e2f) - call Music8_21e8b +Audio2_21e2f: ; 21e2f (8:5e2f) + call Audio2_21e8b jr c, .asm_21e39 - call Music8_21e9f + call Audio2_21e9f jr nc, .asm_21e4c .asm_21e39 ld d, $0 @@ -965,10 +965,10 @@ Music8_21e2f: ; 21e2f (8:5e2f) .asm_21e55 ret -Music8_21e56: ; 21e56 (8:5e56) - call Music8_21e8b +Audio2_21e56: ; 21e56 (8:5e56) + call Audio2_21e8b jr c, .asm_21e60 - call Music8_21e9f + call Audio2_21e9f jr nc, .asm_21e6c .asm_21e60 ld a, [wc0f1] @@ -984,8 +984,8 @@ Music8_21e56: ; 21e56 (8:5e56) .asm_21e6c ret -Music8_21e6d: ; 21e6d (8:5e6d) - call Music8_21e8b +Audio2_21e6d: ; 21e6d (8:5e6d) + call Audio2_21e8b jr nc, .asm_21e88 ld hl, wc006 ld e, c @@ -1007,7 +1007,7 @@ Music8_21e6d: ; 21e6d (8:5e6d) ccf ret -Music8_21e8b: ; 21e8b (8:5e8b) +Audio2_21e8b: ; 21e8b (8:5e8b) ld a, [wc02a] cp $14 jr nc, .asm_21e94 @@ -1024,7 +1024,7 @@ Music8_21e8b: ; 21e8b (8:5e8b) scf ret -Music8_21e9f: ; 21e9f (8:5e9f) +Audio2_21e9f: ; 21e9f (8:5e9f) ld a, [wc02d] ld b, a ld a, [wc02a] @@ -1044,7 +1044,7 @@ Music8_21e9f: ; 21e9f (8:5e9f) scf ret -Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) +Audio2_ApplyPitchBend: ; 21eb8 (8:5eb8) ld hl, wc02e add hl, bc bit 5, [hl] @@ -1134,7 +1134,7 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) add hl, bc ld [hl], d ld b, $3 - call Music8_21ff7 + call Audio2_21ff7 ld a, e ld [hli], a ld [hl], d @@ -1146,7 +1146,7 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) res 5, [hl] ret -Music8_21f4e: ; 21f4e (8:5f4e) +Audio2_21f4e: ; 21f4e (8:5f4e) ld hl, wc096 add hl, bc ld [hl], d @@ -1235,7 +1235,7 @@ Music8_21f4e: ; 21f4e (8:5f4e) ld [hl], a ret -Music8_ApplyDutyCycle: ; 21fcc (8:5fcc) +Audio2_ApplyDutyCycle: ; 21fcc (8:5fcc) ld b, $0 ld hl, wc046 add hl, bc @@ -1246,14 +1246,14 @@ Music8_ApplyDutyCycle: ; 21fcc (8:5fcc) and $c0 ld d, a ld b, $1 - call Music8_21ff7 + call Audio2_21ff7 ld a, [hl] and $3f or d ld [hl], a ret -Music8_GetNextMusicByte: ; 21fe4 (8:5fe4) +Audio2_GetNextMusicByte: ; 21fe4 (8:5fe4) ld d, $0 ld a, c add a @@ -1271,7 +1271,7 @@ Music8_GetNextMusicByte: ; 21fe4 (8:5fe4) ld [hl], d ret -Music8_21ff7: ; 21ff7 (8:5ff7) +Audio2_21ff7: ; 21ff7 (8:5ff7) ld a, c ld hl, Unknown_222d6 add l @@ -1285,7 +1285,7 @@ Music8_21ff7: ; 21ff7 (8:5ff7) ld h, $ff ret -Music8_22006: ; 22006 (8:6006) +Audio2_22006: ; 22006 (8:6006) ld h, $0 .loop srl a @@ -1300,13 +1300,13 @@ Music8_22006: ; 22006 (8:6006) .done ret -Music8_22017: ; 22017 (8:6017) +Audio2_22017: ; 22017 (8:6017) ld h, $0 ld l, a add hl, hl ld d, h ld e, l - ld hl, Music8_Pitches + ld hl, Audio2_Pitches add hl, de ld e, [hl] inc hl @@ -1325,16 +1325,16 @@ Music8_22017: ; 22017 (8:6017) ld d, a ret -Music8_22035:: ; 22035 (8:6035) +Audio2_22035:: ; 22035 (8:6035) ld [wc001], a cp $ff - jp z, Music8_221f3 + jp z, Audio2_221f3 cp $e9 - jp z, Music8_2210d - jp c, Music8_2210d + jp z, Audio2_2210d + jp c, Audio2_2210d cp $fe jr z, .asm_2204c - jp nc, Music8_2210d + jp nc, Audio2_2210d .asm_2204c xor a ld [wc000], a @@ -1344,53 +1344,53 @@ Music8_22035:: ; 22035 (8:6035) ld [wc0e7], a ld d, $8 ld hl, wc016 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc006 - call FillMusicRAM8 + call FillAudioRAM2 ld d, $4 ld hl, wc026 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc02e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc03e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc046 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc04e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc056 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc05e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc066 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc06e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc036 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc076 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc07e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc086 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc08e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc096 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc09e - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc0a6 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc0ae - call FillMusicRAM8 + call FillAudioRAM2 ld a, $1 ld hl, wc0be - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc0b6 - call FillMusicRAM8 + call FillAudioRAM2 ld hl, wc0c6 - call FillMusicRAM8 + call FillAudioRAM2 ld [wc0e8], a ld a, $ff ld [wc004], a @@ -1406,16 +1406,16 @@ Music8_22035:: ; 22035 (8:6035) ld [$ff1a], a ld a, $77 ld [$ff24], a - jp Music8_2224e + jp Audio2_2224e -Music8_2210d: ; 2210d (8:610d) +Audio2_2210d: ; 2210d (8:610d) ld l, a ld e, a ld h, $0 ld d, h add hl, hl add hl, de - ld de, SFX_Headers_08 + ld de, SFX_Headers_2 add hl, de ld a, h ld [wc0ec], a @@ -1555,11 +1555,11 @@ Music8_2210d: ; 2210d (8:610d) .asm_221ea ld a, c and a - jp z, Music8_2224e + jp z, Audio2_2224e dec c jp .asm_22126 -Music8_221f3: ; 221f3 (8:61f3) +Audio2_221f3: ; 221f3 (8:61f3) ld a, $80 ld [$ff26], a ld [$ff1a], a @@ -1587,11 +1587,11 @@ Music8_221f3: ; 221f3 (8:61f3) ld [wc0e7], a ld d, $a0 ld hl, wc006 - call FillMusicRAM8 + call FillAudioRAM2 ld a, $1 ld d, $18 ld hl, wc0b6 - call FillMusicRAM8 + call FillAudioRAM2 ld [wc0e8], a ld [wc0ea], a ld a, $ff @@ -1599,7 +1599,7 @@ Music8_221f3: ; 221f3 (8:61f3) ret ; fills d bytes at hl with a -FillMusicRAM8: ; 22248 (8:6248) +FillAudioRAM2: ; 22248 (8:6248) ld b, d .loop ld [hli], a @@ -1607,7 +1607,7 @@ FillMusicRAM8: ; 22248 (8:6248) jr nz, .loop ret -Music8_2224e: ; 2224e (8:624e) +Audio2_2224e: ; 2224e (8:624e) ld a, [wc001] ld l, a ld e, a @@ -1615,7 +1615,7 @@ Music8_2224e: ; 2224e (8:624e) ld d, h add hl, hl add hl, de - ld de, SFX_Headers_08 + ld de, SFX_Headers_2 add hl, de ld e, l ld d, h @@ -1688,7 +1688,7 @@ Music8_2224e: ; 2224e (8:624e) ld [hli], a ld [hl], a ld hl, wc012 ; sfx noise channel pointer - ld de, Noise8_endchannel + ld de, Noise2_endchannel ld [hl], e inc hl ld [hl], d ; overwrite pointer to point to endchannel @@ -1702,7 +1702,7 @@ Music8_2224e: ; 2224e (8:624e) .asm_222d4 ret -Noise8_endchannel: ; 222d5 (8:62d5) +Noise2_endchannel: ; 222d5 (8:62d5) endchannel Unknown_222d6: ; 222d6 (8:62d6) @@ -1717,7 +1717,7 @@ Unknown_222e6: ; 222e6 (8:62e6) db $11, $22, $44, $88 ; channels 0-3 db $11, $22, $44, $88 ; channels 4-7 -Music8_Pitches: ; 222ee (8:62ee) +Audio2_Pitches: ; 222ee (8:62ee) dw $F82C ; C_ dw $F89D ; C# dw $F907 ; D_ diff --git a/audio/engine_3.asm b/audio/engine_3.asm index 718b6016..93fa62aa 100644 --- a/audio/engine_3.asm +++ b/audio/engine_3.asm @@ -1,6 +1,6 @@ ; The third of three duplicated sound engines. -Music1f_UpdateMusic:: ; 7d177 (1f:5177) +Audio3_UpdateMusic:: ; 7d177 (1f:5177) ld c, CH0 .loop ld b, $0 @@ -26,7 +26,7 @@ Music1f_UpdateMusic:: ; 7d177 (1f:5177) ld [$ff1a], a jr .nextChannel .applyAffects - call Music1f_ApplyMusicAffects + call Audio3_ApplyMusicAffects .nextChannel ld a, c inc c ; inc channel number @@ -42,13 +42,13 @@ Music1f_UpdateMusic:: ; 7d177 (1f:5177) ; 3: a toggle used only by this routine for vibrato ; 4: pitchbend flag ; 6: dutycycle flag -Music1f_ApplyMusicAffects: ; 7d1ac (1f:51ac) +Audio3_ApplyMusicAffects: ; 7d1ac (1f:51ac) ld b, $0 ld hl, wc0b6 ; delay until next note add hl, bc ld a, [hl] cp $1 ; if delay is 1, play next note - jp z, Music1f_PlayNextNote + jp z, Audio3_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a ld a, c @@ -65,7 +65,7 @@ Music1f_ApplyMusicAffects: ; 7d1ac (1f:51ac) add hl, bc bit 6, [hl] ; dutycycle jr z, .checkForExecuteMusic - call Music1f_ApplyDutyCycle + call Audio3_ApplyDutyCycle .checkForExecuteMusic ld b, $0 ld hl, wc036 @@ -81,7 +81,7 @@ Music1f_ApplyMusicAffects: ; 7d1ac (1f:51ac) add hl, bc bit 4, [hl] ; pitchbend jr z, .checkVibratoDelay - jp Music1f_ApplyPitchBend + jp Audio3_ApplyPitchBend .checkVibratoDelay ld hl, wc04e ; vibrato delay add hl, bc @@ -141,14 +141,14 @@ Music1f_ApplyMusicAffects: ; 7d1ac (1f:51ac) .done ld d, a ld b, $3 - call Music1f_7d8ac + call Audio3_7d8ac ld [hl], d ret ; this routine executes all music commands that take up no time, ; like tempo changes, duty changes etc. and doesn't return ; until the first note is reached -Music1f_PlayNextNote: ; 7d244 (1f:5244) +Audio3_PlayNextNote: ; 7d244 (1f:5244) ld hl, wc06e add hl, bc ld a, [hl] @@ -159,14 +159,14 @@ Music1f_PlayNextNote: ; 7d244 (1f:5244) add hl, bc res 4, [hl] res 5, [hl] - call Music1f_endchannel + call Audio3_endchannel ret -Music1f_endchannel: ; 7d25a (1f:525a) - call Music1f_GetNextMusicByte +Audio3_endchannel: ; 7d25a (1f:525a) + call Audio3_GetNextMusicByte ld d, a cp $ff ; is this command an endchannel? - jp nz, Music1f_callchannel ; no + jp nz, Audio3_callchannel ; no ld b, $0 ; yes ld hl, wc02e add hl, bc @@ -216,7 +216,7 @@ Music1f_endchannel: ; 7d25a (1f:525a) inc de ld a, [de] ld [hl], a ; loads channel address to return to - jp Music1f_endchannel + jp Audio3_endchannel .asm_7d2b3 ld hl, Unknown_7db93 add hl, bc @@ -238,7 +238,7 @@ Music1f_endchannel: ; 7d25a (1f:525a) ld a, c cp CH4 jr z, .asm_7d2d9 - call Music1f_7d73b + call Audio3_7d73b ret c .asm_7d2d9 ld a, [wc005] @@ -251,12 +251,12 @@ Music1f_endchannel: ; 7d25a (1f:525a) ld [hl], b ret -Music1f_callchannel: ; 7d2e8 (1f:52e8) +Audio3_callchannel: ; 7d2e8 (1f:52e8) cp $fd ; is this command a callchannel? - jp nz, Music1f_loopchannel ; no - call Music1f_GetNextMusicByte ; yes + jp nz, Audio3_loopchannel ; no + call Audio3_GetNextMusicByte ; yes push af - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld d, a pop af ld e, a @@ -286,12 +286,12 @@ Music1f_callchannel: ; 7d2e8 (1f:52e8) ld hl, wc02e add hl, bc set 1, [hl] ; set the call flag - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_loopchannel: ; 7d31d (1f:531d) +Audio3_loopchannel: ; 7d31d (1f:531d) cp $fe ; is this command a loopchannel? - jp nz, Music1f_notetype ; no - call Music1f_GetNextMusicByte ; yes + jp nz, Audio3_notetype ; no + call Audio3_GetNextMusicByte ; yes ld e, a and a jr z, .infiniteLoop @@ -303,17 +303,17 @@ Music1f_loopchannel: ; 7d31d (1f:531d) jr nz, .loopAgain ld a, $1 ; if no more loops to make ld [hl], a - call Music1f_GetNextMusicByte ; skip pointer - call Music1f_GetNextMusicByte - jp Music1f_endchannel + call Audio3_GetNextMusicByte ; skip pointer + call Audio3_GetNextMusicByte + jp Audio3_endchannel .loopAgain ; inc loop count inc a ld [hl], a ; fall through .infiniteLoop ; overwrite current address with pointer - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte push af - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld b, a ld d, $0 ld a, c @@ -324,12 +324,12 @@ Music1f_loopchannel: ; 7d31d (1f:531d) pop af ld [hli], a ld [hl], b - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_notetype: ; 7d358 (1f:5358) +Audio3_notetype: ; 7d358 (1f:5358) and $f0 cp $d0 ; is this command a notetype? - jp nz, Music1f_toggleperfectpitch ; no + jp nz, Audio3_toggleperfectpitch ; no ld a, d ; yes and $f ld b, $0 @@ -339,7 +339,7 @@ Music1f_notetype: ; 7d358 (1f:5358) ld a, c cp CH3 jr z, .noiseChannel ; noise channel has 0 params - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld d, a ld a, c cp CH2 @@ -368,24 +368,24 @@ Music1f_notetype: ; 7d358 (1f:5358) add hl, bc ld [hl], d .noiseChannel - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_toggleperfectpitch: ; 7d397 (1f:5397) +Audio3_toggleperfectpitch: ; 7d397 (1f:5397) ld a, d cp $e8 ; is this command a toggleperfectpitch? - jr nz, Music1f_vibrato ; no + jr nz, Audio3_vibrato ; no ld b, $0 ; yes ld hl, wc02e add hl, bc ld a, [hl] xor $1 ld [hl], a ; flip bit 0 of wc02e - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_vibrato: ; 7d3a9 (1f:53a9) +Audio3_vibrato: ; 7d3a9 (1f:53a9) cp $ea ; is this command a vibrato? - jr nz, Music1f_pitchbend ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_pitchbend ; no + call Audio3_GetNextMusicByte ; yes ld b, $0 ld hl, wc04e add hl, bc @@ -393,7 +393,7 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9) ld hl, wc06e add hl, bc ld [hl], a ; store delay - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld d, a and $f0 swap a @@ -414,24 +414,24 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9) swap a or d ld [hl], a ; store depth as both high and low nibbles - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_pitchbend: ; 7d3e1 (1f:53e1) +Audio3_pitchbend: ; 7d3e1 (1f:53e1) cp $eb ; is this command a pitchbend? - jr nz, Music1f_duty ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_duty ; no + call Audio3_GetNextMusicByte ; yes ld b, $0 ld hl, wc076 add hl, bc ld [hl], a ; store first param - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld d, a and $f0 swap a ld b, a ld a, d and $f - call Music1f_7d8cc + call Audio3_7d8cc ld b, $0 ld hl, wc0a6 add hl, bc @@ -443,14 +443,14 @@ Music1f_pitchbend: ; 7d3e1 (1f:53e1) ld hl, wc02e add hl, bc set 4, [hl] ; set pitchbend flag - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld d, a - jp Music1f_notelength + jp Audio3_notelength -Music1f_duty: ; 7d419 (1f:5419) +Audio3_duty: ; 7d419 (1f:5419) cp $ec ; is this command a duty? - jr nz, Music1f_tempo ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_tempo ; no + call Audio3_GetNextMusicByte ; yes rrca rrca and $c0 @@ -458,17 +458,17 @@ Music1f_duty: ; 7d419 (1f:5419) ld hl, wc03e add hl, bc ld [hl], a ; store duty - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_tempo: ; 7d42e (1f:542e) +Audio3_tempo: ; 7d42e (1f:542e) cp $ed ; is this command a tempo? - jr nz, Music1f_stereopanning ; no + jr nz, Audio3_stereopanning ; no ld a, c ; yes cp CH4 jr nc, .sfxChannel - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld [wc0e8], a ; store first param - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld [wc0e9], a ; store second param xor a ld [wc0ce], a ; clear RAM @@ -477,9 +477,9 @@ Music1f_tempo: ; 7d42e (1f:542e) ld [wc0d1], a jr .musicChannelDone .sfxChannel - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld [wc0ea], a ; store first param - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld [wc0eb], a ; store second param xor a ld [wc0d2], a ; clear RAM @@ -487,22 +487,22 @@ Music1f_tempo: ; 7d42e (1f:542e) ld [wc0d4], a ld [wc0d5], a .musicChannelDone - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_stereopanning: ; 7d46e (1f:546e) +Audio3_stereopanning: ; 7d46e (1f:546e) cp $ee ; is this command a stereopanning? - jr nz, Music1f_unknownmusic0xef ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_unknownmusic0xef ; no + call Audio3_GetNextMusicByte ; yes ld [wc004], a ; store panning - jp Music1f_endchannel + jp Audio3_endchannel ; this appears to never be used -Music1f_unknownmusic0xef: ; 7d47b (1f:547b) +Audio3_unknownmusic0xef: ; 7d47b (1f:547b) cp $ef ; is this command an unknownmusic0xef? - jr nz, Music1f_dutycycle ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_dutycycle ; no + call Audio3_GetNextMusicByte ; yes push bc - call Music1f_7d8ea + call Audio3_7d8ea pop bc ld a, [wc003] and a @@ -512,12 +512,12 @@ Music1f_unknownmusic0xef: ; 7d47b (1f:547b) xor a ld [wc02d], a .skip - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_dutycycle: ; 7d49a (1f:549a) +Audio3_dutycycle: ; 7d49a (1f:549a) cp $fc ; is this command a dutycycle? - jr nz, Music1f_volume ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_volume ; no + call Audio3_GetNextMusicByte ; yes ld b, $0 ld hl, wc046 add hl, bc @@ -529,48 +529,48 @@ Music1f_dutycycle: ; 7d49a (1f:549a) ld hl, wc02e add hl, bc set 6, [hl] ; set duty flag - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_volume: ; 7d4b8 (1f:54b8) +Audio3_volume: ; 7d4b8 (1f:54b8) cp $f0 ; is this command a volume? - jr nz, Music1f_executemusic ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_executemusic ; no + call Audio3_GetNextMusicByte ; yes ld [$ff24], a ; store volume - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_executemusic: ; 7d4c4 (1f:54c4) +Audio3_executemusic: ; 7d4c4 (1f:54c4) cp $f8 ; is this command an executemusic? - jr nz, Music1f_octave ; no + jr nz, Audio3_octave ; no ld b, $0 ; yes ld hl, wc036 add hl, bc set 0, [hl] - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_octave: ; 7d4d3 (1f:54d3) +Audio3_octave: ; 7d4d3 (1f:54d3) and $f0 cp $e0 ; is this command an octave? - jr nz, Music1f_unknownsfx0x20 ; no + jr nz, Audio3_unknownsfx0x20 ; no ld hl, wc0d6 ; yes ld b, $0 add hl, bc ld a, d and $f ld [hl], a ; store low nibble as octave - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_unknownsfx0x20: ; 7d4e6 (1f:54e6) +Audio3_unknownsfx0x20: ; 7d4e6 (1f:54e6) cp $20 ; is this command an unknownsfx0x20? - jr nz, Music1f_unknownsfx0x10 ; no + jr nz, Audio3_unknownsfx0x10 ; no ld a, c cp CH3 ; is this a noise or sfx channel? - jr c, Music1f_unknownsfx0x10 ; no + jr c, Audio3_unknownsfx0x10 ; no ld b, $0 ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music1f_unknownsfx0x10 ; no - call Music1f_notelength ; yes + jr nz, Audio3_unknownsfx0x10 ; no + call Audio3_notelength ; yes ld d, a ld b, $0 ld hl, wc03e @@ -579,56 +579,56 @@ Music1f_unknownsfx0x20: ; 7d4e6 (1f:54e6) or d ld d, a ld b, $1 - call Music1f_7d8ac + call Audio3_7d8ac ld [hl], d - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld d, a ld b, $2 - call Music1f_7d8ac + call Audio3_7d8ac ld [hl], d - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte ld e, a ld a, c cp CH7 ld a, $0 jr z, .sfxNoiseChannel ; only two params for noise channel push de - call Music1f_GetNextMusicByte + call Audio3_GetNextMusicByte pop de .sfxNoiseChannel ld d, a push de - call Music1f_7d69d - call Music1f_7d66c + call Audio3_7d69d + call Audio3_7d66c pop de - call Music1f_7d6bf + call Audio3_7d6bf ret -Music1f_unknownsfx0x10: ; 7d533 (1f:5533) +Audio3_unknownsfx0x10: ; 7d533 (1f:5533) ld a, c cp CH4 - jr c, Music1f_note ; if not a sfx + jr c, Audio3_note ; if not a sfx ld a, d cp $10 ; is this command an unknownsfx0x10? - jr nz, Music1f_note ; no + jr nz, Audio3_note ; no ld b, $0 ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music1f_note ; no - call Music1f_GetNextMusicByte ; yes + jr nz, Audio3_note ; no + call Audio3_GetNextMusicByte ; yes ld [$ff10], a - jp Music1f_endchannel + jp Audio3_endchannel -Music1f_note: ; 7d54f (1f:554f) +Audio3_note: ; 7d54f (1f:554f) ld a, c cp CH3 - jr nz, Music1f_notelength ; if not noise channel + jr nz, Audio3_notelength ; if not noise channel ld a, d and $f0 cp $b0 ; is this command a dnote? - jr z, Music1f_dnote ; yes - jr nc, Music1f_notelength ; no + jr z, Audio3_dnote ; yes + jr nc, Audio3_notelength ; no swap a ld b, a ld a, d @@ -639,24 +639,24 @@ Music1f_note: ; 7d54f (1f:554f) push bc jr asm_7d571 -Music1f_dnote: ; 7d569 (1f:5569) +Audio3_dnote: ; 7d569 (1f:5569) ld a, d and $f push af push bc - call Music1f_GetNextMusicByte ; get dnote instrument + call Audio3_GetNextMusicByte ; get dnote instrument asm_7d571 ld d, a ld a, [wc003] and a jr nz, .asm_7d57c ld a, d - call Music1f_7d8ea + call Audio3_7d8ea .asm_7d57c pop bc pop de -Music1f_notelength: ; 7d57e (1f:557e) +Audio3_notelength: ; 7d57e (1f:557e) ld a, d push af and $f @@ -668,7 +668,7 @@ Music1f_notelength: ; 7d57e (1f:557e) add hl, bc ld a, [hl] ld l, b - call Music1f_7d8bb + call Audio3_7d8bb ld a, c cp CH4 jr nc, .sfxChannel @@ -682,7 +682,7 @@ Music1f_notelength: ; 7d57e (1f:557e) ld e, $0 cp CH7 jr z, .skip ; if noise channel - call Music1f_7d707 + call Audio3_7d707 ld a, [wc0ea] ld d, a ld a, [wc0eb] @@ -693,7 +693,7 @@ Music1f_notelength: ; 7d57e (1f:557e) ld hl, wc0ce add hl, bc ld l, [hl] - call Music1f_7d8bb + call Audio3_7d8bb ld e, l ld d, h ld hl, wc0ce @@ -706,15 +706,15 @@ Music1f_notelength: ; 7d57e (1f:557e) ld hl, wc036 add hl, bc bit 0, [hl] - jr nz, Music1f_notepitch + jr nz, Audio3_notepitch ld hl, wc02e add hl, bc bit 2, [hl] - jr z, Music1f_notepitch + jr z, Audio3_notepitch pop hl ret -Music1f_notepitch: ; 7d5dc (1f:55dc) +Audio3_notepitch: ; 7d5dc (1f:55dc) pop af and $f0 cp $c0 ; compare to rest @@ -744,7 +744,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) jr .quit .notSfxChannel3 ld b, $2 - call Music1f_7d8ac + call Audio3_7d8ac ld a, $8 ld [hli], a inc hl @@ -758,13 +758,13 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) ld hl, wc0d6 add hl, bc ld b, [hl] - call Music1f_7d8cc + call Audio3_7d8cc ld b, $0 ld hl, wc02e add hl, bc bit 4, [hl] jr z, .asm_7d62c - call Music1f_7d803 + call Audio3_7d803 .asm_7d62c push de ld a, c @@ -787,10 +787,10 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) add hl, bc ld d, [hl] ld b, $2 - call Music1f_7d8ac + call Audio3_7d8ac ld [hl], d - call Music1f_7d69d - call Music1f_7d66c + call Audio3_7d69d + call Audio3_7d66c pop de ld b, $0 ld hl, wc02e @@ -804,10 +804,10 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) ld hl, wc066 add hl, bc ld [hl], e - call Music1f_7d6bf + call Audio3_7d6bf ret -Music1f_7d66c: ; 7d66c (1f:566c) +Audio3_7d66c: ; 7d66c (1f:566c) ld b, $0 ld hl, Unknown_7db9b add hl, bc @@ -841,7 +841,7 @@ Music1f_7d66c: ; 7d66c (1f:566c) ld [$ff25], a ret -Music1f_7d69d: ; 7d69d (1f:569d) +Audio3_7d69d: ; 7d69d (1f:569d) ld b, $0 ld hl, wc0b6 add hl, bc @@ -861,11 +861,11 @@ Music1f_7d69d: ; 7d69d (1f:569d) ld d, a .channel3 ld b, $1 - call Music1f_7d8ac + call Audio3_7d8ac ld [hl], d ret -Music1f_7d6bf: ; 7d6bf (1f:56bf) +Audio3_7d6bf: ; 7d6bf (1f:56bf) ld a, c cp CH2 jr z, .channel3 @@ -883,7 +883,7 @@ Music1f_7d6bf: ; 7d6bf (1f:56bf) add a ld d, $0 ld e, a - ld hl, Music1f_WavePointers + ld hl, Audio3_WavePointers add hl, de ld e, [hl] inc hl @@ -909,15 +909,15 @@ Music1f_7d6bf: ; 7d6bf (1f:56bf) and $c7 ld d, a ld b, $3 - call Music1f_7d8ac + call Audio3_7d8ac ld [hl], e inc hl ld [hl], d - call Music1f_7d729 + call Audio3_7d729 ret -Music1f_7d707: ; 7d707 (1f:5707) - call Music1f_7d759 +Audio3_7d707: ; 7d707 (1f:5707) + call Audio3_7d759 jr nc, .asm_7d71f ld d, $0 ld a, [wc0f2] @@ -937,8 +937,8 @@ Music1f_7d707: ; 7d707 (1f:5707) .asm_7d728 ret -Music1f_7d729: ; 7d729 (1f:5729) - call Music1f_7d759 +Audio3_7d729: ; 7d729 (1f:5729) + call Audio3_7d759 jr nc, .asm_7d73a ld a, [wc0f1] add e @@ -953,8 +953,8 @@ Music1f_7d729: ; 7d729 (1f:5729) .asm_7d73a ret -Music1f_7d73b: ; 7d73b (1f:573b) - call Music1f_7d759 +Audio3_7d73b: ; 7d73b (1f:573b) + call Audio3_7d759 jr nc, .asm_7d756 ld hl, wc006 ld e, c @@ -976,7 +976,7 @@ Music1f_7d73b: ; 7d73b (1f:573b) ccf ret -Music1f_7d759: ; 7d759 (1f:5759) +Audio3_7d759: ; 7d759 (1f:5759) ld a, [wc02a] cp $14 jr nc, .asm_7d762 @@ -993,7 +993,7 @@ Music1f_7d759: ; 7d759 (1f:5759) scf ret -Music1f_ApplyPitchBend: ; 7d76d (1f:576d) +Audio3_ApplyPitchBend: ; 7d76d (1f:576d) ld hl, wc02e add hl, bc bit 5, [hl] @@ -1083,7 +1083,7 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d) add hl, bc ld [hl], d ld b, $3 - call Music1f_7d8ac + call Audio3_7d8ac ld a, e ld [hli], a ld [hl], d @@ -1095,7 +1095,7 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d) res 5, [hl] ret -Music1f_7d803: ; 7d803 (1f:5803) +Audio3_7d803: ; 7d803 (1f:5803) ld hl, wc096 add hl, bc ld [hl], d @@ -1184,7 +1184,7 @@ Music1f_7d803: ; 7d803 (1f:5803) ld [hl], a ret -Music1f_ApplyDutyCycle: ; 7d881 (1f:5881) +Audio3_ApplyDutyCycle: ; 7d881 (1f:5881) ld b, $0 ld hl, wc046 add hl, bc @@ -1195,14 +1195,14 @@ Music1f_ApplyDutyCycle: ; 7d881 (1f:5881) and $c0 ld d, a ld b, $1 - call Music1f_7d8ac + call Audio3_7d8ac ld a, [hl] and $3f or d ld [hl], a ret -Music1f_GetNextMusicByte: ; 7d899 (1f:5899) +Audio3_GetNextMusicByte: ; 7d899 (1f:5899) ld d, $0 ld a, c add a @@ -1220,7 +1220,7 @@ Music1f_GetNextMusicByte: ; 7d899 (1f:5899) ld [hl], d ret -Music1f_7d8ac: ; 7d8ac (1f:58ac) +Audio3_7d8ac: ; 7d8ac (1f:58ac) ld a, c ld hl, Unknown_7db8b add l @@ -1234,7 +1234,7 @@ Music1f_7d8ac: ; 7d8ac (1f:58ac) ld h, $ff ret -Music1f_7d8bb: ; 7d8bb (1f:58bb) +Audio3_7d8bb: ; 7d8bb (1f:58bb) ld h, $0 .loop srl a @@ -1249,13 +1249,13 @@ Music1f_7d8bb: ; 7d8bb (1f:58bb) .done ret -Music1f_7d8cc: ; 7d8cc (1f:58cc) +Audio3_7d8cc: ; 7d8cc (1f:58cc) ld h, $0 ld l, a add hl, hl ld d, h ld e, l - ld hl, Music1f_Pitches + ld hl, Audio3_Pitches add hl, de ld e, [hl] inc hl @@ -1274,16 +1274,16 @@ Music1f_7d8cc: ; 7d8cc (1f:58cc) ld d, a ret -Music1f_7d8ea:: ; 7d8ea (1f:58ea) +Audio3_7d8ea:: ; 7d8ea (1f:58ea) ld [wc001], a cp $ff - jp z, Music1f_7daa8 + jp z, Audio3_7daa8 cp $c2 - jp z, Music1f_7d9c2 - jp c, Music1f_7d9c2 + jp z, Audio3_7d9c2 + jp c, Audio3_7d9c2 cp $fe jr z, .asm_7d901 - jp nc, Music1f_7d9c2 + jp nc, Audio3_7d9c2 .asm_7d901 xor a ld [wc000], a @@ -1293,53 +1293,53 @@ Music1f_7d8ea:: ; 7d8ea (1f:58ea) ld [wc0e7], a ld d, $8 ld hl, wc016 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc006 - call FillMusicRAM1f + call FillAudioRAM3 ld d, $4 ld hl, wc026 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc02e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc03e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc046 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc04e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc056 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc05e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc066 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc06e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc036 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc076 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc07e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc086 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc08e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc096 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc09e - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc0a6 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc0ae - call FillMusicRAM1f + call FillAudioRAM3 ld a, $1 ld hl, wc0be - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc0b6 - call FillMusicRAM1f + call FillAudioRAM3 ld hl, wc0c6 - call FillMusicRAM1f + call FillAudioRAM3 ld [wc0e8], a ld a, $ff ld [wc004], a @@ -1355,16 +1355,16 @@ Music1f_7d8ea:: ; 7d8ea (1f:58ea) ld [$ff1a], a ld a, $77 ld [$ff24], a - jp Music1f_7db03 + jp Audio3_7db03 -Music1f_7d9c2: ; 7d9c2 (1f:59c2) +Audio3_7d9c2: ; 7d9c2 (1f:59c2) ld l, a ld e, a ld h, $0 ld d, h add hl, hl add hl, de - ld de, SFX_Headers_1f + ld de, SFX_Headers_3 add hl, de ld a, h ld [wc0ec], a @@ -1504,11 +1504,11 @@ Music1f_7d9c2: ; 7d9c2 (1f:59c2) .asm_7da9f ld a, c and a - jp z, Music1f_7db03 + jp z, Audio3_7db03 dec c jp .asm_7d9db -Music1f_7daa8: ; 7daa8 (1f:5aa8) +Audio3_7daa8: ; 7daa8 (1f:5aa8) ld a, $80 ld [$ff26], a ld [$ff1a], a @@ -1536,11 +1536,11 @@ Music1f_7daa8: ; 7daa8 (1f:5aa8) ld [wc0e7], a ld d, $a0 ld hl, wc006 - call FillMusicRAM1f + call FillAudioRAM3 ld a, $1 ld d, $18 ld hl, wc0b6 - call FillMusicRAM1f + call FillAudioRAM3 ld [wc0e8], a ld [wc0ea], a ld a, $ff @@ -1548,7 +1548,7 @@ Music1f_7daa8: ; 7daa8 (1f:5aa8) ret ; fills d bytes at hl with a -FillMusicRAM1f: ; 7dafd (1f:5afd) +FillAudioRAM3: ; 7dafd (1f:5afd) ld b, d .loop ld [hli], a @@ -1556,7 +1556,7 @@ FillMusicRAM1f: ; 7dafd (1f:5afd) jr nz, .loop ret -Music1f_7db03: ; 7db03 (1f:5b03) +Audio3_7db03: ; 7db03 (1f:5b03) ld a, [wc001] ld l, a ld e, a @@ -1564,7 +1564,7 @@ Music1f_7db03: ; 7db03 (1f:5b03) ld d, h add hl, hl add hl, de - ld de, SFX_Headers_1f + ld de, SFX_Headers_3 add hl, de ld e, l ld d, h @@ -1637,7 +1637,7 @@ Music1f_7db03: ; 7db03 (1f:5b03) ld [hli], a ld [hl], a ld hl, wc012 ; sfx noise channel pointer - ld de, Noise1f_endchannel + ld de, Noise3_endchannel ld [hl], e inc hl ld [hl], d ; overwrite pointer to point to endchannel @@ -1651,7 +1651,7 @@ Music1f_7db03: ; 7db03 (1f:5b03) .asm_7db89 ret -Noise1f_endchannel: ; 7db8a (1f:5b8a) +Noise3_endchannel: ; 7db8a (1f:5b8a) endchannel Unknown_7db8b: ; 7db8b (1f:5b8b) @@ -1666,7 +1666,7 @@ Unknown_7db9b: ; 7db9b (1f:5b9b) db $11, $22, $44, $88 ; channels 0-3 db $11, $22, $44, $88 ; channels 4-7 -Music1f_Pitches: ; 7dba3 (1f:5ba3) +Audio3_Pitches: ; 7dba3 (1f:5ba3) dw $F82C ; C_ dw $F89D ; C# dw $F907 ; D_ diff --git a/audio/headers/musicheaders02.asm b/audio/headers/musicheaders1.asm index a6449436..a6449436 100755 --- a/audio/headers/musicheaders02.asm +++ b/audio/headers/musicheaders1.asm diff --git a/audio/headers/musicheaders08.asm b/audio/headers/musicheaders2.asm index 85cf2825..85cf2825 100755 --- a/audio/headers/musicheaders08.asm +++ b/audio/headers/musicheaders2.asm diff --git a/audio/headers/musicheaders1f.asm b/audio/headers/musicheaders3.asm index 7846e48f..7846e48f 100755 --- a/audio/headers/musicheaders1f.asm +++ b/audio/headers/musicheaders3.asm diff --git a/audio/headers/sfxheaders02.asm b/audio/headers/sfxheaders1.asm index 86fca297..49370aa4 100644 --- a/audio/headers/sfxheaders02.asm +++ b/audio/headers/sfxheaders1.asm @@ -1,4 +1,4 @@ -SFX_Headers_02:: +SFX_Headers_1:: db $ff, $ff, $ff ; padding SFX_Snare1_1:: ; 8003 (2:4003) diff --git a/audio/headers/sfxheaders08.asm b/audio/headers/sfxheaders2.asm index 46491e67..1b30f5cc 100644 --- a/audio/headers/sfxheaders08.asm +++ b/audio/headers/sfxheaders2.asm @@ -1,4 +1,4 @@ -SFX_Headers_08:: +SFX_Headers_2:: db $ff, $ff, $ff ; padding SFX_Snare1_2:: ; 20003 (8:4003) diff --git a/audio/headers/sfxheaders1f.asm b/audio/headers/sfxheaders3.asm index 7af4755f..321a33f5 100644 --- a/audio/headers/sfxheaders1f.asm +++ b/audio/headers/sfxheaders3.asm @@ -1,4 +1,4 @@ -SFX_Headers_1f:: +SFX_Headers_3:: db $ff, $ff, $ff ; padding SFX_Snare1_3:: ; 7c003 (1f:4003) diff --git a/audio/sfx/sfx_08_pokeflute.asm b/audio/sfx/pokeflute_ch1_ch2.asm index 4ccf89d8..4ccf89d8 100755 --- a/audio/sfx/sfx_08_pokeflute.asm +++ b/audio/sfx/pokeflute_ch1_ch2.asm diff --git a/audio/sfx/sfx_08_pokeflute_ch3.asm b/audio/sfx/pokeflute_ch3.asm index 0652e673..0652e673 100755 --- a/audio/sfx/sfx_08_pokeflute_ch3.asm +++ b/audio/sfx/pokeflute_ch3.asm diff --git a/audio/sfx/sfx_08_unused2.asm b/audio/sfx/unused2_2.asm index 1eca4432..1eca4432 100755 --- a/audio/sfx/sfx_08_unused2.asm +++ b/audio/sfx/unused2_2.asm diff --git a/audio/sfx/sfx_02_unused.asm b/audio/sfx/unused_1.asm index bd9bdfb3..bd9bdfb3 100755 --- a/audio/sfx/sfx_02_unused.asm +++ b/audio/sfx/unused_1.asm diff --git a/audio/sfx/sfx_08_unused.asm b/audio/sfx/unused_2.asm index 25e4840c..25e4840c 100755 --- a/audio/sfx/sfx_08_unused.asm +++ b/audio/sfx/unused_2.asm diff --git a/audio/sfx/sfx_1f_unused.asm b/audio/sfx/unused_3.asm index dfb16ee1..dfb16ee1 100755 --- a/audio/sfx/sfx_1f_unused.asm +++ b/audio/sfx/unused_3.asm diff --git a/constants/music_constants.asm b/constants/music_constants.asm index d8c62dda..f239acea 100644 --- a/constants/music_constants.asm +++ b/constants/music_constants.asm @@ -1,7 +1,7 @@ ; Song ids are calculated by address to save space. music_const: MACRO -\1 EQUS "((\2 - SFX_Headers_02) / 3)" +\1 EQUS "((\2 - SFX_Headers_1) / 3)" ENDM ; AUDIO_1 diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index f9dcc3a5..b123f33f 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -35,7 +35,7 @@ AnimateHealingMachine: ; 70433 (1c:4433) dec b jr nz, .asm_7046e ld a, [wc0ef] - cp BANK(Music1f_UpdateMusic) + cp BANK(Audio3_UpdateMusic) ld [wc0f0], a jr nz, .asm_70495 ld a, $ff diff --git a/home/audio.asm b/home/audio.asm index 1301550c..033f4067 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -56,19 +56,19 @@ Func_2324:: ; 2324 (0:2324) Func_235f:: ; 235f (0:235f) ld a, [wc0ef] ld b, a - cp BANK(Music2_UpdateMusic) - jr nz, .checkForBank08 -.bank02 - ld hl, Music2_UpdateMusic + cp BANK(Audio1_UpdateMusic) + jr nz, .checkForAudio2 +.audio1 + ld hl, Audio1_UpdateMusic jr .asm_2378 -.checkForBank08 - cp BANK(Music8_UpdateMusic) - jr nz, .bank1F -.bank08 - ld hl, Music8_UpdateMusic +.checkForAudio2 + cp BANK(Audio2_UpdateMusic) + jr nz, .audio3 +.audio2 + ld hl, Audio2_UpdateMusic jr .asm_2378 -.bank1F - ld hl, Music1f_UpdateMusic +.audio3 + ld hl, Audio3_UpdateMusic .asm_2378 ld c, $6 .asm_237a @@ -147,22 +147,22 @@ PlaySound:: ; 23b1 (0:23b1) ld a, [wc0ef] ld [H_LOADEDROMBANK], a ld [MBC1RomBank], a - cp BANK(Music2_9876) - jr nz, .checkForBank08 -.bank02 + cp BANK(Audio1_9876) + jr nz, .checkForAudio2 +.audio1 ld a, b - call Music2_9876 + call Audio1_9876 jr .asm_240b -.checkForBank08 - cp BANK(Music8_22035) - jr nz, .bank1F -.bank08 +.checkForAudio2 + cp BANK(Audio2_22035) + jr nz, .audio3 +.audio2 ld a, b - call Music8_22035 + call Audio2_22035 jr .asm_240b -.bank1F +.audio3 ld a, b - call Music1f_7d8ea + call Audio3_7d8ea .asm_240b ld a, [$ffb9] ld [H_LOADEDROMBANK], a diff --git a/home/init.asm b/home/init.asm index 848a81a3..624a4d6a 100644 --- a/home/init.asm +++ b/home/init.asm @@ -126,7 +126,7 @@ ClearVram: StopAllSounds:: - ld a, BANK(Music2_UpdateMusic) + ld a, BANK(Audio1_UpdateMusic) ld [wc0ef], a ld [wc0f0], a xor a diff --git a/home/vblank.asm b/home/vblank.asm index 9adf537c..05b01a3d 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -56,20 +56,20 @@ VBlank:: ld [H_LOADEDROMBANK], a ld [MBC1RomBank], a - cp BANK(Music2_UpdateMusic) - jr nz, .notbank2 -.bank2 - call Music2_UpdateMusic + cp BANK(Audio1_UpdateMusic) + jr nz, .checkForAudio2 +.audio1 + call Audio1_UpdateMusic jr .afterMusic -.notbank2 - cp BANK(Music8_UpdateMusic) - jr nz, .bank1F -.bank8 +.checkForAudio2 + cp BANK(Audio2_UpdateMusic) + jr nz, .audio3 +.audio2 call Music_DoLowHealthAlarm - call Music8_UpdateMusic + call Audio2_UpdateMusic jr .afterMusic -.bank1F - call Music1f_UpdateMusic +.audio3 + call Audio3_UpdateMusic .afterMusic callba TrackPlayTime ; keep track of time played diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index a1fd791a..f1eabc29 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -48,7 +48,7 @@ SSAnne7RubText: ; 618ec (18:58ec) TX_FAR _SSAnne7RubText TX_ASM ld a, [wc0ef] - cp BANK(Music1f_UpdateMusic) + cp BANK(Audio3_UpdateMusic) ld [wc0f0], a jr nz, .asm_61908 ld a, $ff |