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
PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11
NAME_LENGTH EQU 11
; boxes
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
xor a
ld [CurMusic], a
ld [wMapMusic], a
jp GameInit
; 245

View File

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

View File

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

View File

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

View File

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