Merge pull request #319 from JimB16/master

Added comments and changed labels (mainly for AI- and Battle-Functions)
This commit is contained in:
yenatch 2015-10-27 14:30:22 -04:00
commit 006d14640c
32 changed files with 717 additions and 638 deletions

View File

@ -9,7 +9,7 @@ AI_SwitchOrTryItem: ; 38000
and a and a
ret nz ret nz
callba Function3e8d1 callba CheckSubstatus_RechargeChargedRampageBideRollout
ret nz ret nz
ld a, [PlayerSubStatus5] ld a, [PlayerSubStatus5]
@ -24,6 +24,7 @@ AI_SwitchOrTryItem: ; 38000
ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers
and a and a
jr nz, .ok jr nz, .ok
ld a, [TrainerClass] ld a, [TrainerClass]
dec a dec a
ld bc, 7 ld bc, 7

View File

@ -176,7 +176,7 @@ AI_Types: ; 38635
push de push de
ld a, 1 ld a, 1
ld [hBattleTurn], a ld [hBattleTurn], a
callab Function347c8 callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop de pop de
pop bc pop bc
pop hl pop hl
@ -431,7 +431,7 @@ AI_Smart_LeechHit: ; 387f7
push hl push hl
ld a, 1 ld a, 1
ld [hBattleTurn], a ld [hBattleTurn], a
callab Function347c8 callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop hl pop hl
; 60% chance to discourage this move if not very effective. ; 60% chance to discourage this move if not very effective.
@ -512,7 +512,7 @@ AI_Smart_LockOn: ; 3881d
push hl push hl
push bc push bc
callba Function347c8 callba HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265] ld a, [wd265]
cp $a cp $a
pop bc pop bc
@ -1384,7 +1384,7 @@ AI_Smart_Mimic: ; 38ba8
ld a, $1 ld a, $1
ld [hBattleTurn], a ld [hBattleTurn], a
callab Function347c8 callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265] ld a, [wd265]
cp $a cp $a
@ -1783,8 +1783,8 @@ AI_Smart_PriorityHit: ; 38d5a
ld [hBattleTurn], a ld [hBattleTurn], a
push hl push hl
callab EnemyAttackDamage callab EnemyAttackDamage
callab BattleCommand62 callab BattleCommand_DamageCalcWithStats
callab BattleCommand07 callab BattleCommand_CalcDamageTypeMultiplier
pop hl pop hl
ld a, [CurDamage + 1] ld a, [CurDamage + 1]
ld c, a ld c, a
@ -1830,7 +1830,7 @@ AI_Smart_Conversion2: ; 38d98
xor a xor a
ld [hBattleTurn], a ld [hBattleTurn], a
callab Function347c8 callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265] ld a, [wd265]
cp $a cp $a
@ -2496,7 +2496,7 @@ AI_Smart_HiddenPower: ; 3909e
; Calculate Hidden Power's type and base power based on enemy's DVs. ; Calculate Hidden Power's type and base power based on enemy's DVs.
callab HiddenPowerDamage callab HiddenPowerDamage
callab Function347c8 callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop hl pop hl
; Discourage Hidden Power if not very effective. ; Discourage Hidden Power if not very effective.
@ -3380,8 +3380,8 @@ AIDamageCalc: ; 393e7
.asm_39400 .asm_39400
callab EnemyAttackDamage callab EnemyAttackDamage
callab BattleCommand62 callab BattleCommand_DamageCalcWithStats
callab BattleCommand07 callab BattleCommand_CalcDamageTypeMultiplier
ret ret
.ConstantDamageEffects .ConstantDamageEffects
@ -3498,7 +3498,7 @@ AI_Status: ; 39453
push de push de
ld a, 1 ld a, 1
ld [hBattleTurn], a ld [hBattleTurn], a
callab Function347c8 callab HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop de pop de
pop bc pop bc
pop hl pop hl

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ BattleCommandPointers: ; 3fd28
dw BattleCommand04 ; 34555 dw BattleCommand04 ; 34555
dw BattleCommand05 ; 34631 dw BattleCommand05 ; 34631
dw BattleCommand06 ; 352dc dw BattleCommand06 ; 352dc
dw BattleCommand07 ; 346d2 dw BattleCommand_CalcDamageTypeMultiplier ; 346d2 - 07
dw BattleCommand08 ; 34cfd dw BattleCommand08 ; 34cfd
dw BattleCommand09 ; 34d32 dw BattleCommand09 ; 34d32
dw BattleCommand0a ; 34eee dw BattleCommand0a ; 34eee
@ -99,7 +99,7 @@ BattleCommandPointers: ; 3fd28
dw BattleCommand5f ; 377ce dw BattleCommand5f ; 377ce
dw BattleCommand60 ; 3784b dw BattleCommand60 ; 3784b
dw BattleCommand61 ; 37874 dw BattleCommand61 ; 37874
dw BattleCommand62 ; 35612 dw BattleCommand_DamageCalcWithStats ; 35612 - 62
dw BattleCommand63 ; 3790e dw BattleCommand63 ; 3790e
dw BattleCommand64 ; 37939 dw BattleCommand64 ; 37939
dw BattleCommand65 ; 37972 dw BattleCommand65 ; 37972
@ -148,7 +148,7 @@ BattleCommandPointers: ; 3fd28
dw BattleCommand90 ; 34ecc dw BattleCommand90 ; 34ecc
dw BattleCommand91 ; 34fdb dw BattleCommand91 ; 34fdb
dw BattleCommand92 ; 34fd1 dw BattleCommand92 ; 34fd1
dw BattleCommand93 ; 34ffd dw BattleCommand_SwitchTurn ; 34ffd - 93
dw BattleCommand94 ; 36a82 dw BattleCommand94 ; 36a82
dw BattleCommand95 ; 37c1a dw BattleCommand95 ; 37c1a
dw BattleCommand96 ; 37c55 dw BattleCommand96 ; 37c55
@ -170,7 +170,7 @@ BattleCommandPointers: ; 3fd28
dw BattleCommanda6 ; 365af dw BattleCommanda6 ; 365af
dw BattleCommanda7 ; 365c3 dw BattleCommanda7 ; 365c3
dw BattleCommanda8 ; 355b5 dw BattleCommanda8 ; 355b5
dw BattleCommanda9 ; 355d5 dw BattleCommand_IfAttackMissedResetDamage ; 355d5 - a9
dw BattleCommandaa ; 37e80 dw BattleCommandaa ; 37e80
dw BattleCommandab ; 34f57 dw BattleCommandab ; 34f57
dw BattleCommandac ; 3658f dw BattleCommandac ; 3658f

