ref: 8fb01de917b040e4e5d7f392c5b01f33a1341033
parent: b1e63485d8747ef4946b56a5d0c07c4fdfaf7186
author: PikalaxALT <[email protected]>
date: Tue Nov 10 14:51:13 EST 2015
No more DefaultFlypoint
--- a/battle/ai/items.asm
+++ b/battle/ai/items.asm
@@ -725,7 +725,7 @@
call PrintText
.skiptext
- ld a, $1
+ ld a, 1
ld [wd264], a
callab NewEnemyMonStatus
callab ResetEnemyStatLevels
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -240,7 +240,7 @@
MobileFn_3c1bf: mobile
ld a, $5
call GetSRAMBank
- ld hl, $a89b
+ ld hl, $a89b ; s5_a89b
inc [hl]
jr nz, .finish
dec hl
@@ -2145,7 +2145,7 @@
ld hl, BattleMonHP
ld a, [hli]
or [hl]
- jr nz, .asm_3cdba
+ jr nz, .player_mon_not_fainted
call AskUseNextPokemon
jr nc, .dont_flee
@@ -2155,7 +2155,7 @@
ret
.dont_flee
- call Function3d227
+ call ForcePlayerMonChoice
call CheckMobileBattleError
jp c, WildFled_EnemyFled_LinkBattleCanceled
@@ -2165,7 +2165,7 @@
jp z, WildFled_EnemyFled_LinkBattleCanceled
jr Function3cdca
-.asm_3cdba
+.player_mon_not_fainted
ld a, $1
ld [wd0ec], a
call Function3cf4a
@@ -2178,17 +2178,17 @@
Function3cdca: ; 3cdca
ld a, [hLinkPlayerNumber]
cp $1
- jr z, .asm_3cde6
+ jr z, .player_1
call ClearSprites
hlcoord 1, 0
lb bc, 4, 10
call ClearBox
- call Function3d2b3
+ call PlayerPartyMonEntrance
ld a, $1
call EnemyPartyMonEntrance
- jr .asm_3cdfc
+ jr .done
-.asm_3cde6
+.player_1
ld a, [CurPartyMon]
push af
ld a, $1
@@ -2197,9 +2197,9 @@
call LoadTileMapToTempTileMap
pop af
ld [CurPartyMon], a
- call Function3d2b3
+ call PlayerPartyMonEntrance
-.asm_3cdfc
+.done
xor a
ld [wd0ec], a
ret
@@ -2209,7 +2209,7 @@
call UpdateBattleMonInParty
ld a, [wBattleMode]
dec a
- jr z, .asm_3ce16
+ jr z, .wild
ld a, [CurOTMon]
ld hl, OTPartyMon1HP
call GetPartyLocation
@@ -2217,7 +2217,7 @@
ld [hli], a
ld [hl], a
-.asm_3ce16
+.wild
ld hl, PlayerSubStatus3
res SUBSTATUS_IN_LOOP, [hl]
xor a
@@ -2228,25 +2228,25 @@
call BreakAttraction
ld a, [wBattleMode]
dec a
- jr z, .asm_3ce2f
- jr .asm_3ce37
+ jr z, .wild2
+ jr .trainer
-.asm_3ce2f
+.wild2
call StopDangerSound
ld a, $1
ld [wc6fd], a
-.asm_3ce37
+.trainer
ld hl, BattleMonHP
ld a, [hli]
or [hl]
- jr nz, .asm_3ce47
+ jr nz, .player_mon_did_not_faint
ld a, [wc6f7]
and a
- jr nz, .asm_3ce47
- call Function3d1aa
+ jr nz, .player_mon_did_not_faint
+ call PlayerMonFaintHappinessMod
-.asm_3ce47
+.player_mon_did_not_faint
call CheckPlayerPartyForFitPkmn
ld a, d
and a
@@ -2260,16 +2260,16 @@
and $c0
ld [wBattleResult], a
call DoOthersShareExperience
- jr z, .asm_3ce72
+ jr z, .skip_exp
ld hl, EnemyMonBaseStats
ld b, $7
-.asm_3ce6c
+.loop
srl [hl]
inc hl
dec b
- jr nz, .asm_3ce6c
+ jr nz, .loop
-.asm_3ce72
+.skip_exp
ld hl, EnemyMonBaseStats
ld de, wc720
ld bc, EnemyMonEnd - EnemyMonBaseStats
@@ -2777,7 +2777,7 @@
call z, FaintEnemyPokemon
ld a, $1
ld [wc6f7], a
- call Function3d1aa
+ call PlayerMonFaintHappinessMod
call CheckPlayerPartyForFitPkmn
ld a, d
and a
@@ -2800,13 +2800,13 @@
.notfainted
call AskUseNextPokemon
- jr nc, .asm_3d190
+ jr nc, .switch
ld a, $1
ld [BattleEnded], a
ret
-.asm_3d190
- call Function3d227
+.switch
+ call ForcePlayerMonChoice
call CheckMobileBattleError
jp c, WildFled_EnemyFled_LinkBattleCanceled
ld a, c
@@ -2819,7 +2819,7 @@
jp Function3cdca
; 3d1aa
-Function3d1aa: ; 3d1aa
+PlayerMonFaintHappinessMod: ; 3d1aa
ld a, [CurBattleMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
@@ -2841,10 +2841,10 @@
ld b, a
ld a, [EnemyMonLevel]
cp b
- jr c, .asm_3d1dc
+ jr c, .got_param
ld c, HAPPINESS_BEATENBYSTRONGFOE
-.asm_3d1dc
+.got_param
ld a, [CurBattleMon]
ld [CurPartyMon], a
callab ChangeHappiness
@@ -2855,7 +2855,7 @@
ld a, [wc6f7]
and a
ret z
- ret
+ ret ; ??????????
; 3d1f8
AskUseNextPokemon: ; 3d1f8
@@ -2887,7 +2887,7 @@
jp TryToRunAwayFromBattle
; 3d227
-Function3d227: ; 3d227
+ForcePlayerMonChoice: ; 3d227
call EmptyBattleTextBox
call LoadPartyMenuDataHeader
call Function3d2f7
@@ -2903,16 +2903,16 @@
xor a
ld [wd0ec], a
call CheckMobileBattleError
- jr c, .asm_3d251
+ jr c, .enemy_fainted_mobile_error
ld hl, EnemyMonHP
ld a, [hli]
or [hl]
- jr nz, .asm_3d26c
+ jr nz, .send_out_pokemon
-.asm_3d251
+.enemy_fainted_mobile_error
call ClearSprites
call WhiteBGMap
- call Function3eda6
+ call _LoadHPBar
call ExitMenu
call LoadTileMapToTempTileMap
call WaitBGMap
@@ -2922,7 +2922,7 @@
ld c, a
ret
-.asm_3d26c
+.send_out_pokemon
call ClearSprites
ld a, [CurBattleMon]
ld [LastPlayerMon], a
@@ -2933,7 +2933,7 @@
call ResetPlayerStatLevels
call ClearPalettes
call DelayFrame
- call Function3eda6
+ call _LoadHPBar
call WriteBackup
call ClearSGB
call SetPalettes
@@ -2951,7 +2951,7 @@
ret
; 3d2b3
-Function3d2b3: ; 3d2b3
+PlayerPartyMonEntrance: ; 3d2b3
ld a, [CurBattleMon]
ld [LastPlayerMon], a
ld a, [CurPartyMon]
@@ -3306,13 +3306,13 @@
; 3d4c3
-Function3d4c3: ; 3d4c3
+ForceEnemySwitch: ; 3d4c3
call ResetEnemyBattleVars
ld a, [wEnemySwitchMonIndex]
dec a
ld b, a
call LoadEnemyPkmnToSwitchTo
- call Function3d7a0
+ call ClearEnemyMonBox
call NewEnemyMonStatus
call ResetEnemyStatLevels
call Function_SetEnemyPkmnAndSendOutAnimation
@@ -3323,11 +3323,11 @@
EnemySwitch: ; 3d4e1
- call Function3d714
+ call CheckWhetherToAskSwitch
jr nc, EnemySwitch_SetMode
; Shift Mode
call ResetEnemyBattleVars
- call Function3d533
+ call CheckWhetherSwitchmonIsPredetermined
jr c, .skip
call FindPkmnInOTPartyToSwitchIntoBattle
.skip
@@ -3335,7 +3335,7 @@
call LoadEnemyPkmnToSwitchTo
call OfferSwitch
push af
- call Function3d7a0
+ call ClearEnemyMonBox
call Function_BattleTextEnemySentOut
call Function_SetEnemyPkmnAndSendOutAnimation
pop af
@@ -3353,7 +3353,7 @@
EnemySwitch_SetMode: ; 3d517
call ResetEnemyBattleVars
- call Function3d533
+ call CheckWhetherSwitchmonIsPredetermined
jr c, .skip
call FindPkmnInOTPartyToSwitchIntoBattle
.skip
@@ -3361,12 +3361,12 @@
call LoadEnemyPkmnToSwitchTo
ld a, 1
ld [wEnemyIsSwitching], a
- call Function3d7a0
+ call ClearEnemyMonBox
call Function_BattleTextEnemySentOut
jp Function_SetEnemyPkmnAndSendOutAnimation
; 3d533
-Function3d533: ; 3d533
+CheckWhetherSwitchmonIsPredetermined: ; 3d533
; returns carry if: ???
ld a, [wLinkMode]
and a
@@ -3662,19 +3662,19 @@
ret
; 3d714
-Function3d714: ; 3d714
+CheckWhetherToAskSwitch: ; 3d714
ld a, [wd264]
dec a
- jp z, .asm_3d749
+ jp z, .return_nc
ld a, [PartyCount]
dec a
- jp z, .asm_3d749
+ jp z, .return_nc
ld a, [wLinkMode]
and a
- jp nz, .asm_3d749
+ jp nz, .return_nc
ld a, [Options]
bit BATTLE_SHIFT, a
- jr nz, .asm_3d749
+ jr nz, .return_nc
ld a, [CurPartyMon]
push af
ld a, [CurBattleMon]
@@ -3683,11 +3683,11 @@
pop bc
ld a, b
ld [CurPartyMon], a
- jr c, .asm_3d749
+ jr c, .return_nc
scf
ret
-.asm_3d749
+.return_nc
and a
ret
; 3d74b
@@ -3712,7 +3712,7 @@
ld [CurBattleMon], a
call ClearPalettes
call DelayFrame
- call Function3eda6
+ call _LoadHPBar
pop af
ld [CurPartyMon], a
xor a
@@ -3724,7 +3724,7 @@
.canceled_switch
call ClearPalettes
call DelayFrame
- call Function3eda6
+ call _LoadHPBar
.said_no
pop af
@@ -3733,7 +3733,7 @@
ret
; 3d7a0
-Function3d7a0: ; 3d7a0
+ClearEnemyMonBox: ; 3d7a0
xor a
ld [hBGMapMode], a
call ExitMenu
@@ -5266,7 +5266,7 @@
.didnt_use_item
call ClearPalettes
call DelayFrame
- call Function3ed9f
+ call _LoadBattleFontsHPBar
call GetMonBackpic
call GetMonFrontpic
call ExitMenu
@@ -5295,7 +5295,7 @@
.asm_3e24a
xor a
ld [hBGMapMode], a
- call Function3ed9f
+ call _LoadBattleFontsHPBar
call ClearSprites
ld a, [BattleType]
cp BATTLETYPE_TUTORIAL
@@ -5369,7 +5369,7 @@
call ClearSprites
call ClearPalettes
call DelayFrame
- call Function3eda6
+ call _LoadHPBar
call WriteBackup
call LoadTileMapToTempTileMap
call ClearSGB
@@ -5452,7 +5452,7 @@
call ClearPalettes
call DelayFrame
call ClearSprites
- call Function3eda6
+ call _LoadHPBar
call WriteBackup
call ClearSGB
call SetPalettes
@@ -7248,12 +7248,12 @@
; 3ed9f
-Function3ed9f: ; 3ed9f
+_LoadBattleFontsHPBar: ; 3ed9f
callab LoadBattleFontsHPBar
ret
; 3eda6
-Function3eda6: ; 3eda6
+_LoadHPBar: ; 3eda6
callab LoadHPBar
ret
; 3edad
@@ -7842,11 +7842,11 @@
ld hl, CurPartyMon
ld a, [CurBattleMon]
cp [hl]
- jp nz, .asm_3f219
+ jp nz, .finish
ld a, [BattleMonLevel]
cp MAX_LEVEL
- jp nc, .asm_3f219
+ jp nc, .finish
ld a, [hProduct + 3]
ld [wd004], a
@@ -7855,7 +7855,7 @@
ld [wd003], a
push af
xor a
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a ; PARTYMON
ld [MonType], a
predef CopyPkmnToTempMon
@@ -7964,7 +7964,7 @@
pop af
ld [hProduct + 3], a
-.asm_3f219
+.finish
pop bc
ret
; 3f21b
@@ -8957,7 +8957,7 @@
push hl
ld h, d
ld l, e
- ld de, DefaultFlypoint
+ ld de, wd002
ld bc, $000a
call CopyBytes
ld a, $50
@@ -8965,7 +8965,7 @@
inc de
ld bc, $0006
call CopyBytes
- ld de, DefaultFlypoint
+ ld de, wd002
pop hl
call PlaceString
pop hl
@@ -9273,7 +9273,7 @@
Function3fac8: ; 3fac8
ld b, $5
ld hl, s1_b277
- ld de, DefaultFlypoint
+ ld de, wd002
.loop
push bc
push de
@@ -9304,7 +9304,7 @@
endr
ld e, a
ld d, $0
- ld hl, DefaultFlypoint
+ ld hl, wd002
add hl, de
push hl
ld a, c
@@ -9313,7 +9313,7 @@
endr
ld e, a
ld d, $0
- ld hl, DefaultFlypoint
+ ld hl, wd002
add hl, de
ld d, h
ld e, l
@@ -9345,7 +9345,7 @@
ld hl, s1_b266
call AddNTimes
push hl
- ld de, DefaultFlypoint
+ ld de, wd002
ld bc, 18
call CopyBytes
pop hl
@@ -9359,7 +9359,7 @@
push hl
ld bc, 18
call CopyBytes
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld bc, 18
pop de
call CopyBytes
@@ -9404,7 +9404,7 @@
lb bc, 3, 7
call ClearBox
call LoadStandardFont
- call Function3ed9f
+ call _LoadBattleFontsHPBar
call Function3fbd6
xor a
ld [hMapAnims], a
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -3109,7 +3109,7 @@
call DelayFrames
xor a
ld [PlayerRolloutCount], a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld [wc72d], a
jr .got_mon
@@ -3118,10 +3118,10 @@
ld b, a
ld a, [PartyCount]
sub b
- ld [DefaultFlypoint], a
+ ld [wd002], a
.got_mon
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, PartyMonNicknames
call GetNick
ld a, MON_HP
@@ -3129,7 +3129,7 @@
ld a, [hli]
or [hl]
jp z, .beatup_fail ; fainted
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld c, a
ld a, [CurBattleMon]
cp [hl]
@@ -3177,7 +3177,7 @@
xor a
ld [EnemyRolloutCount], a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld [wc72d], a
jr .enemy_continue
@@ -3186,7 +3186,7 @@
ld b, a
ld a, [OTPartyCount]
sub b
- ld [DefaultFlypoint], a
+ ld [wd002], a
.enemy_continue
ld a, [wBattleMode]
dec a
@@ -3200,7 +3200,7 @@
and a
jr nz, .link_or_tower
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld c, a
ld b, 0
ld hl, OTPartySpecies
@@ -3211,7 +3211,7 @@
jr .got_enemy_nick
.link_or_tower
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, OTPartyMonNicknames
ld bc, NAME_LENGTH
call AddNTimes
@@ -3223,7 +3223,7 @@
ld a, [hli]
or [hl]
jp z, .beatup_fail
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld b, a
ld a, [CurOTMon]
cp b
@@ -3304,7 +3304,7 @@
ld hl, OTPartyMon1Species
.asm_355cc
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
add hl, bc
call GetPartyLocation
pop bc
@@ -6665,7 +6665,7 @@
ld a, d
inc a
ld [wEnemySwitchMonIndex], a
- callab Function3d4c3
+ callab ForceEnemySwitch
ld hl, DraggedOutText
call StdBattleTextBox
@@ -8960,7 +8960,7 @@
; Return to battle scene
call ClearPalettes
- callba Function3ed9f
+ callba _LoadBattleFontsHPBar
call WriteBackup
call ClearSprites
hlcoord 1, 0
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -1452,7 +1452,7 @@
pop af
ld [MenuSelection2], a
dec a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld [wcf56], a
callba Function16d6ce
ld a, [wcf51]
@@ -1653,7 +1653,7 @@
ld c, $12
call Function28eef
callba Function4d354
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, PartySpecies
ld c, a
ld b, $0
@@ -1745,7 +1745,7 @@
.asm_28c7b
ld hl, sPartyScratch1
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld bc, SCRATCHMON_STRUCT_LENGTH
call AddNTimes
ld a, BANK(sPartyScratch1)
@@ -1754,7 +1754,7 @@
ld e, l
ld bc, SCRATCHMON_STRUCT_LENGTH
add hl, bc
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld c, a
.asm_28c96
inc c
@@ -1786,7 +1786,7 @@
ld de, wc6e7
ld bc, NAME_LENGTH
call CopyBytes
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, PartySpecies
ld b, $0
ld c, a
@@ -1794,7 +1794,7 @@
ld a, [hl]
ld [wc6d0], a
push af
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, PartyMonOT
call SkipNames
ld de, wc6f2
@@ -1801,7 +1801,7 @@
ld bc, NAME_LENGTH
call CopyBytes
ld hl, PartyMon1ID
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
call GetPartyLocation
ld a, [hli]
ld [PlayerScreens], a
@@ -1808,13 +1808,13 @@
ld a, [hl]
ld [EnemyScreens], a
ld hl, PartyMon1DVs
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
call GetPartyLocation
ld a, [hli]
ld [wc6fd], a
ld a, [hl]
ld [wPlayerMinimized], a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, PartyMon1Species
call GetPartyLocation
ld b, h
@@ -1861,7 +1861,7 @@
callba GetCaughtGender
ld a, c
ld [wEnemyCharging], a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld [CurPartyMon], a
ld hl, PartySpecies
ld b, $0
@@ -1868,7 +1868,7 @@
ld c, a
add hl, bc
ld a, [hl]
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a
ld [wPokemonWithdrawDepositParameter], a
callab Functione039
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -539,7 +539,7 @@
call PlaceString
ld b, $3
ld c, $0
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [hl]
.asm_5033b
push hl
--- a/event/kurt.asm
+++ b/event/kurt.asm
@@ -233,7 +233,7 @@
xor a
ld [ItemCountBuffer], a
ld a, -1
- ld [MiscBuffer2], a
+ ld [wd002], a
; Search for [CurItem] in the bag.
.loop1
@@ -253,7 +253,7 @@
; Increment the result counter and store the bag index of the match.
ld d, $0
push hl
- ld hl, MiscBuffer2
+ ld hl, wd002
add hl, de
inc e
ld a, [ItemCountBuffer]
@@ -271,7 +271,7 @@
jr z, .done
dec a
jr z, .OnlyOne
- ld hl, MiscBuffer2
+ ld hl, wd002
.loop2
ld a, [hl]
@@ -316,7 +316,7 @@
jr nz, .loop2
.OnlyOne
- ld hl, MiscBuffer2
+ ld hl, wd002
.loop4
ld a, [hl]
cp -1
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -2372,7 +2372,7 @@
.asm_f512
xor a
- ld [MiscBuffer2], a
+ ld [wd002], a
ld b, $ff ^ SLP
@@ -2395,7 +2395,7 @@
and b
ld [hl], a
- ld a, [MiscBuffer2]
+ ld a, [wd002]
and a
ld hl, UnknownText_0xf56c
jp z, PrintText
@@ -2420,7 +2420,7 @@
and SLP
jr z, .asm_f564
ld a, 1
- ld [MiscBuffer2], a
+ ld [wd002], a
.asm_f564
pop af
and b
@@ -2521,7 +2521,7 @@
Elixer:
Mysteryberry: ; f5bf
ld a, [CurItem]
- ld [MiscBuffer2], a
+ ld [wd002], a
.loop
; Party Screen opens to choose on which Pkmn to use the Item
@@ -2530,7 +2530,7 @@
jp c, Functionf6e0
.loop2
- ld a, [MiscBuffer2]
+ ld a, [wd002]
cp MAX_ELIXER
jp z, Elixer_RestorePPofAllMoves
cp ELIXER
@@ -2537,7 +2537,7 @@
jp z, Elixer_RestorePPofAllMoves
ld hl, TextJump_RaiseThePPOfWhichMove
- ld a, [MiscBuffer2]
+ ld a, [wd002]
cp PP_UP
jr z, .ppup
ld hl, TextJump_RestoreThePPOfWhichMove
@@ -2568,7 +2568,7 @@
call CopyName1
pop hl
- ld a, [MiscBuffer2]
+ ld a, [wd002]
cp PP_UP
jp nz, Functionf6a7
@@ -2722,7 +2722,7 @@
cp b
jr nc, .dont_restore
- ld a, [MiscBuffer2]
+ ld a, [wd002]
cp MAX_ELIXER
jr z, .restore_all
cp MAX_ETHER
--- a/main.asm
+++ b/main.asm
@@ -8693,7 +8693,7 @@
call WaitSFX
call Functione698
ld a, b
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld a, e
ld [CurPartyLevel], a
xor a
@@ -8709,7 +8709,7 @@
call WaitSFX
call Functione6b3
ld a, b
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld a, e
ld [CurPartyLevel], a
ld a, PC_DEPOSIT
@@ -13543,7 +13543,7 @@
Function12cfe: ; 12cfe (4:6cfe)
- ld de, DefaultFlypoint
+ ld de, wd002
callba Function11e75
ld hl, PlayerName
ld de, wd023
@@ -13563,7 +13563,7 @@
call AddNTimes
ld d, h
ld e, l
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld bc, SCRATCHMON_STRUCT_LENGTH
ld a, BANK(sPartyScratch1)
call GetSRAMBank
@@ -15098,7 +15098,7 @@
call GetPokemonName
ld hl, BugContest_SecondPlaceText
call PrintText
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
call LoadContestantName
ld a, [wd003]
ld [wd265], a
@@ -15330,7 +15330,7 @@
; 13833
Function13833: ; 13833
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld b, 12
xor a
.loop
@@ -15350,11 +15350,11 @@
ld de, wd00a
ld bc, 4
call CopyBytes
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld de, EndFlypoint
ld bc, 4
call CopyBytes
- ld hl, DefaultFlypoint
+ ld hl, wd002
call Function138a0
jr .done
@@ -17274,7 +17274,7 @@
inc de
cp -1
jr nz, .CopyMart
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld de, CurMart + 1
.ReadMartItem
ld a, [de]
@@ -17680,7 +17680,7 @@
ld a, [wcf77]
ld c, a
ld b, 0
- ld hl, DefaultFlypoint
+ ld hl, wd002
rept 3
add hl, bc
endr
@@ -20462,7 +20462,7 @@
Function24a40: ; 24a40 (9:4a40)
call Function24a5c
- ld de, DefaultFlypoint
+ ld de, wd002
call Function24a80
call CopyBytes
ret
@@ -20471,7 +20471,7 @@
call Function24a5c
ld d, h
ld e, l
- ld hl, DefaultFlypoint
+ ld hl, wd002
call Function24a80
call CopyBytes
ret
@@ -22191,7 +22191,7 @@
ld hl, PokedexSeen
ld b, EndPokedexSeen - PokedexSeen
call CountSetBits
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld hl, PokedexCaught
ld b, EndPokedexCaught - PokedexCaught
call CountSetBits
@@ -22213,7 +22213,7 @@
ClearOakRatingBuffers: ; 0x26647
ld hl, StringBuffer3
- ld de, DefaultFlypoint
+ ld de, wd002
call ClearOakRatingBuffer
ld hl, StringBuffer4
ld de, wd003
@@ -22513,7 +22513,7 @@
ld a, $7
call Function26830
ld hl, StringBuffer2
- ld de, DefaultFlypoint
+ ld de, wd002
ld bc, $d
call CopyBytes
ret
@@ -22573,7 +22573,7 @@
Function2686c: ; 2686c
xor a
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld [hli], a
ld a, -1
ld bc, $10
@@ -22603,7 +22603,7 @@
; 26891
Function26891: ; 26891
- ld hl, DefaultFlypoint
+ ld hl, wd002
inc [hl]
ld e, [hl]
ld d, $0
@@ -22619,7 +22619,7 @@
pop hl
call CheckAllDecorationFlags
pop bc
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and a
ret z
ld a, c
@@ -22757,7 +22757,7 @@
; 2695b
Function2695b: ; 2695b
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and a
jr z, .empty
cp 8
@@ -22775,7 +22775,7 @@
ret
.beyond_eight
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld e, [hl]
dec [hl]
ld d, 0
@@ -23875,7 +23875,7 @@
.continue
callba GetMonFrontpic
- callba Function3ed9f
+ callba _LoadBattleFontsHPBar
call ClearSGB
call WriteBackup
call LoadPartyMenuDataHeader
@@ -26804,7 +26804,7 @@
ld a, [hl]
ld [BattleMonLevel], a
predef Predef_StartBattle
- callba Function3ed9f
+ callba _LoadBattleFontsHPBar
ld a, 1
ld [hBGMapMode], a
call ClearSprites
@@ -28147,7 +28147,7 @@
ld a, [Buffer1]
and a
jr z, .CheckMove
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp b
jr nc, .GetMove
@@ -29407,7 +29407,7 @@
ld [wd476], a
ld [wd477], a
ld [wd478], a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld [wd003], a
; could have done "ld a, [wd479] \ and -4", saved four operations
ld a, [wd479]
@@ -29423,7 +29423,7 @@
Function4802f: ; 4802f (12:402f)
xor a
set 6, a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld hl, wd003
set 0, [hl]
ld a, c
@@ -29453,7 +29453,7 @@
call Request1bpp
call Function4a3a7
call WhiteBGMap
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr z, .asm_4808a
call Function48689
@@ -29503,7 +29503,7 @@
hlcoord 2, 12
ld de, String_4849e
call PlaceString
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr nz, .asm_48113
ld a, [PlayerGender]
@@ -29552,7 +29552,7 @@
bit 0, a
jp nz, Function4820d
ld b, a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr z, .asm_48177
ld hl, wd479
@@ -29589,7 +29589,7 @@
call PlaceString
pop de
.asm_481ad
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr nz, .asm_481c1
bit 0, d
@@ -29640,7 +29640,7 @@
ld hl, MenuSelection2
ld a, [hl]
push af
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr z, .asm_4821f
pop af
@@ -29658,7 +29658,7 @@
jp z, Function488d3
ld a, $2
call Function1ff8
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr z, .asm_4825c
jr .asm_4825c
@@ -29917,7 +29917,7 @@
pop bc
ld hl, MenuSelection2
ld [hl], b
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr nz, .asm_48437
ld b, $9
@@ -30110,7 +30110,7 @@
Function486bf: ; 486bf (12:46bf)
ld hl, wcfa1
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr nz, .asm_486ce
ld a, $4
@@ -30122,7 +30122,7 @@
.asm_486d1
ld a, $1
ld [hli], a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr nz, .asm_486e7
call Function48725
@@ -30158,7 +30158,7 @@
add $40
add $80
push af
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr z, .asm_4871a
pop af
@@ -30477,10 +30477,10 @@
jp nz, Function4896e
bit 1, a
jp nz, Function4896e
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and %11001111
res 7, a
- ld [DefaultFlypoint], a
+ ld [wd002], a
pop bc
inc b
ld a, b
@@ -30531,10 +30531,10 @@
jr z, .asm_48994
cp $f
jr nz, .asm_48988
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
set 7, a
and $cf
- ld [DefaultFlypoint], a
+ ld [wd002], a
.asm_48988
hlcoord 11, 10
ld b, $0
@@ -30780,7 +30780,7 @@
jr nz, .asm_48b9d
hlcoord 11, 10
call Function489ea
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 7, a
jr nz, .asm_48b51
.asm_48b51
@@ -30931,7 +30931,7 @@
ret
Function48c11: ; 48c11 (12:4c11)
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 7, a
jr z, .asm_48c20
ld a, d
@@ -30941,30 +30941,30 @@
.asm_48c1e
ld [hl], $7f
.asm_48c20
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
swap a
and $3
inc a
cp b
jr nz, .asm_48c40
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 7, a
jr z, .asm_48c3a
res 7, a
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a
jr .asm_48c40
.asm_48c3a
set 7, a
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a
.asm_48c40
swap a
ld b, a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and $cf
or b
- ld [DefaultFlypoint], a
+ ld [wd002], a
ret
Function48c4d: ; 48c4d (12:4c4d)
@@ -31661,7 +31661,7 @@
ld bc, 4 * SCREEN_WIDTH
ld a, $7
call ByteFill
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
bit 6, a
jr z, .asm_49464
call Function49480
@@ -34171,7 +34171,7 @@
Function4a94e: ; 4a94e
call FadeToMenu
ld a, -1
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld bc, 3
call ByteFill
xor a
@@ -34205,7 +34205,7 @@
.asm_4a990
call Function2b3c
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, -1
ld bc, 3
call ByteFill
@@ -34238,7 +34238,7 @@
; 0x4a9c3
Function4a9c3: ; 4a9c3
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, $ff
cp [hl]
jr z, .asm_4a9d5
@@ -34257,7 +34257,7 @@
; 4a9d7
Function4a9d7: ; 4a9d7
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, PartyMonNicknames
call GetNick
ld h, d
@@ -34340,7 +34340,7 @@
; 4aa7a
Function4aa7a: ; 4aa7a
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld d, $3
.loop
ld e, PARTY_LENGTH
@@ -34395,7 +34395,7 @@
; 4aab6
Function4aab6: ; 4aab6
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld d, $3
.loop
ld a, [hli]
@@ -34540,7 +34540,7 @@
Function4ab99: ; 4ab99
bit 1, a
jr z, .asm_4aba6
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp $ff
jr z, .asm_4aba6
scf
@@ -34771,7 +34771,7 @@
Function4ad17: ; 4ad17
call Function4adb2
jr z, .asm_4ad4a
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, $ff
cp [hl]
jr z, .asm_4ad39
@@ -34863,7 +34863,7 @@
; 4adb2
Function4adb2: ; 4adb2
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [CurPartyMon]
cp [hl]
ret z
@@ -34878,7 +34878,7 @@
; 4adc2
Function4adc2: ; 4adc2
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp $ff
jr nz, .asm_4ade5
ld a, [wd003]
@@ -34885,13 +34885,13 @@
cp $ff
jr nz, .asm_4addd
ld a, [wd004]
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld a, $ff
ld [wd004], a
jr .asm_4ade5
.asm_4addd
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld a, $ff
ld [wd003], a
@@ -38650,7 +38650,7 @@
call PlaceString
ld b, $3
ld c, $0
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [hl]
.loop2
push hl
@@ -40548,7 +40548,7 @@
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
- ld de, MiscBuffer2
+ ld de, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
ld a, [Buffer3]
@@ -40560,7 +40560,7 @@
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
pop de
- ld hl, MiscBuffer2
+ ld hl, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
ld a, [Buffer2] ; wd1eb (aliases: MovementType)
@@ -40567,7 +40567,7 @@
ld hl, PartyMonOT
call SkipNames
push hl
- call .CopyNameToMiscBuffer2
+ call .CopyNameTowd002
ld a, [Buffer3]
ld hl, PartyMonOT
call SkipNames
@@ -40575,13 +40575,13 @@
push hl
call .CopyName
pop de
- ld hl, MiscBuffer2
+ ld hl, wd002
call .CopyName
ld hl, PartyMonNicknames
ld a, [Buffer2] ; wd1eb (aliases: MovementType)
call SkipNames
push hl
- call .CopyNameToMiscBuffer2
+ call .CopyNameTowd002
ld hl, PartyMonNicknames
ld a, [Buffer3]
call SkipNames
@@ -40589,7 +40589,7 @@
push hl
call .CopyName
pop de
- ld hl, MiscBuffer2
+ ld hl, wd002
call .CopyName
ld hl, sPartyScratch1
ld a, [Buffer2] ; wd1eb (aliases: MovementType)
@@ -40596,7 +40596,7 @@
ld bc, SCRATCHMON_STRUCT_LENGTH
call AddNTimes
push hl
- ld de, MiscBuffer2
+ ld de, wd002
ld bc, SCRATCHMON_STRUCT_LENGTH
ld a, BANK(sPartyScratch1)
call GetSRAMBank
@@ -40610,7 +40610,7 @@
ld bc, SCRATCHMON_STRUCT_LENGTH
call CopyBytes
pop de
- ld hl, MiscBuffer2
+ ld hl, wd002
ld bc, SCRATCHMON_STRUCT_LENGTH
call CopyBytes
call CloseSRAM
@@ -40619,8 +40619,8 @@
pop hl
ret
-.CopyNameToMiscBuffer2: ; 51036 (14:5036)
- ld de, MiscBuffer2
+.CopyNameTowd002: ; 51036 (14:5036)
+ ld de, wd002
.CopyName: ; 51039 (14:5039)
ld bc, NAME_LENGTH
@@ -42449,7 +42449,7 @@
; 818f4
Function818f4: ; 818f4
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and a
jr nz, Function81911
ld hl, PokemonPalettes
@@ -42745,7 +42745,7 @@
Function81ac3: ; 81ac3
; Looping back around the pic set.
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and a
jr nz, .asm_81acc
ld a, NUM_POKEMON ; CELEBI
@@ -42794,7 +42794,7 @@
ld de, wd265
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
call PrintNum
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and a
jr nz, .asm_81b7a
ld a, $1
@@ -43031,7 +43031,7 @@
ret
.asm_81ce5
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
and a
ret nz
ld a, [wd003]
@@ -45270,7 +45270,7 @@
ld bc, $372
add hl, bc
ld bc, $b
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
call AddNTimes
ld e, l
ld d, h
@@ -45288,13 +45288,13 @@
ld bc, $35
add hl, bc
ld bc, $20
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
call AddNTimes
ld a, [hl]
pop hl
call Function383d
.ok2
- ld hl, DefaultFlypoint
+ ld hl, wd002
inc [hl]
pop de
pop hl
@@ -45321,7 +45321,7 @@
ld bc, $2b
add hl, bc
ld bc, $20
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
call AddNTimes
ld de, TempMonDVs
ld a, [hli]
@@ -45329,7 +45329,7 @@
inc de
ld a, [hli]
ld [de], a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld [CurPartyMon], a
ld a, $3
ld [MonType], a
@@ -51160,7 +51160,7 @@
lb bc, BANK(GFX_9090b), 1
call Request1bpp
xor a
- ld [DefaultFlypoint], a
+ ld [wd002], a
.asm_90936
hlcoord 0, 12
lb bc, 4, 18
@@ -51191,7 +51191,7 @@
call PrintText
call YesNoBox
jr c, .asm_90936
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld [StringBuffer2], a
call Function663
call LoadStandardFont
@@ -53251,7 +53251,7 @@
jr .exit
.pressedA
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld l, a
ld h, 0
add hl, hl
@@ -53260,7 +53260,7 @@
ld a, [hl]
.exit
- ld [DefaultFlypoint], a
+ ld [wd002], a
pop af
ld [hInMenu], a
call WhiteBGMap
@@ -53270,7 +53270,7 @@
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld [hBGMapAddress + 1], a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld e, a
ret
; 91b73
@@ -53290,7 +53290,7 @@
ret
.ScrollNext
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [hl]
cp d
jr nz, .NotAtEndYet
@@ -53305,7 +53305,7 @@
jr .Finally
.ScrollPrev
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [hl]
cp e
jr nz, .NotAtStartYet
@@ -53384,7 +53384,7 @@
.Name
; We need the map location of the default flypoint
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld l, a
ld h, 0
add hl, hl ; two bytes per flypoint
@@ -53401,7 +53401,7 @@
; 91c17
GetMapCursorCoordinates: ; 91c17
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld l, a
ld h, $0
add hl, hl
@@ -53534,7 +53534,7 @@
; Start from New Bark Town
ld a, FLY_NEW_BARK
- ld [DefaultFlypoint], a
+ ld [wd002], a
; Flypoints begin at New Bark Town...
ld [StartFlypoint], a
@@ -53578,7 +53578,7 @@
; Because Indigo Plateau is the first flypoint the player
; visits, it's made the default flypoint
- ld [DefaultFlypoint], a
+ ld [wd002], a
; Fill out the map
call FillKantoMap
@@ -53592,7 +53592,7 @@
; Start from New Bark Town
ld a, FLY_NEW_BARK
- ld [DefaultFlypoint], a
+ ld [wd002], a
; Flypoints begin at New Bark Town...
ld [StartFlypoint], a
@@ -53620,12 +53620,12 @@
; 91d11
Function91d11: ; 91d11
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
push af
ld a, [wd003]
push af
ld a, e
- ld [DefaultFlypoint], a
+ ld [wd002], a
call ClearSprites
xor a
ld [hBGMapMode], a
@@ -53682,7 +53682,7 @@
pop af
ld [wd003], a
pop af
- ld [DefaultFlypoint], a
+ ld [wd002], a
ret
; 91d9b
@@ -53807,7 +53807,7 @@
call Function91ea9
ret c
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld e, a
callba GetLandmarkCoords
ld c, e
@@ -53863,7 +53863,7 @@
; 91ea9
Function91ea9: ; 91ea9
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@@ -53894,7 +53894,7 @@
; 91ed0
Function91ed0: ; 91ed0
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp FAST_SHIP
jr z, .asm_91ede
callba GetPlayerIcon
@@ -54129,7 +54129,7 @@
Function92311: ; 92311
xor a
- ld [DefaultFlypoint], a
+ ld [wd002], a
call WhiteBGMap
call ClearTileMap
call ClearSprites
@@ -54183,7 +54183,7 @@
jr .asm_9239f
.pressedA
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld l, a
ld h, 0
add hl, hl
@@ -54192,7 +54192,7 @@
ld a, [hl]
.asm_9239f
- ld [DefaultFlypoint], a
+ ld [wd002], a
pop af
ld [hInMenu], a
call WhiteBGMap
@@ -54202,7 +54202,7 @@
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld [hBGMapAddress + 1], a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld e, a
ret
; 923b8
@@ -54218,7 +54218,7 @@
ret
.asm_923c6
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [hl]
cp FLY_INDIGO
jr c, .asm_923d0
@@ -54228,7 +54228,7 @@
jr .asm_923dd
.asm_923d3
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [hl]
and a
jr nz, .asm_923dc
@@ -54237,7 +54237,7 @@
dec [hl]
.asm_923dd
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp KANTO_FLYPOINT
jr c, .johto
@@ -61021,13 +61021,13 @@
Functione14d9: ; e14d9
call Functione1481
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a
call Functione1463
ld a, [hli]
ld b, [hl]
ld c, a
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp $e0
jr z, .asm_e14f2
ld hl, Unknown_e150f
@@ -61049,7 +61049,7 @@
add c
ld [de], a
inc de
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
add [hl]
ld [de], a
inc hl
@@ -64180,7 +64180,7 @@
ld bc, $b
ld a, [CurPartyMon]
call AddNTimes
- ld de, DefaultFlypoint
+ ld de, wd002
ld bc, $b
call CopyBytes
ret
@@ -64540,7 +64540,7 @@
.asm_e3745
ld b, $4
- ld de, DefaultFlypoint
+ ld de, wd002
callba Function116c1
call ClearTileMap
call LoadStandardFont
@@ -64550,13 +64550,13 @@
call GetBoxName
ld e, l
ld d, h
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld c, $8
call InitString
ld a, [MenuSelection]
dec a
call GetBoxName
- ld de, DefaultFlypoint
+ ld de, wd002
call CopyName2
ret
; e3778 (38:7778)
@@ -68032,7 +68032,7 @@
; fb5dd
Functionfb5dd: ; fb5dd
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld d, a
ld a, [PartyCount]
ld b, a
--- a/misc/mobile_22.asm
+++ b/misc/mobile_22.asm
@@ -38,7 +38,7 @@
ret
Function8917a: ; 8917a (22:517a)
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld bc, $32
xor a
call ByteFill
@@ -484,7 +484,7 @@
push bc
ld hl, 0
add hl, bc
- ld de, DefaultFlypoint
+ ld de, wd002
ld c, 6
call Function89193
pop bc
@@ -1365,8 +1365,8 @@
Function898be: ; 898be
push bc
- ld de, DefaultFlypoint
- ld hl, DefaultFlypoint
+ ld de, wd002
+ ld hl, wd002
call Function89331
jr nc, .asm_898cd
ld de, String_89116
@@ -3106,7 +3106,7 @@
Function8a3a2: ; 8a3a2 (22:63a2)
ld a, [MenuSelection2]
dec a
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld e, a
ld d, $0
add hl, de
@@ -3141,7 +3141,7 @@
ld hl, $a603
call Function89b45
call CloseSRAM
- ld hl, DefaultFlypoint
+ ld hl, wd002
jr c, .asm_8a3f8
ld de, Unknown_8a408
call Function8a400
@@ -3620,7 +3620,7 @@
push bc
ld hl, $0
add hl, bc
- ld de, DefaultFlypoint
+ ld de, wd002
ld c, $6
call Function89185
pop bc
@@ -3641,7 +3641,7 @@
Function8a78c: ; 8a78c (22:678c)
call Function891fe
- ld de, DefaultFlypoint
+ ld de, wd002
ld b, $5
callba Function116c1
call OpenSRAMBank4
@@ -3651,7 +3651,7 @@
add hl, bc
ld d, h
ld e, l
- ld hl, DefaultFlypoint
+ ld hl, wd002
call InitName
call CloseSRAM
call DelayFrame
@@ -3701,7 +3701,7 @@
Function8a818: ; 8a818 (22:6818)
call Function89a23
- ld hl, DefaultFlypoint
+ ld hl, wd002
call Function89331
jr c, .asm_8a875
ld hl, wd008
@@ -3716,7 +3716,7 @@
add hl, bc
ld d, h
ld e, l
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld c, $6
call Function89193
pop bc
@@ -3851,7 +3851,7 @@
push bc
ld h, b
ld l, c
- ld de, DefaultFlypoint
+ ld de, wd002
ld bc, $25
call CopyBytes
pop de
@@ -3865,7 +3865,7 @@
ld bc, $25
call CopyBytes
pop de
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld bc, $25
call CopyBytes
ld de, SFX_SWITCH_POKEMON
--- a/misc/mobile_22_2.asm
+++ b/misc/mobile_22_2.asm
@@ -887,7 +887,7 @@
Function8b855: ; 8b855
ld a, $28
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld [hli], a
ld c, $28
xor a
@@ -1061,7 +1061,7 @@
ret
Function8b99f: ; 8b99f (22:799f)
- ld hl, DefaultFlypoint
+ ld hl, wd002
dec a
ld c, a
ld b, $0
@@ -1135,7 +1135,7 @@
scf
.asm_8ba0c
push af
- ld hl, DefaultFlypoint
+ ld hl, wd002
.asm_8ba10
ld a, [de]
inc de
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -5573,7 +5573,7 @@
ld [wd003], a
ld a, [wcd4c]
dec a
- ld [DefaultFlypoint], a
+ ld [wd002], a
call Function102b9c
call Function102bdc
jr c, .asm_10256d
@@ -6003,7 +6003,7 @@
ld [wcd52], a
ld a, [wcd4c]
dec a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld a, [wcd4d]
dec a
ld [wd003], a
@@ -6679,7 +6679,7 @@
ld a, [wJumptableIndex]
dec a
call Function102d34
- ld de, DefaultFlypoint
+ ld de, wd002
ld bc, $002f
call CopyBytes
ld a, [wJumptableIndex]
@@ -6705,7 +6705,7 @@
call Function102d34
ld d, h
ld e, l
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld bc, $002f
call CopyBytes
ret
@@ -8068,7 +8068,7 @@
callba Script_reloadmappart
callba Function4a94e
jr c, .asm_103870
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld de, wdc5c
ld bc, $0003
call CopyBytes
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -8373,7 +8373,7 @@
ld [rSVBK], a
ld a, $7
call GetSRAMBank
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld de, $b000
ld bc, $1000
call CopyBytes
--- a/misc/mobile_46.asm
+++ b/misc/mobile_46.asm
@@ -1580,7 +1580,7 @@
; 118b42 (46:4b42)
Function118b42: ; 118b42
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, l
ld [wcd51], a
ld a, h
@@ -1780,7 +1780,7 @@
; 118e06
Function118e06: ; 118e06
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [wcd38]
and a
jr z, .asm_118e1d
@@ -2110,7 +2110,7 @@
Function119054: ; 119054
ld a, $6
call GetSRAMBank
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [wcd4f]
ld e, a
ld a, [wcd50]
@@ -2126,7 +2126,7 @@
jr z, .asm_11908a
ld a, $6
ld [rSVBK], a
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld a, [Unkn1Pals]
ld c, a
ld a, [wd001]
@@ -2198,7 +2198,7 @@
ld c, a
ld a, [wd001]
ld b, a
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld de, $a000
call Function119192
ret c
@@ -2211,7 +2211,7 @@
ld c, a
ld a, [wd001]
ld b, a
- ld hl, DefaultFlypoint
+ ld hl, wd002
call Function119192
ret c
@@ -2729,7 +2729,7 @@
ld a, b
ld [wcd49], a
call Function1196cd
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, wd003
Function119471: ; 119471 (46:5471)
@@ -3146,7 +3146,7 @@
; 1196f2 (46:56f2)
Function1196f2: ; 1196f2
- ld hl, DefaultFlypoint
+ ld hl, wd002
.asm_1196f5
call Function118b9a
ret nc
@@ -3314,7 +3314,7 @@
; 1197c9
Function1197c9: ; 1197c9
- ld hl, DefaultFlypoint
+ ld hl, wd002
call Function118e39
ld a, $9
ld [wcd3c], a
@@ -3326,7 +3326,7 @@
call Function119ed8
ret c
call DelayFrame
- ld hl, DefaultFlypoint
+ ld hl, wd002
ld de, wcc60
ld bc, $0080
call CopyBytes
--- a/misc/mobile_5b.asm
+++ b/misc/mobile_5b.asm
@@ -25,17 +25,17 @@
xor a
ld [wJumptableIndex], a
ld [wcf64], a
- ld [DefaultFlypoint], a
+ ld [wd002], a
ld [wd003], a
.asm_16c03e
call DelayFrame
callba Function10635c
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld hl, Jumptable_16c05c
rst JumpTable
call Function16cb2e
call Function16cbae
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
cp $ff
jr nz, .asm_16c03e
ret
@@ -60,7 +60,7 @@
ld a, [wcf64]
and a
ret z
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a
ld [wd003], a
ret
@@ -69,7 +69,7 @@
Function16c081: ; 16c081
push af
ld a, $ff
- ld [DefaultFlypoint], a
+ ld [wd002], a
pop af
ret
; 16c089
@@ -81,7 +81,7 @@
xor a
ld [hWY], a
call Function16c0fa
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
ld [wcf64], a
ret
; 16c09e
@@ -144,7 +144,7 @@
call ClearScreen
push af
ld a, $ff
- ld [DefaultFlypoint], a
+ ld [wd002], a
pop af
ret
; 16c0fa
@@ -151,9 +151,9 @@
Function16c0fa: ; 16c0fa
push af
- ld a, [DefaultFlypoint]
+ ld a, [wd002]
inc a
- ld [DefaultFlypoint], a
+ ld [wd002], a
xor a
ld [wd003], a
pop af
--- a/wram.asm
+++ b/wram.asm
@@ -1400,21 +1400,16 @@
SECTION "WRAM 1", WRAMX, BANK [1]
-MiscBuffer0::
wd000:: ds 1
-MiscBuffer1::
DefaultSpawnpoint::
wd001:: ds 1
wd002::
-MiscBuffer2::
PhoneScriptBank::
-DefaultFlypoint:: ; d002
LuckyNumberDigit1Buffer::
wCurrentRadioLine::
wMovementBufferCount::
ds 1
wd003::
-MiscBuffer3::
LuckyNumberDigit2Buffer::
PhoneCallerLo::
wNextRadioLine::
@@ -1421,19 +1416,16 @@
wMovementBufferPerson::
ds 1
wd004::
-MiscBuffer4::
LuckyNumberDigit3Buffer::
PhoneCallerHi::
wRadioTextDelay::
ds 1
wd005::
-MiscBuffer5::
LuckyNumberDigit4Buffer::
StartFlypoint:: ; d005
wNumRadioLinesPrinted::
ds 1
wd006::
-MiscBuffer6::
LuckyNumberDigit5Buffer::
EndFlypoint:: ; d006
wOaksPkmnTalkSegmentCounter::
@@ -1440,7 +1432,6 @@
ds 1
wd007::
-MiscBuffer7::
MovementBuffer:: ; d007
ds 1