Skip to content

Commit b84cfde

Browse files
Decomped DoesTacticFollowLeader
1 parent b085fb4 commit b84cfde

14 files changed

+390
-335
lines changed

asm/include/main_02054E4C.inc

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,26 @@
11
#pragma once
2-
.public _020A190C
3-
.public _020A333C
4-
.public _020A3340
5-
.public _020A3350
6-
.public _020A336C
7-
.public _020A3398
8-
.public _020A33B8
9-
.public _020A33D4
10-
.public _020A340C
11-
.public _020A343C
12-
.public _020A344C
13-
.public _020A3450
14-
.public _020A3468
15-
.public _020AFC28
16-
.public _020AFC4C
17-
.public _020B0A4C
18-
.public _022B5788
19-
.public _022B578C
202
.public AddMoneyCarried
213
.public CleanStickyItemsInBag
224
.public CopyAndInterleaveWrapper
235
.public CopyTacticString
246
.public Debug_Print0
257
.public DirectoryFileMngr_OpenDirectoryFile
8+
.public EnableAllLearnableIqSkills
269
.public GetBaseDefensiveStat
2710
.public GetBaseFormCastformCherrimDeoxys
2811
.public GetBaseHp
2912
.public GetBaseOffensiveStat
3013
.public GetBodySize
3114
.public GetGameMode
32-
.public GetIqGroup
3315
.public GetItemAtIdx
3416
.public GetItemMoveId16
3517
.public GetMaxMembersAllowed
3618
.public GetMaxPp
3719
.public GetMonsterGender
3820
.public GetNameRaw
39-
.public GetPerformanceFlagWithChecks
4021
.public GetShadowSize
4122
.public GroundToDungeonMoveset
4223
.public HandleSir0Translation
43-
.public IQ_GROUP_SKILLS
44-
.public IQ_SKILL_RESTRICTIONS
45-
.public IQ_SKILLS
46-
.public IqSkillFlagTest
4724
.public IsLevelResetDungeon
4825
.public IsSkyExclusiveDungeon
4926
.public ItemZInit
@@ -58,6 +35,25 @@
5835
.public StrncpyName
5936
.public StrncpySimple
6037
.public StrncpySimpleNoPadSafe
38+
.public TEAM_MEMBER_TABLE_PTR
39+
.public UnloadFile
40+
.public _020A333C
41+
.public _020A3340
42+
.public _020A3350
43+
.public _020A336C
44+
.public _020A3398
45+
.public _020A33B8
46+
.public _020A33D4
47+
.public _020A340C
48+
.public _020A343C
49+
.public _020A344C
50+
.public _020A3450
51+
.public _020A3468
52+
.public _020AFC28
53+
.public _020AFC4C
54+
.public _020B0A4C
55+
.public _022B5788
56+
.public _022B578C
6157
.public sub_0200D8AC
6258
.public sub_0200FA0C
6359
.public sub_0201B43C
@@ -72,6 +68,3 @@
7268
.public sub_020534BC
7369
.public sub_02053D1C
7470
.public sub_02053F10
75-
.public TACTICS_UNLOCK_LEVEL_TABLE
76-
.public TEAM_MEMBER_TABLE_PTR
77-
.public UnloadFile

asm/include/main_02058C4C.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
.public GetIqGroup
3+
.public GetPerformanceFlagWithChecks
4+
.public IQ_GROUP_SKILLS
5+
.public IQ_SKILLS
6+
.public IQ_SKILL_RESTRICTIONS
7+
.public IqSkillFlagTest
8+
.public TACTICS_UNLOCK_LEVEL_TABLE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#pragma once

asm/main_02054E4C.s

