summaryrefslogtreecommitdiff
path: root/audio/engine.asm
diff options
context:
space:
mode:
Diffstat (limited to 'audio/engine.asm')
-rw-r--r--audio/engine.asm72
1 files changed, 0 insertions, 72 deletions
diff --git a/audio/engine.asm b/audio/engine.asm
index a3d68a1b1..5dae1e3b6 100644
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -56,7 +56,6 @@ _MapSetup_Sound_Off::
pop hl
ret
-
MusicFadeRestart:
; restart but keep the music id to fade in to
ld a, [wMusicFadeID + 1]
@@ -70,19 +69,16 @@ MusicFadeRestart:
ld [wMusicFadeID + 1], a
ret
-
MusicOn:
ld a, 1
ld [wMusicPlaying], a
ret
-
MusicOff:
xor a
ld [wMusicPlaying], a
ret
-
_UpdateSound::
; called once per frame
; no use updating audio if it's not playing
@@ -212,7 +208,6 @@ _UpdateSound::
ld [rNR51], a
ret
-
UpdateChannels:
ld hl, .ChannelFnPtrs
ld a, [wCurChannel]
@@ -505,7 +500,6 @@ endr
ld [rNR44], a
ret
-
_CheckSFX:
; return carry if any sfx channels are active
ld hl, wChannel5Flags1
@@ -527,7 +521,6 @@ _CheckSFX:
scf
ret
-
PlayDanger:
ld a, [wLowHealthAlarm]
bit DANGER_ON_F, a
@@ -588,7 +581,6 @@ PlayDanger:
ld [wSoundOutput], a
ret
-
DangerSoundHigh:
db $80 ; duty 50%
db $e2 ; volume 14, envelope decrease sweep 2
@@ -713,7 +705,6 @@ FadeMusic:
ld [wVolume], a
ret
-
LoadNote:
; wait for pitch wheel to finish
ld hl, CHANNEL_FLAGS2
@@ -834,7 +825,6 @@ LoadNote:
ld [hl], a
ret
-
HandleTrackVibrato:
; handle duty, cry pitch, and vibrato
ld hl, CHANNEL_FLAGS2
@@ -952,7 +942,6 @@ HandleTrackVibrato:
.quit
ret
-
ApplyPitchWheel:
; quit if pitch wheel inactive
ld hl, CHANNEL_FLAGS2
@@ -1068,7 +1057,6 @@ ApplyPitchWheel:
set NOTE_DUTY_OVERRIDE, [hl]
ret
-
HandleNoise:
; is noise sampling on?
ld hl, CHANNEL_FLAGS1
@@ -1095,7 +1083,6 @@ HandleNoise:
ld [wNoiseSampleDelay], a
ret
-
ReadNoiseSample:
; sample struct:
; [wx] [yy] [zz]
@@ -1146,7 +1133,6 @@ ReadNoiseSample:
.quit
ret
-
ParseMusic:
; parses until a note is read or the song is ended
call GetMusicByte ; store next byte in a
@@ -1255,7 +1241,6 @@ ParseMusic:
ld [hli], a ; bank
ret
-
RestoreVolume:
; ch5 only
ld a, [wCurChannel]
@@ -1275,7 +1260,6 @@ RestoreVolume:
ld [wSFXPriority], a
ret
-
ParseSFXOrRest:
; turn noise sampling on
ld hl, CHANNEL_NOTE_FLAGS
@@ -1306,7 +1290,6 @@ ParseSFXOrRest:
ld [hl], a
ret
-
GetNoiseSample:
; load ptr to sample header in wNoiseSampleAddress
; are we on the last channel?
@@ -1363,7 +1346,6 @@ GetNoiseSample:
ld [wNoiseSampleDelay], a
ret
-
ParseMusicCommand:
; reload command
ld a, [wCurMusicByte]
@@ -1381,7 +1363,6 @@ ParseMusicCommand:
ld l, a
jp hl
-
MusicCommands:
; entries correspond to macros/sound.asm enumeration
dw Music_Octave8 ; octave 8
@@ -1443,7 +1424,6 @@ MusicF7:
MusicF8:
ret
-
Music_EndChannel:
; called when $ff is encountered w/ subroutine flag set
; end music stream
@@ -1465,7 +1445,6 @@ Music_EndChannel:
ld [hl], d
ret
-
Music_CallChannel:
; call music stream (subroutine)
; parameters: ll hh ; pointer to subroutine
@@ -1499,7 +1478,6 @@ Music_CallChannel:
set SOUND_SUBROUTINE, [hl]
ret
-
Music_JumpChannel:
; jump
; parameters: ll hh ; pointer
@@ -1515,7 +1493,6 @@ Music_JumpChannel:
ld [hl], d
ret
-
Music_LoopChannel:
; loops xx - 1 times
; 00: infinite
@@ -1577,7 +1554,6 @@ Music_LoopChannel:
ld [hl], e
ret
-
Music_SetCondition:
; set condition for a jump
; used with FB
@@ -1591,7 +1567,6 @@ Music_SetCondition:
ld [hl], a
ret
-
Music_JumpIf:
; conditional jump
; used with FA
@@ -1638,7 +1613,6 @@ Music_JumpIf:
ld [hl], d
ret
-
MusicEE
; conditional jump
; checks a byte in ram corresponding to the current channel
@@ -1691,7 +1665,6 @@ MusicEE
ld [hl], d
ret
-
MusicF9:
; sets some flag
; seems to be unused
@@ -1700,7 +1673,6 @@ MusicF9:
ld [wc2b5], a
ret
-
MusicE2:
; seems to have been dummied out
; params: 1
@@ -1713,7 +1685,6 @@ MusicE2:
set SOUND_UNKN_0B, [hl]
ret
-
Music_Vibrato:
; vibrato
; params: 2
@@ -1769,7 +1740,6 @@ Music_Vibrato:
ld [hl], a
ret
-
Music_SlidePitchTo:
; set the target for pitch wheel
; params: 2
@@ -1801,7 +1771,6 @@ Music_SlidePitchTo:
set SOUND_PITCH_WHEEL, [hl]
ret
-
Music_Tone:
; tone
; params: 1 (dw)
@@ -1816,7 +1785,6 @@ Music_Tone:
ld [hl], a
ret
-
MusicE7:
; unused
; params: 1
@@ -1829,7 +1797,6 @@ MusicE7:
ld [hl], a
ret
-
Music_SoundDuty:
; sequence of 4 duty cycles to be looped
; params: 1 (4 2-bit duty cycle arguments)
@@ -1850,7 +1817,6 @@ Music_SoundDuty:
ld [hl], a
ret
-
MusicE8:
; unused
; params: 1
@@ -1863,7 +1829,6 @@ MusicE8:
ld [hl], a
ret
-
Music_ToggleSFX:
; toggle something
; params: none
@@ -1878,7 +1843,6 @@ Music_ToggleSFX:
set SOUND_SFX, [hl]
ret
-
Music_ToggleNoise:
; toggle music noise sampling
; can't be used as a straight toggle since the param is not read from on->off
@@ -1901,7 +1865,6 @@ Music_ToggleNoise:
ld [wMusicNoiseSampleSet], a
ret
-
Music_SFXToggleNoise:
; toggle sfx noise sampling
; params:
@@ -1923,7 +1886,6 @@ Music_SFXToggleNoise:
ld [wSFXNoiseSampleSet], a
ret
-
Music_NoteType:
; note length
; # frames per 16th note
@@ -1942,7 +1904,6 @@ Music_NoteType:
call Music_Intensity
ret
-
Music_SoundStatus:
; update sound status
; params: 1
@@ -1953,7 +1914,6 @@ Music_SoundStatus:
set NOTE_UNKN_3, [hl]
ret
-
Music_DutyCycle:
; duty cycle
; params: 1
@@ -1966,7 +1926,6 @@ Music_DutyCycle:
ld [hl], a
ret
-
Music_Intensity:
; intensity
; params: 1
@@ -1978,7 +1937,6 @@ Music_Intensity:
ld [hl], a
ret
-
Music_Tempo:
; global tempo
; params: 2
@@ -1990,7 +1948,6 @@ Music_Tempo:
call SetGlobalTempo
ret
-
Music_Octave8:
Music_Octave7:
Music_Octave6:
@@ -2007,7 +1964,6 @@ Music_Octave1:
ld [hl], a
ret
-
Music_ForceOctave:
; set starting octave
; this forces all notes up by the starting octave
@@ -2018,7 +1974,6 @@ Music_ForceOctave:
ld [hl], a
ret
-
Music_StereoPanning:
; stereo panning
; params: 1
@@ -2030,7 +1985,6 @@ Music_StereoPanning:
call GetMusicByte
ret
-
Music_Panning:
; force panning
; params: 1
@@ -2042,7 +1996,6 @@ Music_Panning:
ld [hl], a
ret
-
Music_Volume:
; set volume
; params: 1
@@ -2059,7 +2012,6 @@ Music_Volume:
ld [wVolume], a
ret
-
Music_TempoRelative:
; set global tempo to current channel tempo +/- param
; params: 1 signed
@@ -2086,7 +2038,6 @@ Music_TempoRelative:
call SetGlobalTempo
ret
-
Music_SFXPriorityOn:
; turn sfx priority on
; params: none
@@ -2094,7 +2045,6 @@ Music_SFXPriorityOn:
ld [wSFXPriority], a
ret
-
Music_SFXPriorityOff:
; turn sfx priority off
; params: none
@@ -2102,7 +2052,6 @@ Music_SFXPriorityOff:
ld [wSFXPriority], a
ret
-
Music_RestartChannel:
; restart current channel from channel header (same bank)
; params: 2 (5)
@@ -2137,7 +2086,6 @@ Music_RestartChannel:
pop bc ; restore current channel
ret
-
Music_NewSong:
; new song
; params: 2
@@ -2151,7 +2099,6 @@ Music_NewSong:
pop bc
ret
-
GetMusicByte:
; returns byte from current address in a
; advances to next byte in music data
@@ -2184,7 +2131,6 @@ GetMusicByte:
ld a, [wCurMusicByte]
ret
-
GetFrequency:
; generate frequency
; input:
@@ -2237,7 +2183,6 @@ GetFrequency:
ld d, a
ret
-
SetNoteDuration:
; input: a = note duration in 16ths
; store delay units in de
@@ -2277,7 +2222,6 @@ SetNoteDuration:
ld [hl], d
ret
-
.Multiply:
; multiplies a and de
; adds the result to l
@@ -2299,7 +2243,6 @@ SetNoteDuration:
jr nz, .loop
ret
-
SetGlobalTempo:
push bc ; save current channel
; are we dealing with music or sfx?
@@ -2329,7 +2272,6 @@ SetGlobalTempo:
pop bc ; restore current channel
ret
-
Tempo:
; input:
; de: note length
@@ -2346,7 +2288,6 @@ Tempo:
ld [hl], a
ret
-
StartChannel:
call SetLRTracks
ld hl, CHANNEL_FLAGS1
@@ -2354,7 +2295,6 @@ StartChannel:
set SOUND_CHANNEL_ON, [hl] ; turn channel on
ret
-
SetLRTracks:
; set tracks for a the current channel to default
; seems to be redundant since this is overwritten by stereo data later
@@ -2375,7 +2315,6 @@ SetLRTracks:
pop de
ret
-
_PlayMusic::
; load music
call MusicOff
@@ -2418,7 +2357,6 @@ _PlayMusic::
call MusicOn
ret
-
_PlayCry::
; Play cry de using parameters:
; wCryPitch
@@ -2530,7 +2468,6 @@ _PlayCry::
call MusicOn
ret
-
_PlaySFX::
; clear channels if they aren't already
call MusicOff
@@ -2630,7 +2567,6 @@ _PlaySFX::
ld [wSFXPriority], a
ret
-
PlayStereoSFX::
; play sfx de
@@ -2732,7 +2668,6 @@ PlayStereoSFX::
call MusicOn
ret
-
LoadChannel:
; prep channel for use
; input:
@@ -2777,7 +2712,6 @@ LoadChannel:
ld [hl], a
ret
-
ChannelInit:
; make sure channel is cleared
; set default tempo and note length in case nothing is loaded
@@ -2808,7 +2742,6 @@ ChannelInit:
pop de
ret
-
LoadMusicByte::
; input:
; de = current music address
@@ -2820,14 +2753,12 @@ LoadMusicByte::
ret
-
INCLUDE "audio/notes.asm"
INCLUDE "audio/wave_samples.asm"
INCLUDE "audio/drumkits.asm"
-
GetLRTracks:
; gets the default sound l/r channels
; stores mono/stereo table in hl
@@ -2842,7 +2773,6 @@ GetLRTracks:
ld hl, StereoTracks
ret
-
MonoTracks:
; bit corresponds to track #
; hi: left channel
@@ -2883,7 +2813,6 @@ ClearChannels::
jr nz, .loop
ret
-
ClearChannel:
; input: hl = beginning hw sound register (rNR10, rNR20, rNR30, rNR40)
; output: 00 00 80 00 80
@@ -2901,7 +2830,6 @@ ClearChannel:
ld [hli], a ; rNR14, rNR24, rNR34, rNR44 ; restart sound (freq hi = 0)
ret
-
PlayTrainerEncounterMusic::
; input: e = trainer type
; turn fade off