Merge commit '946a213f' into merge-mrwint

This commit is contained in:
yenatch 2013-10-25 17:54:04 -04:00
commit 52a6b7da8e
4 changed files with 28 additions and 29 deletions

View File

@ -3,12 +3,11 @@
; Interfaces are in bank 0. ; Interfaces are in bank 0.
; Notable functions: ; Notable functions:
; UpdateSound (called during VBlank)
; FadeMusic ; FadeMusic
; PlayStereoSFX ; PlayStereoSFX
; PlayCry ; PlayCry
SoundRestart: ; e8000 _SoundRestart: ; e8000
; restart sound operation ; restart sound operation
; clear all relevant hardware registers & wram ; clear all relevant hardware registers & wram
push hl push hl
@ -65,7 +64,7 @@ MusicFadeRestart: ; e803d
push af push af
ld a, [MusicFadeIDLo] ld a, [MusicFadeIDLo]
push af push af
call SoundRestart call _SoundRestart
pop af pop af
ld [MusicFadeIDLo], a ld [MusicFadeIDLo], a
pop af pop af
@ -85,7 +84,7 @@ MusicOff: ; e8057
ret ret
; e805c ; e805c
UpdateSound: ; e805c _UpdateSound: ; e805c
; called once per frame ; called once per frame
; no use updating audio if it's not playing ; no use updating audio if it's not playing
ld a, [MusicPlaying] ld a, [MusicPlaying]

View File

@ -1,6 +1,6 @@
Reset: ; 150 Reset: ; 150
di di
call CleanSoundRestart call SoundRestart
xor a xor a
ld [$ffde], a ld [$ffde], a
call ClearPalettes call ClearPalettes
@ -170,7 +170,7 @@ Init: ; 17d
ld a, $30 ld a, $30
call Predef call Predef
call CleanSoundRestart call SoundRestart
xor a xor a
ld [CurMusic], a ld [CurMusic], a
jp GameInit jp GameInit

View File

@ -167,9 +167,9 @@ VBlank0: ; 2b1
call Joypad call Joypad
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
ld a, [$ff8a] ld a, [$ff8a]
rst Bankswitch ; restore bank rst Bankswitch ; restore bank
@ -189,9 +189,9 @@ VBlank2: ; 325
ld [$ff8a], a ld [$ff8a], a
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
; restore bank ; restore bank
ld a, [$ff8a] ld a, [$ff8a]
@ -265,9 +265,9 @@ VBlank1: ; 337
ei ei
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
; restore bank ; restore bank
ld a, [$ff8a] ld a, [$ff8a]
rst Bankswitch rst Bankswitch
@ -369,9 +369,9 @@ VBlank3: ; 396
ei ei
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
; restore bank ; restore bank
ld a, [$ff8a] ld a, [$ff8a]
rst Bankswitch rst Bankswitch
@ -434,9 +434,9 @@ VBlank4: ; 3df
call AskSerial call AskSerial
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
; restore bank ; restore bank
ld a, [$ff8a] ld a, [$ff8a]
rst Bankswitch rst Bankswitch
@ -486,9 +486,9 @@ VBlank5: ; 400
ei ei
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
; restore bank ; restore bank
ld a, [$ff8a] ld a, [$ff8a]
rst Bankswitch rst Bankswitch
@ -531,9 +531,9 @@ VBlank6: ; 436
ld [VBlankOccurred], a ld [VBlankOccurred], a
; update sound ; update sound
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch ; bankswitch
call UpdateSound call _UpdateSound
; restore bank ; restore bank
ld a, [$ff8a] ld a, [$ff8a]
rst Bankswitch rst Bankswitch

View File

@ -2975,7 +2975,7 @@ Function3b3c: ; 3b3c
; 3b4e ; 3b4e
CleanSoundRestart: ; 3b4e SoundRestart: ; 3b4e
push hl push hl
push de push de
@ -2984,11 +2984,11 @@ CleanSoundRestart: ; 3b4e
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(SoundRestart) ld a, BANK(_SoundRestart)
ld [hROMBank], a ld [hROMBank], a
ld [MBC3RomBank], a ld [MBC3RomBank], a
call SoundRestart call _SoundRestart
pop af pop af
ld [hROMBank], a ld [hROMBank], a
@ -3002,7 +3002,7 @@ CleanSoundRestart: ; 3b4e
; 3b6a ; 3b6a
CleanUpdateSound: ; 3b6a UpdateSound: ; 3b6a
push hl push hl
push de push de
@ -3011,11 +3011,11 @@ CleanUpdateSound: ; 3b6a
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(UpdateSound) ld a, BANK(_UpdateSound)
ld [hROMBank], a ld [hROMBank], a
ld [MBC3RomBank], a ld [MBC3RomBank], a
call UpdateSound call _UpdateSound
pop af pop af
ld [hROMBank], a ld [hROMBank], a
@ -3055,7 +3055,7 @@ PlayMusic: ; 3b97
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(_PlayMusic) ; and BANK(SoundRestart) ld a, BANK(_PlayMusic) ; and BANK(_SoundRestart)
ld [hROMBank], a ld [hROMBank], a
ld [MBC3RomBank], a ld [MBC3RomBank], a
@ -3067,7 +3067,7 @@ PlayMusic: ; 3b97
jr .end jr .end
.nomusic .nomusic
call SoundRestart call _SoundRestart
.end .end
pop af pop af
@ -3306,7 +3306,7 @@ Function3cb4: ; 3cb4
and a and a
ret z ret z
dec a dec a
call CleanUpdateSound call UpdateSound
jr .asm_3cb4 jr .asm_3cb4
; 3cbc ; 3cbc