View File

@ -385,9 +385,9 @@ CantMove: ; 341f0
Function34216: ; 34216 Function34216: ; 34216
call SwitchTurn call BattleCommand_SwitchTurn
call CantMove call CantMove
jp SwitchTurn jp BattleCommand_SwitchTurn
; 3421f ; 3421f
@ -539,7 +539,7 @@ CheckEnemyTurn: ; 3421f
ld hl, HurtItselfText ld hl, HurtItselfText
call StdBattleTextBox call StdBattleTextBox
call Function355dd call Function355dd
call BattleCommand62 call BattleCommand_DamageCalcWithStats
call BattleCommand0a call BattleCommand0a
xor a xor a
ld [wcfca], a ld [wcfca], a
@ -652,7 +652,7 @@ HitConfusion: ; 343a5
ld [CriticalHit], a ld [CriticalHit], a
call Function355dd call Function355dd
call BattleCommand62 call BattleCommand_DamageCalcWithStats
call BattleCommand0a call BattleCommand0a
xor a xor a
@ -1336,8 +1336,8 @@ BattleCommand4f: ; 346cd
; 346d2 ; 346d2
BattleCommand07: ; 346d2 BattleCommand_CalcDamageTypeMultiplier: ; 346d2
; stab ; STAB = Same Type Attack Bonus
ld a, BATTLE_VARS_MOVE_ANIM ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar call GetBattleVar
cp STRUGGLE cp STRUGGLE
@ -1354,7 +1354,7 @@ BattleCommand07: ; 346d2
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .go jr z, .go ; Who Attacks and who Defends
ld hl, EnemyMonType1 ld hl, EnemyMonType1
ld a, [hli] ld a, [hli]
@ -1512,7 +1512,7 @@ endr
jr .TypesLoop jr .TypesLoop
.end .end
call Function347c8 call HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265] ld a, [wd265]
ld b, a ld b, a
ld a, [TypeModifier] ld a, [TypeModifier]
@ -1523,7 +1523,7 @@ endr
; 347c8 ; 347c8
Function347c8: ; 347c8 HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn: ; 347c8
ld hl, EnemyMonType1 ld hl, EnemyMonType1
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@ -1601,7 +1601,7 @@ Function347d3: ; 347d3
BattleCommanda3: ; 34833 BattleCommanda3: ; 34833
call Function347c8 call HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
ld a, [wd265] ld a, [wd265]
and a and a
ld a, 10 ; 1.0 ld a, 10 ; 1.0
@ -2874,8 +2874,7 @@ BattleCommand91_92: ; 34feb
; 34ffd ; 34ffd
SwitchTurn: ; 34ffd BattleCommand_SwitchTurn: ; 34ffd
BattleCommand93: ; 34ffd
; switchturn ; switchturn
ld a, [hBattleTurn] ld a, [hBattleTurn]
@ -3248,7 +3247,7 @@ BattleCommand11: ; 351c0
predef Functionc6e0 predef Functionc6e0
call RefreshBattleHuds call RefreshBattleHuds
call SwitchTurn call BattleCommand_SwitchTurn
xor a xor a
ld [wcfca], a ld [wcfca], a
ld [FXAnimIDHi], a ld [FXAnimIDHi], a
@ -3256,7 +3255,7 @@ BattleCommand11: ; 351c0
ld [wc689], a ld [wc689], a
ld a, $c2 ld a, $c2
call Function37e44 call Function37e44
call SwitchTurn call BattleCommand_SwitchTurn
jr .asm_3524d ; 3522f $1c jr .asm_3524d ; 3522f $1c
@ -3307,10 +3306,10 @@ BattleCommand12: ; 35250
ret z ret z
ld [de], a ld [de], a
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, RageBuildingText ld hl, RageBuildingText
call StdBattleTextBox call StdBattleTextBox
jp SwitchTurn jp BattleCommand_SwitchTurn
; 3527b ; 3527b
@ -3934,6 +3933,7 @@ BattleCommanda8: ; 355b5
ld a, [wc72d] ld a, [wc72d]
and a and a
ret nz ret nz
jp PrintButItFailed jp PrintButItFailed
; 355bd ; 355bd
@ -3954,14 +3954,14 @@ Function355bd: ; 355bd
call GetPartyLocation call GetPartyLocation
pop bc pop bc
ret ret
; 355d5
BattleCommanda9: ; 355d5 BattleCommand_IfAttackMissedResetDamage: ; 355d5
; clearmissdamage ; clearmissdamage
ld a, [AttackMissed] ld a, [AttackMissed]
and a and a
ret z ret z
jp ResetDamage jp ResetDamage
; 355dd ; 355dd
@ -4004,7 +4004,7 @@ endr
; 35612 ; 35612
BattleCommand62: ; 35612 BattleCommand_DamageCalcWithStats: ; 35612
; damagecalc ; damagecalc
; Return a damage value for move power d, player level e, enemy defense c and player attack b. ; Return a damage value for move power d, player level e, enemy defense c and player attack b.
@ -4138,12 +4138,12 @@ endr
; Update CurDamage (capped at 997). ; Update CurDamage (capped at 997).
ld hl, CurDamage ld hl, CurDamage
ld b, [hl] ld b, [hl]
ld a, [$ffb6] ld a, [hQuotient + 2]
add b add b
ld [$ffb6], a ld [$ffb6], a
jr nc, .asm_356a5 jr nc, .asm_356a5
ld a, [$ffb5] ld a, [hQuotient + 1]
inc a inc a
ld [$ffb5], a ld [$ffb5], a
and a and a
@ -4397,22 +4397,22 @@ BattleCommand3f: ; 35726
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
ld a, [hl] ld a, [hl]
jr nz, .asm_357f8 jr nz, .notPlayersTurn
ld hl, wPlayerMoveStruct + MOVE_POWER ld hl, wPlayerMoveStruct + MOVE_POWER
ld [hl], a ld [hl], a
push hl push hl
call PlayerAttackDamage call PlayerAttackDamage
jr .asm_35800 jr .notEnemysTurn
.asm_357f8 .notPlayersTurn
ld hl, wEnemyMoveStruct + MOVE_POWER ld hl, wEnemyMoveStruct + MOVE_POWER
ld [hl], a ld [hl], a
push hl push hl
call EnemyAttackDamage call EnemyAttackDamage
.asm_35800 .notEnemysTurn
call BattleCommand62 call BattleCommand_DamageCalcWithStats
pop hl pop hl
ld [hl], 1 ld [hl], 1
ret ret
@ -4754,7 +4754,7 @@ BattleCommand44: ; 359e6
cp CURSE_T cp CURSE_T
jr z, .asm_35a50 jr z, .asm_35a50
call AnimateCurrentMove call AnimateCurrentMove
call SwitchTurn call BattleCommand_SwitchTurn
.asm_35a13 .asm_35a13
call BattleRandom call BattleRandom
@ -4775,7 +4775,7 @@ BattleCommand44: ; 359e6
push hl push hl
ld a, d ld a, d
ld [hl], a ld [hl], a
call Function347c8 call HowEffectiveIsTheMovetypeAgainstTheEnemyPkmn
pop hl pop hl
pop af pop af
ld [hl], a ld [hl], a
@ -4783,7 +4783,7 @@ BattleCommand44: ; 359e6
ld a, [wd265] ld a, [wd265]
cp $a cp $a
jr nc, .asm_35a13 jr nc, .asm_35a13
call SwitchTurn call BattleCommand_SwitchTurn
ld a, [hl] ld a, [hl]
ld [wd265], a ld [wd265], a
@ -5457,13 +5457,13 @@ Function35de0: ; 35de0
ld hl, SubFadedText ld hl, SubFadedText
call StdBattleTextBox call StdBattleTextBox
call SwitchTurn call BattleCommand_SwitchTurn
call BattleCommanda7 call BattleCommanda7
ld a, BATTLE_VARS_SUBSTATUS3 ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVar call GetBattleVar
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
call z, Function37ec7 call z, Function37ec7
call SwitchTurn call BattleCommand_SwitchTurn
ld a, BATTLE_VARS_MOVE_EFFECT ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVarAddr call GetBattleVarAddr
@ -6539,15 +6539,15 @@ Function3641a: ; 3641a
and a and a
jr z, .Player jr z, .Player
call SwitchTurn call BattleCommand_SwitchTurn
call Function365d7 call Function365d7
call SwitchTurn call BattleCommand_SwitchTurn
jr .end jr .end
.Player .Player
call SwitchTurn call BattleCommand_SwitchTurn
call Function365fd call Function365fd
call SwitchTurn call BattleCommand_SwitchTurn
.end .end
ld a, 1 ld a, 1
and a and a
@ -6828,7 +6828,7 @@ Function365d7: ; 365d7
ld hl, BadgeStatBoosts ld hl, BadgeStatBoosts
call CallBattleCore call CallBattleCore
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, Function3ec39 ld hl, Function3ec39
call CallBattleCore call CallBattleCore
@ -6836,7 +6836,7 @@ Function365d7: ; 365d7
ld hl, Function3ec76 ld hl, Function3ec76
call CallBattleCore call CallBattleCore
jp SwitchTurn jp BattleCommand_SwitchTurn
; 365fd ; 365fd
@ -6848,7 +6848,7 @@ Function365fd: ; 365fd
ld a, $5 ld a, $5
call Function3661d call Function3661d
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, Function3ec39 ld hl, Function3ec39
call CallBattleCore call CallBattleCore
@ -6856,7 +6856,7 @@ Function365fd: ; 365fd
ld hl, Function3ec76 ld hl, Function3ec76
call CallBattleCore call CallBattleCore
jp SwitchTurn jp BattleCommand_SwitchTurn
; 3661d ; 3661d
@ -7056,10 +7056,10 @@ BattleCommand3e: ; 3671a
ld [de], a ld [de], a
jr nz, .asm_3674c ; 36730 $1a jr nz, .asm_3674c ; 36730 $1a
res 1, [hl] res 1, [hl]
call SwitchTurn call BattleCommand_SwitchTurn
call Function37962 call Function37962
push af push af
call SwitchTurn call BattleCommand_SwitchTurn
pop af pop af
jr nz, .asm_3674c ; 3673f $b jr nz, .asm_3674c ; 3673f $b
set 7, [hl] set 7, [hl]
@ -7202,7 +7202,7 @@ BattleCommand23: ; 3680f
ld a, [BattleType] ld a, [BattleType]
cp BATTLETYPE_SHINY cp BATTLETYPE_SHINY
jp z, .asm_36969 jp z, .asm_36969
cp $9 cp BATTLETYPE_TRAP
jp z, .asm_36969 jp z, .asm_36969
cp BATTLETYPE_CELEBI cp BATTLETYPE_CELEBI
jp z, .asm_36969 jp z, .asm_36969
@ -8823,10 +8823,10 @@ BattleCommand2c: ; 3713e
call CallBattleCore call CallBattleCore
.asm_371a9 .asm_371a9
call AnimateCurrentMove call AnimateCurrentMove
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, Function3ccef ld hl, Function3ccef
call CallBattleCore call CallBattleCore
call SwitchTurn call BattleCommand_SwitchTurn
call UpdateUserInParty call UpdateUserInParty
call RefreshBattleHuds call RefreshBattleHuds
ld hl, RegainedHealthText ld hl, RegainedHealthText
@ -9500,7 +9500,7 @@ BattleCommand61: ; 37874
push de push de
.asm_3787d .asm_3787d
call BattleCommand07 call BattleCommand_CalcDamageTypeMultiplier
ld a, [wLinkMode] ld a, [wLinkMode]
cp $3 cp $3
@ -9544,7 +9544,7 @@ BattleCommand61: ; 37874
ld a, $3 ld a, $3
ld [wc689], a ld [wc689], a
call AnimateCurrentMove call AnimateCurrentMove
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, AICheckPlayerMaxHP ld hl, AICheckPlayerMaxHP
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@ -9557,18 +9557,18 @@ BattleCommand61: ; 37874
ld hl, GetQuarterMaxHP ld hl, GetQuarterMaxHP
call CallBattleCore call CallBattleCore
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, Function3ccef ld hl, Function3ccef
call CallBattleCore call CallBattleCore
call SwitchTurn call BattleCommand_SwitchTurn
ld hl, RegainedHealthText ld hl, RegainedHealthText
call StdBattleTextBox call StdBattleTextBox
call SwitchTurn call BattleCommand_SwitchTurn
call UpdateOpponentInParty call UpdateOpponentInParty
jr .asm_37904 ; 378f1 $11 jr .asm_37904 ; 378f1 $11
.asm_378f3 .asm_378f3
call SwitchTurn call BattleCommand_SwitchTurn
call Function37ed5 call Function37ed5
jr nc, .asm_37904 ; 378f9 $9 jr nc, .asm_37904 ; 378f9 $9
call AnimateFailedMove call AnimateFailedMove
@ -9733,7 +9733,7 @@ BattleCommand67: ; 379c9
call DelayFrames call DelayFrames
; Transition into switchmon menu ; Transition into switchmon menu
call Function1d6e call LoadMenuDataHeader_0x1d75
callba Function3d2f7 callba Function3d2f7
callba ForcePickSwitchMonInBattle callba ForcePickSwitchMonInBattle
@ -9748,7 +9748,7 @@ BattleCommand67: ; 379c9
call ClearBox call ClearBox
ld b, 1 ld b, 1
call GetSGBLayout call GetSGBLayout
call Function32f9 call SetPalettes
call BatonPass_LinkPlayerSwitch call BatonPass_LinkPlayerSwitch
; Mobile link battles handle entrances differently ; Mobile link battles handle entrances differently
@ -9789,7 +9789,7 @@ BattleCommand67: ; 379c9
call CallBattleCore call CallBattleCore
ld a, 1 ld a, 1
ld [wd265], a ld [wd265], a
ld hl, Function3ecab ld hl, ApplyStatLevelMultiplierOnAllStats
call CallBattleCore call CallBattleCore
ld hl, SpikesDamage ld hl, SpikesDamage
@ -9807,7 +9807,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
ld a, 1 ld a, 1
ld [wd0ec], a ld [wd0ec], a
call Function1d6e call LoadMenuDataHeader_0x1d75
ld hl, Function3e8e4 ld hl, Function3e8e4
call CallBattleCore call CallBattleCore
call WriteBackup call WriteBackup
@ -9823,7 +9823,7 @@ BatonPass_LinkEnemySwitch: ; 37a82
and a and a
ret z ret z
call Function1d6e call LoadMenuDataHeader_0x1d75
ld hl, Function3e8e4 ld hl, Function3e8e4
call CallBattleCore call CallBattleCore
@ -10094,11 +10094,11 @@ endr
rst FarCall rst FarCall
call AnimateCurrentMove call AnimateCurrentMove
call SwitchTurn call BattleCommand_SwitchTurn
callab Function3ccef callab Function3ccef
call SwitchTurn call BattleCommand_SwitchTurn
call UpdateUserInParty call UpdateUserInParty
; 'regained health!' ; 'regained health!'
@ -10596,11 +10596,11 @@ Function37e54: ; 37e54
push hl push hl
push de push de
push bc push bc
call SwitchTurn call BattleCommand_SwitchTurn
callab PlayBattleAnim callab PlayBattleAnim
call SwitchTurn call BattleCommand_SwitchTurn
pop bc pop bc
pop de pop de
pop hl pop hl