Lines changed: 0 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -4921,246 +4921,3 @@ sub_02058C30: ; 0x02058C30
49214921
.align 2, 0
49224922
_02058C38: .word CopyTacticString
49234923
arm_func_end sub_02058C30
4924-
4925-
arm_func_start DoesTacticFollowLeader
4926-
DoesTacticFollowLeader: ; 0x02058C3C
4927-
ldr r1, _02058C48 ; =_020A190C
4928-
ldrb r0, [r1, r0]
4929-
bx lr
4930-
.align 2, 0
4931-
_02058C48: .word _020A190C
4932-
arm_func_end DoesTacticFollowLeader
4933-
4934-
arm_func_start GetUnlockedTactics
4935-
GetUnlockedTactics: ; 0x02058C4C
4936-
stmdb sp!, {r3, lr}
4937-
mov lr, #0
4938-
ldr r3, _02058C98 ; =TACTICS_UNLOCK_LEVEL_TABLE
4939-
mov ip, lr
4940-
_02058C5C:
4941-
mov r2, ip, lsl #1
4942-
ldrsh r2, [r3, r2]
4943-
cmp r2, r1
4944-
strleb ip, [r0, lr]
4945-
add ip, ip, #1
4946-
addle lr, lr, #1
4947-
cmp ip, #0xc
4948-
blt _02058C5C
4949-
mov r1, #0xb
4950-
b _02058C8C
4951-
_02058C84:
4952-
strb r1, [r0, lr]
4953-
add lr, lr, #1
4954-
_02058C8C:
4955-
cmp lr, #0xc
4956-
blt _02058C84
4957-
ldmia sp!, {r3, pc}
4958-
.align 2, 0
4959-
_02058C98: .word TACTICS_UNLOCK_LEVEL_TABLE
4960-
arm_func_end GetUnlockedTactics
4961-
4962-
arm_func_start GetUnlockedTacticFlags
4963-
GetUnlockedTacticFlags: ; 0x02058C9C
4964-
stmdb sp!, {r4, lr}
4965-
mov r4, #0
4966-
ldr lr, _02058CD4 ; =TACTICS_UNLOCK_LEVEL_TABLE
4967-
mov r2, r4
4968-
mov r3, #1
4969-
_02058CB0:
4970-
mov ip, r4, lsl #1
4971-
ldrsh ip, [lr, ip]
4972-
cmp ip, r1
4973-
strleb r3, [r0, r4]
4974-
strgtb r2, [r0, r4]
4975-
add r4, r4, #1
4976-
cmp r4, #0xc
4977-
blt _02058CB0
4978-
ldmia sp!, {r4, pc}
4979-
.align 2, 0
4980-
_02058CD4: .word TACTICS_UNLOCK_LEVEL_TABLE
4981-
arm_func_end GetUnlockedTacticFlags
4982-
4983-
arm_func_start CanLearnIqSkill
4984-
CanLearnIqSkill: ; 0x02058CD8
4985-
cmp r1, #0
4986-
moveq r0, #0
4987-
bxeq lr
4988-
ldr r2, _02058D00 ; =IQ_SKILLS
4989-
ldr r1, [r2, r1, lsl #2]
4990-
cmp r1, r0
4991-
movle r0, #1
4992-
movgt r0, #0
4993-
and r0, r0, #0xff
4994-
bx lr
4995-
.align 2, 0
4996-
_02058D00: .word IQ_SKILLS
4997-
arm_func_end CanLearnIqSkill
4998-
4999-
arm_func_start GetLearnableIqSkills
5000-
GetLearnableIqSkills: ; 0x02058D04
5001-
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
5002-
mov r6, #0
5003-
mov sl, r0
5004-
mov sb, r1
5005-
mov r8, r2
5006-
mov r5, r6
5007-
ldr r4, _02058DA0 ; =IQ_GROUP_SKILLS
5008-
mov fp, #0x19
5009-
b _02058D74
5010-
_02058D28:
5011-
mov r0, sb
5012-
bl GetIqGroup
5013-
mla r1, r0, fp, r4
5014-
and r0, r5, #0xff
5015-
ldrb r7, [r0, r1]
5016-
cmp r7, #0xff
5017-
beq _02058D7C
5018-
cmp r7, #0x18
5019-
bne _02058D58
5020-
mov r0, #3
5021-
bl GetPerformanceFlagWithChecks
5022-
b _02058D64
5023-
_02058D58:
5024-
mov r0, r8
5025-
mov r1, r7
5026-
bl CanLearnIqSkill
5027-
_02058D64:
5028-
cmp r0, #0
5029-
strneb r7, [sl, r6]
5030-
addne r6, r6, #1
5031-
add r5, r5, #1
5032-
_02058D74:
5033-
cmp r5, #0x19
5034-
blt _02058D28
5035-
_02058D7C:
5036-
mov r1, r6
5037-
mov r0, #0
5038-
b _02058D90
5039-
_02058D88:
5040-
strb r0, [sl, r1]
5041-
add r1, r1, #1
5042-
_02058D90:
5043-
cmp r1, #0x45
5044-
blt _02058D88
5045-
mov r0, r6
5046-
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
5047-
.align 2, 0
5048-
_02058DA0: .word IQ_GROUP_SKILLS
5049-
arm_func_end GetLearnableIqSkills
5050-
5051-
arm_func_start DisableIqSkill
5052-
DisableIqSkill: ; 0x02058DA4
5053-
stmdb sp!, {r3, r4, r5, lr}
5054-
mov r4, r0
5055-
mov r5, r1
5056-
bl IqSkillFlagTest
5057-
cmp r0, #0
5058-
beq _02058DE4
5059-
mov r0, r5, asr #4
5060-
add r0, r5, r0, lsr #27
5061-
mov r2, r0, asr #5
5062-
sub r0, r5, r2, lsl #5
5063-
mov r1, #1
5064-
mvn r0, r1, lsl r0
5065-
ldr r1, [r4, r2, lsl #2]
5066-
and r0, r1, r0
5067-
str r0, [r4, r2, lsl #2]
5068-
ldmia sp!, {r3, r4, r5, pc}
5069-
_02058DE4:
5070-
mov r0, r4
5071-
mov r1, r5
5072-
bl EnableIqSkill
5073-
ldmia sp!, {r3, r4, r5, pc}
5074-
arm_func_end DisableIqSkill
5075-
5076-
arm_func_start EnableIqSkill
5077-
EnableIqSkill: ; 0x02058DF4
5078-
stmdb sp!, {r4, r5, r6, lr}
5079-
ldr r2, _02058E64 ; =IQ_SKILL_RESTRICTIONS
5080-
mov r3, r1, lsl #1
5081-
ldrsh ip, [r2, r3]
5082-
mov r3, #0
5083-
mov r4, #1
5084-
_02058E0C:
5085-
mov r5, r3, lsl #1
5086-
ldrsh r5, [r2, r5]
5087-
cmp ip, r5
5088-
bne _02058E3C
5089-
mov lr, r3, asr #4
5090-
add lr, r3, lr, lsr #27
5091-
mov r6, lr, asr #5
5092-
sub lr, r3, r6, lsl #5
5093-
mvn lr, r4, lsl lr
5094-
ldr r5, [r0, r6, lsl #2]
5095-
and r5, r5, lr
5096-
str r5, [r0, r6, lsl #2]
5097-
_02058E3C:
5098-
add r3, r3, #1
5099-
cmp r3, #0x45
5100-
blt _02058E0C
5101-
mov ip, r1, lsr #5
5102-
ldr r3, [r0, ip, lsl #2]
5103-
sub r1, r1, ip, lsl #5
5104-
mov r2, #1
5105-
orr r1, r3, r2, lsl r1
5106-
str r1, [r0, ip, lsl #2]
5107-
ldmia sp!, {r4, r5, r6, pc}
5108-
.align 2, 0
5109-
_02058E64: .word IQ_SKILL_RESTRICTIONS
5110-
arm_func_end EnableIqSkill
5111-
5112-
arm_func_start GetSpeciesIqSkill
5113-
GetSpeciesIqSkill: ; 0x02058E68
5114-
stmdb sp!, {r4, lr}
5115-
mov r4, r1
5116-
bl GetIqGroup
5117-
ldr r2, _02058E88 ; =IQ_GROUP_SKILLS
5118-
mov r1, #0x19
5119-
mla r1, r0, r1, r2
5120-
ldrb r0, [r4, r1]
5121-
ldmia sp!, {r4, pc}
5122-
.align 2, 0
5123-
_02058E88: .word IQ_GROUP_SKILLS
5124-
arm_func_end GetSpeciesIqSkill
5125-
5126-
arm_func_start DisableAllIqSkills
5127-
DisableAllIqSkills: ; 0x02058E8C
5128-
mov r3, #0
5129-
mov r2, r3
5130-
_02058E94:
5131-
add r1, r3, #1
5132-
mov r1, r1, lsl #0x10
5133-
str r2, [r0, r3, lsl #2]
5134-
mov r3, r1, asr #0x10
5135-
cmp r3, #3
5136-
blt _02058E94
5137-
bx lr
5138-
arm_func_end DisableAllIqSkills
5139-
5140-
arm_func_start EnableAllLearnableIqSkills
5141-
EnableAllLearnableIqSkills: ; 0x02058EB0
5142-
stmdb sp!, {r4, r5, r6, lr}
5143-
sub sp, sp, #0x48
5144-
mov r6, r0
5145-
add r0, sp, #0
5146-
bl GetLearnableIqSkills
5147-
mov r0, r6
5148-
bl DisableAllIqSkills
5149-
mov r5, #0
5150-
add r4, sp, #0
5151-
b _02058EF4
5152-
_02058ED8:
5153-
ldrb r0, [r4, r5]
5154-
cmp r0, #0
5155-
beq _02058EFC
5156-
ldrb r1, [r4, r5]
5157-
mov r0, r6
5158-
bl EnableIqSkill
5159-
add r5, r5, #1
5160-
_02058EF4:
5161-
cmp r5, #0x45
5162-
blt _02058ED8
5163-
_02058EFC:
5164-
add sp, sp, #0x48
5165-
ldmia sp!, {r4, r5, r6, pc}
5166-
arm_func_end EnableAllLearnableIqSkills

0 commit comments

Comments
 (0)