Merge pull request #253 from yenatch/master

Clean up music and battle interfaces in home.asm.
This commit is contained in:
Bryan Bishop
2014-05-28 19:51:41 -05:00
10 changed files with 1244 additions and 1216 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

992
home.asm

File diff suppressed because it is too large Load Diff

598
home/audio.asm Normal file

File diff suppressed because it is too large Load Diff

337
home/battle.asm Normal file
View File

@@ -0,0 +1,337 @@
UserPartyAttr:: ; 3945
push af
ld a, [hBattleTurn]
and a
jr nz, .ot
pop af
jr BattlePartyAttr
.ot
pop af
jr OTPartyAttr
; 3951
OpponentPartyAttr:: ; 3951
push af
ld a, [hBattleTurn]
and a
jr z, .ot
pop af
jr BattlePartyAttr
.ot
pop af
jr OTPartyAttr
; 395d
BattlePartyAttr:: ; 395d
; Get attribute a from the active BattleMon's party struct.
push bc
ld c, a
ld b, 0
ld hl, PartyMons
add hl, bc
ld a, [CurBattleMon]
call GetPartyLocation
pop bc
ret
; 396d
OTPartyAttr:: ; 396d
; Get attribute a from the active EnemyMon's party struct.
push bc
ld c, a
ld b, 0
ld hl, OTPartyMon1Species
add hl, bc
ld a, [CurOTMon]
call GetPartyLocation
pop bc
ret
; 397d
ResetDamage:: ; 397d
xor a
ld [CurDamage], a
ld [CurDamage + 1], a
ret
; 3985
SetPlayerTurn:: ; 3985
xor a
ld [hBattleTurn], a
ret
; 3989
SetEnemyTurn:: ; 3989
ld a, 1
ld [hBattleTurn], a
ret
; 398e
UpdateOpponentInParty:: ; 398e
ld a, [hBattleTurn]
and a
jr z, UpdateEnemyMonInParty
jr UpdateBattleMonInParty
; 3995
UpdateUserInParty:: ; 3995
ld a, [hBattleTurn]
and a
jr z, UpdateBattleMonInParty
jr UpdateEnemyMonInParty
; 399c
UpdateBattleMonInParty:: ; 399c
; Update level, status, current HP
ld a, [CurBattleMon]
Function399f:: ; 399f
ld hl, PartyMon1Level
call GetPartyLocation
ld d, h
ld e, l
ld hl, BattleMonLevel
ld bc, BattleMonMaxHP - BattleMonLevel
jp CopyBytes
; 39b0
UpdateEnemyMonInParty:: ; 39b0
; Update level, status, current HP
; No wildmons.
ld a, [IsInBattle]
dec a
ret z
ld a, [CurOTMon]
ld hl, OTPartyMon1Level
call GetPartyLocation
ld d, h
ld e, l
ld hl, EnemyMonLevel
ld bc, EnemyMonMaxHP - EnemyMonLevel
jp CopyBytes
; 39c9
RefreshBattleHuds:: ; 39c9
call UpdateBattleHuds
ld c, 3
call DelayFrames
jp WaitBGMap
; 39d4
UpdateBattleHuds:: ; 39d4
callba Function3df48
callba Function3e036
ret
; 39e1
GetBattleVar:: ; 39e1
; Preserves hl.
push hl
call _GetBattleVar
pop hl
ret
; 39e7
_GetBattleVar:: ; 39e7
; Get variable from pair a, depending on whose turn it is.
; There are 21 variable pairs.
push bc
ld hl, .battlevarpairs
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
; Enemy turn uses the second byte instead.
; This lets battle variable calls be side-neutral.
ld a, [hBattleTurn]
and a
jr z, .getvar
inc hl
.getvar
; var id
ld a, [hl]
ld c, a
ld b, 0
ld hl, .vars
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [hl]
pop bc
ret
.battlevarpairs
dw .substatus1, .substatus2, .substatus3, .substatus4, .substatus5
dw .substatus1opp, .substatus2opp, .substatus3opp, .substatus4opp, .substatus5opp
dw .status, .statusopp, .animation, .effect, .power, .type
dw .curmove, .lastcounter, .lastcounteropp, .lastmove, .lastmoveopp
const_def
const PLAYER_SUBSTATUS_1
const ENEMY_SUBSTATUS_1
const PLAYER_SUBSTATUS_2
const ENEMY_SUBSTATUS_2
const PLAYER_SUBSTATUS_3
const ENEMY_SUBSTATUS_3
const PLAYER_SUBSTATUS_4
const ENEMY_SUBSTATUS_4
const PLAYER_SUBSTATUS_5
const ENEMY_SUBSTATUS_5
const PLAYER_STATUS
const ENEMY_STATUS
const PLAYER_MOVE_ANIMATION
const ENEMY_MOVE_ANIMATION
const PLAYER_MOVE_EFFECT
const ENEMY_MOVE_EFFECT
const PLAYER_MOVE_POWER
const ENEMY_MOVE_POWER
const PLAYER_MOVE_TYPE
const ENEMY_MOVE_TYPE
const PLAYER_CUR_MOVE
const ENEMY_CUR_MOVE
const PLAYER_COUNTER_MOVE
const ENEMY_COUNTER_MOVE
const PLAYER_LAST_MOVE
const ENEMY_LAST_MOVE
; player enemy
.substatus1 db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
.substatus1opp db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
.substatus2 db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2
.substatus2opp db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2
.substatus3 db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3
.substatus3opp db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3
.substatus4 db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4
.substatus4opp db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4
.substatus5 db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5
.substatus5opp db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5
.status db PLAYER_STATUS, ENEMY_STATUS
.statusopp db ENEMY_STATUS, PLAYER_STATUS
.animation db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION
.effect db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT
.power db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER
.type db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE
.curmove db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE
.lastcounter db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE
.lastcounteropp db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE
.lastmove db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE
.lastmoveopp db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE
.vars
dw PlayerSubStatus1, EnemySubStatus1
dw PlayerSubStatus2, EnemySubStatus2
dw PlayerSubStatus3, EnemySubStatus3
dw PlayerSubStatus4, EnemySubStatus4
dw PlayerSubStatus5, EnemySubStatus5
dw BattleMonStatus, EnemyMonStatus
dw PlayerMoveAnimation, EnemyMoveAnimation
dw PlayerMoveEffect, EnemyMoveEffect
dw PlayerMovePower, EnemyMovePower
dw PlayerMoveType, EnemyMoveType
dw CurPlayerMove, CurEnemyMove
dw LastEnemyCounterMove, LastPlayerCounterMove
dw LastPlayerMove, LastEnemyMove
; 3a90
Function3a90:: ; 3a90
inc hl
ld a, [hROMBank]
push af
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld a, [hli]
ld [hROMBank], a
ld [MBC3RomBank], a
ld a, e
ld l, a
ld a, d
ld h, a
ld de, $d00c
ld bc, $0028
call CopyBytes
pop af
ld [hROMBank], a
ld [MBC3RomBank], a
ret
; 3ab2
MobileTextBorder:: ; 3ab2
CELL_PHONE_TOP EQU $5e
CELL_PHONE_BOTTOM EQU $5f
; For mobile link battles only.
ld a, [InLinkBattle]
cp 4
ret c
; Draw a cell phone icon at the
; top right corner of the border.
hlcoord 19, 12
ld [hl], CELL_PHONE_TOP
hlcoord 19, 13
ld [hl], CELL_PHONE_BOTTOM
ret
; 3ac3
BattleTextBox:: ; 3ac3
; Open a textbox and print text at hl.
push hl
call SpeechTextBox
call MobileTextBorder
call Function1ad2
call Function321c
pop hl
call PrintTextBoxText
ret
; 3ad5
StdBattleTextBox:: ; 3ad5
; Open a textbox and print battle text at 20:hl.
GLOBAL BattleText
ld a, [hROMBank]
push af
ld a, BANK(BattleText)
rst Bankswitch
call BattleTextBox
pop af
rst Bankswitch
ret
; 3ae1

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