View File

@ -44,10 +44,10 @@ BattleCommand54: ; 37588
call AnimateCurrentMove call AnimateCurrentMove
ld a, $2 ld a, $2
call Function36532 call Function36532
call SwitchTurn call BattleCommand_SwitchTurn
call BattleCommand8d call BattleCommand8d
call ResetMiss call ResetMiss
call SwitchTurn call BattleCommand_SwitchTurn
call BattleCommand70 call BattleCommand70
call BattleCommand8c call BattleCommand8c
call ResetMiss call ResetMiss

View File

@ -187,7 +187,7 @@ Function109847:: ; 109847
ld [hLCDStatCustom], a ld [hLCDStatCustom], a
call GetCreditsPalette call GetCreditsPalette
call Function32f9 call SetPalettes
ld a, [hVBlank] ld a, [hVBlank]
push af push af
ld a, $5 ld a, $5
@ -447,7 +447,7 @@ endr
xor a xor a
ld [wcf64], a ; frame ld [wcf64], a ; frame
call GetCreditsPalette call GetCreditsPalette
call Function32f9 ; update hw pal registers call SetPalettes ; update hw pal registers
jr .loop jr .loop
.clear .clear

View File

@ -33,7 +33,7 @@ Function1dd709: ; 1dd709
call WaitBGMap call WaitBGMap
ld b, $8 ld b, $8
call GetSGBLayout call GetSGBLayout
call Function32f9 call SetPalettes
call DelayFrame call DelayFrame
ret ret
; 1dd760 ; 1dd760

