summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2016-06-12 02:34:42 -0500
committerdannye <corrnondacqb@yahoo.com>2016-06-12 02:34:42 -0500
commit42f99e9aff80a4c8d47c17f6dda2494e1bd6f7d9 (patch)
treeb2cb959094a6574f20b72fce2d03207b0f56c0c3 /audio
parent9a5b7f5d19e84eb1caab7ecddaa0f157ebae5594 (diff)
parenta51037eeeedb03e29d8675626018cf02750882fa (diff)
Merge branch 'master' of https://github.com/pret/pokered into merge-pokered
Diffstat (limited to 'audio')
-rw-r--r--audio/engine_1.asm54
-rw-r--r--audio/headers/musicheaders2.asm2
2 files changed, 27 insertions, 29 deletions
diff --git a/audio/engine_1.asm b/audio/engine_1.asm
index 51522634..4faf06cf 100644
--- a/audio/engine_1.asm
+++ b/audio/engine_1.asm
@@ -169,7 +169,7 @@ Audio1_PlayNextNote:
call Audio1_endchannel
ret
-Audio1_endchannel: ; 0x91e6
+Audio1_endchannel:
call Audio1_GetNextMusicByte
ld d, a
cp $ff ; is this command an endchannel?
@@ -259,7 +259,7 @@ Audio1_endchannel: ; 0x91e6
ld [hl], b
ret
-Audio1_callchannel: ; 0x9274
+Audio1_callchannel:
cp $fd ; is this command a callchannel?
jp nz, Audio1_loopchannel ; no
call Audio1_GetNextMusicByte
@@ -296,7 +296,7 @@ Audio1_callchannel: ; 0x9274
set BIT_CHANNEL_CALL, [hl] ; set the call flag
jp Audio1_endchannel
-Audio1_loopchannel: ; 0x92a9
+Audio1_loopchannel:
cp $fe ; is this command a loopchannel?
jp nz, Audio1_notetype ; no
call Audio1_GetNextMusicByte
@@ -334,7 +334,7 @@ Audio1_loopchannel: ; 0x92a9
ld [hl], b
jp Audio1_endchannel
-Audio1_notetype: ; 0x92e4
+Audio1_notetype:
and $f0
cp $d0 ; is this command a notetype?
jp nz, Audio1_toggleperfectpitch ; no
@@ -378,7 +378,7 @@ Audio1_notetype: ; 0x92e4
.noiseChannel
jp Audio1_endchannel
-Audio1_toggleperfectpitch: ; 0x9323
+Audio1_toggleperfectpitch:
ld a, d
cp $e8 ; is this command a toggleperfectpitch?
jr nz, Audio1_vibrato ; no
@@ -390,7 +390,7 @@ Audio1_toggleperfectpitch: ; 0x9323
ld [hl], a ; flip bit 0 of wChannelFlags1
jp Audio1_endchannel
-Audio1_vibrato: ; 0x9335
+Audio1_vibrato:
cp $ea ; is this command a vibrato?
jr nz, Audio1_pitchbend ; no
call Audio1_GetNextMusicByte
@@ -438,7 +438,7 @@ Audio1_vibrato: ; 0x9335
jp Audio1_endchannel
-Audio1_pitchbend: ; 0x936d
+Audio1_pitchbend:
cp $eb ; is this command a pitchbend?
jr nz, Audio1_duty ; no
call Audio1_GetNextMusicByte
@@ -469,7 +469,7 @@ Audio1_pitchbend: ; 0x936d
ld d, a
jp Audio1_notelength
-Audio1_duty: ; 0x93a5
+Audio1_duty:
cp $ec ; is this command a duty?
jr nz, Audio1_tempo ; no
call Audio1_GetNextMusicByte
@@ -482,7 +482,7 @@ Audio1_duty: ; 0x93a5
ld [hl], a ; store duty
jp Audio1_endchannel
-Audio1_tempo: ; 0x93ba
+Audio1_tempo:
cp $ed ; is this command a tempo?
jr nz, Audio1_stereopanning ; no
ld a, c
@@ -511,7 +511,7 @@ Audio1_tempo: ; 0x93ba
.musicChannelDone
jp Audio1_endchannel
-Audio1_stereopanning: ; 0x93fa
+Audio1_stereopanning:
cp $ee ; is this command a stereopanning?
jr nz, Audio1_unknownmusic0xef ; no
call Audio1_GetNextMusicByte
@@ -519,7 +519,7 @@ Audio1_stereopanning: ; 0x93fa
jp Audio1_endchannel
; this appears to never be used
-Audio1_unknownmusic0xef: ; 0x9407
+Audio1_unknownmusic0xef:
cp $ef ; is this command an unknownmusic0xef?
jr nz, Audio1_dutycycle ; no
call Audio1_GetNextMusicByte
@@ -537,7 +537,7 @@ Audio1_unknownmusic0xef: ; 0x9407
.skip
jp Audio1_endchannel
-Audio1_dutycycle: ; 0x9426
+Audio1_dutycycle:
cp $fc ; is this command a dutycycle?
jr nz, Audio1_volume ; no
call Audio1_GetNextMusicByte
@@ -554,14 +554,14 @@ Audio1_dutycycle: ; 0x9426
set BIT_ROTATE_DUTY, [hl]
jp Audio1_endchannel
-Audio1_volume: ; 0x9444
+Audio1_volume:
cp $f0 ; is this command a volume?
jr nz, Audio1_executemusic ; no
call Audio1_GetNextMusicByte
ld [rNR50], a ; store volume
jp Audio1_endchannel
-Audio1_executemusic: ; 0x9450
+Audio1_executemusic:
cp $f8 ; is this command an executemusic?
jr nz, Audio1_octave ; no
ld b, $0
@@ -570,7 +570,7 @@ Audio1_executemusic: ; 0x9450
set BIT_EXECUTE_MUSIC, [hl]
jp Audio1_endchannel
-Audio1_octave: ; 0x945f
+Audio1_octave:
and $f0
cp $e0 ; is this command an octave?
jr nz, Audio1_unknownsfx0x20 ; no
@@ -582,7 +582,7 @@ Audio1_octave: ; 0x945f
ld [hl], a ; store low nibble as octave
jp Audio1_endchannel
-Audio1_unknownsfx0x20: ; 0x9472
+Audio1_unknownsfx0x20:
cp $20 ; is this command an unknownsfx0x20?
jr nz, Audio1_unknownsfx0x10
ld a, c
@@ -686,7 +686,7 @@ asm_94fd
pop bc
pop de
-Audio1_notelength: ; 0x950a
+Audio1_notelength:
ld a, d
push af
and $f
@@ -744,7 +744,7 @@ Audio1_notelength: ; 0x950a
pop hl
ret
-Audio1_notepitch: ; 0x9568
+Audio1_notepitch:
pop af
and $f0
cp $c0 ; compare to rest
@@ -876,7 +876,7 @@ Audio1_EnableChannelOutput:
ld [rNR51], a
ret
-Audio1_ApplyDutyAndSoundLength: ; 0x9629
+Audio1_ApplyDutyAndSoundLength:
ld b, 0
ld hl, wChannelNoteDelayCounters ; use the note delay as sound length
add hl, bc
@@ -901,7 +901,7 @@ Audio1_ApplyDutyAndSoundLength: ; 0x9629
ld [hl], d
ret
-Audio1_ApplyWavePatternAndFrequency: ; 0x964b
+Audio1_ApplyWavePatternAndFrequency:
ld a, c
cp CH2
jr z, .channel3
@@ -1071,7 +1071,7 @@ Audio1_96c3:
scf
ret
-Audio1_ApplyPitchBend: ; 0x96f9
+Audio1_ApplyPitchBend:
ld hl, wChannelFlags1
add hl, bc
bit BIT_PITCH_BEND_DECREASING, [hl]
@@ -1175,7 +1175,7 @@ Audio1_ApplyPitchBend: ; 0x96f9
res BIT_PITCH_BEND_DECREASING, [hl]
ret
-Audio1_InitPitchBendVars: ; 0x978f
+Audio1_InitPitchBendVars:
ld hl, wChannelPitchBendCurrentFrequencyHighBytes
add hl, bc
ld [hl], d
@@ -1274,7 +1274,7 @@ Audio1_InitPitchBendVars: ; 0x978f
ld [hl], a ; store remainder - dividend
ret
-Audio1_ApplyDutyCycle: ; 0x980d
+Audio1_ApplyDutyCycle:
ld b, 0
ld hl, wChannelDutyCycles
add hl, bc
@@ -1292,11 +1292,11 @@ Audio1_ApplyDutyCycle: ; 0x980d
ld [hl], a
ret
-Audio1_GetNextMusicByte: ; 0x9825
+Audio1_GetNextMusicByte:
call GetNextMusicByte
ret
-Audio1_GetRegisterPointer: ; 0x9838
+Audio1_GetRegisterPointer:
; hl = address of hardware sound register b for software channel c
ld a, c
ld hl, Audio1_HWChannelBaseAddresses
@@ -1311,7 +1311,7 @@ Audio1_GetRegisterPointer: ; 0x9838
ld h, $ff
ret
-Audio1_MultiplyAdd: ; 0x9847
+Audio1_MultiplyAdd:
; hl = l + (a * de)
ld h, 0
.loop
@@ -1327,7 +1327,7 @@ Audio1_MultiplyAdd: ; 0x9847
.done
ret
-Audio1_CalculateFrequency: ; 0x9858
+Audio1_CalculateFrequency:
; return the frequency for note a, octave b in de
ld h, 0
ld l, a
diff --git a/audio/headers/musicheaders2.asm b/audio/headers/musicheaders2.asm
index 8c128c0e..7df3f8bf 100644
--- a/audio/headers/musicheaders2.asm
+++ b/audio/headers/musicheaders2.asm
@@ -32,5 +32,3 @@ Music_DefeatedGymLeader::
dbw ( $80 | CH0 ), Music_DefeatedGymLeader_Ch1
dbw CH1, Music_DefeatedGymLeader_Ch2
dbw CH2, Music_DefeatedGymLeader_Ch3
-
-; 202fd