130
main.asm
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
@@ -21177,13 +21177,13 @@ Function1344a: ; 1344a
ld a, e ld a, e
ld [$d03f], a ld [$d03f], a
ld a, d ld a, d
ld [MartPointer], a ld [$d040], a
call Function1345a call Function1345a
ret ret
; 1345a ; 1345a
Function1345a: ; 1345a Function1345a: ; 1345a
ld de, CurMart ld de, $d0f0
ld bc, $0004 ld bc, $0004
ld hl, $d03f ld hl, $d03f
ld a, [hli] ld a, [hli]
@@ -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
@@ -27077,7 +27079,7 @@ Function15c25: ; 15c25
ld l, a ld l, a
push hl push hl
inc hl inc hl
ld bc, DefaultFlypoint ld bc, $d002
ld de, CurMart + 1 ld de, CurMart + 1
.asm_15c33 .asm_15c33
ld a, [hli] ld a, [hli]
@@ -27316,7 +27318,7 @@ Function15da5: ; 15da5
ld a, [$d107] ld a, [$d107]
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, MartPointer ld hl, $d040
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@@ -27357,7 +27359,7 @@ Function15df9: ; 15df9
ld a, [$d107] ld a, [$d107]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, MartPointer ld hl, $d040
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@@ -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
@@ -49099,7 +49101,7 @@ Function447fb: ; 0x447fb
Function44806: ; 0x44806 Function44806: ; 0x44806
xor a xor a
ld [CurMart], a ld [$d0f0], a
ld a, $1 ld a, $1
ld [$d0f1], a ld [$d0f1], a
.asm_4480f .asm_4480f
@@ -49112,11 +49114,11 @@ Function44806: ; 0x44806
call Function1ad2 call Function1ad2
ld a, [$d0f1] ld a, [$d0f1]
ld [$cf88], a ld [$cf88], a
ld a, [CurMart] ld a, [$d0f0]
ld [$d0e4], a ld [$d0e4], a
call Function350c call Function350c
ld a, [$d0e4] ld a, [$d0e4]
ld [CurMart], a ld [$d0f0], a
ld a, [$cfa9] ld a, [$cfa9]
ld [$d0f1], a ld [$d0f1], a
ld a, [$cf73] ld a, [$cf73]
@@ -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
@@ -61140,7 +61142,7 @@ Function50db9: ; 50db9
.asm_50dd8 .asm_50dd8
cp $5 cp $5
jr nz, .asm_50de6 jr nz, .asm_50de6
ld hl, CurMart ld hl, $d0f0
ld de, PokemonNames ld de, PokemonNames
ld a, $1 ld a, $1
jr .asm_50dfc jr .asm_50dfc
@@ -61154,7 +61156,7 @@ Function50db9: ; 50db9
jr .asm_50dfc jr .asm_50dfc
.asm_50df4 .asm_50df4
ld hl, CurMart ld hl, $d0f0
ld de, Function50000 ld de, Function50000
ld a, $4 ld a, $4
@@ -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
@@ -62490,17 +62492,17 @@ TryStep: ; 8016b
TrySurfStep: ; 801c0 TrySurfStep: ; 801c0
call CheckWaterPermissions call CheckWaterPermissions
ld [MartPointer], 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
cp 2 cp 2
jr z, .asm_801f1 jr z, .asm_801f1
ld a, [MartPointer] ld a, [$d040]
and a and a
jr nz, .ExitWater jr nz, .ExitWater
@@ -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
@@ -99934,7 +99936,7 @@ Functione5516: ; e5516 (39:5516)
push af push af
ld a, $5 ld a, $5
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ld hl, CurMartEnd ; $d100 (aliases: LYOverrides) ld hl, LYOverrides
ld bc, $90 ld bc, $90
xor a xor a
call ByteFill call ByteFill
@@ -99953,7 +99955,7 @@ Functione552f: ; e552f (39:552f)
ld a, [$cf64] ld a, [$cf64]
and $1 and $1
jr z, .asm_e5548 jr z, .asm_e5548
ld hl, CurMartEnd ; $d100 (aliases: LYOverrides) ld hl, LYOverrides
ld a, [hl] ld a, [hl]
inc a inc a
ld bc, $5f ld bc, $5f
@@ -99965,7 +99967,7 @@ Functione552f: ; e552f (39:552f)
inc a inc a
ld bc, $31 ld bc, $31
call ByteFill call ByteFill
ld a, [CurMartEnd] ; $d100 (aliases: LYOverrides) ld a, [LYOverrides + 0]
ld [hSCX], a ; $ff00+$cf ld [hSCX], a ; $ff00+$cf
pop af pop af
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
@@ -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
@@ -114152,7 +114154,7 @@ Function11c7bc: ; 11c7bc (47:47bc)
jr nz, .asm_11c7d0 jr nz, .asm_11c7d0
ret ret
.asm_11c7e9 .asm_11c7e9
ld hl, CurMartEnd ; $d100 (aliases: LYOverrides) ld hl, $d100
ld a, [$cd26] ld a, [$cd26]
ld e, a ld e, a
add hl, de add hl, de
@@ -114186,8 +114188,8 @@ Function11c7bc: ; 11c7bc (47:47bc)
pop de pop de
ret ret
.asm_11c814 .asm_11c814
ld hl, BattleMonSpclDef ; $c648 ld hl, $c648
ld a, [CreditsTimer] ; $cd22 ld a, [$cd22]
ld e, a ld e, a
ld d, $0 ld d, $0
add hl, de add hl, de
@@ -114336,13 +114338,13 @@ Function11c8f6: ; 11c8f6 (47:48f6)
add [hl] add [hl]
ld c, a ld c, a
ld b, $0 ld b, $0
ld hl, CurMartEnd ; $d100 (aliases: LYOverrides) ld hl, $d100
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
jr .asm_11c911 jr .asm_11c911
.asm_11c938 .asm_11c938
ld hl, BattleMonSpclDef ; $c648 ld hl, $c648
ld a, [CreditsTimer] ; $cd22 ld a, [$cd22]
ld e, a ld e, a
ld d, $0 ld d, $0
add hl, de add hl, de
@@ -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]