View File

@ -1034,9 +1034,11 @@ DoRepelStep: ; 96bd7
ld a, [wRepelEffect] ld a, [wRepelEffect]
and a and a
ret z ret z
dec a dec a
ld [wRepelEffect], a ld [wRepelEffect], a
ret nz ret nz
ld a, BANK(RepelWoreOffScript) ld a, BANK(RepelWoreOffScript)
ld hl, RepelWoreOffScript ld hl, RepelWoreOffScript
call CallScript call CallScript

View File

@ -164,7 +164,7 @@ MenuData2_0x1012c: ; 0x1012c
Jumptable_10137: ; 10137 Jumptable_10137: ; 10137
dw Function10159 dw Function10159
dw Function10492 dw Function10492_ret
; 1013b ; 1013b
MenuDataHeader_0x1013b: ; 0x1013b MenuDataHeader_0x1013b: ; 0x1013b
@ -186,7 +186,7 @@ MenuData2_0x10143: ; 0x10143
Jumptable_10153: ; 10153 Jumptable_10153: ; 10153
dw Function10159 dw Function10159
dw Function103fd dw Function103fd
dw Function10492 dw Function10492_ret
; 10159 ; 10159
Function10159: ; 10159 Function10159: ; 10159
@ -330,7 +330,7 @@ Jumptable_1026a: ; 1026a
dw Function103fd dw Function103fd
dw Function10364 dw Function10364
dw Function103c2 dw Function103c2
dw Function10492 dw Function10492_ret
; 10274 ; 10274
MenuDataHeader_0x10274: ; 0x10274 MenuDataHeader_0x10274: ; 0x10274
@ -354,7 +354,7 @@ Jumptable_10291: ; 10291
dw Function10311 dw Function10311
dw Function103fd dw Function103fd
dw Function10364 dw Function10364
dw Function10492 dw Function10492_ret
; 10299 ; 10299
MenuDataHeader_0x10299: ; 0x10299 MenuDataHeader_0x10299: ; 0x10299
@ -374,7 +374,7 @@ MenuData2_0x102a1: ; 0x102a1
Jumptable_102ac: ; 102ac Jumptable_102ac: ; 102ac
dw Function10311 dw Function10311
dw Function10492 dw Function10492_ret
; 102b0 ; 102b0
MenuDataHeader_0x102b0: ; 0x102b0 MenuDataHeader_0x102b0: ; 0x102b0
@ -396,7 +396,7 @@ MenuData2_0x102b8: ; 0x102b8
Jumptable_102c7: ; 102c7 Jumptable_102c7: ; 102c7
dw Function10311 dw Function10311
dw Function103c2 dw Function103c2
dw Function10492 dw Function10492_ret
; 102cd ; 102cd
MenuDataHeader_0x102cd: ; 0x102cd MenuDataHeader_0x102cd: ; 0x102cd
@ -420,7 +420,7 @@ Jumptable_102ea: ; 102ea
dw Function103fd dw Function103fd
dw Function10364 dw Function10364
dw Function103c2 dw Function103c2
dw Function10492 dw Function10492_ret
; 102f2 ; 102f2
MenuDataHeader_0x102f2: ; 0x102f2 MenuDataHeader_0x102f2: ; 0x102f2
@ -442,7 +442,7 @@ MenuData2_0x102fa: ; 0x102fa
Jumptable_1030b: ; 1030b Jumptable_1030b: ; 1030b
dw Function103fd dw Function103fd
dw Function10364 dw Function10364
dw Function10492 dw Function10492_ret
; 10311 ; 10311
Function10311: ; 10311 Function10311: ; 10311
@ -484,7 +484,7 @@ Function10311: ; 10311
call Function10a40 call Function10a40
ret ret
.NoPokemon .NoPokemon
ld hl, UnknownText_0x10af8 ld hl, TextJump_YouDontHaveAPkmn
call Function10889 call Function10889
ret ret
@ -602,16 +602,19 @@ Function103fd: ; 103fd
callba WritePartyMenuTilemap callba WritePartyMenuTilemap
callba PrintPartyMenuText callba PrintPartyMenuText
call WaitBGMap call WaitBGMap
call Function32f9 call SetPalettes
call DelayFrame call DelayFrame
callba PartyMenuSelect callba PartyMenuSelect
jr c, .asm_10475 jr c, .asm_10475
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
cp EGG cp EGG
jr nz, .asm_10453 jr nz, .asm_10453
ld hl, UnknownText_0x1048d
ld hl, TextJump_AnEGGCantHoldAnItem
call PrintText call PrintText
jr .asm_10427 jr .asm_10427
.asm_10453 .asm_10453
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
push af push af
@ -638,18 +641,18 @@ Function103fd: ; 103fd
ret ret
Function10486: ; 10486 (4:4486) Function10486: ; 10486 (4:4486)
ld hl, UnknownText_0x10af8 ld hl, TextJump_YouDontHaveAPkmn
call Function10889 call Function10889
ret ret
; 1048d (4:448d) ; 1048d (4:448d)
UnknownText_0x1048d: ; 0x1048d TextJump_AnEGGCantHoldAnItem: ; 0x1048d
; An EGG can't hold an item. ; An EGG can't hold an item.
text_jump UnknownText_0x1c0b7f text_jump Text_AnEGGCantHoldAnItem
db "@" db "@"
; 0x10492 ; 0x10492
Function10492: ; 10492 Function10492_ret: ; 10492
ret ret
; 10493 ; 10493
@ -1517,7 +1520,7 @@ Function10a40: ; 10a40
call WaitBGMap call WaitBGMap
ld b, SCREEN_WIDTH ld b, SCREEN_WIDTH
call GetSGBLayout call GetSGBLayout
call Function32f9 call SetPalettes
call DelayFrame call DelayFrame
ret ret
; 10a4f ; 10a4f
@ -1660,9 +1663,9 @@ UnknownText_0x10af3: ; 0x10af3
db "@" db "@"
; 0x10af8 ; 0x10af8
UnknownText_0x10af8: ; 0x10af8 TextJump_YouDontHaveAPkmn: ; 0x10af8
; You don't have a #MON! ; You don't have a #MON!
text_jump UnknownText_0x1c0c17 text_jump Text_YouDontHaveAPkmn
db "@" db "@"
; 0x10afd ; 0x10afd
@ -1690,9 +1693,10 @@ UnknownText_0x10b0c: ; 0x10b0c
db "@" db "@"
; 0x10b11 ; 0x10b11
UnknownText_0x10b11: ; 0x10b11 TextJump_YouCantUseItInABattle: ; 0x10b11
; You can't use it in a battle. ; Doesn't seem to be used anywhere
text_jump UnknownText_0x1c0c85 ; "You can't use it in a battle."
text_jump Text_YouCantUseItInABattle
db "@" db "@"
; 0x10b16 ; 0x10b16

