Comment music functions in home.asm.

This commit is contained in:
yenatch 2014-05-21 16:21:46 -04:00
parent 93f406e8b4
commit 2cb3f8e1b9
8 changed files with 407 additions and 386 deletions

View File

@ -2,6 +2,7 @@
; name length ; name length
PLAYER_NAME_LENGTH EQU 8 PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11 PKMN_NAME_LENGTH EQU 11
NAME_LENGTH EQU 11
; boxes ; boxes
NUM_BOXES EQU 14 NUM_BOXES EQU 14

File diff suppressed because it is too large Load Diff

302
home.asm

File diff suppressed because it is too large Load Diff

View File

@ -172,7 +172,7 @@ Init:: ; 17d
call SoundRestart call SoundRestart
xor a xor a
ld [CurMusic], a ld [wMapMusic], a
jp GameInit jp GameInit
; 245 ; 245

View File

@ -1034,7 +1034,7 @@ Function2653:: ; 2653
; 2674 ; 2674
Function2674:: ; 2674 Function2674:: ; 2674
callba Unknown_0x974f3 callba Function974f3
ld a, [ScriptMode] ld a, [ScriptMode]
push af push af
ld hl, ScriptFlags ld hl, ScriptFlags
@ -2021,8 +2021,8 @@ Function2bae:: ; 2bae
callba Function8c001 callba Function8c001
call Function2173 call Function2173
call Function2821 call Function2821
ld a, $9 ld a, 9
call Function3cb4 call SkipMusic
pop af pop af
rst Bankswitch rst Bankswitch
@ -2259,48 +2259,51 @@ GetWorldMapLocation:: ; 0x2caf
ret ret
; 0x2cbd ; 0x2cbd
Function2cbd:: ; 2cbd GetMapHeaderMusic:: ; 2cbd
RADIO_TOWER_MUSIC EQU 7
push hl push hl
push bc push bc
ld de, $0006 ld de, 6 ; music
call GetMapHeaderMember call GetMapHeaderMember
ld a, c ld a, c
cp $64 cp MUSIC_MAHOGANY_MART
jr z, .asm_2cee jr z, .mahoganymart
bit 7, c bit RADIO_TOWER_MUSIC, c
jr nz, .asm_2cda jr nz, .radiotower
callba Function8b342 callba Function8b342
ld e, c ld e, c
ld d, $0 ld d, 0
.asm_2cd7 .done
pop bc pop bc
pop hl pop hl
ret ret
.asm_2cda .radiotower
ld a, [StatusFlags2] ld a, [StatusFlags2]
bit 0, a bit 0, a
jr z, .asm_2ce6 jr z, .clearedradiotower
ld de, $0056 ld de, MUSIC_ROCKET_OVERTURE
jr .asm_2cd7 jr .done
.asm_2ce6 .clearedradiotower
; the rest of the byte
ld a, c ld a, c
and $7f and 1 << RADIO_TOWER_MUSIC - 1
ld e, a ld e, a
ld d, $0 ld d, 0
jr .asm_2cd7 jr .done
.asm_2cee .mahoganymart
ld a, [StatusFlags2] ld a, [StatusFlags2]
bit 7, a bit 7, a
jr z, .asm_2cfa jr z, .clearedmahogany
ld de, $0048 ld de, MUSIC_ROCKET_HIDEOUT
jr .asm_2cd7 jr .done
.asm_2cfa .clearedmahogany
ld de, $0026 ld de, MUSIC_CHERRYGROVE_CITY
jr .asm_2cd7 jr .done
; 2cff ; 2cff
Function2cff:: ; 2cff Function2cff:: ; 2cff

View File

