ref: 6b2d0ae841f5a7ff851d462b12f09eac998d2d8f
parent: 010b450834bd595b961582aea5e5771632510ef9
parent: 25c126c69beebfdf26d0de286e25c65f6f3db16e
author: PikalaxALT <PikalaxALT@gmail.com>
date: Sun Nov 1 13:14:37 EST 2015
Fix merge conflicts
--- 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
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -176,7 +176,7 @@
push de
ld a, 1
ld [hBattleTurn], a
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop de
pop bc
pop hl
@@ -431,7 +431,7 @@
push hl
ld a, 1
ld [hBattleTurn], a
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop hl
; 60% chance to discourage this move if not very effective.
@@ -512,7 +512,7 @@
push hl
push bc
- callba Function347c8
+ callba HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
cp $a
pop bc
@@ -1384,7 +1384,7 @@
ld a, $1
ld [hBattleTurn], a
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
cp $a
@@ -1783,8 +1783,8 @@
ld [hBattleTurn], a
push hl
callab EnemyAttackDamage
- callab BattleCommand62
- callab BattleCommand07
+ callab BattleCommand_DamageCalcWithStats
+ callab BattleCommand_CalcDamageTypeMultiplier
pop hl
ld a, [CurDamage + 1]
ld c, a
@@ -1830,7 +1830,7 @@
xor a
ld [hBattleTurn], a
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
cp $a
@@ -2496,7 +2496,7 @@
; Calculate Hidden Power's type and base power based on enemy's DVs.
callab HiddenPowerDamage
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop hl
; Discourage Hidden Power if not very effective.
@@ -3380,8 +3380,8 @@
.asm_39400
callab EnemyAttackDamage
- callab BattleCommand62
- callab BattleCommand07
+ callab BattleCommand_DamageCalcWithStats
+ callab BattleCommand_CalcDamageTypeMultiplier
ret
.ConstantDamageEffects
@@ -3498,7 +3498,7 @@
push de
ld a, 1
ld [hBattleTurn], a
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop de
pop bc
pop hl
--- 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, [wLinkMode]
@@ -122,7 +122,7 @@
WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
ld a, [wBattleResult]
and $c0
add $2
@@ -306,7 +306,7 @@
call Function3de97
call Function3dcf9
call UpdateBattleMonInParty
- call Function309d
+ call LoadTileMapToTempTileMap
jp Function3c4df
; 3c23c
@@ -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
@@ -645,9 +645,9 @@
ld [wd235], a
inc a ; POUND
ld [FXAnimIDLo], a
- call Function3e4bc
+ call MoveSelectionScreen
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
@@ -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
@@ -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]
@@ -2104,7 +2106,7 @@
xor a
ld [wc6f7], a
call Function3ce01
- call Function3d873
+ call CheckPlayerPartyForFitPkmn
ld a, d
and a
jp z, LostBattle
@@ -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, [wBattleMode]
dec a
- call z, Function3d0ea
+ call z, PlayVictoryMusic
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [wBattleResult]
and $c0
ld [wBattleResult], 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
@@ -2406,12 +2408,14 @@
ld a, [wLinkMode]
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]
@@ -2432,6 +2436,7 @@
pop af
and a
jr nz, .asm_3cf8f
+
call Function3d4e1
jr .asm_3cf92
@@ -2450,6 +2455,7 @@
; 3cfa4
WinTrainerBattle: ; 3cfa4
+; Player won the battle
call StopDangerSound
ld a, $1
ld [wc6fd], a
@@ -2457,10 +2463,11 @@
ld a, [wLinkMode]
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, [wLinkMode]
@@ -2660,7 +2667,7 @@
ret
; 3d0ea
-Function3d0ea: ; 3d0ea
+PlayVictoryMusic: ; 3d0ea
push de
ld de, MUSIC_NONE
call PlayMusic
@@ -2670,7 +2677,7 @@
dec a
jr nz, .asm_3d113
push de
- call Function3ceaa
+ call ShareExperiencePoints
pop de
jr nz, .asm_3d11e
ld hl, wPayDayMoney
@@ -2761,7 +2768,7 @@
ld a, $1
ld [wc6f7], a
call Function3d1aa
- call Function3d873
+ call CheckPlayerPartyForFitPkmn
ld a, d
and a
jp z, LostBattle
@@ -2843,7 +2850,7 @@
Function3d1f8: ; 3d1f8
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [wBattleMode]
and a
dec a
@@ -2864,12 +2871,12 @@
jr z, .asm_3d20a
ld hl, PartyMon1Speed
ld de, EnemyMonSpeed
- jp Function3d8b3
+ jp TryToRunAwayFromBattle
; 3d227
Function3d227: ; 3d227
call EmptyBattleTextBox
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function3d2f7
call ForcePickPartyMonInBattle
ld a, [wLinkMode]
@@ -2894,10 +2901,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
@@ -2916,13 +2923,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
@@ -2944,7 +2951,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
jp SpikesDamage
; 3d2e0
@@ -2988,7 +2995,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
; 3d329
@@ -3023,7 +3030,7 @@
cp [hl]
jr nz, .notout
- ld hl, BattleText_0x80c0d
+ ld hl, BattleText_PkmnIsAlreadyOut
call StdBattleTextBox
scf
ret
@@ -3128,7 +3135,7 @@
; Greyscale
ld b, 0
call GetSGBLayout
- call Function32f9
+ call SetPalettes
jr .end
.LostLinkBattle
@@ -3287,11 +3294,11 @@
Function3d4c3: ; 3d4c3
- call Function3d557
+ call ResetEnemyBattleVars
ld a, [wc718]
dec a
ld b, a
- call Function3d6ca
+ call LoadEnemyPkmnToSwitchTo
call Function3d7a0
call NewEnemyMonStatus
call ResetEnemyStatLevels
@@ -3305,12 +3312,12 @@
Function3d4e1: ; 3d4e1
call Function3d714
jr nc, Function3d517
- call Function3d557
+ call ResetEnemyBattleVars
call Function3d533
jr c, .asm_3d4f1
- call Function3d599
+ call FindPkmnInOTPartyToSwitchIntoBattle
.asm_3d4f1
- call Function3d6ca
+ call LoadEnemyPkmnToSwitchTo
call Function3d74b
push af
call Function3d7a0
@@ -3324,17 +3331,18 @@
ld [wd0ec], a
inc a
ld [wEnemyIsSwitching], a
- call Function309d
+ call LoadTileMapToTempTileMap
jp Function3e3ad
; 3d517
Function3d517: ; 3d517
- call Function3d557
+ call ResetEnemyBattleVars
call Function3d533
jr c, .asm_3d522
- call Function3d599
+ call FindPkmnInOTPartyToSwitchIntoBattle
.asm_3d522
- call Function3d6ca
+ ; 'b' contains the PartyNr of the Pkmn the AI will switch to
+ call LoadEnemyPkmnToSwitchTo
ld a, 1
ld [wEnemyIsSwitching], a
call Function3d7a0
@@ -3343,6 +3351,7 @@
; 3d533
Function3d533: ; 3d533
+; returns carry if: ???
ld a, [wLinkMode]
and a
jr z, .asm_3d541
@@ -3356,6 +3365,7 @@
ld a, [wc718]
and a
jr z, .asm_3d54b
+
dec a
ld b, a
jr .asm_3d555
@@ -3365,6 +3375,7 @@
and a
ld b, $0
jr nz, .asm_3d555
+
and a
ret
@@ -3373,7 +3384,8 @@
ret
; 3d557
-Function3d557: ; 3d557
+ResetEnemyBattleVars: ; 3d557
+; and draw empty TextBox
xor a
ld [LastEnemyCounterMove], a
ld [LastPlayerCounterMove], a
@@ -3387,7 +3399,7 @@
ld a, $8
call Function3d490
call EmptyBattleTextBox
- jp Function1d6e
+ jp LoadMenuDataHeader_0x1d75
; 3d57a
Function3d57a: ; 3d57a
@@ -3406,7 +3418,7 @@
predef_jump FlagPredef
; 3d599
-Function3d599: ; 3d599
+FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
ld b, $ff
ld a, $1
ld [Buffer1], a
@@ -3433,8 +3445,8 @@
or c
pop bc
jr z, .asm_3d5d0
- call Function3d5d7
- call Function3d618
+ call LookUpTheEffectivenessOfEveryMove
+ call IsThePlayerPkmnTypesEffectiveAgainstOTPkmn
jr .asm_3d5a3
.asm_3d5d0
@@ -3443,7 +3455,7 @@
jr .asm_3d5a3
; 3d5d7
-Function3d5d7: ; 3d5d7
+LookUpTheEffectivenessOfEveryMove: ; 3d5d7
push bc
ld hl, OTPartyMon1Moves
ld a, b
@@ -3467,11 +3479,11 @@
ld a, BANK(Moves)
call FarCopyBytes
call SetEnemyTurn
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop bc
pop de
pop hl
- ld a, [wd265]
+ ld a, [wd265] ; Get The Effectiveness Modifier
cp 10 + 1 ; 1.0 + 0.1
jr c, .loop
ld hl, Buffer1
@@ -3481,7 +3493,9 @@
ret
; 3d618
-Function3d618: ; 3d618
+IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618
+; Calculates the effectiveness of the types of the PlayerPkmn
+; against the OTPkmn
push bc
ld hl, OTPartyCount
ld a, b
@@ -3501,13 +3515,13 @@
ld a, [BattleMonType1]
ld [wPlayerMoveStruct + MOVE_TYPE], a
call SetPlayerTurn
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
cp 10 + 1 ; 1.0 + 0.1
jr nc, .asm_3d663
ld a, [BattleMonType2]
ld [wPlayerMoveStruct + MOVE_TYPE], a
- callab Function347c8
+ callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
cp 10 + 1 ; 1.0 + 0.1
jr nc, .asm_3d663
@@ -3593,7 +3607,8 @@
ret
; 3d6ca
-Function3d6ca: ; 3d6ca
+LoadEnemyPkmnToSwitchTo: ; 3d6ca
+ ; 'b' contains the PartyNr of the Pkmn the AI will switch to
ld a, b
ld [CurPartyMon], a
ld hl, OTPartyMon1Level
@@ -3610,6 +3625,7 @@
ld [TempEnemyMonSpecies], a
ld [CurPartySpecies], a
call LoadEnemyMon
+
ld a, [CurPartySpecies]
cp UNOWN
jr nz, .asm_3d708
@@ -3621,6 +3637,7 @@
ld a, [UnownLetter]
ld [wdef4], a
.asm_3d708
+
ld hl, EnemyMonHP
ld a, [hli]
ld [wc6ea], a
@@ -3726,7 +3743,7 @@
call GetBaseData
ld a, OTPARTYMON
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
call Function3f47c
xor a
@@ -3734,7 +3751,7 @@
ld [wc689], a
call SetEnemyTurn
ld de, ANIM_SEND_OUT_MON
- call Function3ee17
+ call Call_PlayBattleAnim
call Function3da79
jr nc, .asm_3d800
@@ -3741,7 +3758,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
@@ -3803,7 +3820,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
@@ -3853,9 +3871,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
@@ -3898,7 +3917,7 @@
call SetPlayerTurn
call GetItemName
- ld hl, BattleText_0x80b89
+ ld hl, BattleText_UserFledUsingAStringBuffer1
call StdBattleTextBox
jp .asm_3d9a2
@@ -3915,7 +3934,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
@@ -3980,7 +3999,7 @@
call StdBattleTextBox
ld a, $1
ld [wd266], a
- call Function309d
+ call LoadTileMapToTempTileMap
and a
ret
@@ -3989,7 +4008,7 @@
and a
ld a, $2
jr z, .asm_3d9cf
- call Function309d
+ call LoadTileMapToTempTileMap
xor a
ld [wd0ec], a
ld a, $f
@@ -3997,7 +4016,7 @@
xor a
ld [CurPlayerMove], a
call Function3e8e4
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
call Function3d2e0
jr c, .asm_3d9f5
@@ -4022,7 +4041,7 @@
ld hl, BattleText_GotAwaySafely
call StdBattleTextBox
call WaitSFX
- call Function309d
+ call LoadTileMapToTempTileMap
scf
ret
@@ -4036,7 +4055,7 @@
.asm_3da05
call WaitSFX
- call Function309d
+ call LoadTileMapToTempTileMap
scf
ret
; 3da0d
@@ -4200,7 +4219,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
ld hl, EnemyMonHP
ld a, [hli]
or [hl]
@@ -4237,13 +4256,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
@@ -4327,7 +4346,7 @@
push bc
- ld hl, BattleText_0x80bae ; "hurt by SPIKES!"
+ ld hl, BattleText_UserHurtBySpikes ; "hurt by SPIKES!"
call StdBattleTextBox
call GetEighthMaxHP
@@ -4429,7 +4448,7 @@
ld [hBattleTurn], a
ld [wcfca], a
ld de, ANIM_RETURN_MON
- call Function3ee17
+ call Call_PlayBattleAnim
pop af
ld [hBattleTurn], a
ret
@@ -4739,7 +4758,7 @@
ld [bc], a
ld [de], a
call GetItemName
- ld hl, BattleText_0x80bde
+ ld hl, BattleText_UsersStringBuffer1Activated
call StdBattleTextBox
callab BattleCommand8c
ret
@@ -5108,10 +5127,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
@@ -5118,7 +5137,7 @@
call EmptyBattleTextBox
call UpdateBattleHuds
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
.ok
.loop
@@ -5157,7 +5176,7 @@
BattleMenu_Fight: ; 3e192
xor a
ld [wd267], a
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
and a
ret
; 3e19b
@@ -5197,7 +5216,7 @@
and a
jp nz, ItemsCantBeUsed
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld a, [BattleType]
cp BATTLETYPE_TUTORIAL
@@ -5236,12 +5255,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
@@ -5273,7 +5292,7 @@
call ExitMenu
call Function3df2c
call WaitBGMap
- call Function309d
+ call LoadTileMapToTempTileMap
call ResetTextRelatedRAM
call Function3ee27
and a
@@ -5286,16 +5305,16 @@
and $c0
ld [wBattleResult], a
call ResetTextRelatedRAM
- call Function32f9
+ call SetPalettes
scf
ret
; 3e28d
BattleMenu_PKMN: ; 3e28d
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
Function3e290:
call ExitMenu
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call WhiteBGMap
Function3e299:
call Function3d2fa
@@ -5335,9 +5354,9 @@
call DelayFrame
call Function3eda6
call WriteBackup
- call Function309d
+ call LoadTileMapToTempTileMap
call ClearSGB
- call Function32f9
+ call SetPalettes
jp BattleMenu
; 3e2f5
@@ -5389,7 +5408,7 @@
ld a, [CurPartyMon]
cp d
jr nz, .asm_3e36b
- ld hl, BattleText_0x80c0d
+ ld hl, BattleText_PkmnIsAlreadyOut
call StdBattleTextBox
jp Function3e299
@@ -5402,7 +5421,7 @@
jr z, .asm_3e381
.asm_3e378
- ld hl, BattleText_0x80c22
+ ld hl, BattleText_PkmnCantBeRecalled
call StdBattleTextBox
jp Function3e299
@@ -5419,7 +5438,7 @@
call Function3eda6
call WriteBackup
call ClearSGB
- call Function32f9
+ call SetPalettes
ld a, [CurPartyMon]
ld [CurBattleMon], a
; fallthrough
@@ -5431,7 +5450,7 @@
ld a, [wLinkMode]
and a
jr z, .asm_3e3c1
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function3e8e4
call WriteBackup
@@ -5482,7 +5501,7 @@
; 3e40b
BattleMonEntrance: ; 3e40b
- call Function3f2f4
+ call BattleMonNickComma_TextBox
ld c, 50
call DelayFrames
@@ -5510,7 +5529,7 @@
call BreakAttraction
call Function3db5f
call EmptyBattleTextBox
- call Function309d
+ call LoadTileMapToTempTileMap
call SetPlayerTurn
call SpikesDamage
ld a, $2
@@ -5532,10 +5551,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
@@ -5542,12 +5561,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
@@ -5570,7 +5589,7 @@
ret
; 3e4bc
-Function3e4bc: ; 3e4bc
+MoveSelectionScreen: ; 3e4bc
call IsMobileBattle
jr nz, .asm_3e4c8
callba Function100b9f
@@ -5761,16 +5780,16 @@
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
- jp Function3e4bc
+ call Call_LoadTempTileMapToTileMap
+ jp MoveSelectionScreen
; 3e61c
.string_3e61c ; 3e61c
@@ -5855,7 +5874,7 @@
.asm_3e69e
xor a
ld [wd0e3], a
- jp Function3e4bc
+ jp MoveSelectionScreen
.asm_3e6a5
push hl
@@ -5882,7 +5901,7 @@
.asm_3e6bf
ld a, [wcfa9]
ld [wd0e3], a
- jp Function3e4bc
+ jp MoveSelectionScreen
; 3e6c8
MoveInfoBox: ; 3e6c8
@@ -6026,7 +6045,7 @@
ret nz
.asm_3e7b4
- ld hl, BattleText_0x80c72
+ ld hl, BattleText_PkmnHasNoMovesLeft
call StdBattleTextBox
ld c, 60
call DelayFrames
@@ -6044,11 +6063,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
@@ -6055,7 +6074,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]
@@ -6083,8 +6102,8 @@
jp .asm_3e87f
.asm_3e824
- call Function3e8d1
- jp nz, Function3e8c1
+ call CheckSubstatus_RechargeChargedRampageBideRollout
+ jp nz, ResetVarsForSubstatusRage
jr .asm_3e830
.asm_3e82c
@@ -6149,7 +6168,7 @@
.asm_3e882
call SetEnemyTurn
callab UpdateMoveData
- call Function3e8d1
+ call CheckSubstatus_RechargeChargedRampageBideRollout
jr nz, .asm_3e894
xor a
ld [wc733], a
@@ -6185,7 +6204,7 @@
jr .asm_3e87f
; 3e8c1
-Function3e8c1: ; 3e8c1
+ResetVarsForSubstatusRage: ; 3e8c1
xor a
ld [EnemyFuryCutterCount], a
ld [EnemyProtectCount], a
@@ -6195,14 +6214,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
@@ -6498,7 +6519,7 @@
ld de, EnemyMonMaxHP
ld b, $00
ld hl, LinkBattleRNs + 7 ; ?
- predef Functione167
+ predef CalcPkmnStats
; If we're in a trainer battle,
; get the rest of the parameters from the party struct
@@ -6999,10 +7020,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
@@ -7010,7 +7032,7 @@
ret
; 3ecb7
-Function3ecb7: ; 3ecb7
+ApplyStatLevelMultiplier: ; 3ecb7
push bc
push bc
ld a, [wd265]
@@ -7321,7 +7343,7 @@
ret nz
; 3ee17
-Function3ee17: ; 3ee17
+Call_PlayBattleAnim: ; 3ee17
ld a, e
ld [FXAnimIDLo], a
ld a, d
@@ -7337,7 +7359,7 @@
push hl
ld b, $1
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
pop hl
pop de
@@ -7347,7 +7369,7 @@
; 3ee3b
-Function3ee3b: ; 3ee3b
+GiveExperiencePoints: ; 3ee3b
; Give experience.
ld a, [wLinkMode]
and a
@@ -7479,7 +7501,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
@@ -7488,7 +7510,7 @@
pop bc
call Function3f136
push bc
- call Function309d
+ call LoadTileMapToTempTileMap
pop bc
ld hl, $000a
add hl, bc
@@ -7549,7 +7571,7 @@
.asm_3ef74
xor a ; PARTYMON
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
callab Function50e1b
pop bc
ld hl, PartyMon1Level - PartyMon1
@@ -7585,7 +7607,7 @@
add hl, bc
push bc
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
pop bc
pop de
ld hl, $0025
@@ -7635,12 +7657,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
@@ -7654,14 +7676,14 @@
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 ; PARTYMON
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
hlcoord 9, 0
ld b, $a
ld c, $9
@@ -7672,7 +7694,7 @@
ld c, $1e
call DelayFrames
call Functiona80
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
xor a ; PARTYMON
ld [MonType], a
ld a, [CurSpecies]
@@ -7740,14 +7762,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
@@ -7771,30 +7793,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
@@ -7816,7 +7838,7 @@
ld [DefaultFlypoint], a
xor a ; PARTYMON
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
ld a, [TempMonLevel]
ld b, a
ld e, a
@@ -7899,7 +7921,7 @@
call PlaySFX
callba Function8e79d
call WaitSFX
- ld hl, BattleText_0x80c9c
+ ld hl, BattleText_StringBuffer1GrewToLevel
call StdBattleTextBox
pop de
inc e
@@ -8080,17 +8102,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
@@ -8122,41 +8146,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
@@ -8167,7 +8195,7 @@
and a
jr z, .asm_3f36d
dec [hl]
- ld hl, BattleText_0x80cba
+ ld hl, BattleText_WildPkmnIsEating
jr .asm_3f388
.asm_3f36d
@@ -8176,7 +8204,7 @@
and a
ret z
dec [hl]
- ld hl, BattleText_0x80cd1
+ ld hl, BattleText_WildPkmnIsAngry
jr nz, .asm_3f388
push hl
ld a, [EnemyMonSpecies]
@@ -8188,7 +8216,7 @@
.asm_3f388
push hl
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
pop hl
jp StdBattleTextBox
; 3f390
@@ -8743,7 +8771,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
@@ -8863,7 +8891,7 @@
call Function3200
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld c, $8
call DelayFrames
call Functiona80
@@ -9365,7 +9393,7 @@
call HideSprites
ld b, $1
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, $90
ld [hWY], a
xor a
@@ -9520,7 +9548,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 BattleCommand_CalcDamageTypeMultiplier ; 346d2 - 07
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 BattleCommand_DamageCalcWithStats ; 35612 - 62
dw BattleCommand63 ; 3790e
dw BattleCommand64 ; 37939
dw BattleCommand65 ; 37972
@@ -148,7 +148,7 @@
dw BattleCommand90 ; 34ecc
dw BattleCommand91 ; 34fdb
dw BattleCommand92 ; 34fd1
- dw BattleCommand93 ; 34ffd
+ dw BattleCommand_SwitchTurn ; 34ffd - 93
dw BattleCommand94 ; 36a82
dw BattleCommand95 ; 37c1a
dw BattleCommand96 ; 37c55
@@ -170,7 +170,7 @@
dw BattleCommanda6 ; 365af
dw BattleCommanda7 ; 365c3
dw BattleCommanda8 ; 355b5
- dw BattleCommanda9 ; 355d5
+ dw BattleCommand_IfAttackMissedResetDamage ; 355d5 - a9
dw BattleCommandaa ; 37e80
dw BattleCommandab ; 34f57
dw BattleCommandac ; 3658f
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -385,9 +385,9 @@
Function34216: ; 34216
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call CantMove
- jp SwitchTurn
+ jp BattleCommand_SwitchTurn
; 3421f
@@ -539,7 +539,7 @@
ld hl, HurtItselfText
call StdBattleTextBox
call Function355dd
- call BattleCommand62
+ call BattleCommand_DamageCalcWithStats
call BattleCommand0a
xor a
ld [wcfca], a
@@ -652,7 +652,7 @@
ld [CriticalHit], a
call Function355dd
- call BattleCommand62
+ call BattleCommand_DamageCalcWithStats
call BattleCommand0a
xor a
@@ -1336,8 +1336,8 @@
; 346d2
-BattleCommand07: ; 346d2
-; stab
+BattleCommand_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]
@@ -1512,7 +1512,7 @@
jr .TypesLoop
.end
- call Function347c8
+ call HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
ld b, a
ld a, [TypeModifier]
@@ -1523,7 +1523,7 @@
; 347c8
-Function347c8: ; 347c8
+HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn: ; 347c8
ld hl, EnemyMonType1
ld a, [hBattleTurn]
and a
@@ -1601,7 +1601,7 @@
BattleCommanda3: ; 34833
- call Function347c8
+ call HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265]
and a
ld a, 10 ; 1.0
@@ -2874,8 +2874,7 @@
; 34ffd
-SwitchTurn: ; 34ffd
-BattleCommand93: ; 34ffd
+BattleCommand_SwitchTurn: ; 34ffd
; switchturn
ld a, [hBattleTurn]
@@ -3248,7 +3247,7 @@
predef Functionc6e0
call RefreshBattleHuds
- call SwitchTurn
+ call BattleCommand_SwitchTurn
xor a
ld [wcfca], a
ld [FXAnimIDHi], a
@@ -3256,7 +3255,7 @@
ld [wc689], a
ld a, $c2
call Function37e44
- call SwitchTurn
+ call BattleCommand_SwitchTurn
jr .asm_3524d ; 3522f $1c
@@ -3307,10 +3306,10 @@
ret z
ld [de], a
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, RageBuildingText
call StdBattleTextBox
- jp SwitchTurn
+ jp BattleCommand_SwitchTurn
; 3527b
@@ -3934,6 +3933,7 @@
ld a, [wc72d]
and a
ret nz
+
jp PrintButItFailed
; 355bd
@@ -3954,14 +3954,14 @@
call GetPartyLocation
pop bc
ret
-; 355d5
-BattleCommanda9: ; 355d5
+BattleCommand_IfAttackMissedResetDamage: ; 355d5
; clearmissdamage
ld a, [AttackMissed]
and a
ret z
+
jp ResetDamage
; 355dd
@@ -4004,7 +4004,7 @@
; 35612
-BattleCommand62: ; 35612
+BattleCommand_DamageCalcWithStats: ; 35612
; damagecalc
; Return a damage value for move power d, player level e, enemy defense c and player attack b.
@@ -4138,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
@@ -4397,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 BattleCommand_DamageCalcWithStats
pop hl
ld [hl], 1
ret
@@ -4754,7 +4754,7 @@
cp CURSE_T
jr z, .asm_35a50
call AnimateCurrentMove
- call SwitchTurn
+ call BattleCommand_SwitchTurn
.asm_35a13
call BattleRandom
@@ -4775,7 +4775,7 @@
push hl
ld a, d
ld [hl], a
- call Function347c8
+ call HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop hl
pop af
ld [hl], a
@@ -4783,7 +4783,7 @@
ld a, [wd265]
cp $a
jr nc, .asm_35a13
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld a, [hl]
ld [wd265], a
@@ -5457,13 +5457,13 @@
ld hl, SubFadedText
call StdBattleTextBox
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call BattleCommanda7
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
call z, Function37ec7
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVarAddr
@@ -6539,15 +6539,15 @@
and a
jr z, .Player
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call Function365d7
- call SwitchTurn
+ call BattleCommand_SwitchTurn
jr .end
.Player
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call Function365fd
- call SwitchTurn
+ call BattleCommand_SwitchTurn
.end
ld a, 1
and a
@@ -6828,7 +6828,7 @@
ld hl, BadgeStatBoosts
call CallBattleCore
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, Function3ec39
call CallBattleCore
@@ -6836,7 +6836,7 @@
ld hl, Function3ec76
call CallBattleCore
- jp SwitchTurn
+ jp BattleCommand_SwitchTurn
; 365fd
@@ -6848,7 +6848,7 @@
ld a, $5
call Function3661d
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, Function3ec39
call CallBattleCore
@@ -6856,7 +6856,7 @@
ld hl, Function3ec76
call CallBattleCore
- jp SwitchTurn
+ jp BattleCommand_SwitchTurn
; 3661d
@@ -7056,10 +7056,10 @@
ld [de], a
jr nz, .asm_3674c ; 36730 $1a
res 1, [hl]
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call Function37962
push af
- call SwitchTurn
+ call BattleCommand_SwitchTurn
pop af
jr nz, .asm_3674c ; 3673f $b
set 7, [hl]
@@ -7202,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
@@ -8823,10 +8823,10 @@
call CallBattleCore
.asm_371a9
call AnimateCurrentMove
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, Function3ccef
call CallBattleCore
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call UpdateUserInParty
call RefreshBattleHuds
ld hl, RegainedHealthText
@@ -9500,7 +9500,7 @@
push de
.asm_3787d
- call BattleCommand07
+ call BattleCommand_CalcDamageTypeMultiplier
ld a, [wLinkMode]
cp $3
@@ -9544,7 +9544,7 @@
ld a, $3
ld [wc689], a
call AnimateCurrentMove
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, AICheckPlayerMaxHP
ld a, [hBattleTurn]
and a
@@ -9557,18 +9557,18 @@
ld hl, GetQuarterMaxHP
call CallBattleCore
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, Function3ccef
call CallBattleCore
- call SwitchTurn
+ call BattleCommand_SwitchTurn
ld hl, RegainedHealthText
call StdBattleTextBox
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call UpdateOpponentInParty
jr .asm_37904 ; 378f1 $11
.asm_378f3
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call Function37ed5
jr nc, .asm_37904 ; 378f9 $9
call AnimateFailedMove
@@ -9733,7 +9733,7 @@
call DelayFrames
; Transition into switchmon menu
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function3d2f7
callba ForcePickSwitchMonInBattle
@@ -9748,7 +9748,7 @@
call ClearBox
ld b, 1
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call BatonPass_LinkPlayerSwitch
; Mobile link battles handle entrances differently
@@ -9789,7 +9789,7 @@
call CallBattleCore
ld a, 1
ld [wd265], a
- ld hl, Function3ecab
+ ld hl, ApplyStatLevelMultiplierOnAllStats
call CallBattleCore
ld hl, SpikesDamage
@@ -9807,7 +9807,7 @@
ld a, 1
ld [wd0ec], a
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, Function3e8e4
call CallBattleCore
call WriteBackup
@@ -9823,7 +9823,7 @@
and a
ret z
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, Function3e8e4
call CallBattleCore
@@ -10094,11 +10094,11 @@
rst FarCall
call AnimateCurrentMove
- call SwitchTurn
+ call BattleCommand_SwitchTurn
callab Function3ccef
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call UpdateUserInParty
; 'regained health!'
@@ -10596,11 +10596,11 @@
push hl
push de
push bc
- call SwitchTurn
+ call BattleCommand_SwitchTurn
callab PlayBattleAnim
- call SwitchTurn
+ call BattleCommand_SwitchTurn
pop bc
pop de
pop hl
--- a/battle/effects/curse.asm
+++ b/battle/effects/curse.asm
@@ -44,10 +44,10 @@
call AnimateCurrentMove
ld a, $2
call Function36532
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call BattleCommand8d
call ResetMiss
- call SwitchTurn
+ call BattleCommand_SwitchTurn
call BattleCommand70
call BattleCommand8c
call ResetMiss
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -6,9 +6,6 @@
MAX_KEY_ITEMS EQU 25
MAX_PC_ITEMS EQU 50
-LO_NYBBLE EQU $0f
-HI_NYBBLE EQU $f0
-
; strings
PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11
--- 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
@@ -1034,9 +1034,11 @@
ld a, [wRepelEffect]
and a
ret z
+
dec a
ld [wRepelEffect], a
ret nz
+
ld a, BANK(RepelWoreOffScript)
ld hl, RepelWoreOffScript
call CallScript
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -164,7 +164,7 @@
Jumptable_10137: ; 10137
dw Function10159
- dw Function10492
+ dw Function10492_ret
; 1013b
MenuDataHeader_0x1013b: ; 0x1013b
@@ -186,7 +186,7 @@
Jumptable_10153: ; 10153
dw Function10159
dw Function103fd
- dw Function10492
+ dw Function10492_ret
; 10159
Function10159: ; 10159
@@ -330,7 +330,7 @@
dw Function103fd
dw Function10364
dw Function103c2
- dw Function10492
+ dw Function10492_ret
; 10274
MenuDataHeader_0x10274: ; 0x10274
@@ -354,7 +354,7 @@
dw Function10311
dw Function103fd
dw Function10364
- dw Function10492
+ dw Function10492_ret
; 10299
MenuDataHeader_0x10299: ; 0x10299
@@ -374,7 +374,7 @@
Jumptable_102ac: ; 102ac
dw Function10311
- dw Function10492
+ dw Function10492_ret
; 102b0
MenuDataHeader_0x102b0: ; 0x102b0
@@ -396,7 +396,7 @@
Jumptable_102c7: ; 102c7
dw Function10311
dw Function103c2
- dw Function10492
+ dw Function10492_ret
; 102cd
MenuDataHeader_0x102cd: ; 0x102cd
@@ -420,7 +420,7 @@
dw Function103fd
dw Function10364
dw Function103c2
- dw Function10492
+ dw Function10492_ret
; 102f2
MenuDataHeader_0x102f2: ; 0x102f2
@@ -442,7 +442,7 @@
Jumptable_1030b: ; 1030b
dw Function103fd
dw Function10364
- dw Function10492
+ dw Function10492_ret
; 10311
Function10311: ; 10311
@@ -484,7 +484,7 @@
call Function10a40
ret
.NoPokemon
- ld hl, UnknownText_0x10af8
+ ld hl, TextJump_YouDontHaveAPkmn
call Function10889
ret
@@ -602,16 +602,19 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
jr c, .asm_10475
+
ld a, [CurPartySpecies]
cp EGG
jr nz, .asm_10453
- ld hl, UnknownText_0x1048d
+
+ ld hl, TextJump_AnEGGCantHoldAnItem
call PrintText
jr .asm_10427
+
.asm_10453
ld a, [wJumptableIndex]
push af
@@ -638,18 +641,18 @@
ret
Function10486: ; 10486 (4:4486)
- ld hl, UnknownText_0x10af8
+ ld hl, TextJump_YouDontHaveAPkmn
call Function10889
ret
; 1048d (4:448d)
-UnknownText_0x1048d: ; 0x1048d
+TextJump_AnEGGCantHoldAnItem: ; 0x1048d
; An EGG can't hold an item.
- text_jump UnknownText_0x1c0b7f
+ text_jump Text_AnEGGCantHoldAnItem
db "@"
; 0x10492
-Function10492: ; 10492
+Function10492_ret: ; 10492
ret
; 10493
@@ -1517,7 +1520,7 @@
call WaitBGMap
ld b, SCREEN_WIDTH
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
; 10a4f
@@ -1660,9 +1663,9 @@
db "@"
; 0x10af8
-UnknownText_0x10af8: ; 0x10af8
+TextJump_YouDontHaveAPkmn: ; 0x10af8
; You don't have a #MON!
- text_jump UnknownText_0x1c0c17
+ text_jump Text_YouDontHaveAPkmn
db "@"
; 0x10afd
@@ -1690,9 +1693,10 @@
db "@"
; 0x10b11
-UnknownText_0x10b11: ; 0x10b11
- ; You can't use it in a battle.
- text_jump UnknownText_0x1c0c85
+TextJump_YouCantUseItInABattle: ; 0x10b11
+ ; Doesn't seem to be used anywhere
+ ; "You can't use it in a battle."
+ text_jump Text_YouCantUseItInABattle
db "@"
; 0x10b16
--- a/engine/predef.asm
+++ b/engine/predef.asm
@@ -38,11 +38,11 @@
add_predef FillPP
add_predef TryAddMonToParty
add_predef Functionda96
- add_predef Functiondb3f ; $8
+ add_predef SentGetPkmnIntoFromBox
add_predef SentPkmnIntoBox
add_predef GiveEgg
add_predef Functionc6e0
- add_predef Functione167
+ add_predef CalcPkmnStats
add_predef Functione17b
add_predef CanLearnTMHMMove
add_predef GetTMHMMove
@@ -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
@@ -61,7 +61,7 @@
add_predef Function421e6
add_predef Function28f63
add_predef Function28f24
- add_predef Function5084a
+ add_predef CopyPkmnToTempMon
add_predef ListMoves ; $20
add_predef Function50d2e
add_predef Function50cdb
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -1,5 +1,5 @@
Function14a1a: ; 14a1a
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function5e9a
call SpeechTextBox
call UpdateSprites
--- a/event/kurt.asm
+++ b/event/kurt.asm
@@ -23,7 +23,7 @@
; 0x88018
Special_SelectApricornForKurt: ; 88018
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld c, $1
xor a
ld [wd0e4], a
@@ -52,7 +52,7 @@
call Kurt_GiveUpSelectedQuantityOfSelectedApricorn
.done
- call Function1d7d
+ call Call_ExitMenu
ret
; 88055
--- a/event/mom.asm
+++ b/event/mom.asm
@@ -103,7 +103,7 @@
.AccessBankOfMom: ; 162a8
ld hl, UnknownText_0x1665d
call PrintText
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, MenuDataHeader_0x166b5
call CopyMenuDataHeader
call InterpretMenu2
@@ -148,7 +148,7 @@
ld [hl], a
ld a, $5
ld [wcf64], a
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function16517
call Function1656b
call Function16571
@@ -216,7 +216,7 @@
ld [hl], a
ld a, $5
ld [wcf64], a
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function16512
call Function1656b
call Function16571
--- a/event/move_deleter.asm
+++ b/event/move_deleter.asm
@@ -19,7 +19,7 @@
jr z, .asm_2c5ca
ld hl, UnknownText_0x2c5ea
call PrintText
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function12f5b
push af
call Function2b74
--- 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)
@@ -682,11 +685,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
@@ -694,7 +698,7 @@
ld [rOBP1], a
ret
-.asm_3309
+.SetPalettesForGameBoyColor
push de
ld a, $e4
call DmgToCgbBGPals
@@ -965,10 +969,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
@@ -1165,7 +1169,7 @@
ld hl, VramState
bit 0, [hl]
jp nz, UpdateTimePals
- jp Function32f9
+ jp SetPalettes
; 352f
Function352f:: ; 352f
--- a/home/map.asm
+++ b/home/map.asm
@@ -1957,7 +1957,7 @@
FadeToMenu:: ; 2b29
xor a
ld [hBGMapMode], a
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba FadeBlackBGMap
call ClearSprites
call DisableSpriteUpdates
@@ -1969,7 +1969,7 @@
call WhiteBGMap
call Function2bae
call UpdateSprites
- call Function1d7d
+ call Call_ExitMenu
call Functiond90
jr Function2b5c
; 2b4d
@@ -1976,7 +1976,7 @@
Function2b4d:: ; 2b4d
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function2bae
call UpdateSprites
call Functiond90
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -52,7 +52,7 @@
ret
; 1d6e
-Function1d6e:: ; 1d6e
+LoadMenuDataHeader_0x1d75:: ; 1d6e
ld hl, MenuDataHeader_0x1d75
call LoadMenuDataHeader
ret
@@ -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
@@ -89,7 +89,7 @@
hRandomAdd EQU $ffe1
hRandomSub EQU $ffe2
hSecondsBackup EQU $ffe3
-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
@@ -1143,13 +1143,13 @@
ld de, MUSIC_CAPTURE
call PlayMusic
pop bc
- ld hl, UnknownText_0xede6
+ ld hl, TextJump_Waitbutton
ret
; ede6
-UnknownText_0xede6: ; 0xede6
+TextJump_Waitbutton: ; 0xede6
; @
- text_jump UnknownText_0x1c5b35
+ text_jump Text_Waitbutton_2
db "@"
; 0xedeb
@@ -1262,7 +1262,7 @@
ld bc, ITEM_NAME_LENGTH
call CopyBytes
- call Functionf780
+ call Play_SFX_FULL_HEAL
ld hl, UnknownText_0xeea6
call PrintText
@@ -1288,7 +1288,7 @@
ld a, PartyMon1HPExp - 1 - PartyMon1
call GetPartyParamLocation
ld b, $1
- predef_jump Functione167
+ predef_jump CalcPkmnStats
; ee9f
Functionee9f: ; ee9f
@@ -1427,7 +1427,7 @@
xor a ; PARTYMON
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
hlcoord 9, 0
ld b, 10
@@ -1518,7 +1518,7 @@
ld a, b
ld [PartyMenuActionText], a
call Functionf030
- call Functionf780
+ call Play_SFX_FULL_HEAL
call Functionf279
call Functionf795
ld a, $0
@@ -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
@@ -2256,16 +2256,17 @@
Function_0xf46c: ; f46c
ld a, [wRepelEffect]
and a
- ld hl, UnknownText_0xf47d
+ ld hl, TextJump_RepelUsedEarlierIsStillInEffect
jp nz, PrintText
+
ld a, b
ld [wRepelEffect], 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
@@ -2520,6 +2521,7 @@
ld [MiscBuffer2], a
.loop
+ ; Party Screen opens to choose on which Pkmn to use the Item
ld b, $1
call Functionf1f9
jp c, Functionf6e0
@@ -2531,11 +2533,11 @@
cp ELIXER
jp z, Elixer_RestorePPofAllMoves
- ld hl, UnknownText_0xf725
+ ld hl, TextJump_RaiseThePPOfWhichMove
ld a, [MiscBuffer2]
cp PP_UP
jr z, .ppup
- ld hl, UnknownText_0xf72a
+ ld hl, TextJump_RestoreThePPOfWhichMove
.ppup
call PrintText
@@ -2546,9 +2548,9 @@
ld [CurMoveNum], a
ld a, $2
ld [wd235], a
- callba Function3e4bc
-
+ callba MoveSelectionScreen
pop bc
+
ld a, b
ld [CurMoveNum], a
jr nz, .loop
@@ -2561,8 +2563,8 @@
ld [wd265], a
call GetMoveName
call CopyName1
-
pop hl
+
ld a, [MiscBuffer2]
cp PP_UP
jp nz, Functionf6a7
@@ -2574,24 +2576,25 @@
ld bc, $0015
add hl, bc
ld a, [hl]
- cp 3 << 6
+ cp 3 << 6 ; have 3 PP Ups already been used?
jr c, .do_ppup
.CantUsePPUpOnSketch
- ld hl, UnknownText_0xf72f
+.pp_is_maxed_out
+ ld hl, TextJump_PPIsMaxedOut
call PrintText
jr .loop2
.do_ppup
ld a, [hl]
- add 1 << 6
+ add 1 << 6 ; increase PP Up count by 1
ld [hl], a
ld a, $1
ld [wd265], a
call Functionf84c
- call Functionf780
+ call Play_SFX_FULL_HEAL
- ld hl, UnknownText_0xf734
+ ld hl, TextJump_PPsIncreased
call PrintText
Functionf64c: ; f64c
@@ -2614,7 +2617,7 @@
call .asm_f677
.asm_f66c
- call Functionf780
+ call Play_SFX_FULL_HEAL
ld hl, UnknownText_0xf739
call PrintText
jr Functionf64c
@@ -2748,27 +2751,27 @@
ret
; f725
-UnknownText_0xf725: ; 0xf725
+TextJump_RaiseThePPOfWhichMove: ; 0xf725
; Raise the PP of which move?
- text_jump UnknownText_0x1c5c8a
+ text_jump Text_RaiseThePPOfWhichMove
db "@"
; 0xf72a
-UnknownText_0xf72a: ; 0xf72a
+TextJump_RestoreThePPOfWhichMove: ; 0xf72a
; Restore the PP of which move?
- text_jump UnknownText_0x1c5ca7
+ text_jump Text_RestoreThePPOfWhichMove
db "@"
; 0xf72f
-UnknownText_0xf72f: ; 0xf72f
+TextJump_PPIsMaxedOut: ; 0xf72f
; 's PP is maxed out.
- text_jump UnknownText_0x1c5cc6
+ text_jump Text_PPIsMaxedOut
db "@"
; 0xf734
-UnknownText_0xf734: ; 0xf734
+TextJump_PPsIncreased: ; 0xf734
; 's PP increased.
- text_jump UnknownText_0x1c5cdd
+ text_jump Text_PPsIncreased
db "@"
; 0xf739
@@ -2925,7 +2928,7 @@
; f780
-Functionf780: ; f780
+Play_SFX_FULL_HEAL: ; f780
push de
ld de, SFX_FULL_HEAL
call WaitPlaySFX
@@ -2936,7 +2939,7 @@
Functionf789: ; f789
ld hl, UsedItemText
call PrintText
- call Functionf780
+ call Play_SFX_FULL_HEAL
call Functiona80
; fallthrough
; f795
--- a/main.asm
+++ b/main.asm
@@ -132,7 +132,7 @@
ld [wc2cc], a
call ResetWRAM
call Function5b44
- call Function5b8f
+ call AreYouABoyOrAreYouAGirl
call OakSpeech
call InitializeWorld
ld a, 1
@@ -146,8 +146,8 @@
jp FinishContinueFunction
; 5b8f
-Function5b8f: ; 5b8f
- callba Function10632f
+AreYouABoyOrAreYouAGirl: ; 5b8f
+ callba Function10632f ; some mobile stuff
jr c, .ok
callba InitGender
ret
@@ -415,7 +415,7 @@
callba TryLoadSaveFile
jr c, .FailToLoad
callba Function150b9
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function5e85
ld a, $1
ld [hBGMapMode], a
@@ -1587,7 +1587,7 @@
; 6508
LearnMove: ; 6508
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [CurPartyMon]
ld hl, PartyMonNicknames
call GetNick
@@ -1749,7 +1749,7 @@
ld [wcfa7], a
call Function1bc9
push af
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
pop af
pop hl
bit 1, a
@@ -3192,7 +3192,7 @@
ld a, $7
call ByteFill
call Function3200
- call Function32f9
+ call SetPalettes
ret
; 8029
@@ -5197,7 +5197,7 @@
.outdoors
xor a
ld [$ffde], a
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call ClearSprites
callba _FlyMap
ld a, e
@@ -7931,6 +7931,7 @@
TryAddMonToParty: ; d88c
+; Check if to copy wild Pkmn or generate new Pkmn
; Whose is it?
ld de, PartyCount
ld a, [MonType]
@@ -8198,12 +8199,15 @@
ld [de], a
inc de
ld hl, EnemyMonStatus
+ ; Copy EnemyMonStatus
ld a, [hli]
ld [de], a
inc de
+ ; Copy EnemyMonUnused
ld a, [hli]
ld [de], a
inc de
+ ; Copy EnemyMonHP
ld a, [hli]
ld [de], a
inc de
@@ -8216,7 +8220,7 @@
dec a
jr nz, .generatestats
ld hl, EnemyMonMaxHP
- ld bc, 12
+ ld bc, 2*6 ; MaxHP + 5 Stats
call CopyBytes
pop hl
jr .next3
@@ -8223,10 +8227,11 @@
.generatestats
pop hl
- ld bc, $000a
+ ld bc, 2*5 ; 5 Stats
add hl, bc
- ld b, $0
- call Functione167
+ ld b, $0 ; if b = 1, then the Stats of the Pkmn are calculated
+ ; only the current HP aren't set to MaxHP after this
+ call CalcPkmnStats
.next3
ld a, [MonType]
@@ -8248,6 +8253,7 @@
ret
; da6d
+
FillPP: ; da6d
push bc
ld b, NUM_MOVES
@@ -8285,6 +8291,7 @@
cp PARTY_LENGTH
scf
ret z
+
inc a
ld [hl], a
ld c, a
@@ -8358,30 +8365,37 @@
and a
ret
-; db3f
-Functiondb3f: ; db3f
+
+SentGetPkmnIntoFromBox: ; db3f
+; Sents/Gets Pkmn into/from Box depending on Parameter
+; wd10b == 0: get Pkmn into Party
+; wd10b == 1: sent Pkmn into Box
+
ld a, BANK(sBoxCount)
call GetSRAMBank
ld a, [wd10b]
and a
- jr z, .asm_db60
+ jr z, .check_IfPartyIsFull
cp $2
- jr z, .asm_db60
+ jr z, .check_IfPartyIsFull
cp $3
ld hl, wBreedMon1Species
jr z, .asm_db9b
+
+ ; we want to sent a Pkmn into the Box
+ ; so check if there's enough space
ld hl, sBoxCount
ld a, [hl]
cp MONS_PER_BOX
jr nz, .asm_db69
- jp Functiondcb1
+ jp CloseSRAM_And_SetCFlag
-.asm_db60
+.check_IfPartyIsFull
ld hl, PartyCount
ld a, [hl]
cp PARTY_LENGTH
- jp z, Functiondcb1
+ jp z, CloseSRAM_And_SetCFlag
.asm_db69
inc a
@@ -8409,7 +8423,7 @@
ld a, [sBoxCount]
.asm_db97
- dec a
+ dec a ; PartyCount - 1
call AddNTimes
.asm_db9b
@@ -8512,7 +8526,7 @@
srl a
add $2
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
callab Function50e1b
ld a, d
ld [CurPartyLevel], a
@@ -8530,7 +8544,7 @@
add hl, bc
push bc
ld b, $1
- call Functione167
+ call CalcPkmnStats
pop bc
ld a, [wd10b]
and a
@@ -8575,7 +8589,7 @@
ret
; dcb1
-Functiondcb1: ; dcb1
+CloseSRAM_And_SetCFlag: ; dcb1
call CloseSRAM
scf
ret
@@ -8583,7 +8597,6 @@
Functiondcb6: ; dcb6
-
ld a, b
ld hl, sBoxMons
ld bc, sBoxMon1End - sBoxMon1
@@ -8747,7 +8760,7 @@
add hl, bc
push bc
ld b, $1
- call Functione167
+ call CalcPkmnStats
ld hl, PartyMon1Moves
ld a, [PartyCount]
dec a
@@ -8891,8 +8904,9 @@
ld [de], a
inc de
+ ; Set all 5 Experience Values to 0
xor a
- ld b, $a
+ ld b, 2*5
.asm_dee5
ld [de], a
inc de
@@ -8935,10 +8949,12 @@
ld de, TempMonMoves
ld bc, NUM_MOVES
call CopyBytes
+
ld hl, sBoxMon1PP
ld de, TempMonPP
ld bc, NUM_MOVES
call CopyBytes
+
ld b, 0
call Functiondcb6
@@ -8947,6 +8963,7 @@
ret
; df42
+
Functiondf42: ; df42
call CloseSRAM
and a
@@ -9061,7 +9078,7 @@
dec a
ld hl, PartyMonNicknames
call SkipNames
- ld de, Stringe035
+ ld de, String_Egg
call CopyName2
ld a, [PartyCount]
dec a
@@ -9088,12 +9105,11 @@
ret
; e035
-Stringe035: ; e035
+String_Egg: ; e035
db "EGG@"
; e039
Functione039: ; e039
-
ld hl, PartyCount
ld a, [wd10b]
@@ -9261,7 +9277,7 @@
ld a, PartyMon1Exp + 2 - PartyMon1
call GetPartyParamLocation
ld b, $1
- call Functione167
+ call CalcPkmnStats
pop de
ld a, PartyMon1HP - PartyMon1
call GetPartyParamLocation
@@ -9273,7 +9289,12 @@
ret
; e167
-Functione167: ; e167
+CalcPkmnStats: ; e167
+; Calculates all 6 Stats of a Pkmn
+; b = 0 or 1
+; 'c' counts from 1-6 and points with 'BaseStats' to the base value
+; results in $ffb5 and $ffb6 are saved in [de]
+
ld c, $0
.asm_e169
inc c
@@ -9291,6 +9312,8 @@
; e17b
Functione17b: ; e17b
+; 'c' is 1-6 and points to the BaseStat
+
push hl
push de
push bc
@@ -9297,8 +9320,8 @@
ld a, b
ld d, a
push hl
- ld hl, BaseHP
- dec hl
+ ld hl, BaseStats
+ dec hl ; has to be decreased, because 'c' begins with 1
ld b, $0
add hl, bc
ld a, [hl]
@@ -9669,6 +9692,7 @@
ret
; e3d9
+
TextJump_WasSentToBillsPC: ; 0xe3d9
; was sent to BILL's PC.
text_jump Text_WasSentToBillsPC
@@ -9677,7 +9701,7 @@
Functione3de: ; e3de
push de
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call DisableSpriteUpdates
pop de
push de
@@ -9718,7 +9742,7 @@
Functione41c: ; e41c (3:641c)
xor a
ld [hBGMapMode], a ; $ff00+$d4
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call ClearPCItemScreen
ld hl, Options
ld a, [hl]
@@ -9748,7 +9772,7 @@
ld a, $1
.asm_e44b
ld [wMenuCursorBuffer], a
- call Function32f9
+ call SetPalettes
xor a
ld [wcf76], a
ld [hBGMapMode], a ; $ff00+$d4
@@ -9814,7 +9838,7 @@
; e4cd
Functione4cd: ; e4cd
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function44781
jr nc, .asm_e4e0
ld hl, UnknownText_0xe4f9
@@ -9841,7 +9865,7 @@
; 0xe4fe
Functione4fe: ; e4fe (3:64fe)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Functione2391
call Function222a
call ClearPCItemScreen
@@ -9917,7 +9941,7 @@
Functione559: ; e559 (3:6559)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Functione2583
call Function222a
call ClearPCItemScreen
@@ -9968,7 +9992,7 @@
ld bc, $0412
call TextBox
call Function3200
- call Function32f9 ; load regular palettes?
+ call SetPalettes ; load regular palettes?
ret
; 0xe5bb
@@ -10476,7 +10500,7 @@
call Function1171d
call WaitBGMap
call WaitTop
- call Function32f9
+ call SetPalettes
call Function11be0
ret
; 1171d
@@ -12252,7 +12276,7 @@
Function1250a: ; 1250a
ld b, $0
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; 12513
@@ -12563,7 +12587,7 @@
.Clear ; 126b7
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function2bae
call .DrawMenuAccount_
call MenuFunc_1e7f
@@ -12963,7 +12987,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
@@ -13185,7 +13209,7 @@
call AddNTimes
ld [hl], "▷"
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
@@ -13234,7 +13258,7 @@
cp 1
jr nz, .asm_12ba0
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call ClearPalettes
call Function12ba9
call ClearPalettes
@@ -13647,7 +13671,7 @@
OpenPartyStats: ; 12e00
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call ClearSprites
; PartyMon
xor a
@@ -13655,7 +13679,7 @@
call LowVolume
predef StatsScreenInit
call MaxVolume
- call Function1d7d
+ call Call_ExitMenu
ld a, 0
ret
; 12e1b
@@ -13826,19 +13850,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
@@ -14209,7 +14233,7 @@
hlcoord 5, 1
call PlaceString
push bc
- callba Function5084a
+ callba CopyPkmnToTempMon
pop hl
call PrintLevel
ld hl, PlayerHPPal
@@ -14226,7 +14250,7 @@
ld [hBGMapMode], a
ld [wd0e3], a
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
ld hl, TempMonMoves
ld de, wListMoves_MoveIndicesBuffer
ld bc, NUM_MOVES
@@ -14238,7 +14262,7 @@
hlcoord 10, 4
predef Function50c50
call WaitBGMap
- call Function32f9
+ call SetPalettes
ld a, [wd0eb]
inc a
ld [wcfa3], a
@@ -14707,7 +14731,7 @@
; 134dd
Function134dd: ; 134dd
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, Elevator_WhichFloorText
call PrintText
call Elevator_GetCurrentFloorText
@@ -15760,7 +15784,7 @@
ld hl, PartyMon1Exp + 2 - PartyMon1
add hl, bc
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
pop hl
ld bc, PartyMon2 - PartyMon1
add hl, bc
@@ -18092,7 +18116,7 @@
; 0x157d1
KrisWithdrawItemMenu: ; 0x157d1
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba ClearPCItemScreen
.asm_157da
call Function15985
@@ -18171,7 +18195,7 @@
KrisTossItemMenu: ; 0x1585f
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba ClearPCItemScreen
.asm_15868
call Function15985
@@ -18208,7 +18232,7 @@
call Function158b8
jr c, .asm_158b6
call DisableSpriteUpdates
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function106a5
.asm_1589c
callba Function106be
@@ -18513,7 +18537,7 @@
HerbShop: ; 15a6e
call ReadMart
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x15e4a
call Function15fcd
call Function15c62
@@ -18527,7 +18551,7 @@
ld de, BargainShopData
call LoadMartPointer
call Function15c25
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x15e6d
call Function15fcd
call Function15c62
@@ -18546,7 +18570,7 @@
Pharmacist: ; 15aae
call ReadMart
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x15e90
call Function15fcd
call Function15c62
@@ -18567,7 +18591,7 @@
.ok
call LoadMartPointer
call Function15c25
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x15f83
call Function15fcd
call Function15c62
@@ -18652,7 +18676,7 @@
; 15b62
Function15b62: ; 15b62
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x15f83
call PrintText
ld a, $1
@@ -18705,7 +18729,7 @@
; 15baf
Function15baf: ; 15baf
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x15fb9
call PrintText
ld a, $1
@@ -20223,7 +20247,7 @@
pop hl
push bc
ld b, $0
- predef Functione167
+ predef CalcPkmnStats
pop bc
ld hl, PartyMon1HP - PartyMon1
add hl, bc
@@ -20513,7 +20537,7 @@
ld b, $1c
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.asm_16c6b
call JoyTextDelay
@@ -20940,7 +20964,7 @@
OverworldHatchEgg:: ; 16f5e
call ResetWindow
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function16f70
call Function2b4d
call RestartMapMusic
@@ -21027,7 +21051,7 @@
ld bc, PartyMon1Exp + 2 - PartyMon1
add hl, bc
ld b, $0
- predef Functione167
+ predef CalcPkmnStats
pop bc
ld hl, PartyMon1MaxHP - PartyMon1
add hl, bc
@@ -21421,7 +21445,7 @@
predef FillBox
pop af
call Function17363
- call Function32f9
+ call SetPalettes
jp WaitBGMap
Function1727f: ; 1727f (5:727f)
@@ -21782,7 +21806,7 @@
ld a, [hl]
push af
set 4, [hl]
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call ClearTileMap
ld hl, UnknownText_0x2004c
call PrintText
@@ -24845,7 +24869,7 @@
call WaitBGMap
ld b, $15
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call WaitBGMap
ld hl, wJumptableIndex
xor a
@@ -26028,7 +26052,7 @@
ld d, 0
add hl, de
ld [hl], -1
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, MenuDataHeader_0x269c5
call CopyMenuDataHeader
xor a
@@ -27125,9 +27149,9 @@
callba Function3ed9f
call ClearSGB
call WriteBackup
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call WaitBGMap
- jp Function32f9
+ jp SetPalettes
; 27192
Function27192: ; 27192
@@ -28587,7 +28611,7 @@
; 28926
Function28926: ; 28926
- call Function309d
+ call LoadTileMapToTempTileMap
ld a, [wcfa9]
push af
hlcoord 0, 15
@@ -28628,7 +28652,7 @@
.asm_28983
pop af
ld [wcfa9], a
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
jp Function2888b
.asm_2898d
@@ -28666,7 +28690,7 @@
ld [wd263], a
callab Function50db9
callba Function4d319
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
hlcoord 6, 1
ld bc, $0601
ld a, $7f
@@ -28906,7 +28930,7 @@
ld hl, UnknownText_0x28eb8
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
hlcoord 10, 7
ld b, $3
ld c, $7
@@ -28935,7 +28959,7 @@
callba Function4d354
call Function1bd3
push af
- call Function1d7d
+ call Call_ExitMenu
call Function3200
pop af
bit 1, a
@@ -29248,7 +29272,7 @@
Function28eff: ; 28eff
callba Function16d6a7
- call Function32f9
+ call SetPalettes
ret
; 28f09
@@ -32507,13 +32531,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]
@@ -32521,13 +32545,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
@@ -32864,7 +32888,7 @@
callba Function2c10d ; no need to callba
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, $e4
ld [rOBP0], a
ret
@@ -33465,7 +33489,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
push af
@@ -35033,7 +35057,7 @@
push hl
xor a
ld [MonType], a
- predef Function5084a
+ predef CopyPkmnToTempMon
pop hl
.asm_42230
@@ -35243,7 +35267,7 @@
ld hl, TempMonExp + 2
ld de, TempMonMaxHP
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
ld a, [CurPartyMon]
ld hl, PartyMons
@@ -35677,7 +35701,7 @@
ret nz
; No use picking a move if there's no choice.
- callba Function3e8d1
+ callba CheckSubstatus_RechargeChargedRampageBideRollout
ret nz
@@ -36487,7 +36511,7 @@
_KrisMailBoxMenu: ; 0x447a0
call InitMail
jr z, .nomail
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function44806
jp WriteBackup
@@ -36681,7 +36705,7 @@
callba WritePartyMenuTilemap
callba PrintPartyMenuText
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
callba PartyMenuSelect
jr c, .asm_44939
@@ -36901,7 +36925,7 @@
call PlaceString
call Function48187
call Function3200
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -38587,11 +38611,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
@@ -38621,8 +38645,8 @@
call Function48e47
call Function48e64
call Function3200
- call Function32f9
- ld hl, UnknownText_0x48e0f
+ call SetPalettes
+ ld hl, TextJump_AreYouABoyOrAreYouAGirl
call PrintText
ld hl, .MenuDataHeader
call LoadMenuDataHeader
@@ -38652,9 +38676,9 @@
db "Girl@"
; 0x48e0f
-UnknownText_0x48e0f: ; 0x48e0f
+TextJump_AreYouABoyOrAreYouAGirl: ; 0x48e0f
; Are you a boy? Or are you a girl?
- text_jump UnknownText_0x1c0ca3
+ text_jump Text_AreYouABoyOrAreYouAGirl
db "@"
; 0x48e14
@@ -39835,7 +39859,7 @@
call Function49ed0
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld hl, GameTimerPause
res 0, [hl]
call Function49da4
@@ -40216,7 +40240,7 @@
hlcoord 1, 14
call PlaceString
call Function3200
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -40361,9 +40385,9 @@
call Function1ff8
call Function1bee
call WaitBGMap
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function89de0
- call Function1d7d
+ call Call_ExitMenu
call Function49351
call Function4a485
pop bc
@@ -40472,7 +40496,7 @@
hlcoord 1, 14
call PlaceString
callba Function104148
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -40580,7 +40604,7 @@
call Function4a6d8
call Function1bee
call WaitBGMap
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld a, $5
call GetSRAMBank
ld a, [$aa4b]
@@ -40610,7 +40634,7 @@
.asm_4a2df
callba Function11765d
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Functione5f
scf
ret
@@ -40644,7 +40668,7 @@
.asm_4a338
call ExitMenu
.asm_4a33b
- call Function1d7d
+ call Call_ExitMenu
callba Function104148
xor a
ret
@@ -40721,7 +40745,7 @@
call Function4a485
call Function4a492
call Function4a3aa
- call Function32f9
+ call SetPalettes
ret
; 4a3a7
@@ -40901,7 +40925,7 @@
hlcoord 1, 16
call PlaceString
call Function3200
- call Function32f9
+ call SetPalettes
call Function1bc9
ld hl, wcfa9
ld b, [hl]
@@ -41545,7 +41569,7 @@
ld [wd019], a
ld b, $14
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call Function4aa22
jr c, .asm_4a985
jr z, .asm_4a9a1
@@ -41676,7 +41700,7 @@
callba PrintPartyMenuText
call Function4aab6
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
call Function4ab1a
jr z, .asm_4aa66
@@ -44172,7 +44196,7 @@
call CopyBytes
jr .asm_4de2a
.asm_4de10
- callba Function5084a
+ callba CopyPkmnToTempMon
ld a, [CurPartySpecies]
cp EGG
jr z, .asm_4de2a
@@ -44426,7 +44450,7 @@
ld hl, wcf64
bit 4, [hl]
jr nz, .asm_4dfd6
- call Function32f9
+ call SetPalettes
ret
.asm_4dfd6
call Function4e226
@@ -44739,14 +44763,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
@@ -44930,7 +44954,7 @@
call PlaceString
ld hl, wcf64
set 5, [hl]
- call Function32f9 ; pals
+ call SetPalettes ; pals
call DelayFrame
hlcoord 0, 0
call Function3786
@@ -45573,7 +45597,7 @@
ld hl, UnknownText_0x4e8bd
call PrintText
call Function3200
- call Function32f9
+ call SetPalettes
ret
; 4e8bd
@@ -45613,7 +45637,7 @@
ld [hSCX], a
call EnableLCD
call Function3200
- call Function32f9
+ call SetPalettes
ret
; 4e906
@@ -45931,7 +45955,7 @@
call WhiteBGMap
call Function5003f
call WaitBGMap
- call Function32f9
+ call SetPalettes
call DelayFrame
call PartyMenuSelect
call Function2b74
@@ -45948,7 +45972,7 @@
call WaitBGMap
ld b, $a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call DelayFrame
call PartyMenuSelect
call Function2b74
@@ -47004,7 +47028,7 @@
ld a, [PartyCount]
cp [hl]
jr nz, .asm_50682
- predef Function3d873
+ predef CheckPlayerPartyForFitPkmn
ld a, d
ld [ScriptVar], a
ret
@@ -47302,10 +47326,13 @@
db "@"
; 0x5084a
-Function5084a: ; 5084a
+CopyPkmnToTempMon: ; 5084a
+; gets the BaseData of a Pkmn
+; and copys the PkmnStructure to TempMon
+
ld a, [CurPartyMon]
ld e, a
- call Function508d5
+ call GetPkmnSpecies
ld a, [CurPartySpecies]
ld [CurSpecies], a
call GetBaseData
@@ -47326,7 +47353,7 @@
.copywholestruct
ld a, [CurPartyMon]
call AddNTimes
- ld de, TempMonSpecies
+ ld de, TempMon
ld bc, PartyMon2 - PartyMon1
call CopyBytes
@@ -47358,7 +47385,7 @@
add hl, bc
push bc
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
pop bc
ld hl, TempMonHP - TempMon
add hl, bc
@@ -47390,7 +47417,10 @@
ret
; 508d5
-Function508d5: ; 508d5
+GetPkmnSpecies: ; 508d5
+; [MonType] has the type of the Pkmn
+; e = Nr. of Pkmn (i.e. [CurPartyMon])
+
ld a, [MonType]
and a ; PARTYMON
jr z, .partymon
@@ -47893,7 +47923,7 @@
call GetNick
pop hl
call PlaceString
- call Function5084a
+ call CopyPkmnToTempMon
pop hl
ld a, [CurPartySpecies]
cp EGG
@@ -48114,15 +48144,15 @@
call Function50e47
push hl
ld hl, TempMonExp + 2
- ld a, [$ffb6]
+ ld a, [hMultiplicand + 2]
ld c, a
ld a, [hld]
sub c
- ld a, [$ffb5]
+ ld a, [hMultiplicand + 1]
ld c, a
ld a, [hld]
sbc c
- ld a, [hMultiplicand]
+ ld a, [hMultiplicand + 0]
ld c, a
ld a, [hl]
sbc c
@@ -48159,15 +48189,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
@@ -48368,12 +48398,12 @@
ld bc, $30
call CopyBytes
ld a, [Buffer2] ; wd1eb (aliases: MovementType)
- ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
+ ld hl, PartyMonOT
call SkipNames
push hl
call Function51036
ld a, [wd1ec]
- ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
+ ld hl, PartyMonOT
call SkipNames
pop de
push hl
@@ -52550,11 +52580,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
@@ -52582,7 +52612,7 @@
pop af
ld [hVBlank], a
call Function84411
- call Function30b4
+ call Call_LoadTempTileMapToTileMap
xor a
ld [rIF], a
pop af
@@ -52715,13 +52745,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
@@ -53492,7 +53522,7 @@
ld [hBGMapMode], a
ld b, $1a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call Function86635
xor a
ld [wc2c6], a
@@ -53630,7 +53660,7 @@
call WaitBGMap
ld b, $1a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
decoord 6, 5
ld c, $6
predef Functiond066e
@@ -53791,7 +53821,7 @@
ld [CurPartySpecies], a
ld b, $1a
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call Function86635
xor a
ld [wc2c6], a
@@ -58966,7 +58996,7 @@
hlcoord 0, 12
lb bc, 4, 18
call TextBox
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld hl, UnknownText_0x90a3f
call PrintText
hlcoord 9, 3
@@ -59062,7 +59092,7 @@
ld a, [wd002]
ld e, a
ld d, 0
- ld hl, Unknown_909f2
+ ld hl, WeekdaysStrings
rept 2
add hl, de
endr
@@ -59074,7 +59104,7 @@
ret
; 909f2
-Unknown_909f2: ; 909f2
+WeekdaysStrings: ; 909f2
dw Sunday
dw Monday
dw Tuesday
@@ -59134,13 +59164,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
@@ -59393,7 +59423,7 @@
call Function90da8
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, [hCGB]
and a
ret z
@@ -60777,7 +60807,7 @@
ld [wd005], a
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld a, [hCGB]
and a
jr z, .asm_9198b
@@ -61031,7 +61061,7 @@
call Function91c8f
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.loop
call JoyTextDelay
ld hl, hJoyPressed
@@ -61453,7 +61483,7 @@
call TownMapBGUpdate
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
xor a
ld [hBGMapMode], a
xor a
@@ -61963,7 +61993,7 @@
ld [wd004], a
ld b, $2
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.loop
call JoyTextDelay
ld hl, hJoyPressed
@@ -65109,7 +65139,7 @@
ld a, [wd1ec]
ld e, a
callba Function8cb4
- call Function32f9
+ call SetPalettes
xor a
ld [hJoyPressed], a
call Functionb929a
@@ -66317,7 +66347,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; cc0a7
@@ -69887,7 +69917,7 @@
ret
BillsPCDepositFuncStats: ; e24c8 (38:64c8)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Functione2f7e
call ExitMenu
call PCMonInfo
@@ -69906,7 +69936,7 @@
push af
ld de, PCString_ReleasePKMN
call Functione2a6e
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
lb bc, 14, 11
call PlaceYesNoBox
ld a, [wcfa9]
@@ -70152,7 +70182,7 @@
ret
.stats: ; e26c0 (38:66c0)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Functione2f7e
call ExitMenu
call PCMonInfo
@@ -70169,7 +70199,7 @@
jr c, .FailedRelease
ld de, PCString_ReleasePKMN
call Functione2a6e
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
lb bc, 14, 11
call PlaceYesNoBox
ld a, [wcfa9]
@@ -70412,7 +70442,7 @@
; e28a5
Functione28a5: ; e28a5
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Functione2f7e
call ExitMenu
call PCMonInfo
@@ -71528,7 +71558,7 @@
call Functione3357
ld hl, PartyMonNicknames
call Functione3363
- ld hl, PartyMonOT ; wddff (aliases: PartyMonOT)
+ ld hl, PartyMonOT
call Functione3376
ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
ld bc, $30
@@ -71575,8 +71605,8 @@
call GetNick
ld a, $1
ld [wd10b], a
- predef Functiondb3f
- jr c, .asm_e30e4
+ predef SentGetPkmnIntoFromBox
+ jr c, .asm_boxisfull
xor a
ld [wd10b], a
callba Functione039
@@ -71605,7 +71635,8 @@
call DelayFrames
and a
ret
-.asm_e30e4
+
+.asm_boxisfull
ld de, PCString_BoxFull
call Functione2a6e
ld de, SFX_WRONG
@@ -71629,7 +71660,7 @@
call CloseSRAM
xor a
ld [wd10b], a
- predef Functiondb3f
+ predef SentGetPkmnIntoFromBox
jr c, .PartyFull
ld a, $1
ld [wd10b], a
@@ -71659,6 +71690,7 @@
call DelayFrames
and a
ret
+
.PartyFull
ld de, PCString_PartyFull
call Functione2a6e
@@ -71670,6 +71702,7 @@
scf
ret
+
Functione3180: ; e3180 (38:7180)
hlcoord 0, 0
lb bc, 15, 8
@@ -72047,7 +72080,7 @@
; e35aa
Functione35aa: ; e35aa (38:75aa)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Functione35e2
.loop
xor a
@@ -72409,7 +72442,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
.asm_e4217
call JoyTextDelay
ld a, [hJoyPressed]
@@ -72976,7 +73009,7 @@
call WaitBGMap
ld b, $19
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ld c, 10
call DelayFrames
callab Copyright
@@ -76093,7 +76126,7 @@
ld [TempMonDVs + 1], a
ld b, $1c
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; fb8f1
@@ -78492,7 +78525,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
pop de
hlcoord 2, 8
ld a, d
@@ -79793,7 +79826,7 @@
call WaitBGMap
ld b, $1d
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
Function10522e: ; 10522e (41:522e)
@@ -79971,7 +80004,7 @@
call WaitBGMap
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
Function10578c: ; 10578c (41:578c)
@@ -80096,7 +80129,7 @@
call WaitBGMap
ld b, $2
callba Function4930f
- jp Function32f9
+ jp SetPalettes
Function1058c6: ; 1058c6 (41:58c6)
ld b, $6
@@ -81231,10 +81264,11 @@
ld [$ffbb], a
ret
-Function1062f7
+Function1062f7:
ld a, [$ffbc]
bit 7, a
ret z
+
ld [hl], $f6
ret
; 1062ff
@@ -81869,7 +81903,7 @@
xor a
ld [MonType], a
- callba Function5084a
+ callba CopyPkmnToTempMon
hlcoord 0, 7
ld b, $9
ld c, $12
@@ -81940,7 +81974,7 @@
call WaitBGMap
ld b, $3
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; 1dc47b
@@ -81953,7 +81987,7 @@
call LoadFontsBattleExtra
xor a
ld [MonType], a
- callba Function5084a
+ callba CopyPkmnToTempMon
hlcoord 0, 0
ld b, 15
ld c, 18
@@ -81992,7 +82026,7 @@
call WaitBGMap
ld b, $3
call GetSGBLayout
- call Function32f9
+ call SetPalettes
ret
; 1dc507
@@ -82134,10 +82168,10 @@
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
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
@@ -82144,8 +82178,8 @@
ret
; 1dd6fc (77:56fc)
-String_1dd6fc: db "AM@"
-String_1dd6ff: db "PM@"
+String_AM: db "AM@" ; 1dd6fc
+String_PM: db "PM@" ; 1dd6ff
; 1dd702
--- a/misc/crystal_misc.asm
+++ b/misc/crystal_misc.asm
@@ -51,7 +51,7 @@
call Function17abcf
callba Function49409
callba Function49420
- call Function32f9
+ call SetPalettes
call DelayFrame
ret
@@ -430,7 +430,7 @@
ret
.asm_17a92c
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function17a99e
ld hl, $d088
set 7, [hl]
--- a/misc/mobile_22.asm
+++ b/misc/mobile_22.asm
@@ -655,7 +655,7 @@
call Function895c7
call Function8949c
call Function8a60d
- call Function32f9
+ call SetPalettes
pop bc
ret
@@ -1307,7 +1307,7 @@
call Function897af
push bc
call Function3200
- call Function32f9
+ call SetPalettes
pop bc
ret
; 89856
@@ -1816,9 +1816,9 @@
call Function891de
call WhiteBGMap
call Function893e2
- call Function1d7d
+ call Call_ExitMenu
call Function891ab
- call Function32f9
+ call SetPalettes
ret
Function89b3b: ; 89b3b (22:5b3b)
@@ -2167,7 +2167,7 @@
call CopyBytes
pop af
ld [rSVBK], a ; $ff00+$70
- call Function32f9
+ call SetPalettes
callba Function845db
call Function89240
ld c, $18
@@ -2373,7 +2373,7 @@
hlcoord 10, 4, AttrMap
call Function8a5a3
call Function891ab
- call Function32f9
+ call SetPalettes
jp Function89e36
Function89e9a: ; 89e9a (22:5e9a)
@@ -2410,7 +2410,7 @@
hlcoord 10, 4, AttrMap
call Function8a5a3
call Function891ab
- call Function32f9
+ call SetPalettes
jp Function89e36
Function89ee1: ; 89ee1 (22:5ee1)
@@ -2591,7 +2591,7 @@
hlcoord 10, 4, AttrMap
call Function8a5a3
call Function89448
- call Function32f9
+ call SetPalettes
call Function891ab
jp Function89e36
@@ -2927,7 +2927,7 @@
; 0x8a241
Function8a241: ; 8a241 (22:6241)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function891fe
call Function8a262
jr nc, .asm_8a254
@@ -2938,7 +2938,7 @@
.asm_8a254
call Function891de
call WhiteBGMap
- call Function1d7d
+ call Call_ExitMenu
call Function891de
and a
ret
@@ -2965,7 +2965,7 @@
call Function8b36c
call Function8b493
call Function891ab
- call Function32f9
+ call SetPalettes
call Function8b5e7
ret
@@ -3063,7 +3063,7 @@
call Function8a4d3
call Function8a4fc
call Function891ab
- call Function32f9
+ call SetPalettes
call Function8a383
jr c, .asm_8a370
jr z, .asm_8a34e
@@ -3455,7 +3455,7 @@
; 8a62c
Function8a62c: ; 8a62c (22:662c)
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function891fe
xor a
call Function8b94a
@@ -3885,7 +3885,7 @@
jr c, .asm_8a9bb
push bc
push de
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
pop de
dec e
ld a, e
@@ -4141,7 +4141,7 @@
Function8ab93: ; 8ab93 (22:6b93)
call WhiteBGMap
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
callba Function105688
call ClearSprites
call Function891fe
--- a/misc/mobile_22_2.asm
+++ b/misc/mobile_22_2.asm
@@ -581,7 +581,7 @@
call Function8b6ed
call EnableLCD
call Function891ab
- call Function32f9
+ call SetPalettes
ret
; 8b690
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -1615,6 +1615,7 @@
ld a, [wLinkMode]
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
@@ -4482,7 +4483,7 @@
Function101d95: ; 101d95
call Function101ee2
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
ld e, $e
call Function101ee4
ld hl, wcd29
@@ -6255,7 +6256,7 @@
; 1029cf
Function1029cf: ; 1029cf
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
hlcoord 10, 7
ld b, $3
ld c, $8
@@ -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
@@ -15686,7 +15686,7 @@
pop de
push de
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
pop de
ld h, d
ld l, e
@@ -16102,7 +16102,7 @@
ld hl, $c616 + 1
ld de, $c62c + 5
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
ld de, $c62c + 5
ld hl, $c62c + 3
ld a, [de]
@@ -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
@@ -22177,7 +22177,7 @@
; 16d43b
Function16d43b: ; 16d43b
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call WhiteBGMap
call ClearTileMap
call ClearSprites
@@ -22185,10 +22185,10 @@
callba Function16d42e
ld b, $8
call GetSGBLayout
- call Function32f9
+ call SetPalettes
call WaitBGMap
call JoyWaitAorB
- call Function1d7d
+ call Call_ExitMenu
ret
; 16d465
@@ -22327,10 +22327,10 @@
; 16d6ce
Function16d6ce: ; 16d6ce
- call Function1d6e
+ call LoadMenuDataHeader_0x1d75
call Function16d6e1
callba Function87d
- call Function1d7d
+ call Call_ExitMenu
call Function3200
ret
; 16d6e1
@@ -23076,7 +23076,7 @@
ld hl, $000a
add hl, bc
ld b, $1
- predef Functione167
+ predef CalcPkmnStats
pop de
pop hl
rept 2
@@ -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]
@@ -2465,7 +2465,7 @@
ld e, l
push hl
ld b, $0
- callba Functione167
+ callba CalcPkmnStats
ld a, [PartyCount]
dec a
ld hl, PartyMon1HP
@@ -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, 3, 6
@@ -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, 2, 4
@@ -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
@@ -689,7 +689,7 @@
done
; 1c0b7f
-UnknownText_0x1c0b7f: ; 1c0b7f
+Text_AnEGGCantHoldAnItem: ; 1c0b7f
text "An EGG can't hold"
line "an item."
prompt
@@ -731,7 +731,7 @@
prompt
; 1c0c17
-UnknownText_0x1c0c17: ; 1c0c17
+Text_YouDontHaveAPkmn: ; 1c0c17
text "You don't have a"
line "#MON!"
prompt
@@ -762,13 +762,13 @@
done
; 1c0c85
-UnknownText_0x1c0c85: ; 1c0c85
+Text_YouCantUseItInABattle: ; 1c0c85
text "You can't use it"
line "in a battle."
prompt
; 1c0ca3
-UnknownText_0x1c0ca3: ; 1c0ca3
+Text_AreYouABoyOrAreYouAGirl: ; 1c0ca3
text "Are you a boy?"
line "Or are you a girl?"
done
--- a/text/common_4.asm
+++ b/text/common_4.asm
@@ -1375,7 +1375,7 @@
db "@"
; 0x1c5b35
-UnknownText_0x1c5b35: ; 0x1c5b35
+Text_Waitbutton_2: ; 0x1c5b35
text_waitbutton
db "@"
; 0x1c5b37
@@ -1428,7 +1428,7 @@
prompt
; 0x1c5bcd
-UnknownText_0x1c5bcd: ; 0x1c5bcd
+Text_RepelUsedEarlierIsStillInEffect: ; 0x1c5bcd
text "The REPEL used"
line "earlier is still"
cont "in effect."
@@ -1480,19 +1480,19 @@
db "@"
; 0x1c5c8a
-UnknownText_0x1c5c8a: ; 0x1c5c8a
+Text_RaiseThePPOfWhichMove: ; 0x1c5c8a
text "Raise the PP of"
line "which move?"
done
; 0x1c5ca7
-UnknownText_0x1c5ca7: ; 0x1c5ca7
+Text_RestoreThePPOfWhichMove: ; 0x1c5ca7
text "Restore the PP of"
line "which move?"
done
; 0x1c5cc6
-UnknownText_0x1c5cc6: ; 0x1c5cc6
+Text_PPIsMaxedOut: ; 0x1c5cc6
text_from_ram StringBuffer2
text "'s PP"
line "is maxed out."
@@ -1499,7 +1499,7 @@
prompt
; 0x1c5cdd
-UnknownText_0x1c5cdd: ; 0x1c5cdd
+Text_PPsIncreased: ; 0x1c5cdd
text_from_ram StringBuffer2
text "'s PP"
line "increased."
@@ -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
@@ -817,13 +817,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
@@ -1796,17 +1796,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
@@ -2461,9 +2461,9 @@
wdc7a:: ds 2
wPhoneList:: ds CONTACT_LIST_SIZE
ds 23
-wLuckyNumberShowFlag:: ds 2
-wLuckyIDNumber:: ds 2
-wRepelEffect:: ds 1
+wLuckyNumberShowFlag:: ds 2 ; dc9d
+wLuckyIDNumber:: ds 2 ; dc9f
+wRepelEffect:: ds 1 ; If a Repel is in use, it contains the nr of steps it's still active
wBikeStep:: ds 2
wKurtApricornQuantity:: ds 1
@@ -2624,7 +2624,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