View File

@ -38,11 +38,11 @@ PredefPointers:: ; 856b
add_predef FillPP add_predef FillPP
add_predef TryAddMonToParty add_predef TryAddMonToParty
add_predef Functionda96 add_predef Functionda96
add_predef Functiondb3f ; $8 add_predef SentGetPkmnIntoFromBox
add_predef SentPkmnIntoBox add_predef SentPkmnIntoBox
add_predef GiveEgg add_predef GiveEgg
add_predef Functionc6e0 add_predef Functionc6e0
add_predef Functione167 add_predef CalcPkmnStats
add_predef Functione17b add_predef Functione17b
add_predef CanLearnTMHMMove add_predef CanLearnTMHMMove
add_predef GetTMHMMove add_predef GetTMHMMove
@ -50,7 +50,7 @@ PredefPointers:: ; 856b
add_predef PrintMoveDesc add_predef PrintMoveDesc
add_predef UpdatePlayerHUD add_predef UpdatePlayerHUD
add_predef FillBox add_predef FillBox
add_predef Function3d873 add_predef CheckPlayerPartyForFitPkmn
add_predef UpdateEnemyHUD add_predef UpdateEnemyHUD
add_predef StartBattle add_predef StartBattle
add_predef FillInExpBar add_predef FillInExpBar
@ -61,7 +61,7 @@ PredefPointers:: ; 856b
add_predef Function421e6 add_predef Function421e6
add_predef Function28f63 add_predef Function28f63
add_predef Function28f24 add_predef Function28f24
add_predef Function5084a add_predef CopyPkmnToTempMon
add_predef ListMoves ; $20 add_predef ListMoves ; $20
add_predef Function50d2e add_predef Function50d2e
add_predef Function50cdb add_predef Function50cdb