@ -3747,7 +3747,7 @@ Function5ae8: ; 5ae8
call DelayFrame call DelayFrame
ld de, MUSIC_MAIN_MENU ld de, MUSIC_MAIN_MENU
ld a, e ld a, e
ld [CurMusic], a ld [wMapMusic], a
call PlayMusic call PlayMusic
callba MainMenu callba MainMenu
jp Function6219 jp Function6219
@ -7940,8 +7940,8 @@ SpecialsPointers: ; c029
dbw BANK(Functionc230), Functionc230 dbw BANK(Functionc230), Functionc230
dbw BANK(SpecialSeenMon), SpecialSeenMon dbw BANK(SpecialSeenMon), SpecialSeenMon
dbw BANK(WaitSFX),WaitSFX dbw BANK(WaitSFX),WaitSFX
dbw BANK(Function3cdf), Function3cdf dbw BANK(PlayMapMusic), PlayMapMusic
dbw BANK(Function3d47), Function3d47 dbw BANK(RestartMapMusic), RestartMapMusic
dbw BANK(Function12324), Function12324 dbw BANK(Function12324), Function12324
dbw BANK(Function8379), Function8379 dbw BANK(Function8379), Function8379
dbw BANK(Functionc25a), Functionc25a dbw BANK(Functionc25a), Functionc25a
@ -8402,7 +8402,7 @@ SpecialSnorlaxAwake: ; 0xc43d
; ScriptVar is 1 if the conditions are met, otherwise 0. ; ScriptVar is 1 if the conditions are met, otherwise 0.
; check background music ; check background music
ld a, [CurMusic] ld a, [wMapMusic]
cp MUSIC_POKE_FLUTE_CHANNEL cp MUSIC_POKE_FLUTE_CHANNEL
jr nz, .nope jr nz, .nope
@ -10774,7 +10774,7 @@ Functiond0bc: ; d0bc
call MaxVolume call MaxVolume
ld de, MUSIC_BICYCLE ld de, MUSIC_BICYCLE
ld a, e ld a, e
ld [CurMusic], a ld [wMapMusic], a
call PlayMusic call PlayMusic
ld a, $1 ld a, $1
ret ret
@ -23072,6 +23072,8 @@ AddSpriteGFX: ; 142e5
LoadSpriteGFX: ; 14306 LoadSpriteGFX: ; 14306
; Bug: b is not preserved, so
; it's useless as a loop count.
ld hl, UsedSprites ld hl, UsedSprites
ld b, $20 ld b, $20
@ -25882,11 +25884,11 @@ MapSetupCommands: ; 15440
dbw BANK(EnableLCD), EnableLCD dbw BANK(EnableLCD), EnableLCD
dbw BANK(DisableLCD), DisableLCD dbw BANK(DisableLCD), DisableLCD
dbw BANK(SoundRestart), SoundRestart dbw BANK(SoundRestart), SoundRestart
dbw BANK(Function3cdf), Function3cdf dbw BANK(PlayMapMusic), PlayMapMusic
dbw BANK(Function3d47), Function3d47 dbw BANK(RestartMapMusic), RestartMapMusic
dbw BANK(Function3cbc), Function3cbc dbw BANK(FadeToMapMusic), FadeToMapMusic
dbw BANK(Function15574), Function15574 dbw BANK(Function15574), Function15574
dbw BANK(Function3d03), Function3d03 dbw BANK(EnterMapMusic), EnterMapMusic
dbw BANK(Function15587), Function15587 dbw BANK(Function15587), Function15587
dbw BANK(Function3cae), Function3cae dbw BANK(Function3cae), Function3cae
dbw BANK(Function24cd), Function24cd dbw BANK(Function24cd), Function24cd
@ -26045,8 +26047,8 @@ Function1554e: ; 1554e (5:554e)
; 15567 ; 15567
Function15567: ; 15567 Function15567: ; 15567
ld a, $6 ld a, 6
call Function3cb4 call SkipMusic
ret ret
; 1556d ; 1556d
@ -29488,12 +29490,12 @@ Function16be4: ; 16be4
ld de, UnownDexATile ld de, UnownDexATile
ld hl, $8ef0 ld hl, $8ef0
ld bc, $0501 lb bc, BANK(UnownDexBTile), 1
call Request1bpp call Request1bpp
ld de, UnownDexBTile ld de, UnownDexBTile
ld hl, $8f50 ld hl, $8f50
ld bc, $0501 lb bc, BANK(UnownDexBTile), 1
call Request1bpp call Request1bpp
ld hl, TileMap ld hl, TileMap
@ -29554,7 +29556,7 @@ Function16be4: ; 16be4
ld a, [$cf63] ld a, [$cf63]
push af push af
callba Function84560 callba Function84560
call Function3d47 call RestartMapMusic
pop af pop af
ld [$cf63], a ld [$cf63], a
jr .asm_16c6b jr .asm_16c6b
@ -29969,7 +29971,7 @@ Function16f5e:: ; 16f5e
call Function1d6e call Function1d6e
call Function16f70 call Function16f70
call Function2b4d call Function2b4d
call Function3d47 call RestartMapMusic
jp Function2dcf jp Function2dcf
; 16f70 ; 16f70
@ -40609,7 +40611,7 @@ Function2a111: ; 2a111
Function2a124:: ; 2a124 Function2a124:: ; 2a124
; Pokemon March and Ruins of Alph signal double encounter rate. ; Pokemon March and Ruins of Alph signal double encounter rate.
; Pokemon Lullaby halves encounter rate. ; Pokemon Lullaby halves encounter rate.
ld a, [CurMusic] ld a, [wMapMusic]
cp MUSIC_POKEMON_MARCH cp MUSIC_POKEMON_MARCH
jr z, .asm_2a135 jr z, .asm_2a135
cp MUSIC_RUINS_OF_ALPH_RADIO cp MUSIC_RUINS_OF_ALPH_RADIO
@ -47388,8 +47390,8 @@ Function414b7: ; 414b7
ld hl, PokedexSlowpokeLZ ld hl, PokedexSlowpokeLZ
ld de, VTiles0 ld de, VTiles0
call Decompress call Decompress
ld a, $6 ld a, 6
call Function3cb4 call SkipMusic
call EnableLCD call EnableLCD
ret ret
@ -47893,7 +47895,7 @@ Function423ff: ; 423ff
ret nz ret nz
ld a, [$d268] ld a, [$d268]
and a and a
call nz, Function3d47 call nz, RestartMapMusic
ret ret
; 42414 ; 42414
@ -52964,7 +52966,7 @@ MainMenu_MysteryGift: ; 49ef5
MainMenu_Mobile: ; 49efc MainMenu_Mobile: ; 49efc
call WhiteBGMap call WhiteBGMap
ld a, MUSIC_MOBILE_ADAPTER_MENU ld a, MUSIC_MOBILE_ADAPTER_MENU
ld [CurMusic], a ld [wMapMusic], a
ld de, MUSIC_MOBILE_ADAPTER_MENU ld de, MUSIC_MOBILE_ADAPTER_MENU
call Function4a6c5 call Function4a6c5
Function49f0a: ; 49f0a Function49f0a: ; 49f0a
@ -53031,7 +53033,7 @@ Function49f16: ; 49f16
call WhiteBGMap call WhiteBGMap
call ClearTileMap call ClearTileMap
ld a, MUSIC_MAIN_MENU ld a, MUSIC_MAIN_MENU
ld [CurMusic], a ld [wMapMusic], a
ld de, MUSIC_MAIN_MENU ld de, MUSIC_MAIN_MENU
call Function4a6c5 call Function4a6c5
ret ret
@ -57194,7 +57196,7 @@ Function4ddd6: ; 4ddd6 (13:5dd6)
; no known jump sources ; no known jump sources
Function4dde6: ; 4dde6 (13:5de6) Function4dde6: ; 4dde6 (13:5de6)
call Function3c74 call IsSFXPlaying
ret nc ret nc
ld a, [$cf63] ld a, [$cf63]
inc a inc a
@ -62432,7 +62434,7 @@ TryStep: ; 8016b
call CheckLandPermissions call CheckLandPermissions
jr c, .asm_801be jr c, .asm_801be
call Function80341 call IsNPCInFront
and a and a
jr z, .asm_801be jr z, .asm_801be
cp 2 cp 2
@ -62493,7 +62495,7 @@ TrySurfStep: ; 801c0
ld [$d040], a ld [$d040], a
jr c, .asm_801f1 jr c, .asm_801f1
call Function80341 call IsNPCInFront
ld [$d03f], a ld [$d03f], a
and a and a
jr z, .asm_801f1 jr z, .asm_801f1
@ -62511,7 +62513,7 @@ TrySurfStep: ; 801c0
.ExitWater .ExitWater
call WaterToLandSprite call WaterToLandSprite
call Function3cdf ; PlayMapMusic call PlayMapMusic
ld a, STEP_WALK ld a, STEP_WALK
call DoStep call DoStep
ld a, 6 ld a, 6
@ -62773,7 +62775,7 @@ GetMovementAction: ; 802ec
; 80341 ; 80341
Function80341: ; 80341 IsNPCInFront: ; 80341
ld a, 0 ld a, 0
ld [hConnectionStripLength], a ld [hConnectionStripLength], a
@ -65883,7 +65885,7 @@ Function8474c: ; 8474c
; 84753 ; 84753
Function84753: ; 84753 Function84753: ; 84753
call Function3d47 call RestartMapMusic
ret ret
; 84757 ; 84757
@ -69841,7 +69843,7 @@ Function89d0d: ; 89d0d (22:5d0d)
call Function89240 call Function89240
ld c, $18 ld c, $18
call DelayFrames call DelayFrames
call Function3d47 call RestartMapMusic
ret ret
; 89d4e (22:5d4e) ; 89d4e (22:5d4e)
@ -81610,8 +81612,8 @@ Function90bea: ; 90bea (24:4bea)
call Function90c4e call Function90c4e
callba Function8cf53 callba Function8cf53
call Function90d32 call Function90d32
ld a, $8 ld a, 8
call Function3cb4 call SkipMusic
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
call Function90d70 call Function90d70
@ -82923,13 +82925,13 @@ Function91492: ; 91492
cp $fe cp $fe
jr z, .asm_914a3 jr z, .asm_914a3
cp $ff cp $ff
call z, Function3d03 call z, EnterMapMusic
xor a xor a
ld [$c6dc], a ld [$c6dc], a
ret ret
.asm_914a3 .asm_914a3
call Function3d47 call RestartMapMusic
xor a xor a
ld [$c6dc], a ld [$c6dc], a
ret ret
@ -83359,7 +83361,7 @@ Function91854: ; 91854 (24:5854)
call PlayMusic call PlayMusic
pop de pop de
ld a, e ld a, e
ld [CurMusic], a ; $c2c0 ld [wMapMusic], a
call PlayMusic call PlayMusic
ret ret
@ -83446,8 +83448,8 @@ Function9191c: ; 9191c
call DisableLCD call DisableLCD
call Function90c4e call Function90c4e
callba Function8cf53 callba Function8cf53
ld a, $8 ld a, 8
call Function3cb4 call SkipMusic
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
call Function90d56 call Function90d56
@ -96955,8 +96957,8 @@ Functione33e8: ; e33e8 (38:73e8)
ld hl, PCSelectLZ ld hl, PCSelectLZ
ld de, $8000 ld de, $8000
call Decompress call Decompress
ld a, $6 ld a, 6
call Function3cb4 call SkipMusic
call EnableLCD call EnableLCD
ret ret
; e3419 (38:7419) ; e3419 (38:7419)
@ -97617,7 +97619,7 @@ Options_Sound: ; e43dd
.SetMono .SetMono
res 5, [hl] res 5, [hl]
call Function3d47 ;reload the music call RestartMapMusic
.ToggleMono .ToggleMono
ld de, .Mono ld de, .Mono
@ -97625,7 +97627,7 @@ Options_Sound: ; e43dd
.SetStereo .SetStereo
set 5, [hl] set 5, [hl]
call Function3d47 ;reload the music call RestartMapMusic
.ToggleStereo .ToggleStereo
ld de, .Stereo ld de, .Stereo
@ -101561,7 +101563,7 @@ NPCTrade:: ; fcba8
ld hl, TradedForText ld hl, TradedForText
call PrintText call PrintText
call Function3d47 call RestartMapMusic
ld a, TRADE_COMPLETE ld a, TRADE_COMPLETE
@ -112685,7 +112687,7 @@ Function11b7e5: ; 11b7e5
.asm_11b872 .asm_11b872
call Function2b3c call Function2b3c
call Function3d47 call RestartMapMusic
ret ret
; 11b879 ; 11b879
@ -117747,7 +117749,7 @@ Function17d2ce: ; 17d2ce
ld [rSVBK], a ld [rSVBK], a
ld de, MUSIC_MOBILE_CENTER ld de, MUSIC_MOBILE_CENTER
ld a, e ld a, e
ld [CurMusic], a ld [wMapMusic], a
ld [MusicFadeIDLo], a ld [MusicFadeIDLo], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeIDHi], a
@ -119158,7 +119160,7 @@ Function17ff23: ; 17ff23
ret z ret z
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, [CurMusic] ld a, [wMapMusic]
ld [MusicFadeIDLo], a ld [MusicFadeIDLo], a
xor a xor a
ld [MusicFadeIDHi], a ld [MusicFadeIDHi], a

View File

@ -257,7 +257,7 @@ Function17a7ff: ; 17a7ff (5e:67ff)
; no known jump sources ; no known jump sources
Function17a81a: ; 17a81a (5e:681a) Function17a81a: ; 17a81a (5e:681a)
call Function3c74 call IsSFXPlaying
ret nc ret nc
ld a, [hJoyPressed] ; $ff00+$a7 ld a, [hJoyPressed] ; $ff00+$a7
and $3 and $3

View File

@ -365,8 +365,7 @@ CryTracks:: ; c2bd
CurSFX:: ; c2bf CurSFX:: ; c2bf
; id of sfx currently playing ; id of sfx currently playing
ds 1 ds 1
CurMusic:: ; c2c0 wMapMusic:: ; c2c0
; id of music currently playing
ds 1 ds 1
SECTION "auto",WRAM0[$c2c7] SECTION "auto",WRAM0[$c2c7]