ref: a7cb2a5e9baedeb077f898df4269291dee72be70
parent: 0d4c2776d927e5d3162d9a4430fc82f35bf50be5
author: JimB16 <f1@jimb.de>
date: Wed Sep 9 21:27:07 EDT 2015
changed more labels
--- a/battle/ai/items.asm
+++ b/battle/ai/items.asm
@@ -9,7 +9,7 @@
and a
ret nz
- callba Function3e8d1
+ callba CheckSubstatus_RechargeChargedRampageBideRollout
ret nz
ld a, [PlayerSubStatus5]
@@ -24,6 +24,7 @@
ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers
and a
jr nz, .ok
+
ld a, [TrainerClass]
dec a
ld bc, 7
@@ -787,17 +788,17 @@
; 3851e
Function3851e: ; 3851e
- ld [hMultiplier], a
+ ld [hDivisor], a
ld hl, EnemyMonMaxHP
ld a, [hli]
- ld [hProduct], a
+ ld [hDividend + 0], a
ld a, [hl]
- ld [hMultiplicand], a
+ ld [hDividend + 1], a
ld b, $2
call Divide
- ld a, [$ffb6]
+ ld a, [hQuotient + 2]
ld c, a
- ld a, [$ffb5]
+ ld a, [hQuotient + 1]
ld b, a
ld hl, EnemyMonHP + 1
ld a, [hld]
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -1783,8 +1783,8 @@
ld [hBattleTurn], a
push hl
callab EnemyAttackDamage
- callab BattleCommand62
- callab BattleCommand07
+ callab BattleCommand62_DamageCalcWithStats
+ callab BattleCommand07_CalcDamageTypeMultiplier
pop hl
ld a, [CurDamage + 1]
ld c, a
@@ -3380,8 +3380,8 @@
.asm_39400
callab EnemyAttackDamage
- callab BattleCommand62
- callab BattleCommand07
+ callab BattleCommand62_DamageCalcWithStats
+ callab BattleCommand07_CalcDamageTypeMultiplier
ret
.ConstantDamageEffects
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -49,14 +49,14 @@
call DelayFrames
.asm_3c04c
- call Function309d
- call Function3d873
+ call LoadTileMapToTempTileMap
+ call CheckPlayerPartyForFitPkmn
ld a, d
and a
jp z, LostBattle
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
ld a, [BattleType]
- cp $2
+ cp BATTLETYPE_DEBUG
jp z, .asm_3c0e2
cp BATTLETYPE_TUTORIAL
jp z, .asm_3c0e2
@@ -85,7 +85,7 @@
hlcoord 1, 5
ld a, $9
call Function3d490
- call Function309d
+ call LoadTileMapToTempTileMap
call Function3d57a
call Function3da0d
call ResetPlayerStatLevels
@@ -94,7 +94,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
call SpikesDamage
ld a, [InLinkBattle]
@@ -122,7 +122,7 @@
WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
ld a, [wd0ee]
and $c0
add $2
@@ -306,7 +306,7 @@
call Function3de97
call Function3dcf9
call UpdateBattleMonInParty
- call Function309d
+ call LoadTileMapToTempTileMap
jp Function3c4df
; 3c23c
@@ -321,7 +321,7 @@
.asm_3c24a
call HasEnemyFainted
jr nz, .asm_3c258
- call Function3cd55
+ call Handle_EnemyPkmnFainted
ld a, [BattleEnded]
and a
jr nz, .asm_3c25a
@@ -338,7 +338,7 @@
Function3c25c: ; 3c25c
call HasEnemyFainted
jr nz, .asm_3c26a
- call Function3cd55
+ call Handle_EnemyPkmnFainted
ld a, [BattleEnded]
and a
jr nz, .asm_3c27a
@@ -422,7 +422,7 @@
pop hl
ld [hl], a
call GetItemName
- ld hl, BattleText_0x80bde
+ ld hl, BattleText_UsersStringBuffer1Activated
call StdBattleTextBox
callab BattleCommand8c
pop af
@@ -647,7 +647,7 @@
ld [FXAnimIDLo], a
call Function3e4bc
push af
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
call UpdateBattleHuds
ld a, [CurPlayerMove]
cp STRUGGLE
@@ -748,7 +748,7 @@
ld hl, PlayerSubStatus5
res SUBSTATUS_ENCORED, [hl]
call SetEnemyTurn
- ld hl, BattleText_0x80c8a
+ ld hl, BattleText_TargetsEncoreEnded
jp StdBattleTextBox
.asm_3c518
@@ -772,7 +772,7 @@
ld hl, EnemySubStatus5
res SUBSTATUS_ENCORED, [hl]
call SetPlayerTurn
- ld hl, BattleText_0x80c8a
+ ld hl, BattleText_TargetsEncoreEnded
jp StdBattleTextBox
; 3c543
@@ -937,7 +937,7 @@
Function3c5fe: ; 3c5fe
- call Function309d
+ call LoadTileMapToTempTileMap
call Function3c543
jp c, WildFled_EnemyFled_LinkBattleCanceled
call SetEnemyTurn
@@ -954,12 +954,12 @@
call HasPlayerFainted
jp z, Function3d14e
call HasEnemyFainted
- jp z, Function3cd55
+ jp z, Handle_EnemyPkmnFainted
.asm_3c62f
call SetEnemyTurn
call ResidualDamage
- jp z, Function3cd55
+ jp z, Handle_EnemyPkmnFainted
call RefreshBattleHuds
call Function3c6cf
call Function3d2e0
@@ -968,7 +968,7 @@
and a
ret nz
call HasEnemyFainted
- jp z, Function3cd55
+ jp z, Handle_EnemyPkmnFainted
call HasPlayerFainted
jp z, Function3d14e
call SetPlayerTurn
@@ -994,7 +994,7 @@
call Function3d2e0
ret c
call HasEnemyFainted
- jp z, Function3cd55
+ jp z, Handle_EnemyPkmnFainted
call HasPlayerFainted
jp z, Function3d14e
push bc
@@ -1006,7 +1006,7 @@
call RefreshBattleHuds
pop af
jr c, .asm_3c6be
- call Function309d
+ call LoadTileMapToTempTileMap
call Function3c543
jp c, WildFled_EnemyFled_LinkBattleCanceled
call Function3c6de
@@ -1018,12 +1018,12 @@
call HasPlayerFainted
jp z, Function3d14e
call HasEnemyFainted
- jp z, Function3cd55
+ jp z, Handle_EnemyPkmnFainted
.asm_3c6be
call SetEnemyTurn
call ResidualDamage
- jp z, Function3cd55
+ jp z, Handle_EnemyPkmnFainted
call RefreshBattleHuds
xor a
ld [wd0ec], a
@@ -1068,12 +1068,12 @@
jr z, HasPlayerFainted
HasEnemyFainted: ; 3c70b
ld hl, EnemyMonHP
- jr Function3c713
+ jr CheckIfHPIsZero
HasPlayerFainted: ; 3c710
ld hl, BattleMonHP
-Function3c713: ; 3c713
+CheckIfHPIsZero: ; 3c713
ld a, [hli]
or [hl]
ret
@@ -1334,11 +1334,11 @@
.asm_3c8d3
call GetSixteenthMaxHP
call Function3cc3f
- ld hl, BattleText_0x80de2
+ ld hl, BattleText_UsersHurtByStringBuffer1
jr .asm_3c8e1
.asm_3c8de
- ld hl, BattleText_0x80df5
+ ld hl, BattleText_UserWasReleasedFromStringBuffer1
.asm_3c8e1
jp StdBattleTextBox
@@ -1823,7 +1823,7 @@
xor a
ld [wcfca], a
ld de, ANIM_IN_SANDSTORM
- call Function3ee17
+ call Call_PlayBattleAnim
call SwitchTurnCore
call GetEighthMaxHP
call Function3cc3f
@@ -1868,6 +1868,7 @@
; 3cc3f
Function3cc3f: ; 3cc3f
+; Subtract HP from Pkmn
call Function3cc45
jp Function3cd36
; 3cc45
@@ -1892,6 +1893,7 @@
ld [hl], a
ld [wd1ef], a
ret nc
+
ld a, [wd1ec]
ld c, a
ld a, [wd1ed]
@@ -2095,16 +2097,16 @@
ret
; 3cd55
-Function3cd55: ; 3cd55
- call Function3cf14
+Handle_EnemyPkmnFainted: ; 3cd55
+ call EnemyPkmnFainted_TextSFX
ld hl, BattleMonHP
ld a, [hli]
or [hl]
- call z, Function3cef1
+ call z, PlayerPkmnFainted_TextSFX
xor a
ld [wc6f7], a
call Function3ce01
- call Function3d873
+ call CheckPlayerPartyForFitPkmn
ld a, d
and a
jp z, LostBattle
@@ -2128,8 +2130,8 @@
ret
.asm_3cd8c
- call Function3cf35
- jp z, Function3cfa4
+ call CheckIfOTPartyHasPkmnToBattleWith
+ jp z, HandlePlayerWonBattle
ld hl, BattleMonHP
ld a, [hli]
@@ -2183,7 +2185,7 @@
ld a, $1
call EnemyPartyMonEntrance
call ClearSprites
- call Function309d
+ call LoadTileMapToTempTileMap
pop af
ld [CurPartyMon], a
call Function3d2b3
@@ -2236,19 +2238,19 @@
call Function3d1aa
.asm_3ce47
- call Function3d873
+ call CheckPlayerPartyForFitPkmn
ld a, d
and a
ret z
ld a, [IsInBattle]
dec a
- call z, Function3d0ea
+ call z, PlayVictoryMusic
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [wd0ee]
and $c0
ld [wd0ee], a
- call Function3ceaa
+ call ShareExperiencePoints
jr z, .asm_3ce72
ld hl, EnemyMonBaseStats
ld b, $7
@@ -2265,8 +2267,8 @@
call CopyBytes
xor a
ld [wc71f], a
- call Function3ee3b
- call Function3ceaa
+ call GiveExperiencePoints
+ call ShareExperiencePoints
ret z
ld a, [wc664]
push af
@@ -2278,13 +2280,13 @@
call CopyBytes
ld a, $1
ld [wc71f], a
- call Function3ee3b
+ call GiveExperiencePoints
pop af
ld [wc664], a
ret
; 3ceaa
-Function3ceaa: ; 3ceaa
+ShareExperiencePoints: ; 3ceaa
ld a, [PartyCount]
ld b, a
ld hl, PartyMon1
@@ -2348,7 +2350,7 @@
ret
; 3cef1
-Function3cef1: ; 3cef1
+PlayerPkmnFainted_TextSFX: ; 3cef1
call Function3ceec
call WaitSFX
ld a, $f0
@@ -2363,7 +2365,7 @@
jp StdBattleTextBox
; 3cf14
-Function3cf14: ; 3cf14
+EnemyPkmnFainted_TextSFX: ; 3cf14
call WaitSFX
ld de, SFX_KINESIS
call PlaySFX
@@ -2377,7 +2379,7 @@
jp StdBattleTextBox
; 3cf35
-Function3cf35: ; 3cf35
+CheckIfOTPartyHasPkmnToBattleWith: ; 3cf35
ld a, [OTPartyCount]
ld b, a
xor a
@@ -2401,15 +2403,18 @@
call Function3e12e
call WaitBGMap
callba Function2c012
+
ld a, [InLinkBattle]
and a
jr z, .asm_3cf6d
+
call Function3e8e4
ld a, [wBattleAction]
cp $f
ret z
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
+
.asm_3cf6d
ld hl, BattleMonHP
ld a, [hli]
@@ -2430,6 +2435,7 @@
pop af
and a
jr nz, .asm_3cf8f
+
call Function3d4e1
jr .asm_3cf92
@@ -2447,7 +2453,8 @@
ret
; 3cfa4
-Function3cfa4: ; 3cfa4
+HandlePlayerWonBattle: ; 3cfa4
+; Player won the battle
call Function3ceec
ld a, $1
ld [wc6fd], a
@@ -2455,12 +2462,14 @@
ld a, [InLinkBattle]
and a
ld a, b
- call z, Function3d0ea
+ call z, PlayVictoryMusic
callab Battle_GetTrainerName
ld hl, BattleText_EnemyWasDefeated
call StdBattleTextBox
+
call IsMobileBattle
jr z, .asm_3cff5
+
ld a, [InLinkBattle]
and a
ret nz
@@ -2658,7 +2667,7 @@
ret
; 3d0ea
-Function3d0ea: ; 3d0ea
+PlayVictoryMusic: ; 3d0ea
push de
ld de, MUSIC_NONE
call PlayMusic
@@ -2668,7 +2677,7 @@
dec a
jr nz, .asm_3d113
push de
- call Function3ceaa
+ call ShareExperiencePoints
pop de
jr nz, .asm_3d11e
ld hl, wPayDayMoney
@@ -2751,15 +2760,15 @@
Function3d14e: ; 3d14e
- call Function3cef1
+ call PlayerPkmnFainted_TextSFX
ld hl, EnemyMonHP
ld a, [hli]
or [hl]
- call z, Function3cf14
+ call z, EnemyPkmnFainted_TextSFX
ld a, $1
ld [wc6f7], a
call Function3d1aa
- call Function3d873
+ call CheckPlayerPartyForFitPkmn
ld a, d
and a
jp z, LostBattle
@@ -2776,8 +2785,8 @@
ret
.asm_3d17f
- call Function3cf35
- jp z, Function3cfa4
+ call CheckIfOTPartyHasPkmnToBattleWith
+ jp z, HandlePlayerWonBattle
.asm_3d185
call Function3d1f8
@@ -2840,7 +2849,7 @@
Function3d1f8: ; 3d1f8
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [IsInBattle]
and a
dec a
@@ -2861,7 +2870,7 @@
jr z, .asm_3d20a
ld hl, PartyMon1Speed
ld de, EnemyMonSpeed
- jp Function3d8b3
+ jp TryToRunAwayFromBattle
; 3d227
Function3d227: ; 3d227
@@ -2891,10 +2900,10 @@
call WhiteBGMap
call Function3eda6
call ExitMenu
- call Function309d
+ call LoadTileMapToTempTileMap
call WaitBGMap
call ClearSGB
- call Function32f9
+ call SetPalettes
xor a
ld c, a
ret
@@ -2913,13 +2922,13 @@
call Function3eda6
call WriteBackup
call ClearSGB
- call Function32f9
+ call SetPalettes
call SendOutPkmnText
call NewBattleMonStatus
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
call SpikesDamage
ld a, $1
@@ -2941,7 +2950,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
jp SpikesDamage
; 3d2e0
@@ -2985,7 +2994,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
; 3d329
@@ -3020,7 +3029,7 @@
cp [hl]
jr nz, .notout
- ld hl, BattleText_0x80c0d
+ ld hl, BattleText_PkmnIsAlreadyOut
call StdBattleTextBox
scf
ret
@@ -3125,12 +3134,12 @@
; Greyscale
ld b, 0
call GetSGBLayout
- call Function32f9
+ call SetPalettes
jr .end
.LostLinkBattle
call UpdateEnemyMonInParty
- call Function3cf35
+ call CheckIfOTPartyHasPkmnToBattleWith
jr nz, .asm_3d40a
ld hl, TiedAgainstText
ld a, [wd0ee]
@@ -3317,7 +3326,7 @@
ld [wd0ec], a
inc a
ld [wEnemyIsSwitching], a
- call Function309d
+ call LoadTileMapToTempTileMap
jp Function3e3ad
; 3d517
@@ -3603,6 +3612,7 @@
ld [TempEnemyMonSpecies], a
ld [CurPartySpecies], a
call LoadEnemyMon
+
ld a, [CurPartySpecies]
cp UNOWN
jr nz, .asm_3d708
@@ -3614,6 +3624,7 @@
ld a, [UnownLetter]
ld [wdef4], a
.asm_3d708
+
ld hl, EnemyMonHP
ld a, [hli]
ld [wc6ea], a
@@ -3727,7 +3738,7 @@
ld [wc689], a
call SetEnemyTurn
ld de, ANIM_SEND_OUT_MON
- call Function3ee17
+ call Call_PlayBattleAnim
call Function3da79
jr nc, .asm_3d800
@@ -3734,7 +3745,7 @@
ld a, 1 ; shiny anim
ld [wc689], a
ld de, ANIM_SEND_OUT_MON
- call Function3ee17
+ call Call_PlayBattleAnim
.asm_3d800
ld bc, TempMonSpecies
@@ -3796,7 +3807,8 @@
ret
; 3d873
-Function3d873: ; 3d873
+CheckPlayerPartyForFitPkmn: ; 3d873
+; Has the player any Pkmn in his Party that can fight?
ld a, [PartyCount]
ld e, a
xor a
@@ -3846,9 +3858,10 @@
; 3d8b3
-Function3d8b3: ; 3d8b3
+TryToRunAwayFromBattle: ; 3d8b3
+; Run away from battle, with or without item
ld a, [BattleType]
- cp $2
+ cp BATTLETYPE_DEBUG
jp z, .asm_3d9a2
cp BATTLETYPE_CONTEST
jp z, .asm_3d9a2
@@ -3891,7 +3904,7 @@
call SetPlayerTurn
call GetItemName
- ld hl, BattleText_0x80b89
+ ld hl, BattleText_UserFledUsingAStringBuffer1
call StdBattleTextBox
jp .asm_3d9a2
@@ -3908,7 +3921,7 @@
ld [hStringCmpString1 + 0], a
ld a, [de]
ld [hStringCmpString1 + 1], a
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
ld de, hStringCmpString2
ld hl, hStringCmpString1
ld c, $2
@@ -3973,7 +3986,7 @@
call StdBattleTextBox
ld a, $1
ld [wd266], a
- call Function309d
+ call LoadTileMapToTempTileMap
and a
ret
@@ -3982,7 +3995,7 @@
and a
ld a, $2
jr z, .asm_3d9cf
- call Function309d
+ call LoadTileMapToTempTileMap
xor a
ld [wd0ec], a
ld a, $f
@@ -3990,7 +4003,7 @@
xor a
ld [CurPlayerMove], a
call Function3e8e4
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
call Function3d2e0
jr c, .asm_3d9f5
@@ -4015,7 +4028,7 @@
ld hl, BattleText_GotAwaySafely
call StdBattleTextBox
call WaitSFX
- call Function309d
+ call LoadTileMapToTempTileMap
scf
ret
@@ -4029,7 +4042,7 @@
.asm_3da05
call WaitSFX
- call Function309d
+ call LoadTileMapToTempTileMap
scf
ret
; 3da0d
@@ -4193,7 +4206,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld hl, EnemyMonHP
ld a, [hli]
or [hl]
@@ -4230,13 +4243,13 @@
ld [wcfca], a
ld [wc689], a
ld de, ANIM_SEND_OUT_MON
- call Function3ee17
+ call Call_PlayBattleAnim
call Function3da74
jr nc, .asm_3dbbc
ld a, $1
ld [wc689], a
ld de, ANIM_SEND_OUT_MON
- call Function3ee17
+ call Call_PlayBattleAnim
.asm_3dbbc
ld a, PartyMon1Species - PartyMon1
@@ -4320,7 +4333,7 @@
push bc
- ld hl, BattleText_0x80bae ; "hurt by SPIKES!"
+ ld hl, BattleText_UserHurtBySpikes ; "hurt by SPIKES!"
call StdBattleTextBox
call GetEighthMaxHP
@@ -4422,7 +4435,7 @@
ld [hBattleTurn], a
ld [wcfca], a
ld de, ANIM_RETURN_MON
- call Function3ee17
+ call Call_PlayBattleAnim
pop af
ld [hBattleTurn], a
ret
@@ -4732,7 +4745,7 @@
ld [bc], a
ld [de], a
call GetItemName
- ld hl, BattleText_0x80bde
+ ld hl, BattleText_UsersStringBuffer1Activated
call StdBattleTextBox
callab BattleCommand8c
ret
@@ -5101,10 +5114,10 @@
BattleMenu: ; 3e139
xor a
ld [hBGMapMode], a
- call Function30bf
+ call LoadTempTileMapToTileMap
ld a, [BattleType]
- cp $2
+ cp BATTLETYPE_DEBUG
jr z, .ok
cp BATTLETYPE_TUTORIAL
jr z, .ok
@@ -5111,7 +5124,7 @@
call EmptyBattleTextBox
call UpdateBattleHuds
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
.ok
.loop
@@ -5126,7 +5139,7 @@
ld a, [InputType]
or a
jr z, .asm_3e171
- callba Function1de294
+ callba Start_DudeAutoInput_DownA
.asm_3e171
call LoadBattleMenu2
@@ -5150,7 +5163,7 @@
BattleMenu_Fight: ; 3e192
xor a
ld [wd267], a
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
and a
ret
; 3e19b
@@ -5229,12 +5242,12 @@
call ExitMenu
call WaitBGMap
call Function3ee27
- call Function309d
+ call LoadTileMapToTempTileMap
jp BattleMenu
; 3e22b
ItemsCantBeUsed: ; 3e22b
- ld hl, BattleText_0x80bf3
+ ld hl, BattleText_ItemsCantBeUsedHere
call StdBattleTextBox
jp BattleMenu
; 3e234
@@ -5266,7 +5279,7 @@
call ExitMenu
call Function3df2c
call WaitBGMap
- call Function309d
+ call LoadTileMapToTempTileMap
call Function1fbf
call Function3ee27
and a
@@ -5279,7 +5292,7 @@
and $c0
ld [wd0ee], a
call Function1fbf
- call Function32f9
+ call SetPalettes
scf
ret
; 3e28d
@@ -5328,9 +5341,9 @@
call DelayFrame
call Function3eda6
call WriteBackup
- call Function309d
+ call LoadTileMapToTempTileMap
call ClearSGB
- call Function32f9
+ call SetPalettes
jp BattleMenu
; 3e2f5
@@ -5382,7 +5395,7 @@
ld a, [CurPartyMon]
cp d
jr nz, .asm_3e36b
- ld hl, BattleText_0x80c0d
+ ld hl, BattleText_PkmnIsAlreadyOut
call StdBattleTextBox
jp Function3e299
@@ -5395,7 +5408,7 @@
jr z, .asm_3e381
.asm_3e378
- ld hl, BattleText_0x80c22
+ ld hl, BattleText_PkmnCantBeRecalled
call StdBattleTextBox
jp Function3e299
@@ -5412,7 +5425,7 @@
call Function3eda6
call WriteBackup
call ClearSGB
- call Function32f9
+ call SetPalettes
ld a, [CurPartyMon]
ld [CurBattleMon], a
; fallthrough
@@ -5475,7 +5488,7 @@
; 3e40b
BattleMonEntrance: ; 3e40b
- call Function3f2f4
+ call BattleMonNickComma_TextBox
ld c, 50
call DelayFrames
@@ -5503,7 +5516,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
call SpikesDamage
ld a, $2
@@ -5525,10 +5538,10 @@
call Function3da0d
xor a
ld [wd265], a
- call Function3ecab
+ call ApplyStatLevelMultiplierOnAllStats
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
jp SpikesDamage
; 3e489
@@ -5535,12 +5548,12 @@
BattleMenu_Run: ; 3e489
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
ld a, $3
ld [wcfa9], a
ld hl, BattleMonSpeed
ld de, EnemyMonSpeed
- call Function3d8b3
+ call TryToRunAwayFromBattle
ld a, $0
ld [wd266], a
ret c
@@ -5754,15 +5767,15 @@
ret
.asm_3e60b
- ld hl, BattleText_0x80c5b
+ ld hl, BattleText_TheMoveIsDisabled
jr .asm_3e613
.asm_3e610
- ld hl, BattleText_0x80c39
+ ld hl, BattleText_TheresNoPPLeftForThisMove
.asm_3e613
call StdBattleTextBox
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
jp Function3e4bc
; 3e61c
@@ -6019,7 +6032,7 @@
ret nz
.asm_3e7b4
- ld hl, BattleText_0x80c72
+ ld hl, BattleText_PkmnHasNoMovesLeft
call StdBattleTextBox
ld c, 60
call DelayFrames
@@ -6037,11 +6050,11 @@
and a
jr z, .asm_3e817
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [wd0ec]
and a
call z, Function3e8e4
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
ld a, [wBattleAction]
cp $e
jp z, .asm_3e8bd
@@ -6048,7 +6061,7 @@
cp $d
jp z, .asm_3e82c
cp NUM_MOVES
- jp nc, Function3e8c1
+ jp nc, ResetVarsForSubstatusRage
ld [CurEnemyMoveNum], a
ld c, a
ld a, [EnemySubStatus1]
@@ -6076,8 +6089,8 @@
jp .asm_3e87f
.asm_3e824
- call Function3e8d1
- jp nz, Function3e8c1
+ call CheckSubstatus_RechargeChargedRampageBideRollout
+ jp nz, ResetVarsForSubstatusRage
jr .asm_3e830
.asm_3e82c
@@ -6142,7 +6155,7 @@
.asm_3e882
call SetEnemyTurn
callab UpdateMoveData
- call Function3e8d1
+ call CheckSubstatus_RechargeChargedRampageBideRollout
jr nz, .asm_3e894
xor a
ld [wc733], a
@@ -6178,7 +6191,7 @@
jr .asm_3e87f
; 3e8c1
-Function3e8c1: ; 3e8c1
+ResetVarsForSubstatusRage: ; 3e8c1
xor a
ld [EnemyFuryCutterCount], a
ld [EnemyProtectCount], a
@@ -6188,14 +6201,16 @@
ret
; 3e8d1
-Function3e8d1: ; 3e8d1
+CheckSubstatus_RechargeChargedRampageBideRollout: ; 3e8d1
ld a, [EnemySubStatus4]
and 1 << SUBSTATUS_RECHARGE
ret nz
+
ld hl, EnemySubStatus3
ld a, [hl]
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
ret nz
+
ld hl, EnemySubStatus1
bit SUBSTATUS_ROLLOUT, [hl]
ret
@@ -6987,10 +7002,11 @@
ret
; 3ecab
-Function3ecab: ; 3ecab
+ApplyStatLevelMultiplierOnAllStats: ; 3ecab
+; Apply StatLevelMultipliers on all 5 Stats
ld c, 0
.asm_3ecad
- call Function3ecb7
+ call ApplyStatLevelMultiplier
inc c
ld a, c
cp 5
@@ -6998,7 +7014,7 @@
ret
; 3ecb7
-Function3ecb7: ; 3ecb7
+ApplyStatLevelMultiplier: ; 3ecb7
push bc
push bc
ld a, [wd265]
@@ -7309,7 +7325,7 @@
ret nz
; 3ee17
-Function3ee17: ; 3ee17
+Call_PlayBattleAnim: ; 3ee17
ld a, e
ld [FXAnimIDLo], a
ld a, d
@@ -7325,7 +7341,7 @@
push hl
ld b, $1
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
pop hl
pop de
@@ -7335,7 +7351,7 @@
; 3ee3b
-Function3ee3b: ; 3ee3b
+GiveExperiencePoints: ; 3ee3b
; Give experience.
ld a, [InLinkBattle]
and a
@@ -7467,7 +7483,7 @@
ld a, [CurPartyMon]
ld hl, PartyMonNicknames
call GetNick
- ld hl, UnknownText_0x3f11b
+ ld hl, Text_PkmnGainedExpPoint
call BattleTextBox
ld a, [StringBuffer2 + 1]
ld [$ffb6], a
@@ -7476,7 +7492,7 @@
pop bc
call Function3f136
push bc
- call Function309d
+ call LoadTileMapToTempTileMap
pop bc
ld hl, $000a
add hl, bc
@@ -7623,12 +7639,12 @@
.asm_3f012
xor a
ld [wd265], a
- call Function3ecab
+ call ApplyStatLevelMultiplierOnAllStats
callab Function3ec2c
callab BadgeStatBoosts
callab UpdatePlayerHUD
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, $1
ld [hBGMapMode], a
@@ -7642,9 +7658,9 @@
ld de, SFX_HIT_END_OF_EXP_BAR
call PlaySFX
call WaitSFX
- ld hl, BattleText_0x80c9c
+ ld hl, BattleText_StringBuffer1GrewToLevel
call StdBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
.asm_3f057
xor a
@@ -7660,7 +7676,7 @@
ld c, $1e
call DelayFrames
call Functiona80
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
xor a
ld [MonType], a
ld a, [CurSpecies]
@@ -7728,14 +7744,14 @@
ld c, $7
.asm_3f0ef
xor a
- ld [hProduct], a
+ ld [hDividend + 0], a
ld a, [hl]
- ld [hMultiplicand], a
+ ld [hDividend + 1], a
ld a, [wd265]
- ld [hMultiplier], a
+ ld [hDivisor], a
ld b, $2
call Divide
- ld a, [$ffb6]
+ ld a, [hQuotient + 2]
ld [hli], a
dec c
jr nz, .asm_3f0ef
@@ -7759,30 +7775,30 @@
ret
; 3f11b
-UnknownText_0x3f11b: ; 3f11b
- text_jump UnknownText_0x1c029c
+Text_PkmnGainedExpPoint: ; 3f11b
+ text_jump Text_Gained
start_asm
- ld hl, UnknownText_0x3f131
+ ld hl, TextJump_StringBuffer2ExpPoints
ld a, [StringBuffer2 + 2] ; IsTradedMon
and a
ret z
- ld hl, UnknownText_0x3f12c
+
+ ld hl, TextJump_ABoostedStringBuffer2ExpPoints
ret
; 3f12c
-UnknownText_0x3f12c: ; 3f12c
- text_jump UnknownText_0x1c02a9
+TextJump_ABoostedStringBuffer2ExpPoints: ; 3f12c
+ text_jump Text_ABoostedStringBuffer2ExpPoints
db "@"
; 3f131
-UnknownText_0x3f131: ; 3f131
- text_jump UnknownText_0x1c02c9
+TextJump_StringBuffer2ExpPoints: ; 3f131
+ text_jump Text_StringBuffer2ExpPoints
db "@"
; 3f136
Function3f136: ; 3f136
-
push bc
ld hl, CurPartyMon
@@ -7887,7 +7903,7 @@
call PlaySFX
callba Function8e79d
call WaitSFX
- ld hl, BattleText_0x80c9c
+ ld hl, BattleText_StringBuffer1GrewToLevel
call StdBattleTextBox
pop de
inc e
@@ -8068,17 +8084,19 @@
; 3f2f4
-Function3f2f4: ; 3f2f4
- ld hl, UnknownText_0x3f2fa
+BattleMonNickComma_TextBox: ; 3f2f4
+ ld hl, TextJump_BattleMonNickComma
jp BattleTextBox
; 3f2fa
-UnknownText_0x3f2fa: ; 3f2fa
- text_jump UnknownText_0x1c031d
+TextJump_BattleMonNickComma: ; 3f2fa
+ text_jump Text_BattleMonNickComma
start_asm
; 3f2ff
Function3f2ff: ; 3f2ff
+; Print text to withdraw Pkmn
+; depending on HP the message is different
push de
push bc
ld hl, EnemyMonHP + 1
@@ -8110,41 +8128,45 @@
pop bc
pop de
ld a, [hQuotient + 2]
- ld hl, UnknownText_0x3f348
+ ld hl, TextJump_ThatsEnoughComeBack
and a
ret z
- ld hl, UnknownText_0x3f35b
+
+ ld hl, TextJump_ComeBack
cp $1e
ret c
- ld hl, UnknownText_0x3f34d
+
+ ld hl, TextJump_OKComeBack
cp $46
ret c
- ld hl, UnknownText_0x3f352
+
+ ld hl, TextJump_GoodComeBack
ret
; 3f348
-UnknownText_0x3f348: ; 3f348
- text_jump UnknownText_0x1c0324
+TextJump_ThatsEnoughComeBack: ; 3f348
+ text_jump Text_ThatsEnoughComeBack
db "@"
; 3f34d
-UnknownText_0x3f34d: ; 3f34d
- text_jump UnknownText_0x1c0340
+TextJump_OKComeBack: ; 3f34d
+ text_jump Text_OKComeBack
db "@"
; 3f352
-UnknownText_0x3f352: ; 3f352
- text_jump UnknownText_0x1c0352
+TextJump_GoodComeBack: ; 3f352
+ text_jump Text_GoodComeBack
db "@"
; 3f357
-Function3f357: ; 3f357
- ld hl, UnknownText_0x3f35b
+Function_TextJump_ComeBack: ; 3f357
+; this function doesn't seem to be used
+ ld hl, TextJump_ComeBack
ret
; 3f35b
-UnknownText_0x3f35b: ; 3f35b
- text_jump UnknownText_0x1c0366
+TextJump_ComeBack: ; 3f35b
+ text_jump Text_ComeBack
db "@"
; 3f360
@@ -8155,7 +8177,7 @@
and a
jr z, .asm_3f36d
dec [hl]
- ld hl, BattleText_0x80cba
+ ld hl, BattleText_WildPkmnIsEating
jr .asm_3f388
.asm_3f36d
@@ -8164,7 +8186,7 @@
and a
ret z
dec [hl]
- ld hl, BattleText_0x80cd1
+ ld hl, BattleText_WildPkmnIsAngry
jr nz, .asm_3f388
push hl
ld a, [EnemyMonSpecies]
@@ -8176,7 +8198,7 @@
.asm_3f388
push hl
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
pop hl
jp StdBattleTextBox
; 3f390
@@ -8727,7 +8749,7 @@
ld hl, wPayDayMoney + 2
ld de, Money + 2
call Function3d0be
- ld hl, BattleText_0x80730
+ ld hl, BattleText_PlayerPickuedUpPayDayMoney
call StdBattleTextBox
ld a, [InBattleTowerBattle]
bit 0, a
@@ -8847,7 +8869,7 @@
call Function3200
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld c, $8
call DelayFrames
call Functiona80
@@ -9349,7 +9371,7 @@
call HideSprites
ld b, $1
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, $90
ld [hWY], a
xor a
@@ -9504,7 +9526,7 @@
ld a, 1
ld [wc689], a
ld de, ANIM_SEND_OUT_MON
- call Function3ee17
+ call Call_PlayBattleAnim
.asm_3fcc2
callba CheckSleepingTreeMon
--- a/battle/effect_command_pointers.asm
+++ b/battle/effect_command_pointers.asm
@@ -8,7 +8,7 @@
dw BattleCommand04 ; 34555
dw BattleCommand05 ; 34631
dw BattleCommand06 ; 352dc
- dw BattleCommand07 ; 346d2
+ dw BattleCommand07_CalcDamageTypeMultiplier ; 346d2
dw BattleCommand08 ; 34cfd
dw BattleCommand09 ; 34d32
dw BattleCommand0a ; 34eee
@@ -99,7 +99,7 @@
dw BattleCommand5f ; 377ce
dw BattleCommand60 ; 3784b
dw BattleCommand61 ; 37874
- dw BattleCommand62 ; 35612
+ dw BattleCommand62_DamageCalcWithStats ; 35612
dw BattleCommand63 ; 3790e
dw BattleCommand64 ; 37939
dw BattleCommand65 ; 37972
@@ -170,7 +170,7 @@
dw BattleCommanda6 ; 365af
dw BattleCommanda7 ; 365c3
dw BattleCommanda8 ; 355b5
- dw BattleCommanda9 ; 355d5
+ dw BattleCommanda9_IfAttackMissedResetDamage ; 355d5
dw BattleCommandaa ; 37e80
dw BattleCommandab ; 34f57
dw BattleCommandac ; 3658f
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -539,7 +539,7 @@
ld hl, HurtItselfText
call StdBattleTextBox
call Function355dd
- call BattleCommand62
+ call BattleCommand62_DamageCalcWithStats
call BattleCommand0a
xor a
ld [wcfca], a
@@ -652,7 +652,7 @@
ld [CriticalHit], a
call Function355dd
- call BattleCommand62
+ call BattleCommand62_DamageCalcWithStats
call BattleCommand0a
xor a
@@ -1336,8 +1336,8 @@
; 346d2
-BattleCommand07: ; 346d2
-; stab
+BattleCommand07_CalcDamageTypeMultiplier: ; 346d2
+; STAB = Same Type Attack Bonus
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
cp STRUGGLE
@@ -1354,7 +1354,7 @@
ld a, [hBattleTurn]
and a
- jr z, .go
+ jr z, .go ; Who Attacks and who Defends
ld hl, EnemyMonType1
ld a, [hli]
@@ -3932,6 +3932,7 @@
ld a, [wc72d]
and a
ret nz
+
jp PrintButItFailed
; 355bd
@@ -3955,11 +3956,12 @@
; 355d5
-BattleCommanda9: ; 355d5
+BattleCommanda9_IfAttackMissedResetDamage: ; 355d5
; clearmissdamage
ld a, [AttackMissed]
and a
ret z
+
jp ResetDamage
; 355dd
@@ -4002,7 +4004,7 @@
; 35612
-BattleCommand62: ; 35612
+BattleCommand62_DamageCalcWithStats: ; 35612
; damagecalc
; Return a damage value for move power d, player level e, enemy defense c and player attack b.
@@ -4136,12 +4138,12 @@
; Update CurDamage (capped at 997).
ld hl, CurDamage
ld b, [hl]
- ld a, [$ffb6]
+ ld a, [hQuotient + 2]
add b
ld [$ffb6], a
jr nc, .asm_356a5
- ld a, [$ffb5]
+ ld a, [hQuotient + 1]
inc a
ld [$ffb5], a
and a
@@ -4395,22 +4397,22 @@
ld a, [hBattleTurn]
and a
ld a, [hl]
- jr nz, .asm_357f8
+ jr nz, .notPlayersTurn
ld hl, wPlayerMoveStruct + MOVE_POWER
ld [hl], a
push hl
call PlayerAttackDamage
- jr .asm_35800
+ jr .notEnemysTurn
-.asm_357f8
+.notPlayersTurn
ld hl, wEnemyMoveStruct + MOVE_POWER
ld [hl], a
push hl
call EnemyAttackDamage
-.asm_35800
- call BattleCommand62
+.notEnemysTurn
+ call BattleCommand62_DamageCalcWithStats
pop hl
ld [hl], 1
ret
@@ -7200,7 +7202,7 @@
ld a, [BattleType]
cp BATTLETYPE_SHINY
jp z, .asm_36969
- cp $9
+ cp BATTLETYPE_TRAP
jp z, .asm_36969
cp BATTLETYPE_CELEBI
jp z, .asm_36969
@@ -9498,7 +9500,7 @@
push de
.asm_3787d
- call BattleCommand07
+ call BattleCommand07_CalcDamageTypeMultiplier
ld a, [InLinkBattle]
cp $3
@@ -9746,7 +9748,7 @@
call ClearBox
ld b, 1
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call BatonPass_LinkPlayerSwitch
; Mobile link battles handle entrances differently
@@ -9787,7 +9789,7 @@
call CallBattleCore
ld a, 1
ld [wd265], a
- ld hl, Function3ecab
+ ld hl, ApplyStatLevelMultiplierOnAllStats
call CallBattleCore
ld hl, SpikesDamage
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -187,7 +187,7 @@
ld [hLCDStatCustom], a
call GetCreditsPalette
- call Function32f9
+ call SetPalettes
ld a, [hVBlank]
push af
ld a, $5
@@ -447,7 +447,7 @@
xor a
ld [wcf64], a ; frame
call GetCreditsPalette
- call Function32f9 ; update hw pal registers
+ call SetPalettes ; update hw pal registers
jr .loop
.clear
--- a/engine/diploma.asm
+++ b/engine/diploma.asm
@@ -33,7 +33,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
; 1dd760
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -1021,12 +1021,14 @@
; 96bd7
Function96bd7: ; 96bd7
- ld a, [wdca1]
+ ld a, [RepelStepsLeft]
and a
ret z
+
dec a
- ld [wdca1], a
+ ld [RepelStepsLeft], a
ret nz
+
ld a, BANK(RepelWoreOffScript)
ld hl, RepelWoreOffScript
call CallScript
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -278,7 +278,7 @@
call GetMapHeaderPhoneServiceNybble
and a
jr nz, .NoCall
- ld hl, wdca1 + 1
+ ld hl, wdca2
ld a, [hli]
ld d, a
ld e, [hl]
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -594,7 +594,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
jr c, .asm_10475
@@ -1112,7 +1112,7 @@
ld a, [InputType]
or a
jr z, .asm_107ca
- callba Function1de28f
+ callba Start_DudeAutoInput_RightA
.asm_107ca
call Function107d7
@@ -1507,7 +1507,7 @@
call WaitBGMap
ld b, $14
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
; 10a4f
--- a/engine/predef.asm
+++ b/engine/predef.asm
@@ -50,7 +50,7 @@
add_predef PrintMoveDesc
add_predef UpdatePlayerHUD
add_predef FillBox
- add_predef Function3d873
+ add_predef CheckPlayerPartyForFitPkmn
add_predef UpdateEnemyHUD
add_predef StartBattle
add_predef FillInExpBar
--- a/home.asm
+++ b/home.asm
@@ -70,6 +70,7 @@
ld a, [wc2cc]
bit 1, a
ret z
+
ld a, [hJoyDown]
bit 1, a ; B_BUTTON
ret
@@ -212,7 +213,8 @@
INCLUDE "home/copy2.asm"
-Function309d:: ; 309d
+LoadTileMapToTempTileMap:: ; 309d
+; Load TileMap into TempTileMap
ld a, [rSVBK]
push af
ld a, BANK(w2_d000)
@@ -226,16 +228,17 @@
ret
; 30b4
-Function30b4:: ; 30b4
+Call_LoadTempTileMapToTileMap:: ; 30b4
xor a
ld [hBGMapMode], a
- call Function30bf
+ call LoadTempTileMapToTileMap
ld a, 1
ld [hBGMapMode], a
ret
; 30bf
-Function30bf:: ; 30bf
+LoadTempTileMapToTileMap:: ; 30bf
+; Load TempTileMap into TileMap
ld a, [rSVBK]
push af
ld a, BANK(w2_d000)
@@ -676,11 +679,12 @@
; 32f9
-
-Function32f9:: ; 32f9
+SetPalettes:: ; 32f9
+; Inits the Palettes
+; depending on the system the monochromes palettes or color palettes
ld a, [hCGB]
and a
- jr nz, .asm_3309
+ jr nz, .SetPalettesForGameBoyColor
ld a, $e4
ld [rBGP], a
ld a, $d0
@@ -688,7 +692,7 @@
ld [rOBP1], a
ret
-.asm_3309
+.SetPalettesForGameBoyColor
push de
ld a, $e4
call DmgToCgbBGPals
@@ -959,10 +963,10 @@
ld h, 0
ld l, a
rept 2
- add hl, hl
+ add hl, hl ; hl = hl * 4
endr
- add hl, de
- add hl, hl
+ add hl, de ; hl = (hl*4) + de
+ add hl, hl ; hl = (5*hl) + (5*hl)
ld de, PokemonNames
add hl, de
@@ -1159,7 +1163,7 @@
ld hl, VramState
bit 0, [hl]
jp nz, UpdateTimePals
- jp Function32f9
+ jp SetPalettes
; 352f
Function352f:: ; 352f
@@ -1760,7 +1764,7 @@
Function3842:: ; 3842
ld [wd265], a
ld de, wd265
- ld b, 1 << 6 + 1
+ ld b, 1 << 6 + 1 ; 65
jp PrintNum
; 384d
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -410,7 +410,7 @@
ld a, [InputType]
or a
jr z, .asm_ad9
- callba Function1de28a
+ callba Start_DudeAutoInput_A
.asm_ad9
call Functionaf5
call Functiona57
--- a/home/map.asm
+++ b/home/map.asm
@@ -1967,7 +1967,7 @@
call WhiteBGMap
call Function2bae
call UpdateSprites
- call Function1d7d
+ call Call_ExitMenu
call Functiond90
jr Function2b5c
; 2b4d
@@ -1974,7 +1974,7 @@
Function2b4d:: ; 2b4d
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function2bae
call UpdateSprites
call Functiond90
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -66,7 +66,7 @@
db 1 ; default option
; 1d7d
-Function1d7d:: ; 1d7d
+Call_ExitMenu:: ; 1d7d
call ExitMenu
ret
; 1d81
--- a/home/serial.asm
+++ b/home/serial.asm
@@ -273,15 +273,15 @@
; 862
Function862:: ; 862
- call Function309d
+ call LoadTileMapToTempTileMap
callab Function4000
call Function87d
- jp Function30b4
+ jp Call_LoadTempTileMapToTileMap
; 871
Function871:: ; 871
- call Function309d
+ call LoadTileMapToTempTileMap
callab Function4000
jp Function87d
; 87d
--- a/hram.asm
+++ b/hram.asm
@@ -73,7 +73,7 @@
hRandomAdd EQU $ffe1
hRandomSub EQU $ffe2
-hBattleTurn EQU $ffe4
+hBattleTurn EQU $ffe4 ; Which trainers turn is it? 0: Player, 1: Opponent Trainer
hCGBPalUpdate EQU $ffe5
hCGB EQU $ffe6
hSGB EQU $ffe7
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -705,7 +705,7 @@
ld a, [BattleType]
cp BATTLETYPE_TUTORIAL
ret z
- cp 2
+ cp BATTLETYPE_DEBUG
ret z
cp BATTLETYPE_CONTEST
jr z, .used_park_ball
@@ -1880,7 +1880,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
ret
@@ -1897,7 +1897,7 @@
callba WritePartyMenuTilemap
callba Function50566
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
pop bc
pop de
@@ -2254,18 +2254,19 @@
; f46c
Function_0xf46c: ; f46c
- ld a, [wdca1]
+ ld a, [RepelStepsLeft]
and a
- ld hl, UnknownText_0xf47d
+ ld hl, TextJump_RepelUsedEarlierIsStillInEffect
jp nz, PrintText
+
ld a, b
- ld [wdca1], a
+ ld [RepelStepsLeft], a
jp Functionf789
-; f47d
-UnknownText_0xf47d: ; 0xf47d
+
+TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d
; The REPEL used earlier is still in effect.
- text_jump UnknownText_0x1c5bcd
+ text_jump Text_RepelUsedEarlierIsStillInEffect
db "@"
; 0xf482
--- a/main.asm
+++ b/main.asm
@@ -1579,7 +1579,7 @@
; 6508
LearnMove: ; 6508
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [CurPartyMon]
ld hl, PartyMonNicknames
call GetNick
@@ -1741,7 +1741,7 @@
ld [wcfa7], a
call Function1bc9
push af
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
pop af
pop hl
bit 1, a
@@ -3177,7 +3177,7 @@
ld a, $7
call ByteFill
call Function3200
- call Function32f9
+ call SetPalettes
ret
; 8029
@@ -9726,7 +9726,7 @@
ld a, $1
.asm_e44b
ld [wcf88], a
- call Function32f9
+ call SetPalettes
xor a
ld [wcf76], a
ld [hBGMapMode], a ; $ff00+$d4
@@ -9946,7 +9946,7 @@
ld bc, $0412
call TextBox
call Function3200
- call Function32f9 ; load regular palettes?
+ call SetPalettes ; load regular palettes?
ret
; 0xe5bb
@@ -10918,7 +10918,7 @@
call Function1171d
call WaitBGMap
call WaitTop
- call Function32f9
+ call SetPalettes
call Function11be0
ret
; 1171d
@@ -12693,7 +12693,7 @@
Function1250a: ; 1250a
ld b, $0
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; 12513
@@ -13004,7 +13004,7 @@
.Clear ; 126b7
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function2bae
call .DrawMenuAccount_
call MenuFunc_1e7f
@@ -13403,7 +13403,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9 ; load regular palettes?
+ call SetPalettes ; load regular palettes?
call DelayFrame
callba PartyMenuSelect
jr c, .return ; if cancelled or pressed B
@@ -13625,7 +13625,7 @@
call AddNTimes
ld [hl], "▷"
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
@@ -14082,7 +14082,7 @@
call LowVolume
predef StatsScreenInit
call MaxVolume
- call Function1d7d
+ call Call_ExitMenu
ld a, 0
ret
; 12e1b
@@ -14253,19 +14253,19 @@
ld a, PartyMon1MaxHP - PartyMon1
call GetPartyParamLocation
ld a, [hli]
- ld [hProduct], a
+ ld [hDividend + 0], a
ld a, [hl]
- ld [hMultiplicand], a
+ ld [hDividend + 1], a
ld a, $5
- ld [hMultiplier], a
+ ld [hDivisor], a
ld b, $2
call Divide
ld a, PartyMon1HP + 1 - PartyMon1
call GetPartyParamLocation
- ld a, [$ffb6]
+ ld a, [hQuotient + 2]
sub [hl]
dec hl
- ld a, [$ffb5]
+ ld a, [hQuotient + 1]
sbc [hl]
ret
; 12f26
@@ -14665,7 +14665,7 @@
hlcoord 10, 4
predef Function50c50
call WaitBGMap
- call Function32f9
+ call SetPalettes
ld a, [wd0eb]
inc a
ld [wcfa3], a
@@ -21684,7 +21684,7 @@
ld b, $1c
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.asm_16c6b
call Functiona57
@@ -22592,7 +22592,7 @@
predef FillBox
pop af
call Function17363
- call Function32f9
+ call SetPalettes
jp WaitBGMap
Function1727f: ; 1727f (5:727f)
@@ -26001,7 +26001,7 @@
call WaitBGMap
ld b, $15
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call WaitBGMap
ld hl, wcf63
xor a
@@ -28283,7 +28283,7 @@
call WriteBackup
call Function1d6e
call WaitBGMap
- jp Function32f9
+ jp SetPalettes
; 27192
Function27192: ; 27192
@@ -29743,7 +29743,7 @@
; 28926
Function28926: ; 28926
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [wcfa9]
push af
hlcoord 0, 15
@@ -29784,7 +29784,7 @@
.asm_28983
pop af
ld [wcfa9], a
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
jp Function2888b
.asm_2898d
@@ -29822,7 +29822,7 @@
ld [wd263], a
callab Function50db9
callba Function4d319
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
hlcoord 6, 1
ld bc, $0601
ld a, $7f
@@ -30091,7 +30091,7 @@
callba Function4d354
call Function1bd3
push af
- call Function1d7d
+ call Call_ExitMenu
call Function3200
pop af
bit 1, a
@@ -30404,7 +30404,7 @@
Function28eff: ; 28eff
callba Function16d6a7
- call Function32f9
+ call SetPalettes
ret
; 28f09
@@ -32894,7 +32894,7 @@
CheckRepelEffect:: ; 2a1df
; If there is no active Repel, there's no need to be here.
- ld a, [wdca1]
+ ld a, [RepelStepsLeft]
and a
jr z, .encounter
; Get the first Pokemon in your party that isn't fainted.
@@ -33663,13 +33663,13 @@
jr z, .asm_2b9d7
dec hl
xor a
- ld [hProduct], a
+ ld [hDividend + 0], a
ld a, [hli]
- ld [hMultiplicand], a
+ ld [hDividend + 1], a
ld a, [hli]
- ld [$ffb5], a
+ ld [hDividend + 2], a
xor a
- ld [$ffb6], a
+ ld [hDividend + 3], a
ld a, [hli]
ld b, a
ld a, [hld]
@@ -33677,13 +33677,13 @@
rr a
srl b
rr a
- ld [hMultiplier], a
+ ld [hDivisor], a
ld b, $4
call Divide
- ld a, [$ffb6]
+ ld a, [hQuotient + 2]
add e
ld e, a
- ld a, [$ffb5]
+ ld a, [hQuotient + 1]
adc d
ld d, a
dec hl
@@ -34020,7 +34020,7 @@
callba Function2c10d
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, $e4
ld [rOBP0], a
ret
@@ -34559,7 +34559,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
push af
@@ -36764,7 +36764,7 @@
ret nz
; No use picking a move if there's no choice.
- callba Function3e8d1
+ callba CheckSubstatus_RechargeChargedRampageBideRollout
ret nz
@@ -37768,7 +37768,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
jr c, .asm_44939
@@ -37987,7 +37987,7 @@
call PlaceString
call Function48187
call Function3200
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -39673,11 +39673,11 @@
Function48d94: ; 48d94 (12:4d94)
xor a
ld [hDividend + 0], a
- ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
+ ld [hDividend + 1], a ; $ff00+$b4 (aliases: hMultiplicand)
ld a, [hli]
ld [hDividend + 0], a
ld a, [hl]
- ld [hQuotient], a ; $ff00+$b4 (aliases: hMultiplicand)
+ ld [hDividend + 1], a ; $ff00+$b4 (aliases: hMultiplicand)
ld a, 100
ld [hDivisor], a ; $ff00+$b7 (aliases: hMultiplier)
ld b, 2
@@ -39707,7 +39707,7 @@
call Function48e47
call Function48e64
call Function3200
- call Function32f9
+ call SetPalettes
ld hl, UnknownText_0x48e0f
call PrintText
ld hl, MenuDataHeader_0x48dfc
@@ -40921,7 +40921,7 @@
call Function49ed0
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld hl, GameTimerPause
res 0, [hl]
call Function49da4
@@ -41302,7 +41302,7 @@
hlcoord 1, 14
call PlaceString
call Function3200
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -41449,7 +41449,7 @@
call WaitBGMap
call Function1d6e
callba Function89de0
- call Function1d7d
+ call Call_ExitMenu
call Function49351
call Function4a485
pop bc
@@ -41558,7 +41558,7 @@
hlcoord 1, 14
call PlaceString
callba Function104148
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -41696,7 +41696,7 @@
.asm_4a2df
callba Function11765d
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Functione5f
scf
ret
@@ -41730,7 +41730,7 @@
.asm_4a338
call ExitMenu
.asm_4a33b
- call Function1d7d
+ call Call_ExitMenu
callba Function104148
xor a
ret
@@ -41807,7 +41807,7 @@
call Function4a485
call Function4a492
call Function4a3aa
- call Function32f9
+ call SetPalettes
ret
; 4a3a7
@@ -41987,7 +41987,7 @@
hlcoord 1, 16
call PlaceString
call Function3200
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -42631,7 +42631,7 @@
ld [wd019], a
ld b, $14
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call Function4aa22
jr c, .asm_4a985
jr z, .asm_4a9a1
@@ -42762,7 +42762,7 @@
callba PrintPartyMenuText
call Function4aab6
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
call Function4ab1a
jr z, .asm_4aa66
@@ -45652,7 +45652,7 @@
ld hl, wcf64
bit 4, [hl]
jr nz, .asm_4dfd6
- call Function32f9
+ call SetPalettes
ret
.asm_4dfd6
call Function4e226
@@ -45965,14 +45965,14 @@
jr .asm_4e246
.asm_4e238
call Function4e271
- call Function32f9
+ call SetPalettes
ret
.asm_4e23f
call Function4e253
- call Function32f9
+ call SetPalettes
ret
.asm_4e246
- call Function32f9
+ call SetPalettes
call Function4e253
ld a, [CurPartySpecies]
call PlayCry2
@@ -46156,7 +46156,7 @@
call PlaceString
ld hl, wcf64
set 5, [hl]
- call Function32f9 ; pals
+ call SetPalettes ; pals
call DelayFrame
hlcoord 0, 0
call Function3786
@@ -46799,7 +46799,7 @@
ld hl, UnknownText_0x4e8bd
call PrintText
call Function3200
- call Function32f9
+ call SetPalettes
ret
; 4e8bd
@@ -46839,7 +46839,7 @@
ld [hSCX], a
call EnableLCD
call Function3200
- call Function32f9
+ call SetPalettes
ret
; 4e906
@@ -47157,7 +47157,7 @@
call WhiteBGMap
call Function5003f
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
call PartyMenuSelect
call Function2b74
@@ -47174,7 +47174,7 @@
call WaitBGMap
ld b, $a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
call PartyMenuSelect
call Function2b74
@@ -48230,7 +48230,7 @@
ld a, [PartyCount]
cp [hl]
jr nz, .asm_50682
- predef Function3d873
+ predef CheckPlayerPartyForFitPkmn
ld a, d
ld [ScriptVar], a
ret
@@ -49385,15 +49385,15 @@
ld a, [hli]
and $f
- ld [hMultiplier], a
+ ld [hDivisor], a
ld b, $4
call Divide
- ld a, [hMultiplicand + 0]
+ ld a, [hQuotient + 0]
push af
- ld a, [hMultiplicand + 1]
+ ld a, [hQuotient + 1]
push af
- ld a, [hMultiplicand + 2]
+ ld a, [hQuotient + 2]
push af
call Function50eed
@@ -53774,11 +53774,11 @@
ld [hl], $4
xor a
ld [hBGMapMode], a
- call Function309d
+ call LoadTileMapToTempTileMap
callba Function16dac
ld a, $0
call Function84419
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
call Function84742
ld a, $9
ld [wcf65], a
@@ -53806,7 +53806,7 @@
pop af
ld [hVBlank], a
call Function84411
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
xor a
ld [rIF], a
pop af
@@ -53939,13 +53939,13 @@
call Function84411
ld c, $c
call DelayFrames
- call Function309d
+ call LoadTileMapToTempTileMap
xor a
ld [hBGMapMode], a
callba Function1dd7ae
ld a, $3
call Function84419
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
call Function84742
ld a, $9
ld [wcf65], a
@@ -54716,7 +54716,7 @@
ld [hBGMapMode], a
ld b, $1a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call Function86635
xor a
ld [wc2c6], a
@@ -54854,7 +54854,7 @@
call WaitBGMap
ld b, $1a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
decoord 6, 5
ld c, $6
predef Functiond066e
@@ -55015,7 +55015,7 @@
ld [CurPartySpecies], a
ld b, $1a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call Function86635
xor a
ld [wc2c6], a
@@ -55135,7 +55135,7 @@
call Function88161
.asm_88051
- call Function1d7d
+ call Call_ExitMenu
ret
; 88055
@@ -56433,7 +56433,7 @@
call Function895c7
call Function8949c
call Function8a60d
- call Function32f9
+ call SetPalettes
pop bc
ret
@@ -57085,7 +57085,7 @@
call Function897af
push bc
call Function3200
- call Function32f9
+ call SetPalettes
pop bc
ret
; 89856
@@ -57594,9 +57594,9 @@
call Function891de
call WhiteBGMap
call Function893e2
- call Function1d7d
+ call Call_ExitMenu
call Function891ab
- call Function32f9
+ call SetPalettes
ret
Function89b3b: ; 89b3b (22:5b3b)
@@ -57945,7 +57945,7 @@
call CopyBytes
pop af
ld [rSVBK], a ; $ff00+$70
- call Function32f9
+ call SetPalettes
callba Function845db
call Function89240
ld c, $18
@@ -58151,7 +58151,7 @@
hlcoord 10, 4, AttrMap
call Function8a5a3
call Function891ab
- call Function32f9
+ call SetPalettes
jp Function89e36
Function89e9a: ; 89e9a (22:5e9a)
@@ -58188,7 +58188,7 @@
hlcoord 10, 4, AttrMap
call Function8a5a3
call Function891ab
- call Function32f9
+ call SetPalettes
jp Function89e36
Function89ee1: ; 89ee1 (22:5ee1)
@@ -58369,7 +58369,7 @@
hlcoord 10, 4, AttrMap
call Function8a5a3
call Function89448
- call Function32f9
+ call SetPalettes
call Function891ab
jp Function89e36
@@ -58716,7 +58716,7 @@
.asm_8a254
call Function891de
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function891de
and a
ret
@@ -58743,7 +58743,7 @@
call Function8b36c
call Function8b493
call Function891ab
- call Function32f9
+ call SetPalettes
call Function8b5e7
ret
@@ -58841,7 +58841,7 @@
call Function8a4d3
call Function8a4fc
call Function891ab
- call Function32f9
+ call SetPalettes
call Function8a383
jr c, .asm_8a370
jr z, .asm_8a34e
@@ -61780,7 +61780,7 @@
call Function8b6ed
call EnableLCD
call Function891ab
- call Function32f9
+ call SetPalettes
ret
; 8b690
@@ -69325,7 +69325,7 @@
ld a, [wd002]
ld e, a
ld d, 0
- ld hl, Unknown_909f2
+ ld hl, WeekdaysStrings
rept 2
add hl, de
endr
@@ -69337,7 +69337,7 @@
ret
; 909f2
-Unknown_909f2: ; 909f2
+WeekdaysStrings: ; 909f2
dw Sunday
dw Monday
dw Tuesday
@@ -69397,13 +69397,13 @@
ld c, a
decoord 1, 14
callba Function1dd6bb
- ld hl, UnknownText_0x90a83
+ ld hl, TextJump_DSTIsThatOK
ret
; 90a83 (24:4a83)
-UnknownText_0x90a83: ; 0x90a83
+TextJump_DSTIsThatOK: ; 0x90a83
; DST, is that OK?
- text_jump UnknownText_0x1c5fde
+ text_jump Text_DSTIsThatOK
db "@"
; 0x90a88
@@ -69655,7 +69655,7 @@
call Function90da8
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, [hCGB]
and a
ret z
@@ -71442,7 +71442,7 @@
ld [wd005], a
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, [hCGB]
and a
jr z, .asm_9198b
@@ -71696,7 +71696,7 @@
call Function91c8f
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.loop
call Functiona57
ld hl, hJoyPressed
@@ -72118,7 +72118,7 @@
call TownMapBGUpdate
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
xor a
ld [hBGMapMode], a
xor a
@@ -72628,7 +72628,7 @@
ld [wd004], a
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.loop
call Functiona57
ld hl, hJoyPressed
@@ -75771,7 +75771,7 @@
ld a, [wd1ec]
ld e, a
callba Function8cb4
- call Function32f9
+ call SetPalettes
xor a
ld [hJoyPressed], a
call Functionb929a
@@ -76979,7 +76979,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; cc0a7
@@ -83069,7 +83069,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.asm_e4217
call Functiona57
ld a, [hJoyPressed]
@@ -83636,7 +83636,7 @@
call WaitBGMap
ld b, $19
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld c, 10
call DelayFrames
callab Copyright
@@ -86753,7 +86753,7 @@
ld [TempMonDVs + 1], a
ld b, $1c
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; fb8f1
@@ -89503,7 +89503,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
pop de
hlcoord 2, 8
ld a, d
@@ -90803,7 +90803,7 @@
call WaitBGMap
ld b, $1d
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
Function10522e: ; 10522e (41:522e)
@@ -90981,7 +90981,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
Function10578c: ; 10578c (41:578c)
@@ -91106,7 +91106,7 @@
call WaitBGMap
ld b, $2
callba Function4930f
- jp Function32f9
+ jp SetPalettes
Function1058c6: ; 1058c6 (41:58c6)
ld b, $6
@@ -92241,10 +92241,11 @@
ld [$ffbb], a
ret
-Function1062f7
+Function1062f7:
ld a, [$ffbc]
bit 7, a
ret z
+
ld [hl], $f6
ret
; 1062ff
@@ -92950,7 +92951,7 @@
call WaitBGMap
ld b, $3
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; 1dc47b
@@ -93002,7 +93003,7 @@
call WaitBGMap
ld b, $3
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; 1dc507
@@ -93144,10 +93145,10 @@
ld bc, $8102
call PrintNum
pop bc
- ld de, String_1dd6fc
+ ld de, String_AM
pop af
jr c, .asm_1dd6f7
- ld de, String_1dd6ff
+ ld de, String_PM
.asm_1dd6f7
inc hl
call PlaceString
@@ -93154,8 +93155,8 @@
ret
; 1dd6fc (77:56fc)
-String_1dd6fc: db "AM@"
-String_1dd6ff: db "PM@"
+String_AM: db "AM@" ; 1dd6fc
+String_PM: db "PM@" ; 1dd6ff
; 1dd702
@@ -93333,22 +93334,22 @@
-Function1de28a:: ; 1de28a
+Start_DudeAutoInput_A:: ; 1de28a
ld hl, DudeAutoInput_A
- jr Function1de299
+ jr CallStartAutoInput
; 1de28f
-Function1de28f: ; 1de28f
+Start_DudeAutoInput_RightA: ; 1de28f
ld hl, DudeAutoInput_RightA
- jr Function1de299
+ jr CallStartAutoInput
; 1de294
-Function1de294: ; 1de294
+Start_DudeAutoInput_DownA: ; 1de294
ld hl, DudeAutoInput_DownA
- jr Function1de299
+ jr CallStartAutoInput
; 1de299
-Function1de299: ; 1de299
+CallStartAutoInput: ; 1de299
ld a, BANK(DudeAutoInputs)
call StartAutoInput
ret
--- a/misc/crystal_misc.asm
+++ b/misc/crystal_misc.asm
@@ -50,7 +50,7 @@
call Function17abcf
callba Function49409
callba Function49420
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -1615,6 +1615,7 @@
ld a, [InLinkBattle]
cp $4
jr nz, .asm_100a2a
+
call Function100a87
call Function100da5
callba Function3ee27
@@ -1941,15 +1942,15 @@
ret
.asm_100c63
- ld hl, BattleText_0x80c5b
+ ld hl, BattleText_TheMoveIsDisabled
jr .asm_100c6b
.asm_100c68
- ld hl, BattleText_0x80c39
+ ld hl, BattleText_TheresNoPPLeftForThisMove
.asm_100c6b
call StdBattleTextBox
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
jp Function100bc2
; 100c74
@@ -3015,7 +3016,7 @@
Function1013aa: ; 1013aa
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function2bae
callba Function106464
call UpdateSprites
@@ -6793,7 +6794,7 @@
ld a, $5
call FarCopyWRAM
callba Function49742
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
; 102e07
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -5789,7 +5789,7 @@
ld de, Unkn1Pals + 8 * 7
ld bc, $0008
call CopyBytes
- call Function32f9
+ call SetPalettes
pop af
ld [rSVBK], a
ld a, $30
@@ -5810,7 +5810,7 @@
ld de, wd050
ld bc, $0030
call CopyBytes
- call Function32f9
+ call SetPalettes
pop af
ld [rSVBK], a
ret
@@ -5917,7 +5917,7 @@
call CopyBytes
pop af
ld [rSVBK], a
- call Function32f9
+ call SetPalettes
ld a, [rSVBK]
push af
ld a, $1
@@ -5967,7 +5967,7 @@
call CopyBytes
pop af
ld [rSVBK], a
- call Function32f9
+ call SetPalettes
call DelayFrame
ld a, $90
ld [hWY], a
@@ -14155,7 +14155,7 @@
Function11a9ce: ; 11a9ce
call WhiteBGMap
call Function2bae
- call Function1d7d
+ call Call_ExitMenu
callba Function106462
callba Function106464
call Functiond90
@@ -14937,7 +14937,7 @@
call Function11b099
call Function11b295
call Function11b275
- call Function32f9
+ call SetPalettes
jp Function11ad8a
; 11b099
@@ -16875,7 +16875,7 @@
call ClearSprites
call ClearScreen
call Function11d323
- call Function32f9
+ call SetPalettes
call DisableLCD
ld hl, GFX_11d67e
ld de, VTiles2
@@ -21659,7 +21659,7 @@
cp $8
jr nz, .asm_16c969
callba Function96a4
- call Function32f9
+ call SetPalettes
ld a, [rSVBK]
push af
ld a, $1
@@ -21762,7 +21762,7 @@
cp $8
jr nz, .asm_16ca28
callba Function96a4
- call Function32f9
+ call SetPalettes
ld a, [rSVBK]
push af
ld a, $1
@@ -22185,10 +22185,10 @@
callba Function16d42e
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call WaitBGMap
call Functiona36
- call Function1d7d
+ call Call_ExitMenu
ret
; 16d465
@@ -22330,7 +22330,7 @@
call Function1d6e
call Function16d6e1
callba Function87d
- call Function1d7d
+ call Call_ExitMenu
call Function3200
ret
; 16d6e1
@@ -23293,7 +23293,7 @@
Function170571:
- call Function32f9
+ call SetPalettes
call Function1705b2
@@ -24906,7 +24906,7 @@
ld [hli], a
ld a, $7f
ld [hl], a
- call Function32f9
+ call SetPalettes
pop af
ld [rSVBK], a ; $ff00+$70
ret
@@ -25068,7 +25068,7 @@
ld de, BGPals
ld bc, $40
call CopyBytes
- call Function32f9
+ call SetPalettes
pop af
ld [rSVBK], a ; $ff00+$70
ret
--- a/misc/mobile_5f.asm
+++ b/misc/mobile_5f.asm
@@ -706,7 +706,7 @@
ld de, Unkn1Pals
ld bc, $0040
call CopyBytes
- call Function32f9
+ call SetPalettes
pop af
ld [rSVBK], a
ret
@@ -938,7 +938,7 @@
; 17d5be
Function17d5be: ; 17d5be
- call Function32f9
+ call SetPalettes
call Function17e438
Function17d5c4:
@@ -1508,7 +1508,7 @@
ld a, [wc70c]
ld e, a
callba Function8bc6
- call Function32f9
+ call SetPalettes
ld a, [wc708]
ld l, a
ld a, [wc709]
@@ -1544,7 +1544,7 @@
ld a, [wc70b]
ld e, a
callba Function8bbd
- call Function32f9
+ call SetPalettes
ld a, [wc708]
ld e, a
ld a, [wc709]
@@ -4764,7 +4764,7 @@
Function17f5d2: ; 17f5d2
call Function17f5e4
callba Function104000
- call Function32f9
+ call SetPalettes
ld a, $1
ld [wc303], a
ret
--- a/text/battle.asm
+++ b/text/battle.asm
@@ -1,4 +1,4 @@
-BattleText_0x80730: ; 0x80730
+BattleText_PlayerPickuedUpPayDayMoney: ; 0x80730
text "<PLAYER> picked up"
line "¥@"
deciram wPayDayMoney, $36
@@ -307,7 +307,7 @@
text "Got away safely!"
prompt
-BattleText_0x80b89: ; 0x80b89
+BattleText_UserFledUsingAStringBuffer1: ; 0x80b89
text "<USER>"
line "fled using a"
cont "@"
@@ -321,7 +321,7 @@
prompt
; 0x80bae
-BattleText_0x80bae: ; 0x80bae
+BattleText_UserHurtBySpikes: ; 0x80bae
text "<USER>'s"
line "hurt by SPIKES!"
prompt
@@ -336,7 +336,7 @@
prompt
; 0x80bde
-BattleText_0x80bde: ; 0x80bde
+BattleText_UsersStringBuffer1Activated: ; 0x80bde
text "<USER>'s"
line "@"
text_from_ram StringBuffer1
@@ -345,13 +345,13 @@
prompt
; 0x80bf3
-BattleText_0x80bf3: ; 0x80bf3
+BattleText_ItemsCantBeUsedHere: ; 0x80bf3
text "Items can't be"
line "used here."
prompt
; 0x80c0d
-BattleText_0x80c0d: ; 0x80c0d
+BattleText_PkmnIsAlreadyOut: ; 0x80c0d
text_from_ram BattleMonNick
text ""
line "is already out."
@@ -358,7 +358,7 @@
prompt
; 0x80c22
-BattleText_0x80c22: ; 0x80c22
+BattleText_PkmnCantBeRecalled: ; 0x80c22
text_from_ram BattleMonNick
text ""
line "can't be recalled!"
@@ -365,19 +365,19 @@
prompt
; 0x80c39
-BattleText_0x80c39: ; 0x80c39
+BattleText_TheresNoPPLeftForThisMove: ; 0x80c39
text "There's no PP left"
line "for this move!"
prompt
; 0x80c5b
-BattleText_0x80c5b: ; 0x80c5b
+BattleText_TheMoveIsDisabled: ; 0x80c5b
text "The move is"
line "DISABLED!"
prompt
; 0x80c72
-BattleText_0x80c72: ; 0x80c72
+BattleText_PkmnHasNoMovesLeft: ; 0x80c72
text_from_ram BattleMonNick
text ""
line "has no moves left!"
@@ -384,13 +384,13 @@
done
; 0x80c8a
-BattleText_0x80c8a: ; 0x80c8a
+BattleText_TargetsEncoreEnded: ; 0x80c8a
text "<TARGET>'s"
line "ENCORE ended!"
prompt
; 0x80c9c
-BattleText_0x80c9c: ; 0x80c9c
+BattleText_StringBuffer1GrewToLevel: ; 0x80c9c
text_from_ram StringBuffer1
text " grew to"
line "level @"
@@ -404,7 +404,7 @@
db "@"
; 0x80cba
-BattleText_0x80cba: ; 0x80cba
+BattleText_WildPkmnIsEating: ; 0x80cba
text "Wild @"
text_from_ram EnemyMonNick
text ""
@@ -412,7 +412,7 @@
prompt
; 0x80cd1
-BattleText_0x80cd1: ; 0x80cd1
+BattleText_WildPkmnIsAngry: ; 0x80cd1
text "Wild @"
text_from_ram EnemyMonNick
text ""
@@ -495,7 +495,7 @@
prompt
; 0x80de2
-BattleText_0x80de2: ; 0x80de2
+BattleText_UsersHurtByStringBuffer1: ; 0x80de2
text "<USER>'s"
line "hurt by"
cont "@"
@@ -504,7 +504,7 @@
prompt
; 0x80df5
-BattleText_0x80df5: ; 0x80df5
+BattleText_UserWasReleasedFromStringBuffer1: ; 0x80df5
text "<USER>"
line "was released from"
cont "@"
--- a/text/common_3.asm
+++ b/text/common_3.asm
@@ -106,13 +106,13 @@
prompt
; 1c029c
-UnknownText_0x1c029c: ; 1c029c
+Text_Gained: ; 1c029c
text_from_ram StringBuffer1
text " gained@"
db "@"
; 1c02a9
-UnknownText_0x1c02a9: ; 1c02a9
+Text_ABoostedStringBuffer2ExpPoints: ; 1c02a9
text ""
line "a boosted"
cont "@"
@@ -121,7 +121,7 @@
prompt
; 1c02c9
-UnknownText_0x1c02c9: ; 1c02c9
+Text_StringBuffer2ExpPoints: ; 1c02c9
text ""
line "@"
deciram StringBuffer2, $24
@@ -157,31 +157,31 @@
done
; 1c031d
-UnknownText_0x1c031d: ; 1c031d
+Text_BattleMonNickComma: ; 1c031d
text_from_ram BattleMonNick
text ",@"
db "@"
; 1c0324
-UnknownText_0x1c0324: ; 1c0324
+Text_ThatsEnoughComeBack: ; 1c0324
text " that's"
line "enough! Come back!@"
db "@"
; 1c0340
-UnknownText_0x1c0340: ; 1c0340
+Text_OKComeBack: ; 1c0340
text " OK!"
line "Come back!@"
db "@"
; 1c0352
-UnknownText_0x1c0352: ; 1c0352
+Text_GoodComeBack: ; 1c0352
text " good!"
line "Come back!@"
db "@"
; 1c0366
-UnknownText_0x1c0366: ; 1c0366
+Text_ComeBack: ; 1c0366
text " come"
line "back!"
done
--- a/text/common_4.asm
+++ b/text/common_4.asm
@@ -1428,7 +1428,7 @@
prompt
; 0x1c5bcd
-UnknownText_0x1c5bcd: ; 0x1c5bcd
+Text_RepelUsedEarlierIsStillInEffect: ; 0x1c5bcd
text "The REPEL used"
line "earlier is still"
cont "in effect."
@@ -1674,7 +1674,7 @@
prompt
; 0x1c5fde
-UnknownText_0x1c5fde: ; 0x1c5fde
+Text_DSTIsThatOK: ; 0x1c5fde
text " DST,"
line "is that OK?"
done
--- a/wram.asm
+++ b/wram.asm
@@ -819,13 +819,13 @@
wc71d:: ds 1
wc71e:: ds 1
wc71f:: ds 1
-wc720:: ds 4
+wc720:: ds 4 ; copy from/to EnemyMonBaseStats, length=7
wc724:: ds 3
wc727:: ds 2
wc729:: ds 2
wc72b:: ds 1
wc72c:: ds 1
-wc72d:: ds 1
+wc72d:: ds 1 ; if 0 then PrintButItFailed
wc72e:: ds 1
wc72f:: ds 1
wc730:: ds 1
@@ -887,17 +887,17 @@
RSSET 0 ; Offsets for wBT_OTTempCopy:: @ $c608
-wBT_OTTempCopy_0 RB $A ; $c608
-wBT_OTTempCopy_TrainerClass RB $1 ; $c608 + $a = $c612
-wBT_OTTempCopy_Pkmn1 RB $30 ; $c608 + $b = $c613
-wBT_OTTempCopy_Pkmn1Name RB $A ; $c608 + $3b = $c643
-wBT_OTTempCopy_45 RB $1 ; $c608 + $45 = $c64d
-wBT_OTTempCopy_Pkmn2 RB $30 ; $c608 + $46 = $c64e
-wBT_OTTempCopy_Pkmn2Name RB $A ; $c608 + $76 = $c67e
-wBT_OTTempCopy_80 RB $1 ; $c608 + $80 = $c688
-wBT_OTTempCopy_Pkmn3 RB $30 ; $c608 + $81 = $c689
-wBT_OTTempCopy_Pkmn3Name RB $A ; $c608 + $b1 = $c6b9
-wBT_OTTempCopy_BB RB $1 ; $c608 + $bb = $c6c3
+wBT_OTTempCopy_0 RB $A ; $c608
+wBT_OTTempCopy_TrainerClass RB $1 ; $c608 + $a = $c612
+wBT_OTTempCopy_Pkmn1 RB $30 ; $c608 + $b = $c613
+wBT_OTTempCopy_Pkmn1Name RB $A ; $c608 + $3b = $c643
+wBT_OTTempCopy_45 RB $1 ; $c608 + $45 = $c64d
+wBT_OTTempCopy_Pkmn2 RB $30 ; $c608 + $46 = $c64e
+wBT_OTTempCopy_Pkmn2Name RB $A ; $c608 + $76 = $c67e
+wBT_OTTempCopy_80 RB $1 ; $c608 + $80 = $c688
+wBT_OTTempCopy_Pkmn3 RB $30 ; $c608 + $81 = $c689
+wBT_OTTempCopy_Pkmn3Name RB $A ; $c608 + $b1 = $c6b9
+wBT_OTTempCopy_BB RB $1 ; $c608 + $bb = $c6c3
GLOBAL wBT_OTTempCopy_TrainerClass, wBT_OTTempCopy_Pkmn1, wBT_OTTempCopy_Pkmn1Name, wBT_OTTempCopy_45, wBT_OTTempCopy_Pkmn2, wBT_OTTempCopy_Pkmn2Name, wBT_OTTempCopy_80, wBT_OTTempCopy_Pkmn3, wBT_OTTempCopy_Pkmn3Name, wBT_OTTempCopy_BB
@@ -1758,17 +1758,17 @@
BattleType:: ; d230
; $00 normal
-; $01
-; $02
-; $03 dude
+; $01 can lose
+; $02 debug
+; $03 dude/tutorial
; $04 fishing
; $05 roaming
-; $06
+; $06 contest
; $07 shiny
; $08 headbutt/rock smash
-; $09
+; $09 trap
; $0a force Item1
-; $0b
+; $0b celebi
; $0c suicune
ds 1
@@ -2421,8 +2421,10 @@
wdc9d:: ds 2
wdc9f:: ds 1
wdca0:: ds 1
-wdca1:: ds 3
-wdca4:: ds 1
+RepelStepsLeft:: ; If a Repel is in use, it contains the nr of steps it's still active
+ ds 1
+wdca2:: ds 2
+wdca4:: ds 1
wPlayerDataEnd::
@@ -2586,7 +2588,9 @@
SECTION "Pic Animations", WRAMX, BANK [2]
-w2_d000:: ds $168
+w2_d000::
+; 20x18 grid of 8x8 tiles
+ ds SCREEN_WIDTH * SCREEN_HEIGHT ; $168 = 360
w2_d168:: ds 1
w2_d169:: ds 1