View File

@ -1,5 +1,5 @@
Function14a1a: ; 14a1a Function14a1a: ; 14a1a
call Function1d6e call LoadMenuDataHeader_0x1d75
callba Function5e9a callba Function5e9a
call SpeechTextBox call SpeechTextBox
call UpdateSprites call UpdateSprites

View File

@ -23,7 +23,7 @@ UnknownText_0x88013: ; 0x88013
; 0x88018 ; 0x88018
Special_SelectApricornForKurt: ; 88018 Special_SelectApricornForKurt: ; 88018
call Function1d6e call LoadMenuDataHeader_0x1d75
ld c, $1 ld c, $1
xor a xor a
ld [wd0e4], a ld [wd0e4], a
@ -52,7 +52,7 @@ Special_SelectApricornForKurt: ; 88018
call Kurt_GiveUpSelectedQuantityOfSelectedApricorn call Kurt_GiveUpSelectedQuantityOfSelectedApricorn
.done .done
call Function1d7d call Call_ExitMenu
ret ret
; 88055 ; 88055

View File

@ -103,7 +103,7 @@ endr
.AccessBankOfMom: ; 162a8 .AccessBankOfMom: ; 162a8
ld hl, UnknownText_0x1665d ld hl, UnknownText_0x1665d
call PrintText call PrintText
call Function1d6e call LoadMenuDataHeader_0x1d75
ld hl, MenuDataHeader_0x166b5 ld hl, MenuDataHeader_0x166b5
call CopyMenuDataHeader call CopyMenuDataHeader
call InterpretMenu2 call InterpretMenu2
@ -148,7 +148,7 @@ endr
ld [hl], a ld [hl], a
ld a, $5 ld a, $5
ld [wcf64], a ld [wcf64], a
call Function1d6e call LoadMenuDataHeader_0x1d75
call Function16517 call Function16517
call Function1656b call Function1656b
call Function16571 call Function16571
@ -216,7 +216,7 @@ endr
ld [hl], a ld [hl], a
ld a, $5 ld a, $5
ld [wcf64], a ld [wcf64], a
call Function1d6e call LoadMenuDataHeader_0x1d75
call Function16512 call Function16512
call Function1656b call Function1656b
call Function16571 call Function16571

View File

@ -19,7 +19,7 @@ MoveDeletion:
jr z, .asm_2c5ca jr z, .asm_2c5ca
ld hl, UnknownText_0x2c5ea ld hl, UnknownText_0x2c5ea
call PrintText call PrintText
call Function1d6e call LoadMenuDataHeader_0x1d75
callba Function12f5b callba Function12f5b
push af push af
call Function2b74 call Function2b74

View File

@ -70,6 +70,7 @@ Function2ebb:: ; 2ebb
ld a, [wc2cc] ld a, [wc2cc]
bit 1, a bit 1, a
ret z ret z
ld a, [hJoyDown] ld a, [hJoyDown]
bit 1, a ; B_BUTTON bit 1, a ; B_BUTTON
ret ret
@ -212,7 +213,8 @@ HideSprites:: ; 3016
INCLUDE "home/copy2.asm" INCLUDE "home/copy2.asm"
Function309d:: ; 309d LoadTileMapToTempTileMap:: ; 309d
; Load TileMap into TempTileMap
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, BANK(w2_d000) ld a, BANK(w2_d000)
@ -226,16 +228,17 @@ Function309d:: ; 309d
ret ret
; 30b4 ; 30b4
Function30b4:: ; 30b4 Call_LoadTempTileMapToTileMap:: ; 30b4
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call Function30bf call LoadTempTileMapToTileMap
ld a, 1 ld a, 1
ld [hBGMapMode], a ld [hBGMapMode], a
ret ret
; 30bf ; 30bf
Function30bf:: ; 30bf LoadTempTileMapToTileMap:: ; 30bf
; Load TempTileMap into TileMap
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, BANK(w2_d000) ld a, BANK(w2_d000)
@ -682,11 +685,12 @@ endr
; 32f9 ; 32f9
SetPalettes:: ; 32f9
Function32f9:: ; 32f9 ; Inits the Palettes
; depending on the system the monochromes palettes or color palettes
ld a, [hCGB] ld a, [hCGB]
and a and a
jr nz, .asm_3309 jr nz, .SetPalettesForGameBoyColor
ld a, $e4 ld a, $e4
ld [rBGP], a ld [rBGP], a
ld a, $d0 ld a, $d0
@ -694,7 +698,7 @@ Function32f9:: ; 32f9
ld [rOBP1], a ld [rOBP1], a
ret ret
.asm_3309 .SetPalettesForGameBoyColor
push de push de
ld a, $e4 ld a, $e4
call DmgToCgbBGPals call DmgToCgbBGPals
@ -965,10 +969,10 @@ GetPokemonName:: ; 343b
ld h, 0 ld h, 0
ld l, a ld l, a
rept 2 rept 2
add hl, hl add hl, hl ; hl = hl * 4
endr endr
add hl, de add hl, de ; hl = (hl*4) + de
add hl, hl add hl, hl ; hl = (5*hl) + (5*hl)
ld de, PokemonNames ld de, PokemonNames
add hl, de add hl, de
@ -1165,7 +1169,7 @@ Function3524:: ; 3524
ld hl, VramState ld hl, VramState
bit 0, [hl] bit 0, [hl]
jp nz, UpdateTimePals jp nz, UpdateTimePals
jp Function32f9 jp SetPalettes
; 352f ; 352f
Function352f:: ; 352f Function352f:: ; 352f

View File

@ -1957,7 +1957,7 @@ CheckStandingOnXYTrigger:: ; 2ae7
FadeToMenu:: ; 2b29 FadeToMenu:: ; 2b29
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call Function1d6e call LoadMenuDataHeader_0x1d75
callba FadeBlackBGMap callba FadeBlackBGMap
call ClearSprites call ClearSprites
call DisableSpriteUpdates call DisableSpriteUpdates
@ -1969,14 +1969,14 @@ Function2b3c:: ; 2b3c
call WhiteBGMap call WhiteBGMap
call Function2bae call Function2bae
call UpdateSprites call UpdateSprites
call Function1d7d call Call_ExitMenu
call Functiond90 call Functiond90
jr Function2b5c jr Function2b5c
; 2b4d ; 2b4d
Function2b4d:: ; 2b4d Function2b4d:: ; 2b4d
call WhiteBGMap call WhiteBGMap
call Function1d7d call Call_ExitMenu
call Function2bae call Function2bae
call UpdateSprites call UpdateSprites
call Functiond90 call Functiond90

View File

@ -52,7 +52,7 @@ MenuTextBoxBackup:: ; 1d67
ret ret
; 1d6e ; 1d6e
Function1d6e:: ; 1d6e LoadMenuDataHeader_0x1d75:: ; 1d6e
ld hl, MenuDataHeader_0x1d75 ld hl, MenuDataHeader_0x1d75
call LoadMenuDataHeader call LoadMenuDataHeader
ret ret
@ -66,7 +66,7 @@ MenuDataHeader_0x1d75:: ; 1d75
db 1 ; default option db 1 ; default option
; 1d7d ; 1d7d
Function1d7d:: ; 1d7d Call_ExitMenu:: ; 1d7d
call ExitMenu call ExitMenu
ret ret
; 1d81 ; 1d81

View File

@ -273,15 +273,15 @@ Function83b:: ; 83b
; 862 ; 862
Function862:: ; 862 Function862:: ; 862
call Function309d call LoadTileMapToTempTileMap
callab Function4000 callab Function4000
call Function87d call Function87d
jp Function30b4 jp Call_LoadTempTileMapToTileMap
; 871 ; 871
Function871:: ; 871 Function871:: ; 871
call Function309d call LoadTileMapToTempTileMap
callab Function4000 callab Function4000
jp Function87d jp Function87d
; 87d ; 87d

View File

@ -87,7 +87,7 @@ hRandom EQU $ffe1
hRandomAdd EQU $ffe1 hRandomAdd EQU $ffe1
hRandomSub EQU $ffe2 hRandomSub EQU $ffe2
hSecondsBackup EQU $ffe3 hSecondsBackup EQU $ffe3
hBattleTurn EQU $ffe4 hBattleTurn EQU $ffe4 ; Which trainers turn is it? 0: Player, 1: Opponent Trainer
hCGBPalUpdate EQU $ffe5 hCGBPalUpdate EQU $ffe5
hCGB EQU $ffe6 hCGB EQU $ffe6
hSGB EQU $ffe7 hSGB EQU $ffe7

Some files were not shown because too many files have changed in this diff Show More