begin decompiling encounter.c

This commit is contained in:
red031000 2023-08-10 20:41:39 +01:00
parent 66ce2b8e3e
commit 1521acf3f0
No known key found for this signature in database
GPG Key ID: D27E50C050AE0CE1
108 changed files with 2132 additions and 2817 deletions

View File

@ -311,4 +311,8 @@ diamond: ; @+$(MAKE) GAME_VERSION=DIAMOND
pearl: ; @+$(MAKE) GAME_VERSION=PEARL
compare_diamond: ; @+$(MAKE) GAME_VERSION=DIAMOND COMPARE=1
compare_pearl: ; @+$(MAKE) GAME_VERSION=PEARL COMPARE=1
compare: compare_diamond
clean_diamond: ; @+$(MAKE) GAME_VERSION=DIAMOND clean
clean_pearl: ; @+$(MAKE) GAME_VERSION=PEARL clean
compare: compare_diamond
.PHONY: diamond pearl compare_diamond compare_pearl compare clean_diamond clean_pearl

View File

@ -184,7 +184,8 @@ Static arm9
Object unk_02046030.o
Object event_data.o
Object task.o
Object unk_0204653C.o
Object encounter.o
Object encounter_asm.o
Object unk_02047500.o
Object unk_020476CC.o
Object unk_02048120.o

505
arm9/asm/encounter_asm.s Normal file
View File

@ -0,0 +1,505 @@
.include "asm/macros.inc"
.include "global.inc"
.extern Encounter_New
.extern CallTask_StartEncounter
.extern sub_02046758
.extern sub_020467FC
.text
thumb_func_start SetupAndStartTrainerBattle
SetupAndStartTrainerBattle: ; 0x020470E8
push {r4-r7, lr}
sub sp, #0xc
str r0, [sp, #0x4]
add r6, r1, #0x0
add r5, r2, #0x0
str r3, [sp, #0x8]
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
cmp r5, #0x0
beq _02047110
cmp r6, r5
beq _02047110
ldr r0, [sp, #0x8]
cmp r0, #0x0
bne _0204710C
mov r4, #0x13
b _0204711A
_0204710C:
mov r4, #0x4b
b _0204711A
_02047110:
cmp r6, r5
bne _02047118
mov r4, #0x3
b _0204711A
_02047118:
mov r4, #0x1
_0204711A:
add r0, r7, #0x0
add r0, #0x90
ldr r0, [r0, #0x0]
bl sub_0205DD40
mov r0, #0xb
add r1, r4, #0x0
bl BattleSetup_New
add r4, r0, #0x0
add r1, r7, #0x0
bl BattleSetup_InitFromFieldSystem
str r6, [r4, #0x1c]
ldr r0, [sp, #0x8]
str r5, [r4, #0x24]
str r0, [r4, #0x20]
ldr r1, [r7, #0xc]
ldr r2, [sp, #0x20]
add r0, r4, #0x0
bl EnemyTrainerSet_Init
ldr r0, [r7, #0xc]
bl Save_GameStats_Get
mov r1, #0x8
bl GameStats_Inc
add r0, r4, #0x0
bl sub_020475A0
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_020475B0
add r3, r0, #0x0
ldr r0, [sp, #0x24]
add r1, r4, #0x0
str r0, [sp, #0x0]
ldr r0, [sp, #0x4]
add r2, r5, #0x0
bl CallTask_StartEncounter
add sp, #0xc
pop {r4-r7, pc}
thumb_func_start sub_02047174
sub_02047174: ; 0x02047174
push {r3-r7, lr}
add r5, r2, #0x0
add r7, r0, #0x0
add r4, r1, #0x0
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
mov r0, #0xb
add r1, r5, #0x0
bl BattleSetup_New
add r5, r0, #0x0
add r1, r6, #0x0
add r2, r4, #0x0
bl sub_02047F1C
add r0, r5, #0x0
bl sub_020475A0
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_020475B0
add r2, r0, #0x0
add r0, r5, #0x0
add r1, r4, #0x0
mov r3, #0x0
bl Encounter_New
add r2, r0, #0x0
ldr r1, _020471BC ; =sub_02046758
add r0, r7, #0x0
bl TaskManager_Call
pop {r3-r7, pc}
nop
_020471BC: .word sub_02046758
thumb_func_start sub_020471C0
sub_020471C0: ; 0x020471C0
push {r3-r7, lr}
str r0, [sp, #0x0]
add r5, r1, #0x0
add r6, r2, #0x0
add r4, r3, #0x0
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
cmp r4, #0x0
beq _020471DE
mov r0, #0xb
mov r1, #0x5
bl BattleSetup_New
b _020471E6
_020471DE:
mov r0, #0xb
mov r1, #0x7
bl BattleSetup_New
_020471E6:
add r4, r0, #0x0
add r0, r4, #0x0
add r1, r7, #0x0
add r2, r6, #0x0
bl sub_02047BC0
add r0, r4, #0x0
bl sub_020475A0
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_020475B0
add r2, r0, #0x0
add r0, r4, #0x0
add r1, r6, #0x0
mov r3, #0x0
bl Encounter_New
add r2, r0, #0x0
ldr r0, [sp, #0x0]
ldr r1, _0204721C ; =sub_020467FC
str r5, [r2, #0xc]
bl TaskManager_Call
pop {r3-r7, pc}
nop
_0204721C: .word sub_020467FC
thumb_func_start sub_02047220
sub_02047220: ; 0x02047220
push {r3-r7, lr}
add r5, r0, #0x0
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetEnvironment
add r7, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
beq _02047246
cmp r0, #0x1
beq _02047258
b _02047262
_02047246:
ldr r1, _02047268 ; =sub_02046758
add r0, r5, #0x0
add r2, r7, #0x0
bl TaskManager_Call
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
b _02047262
_02047258:
add r0, r6, #0x0
bl sub_0204FF5C
mov r0, #0x1
pop {r3-r7, pc}
_02047262:
mov r0, #0x0
pop {r3-r7, pc}
nop
_02047268: .word sub_02046758
thumb_func_start sub_0204726C
sub_0204726C: ; 0x0204726C
push {r4-r6, lr}
add r5, r0, #0x0
add r6, r1, #0x0
mov r0, #0xb
add r1, r2, #0x0
bl BattleSetup_New
add r4, r0, #0x0
add r1, r5, #0x0
add r2, r6, #0x0
bl sub_02047F1C
add r0, r4, #0x0
bl sub_020475A0
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_020475B0
add r2, r0, #0x0
add r0, r4, #0x0
add r1, r6, #0x0
mov r3, #0x0
bl Encounter_New
add r2, r0, #0x0
ldr r1, _020472AC ; =sub_02047220
add r0, r5, #0x0
bl FieldSystem_CreateTask
pop {r4-r6, pc}
nop
_020472AC: .word sub_02047220
thumb_func_start sub_020472B0
sub_020472B0: ; 0x020472B0
push {r4-r6, lr}
add r5, r0, #0x0
add r6, r1, #0x0
mov r0, #0xb
add r1, r2, #0x0
bl BattleSetup_New
add r4, r0, #0x0
add r1, r5, #0x0
add r2, r6, #0x0
mov r3, #0x0
bl sub_02047D48
add r0, r4, #0x0
bl sub_020475A0
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_020475B0
add r2, r0, #0x0
add r0, r4, #0x0
add r1, r6, #0x0
mov r3, #0x0
bl Encounter_New
add r2, r0, #0x0
ldr r1, _020472F0 ; =sub_02047220
add r0, r5, #0x0
bl FieldSystem_CreateTask
pop {r4-r6, pc}
.balign 4
_020472F0: .word sub_02047220
thumb_func_start sub_020472F4
sub_020472F4: ; 0x020472F4
push {r3-r5, lr}
add r4, r0, #0x0
ldr r0, [r1, #0x0]
mov r3, #0x4
ldr r2, [r1, #0x14]
tst r3, r0
bne _020473C8
mov r3, #0x80
add r5, r0, #0x0
tst r5, r3
bne _020473C8
cmp r0, #0x0
beq _02047318
add r3, #0x80
cmp r0, r3
beq _02047318
cmp r0, #0x4a
bne _02047364
_02047318:
cmp r2, #0x1
bne _0204732A
ldr r0, [r4, #0xc]
bl Save_GameStats_Get
mov r1, #0x8
bl GameStats_AddSpecial
pop {r3-r5, pc}
_0204732A:
cmp r2, #0x4
bne _020473C8
ldr r0, [r1, #0x8]
mov r1, #0x0
bl GetPartyMonByIndex
mov r1, #0x5
mov r2, #0x0
bl GetMonData
add r1, r0, #0x0
mov r0, #0x0
bl sub_0206BB48
cmp r0, #0x0
ldr r0, [r4, #0xc]
beq _02047358
bl Save_GameStats_Get
mov r1, #0x9
bl GameStats_AddSpecial
pop {r3-r5, pc}
_02047358:
bl Save_GameStats_Get
mov r1, #0xa
bl GameStats_AddSpecial
pop {r3-r5, pc}
_02047364:
mov r3, #0x1
tst r3, r0
bne _02047370
mov r3, #0x10
tst r3, r0
beq _02047382
_02047370:
cmp r2, #0x1
bne _020473C8
ldr r0, [r4, #0xc]
bl Save_GameStats_Get
mov r1, #0xb
bl GameStats_AddSpecial
pop {r3-r5, pc}
_02047382:
mov r3, #0x20
add r5, r0, #0x0
tst r5, r3
bne _02047390
lsl r3, r3, #0x4
tst r0, r3
beq _020473C8
_02047390:
cmp r2, #0x4
bne _020473C8
ldr r0, [r1, #0x8]
mov r1, #0x0
bl GetPartyMonByIndex
mov r1, #0x5
mov r2, #0x0
bl GetMonData
add r1, r0, #0x0
mov r0, #0x0
bl sub_0206BB48
cmp r0, #0x0
ldr r0, [r4, #0xc]
beq _020473BE
bl Save_GameStats_Get
mov r1, #0x9
bl GameStats_AddSpecial
pop {r3-r5, pc}
_020473BE:
bl Save_GameStats_Get
mov r1, #0xa
bl GameStats_AddSpecial
_020473C8:
pop {r3-r5, pc}
.balign 4
thumb_func_start sub_020473CC
sub_020473CC: ; 0x020473CC
push {r4-r7, lr}
sub sp, #0xc
add r4, r1, #0x0
add r5, r0, #0x0
ldr r0, [r4, #0x0]
mov r2, #0x4
ldr r1, [r4, #0x14]
tst r2, r0
bne _020473EC
mov r3, #0x80
add r2, r0, #0x0
tst r2, r3
bne _020473EC
lsl r2, r3, #0x2
tst r2, r0
beq _020473EE
_020473EC:
b _020474FC
_020473EE:
cmp r0, #0x0
beq _02047400
add r3, #0x80
cmp r0, r3
beq _02047400
cmp r0, #0x4a
beq _02047400
cmp r0, #0x20
bne _020474D2
_02047400:
cmp r1, #0x1
bne _02047470
add r0, r5, #0x0
add r0, #0x76
ldrh r0, [r0, #0x0]
add r1, r0, #0x1
add r0, r5, #0x0
add r0, #0x76
strh r1, [r0, #0x0]
add r0, r5, #0x0
add r0, #0x76
ldrh r0, [r0, #0x0]
cmp r0, #0x5
blo _020474FC
ldr r0, [r4, #0x8]
mov r1, #0x0
bl GetPartyMonByIndex
add r6, r0, #0x0
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetIGTAddr
str r0, [sp, #0x4]
add r0, r6, #0x0
mov r1, #0x5
mov r2, #0x0
bl GetMonData
add r7, r0, #0x0
add r0, r6, #0x0
mov r1, #0x6f
mov r2, #0x0
bl GetMonData
add r2, r0, #0x0
mov r3, #0xb
str r3, [sp, #0x0]
lsl r3, r3, #0x5
ldr r3, [r4, r3]
lsl r1, r7, #0x10
lsl r2, r2, #0x18
lsl r3, r3, #0x18
ldr r0, [sp, #0x4]
lsr r1, r1, #0x10
lsr r2, r2, #0x18
lsr r3, r3, #0x18
bl sub_0202920C
add r5, #0x98
add r1, r0, #0x0
ldr r0, [r5, #0x0]
mov r2, #0x2
bl sub_02028AD4
add sp, #0xc
pop {r4-r7, pc}
_02047470:
cmp r1, #0x4
bne _020474FC
mov r0, #0x17
lsl r0, r0, #0x4
ldr r0, [r4, r0]
mov r1, #0x0
lsl r0, r0, #0x2
add r0, r4, r0
ldr r0, [r0, #0x4]
bl GetPartyMonByIndex
add r6, r0, #0x0
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetIGTAddr
str r0, [sp, #0x8]
add r0, r6, #0x0
mov r1, #0x5
mov r2, #0x0
bl GetMonData
add r7, r0, #0x0
add r0, r6, #0x0
mov r1, #0x6f
mov r2, #0x0
bl GetMonData
add r2, r0, #0x0
mov r3, #0xb
str r3, [sp, #0x0]
lsl r3, r3, #0x5
ldr r3, [r4, r3]
lsl r1, r7, #0x10
lsl r2, r2, #0x18
lsl r3, r3, #0x18
ldr r0, [sp, #0x8]
lsr r1, r1, #0x10
lsr r2, r2, #0x18
lsr r3, r3, #0x18
bl sub_0202918C
add r5, #0x98
add r1, r0, #0x0
ldr r0, [r5, #0x0]
mov r2, #0x2
bl sub_02028AD4
add sp, #0xc
pop {r4-r7, pc}
_020474D2:
mov r2, #0x1
tst r2, r0
bne _020474DE
mov r2, #0x10
tst r0, r2
beq _020474FC
_020474DE:
cmp r1, #0x1
bne _020474FC
ldr r1, [r5, #0x1c]
add r0, r5, #0x0
ldr r1, [r1, #0x0]
ldr r2, [r4, #0x1c]
add r0, #0x98
lsl r1, r1, #0x10
lsl r2, r2, #0x10
ldr r0, [r0, #0x0]
lsr r1, r1, #0x10
lsr r2, r2, #0x10
mov r3, #0xb
bl sub_020299DC
_020474FC:
add sp, #0xc
pop {r4-r7, pc}

View File

@ -283,7 +283,7 @@ _02042F0C: .word UNK_020F43E4
sub_02042F10: ; 0x02042F10
push {r3, lr}
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl GetPartyCount
cmp r0, #0x6
bge _02042F24
@ -656,7 +656,7 @@ _0204322C:
bl CalcMonLevelAndStats
ldr r0, [sp, #0x4]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r4, #0x0
bl AddMonToParty
cmp r0, #0x0

View File

@ -117,7 +117,7 @@ ScrCmd_Unk00FA: ; 0x0203FF10
add r0, #0x80
ldr r0, [r0, #0x0]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r6, #0x0
bl GetPartyMonByIndex
str r0, [sp, #0x10]

View File

@ -40,7 +40,7 @@ ScrCmd_Unk024F: ; 0x020411C4
add r0, #0x80
ldr r7, [r0, #0x0]
ldr r0, [r7, #0xc]
bl GetStoragePCPointer
bl Save_PCStorage_Get
str r0, [sp, #0x20]
add r0, r4, #0x0
bl ScriptReadHalfword
@ -74,7 +74,7 @@ ScrCmd_Unk024F: ; 0x020411C4
bl VarGet
str r0, [sp, #0x0]
ldr r0, [r7, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl GetPartyCount
lsl r0, r0, #0x10
lsr r6, r0, #0x10
@ -85,7 +85,7 @@ ScrCmd_Unk024F: ; 0x020411C4
beq _02041286
_0204123C:
ldr r0, [r7, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r5, #0x0
bl GetPartyMonByIndex
mov r1, #0x4c

View File

@ -266,7 +266,7 @@ ScrCmd_Unk00E5: ; 0x0204188C
mov r6, #0x0
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0x1
bne _020418F2
ldr r0, [r4, #0xc]
@ -281,7 +281,7 @@ _020418F2:
ldr r1, [sp, #0xc]
ldr r2, [sp, #0x8]
add r3, r6, #0x0
bl sub_020470E8
bl SetupAndStartTrainerBattle
mov r0, #0x1
add sp, #0x10
pop {r3-r7, pc}
@ -327,7 +327,7 @@ ScrCmd_Unk02A0: ; 0x0204190C
ldr r0, [r5, #0x74]
add r1, r7, #0x0
add r3, r6, #0x0
bl sub_020470E8
bl SetupAndStartTrainerBattle
mov r0, #0x1
add sp, #0x8
pop {r3-r7, pc}
@ -524,7 +524,7 @@ ScrCmd_Unk00EC: ; 0x02041AE0
bl GetVarPointer
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_020480B8
bl IsBattleResultWin
strh r0, [r5, #0x0]
mov r0, #0x1
pop {r3-r5, pc}
@ -590,7 +590,7 @@ ScrCmd_Unk00EE: ; 0x02041B70
add r4, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl HasEnoughAlivePokemonForDoubleBattle
strh r0, [r4, #0x0]
mov r0, #0x0
@ -613,7 +613,7 @@ ScrCmd_Unk00EF: ; 0x02041B9C
ldr r0, [r4, #0x74]
mov r1, #0x1
add r3, r2, #0x0
bl sub_020470E8
bl SetupAndStartTrainerBattle
mov r0, #0x1
add sp, #0x8
pop {r4, pc}

View File

@ -242,7 +242,7 @@ ScrCmd_Unk02B8: ; 0x02042000
add r0, #0x80
ldr r0, [r0, #0x0]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r4, r0, #0x0
add r0, r5, #0x0
bl ScriptReadHalfword
@ -407,7 +407,7 @@ _02042170:
add r0, #0x80
ldr r0, [r0, #0x0]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r6, r0, #0x0
add r0, r5, #0x0
bl ScriptReadHalfword
@ -548,7 +548,7 @@ sub_02042288: ; 0x02042288
push {r4, lr}
ldr r0, [r0, #0xc]
add r4, r1, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl GetFirstNonEggInParty
bl sub_020690E4
add r2, r0, #0x0

View File

@ -85,7 +85,7 @@ sub_02035080: ; 0x02035080
add r4, r0, #0x0
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
bne _020350A6
add r0, r5, #0x0
@ -141,7 +141,7 @@ _02035106:
ldr r1, _02035114 ; =sub_020352E4
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3-r5, pc}
nop
_02035114: .word sub_020352E4
@ -173,7 +173,7 @@ _0203514C:
ldr r1, _02035158 ; =sub_020352E4
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3-r5, pc}
.balign 4
_02035158: .word sub_020352E4
@ -205,7 +205,7 @@ _02035190:
ldr r1, _0203519C ; =sub_020352E4
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3-r5, pc}
.balign 4
_0203519C: .word sub_020352E4
@ -224,7 +224,7 @@ sub_020351A0: ; 0x020351A0
str r1, [r4, r0]
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
bne _020351D4
add r0, r5, #0x0
@ -288,7 +288,7 @@ _02035240:
ldr r0, [r5, #0x10]
ldr r1, _02035250 ; =sub_020352E4
add r2, r4, #0x0
bl sub_020463EC
bl TaskManager_Jump
pop {r3-r5, pc}
.balign 4
_0203524C: .word 0x000005FD
@ -390,7 +390,7 @@ sub_020352E4: ; 0x020352E4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldrh r1, [r4, #0x2a]
cmp r1, #0xf
@ -420,7 +420,7 @@ _02035308: ; jump table (using 16-bit offset)
.short _02035432 - _02035308 - 2; case 15
_02035328:
ldr r0, [r5, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
mov r1, #0x73
lsl r1, r1, #0x2
add r0, r5, #0x0
@ -478,7 +478,7 @@ _02035398:
cmp r0, #0x0
beq _02035484
ldr r0, [r5, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
add r0, r6, #0x0
bl sub_0203549C
add r0, r6, #0x0
@ -508,7 +508,7 @@ _020353D6:
add r0, r4, #0x0
bl FreeToHeap
ldr r0, [r5, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
mov r0, #0x1
pop {r4-r6, pc}
_020353F6:
@ -517,7 +517,7 @@ _020353F6:
cmp r0, #0x0
beq _02035484
ldr r0, [r5, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
mov r0, #0x1
bl ov05_021D7CA4
mov r0, #0xb
@ -533,14 +533,14 @@ _02035412:
add r2, #0x30
ldr r2, [r4, r2]
add r0, r6, #0x0
bl sub_020463EC
bl TaskManager_Jump
add r0, r4, #0x0
bl FreeToHeap
b _02035484
_02035432:
bl FreeToHeap
ldr r0, [r5, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
mov r0, #0x1
pop {r4-r6, pc}
_02035440:
@ -561,7 +561,7 @@ _02035440:
add r0, r4, #0x0
bl FreeToHeap
ldr r0, [r5, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
mov r0, #0x1
pop {r4-r6, pc}
_02035478:
@ -591,7 +591,7 @@ sub_0203549C: ; 0x0203549C
bl TaskManager_GetFieldSystem
str r0, [sp, #0x1c]
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r1, r4, #0x0
add r1, #0x30
@ -915,11 +915,11 @@ sub_02035734: ; 0x02035734
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
bne _0203575A
mov r6, #0x0
@ -1074,11 +1074,11 @@ sub_020358A0: ; 0x020358A0
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x0
bne _020358CE
ldr r0, [r4, #0xc]
@ -1105,7 +1105,7 @@ sub_020358E4: ; 0x020358E4
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r0, [r5, #0x20]
bl sub_02001E5C
@ -1583,7 +1583,7 @@ sub_02035CA0: ; 0x02035CA0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
bl sub_02035718
add r0, r4, #0x0
@ -1608,10 +1608,10 @@ sub_02035CDC: ; 0x02035CDC
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _02035D02
mov r1, #0x72
@ -1634,7 +1634,7 @@ sub_02035D04: ; 0x02035D04
thumb_func_start sub_02035D10
sub_02035D10: ; 0x02035D10
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x0
bl ov05_021D7CA4
@ -1657,7 +1657,7 @@ sub_02035D34: ; 0x02035D34
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
mov r0, #0xb
mov r1, #0x20
@ -1721,7 +1721,7 @@ sub_02035DC8: ; 0x02035DC8
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204649C
@ -1741,7 +1741,7 @@ _02035DF0:
thumb_func_start sub_02035DF8
sub_02035DF8: ; 0x02035DF8
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x0
bl ov05_021D7CA4
@ -1763,7 +1763,7 @@ sub_02035E1C: ; 0x02035E1C
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
mov r1, #0x7a
add r4, r0, #0x0
lsl r1, r1, #0x2
@ -1790,7 +1790,7 @@ sub_02035E50: ; 0x02035E50
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0xb
mov r1, #0x40
@ -1849,7 +1849,7 @@ _02035ECC:
bl AllocFromHeap
add r7, r0, #0x0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r7, #0x0]
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetOptionsAddr
@ -1901,7 +1901,7 @@ _02035F4A:
bl AllocFromHeap
add r7, r0, #0x0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r7, #0x0]
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetOptionsAddr
@ -1958,7 +1958,7 @@ _02035FD0:
bl AllocFromHeap
add r7, r0, #0x0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r7, #0x0]
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetOptionsAddr
@ -2052,7 +2052,7 @@ _0203609C:
b _0203625E
_020360AC:
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r6, #0x0
add r1, #0x22
ldrb r1, [r1, #0x0]
@ -2271,7 +2271,7 @@ _02036280: .word sub_020362E4
thumb_func_start sub_02036284
sub_02036284: ; 0x02036284
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x0
bl ov05_021D7CA4
@ -2293,7 +2293,7 @@ sub_020362A8: ; 0x020362A8
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
mov r1, #0x73
add r4, r0, #0x0
lsl r1, r1, #0x2
@ -2323,7 +2323,7 @@ sub_020362E4: ; 0x020362E4
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0xb
bl BagView_New
@ -2400,7 +2400,7 @@ _0203638A:
add r5, r0, #0x0
bl memset
ldr r0, [r6, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r5, #0x0]
ldr r0, [r6, #0xc]
bl Save_Bag_Get
@ -2439,7 +2439,7 @@ _0203638A:
b _020364F8
_020363F6:
ldr r0, [r6, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0x4]
mov r0, #0x7f
lsl r0, r0, #0x2
@ -2566,7 +2566,7 @@ _0203650C: .word sub_02036BDC
thumb_func_start sub_02036510
sub_02036510: ; 0x02036510
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x0
bl ov05_021D7CA4
@ -2589,7 +2589,7 @@ sub_02036534: ; 0x02036534
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0xb
bl sub_02065054
@ -2626,7 +2626,7 @@ sub_02036584: ; 0x02036584
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
mov r1, #0x7e
add r4, r0, #0x0
lsl r1, r1, #0x2
@ -2649,7 +2649,7 @@ sub_02036584: ; 0x02036584
sub_020365BC: ; 0x020365BC
push {r3-r5, lr}
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
bl sub_02035718
add r0, r4, #0x0
@ -2672,7 +2672,7 @@ sub_020365BC: ; 0x020365BC
sub_020365F0: ; 0x020365F0
push {r3-r5, lr}
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -2684,7 +2684,7 @@ sub_020365F0: ; 0x020365F0
ldr r1, _0203663C ; =0x000007F2
add r0, r5, #0x0
add r3, r2, #0x0
bl sub_02038CD8
bl QueueScript
b _02036636
_02036618:
mov r0, #0x20
@ -2699,7 +2699,7 @@ _02036618:
ldr r1, _02036640 ; =0x000007D5
add r0, r5, #0x0
add r3, r3, #0x4
bl sub_02038CD8
bl QueueScript
_02036636:
mov r0, #0x5
strh r0, [r4, #0x2a]
@ -2715,7 +2715,7 @@ sub_02036644: ; 0x02036644
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2
@ -2745,7 +2745,7 @@ _02036678:
thumb_func_start sub_02036684
sub_02036684: ; 0x02036684
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x0
bl ov05_021D7CA4
@ -2767,7 +2767,7 @@ sub_020366A8: ; 0x020366A8
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_02037EF8
@ -2789,7 +2789,7 @@ sub_020366D4: ; 0x020366D4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2
@ -2806,7 +2806,7 @@ sub_020366D4: ; 0x020366D4
thumb_func_start sub_02036700
sub_02036700: ; 0x02036700
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x0
bl ov05_021D7CA4
@ -2829,7 +2829,7 @@ sub_02036724: ; 0x02036724
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r2, [r5, #0xc]
mov r0, #0x2
@ -2870,7 +2870,7 @@ sub_0203677C: ; 0x0203677C
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2
@ -2919,7 +2919,7 @@ sub_020367E8: ; 0x020367E8
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
bl sub_02035718
add r0, r4, #0x0
@ -2934,19 +2934,19 @@ sub_020367E8: ; 0x020367E8
bl sub_020358A0
ldr r0, [r6, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
bne _02036834
ldr r1, _02036848 ; =0x00002275
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
b _0203683E
_02036834:
add r0, r5, #0x0
mov r1, #0x4
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
_0203683E:
add r0, r4, #0x0
bl FreeToHeap
@ -2962,7 +2962,7 @@ sub_0203684C: ; 0x0203684C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0xb
mov r1, #0x30
@ -2992,7 +2992,7 @@ sub_0203684C: ; 0x0203684C
add r5, r0, #0x0
bl memset
ldr r0, [r6, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r5, #0x0]
ldr r0, [r6, #0xc]
bl Save_Bag_Get
@ -3089,7 +3089,7 @@ sub_0203695C: ; 0x0203695C
bl TaskManager_GetFieldSystem
str r0, [sp, #0x4]
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
mov r0, #0xb
bl sub_020851B8
@ -3172,7 +3172,7 @@ sub_02036A14: ; 0x02036A14
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2
@ -3217,7 +3217,7 @@ sub_02036A78: ; 0x02036A78
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
mov r1, #0x7e
add r4, r0, #0x0
lsl r1, r1, #0x2
@ -3248,7 +3248,7 @@ sub_02036AB8: ; 0x02036AB8
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7f
lsl r0, r0, #0x2
@ -3281,7 +3281,7 @@ sub_02036AB8: ; 0x02036AB8
b _02036B82
_02036B0E:
ldr r0, [r6, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r7, #0x0
bl GetPartyMonByIndex
add r2, r0, #0x0
@ -3346,7 +3346,7 @@ sub_02036B90: ; 0x02036B90
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
mov r1, #0x73
add r4, r0, #0x0
lsl r1, r1, #0x2
@ -3385,7 +3385,7 @@ sub_02036BDC: ; 0x02036BDC
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7f
lsl r0, r0, #0x2
@ -3521,7 +3521,7 @@ sub_02036CEC: ; 0x02036CEC
add r4, r0, #0x0
bl memset
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_Bag_Get
@ -3585,7 +3585,7 @@ sub_02036D94: ; 0x02036D94
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2
@ -3614,7 +3614,7 @@ sub_02036DD4: ; 0x02036DD4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
mov r1, #0x73
add r4, r0, #0x0
lsl r1, r1, #0x2
@ -3640,7 +3640,7 @@ sub_02036E08: ; 0x02036E08
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2
@ -3651,7 +3651,7 @@ sub_02036E08: ; 0x02036E08
lsl r2, r0, #0x10
bl CreateHeap
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldrb r1, [r5, #0x0]
str r0, [sp, #0x20]
bl GetPartyMonByIndex
@ -3760,7 +3760,7 @@ sub_02036F1C: ; 0x02036F1C
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x7e
lsl r0, r0, #0x2

View File

@ -429,7 +429,7 @@ sub_0203797C: ; 0x0203797C
mov r2, #0x40
bl MIi_CpuClearFast
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_Bag_Get
@ -557,10 +557,10 @@ sub_02037A7C: ; 0x02037A7C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0x4
@ -587,7 +587,7 @@ _02037AB2:
b _02037B3A
_02037AC2:
add r0, r6, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _02037B3A
ldr r0, [r4, #0x4]
@ -630,7 +630,7 @@ _02037AF8:
b _02037B3A
_02037B1A:
add r0, r6, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _02037B3A
ldr r0, [r4, #0x8]
@ -755,7 +755,7 @@ sub_02037C00: ; 0x02037C00
bl AllocFromHeap
add r4, r0, #0x0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetOptionsAddr
@ -814,7 +814,7 @@ sub_02037C7C: ; 0x02037C7C
bl Save_PlayerData_GetOptionsAddr
str r0, [r4, #0x4]
add r0, r5, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
mov r0, #0x1
strb r0, [r4, #0x11]
@ -860,7 +860,7 @@ sub_02037CF0: ; 0x02037CF0
add r4, r0, #0x0
bl memset
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetOptionsAddr
@ -915,10 +915,10 @@ sub_02037D70: ; 0x02037D70
push {r3-r6, lr}
sub sp, #0x4
add r6, r0, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
add r0, r6, #0x0
bl TaskManager_GetFieldSystem
@ -938,7 +938,7 @@ _02037D9A:
str r0, [r4, #0x0]
b _02037E12
_02037DA8:
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _02037E12
ldr r0, [r4, #0x0]
@ -1261,7 +1261,7 @@ sub_0203800C: ; 0x0203800C
add r4, r0, #0x0
bl memset
add r0, r5, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r7, #0x0
bl GetPartyMonByIndex
str r0, [r4, #0x0]
@ -1298,7 +1298,7 @@ sub_02038070: ; 0x02038070
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0x0
@ -1316,7 +1316,7 @@ _0203808E:
b _020380C8
_0203809E:
add r0, r4, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _020380C8
ldr r0, [r5, #0x8]
@ -1410,7 +1410,7 @@ sub_02038144: ; 0x02038144
bl Save_PlayerData_GetProfileAddr
str r0, [r5, #0x4]
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r5, #0x8]
ldr r0, [r4, #0xc]
mov r1, #0x9
@ -1493,7 +1493,7 @@ sub_020381FC: ; 0x020381FC
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x7
@ -1803,7 +1803,7 @@ sub_0203847C: ; 0x0203847C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x3
@ -1837,7 +1837,7 @@ _020384B6:
b _02038544
_020384C8:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -1907,7 +1907,7 @@ sub_0203854C: ; 0x0203854C
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0xc]
ldr r0, [r0, #0x0]
@ -1936,7 +1936,7 @@ _02038580:
pop {r3-r5, pc}
_02038590:
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldr r1, [r4, #0x4]
bl GetPartyMonByIndex
ldr r2, [r4, #0xc]
@ -2003,7 +2003,7 @@ CreateNamingScreen: ; 0x020385CC
b _02038660
_02038620:
ldr r0, [r7, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldr r1, [r4, #0x4]
bl GetPartyMonByIndex
mov r1, #0x6f
@ -2127,7 +2127,7 @@ sub_020386E0: ; 0x020386E0
bl SaveArray_Get
str r0, [r4, #0x8]
ldr r0, [r5, #0xc]
bl GetStoragePCPointer
bl Save_PCStorage_Get
str r0, [r4, #0xc]
ldr r0, [r5, #0xc]
bl Save_Pokedex_Get
@ -2329,7 +2329,7 @@ HatchEggInParty: ; 0x020388B4
sub sp, #0x10
add r4, r0, #0x0
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl ov05_021ED49C
add r5, r0, #0x0
bne _020388CC
@ -2379,10 +2379,10 @@ sub_02038914: ; 0x02038914
bl Save_VarsFlags_Get
add r7, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r6, r0, #0x0
ldr r0, [r6, #0x0]
cmp r0, #0x0
@ -2401,7 +2401,7 @@ _02038944:
b _020389C6
_02038956:
add r0, r4, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _020389C6
ldr r0, [r4, #0xc]
@ -2556,7 +2556,7 @@ _02038AAC: .word UNK_020F2BE8
thumb_func_start sub_02038AB0
sub_02038AB0: ; 0x02038AB0
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
bl ov06_0224D79C
cmp r0, #0x1

View File

@ -891,7 +891,7 @@ sub_02038C78: ; 0x02038C78
ldr r1, _02038CA4 ; =sub_02038D48
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3-r7, pc}
nop
_02038CA4: .word sub_02038D48
@ -903,7 +903,7 @@ sub_02038CA8: ; 0x02038CA8
add r5, r1, #0x0
add r4, r2, #0x0
add r6, r3, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r2, [sp, #0x1c]
mov r1, #0x1c
add r3, r2, #0x0
@ -922,8 +922,8 @@ sub_02038CA8: ; 0x02038CA8
pop {r4-r6, pc}
.balign 4
thumb_func_start sub_02038CD8
sub_02038CD8: ; 0x02038CD8
thumb_func_start QueueScript
QueueScript: ; 0x02038CD8
push {r4-r7, lr}
sub sp, #0xc
add r6, r0, #0x0
@ -949,8 +949,8 @@ sub_02038CD8: ; 0x02038CD8
.balign 4
_02038D0C: .word sub_02038D48
thumb_func_start sub_02038D10
sub_02038D10: ; 0x02038D10
thumb_func_start StartScriptFromMenu
StartScriptFromMenu: ; 0x02038D10
push {r3-r7, lr}
sub sp, #0x8
add r5, r0, #0x0
@ -970,7 +970,7 @@ sub_02038D10: ; 0x02038D10
ldr r1, _02038D44 ; =sub_02038D48
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463EC
bl TaskManager_Jump
add sp, #0x8
pop {r3-r7, pc}
.balign 4
@ -981,7 +981,7 @@ sub_02038D48: ; 0x02038D48
push {r3-r7, lr}
sub sp, #0x8
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -1874,7 +1874,7 @@ FieldSysGetAttrAddr: ; 0x02039438
push {r3-r5, lr}
ldr r0, [r0, #0x10]
add r5, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
ldr r0, _0203945C ; =0x0003643F
@ -1894,7 +1894,7 @@ sub_02039460: ; 0x02039460
push {r3-r5, lr}
add r5, r0, #0x0
ldr r0, [r5, #0x10]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_02035068

View File

@ -41,7 +41,7 @@ sub_02046068: ; 0x02046068
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
@ -80,7 +80,7 @@ _020460AE:
mov r1, #0x1
bl sub_0206367C
add r0, r6, #0x0
bl sub_0204AFC8
bl CallTask_FadeToBlack
ldrb r0, [r4, #0x8]
add r0, r0, #0x1
strb r0, [r4, #0x8]
@ -113,7 +113,7 @@ _020460E2:
b _020461F8
_0204610A:
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldrb r0, [r4, #0x8]
add r0, r0, #0x1
strb r0, [r4, #0x8]
@ -200,7 +200,7 @@ _02046198:
b _020461F8
_020461C0:
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldrb r0, [r4, #0x8]
add r0, r0, #0x1
strb r0, [r4, #0x8]
@ -210,7 +210,7 @@ _020461CE:
mov r1, #0x0
bl sub_02046214
add r0, r6, #0x0
bl sub_0204B00C
bl CallTask_FadeFromBlack
ldrb r0, [r4, #0x8]
add r0, r0, #0x1
strb r0, [r4, #0x8]

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,8 @@ UNK_020F45F8: ; 0x020F45F8
.text
thumb_func_start sub_020476CC
sub_020476CC: ; 0x020476CC
thumb_func_start BattleSetup_New
BattleSetup_New: ; 0x020476CC
push {r3-r7, lr}
add r4, r1, #0x0
mov r1, #0x67
@ -156,7 +156,7 @@ sub_020477EC: ; 0x020477EC
push {r4, lr}
add r4, r1, #0x0
mov r1, #0x20
bl sub_020476CC
bl BattleSetup_New
mov r1, #0x19
lsl r1, r1, #0x4
str r4, [r0, r1]
@ -169,7 +169,7 @@ sub_02047800: ; 0x02047800
add r4, r1, #0x0
mov r1, #0x2
lsl r1, r1, #0x8
bl sub_020476CC
bl BattleSetup_New
mov r1, #0x19
lsl r1, r1, #0x4
str r4, [r0, r1]
@ -190,7 +190,7 @@ sub_02047814: ; 0x02047814
str r0, [sp, #0x14]
add r0, r6, #0x0
lsl r1, r1, #0xa
bl sub_020476CC
bl BattleSetup_New
add r4, r0, #0x0
ldr r2, _0204795C ; =0x000001F1
mov r0, #0x1
@ -285,7 +285,7 @@ sub_02047814: ; 0x02047814
add r0, r6, #0x0
bl FreeToHeap
ldr r0, [r5, #0xc]
bl GetStoragePCPointer
bl Save_PCStorage_Get
mov r1, #0x45
lsl r1, r1, #0x2
str r0, [r4, r1]
@ -317,8 +317,8 @@ sub_02047814: ; 0x02047814
_0204795C: .word 0x000001F1
_02047960: .word 0x0000018F
thumb_func_start sub_02047964
sub_02047964: ; 0x02047964
thumb_func_start BattleSetup_Delete
BattleSetup_Delete: ; 0x02047964
push {r3-r7, lr}
add r7, r0, #0x0
mov r4, #0x0
@ -427,7 +427,7 @@ _02047A34:
add r1, r5, r1
ldr r1, [r1, #0x4]
add r0, r6, #0x0
bl CopyPlayerParty
bl CopyParty
pop {r4-r6, pc}
.balign 4
@ -471,7 +471,7 @@ sub_02047A78: ; 0x02047A78
bl Save_PlayerData_GetProfileAddr
add r6, r0, #0x0
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r7, r0, #0x0
ldr r0, [r4, #0xc]
bl Save_Bag_Get
@ -519,7 +519,7 @@ sub_02047A78: ; 0x02047A78
mov r2, #0x0
bl sub_02047A64
ldr r0, [r4, #0xc]
bl GetStoragePCPointer
bl Save_PCStorage_Get
mov r1, #0x45
lsl r1, r1, #0x2
str r0, [r5, r1]
@ -594,8 +594,8 @@ sub_02047A78: ; 0x02047A78
pop {r4-r7, pc}
.balign 4
thumb_func_start sub_02047BB0
sub_02047BB0: ; 0x02047BB0
thumb_func_start BattleSetup_InitFromFieldSystem
BattleSetup_InitFromFieldSystem: ; 0x02047BB0
push {r4, lr}
add r4, r0, #0x0
bl sub_02047A78
@ -616,7 +616,7 @@ sub_02047BC0: ; 0x02047BC0
add r4, r0, #0x0
ldr r0, [sp, #0x0]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0x14]
ldr r0, [sp, #0x0]
ldr r0, [r0, #0xc]
@ -719,7 +719,7 @@ _02047C98:
bl sub_02047A64
ldr r0, [sp, #0x0]
ldr r0, [r0, #0xc]
bl GetStoragePCPointer
bl Save_PCStorage_Get
mov r1, #0x45
lsl r1, r1, #0x2
str r0, [r6, r1]
@ -903,7 +903,7 @@ _02047E2C:
bl sub_02047A64
ldr r0, [sp, #0x0]
ldr r0, [r0, #0xc]
bl GetStoragePCPointer
bl Save_PCStorage_Get
mov r1, #0x45
lsl r1, r1, #0x2
str r0, [r5, r1]
@ -995,7 +995,7 @@ sub_02047F1C: ; 0x02047F1C
add r5, r0, #0x0
ldr r0, [r4, #0xc]
add r6, r2, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r2, r0, #0x0
add r0, r5, #0x0
add r1, r4, #0x0
@ -1013,7 +1013,7 @@ sub_02047F38: ; 0x02047F38
bl Save_PlayerData_GetProfileAddr
add r6, r0, #0x0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r7, r0, #0x0
ldr r0, [r5, #0xc]
bl Save_Bag_Get
@ -1032,7 +1032,7 @@ sub_02047F38: ; 0x02047F38
bl PlayerProfile_Copy
ldr r0, [r4, #0x4]
add r1, r7, #0x0
bl CopyPlayerParty
bl CopyParty
mov r0, #0x42
lsl r0, r0, #0x2
ldr r0, [r4, r0]
@ -1058,7 +1058,7 @@ sub_02047FA4: ; 0x02047FA4
ldr r0, [r5, #0xc]
bl Save_PlayerData_GetProfileAddr
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldr r0, [r5, #0xc]
bl Save_Bag_Get
ldr r0, [r5, #0xc]
@ -1191,8 +1191,8 @@ sub_020480AC: ; 0x020480AC
bx lr
.balign 4
thumb_func_start sub_020480B8
sub_020480B8: ; 0x020480B8
thumb_func_start IsBattleResultWin
IsBattleResultWin: ; 0x020480B8
cmp r0, #0x2
beq _020480C0
cmp r0, #0x3

View File

@ -137,7 +137,7 @@ _02048210: .word sub_02048214
sub_02048214: ; 0x02048214
push {r3-r4, lr}
sub sp, #0xc
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x4
@ -313,7 +313,7 @@ FieldTask_BlackOut: ; 0x0204837C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x6
@ -391,7 +391,7 @@ _0204840C:
b _02048488
_02048434:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -412,14 +412,14 @@ _02048442:
ldr r1, _02048490 ; =0x000007E4
add r0, r5, #0x0
add r3, r2, #0x0
bl sub_02038CD8
bl QueueScript
b _0204847A
_0204846E:
mov r2, #0x0
ldr r1, _02048494 ; =0x000007E5
add r0, r5, #0x0
add r3, r2, #0x0
bl sub_02038CD8
bl QueueScript
_0204847A:
ldr r0, [r4, #0x0]
add r0, r0, #0x1

View File

@ -41,7 +41,7 @@ _020484C6:
bl Save_HOF_Init
_020484CC:
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r6, r0, #0x0
add r0, sp, #0x4
bl GF_RTC_CopyDate
@ -66,10 +66,10 @@ sub_020484F8: ; 0x020484F8
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x9
@ -101,7 +101,7 @@ _0204853A:
b _02048688
_0204854A:
add r0, r6, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
beq _02048556
_02048554:
@ -158,7 +158,7 @@ _020485AE:
b _02048688
_020485C0:
ldr r0, [r6, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl HealParty
bl Save_SetDirtyBit
ldr r0, [r6, #0xc]
@ -234,7 +234,7 @@ _02048644:
b _02048688
_02048666:
add r0, r6, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _02048688
add r0, r5, #0x0
@ -285,7 +285,7 @@ CallTask_GameClear: ; 0x02048694
bl Save_PlayerData_GetProfileAddr
str r0, [r5, #0x4]
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r5, #0x8]
ldr r0, [r4, #0xc]
bl Save_PlayerData_GetIGTAddr
@ -308,7 +308,7 @@ CallTask_GameClear: ; 0x02048694
bl Script_SavRTC_DateTimeTox2C
_0204871E:
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl GiveAllMonsTheSinnohChampRibbon
ldr r0, [sp, #0x8]
bl sub_020377B0

View File

@ -554,7 +554,7 @@ sub_02048D34: ; 0x02048D34
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
@ -603,7 +603,7 @@ sub_02048D90: ; 0x02048D90
ldr r1, _02048DA8 ; =sub_02048D34
add r0, r4, #0x0
mov r2, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r4, pc}
.balign 4
_02048DA8: .word sub_02048D34
@ -618,7 +618,7 @@ sub_02048DAC: ; 0x02048DAC
bl Save_VarsFlags_Get
add r6, r0, #0x0
add r0, r7, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0x4
@ -724,7 +724,7 @@ _02048EB0:
pop {r3-r7, pc}
_02048EB4:
add r0, r4, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _02048EC2
mov r0, #0x1
@ -736,13 +736,13 @@ _02048EC2:
thumb_func_start sub_02048EC8
sub_02048EC8: ; 0x02048EC8
ldr r3, _02048ED4 ; =sub_020463CC
ldr r3, _02048ED4 ; =FieldSystem_CreateTask
mov r2, #0x0
str r2, [r0, #0x6c]
ldr r1, _02048ED8 ; =sub_02048DAC
bx r3
nop
_02048ED4: .word sub_020463CC
_02048ED4: .word FieldSystem_CreateTask
_02048ED8: .word sub_02048DAC
thumb_func_start sub_02048EDC
@ -752,13 +752,13 @@ sub_02048EDC: ; 0x02048EDC
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
str r0, [sp, #0x0]
add r0, r7, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0x5
@ -823,7 +823,7 @@ _02048F7E:
bl sub_02052EE8
str r0, [r4, #0x7c]
add r0, r7, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r5, #0x0]
add r0, r0, #0x1
str r0, [r5, #0x0]
@ -899,7 +899,7 @@ _02049000:
str r0, [r4, #0x6c]
ldr r1, _02049034 ; =sub_02048EDC
add r0, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3-r5, pc}
nop
_02049030: .word 0x000001D2
@ -912,7 +912,7 @@ sub_02049038: ; 0x02049038
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x3
@ -1003,7 +1003,7 @@ sub_020490F0: ; 0x020490F0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
@ -1107,7 +1107,7 @@ sub_020491C4: ; 0x020491C4
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x3
@ -1149,7 +1149,7 @@ _02049216:
add r0, r6, #0x0
bl sub_0204AD8C
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -1219,7 +1219,7 @@ sub_02049274: ; 0x02049274
ldr r1, _020492B8 ; =sub_02049304
str r0, [r3, #0x0]
add r0, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #0x14
pop {r4-r5, pc}
nop
@ -1255,7 +1255,7 @@ sub_020492BC: ; 0x020492BC
ldr r1, _02049300 ; =sub_02049304
str r0, [r3, #0x0]
add r0, r4, #0x0
bl sub_020463EC
bl TaskManager_Jump
add sp, #0x14
pop {r4-r5, pc}
nop
@ -1268,7 +1268,7 @@ sub_02049304: ; 0x02049304
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r5, r4, #0x0
ldr r1, [r4, #0x0]
@ -1345,7 +1345,7 @@ _020493A0: .word sub_020493A4
sub_020493A4: ; 0x020493A4
push {r3-r5, lr}
add r5, r0, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
@ -1371,7 +1371,7 @@ _020493CC:
sub_020493D0: ; 0x020493D0
push {r4, lr}
add r4, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r2, r0, #0x0
ldr r1, _020493E4 ; =sub_020493E8
add r0, r4, #0x0
@ -1384,7 +1384,7 @@ _020493E4: .word sub_020493E8
sub_020493E8: ; 0x020493E8
push {r3-r5, lr}
add r5, r0, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -1398,7 +1398,7 @@ sub_020493E8: ; 0x020493E8
b _0204942C
_02049408:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -1425,7 +1425,7 @@ sub_02049430: ; 0x02049430
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0203739C
@ -1451,7 +1451,7 @@ _02049470: .word sub_02049474
thumb_func_start sub_02049474
sub_02049474: ; 0x02049474
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
bl ov06_022483E0
@ -1489,7 +1489,7 @@ sub_02049494: ; 0x02049494
ldr r1, _020494C8 ; =sub_020494CC
str r0, [r3, #0x0]
add r0, r6, #0x0
bl sub_020463EC
bl TaskManager_Jump
pop {r4-r6, pc}
.balign 4
_020494C8: .word sub_020494CC
@ -1501,7 +1501,7 @@ sub_020494CC: ; 0x020494CC
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r6, r4, #0x0
ldr r1, [r4, #0x0]
@ -1591,7 +1591,7 @@ _02049580: .word sub_02049584
sub_02049584: ; 0x02049584
push {r3-r5, lr}
add r5, r0, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
@ -1617,7 +1617,7 @@ _020495AC:
sub_020495B0: ; 0x020495B0
push {r4, lr}
add r4, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r2, r0, #0x0
ldr r1, _020495C4 ; =sub_020495C8
add r0, r4, #0x0
@ -1630,13 +1630,13 @@ _020495C4: .word sub_020495C8
sub_020495C8: ; 0x020495C8
push {r4-r6, lr}
add r5, r0, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r0, [r4, #0x0]
cmp r0, #0x0
beq _020495F0
@ -1647,7 +1647,7 @@ sub_020495C8: ; 0x020495C8
b _02049616
_020495F0:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -1676,7 +1676,7 @@ sub_0204961C: ; 0x0204961C
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_0203739C
@ -1704,7 +1704,7 @@ sub_02049658: ; 0x02049658
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r5, r4, #0x0
ldr r1, [r4, #0x0]
@ -1763,7 +1763,7 @@ _020496CC:
add r0, r7, #0x0
bl sub_0204AD8C
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -1828,7 +1828,7 @@ sub_02049718: ; 0x02049718
str r0, [r2, #0x0]
add r0, r5, #0x0
add r2, r7, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #0x14
pop {r4-r7, pc}
nop
@ -1943,7 +1943,7 @@ sub_02049824: ; 0x02049824
add r1, r0, #0x0
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
_02049840:
pop {r3-r5, pc}
.balign 4
@ -1956,7 +1956,7 @@ sub_02049844: ; 0x02049844
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0xc
@ -2088,7 +2088,7 @@ _0204995E:
ldr r1, _02049AC0 ; =0x000007F2
add r0, r6, #0x0
add r3, r2, #0x0
bl sub_02038CD8
bl QueueScript
b _0204999C
_02049976:
ldr r0, [r5, #0xc]
@ -2105,7 +2105,7 @@ _02049976:
add r0, r6, #0x0
add r3, #0x1c
strh r2, [r4, #0x1c]
bl sub_02038CD8
bl QueueScript
_0204999C:
mov r0, #0x4
str r0, [r4, #0x0]
@ -2135,7 +2135,7 @@ _020499CA:
b _02049AB2
_020499D0:
ldr r0, [r5, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
add r0, r4, #0x0
bl FreeToHeap
add sp, #0x8
@ -2196,7 +2196,7 @@ _02049A42:
add r0, r5, #0x0
bl sub_0204AB44
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -2254,7 +2254,7 @@ sub_02049ACC: ; 0x02049ACC
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x7
@ -2354,7 +2354,7 @@ _02049B9C:
add r0, r5, #0x0
bl sub_0204AB44
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -2410,7 +2410,7 @@ sub_02049C0C: ; 0x02049C0C
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
mov r5, #0x0
@ -2448,7 +2448,7 @@ sub_02049C54: ; 0x02049C54
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
@ -2529,10 +2529,10 @@ sub_02049CF8: ; 0x02049CF8
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x5
@ -2584,14 +2584,14 @@ _02049D60:
b _02049D98
_02049D72:
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
b _02049D98
_02049D80:
add r0, r6, #0x0
bl sub_0204B00C
bl CallTask_FadeFromBlack
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -2637,7 +2637,7 @@ sub_02049D9C: ; 0x02049D9C
ldr r1, _02049DF0 ; =sub_02049CF8
add r0, r5, #0x0
add r2, r6, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
str r0, [r5, #0x78]
pop {r4-r6, pc}
@ -2651,10 +2651,10 @@ sub_02049DF4: ; 0x02049DF4
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x6
@ -2679,7 +2679,7 @@ _02049E2E:
mov r2, #0x0
bl sub_0204ACA8
add r0, r6, #0x0
bl sub_0204AFC8
bl CallTask_FadeToBlack
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -2702,7 +2702,7 @@ _02049E54:
b _02049E9E
_02049E66:
add r0, r6, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -2788,7 +2788,7 @@ sub_02049F10: ; 0x02049F10
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x3
@ -2832,7 +2832,7 @@ _02049F68:
add r0, r6, #0x0
bl sub_0204AD8C
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]

View File

@ -657,7 +657,7 @@ sub_0204B818: ; 0x0204B818
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x4

View File

@ -485,7 +485,7 @@ sub_0204BD40: ; 0x0204BD40
bl sub_02047800
add r1, r5, #0x0
add r7, r0, #0x0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
ldr r0, [sp, #0x0]
ldr r1, [r6, #0x3c]
add r2, r4, #0x0

View File

@ -60,7 +60,7 @@ sub_0204C1F4: ; 0x0204C1F4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x0]
cmp r0, #0x0
@ -130,7 +130,7 @@ sub_0204C260: ; 0x0204C260
ldr r0, [sp, #0x20]
str r0, [r2, #0x20]
add r0, r7, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3-r7, pc}
nop
_0204C298: .word sub_0204C380
@ -238,7 +238,7 @@ _0204C36A:
add r0, r7, #0x0
add r2, r6, #0x0
str r4, [r6, #0x20]
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #0xc
pop {r4-r7, pc}
nop
@ -251,7 +251,7 @@ sub_0204C380: ; 0x0204C380
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r6, r4, #0x0
ldr r1, [r4, #0x0]
@ -306,7 +306,7 @@ _0204C3E8:
b _0204C458
_0204C3F8:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]
@ -365,7 +365,7 @@ sub_0204C468: ; 0x0204C468
add r5, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x0
@ -377,7 +377,7 @@ _0204C484:
ldr r0, _0204C4A0 ; =0x00000603
bl PlaySE
add r0, r5, #0x0
bl sub_0204AFC8
bl CallTask_FadeToBlack
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]
@ -398,7 +398,7 @@ sub_0204C4A4: ; 0x0204C4A4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x3
@ -444,7 +444,7 @@ _0204C4F6:
b _0204C522
_0204C510:
add r0, r6, #0x0
bl sub_0204AFC8
bl CallTask_FadeToBlack
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]
@ -464,7 +464,7 @@ sub_0204C528: ; 0x0204C528
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x0
@ -522,7 +522,7 @@ sub_0204C5A0: ; 0x0204C5A0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x3
@ -603,7 +603,7 @@ sub_0204C644: ; 0x0204C644
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r6, #0x38]
bl PlayerAvatar_GetMapObject
@ -639,7 +639,7 @@ sub_0204C68C: ; 0x0204C68C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r6, #0x38]
bl PlayerAvatar_GetMapObject
@ -675,7 +675,7 @@ sub_0204C6D4: ; 0x0204C6D4
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r0, [r5, #0x4]
cmp r0, #0x3
@ -769,7 +769,7 @@ sub_0204C7A0: ; 0x0204C7A0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x0
@ -801,7 +801,7 @@ _0204C7BE:
ldr r1, _0204C81C ; =sub_0204C6D4
add r0, r6, #0x0
add r2, r4, #0x0
bl sub_020463EC
bl TaskManager_Jump
b _0204C818
_0204C7FE:
bl ov05_021DB030
@ -830,7 +830,7 @@ sub_0204C824: ; 0x0204C824
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x0
@ -888,7 +888,7 @@ sub_0204C89C: ; 0x0204C89C
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x3
@ -968,7 +968,7 @@ sub_0204C93C: ; 0x0204C93C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r6, #0x38]
bl PlayerAvatar_GetMapObject

View File

@ -1762,7 +1762,7 @@ sub_02050968: ; 0x02050968
ldr r1, [r1, #0x0]
add r0, r4, #0x0
ldr r1, [r1, #0x44]
bl CopyPlayerParty
bl CopyParty
_02050986:
cmp r5, #0x0
beq _02050994

View File

@ -94,7 +94,7 @@ sub_02050ED4: ; 0x02050ED4
str r0, [r4, #0x14]
ldr r0, [r5, #0x24]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0x24]
ldr r0, [r0, #0xc]
@ -198,7 +198,7 @@ sub_02050FC8: ; 0x02050FC8
push {r4, lr}
add r4, r0, #0x0
add r0, r1, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
beq _02050FDA
mov r0, #0x0
@ -246,7 +246,7 @@ sub_02051020: ; 0x02051020
push {r4, lr}
add r4, r0, #0x0
add r0, r1, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
beq _02051032
mov r0, #0x0
@ -311,7 +311,7 @@ sub_02051094: ; 0x02051094
push {r3-r5, lr}
sub sp, #0x8
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -627,7 +627,7 @@ _02051308:
_0205130E:
ldr r0, [r4, #0x24]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r2, r0, #0x0
mov r0, #0x0
str r0, [sp, #0x0]
@ -1408,7 +1408,7 @@ _02051988:
ldr r1, _02051994 ; =sub_02051094
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
_02051992:
pop {r4-r6, pc}
.balign 4
@ -1451,11 +1451,11 @@ _020519BA:
thumb_func_start sub_020519E4
sub_020519E4: ; 0x020519E4
ldr r3, _020519EC ; =sub_0204652C
ldr r3, _020519EC ; =TaskManager_GetEnvironment
ldr r0, [r0, #0x10]
bx r3
nop
_020519EC: .word sub_0204652C
_020519EC: .word TaskManager_GetEnvironment
thumb_func_start sub_020519F0
sub_020519F0: ; 0x020519F0
@ -1464,7 +1464,7 @@ sub_020519F0: ; 0x020519F0
ldr r0, [r7, #0x24]
add r5, r1, #0x0
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0x0]
ldr r4, [r7, #0x4c]
bl sub_020690C4
@ -2095,7 +2095,7 @@ sub_02051EB0: ; 0x02051EB0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r1, #0x0
ldr r0, [r4, #0x24]
@ -2230,7 +2230,7 @@ _02051FDC:
b _0205203A
_02051FEC:
add r0, r5, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _0205203A
ldr r0, [r4, #0x28]
@ -2306,7 +2306,7 @@ _02052066:
str r0, [r2, #0x28]
ldr r0, [sp, #0x0]
ldr r1, _020520A8 ; =sub_02051EB0
bl sub_020463CC
bl FieldSystem_CreateTask
bl sub_02037760
pop {r3-r7, pc}
_0205209C:

View File

@ -288,7 +288,7 @@ _02054DE8: .word 0x0000010D
sub_02054DEC: ; 0x02054DEC
push {r3-r7, lr}
add r6, r0, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl GetPartyCount
lsl r0, r0, #0x10
lsr r5, r0, #0x10
@ -297,7 +297,7 @@ sub_02054DEC: ; 0x02054DEC
mov r7, #0x4c
_02054E02:
add r0, r6, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r4, #0x0
bl GetPartyMonByIndex
add r1, r7, #0x0
@ -324,7 +324,7 @@ Save_PlayerHasAllRegisInParty: ; 0x02054E30
push {r3-r7, lr}
sub sp, #0x10
mov r7, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0x0]
bl GetPartyCount
add r4, r0, #0x0
@ -388,7 +388,7 @@ sub_02054EA0: ; 0x02054EA0
add r4, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0x2
lsl r0, r0, #0xe
@ -538,7 +538,7 @@ sub_02054FE4: ; 0x02054FE4
add r4, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldrb r1, [r4, #0x9]
ldr r0, [r4, #0x0]

View File

@ -2734,8 +2734,8 @@ sub_02058774: ; 0x02058774
nop
_0205877C: .word sub_02058384
thumb_func_start sub_02058780
sub_02058780: ; 0x02058780
thumb_func_start MapObjectManager_PauseAllMovement
MapObjectManager_PauseAllMovement: ; 0x02058780
push {r4-r6, lr}
add r5, r0, #0x0
bl sub_02058368
@ -2759,8 +2759,8 @@ _020587A6:
pop {r4-r6, pc}
.balign 4
thumb_func_start sub_020587B0
sub_020587B0: ; 0x020587B0
thumb_func_start MapObjectManager_UnpauseAllMovement
MapObjectManager_UnpauseAllMovement: ; 0x020587B0
push {r4-r6, lr}
add r5, r0, #0x0
bl sub_02058368

View File

@ -76,7 +76,7 @@ sub_0205CE80: ; 0x0205CE80
str r0, [r5, #0x0]
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
str r0, [r5, #0x4]
ldr r0, [r4, #0x38]
bl PlayerAvatar_GetState
@ -165,7 +165,7 @@ sub_0205CF34: ; 0x0205CF34
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r7, #0x0
bl sub_0204649C
@ -202,7 +202,7 @@ sub_0205CF78: ; 0x0205CF78
add r2, r0, #0x0
ldr r0, [r4, #0x0]
ldr r1, _0205CF9C ; =sub_0205CFA0
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #0x4
pop {r3-r4, pc}
nop
@ -215,10 +215,10 @@ sub_0205CFA0: ; 0x0205CFA0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r7, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r6, r0, #0x0
ldr r0, [r6, #0x0]
cmp r0, #0x0
@ -236,7 +236,7 @@ _0205CFC6:
add r0, r7, #0x0
lsr r1, r1, #0x10
mov r3, #0x0
bl sub_02038CD8
bl QueueScript
add r0, r5, #0x0
mov r1, #0x29
bl FieldSysGetAttrAddr
@ -278,7 +278,7 @@ sub_0205D024: ; 0x0205D024
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r6, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r7, r0, #0x0
mov r0, #0xb
mov r1, #0x40
@ -288,7 +288,7 @@ sub_0205D024: ; 0x0205D024
add r4, r0, #0x0
bl memset
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_Bag_Get
@ -344,7 +344,7 @@ sub_0205D0BC: ; 0x0205D0BC
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_02037EB8
@ -383,7 +383,7 @@ sub_0205D104: ; 0x0205D104
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204649C
@ -414,11 +414,11 @@ sub_0205D144: ; 0x0205D144
add r4, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
ldr r0, [r5, #0x0]
ldr r1, _0205D16C ; =sub_02049844
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
ldr r1, [r5, #0x0]
mov r0, #0x0
add r1, #0x8c
@ -458,7 +458,7 @@ _0205D1A4:
ldr r0, [r5, #0x18]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
beq _0205D1C4
ldr r0, [r5, #0x18]
@ -520,7 +520,7 @@ sub_0205D21C: ; 0x0205D21C
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204649C
@ -543,7 +543,7 @@ sub_0205D250: ; 0x0205D250
ldr r0, [r0, #0x0]
ldr r1, _0205D260 ; =sub_0205D264
mov r2, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
pop {r3, pc}
.balign 4
@ -556,7 +556,7 @@ sub_0205D264: ; 0x0205D264
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0x3
@ -633,7 +633,7 @@ _0205D314:
b _0205D324
_0205D31A:
ldr r0, [r4, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
mov r0, #0x1
pop {r3-r5, pc}
_0205D324:
@ -723,7 +723,7 @@ sub_0205D3B8: ; 0x0205D3B8
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
mov r1, #0x0
@ -761,7 +761,7 @@ sub_0205D400: ; 0x0205D400
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r6, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r7, r0, #0x0
mov r0, #0xb
mov r1, #0x40
@ -771,7 +771,7 @@ sub_0205D400: ; 0x0205D400
add r4, r0, #0x0
bl memset
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_Bag_Get
@ -827,7 +827,7 @@ sub_0205D498: ; 0x0205D498
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldrh r0, [r5, #0x4]
bl ItemToMailId
@ -866,7 +866,7 @@ sub_0205D4E8: ; 0x0205D4E8
add r4, r1, #0x0
bl TaskManager_GetFieldSystem
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
ldrh r1, [r4, #0x10]
mov r0, #0x1
tst r0, r1
@ -902,7 +902,7 @@ sub_0205D528: ; 0x0205D528
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
mov r1, #0xb
@ -943,7 +943,7 @@ sub_0205D574: ; 0x0205D574
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r5, #0xc]
add r0, r5, #0x0
@ -985,7 +985,7 @@ sub_0205D5C4: ; 0x0205D5C4
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
mov r0, #0xb
mov r1, #0x4
@ -1019,7 +1019,7 @@ sub_0205D604: ; 0x0205D604
str r0, [r2, #0x0]
ldr r0, [r4, #0x0]
ldr r1, _0205D624 ; =sub_0205E30C
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
pop {r4, pc}
nop
@ -1124,7 +1124,7 @@ sub_0205D6BC: ; 0x0205D6BC
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204649C
@ -1197,7 +1197,7 @@ sub_0205D74C: ; 0x0205D74C
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204649C
@ -1229,7 +1229,7 @@ sub_0205D788: ; 0x0205D788
add r2, r0, #0x0
ldr r0, [r4, #0x0]
ldr r1, _0205D7A4 ; =ov05_021F5C70
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
pop {r4, pc}
.balign 4
@ -1243,7 +1243,7 @@ sub_0205D7A8: ; 0x0205D7A8
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204649C
@ -1275,7 +1275,7 @@ sub_0205D7E4: ; 0x0205D7E4
add r2, r0, #0x0
ldr r0, [r4, #0x0]
ldr r1, _0205D800 ; =ov05_021F5C70
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
pop {r4, pc}
.balign 4
@ -1289,7 +1289,7 @@ sub_0205D804: ; 0x0205D804
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r4, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204649C
@ -1321,7 +1321,7 @@ sub_0205D840: ; 0x0205D840
add r2, r0, #0x0
ldr r0, [r4, #0x0]
ldr r1, _0205D85C ; =ov05_021F5C70
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
pop {r4, pc}
.balign 4
@ -1402,7 +1402,7 @@ sub_0205D8B8: ; 0x0205D8B8
ldr r0, [r5, #0x0]
ldr r1, _0205D900 ; =sub_0205D904
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
mov r0, #0x0
pop {r3-r5, pc}
.balign 4
@ -1415,7 +1415,7 @@ sub_0205D904: ; 0x0205D904
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldrh r0, [r4, #0x16]
cmp r0, #0x0
@ -1427,7 +1427,7 @@ sub_0205D904: ; 0x0205D904
b _0205D9A0
_0205D926:
ldr r0, [r5, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
ldr r0, [r5, #0x8]
add r1, r4, #0x0
mov r2, #0x3
@ -1469,7 +1469,7 @@ _0205D95C:
b _0205D9A0
_0205D984:
ldr r0, [r5, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
add r0, r4, #0x0
bl RemoveWindow
ldr r0, [r4, #0x10]
@ -1492,7 +1492,7 @@ sub_0205D9A8: ; 0x0205D9A8
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r6, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r7, r0, #0x0
mov r0, #0xb
mov r1, #0x40
@ -1502,7 +1502,7 @@ sub_0205D9A8: ; 0x0205D9A8
add r4, r0, #0x0
bl memset
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
ldr r0, [r5, #0xc]
bl Save_Bag_Get
@ -1557,7 +1557,7 @@ sub_0205DA3C: ; 0x0205DA3C
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204649C
@ -1615,7 +1615,7 @@ sub_0205DAAC: ; 0x0205DAAC
add r2, r0, #0x0
ldr r1, _0205DAC8 ; =0x0224C721
add r0, r4, #0x0
bl sub_020463EC
bl TaskManager_Jump
mov r0, #0x0
pop {r4, pc}
.balign 4
@ -1796,7 +1796,7 @@ sub_0205DBF0: ; 0x0205DBF0
ldr r0, [r5, #0x0]
ldr r1, _0205DC34 ; =sub_0205D904
add r2, r4, #0x0
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #0x4
pop {r3-r6, pc}
.balign 4
@ -1809,7 +1809,7 @@ sub_0205DC38: ; 0x0205DC38
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, #0x2a
ldrb r0, [r0, #0x0]
@ -1829,7 +1829,7 @@ _0205DC5E: ; jump table (using 16-bit offset)
.short _0205DCE2 - _0205DC5E - 2; case 4
_0205DC68:
ldr r0, [r5, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
mov r0, #0x0
bl ov05_021D7CA4
mov r0, #0x1
@ -1850,7 +1850,7 @@ _0205DC7C:
b _0205DCFA
_0205DC94:
add r0, r5, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _0205DCFA
ldr r0, [r4, #0x24]
@ -1877,7 +1877,7 @@ _0205DCC4:
cmp r0, #0x0
beq _0205DCFA
ldr r0, [r5, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
mov r0, #0x1
bl ov05_021D7CA4
mov r0, #0x4
@ -1889,7 +1889,7 @@ _0205DCE2:
cmp r0, #0x0
beq _0205DCFA
ldr r0, [r5, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
add r0, r4, #0x0
bl FreeToHeap
mov r0, #0x1
@ -1904,10 +1904,10 @@ _0205DD00: .word sub_0205D568
sub_0205DD04: ; 0x0205DD04
add r2, r0, #0x0
str r1, [r2, #0x20]
ldr r3, _0205DD10 ; =sub_020463CC
ldr r3, _0205DD10 ; =FieldSystem_CreateTask
ldr r0, [r2, #0x0]
ldr r1, _0205DD14 ; =sub_0205DC38
bx r3
.balign 4
_0205DD10: .word sub_020463CC
_0205DD10: .word FieldSystem_CreateTask
_0205DD14: .word sub_0205DC38

View File

@ -836,7 +836,7 @@ sub_0205E30C: ; 0x0205E30C
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r7, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r1, [r5, #0x0]
cmp r1, #0x4
@ -855,7 +855,7 @@ _0205E330: ; jump table (using 16-bit offset)
.short _0205E3DE - _0205E330 - 2; case 4
_0205E33A:
ldr r0, [r4, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
ldr r0, [r4, #0xc]
bl Save_Roamers_Get
bl sub_0202AB40
@ -867,7 +867,7 @@ _0205E33A:
ldr r1, _0205E400 ; =0x0000230A
add r0, r7, #0x0
add r3, r2, #0x0
bl sub_02038CD8
bl QueueScript
add r0, r4, #0x0
mov r1, #0x29
bl FieldSysGetAttrAddr
@ -931,7 +931,7 @@ _0205E3CC:
_0205E3DE:
bl FreeToHeap
ldr r0, [r4, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
mov r0, #0x1
pop {r3-r7, pc}
_0205E3EC:
@ -939,7 +939,7 @@ _0205E3EC:
ldr r1, _0205E408 ; =0x0000230B
add r0, r7, #0x0
add r3, r2, #0x0
bl sub_02038CD8
bl QueueScript
mov r0, #0x4
str r0, [r5, #0x0]
_0205E3FC:

View File

@ -15,7 +15,7 @@ sub_020606B0: ; 0x020606B0
add r4, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r2, r0, #0x0
ldr r1, _020606CC ; =UNK_020F7630
add r0, r4, #0x0
@ -33,7 +33,7 @@ sub_020606D0: ; 0x020606D0
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x6
@ -73,7 +73,7 @@ _02060704:
b _0206078A
_0206072C:
add r0, r5, #0x0
bl sub_0204AFC8
bl CallTask_FadeToBlack
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]
@ -94,14 +94,14 @@ _02060748:
b _0206078A
_02060756:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]
b _0206078A
_02060764:
add r0, r5, #0x0
bl sub_0204B00C
bl CallTask_FadeFromBlack
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]

View File

@ -195,10 +195,10 @@ sub_02060948: ; 0x02060948
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_02046530
bl TaskManager_GetStatePtr
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0x0
@ -215,7 +215,7 @@ _02060972:
b _02060994
_0206097C:
add r0, r4, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
beq _02060994
mov r0, #0x0
@ -241,7 +241,7 @@ sub_020609A0: ; 0x020609A0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldrb r1, [r4, #0x0]
cmp r1, #0x7

View File

@ -2172,7 +2172,7 @@ sub_02061C5C: ; 0x02061C5C
add r5, r0, #0x0
ldr r0, [r5, #0xc]
add r4, r1, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl GetFirstNonEggInParty
add r1, sp, #0x8
add r2, sp, #0x4

View File

@ -1963,7 +1963,7 @@ sub_02063524: ; 0x02063524
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r2, [r4, #0x0]
ldr r1, [r4, #0x8]

View File

@ -33,7 +33,7 @@ sub_02063684: ; 0x02063684
strh r1, [r0, #0x0]
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x0
bne _020636DA
ldr r0, [r5, #0xc]

View File

@ -39,7 +39,7 @@ sub_020638BC: ; 0x020638BC
add r5, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x0

View File

@ -233,7 +233,7 @@ sub_02063AD0: ; 0x02063AD0
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -258,7 +258,7 @@ sub_02063B04: ; 0x02063B04
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -266,7 +266,7 @@ sub_02063B04: ; 0x02063B04
ldr r1, _02063B3C ; =0x00002718
ldr r2, [r4, #0x4]
add r0, r5, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -312,7 +312,7 @@ _02063B74:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0x1
bne _02063B88
mov r0, #0x3
@ -321,7 +321,7 @@ _02063B88:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
beq _02063BA8
ldr r0, [r4, #0x4]
@ -353,7 +353,7 @@ sub_02063BBC: ; 0x02063BBC
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
mov r0, #0xb
mov r1, #0x4
@ -424,7 +424,7 @@ _02063C56:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0x1
bne _02063C6A
mov r0, #0x3
@ -440,7 +440,7 @@ sub_02063C70: ; 0x02063C70
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -465,7 +465,7 @@ sub_02063CA4: ; 0x02063CA4
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -473,7 +473,7 @@ sub_02063CA4: ; 0x02063CA4
ldr r1, _02063CDC ; =0x0000271C
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -526,7 +526,7 @@ sub_02063D18: ; 0x02063D18
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -551,7 +551,7 @@ sub_02063D4C: ; 0x02063D4C
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -559,7 +559,7 @@ sub_02063D4C: ; 0x02063D4C
ldr r1, _02063D84 ; =0x0000271A
ldr r2, [r4, #0x4]
add r0, r5, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -612,7 +612,7 @@ sub_02063DC0: ; 0x02063DC0
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -637,7 +637,7 @@ sub_02063DF4: ; 0x02063DF4
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -645,7 +645,7 @@ sub_02063DF4: ; 0x02063DF4
ldr r1, _02063E2C ; =0x0000271E
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -698,7 +698,7 @@ sub_02063E68: ; 0x02063E68
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -723,7 +723,7 @@ sub_02063E9C: ; 0x02063E9C
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -731,7 +731,7 @@ sub_02063E9C: ; 0x02063E9C
ldr r1, _02063ED4 ; =0x00002719
ldr r2, [r4, #0x4]
add r0, r5, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -784,7 +784,7 @@ sub_02063F10: ; 0x02063F10
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -809,7 +809,7 @@ sub_02063F44: ; 0x02063F44
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -817,7 +817,7 @@ sub_02063F44: ; 0x02063F44
ldr r1, _02063F7C ; =0x0000271D
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -863,7 +863,7 @@ _02063FB2:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0x1
bne _02063FC6
mov r0, #0x3
@ -879,7 +879,7 @@ sub_02063FCC: ; 0x02063FCC
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -904,7 +904,7 @@ sub_02064000: ; 0x02064000
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -912,7 +912,7 @@ sub_02064000: ; 0x02064000
ldr r1, _02064038 ; =0x0000271B
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -954,7 +954,7 @@ sub_0206405C: ; 0x0206405C
add r5, r0, #0x0
ldr r0, [r5, #0x0]
add r6, r1, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -979,7 +979,7 @@ sub_02064090: ; 0x02064090
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -987,7 +987,7 @@ sub_02064090: ; 0x02064090
ldr r1, _020640C8 ; =0x0000271F
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]
@ -1024,7 +1024,7 @@ _020640EC:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0x1
bne _02064100
mov r0, #0x3
@ -1033,7 +1033,7 @@ _02064100:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0x1
beq _02064120
ldr r0, [r4, #0x4]
@ -1065,7 +1065,7 @@ sub_02064134: ; 0x02064134
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204649C
@ -1094,7 +1094,7 @@ sub_02064174: ; 0x02064174
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
add r0, r6, #0x0
@ -1106,7 +1106,7 @@ sub_02064174: ; 0x02064174
ldr r1, _020641A8 ; =ov06_0224CB54
add r0, r5, #0x0
add r2, r6, #0x0
bl sub_020463EC
bl TaskManager_Jump
mov r0, #0x0
pop {r4-r6, pc}
nop
@ -1139,7 +1139,7 @@ _020641D6:
ldr r0, [r4, #0x4]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0x1
bne _020641EA
mov r0, #0x3
@ -1157,7 +1157,7 @@ sub_020641F0: ; 0x020641F0
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_0204649C
@ -1186,7 +1186,7 @@ sub_02064230: ; 0x02064230
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
ldr r1, [r6, #0x0]
add r0, r4, #0x0
@ -1210,7 +1210,7 @@ sub_02064230: ; 0x02064230
ldr r1, _02064280 ; =ov06_0224CAAC
add r0, r5, #0x0
add r2, r7, #0x0
bl sub_020463EC
bl TaskManager_Jump
mov r0, #0x0
pop {r3-r7, pc}
nop
@ -1253,7 +1253,7 @@ sub_020642B4: ; 0x020642B4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
ldr r0, [r6, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
ldrh r1, [r6, #0x4]
add r4, r0, #0x0
ldr r2, [r5, #0xc]
@ -1311,7 +1311,7 @@ sub_02064324: ; 0x02064324
bl TaskManager_GetFieldSystem
add r7, r0, #0x0
ldr r0, [r5, #0x0]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
add r1, r6, #0x0
@ -1336,7 +1336,7 @@ sub_02064360: ; 0x02064360
push {r3-r6, lr}
sub sp, #0x4
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r5, #0x0
bl TaskManager_GetFieldSystem
@ -1344,7 +1344,7 @@ sub_02064360: ; 0x02064360
ldr r1, _02064398 ; =0x000022C4
add r0, r5, #0x0
mov r2, #0x0
bl sub_02038D10
bl StartScriptFromMenu
mov r2, #0x0
str r2, [sp, #0x0]
ldrh r1, [r4, #0xc]

View File

@ -422,7 +422,7 @@ sub_02064A70: ; 0x02064A70
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x3
@ -546,7 +546,7 @@ sub_02064B70: ; 0x02064B70
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x3

View File

@ -609,7 +609,7 @@ sub_02065370: ; 0x02065370
bl TaskManager_GetFieldSystem
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0x0
ldr r0, [r5, #0x0]
cmp r0, #0xa
@ -650,7 +650,7 @@ _020653BA:
b _020653E2
_020653C8:
add r0, r4, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _020653E2
ldr r0, [r4, #0x78]

View File

@ -1808,7 +1808,7 @@ sub_020661F8: ; 0x020661F8
lsl r0, r0, #0x2
ldr r0, [r5, r0]
bl FieldSystem_GetSaveDataPtr
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r7, #0x0
bl GetPartyMonByIndex
add r2, r0, #0x0
@ -2377,7 +2377,7 @@ _02066676:
lsl r0, r0, #0x2
ldr r0, [r5, r0]
bl FieldSystem_GetSaveDataPtr
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r4, #0x0]
mov r0, #0x5b
lsl r0, r0, #0x2
@ -2434,7 +2434,7 @@ _02066708:
mov r0, #0x5b
lsl r0, r0, #0x2
ldr r0, [r5, r0]
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _0206671E
mov r0, #0x0
@ -2495,7 +2495,7 @@ _0206677A:
mov r0, #0x5b
lsl r0, r0, #0x2
ldr r0, [r4, r0]
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
bne _020667D0
mov r0, #0x6a
@ -2544,7 +2544,7 @@ sub_020667D4: ; 0x020667D4
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x4]
cmp r1, #0x0

View File

@ -514,7 +514,7 @@ _0206C2E8:
add r4, #0x20
ldr r0, [r0, #0x4]
add r1, r4, #0x0
bl CopyPlayerParty
bl CopyParty
mov r0, #0x1
pop {r4, pc}
@ -788,7 +788,7 @@ _0206C4DA:
add r5, #0x20
ldr r0, [r0, #0x4]
add r1, r5, #0x0
bl CopyPlayerParty
bl CopyParty
mov r0, #0x1
pop {r3-r5, pc}
.balign 4

View File

@ -16,7 +16,7 @@ sub_0206F1F0: ; 0x0206F1F0
bl TaskManager_GetFieldSystem
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0xb

View File

@ -68,7 +68,7 @@ sub_02080C60: ; 0x02080C60
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0xe
@ -106,7 +106,7 @@ _02080CA6:
b _02080DF2
_02080CB4:
ldr r0, [r6, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0x0
bl GetPartyMonByIndex
add r7, r0, #0x0
@ -240,7 +240,7 @@ _02080DCE:
b _02080DF2
_02080DD4:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]
@ -308,7 +308,7 @@ sub_02080E5C: ; 0x02080E5C
add r5, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0xd
@ -491,7 +491,7 @@ _02080FBA:
b _02080FDC
_02080FC0:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]
@ -523,7 +523,7 @@ sub_02081000: ; 0x02081000
add r5, r0, #0x0
bl TaskManager_GetFieldSystem
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, [r4, #0x4]
cmp r0, #0x9
@ -741,7 +741,7 @@ _0208117E:
b _020811B4
_02081196:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x4]
add r0, r0, #0x1
str r0, [r4, #0x4]

View File

@ -627,7 +627,7 @@ sub_02085DA4: ; 0x02085DA4
push {r4-r7, lr}
sub sp, #0xc
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0x0
add r0, r5, #0x0
ldr r7, [r6, #0x8]
@ -662,7 +662,7 @@ _02085DDC:
mov r1, #0x0
bl sub_02085D8C
ldr r0, [r6, #0x10]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r7, #0x1c]
bl GetPartyCount
mov r4, #0x0
@ -799,7 +799,7 @@ _02085F0E:
b _02085F38
_02085F14:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
mov r0, #0x6
str r0, [r6, #0x14]
b _02085F38

View File

@ -229,7 +229,7 @@ sub_02086280: ; 0x02086280
push {r4-r7, lr}
sub sp, #0xc
add r5, r0, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x0]
cmp r1, #0x6
@ -369,7 +369,7 @@ _020863A8:
b _020863CE
_020863B6:
add r0, r5, #0x0
bl sub_0204AF84
bl CallTask_RestoreOverworld
ldr r0, [r4, #0x0]
add r0, r0, #0x1
str r0, [r4, #0x0]

View File

@ -63,7 +63,7 @@ sub_02087D00: ; 0x02087D00
bl Save_PlayerData_GetProfileAddr
str r0, [r7, #0xc]
add r0, r4, #0x0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [r7, #0x10]
add r0, r4, #0x0
bl Save_Bag_Get

View File

@ -10,7 +10,7 @@ sub_0208A258: ; 0x0208A258
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r0, _0208A290 ; =0x0000022F
ldrb r0, [r4, r0]
@ -40,7 +40,7 @@ sub_0208A294: ; 0x0208A294
push {r3-r5, lr}
add r5, r0, #0x0
add r4, r1, #0x0
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
beq _0208A2A6
mov r0, #0x10
@ -66,7 +66,7 @@ sub_0208A2C4: ; 0x0208A2C4
bl TaskManager_GetFieldSystem
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_020464A4
@ -77,7 +77,7 @@ sub_0208A2C4: ; 0x0208A2C4
ldr r1, _0208A2F8 ; =0x0223D4AD
add r0, r5, #0x0
add r2, r4, #0x0
bl sub_020463EC
bl TaskManager_Jump
ldr r0, _0208A2FC ; =0x0000022F
mov r1, #0x12
strb r1, [r4, r0]

View File

@ -133,7 +133,7 @@ _0208A456:
thumb_func_start sub_0208A458
sub_0208A458: ; 0x0208A458
push {r3-r5, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0x0
ldr r1, [r4, #0x54]
cmp r1, #0xd
@ -293,7 +293,7 @@ _0208A57A:
b _0208A6C8
_0208A5A6:
ldr r0, [r4, #0x0]
bl sub_0204647C
bl FieldSystem_ApplicationIsRunning
cmp r0, #0x0
beq _0208A5B2
_0208A5B0:

View File

@ -1427,7 +1427,7 @@
.extern sub_02022450
.extern Reset_To_File
.extern Save_SafariZone_Get
.extern GetStoragePCPointer
.extern Save_PCStorage_Get
.extern sub_0202251C
.extern sub_02022528
.extern LoadHallOfFame
@ -2673,8 +2673,8 @@
.extern sub_02038B6C
.extern sub_02038C78
.extern sub_02038CA8
.extern sub_02038CD8
.extern sub_02038D10
.extern QueueScript
.extern StartScriptFromMenu
.extern CreateScriptContext
.extern FieldSysGetAttrAddr
.extern sub_02039460
@ -3428,18 +3428,18 @@
.extern ClearFlagInArray
.extern GetFlagAddr
.extern GetVarAddr
.extern sub_020463CC
.extern sub_020463EC
.extern FieldSystem_CreateTask
.extern TaskManager_Jump
.extern TaskManager_Call
.extern sub_02046420
.extern sub_0204646C
.extern sub_0204647C
.extern FieldSystem_ApplicationIsRunning
.extern sub_0204649C
.extern sub_020464A4
.extern sub_02046500
.extern TaskManager_GetFieldSystem
.extern sub_0204652C
.extern sub_02046530
.extern TaskManager_GetEnvironment
.extern TaskManager_GetStatePtr
.extern sub_02046534
.extern sub_02046948
.extern sub_020469B8
@ -3449,28 +3449,28 @@
.extern sub_02046F70
.extern SetupAndStartFirstBattle
.extern SetupAndStartTutorialBattle
.extern sub_020470E8
.extern SetupAndStartTrainerBattle
.extern sub_02047174
.extern sub_020471C0
.extern sub_0204726C
.extern sub_020472B0
.extern sub_020475A0
.extern sub_020475B0
.extern sub_020476CC
.extern BattleSetup_New
.extern sub_020477EC
.extern sub_02047800
.extern sub_02047814
.extern sub_02047964
.extern BattleSetup_Delete
.extern sub_020479FC
.extern sub_02047A78
.extern sub_02047BB0
.extern BattleSetup_InitFromFieldSystem
.extern sub_02047BC0
.extern sub_02047D48
.extern sub_02047F1C
.extern sub_02047F38
.extern sub_02047FA4
.extern sub_020480AC
.extern sub_020480B8
.extern IsBattleResultWin
.extern sub_020480C8
.extern sub_020480D8
.extern sub_020480E4
@ -3539,9 +3539,9 @@
.extern sub_0204AE5C
.extern sub_0204AEF8
.extern sub_0204AF3C
.extern sub_0204AF84
.extern sub_0204AFC8
.extern sub_0204B00C
.extern CallTask_RestoreOverworld
.extern CallTask_FadeToBlack
.extern CallTask_FadeFromBlack
.extern sub_0204B090
.extern sub_0204B0E8
.extern sub_0204B0F8
@ -4076,8 +4076,8 @@
.extern sub_02058750
.extern sub_02058768
.extern sub_02058774
.extern sub_02058780
.extern sub_020587B0
.extern MapObjectManager_PauseAllMovement
.extern MapObjectManager_UnpauseAllMovement
.extern sub_020587E0
.extern sub_020587F4
.extern sub_02058804
@ -4535,7 +4535,7 @@
.extern sub_0205ED0C
.extern sub_0205ED1C
.extern sub_0205ED2C
.extern sub_0205ED3C
.extern Save_VarsFlags_CheckHaveFollower
.extern sub_0205ED4C
.extern sub_0205ED5C
.extern sub_0205ED6C
@ -4564,7 +4564,7 @@
.extern sub_0205F1E4
.extern Save_VarsFlags_SetSafariSysFlag
.extern Save_VarsFlags_ClearSafariSysFlag
.extern sub_0205F214
.extern Save_VarsFlags_CheckSafariSysFlag
.extern sub_0205F224
.extern sub_0205F234
.extern sub_0205F244
@ -4888,9 +4888,9 @@
.extern GetPartyMonByIndex
.extern ReplacePartySlotWithMon
.extern SwapSlotsInParty
.extern CopyPlayerParty
.extern CopyParty
.extern PartyHasMon
.extern SaveArray_PlayerParty_Get
.extern SaveArray_Party_Get
.extern SaveArray_IsNatDexEnabled
.extern Pokedex_IsNatDexEnabled
.extern sub_0206BB48

View File

@ -221,7 +221,7 @@ ov05_021D825C: ; 0x021D825C
_021D827C:
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0
bne _021D8290
add sp, #0x10
@ -318,12 +318,12 @@ _021D8342:
lsr r0, r0, #0x1f
bne _021D8384
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
bl HasEnoughAlivePokemonForDoubleBattle
add r6, r0, #0
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #1
bne _021D8366
mov r6, #1
@ -336,7 +336,7 @@ _021D8366:
ldr r0, [r4, #0x38]
bl sub_02055B14
ldr r0, [r4, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
add sp, #8
mov r0, #1
pop {r3, r4, r5, r6, r7, pc}
@ -385,7 +385,7 @@ _021D83C2:
orr r6, r0
_021D83E4:
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0x7f
bl GetIdxOfFirstPartyMonWithMove
cmp r0, #0xff
@ -1471,7 +1471,7 @@ _021D8C88:
cmp r0, #0
beq _021D8CE0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0x39
bl GetIdxOfFirstPartyMonWithMove
cmp r0, #0xff
@ -1762,7 +1762,7 @@ ov05_021D8F38: ; 0x021D8F38
push {r3, r4, r5, lr}
add r4, r0, #0
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r5, r0, #0
ldr r0, [r4, #0xc]
bl Save_Daycare_Get
@ -1842,7 +1842,7 @@ ov05_021D8FD0: ; 0x021D8FD0
push {r3, r4, r5, r6, r7, lr}
add r4, r0, #0
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r6, r0, #0
ldr r0, [r4, #0x1c]
ldr r0, [r0]
@ -1874,7 +1874,7 @@ ov05_021D9010: ; 0x021D9010
push {r3, r4, r5, lr}
add r5, r0, #0
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r4, r0, #0
ldr r0, [r5, #0xc]
bl Save_LocalFieldData_Get
@ -1938,7 +1938,7 @@ ov05_021D9090: ; 0x021D9090
add r4, r0, #0
ldr r0, [r4, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
cmp r0, #0
bne _021D90A6
mov r0, #0

View File

@ -1072,7 +1072,7 @@ ov05_021DAE14: ; 0x021DAE14
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldrb r1, [r4]
ldr r0, [r5, #0x50]
@ -1351,7 +1351,7 @@ ov05_021DB040: ; 0x021DB040
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #3
@ -1472,7 +1472,7 @@ ov05_021DB144: ; 0x021DB144
bl TaskManager_GetFieldSystem
add r4, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r0, [r5]
cmp r0, #0
@ -1539,7 +1539,7 @@ ov05_021DB1D0: ; 0x021DB1D0
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #0
@ -1602,7 +1602,7 @@ ov05_021DB250: ; 0x021DB250
bl TaskManager_GetFieldSystem
add r5, r0, #0
ldr r0, [sp, #0x10]
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #3
@ -1753,7 +1753,7 @@ ov05_021DB380: ; 0x021DB380
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r7, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #3

View File

@ -45,7 +45,7 @@ _021E13C0: .word ov05_021E13C4
ov05_021E13C4: ; 0x021E13C4
push {r3, r4, r5, lr}
sub sp, #8
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r1, [r4]
cmp r1, #8

View File

@ -11,7 +11,7 @@ ov05_021E3340: ; 0x021E3340
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #4

View File

@ -425,7 +425,7 @@ ov05_021E6304: ; 0x021E6304
ldr r1, _021E6328 ; =ov05_021E632C
add r0, r4, #0
str r6, [r2, #0xc]
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3, r4, r5, r6, r7, pc}
.balign 4, 0
_021E6328: .word ov05_021E632C
@ -433,7 +433,7 @@ _021E6328: .word ov05_021E632C
thumb_func_start ov05_021E632C
ov05_021E632C: ; 0x021E632C
push {r4, r5, r6, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0xc]
bl PlayerAvatar_GetMapObject
@ -596,7 +596,7 @@ _021E647E:
thumb_func_start ov05_021E6484
ov05_021E6484: ; 0x021E6484
push {r3, r4, r5, r6, r7, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #7
@ -830,7 +830,7 @@ _021E6666:
ldr r1, _021E6674 ; =ov05_021E6678
add r0, r5, #0
add r2, r4, #0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3, r4, r5, r6, r7, pc}
nop
_021E6674: .word ov05_021E6678
@ -838,7 +838,7 @@ _021E6674: .word ov05_021E6678
thumb_func_start ov05_021E6678
ov05_021E6678: ; 0x021E6678
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #0
@ -986,7 +986,7 @@ ov05_021E67A0: ; 0x021E67A0
ldr r1, _021E67BC ; =ov05_021E67C0
add r0, r5, #0
str r4, [r2, #0xc]
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3, r4, r5, pc}
.balign 4, 0
_021E67BC: .word ov05_021E67C0
@ -996,7 +996,7 @@ ov05_021E67C0: ; 0x021E67C0
push {r4, r5, r6, r7, lr}
sub sp, #0xc
add r6, r0, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0xc]
bl PlayerAvatar_GetMapObject
@ -1273,7 +1273,7 @@ _021E69F6:
thumb_func_start ov05_021E69FC
ov05_021E69FC: ; 0x021E69FC
push {r4, r5, r6, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r6, _021E6A24 ; =ov05_021F7714
add r5, r0, #0
_021E6A06:
@ -1527,7 +1527,7 @@ ov05_021E6BD8: ; 0x021E6BD8
add r2, r0, #0
ldr r1, _021E6BF0 ; =ov05_021E6C30
add r0, r4, #0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r4, pc}
nop
_021E6BF0: .word ov05_021E6C30
@ -1563,7 +1563,7 @@ _021E6C2C: .word ov05_021E6C30
thumb_func_start ov05_021E6C30
ov05_021E6C30: ; 0x021E6C30
push {r4, r5, r6, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r6, _021E6C70 ; =ov05_021F7700
ldr r4, _021E6C74 ; =ov05_021F76EC
add r5, r0, #0
@ -2112,7 +2112,7 @@ _021E7068: .word ov05_021E706C
thumb_func_start ov05_021E706C
ov05_021E706C: ; 0x021E706C
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0xc]
cmp r0, #0
@ -2421,7 +2421,7 @@ ov05_021E72E8: ; 0x021E72E8
push {r4, lr}
ldr r0, [r0, #0xc]
add r4, r1, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r4, #0
bl GetPartyMonByIndex
pop {r4, pc}

View File

@ -653,7 +653,7 @@ _021F0122:
ov05_021F0128: ; 0x021F0128
push {r3, r4, r5, lr}
add r5, r0, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
thumb_func_start ov05_021F0130
ov05_021F0130: ; 0x021F0130
@ -870,7 +870,7 @@ ov05_021F02C4: ; 0x021F02C4
ldr r1, _021F0300 ; =ov05_021F0128
add r0, r6, #0
add r2, r4, #0
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r4, r5, r6, pc}
_021F02F2:
ldr r1, _021F0300 ; =ov05_021F0128

View File

@ -168,7 +168,7 @@ Field_CheckPokemonSizeRecord: ; 0x021F3A18
add r4, r0, #0
ldr r0, [r4, #0xc]
add r5, r1, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r5, #0
bl GetPartyMonByIndex
mov r1, #5
@ -237,7 +237,7 @@ Field_SetPokemonSizeRecord: ; 0x021F3AB4
add r4, r0, #0
ldr r0, [r4, #0xc]
add r5, r1, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r5, #0
bl GetPartyMonByIndex
bl ov05_021F38CC
@ -333,7 +333,7 @@ Field_BufferPartyPokemonSize: ; 0x021F3B7C
ldr r0, [r5, #0xc]
add r4, r3, #0
add r7, r1, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r4, #0
bl GetPartyMonByIndex
mov r1, #5

View File

@ -395,7 +395,7 @@ ov05_021F57F0: ; 0x021F57F0
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldrh r1, [r4, #8]
cmp r1, #9
@ -557,7 +557,7 @@ _021F5936:
ldr r1, _021F5988 ; =0x000007ED
add r0, r6, #0
add r3, r2, #0
bl sub_02038CD8
bl QueueScript
mov r0, #9
strh r0, [r4, #8]
b _021F5980
@ -566,7 +566,7 @@ _021F5956:
ldr r1, _021F598C ; =0x000007EC
add r0, r6, #0
add r3, r2, #0
bl sub_02038CD8
bl QueueScript
mov r0, #9
strh r0, [r4, #8]
b _021F5980

View File

@ -34,7 +34,7 @@ ov05_021F5C70: ; 0x021F5C70
bl TaskManager_GetFieldSystem
add r4, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r0, [r5]
cmp r0, #0
@ -44,7 +44,7 @@ ov05_021F5C70: ; 0x021F5C70
b _021F5D28
_021F5C8E:
ldr r0, [r4, #0x34]
bl sub_02058780
bl MapObjectManager_PauseAllMovement
mov r0, #0
str r0, [r5, #0x10]
add r2, r5, #0
@ -100,10 +100,10 @@ _021F5CBA:
_021F5D10:
cmp r0, #0
beq _021F5D18
bl sub_02047964
bl BattleSetup_Delete
_021F5D18:
ldr r0, [r4, #0x34]
bl sub_020587B0
bl MapObjectManager_UnpauseAllMovement
add r0, r5, #0
bl FreeToHeap
mov r0, #1

View File

@ -10,10 +10,10 @@ ov05_021F6360: ; 0x021F6360
bl TaskManager_GetFieldSystem
str r0, [sp]
add r0, r7, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r6, r0, #0
add r0, r7, #0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0
ldr r0, [r4]
ldr r5, [r6, #4]

View File

@ -4,14 +4,14 @@
#include "heap.h"
#include "unk_020051F4.h"
extern void sub_020463CC(u32 param0, void *func, UnkStruct021E7358 *param2);
extern void FieldSystem_CreateTask(u32 param0, void *func, UnkStruct021E7358 *param2);
extern u32 PlayerAvatar_GetMapObject(u32 param0);
extern u32 sub_02058720(u32 param0);
extern BOOL sub_02054B30(u8 param0);
extern BOOL sub_02054B3C(u8 param0);
extern BOOL sub_02054B48(u8 param0);
extern BOOL sub_02054B54(u8 param0);
extern UnkStruct021E7358 *sub_0204652C(UnkStruct021E7358 *param0);
extern UnkStruct021E7358 *TaskManager_GetEnvironment(UnkStruct021E7358 *param0);
extern void sub_02058410(u32 param0, u32 param1);
extern BOOL sub_02057254(u32 param0);
extern u32 sub_0205AFDC(u32 param0, u32 param1);
@ -57,7 +57,7 @@ void ov05_021E7358(u32 param0, u32 param1, u32 param2)
res->Unk10 = param1;
res->Unk00 = param2;
PlaySE(SEQ_SE_DP_F209);
sub_020463CC(param0, ov05_021E73B4, res);
FieldSystem_CreateTask(param0, ov05_021E73B4, res);
}
u32 ov05_021E7388(u32 param0)
@ -78,7 +78,7 @@ u32 ov05_021E7388(u32 param0)
BOOL ov05_021E73B4(UnkStruct021E7358 *param0)
{
UnkStruct021E7358 *strct = sub_0204652C(param0);
UnkStruct021E7358 *strct = TaskManager_GetEnvironment(param0);
u32 res = PlayerAvatar_GetMapObject(strct->Unk10);
u8 res2 = (u8)sub_02058720(res);
switch (strct->Unk08)

View File

@ -329,7 +329,7 @@ ov06_022398FC: ; 0x022398FC
add r4, r0, #0
bl TaskManager_GetFieldSystem
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0xc]
cmp r0, #0
@ -429,7 +429,7 @@ ov06_022399C8: ; 0x022399C8
add r4, r0, #0
bl TaskManager_GetFieldSystem
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0xc]
cmp r0, #7
@ -4844,7 +4844,7 @@ ov06_0223BA04: ; 0x0223BA04
pop {r4, r5, r6, r7, pc}
_0223BA42:
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r7, r0, #0
add r0, r5, #0
bl sub_02034CE0
@ -4943,7 +4943,7 @@ _0223BB0C:
_0223BB18:
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0
beq _0223BB2C
mov r0, #1
@ -4976,10 +4976,10 @@ _0223BB30:
mov r0, #0xb
add r1, r0, #0
add r1, #0xf5
bl sub_020476CC
bl BattleSetup_New
str r0, [sp, #0x2c]
add r1, r5, #0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
ldr r0, [sp, #0x30]
ldr r1, [sp, #0x28]
ldr r2, [sp, #0x2c]
@ -5004,7 +5004,7 @@ _0223BB98:
bne _0223BBB6
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
str r0, [sp, #0x18]
ldr r1, [sp, #0x18]
add r0, r5, #0
@ -5014,12 +5014,12 @@ _0223BB98:
_0223BBB6:
mov r0, #0xb
mov r1, #0x4a
bl sub_020476CC
bl BattleSetup_New
str r0, [sp, #0x2c]
_0223BBC0:
ldr r0, [sp, #0x2c]
add r1, r5, #0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
add r0, sp, #0x24
ldrb r0, [r0, #1]
cmp r0, #0
@ -5135,7 +5135,7 @@ _0223BC90:
_0223BCBC:
bl GF_AssertFail
ldr r0, [sp, #0x2c]
bl sub_02047964
bl BattleSetup_Delete
add sp, #0xb4
mov r0, #0
pop {r4, r5, r6, r7, pc}
@ -5166,7 +5166,7 @@ _0223BCFA:
cmp r0, #0
bne _0223BD06
ldr r0, [sp, #0x2c]
bl sub_02047964
bl BattleSetup_Delete
_0223BD06:
mov r0, #0
add r5, #0x74
@ -5193,7 +5193,7 @@ ov06_0223BD14: ; 0x0223BD14
_0223BD2E:
ldr r0, [sp, #8]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0
bl GetPartyMonByIndex
str r0, [sp, #0x14]
@ -5233,7 +5233,7 @@ _0223BD8A:
ldr r0, [sp, #8]
ldr r0, [r0, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
add r1, r0, #0
ldr r0, [sp, #8]
ldr r2, [sp, #0x10]
@ -5241,7 +5241,7 @@ _0223BD8A:
ldr r0, [sp, #0x10]
ldr r1, [sp, #8]
ldr r0, [r0]
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
ldr r0, [sp, #0x10]
ldr r0, [r0]
bl sub_020480AC
@ -5370,7 +5370,7 @@ ov06_0223BE70: ; 0x0223BE70
pop {r4, r5, r6, r7, pc}
_0223BEA4:
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r6, r0, #0
add r0, r5, #0
bl sub_02034CE0
@ -5395,7 +5395,7 @@ _0223BEA4:
str r1, [r0, #0xc]
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0
beq _0223BEF0
mov r0, #1
@ -5416,10 +5416,10 @@ _0223BEF4:
mov r0, #0xb
add r1, r0, #0
add r1, #0xf5
bl sub_020476CC
bl BattleSetup_New
str r0, [sp, #0x24]
add r1, r5, #0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
ldr r0, [sp, #0x28]
ldr r1, [sp, #0x20]
ldr r2, [sp, #0x24]
@ -5441,7 +5441,7 @@ _0223BF3C:
bne _0223BF5A
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
str r0, [sp, #0x14]
ldr r1, [sp, #0x14]
add r0, r5, #0
@ -5451,12 +5451,12 @@ _0223BF3C:
_0223BF5A:
mov r0, #0xb
mov r1, #0x4a
bl sub_020476CC
bl BattleSetup_New
str r0, [sp, #0x24]
_0223BF64:
ldr r0, [sp, #0x24]
add r1, r5, #0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
add r0, sp, #0x1c
ldrb r0, [r0]
cmp r0, #0
@ -5626,7 +5626,7 @@ ov06_0223C08C: ; 0x0223C08C
pop {r4, r5, r6, r7, pc}
_0223C0CE:
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r6, r0, #0
add r0, r5, #0
bl sub_02034CE0
@ -5697,7 +5697,7 @@ _0223C162:
str r0, [sp, #0x48]
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205ED3C
bl Save_VarsFlags_CheckHaveFollower
cmp r0, #0
beq _0223C184
mov r0, #1
@ -5727,10 +5727,10 @@ _0223C188:
mov r0, #0xb
add r1, r0, #0
add r1, #0xf5
bl sub_020476CC
bl BattleSetup_New
str r0, [r4]
add r1, r5, #0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
ldr r0, [sp, #0x28]
ldr r1, [sp, #0x24]
ldr r2, [r4]
@ -5751,7 +5751,7 @@ _0223C1E0:
bne _0223C1FE
ldr r0, [r5, #0xc]
bl Save_VarsFlags_Get
bl sub_0205F214
bl Save_VarsFlags_CheckSafariSysFlag
str r0, [sp, #0x18]
ldr r1, [sp, #0x18]
add r0, r5, #0
@ -5761,12 +5761,12 @@ _0223C1E0:
_0223C1FE:
mov r0, #0xb
mov r1, #0x4a
bl sub_020476CC
bl BattleSetup_New
str r0, [r4]
_0223C208:
ldr r0, [r4]
add r1, r5, #0
bl sub_02047BB0
bl BattleSetup_InitFromFieldSystem
add r0, sp, #0x20
ldrb r0, [r0, #1]
cmp r0, #0
@ -5853,7 +5853,7 @@ _0223C2A2:
_0223C2CC:
bl GF_AssertFail
ldr r0, [r4]
bl sub_02047964
bl BattleSetup_Delete
add sp, #0xac
mov r0, #0
pop {r4, r5, r6, r7, pc}
@ -5879,7 +5879,7 @@ _0223C300:
cmp r0, #0
bne _0223C30E
ldr r0, [r4]
bl sub_02047964
bl BattleSetup_Delete
b _0223C314
_0223C30E:
mov r0, #0
@ -7181,7 +7181,7 @@ ov06_0223CCDC: ; 0x0223CCDC
bl ov05_021F51D0
str r0, [sp, #8]
ldr r0, [r5, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0
bl GetPartyMonByIndex
str r0, [sp, #0xc]
@ -7257,7 +7257,7 @@ ov06_0223CD7C: ; 0x0223CD7C
ldr r0, [r5, #0xc]
add r7, r1, #0
add r6, r3, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0
bl GetPartyMonByIndex
add r4, r0, #0
@ -7588,7 +7588,7 @@ ov06_0223CFD0: ; 0x0223CFD0
bne _0223CFE4
mov r0, #0xb
mov r1, #0
bl sub_020476CC
bl BattleSetup_New
str r0, [r4]
pop {r4, pc}
_0223CFE4:
@ -8219,7 +8219,7 @@ ov06_0223D4AC: ; 0x0223D4AC
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r1, _0223D604 ; =0x0000022F
add r4, r0, #0
ldrb r1, [r4, r1]
@ -11156,7 +11156,7 @@ ov06_0223ECF0: ; 0x0223ECF0
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
bl ov06_0223D7B8
ldr r0, [r5, #0xc]
@ -11177,7 +11177,7 @@ ov06_0223ECF0: ; 0x0223ECF0
ldr r1, _0223ED4C ; =sub_0208A258
add r0, r6, #0
add r2, r4, #0
bl sub_020463EC
bl TaskManager_Jump
ldr r0, _0223ED50 ; =0x0000022F
mov r1, #0x10
strb r1, [r4, r0]
@ -15300,7 +15300,7 @@ ov06_02240F40: ; 0x02240F40
add r4, r0, #0
ldr r0, [r4, #0x10]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r0, #0
ldr r0, [r4, #0x10]
ldr r2, [r4, #0x6c]
@ -15380,7 +15380,7 @@ ov06_02240FEC: ; 0x02240FEC
add r4, r0, #0
bl TaskManager_GetFieldSystem
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r1, [r4, #0x7c]
cmp r1, #0xb
@ -15803,7 +15803,7 @@ ov06_02241348: ; 0x02241348
bl TaskManager_GetFieldSystem
add r4, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r1, [r5]
cmp r1, #3
@ -15910,7 +15910,7 @@ ov06_02241428: ; 0x02241428
bl TaskManager_GetFieldSystem
add r4, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r1, [r5]
cmp r1, #5
@ -16082,7 +16082,7 @@ ov06_0224158C: ; 0x0224158C
bl TaskManager_GetFieldSystem
add r4, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r1, [r5]
cmp r1, #3
@ -16538,7 +16538,7 @@ ov06_02241974: ; 0x02241974
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r1, [r4]
cmp r1, #3
@ -16637,7 +16637,7 @@ ov06_02241A44: ; 0x02241A44
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r1, [r4]
cmp r1, #3
@ -16897,7 +16897,7 @@ _02241C34:
strb r1, [r0]
ldr r0, [r5]
ldr r1, _02241D70 ; =ov06_02241F7C
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #8
pop {r3, r4, r5, r6, r7, pc}
_02241C64:
@ -16958,7 +16958,7 @@ _02241CB2:
ldr r0, [r5]
ldr r1, _02241D7C ; =ov06_022420CC
ldr r2, [sp]
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #8
pop {r3, r4, r5, r6, r7, pc}
_02241CDA:
@ -17028,7 +17028,7 @@ _02241D54:
ldr r0, [r5]
ldr r1, _02241D8C ; =ov06_02241E58
ldr r2, [sp]
bl sub_020463CC
bl FieldSystem_CreateTask
add sp, #8
pop {r3, r4, r5, r6, r7, pc}
nop
@ -17145,7 +17145,7 @@ ov06_02241E58: ; 0x02241E58
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r1, [r6, #4]
add r4, r0, #0
ldr r5, [r1, #0x24]
@ -17285,7 +17285,7 @@ ov06_02241F7C: ; 0x02241F7C
bl TaskManager_GetFieldSystem
add r7, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r7, #4]
ldr r5, [r0, #0x24]
@ -17444,7 +17444,7 @@ ov06_022420CC: ; 0x022420CC
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r6, #4]
ldr r5, [r0, #0x24]
@ -18047,7 +18047,7 @@ _022425A4:
ldr r0, [r5]
ldr r1, _022425C4 ; =ov06_02242744
ldr r2, [sp]
bl sub_020463CC
bl FieldSystem_CreateTask
pop {r3, r4, r5, r6, r7, pc}
nop
_022425B8: .word ov06_0224F8BD
@ -18260,7 +18260,7 @@ ov06_02242744: ; 0x02242744
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r6, #4]
ldr r5, [r0, #0x24]
@ -18743,7 +18743,7 @@ ov06_02242AEC: ; 0x02242AEC
bl TaskManager_GetFieldSystem
str r0, [sp, #8]
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r1, [sp, #8]
str r0, [sp, #4]
ldr r1, [r1, #4]
@ -19232,7 +19232,7 @@ _02242EB2:
thumb_func_start ov06_02242EC0
ov06_02242EC0: ; 0x02242EC0
push {r4, lr}
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
add r1, r4, #0
add r1, #0x5c
@ -19798,7 +19798,7 @@ ov06_022432E4: ; 0x022432E4
sub sp, #0x28
str r0, [sp]
add r0, r1, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #4]
bl GetPartyCount
lsl r0, r0, #0x18
@ -20327,7 +20327,7 @@ _02243706:
pop {r4, r5, r6, r7, pc}
_02243716:
add r0, r2, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #8]
ldrb r0, [r5, #0xe]
mov r4, #0
@ -20383,7 +20383,7 @@ ov06_02243780: ; 0x02243780
sub sp, #0x1c
str r0, [sp]
add r0, r1, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #4]
ldr r0, [sp]
mov r5, #0
@ -20638,7 +20638,7 @@ ov06_02243938: ; 0x02243938
bne _02243980
_0224394A:
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldrb r1, [r5, #0xf]
cmp r1, #0
bne _0224396C
@ -21506,7 +21506,7 @@ ov06_02243FDC: ; 0x02243FDC
mov r2, #1
add r1, sp, #8
strb r2, [r1]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp]
mov r7, #0
ldrb r0, [r5, #0xe]
@ -21729,7 +21729,7 @@ ov06_02244190: ; 0x02244190
str r0, [sp, #4]
bl MI_CpuFill8
add r0, r4, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldr r5, [sp, #4]
add r7, r0, #0
mov r4, #0
@ -22186,10 +22186,10 @@ ov06_02244558: ; 0x02244558
bl ov06_02244528
add r1, r0, #0
ldr r0, [r5, #4]
bl sub_020476CC
bl BattleSetup_New
add r7, r0, #0
ldr r0, [r4, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #4]
add r0, r7, #0
add r1, r4, #0
@ -22401,7 +22401,7 @@ ov06_022446FC: ; 0x022446FC
ldr r1, _02244750 ; =0x0000083E
strh r0, [r6, r1]
add r0, r4, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r7, r0, #0
mov r4, #0
add r5, r6, #0
@ -24010,7 +24010,7 @@ ov06_02245360: ; 0x02245360
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldrb r1, [r4, #5]
cmp r1, #5
@ -31059,7 +31059,7 @@ ov06_022488FC: ; 0x022488FC
ldr r0, [r5, #0xc]
add r4, r1, #0
add r6, r2, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
ldr r2, [r4, #4]
add r1, r6, #0
bl ReplacePartySlotWithMon
@ -31077,7 +31077,7 @@ ov06_0224891C: ; 0x0224891C
add r7, r2, #0
add r5, r1, #0
add r4, r3, #0
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r7, #0
bl GetPartyMonByIndex
mov r1, #0xa0
@ -38587,7 +38587,7 @@ ov06_0224C2F4: ; 0x0224C2F4
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldrb r1, [r4, #0xf]
cmp r1, #5
@ -38879,7 +38879,7 @@ ov06_0224C560: ; 0x0224C560
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldrb r1, [r4, #2]
cmp r1, #4
@ -39098,7 +39098,7 @@ ov06_0224C720: ; 0x0224C720
bl TaskManager_GetFieldSystem
add r7, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
_0224C732:
ldr r3, [r5]
@ -39323,7 +39323,7 @@ ov06_0224C8E8: ; 0x0224C8E8
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
ldr r7, _0224C928 ; =0x02251DF4
add r4, r0, #0
_0224C8FC:
@ -39550,7 +39550,7 @@ ov06_0224CAAC: ; 0x0224CAAC
bl TaskManager_GetFieldSystem
add r7, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
_0224CABE:
ldr r3, [r5]
@ -39639,7 +39639,7 @@ ov06_0224CB54: ; 0x0224CB54
bl TaskManager_GetFieldSystem
add r7, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
_0224CB66:
ldr r3, [r5]
@ -40797,7 +40797,7 @@ ov06_0224D410: ; 0x0224D410
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r1, [r4, #4]
cmp r1, #0
@ -42987,7 +42987,7 @@ ov06_0224E5D0: ; 0x0224E5D0
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldrb r1, [r4, #0xf]
cmp r1, #5
@ -43238,7 +43238,7 @@ ov06_0224E7D8: ; 0x0224E7D8
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_02046530
bl TaskManager_GetStatePtr
add r4, r0, #0
ldr r0, [r4]
cmp r0, #0

View File

@ -1153,7 +1153,7 @@ _0222DFE4:
_0222DFEC:
ldr r0, [r5, #0x68]
ldr r1, [r6, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [r5, #0x68]
bl FreeToHeap
add r1, r6, #0
@ -1997,7 +1997,7 @@ _0222E734:
ldr r0, [sp, #4]
ldr r1, [r5, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [sp, #4]
add r6, r6, #1
add r0, r0, #4
@ -2102,7 +2102,7 @@ _0222E810:
ldr r0, [sp, #4]
ldr r1, [r5, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [sp, #4]
add r6, r6, #1
add r0, r0, #4
@ -2212,7 +2212,7 @@ _0222E8FE:
ldr r0, [sp, #4]
ldr r1, [r5, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [sp, #4]
add r6, r6, #1
add r0, r0, #4
@ -2342,7 +2342,7 @@ _0222EA0C:
ldr r0, [sp, #4]
ldr r1, [r7, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [r7, #0x68]
mov r5, #0
bl GetPartyCount
@ -2428,7 +2428,7 @@ _0222EAC0:
ldr r0, [sp, #4]
ldr r1, [r5, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [sp, #4]
add r6, r6, #1
add r0, r0, #4
@ -2555,7 +2555,7 @@ _0222EBC6:
ldr r0, [sp, #4]
ldr r1, [r5, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [sp, #4]
add r6, r6, #1
add r0, r0, #4
@ -2664,7 +2664,7 @@ _0222ECA6:
ldr r0, [sp, #4]
ldr r1, [r5, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [sp, #4]
add r6, r6, #1
add r0, r0, #4
@ -2797,7 +2797,7 @@ _0222EDBC:
ldr r0, [sp, #4]
ldr r1, [r7, #0x68]
ldr r0, [r0, #4]
bl CopyPlayerParty
bl CopyParty
ldr r0, [r7, #0x68]
mov r5, #0
bl GetPartyCount

View File

@ -7519,7 +7519,7 @@ ov14_021DB220: ; 0x021DB220
add r4, r1, #0
add r5, r0, #0
ldr r0, [r4]
bl GetStoragePCPointer
bl Save_PCStorage_Get
mov r1, #0x12
lsl r1, r1, #4
str r0, [r5, r1]
@ -7527,7 +7527,7 @@ ov14_021DB220: ; 0x021DB220
sub r0, r1, #4
str r2, [r5, r0]
ldr r0, [r4]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0x49
lsl r1, r1, #2
str r0, [r5, r1]

View File

@ -26733,7 +26733,7 @@ ov18_0224648C: ; 0x0224648C
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0x10]
cmp r0, #0
@ -26770,7 +26770,7 @@ ov18_022464D0: ; 0x022464D0
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0x10]
cmp r0, #0
@ -26808,7 +26808,7 @@ ov18_02246514: ; 0x02246514
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #0xc]
cmp r0, #0xd
@ -27213,7 +27213,7 @@ ov18_0224686C: ; 0x0224686C
strb r1, [r0]
ldr r1, _02246894 ; =ov18_02246514
add r0, r4, #0
bl sub_020463CC
bl FieldSystem_CreateTask
_0224688E:
add sp, #8
pop {r3, r4, r5, pc}
@ -37225,7 +37225,7 @@ ov18_0224B84C: ; 0x0224B84C
bl TaskManager_GetFieldSystem
add r4, r0, #0
add r0, r6, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r0, [r5]
cmp r0, #5
@ -37707,7 +37707,7 @@ _0224BC5C:
ldr r0, [r4, #0xc]
ldr r1, _0224BD50 ; =ov18_0224B84C
add r2, r5, #0
bl sub_020463CC
bl FieldSystem_CreateTask
_0224BC86:
add r0, r6, #0
add r1, r4, #0
@ -43203,7 +43203,7 @@ ov18_0224E824: ; 0x0224E824
bl TaskManager_GetFieldSystem
add r6, r0, #0
add r0, r5, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4]
cmp r0, #7
@ -43346,7 +43346,7 @@ ov18_0224E960: ; 0x0224E960
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, _0224EA68 ; =0x00000504
ldr r0, [r4, r0]
@ -43515,7 +43515,7 @@ ov18_0224EAD4: ; 0x0224EAD4
bl TaskManager_GetFieldSystem
add r5, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #4]
cmp r0, #5
@ -43886,7 +43886,7 @@ ov18_0224EDDC: ; 0x0224EDDC
bl TaskManager_GetFieldSystem
add r7, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #4]
cmp r0, #6
@ -44442,7 +44442,7 @@ ov18_0224F258: ; 0x0224F258
bl TaskManager_GetFieldSystem
add r7, r0, #0
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r5, r0, #0
ldr r0, [r5, #4]
cmp r0, #0
@ -44786,7 +44786,7 @@ ov18_0224F528: ; 0x0224F528
bl TaskManager_GetFieldSystem
str r0, [sp]
add r0, r4, #0
bl sub_0204652C
bl TaskManager_GetEnvironment
add r4, r0, #0
ldr r0, [r4, #4]
cmp r0, #3

View File

@ -56,7 +56,7 @@ ov27_0225489C: ; 0x0225489C
strb r0, [r5, #2]
add r0, r4, #0
bl ov20_02252C40
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r0, #0
add r0, r5, #4
bl ov27_02254A48
@ -223,7 +223,7 @@ _0225499C:
blo _02254A02
ldr r0, [r4, #0x78]
bl ov20_02252C40
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
add r1, r0, #0
add r0, r4, #4
bl ov27_02254A48

View File

@ -57,7 +57,7 @@ ov28_0225489C: ; 0x0225489C
strb r0, [r7, #2]
str r4, [r7, #0x60]
bl sub_020225F8
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
mov r1, #0
str r0, [sp, #4]
str r1, [sp]

View File

@ -49,7 +49,7 @@ ov39_0225489C: ; 0x0225489C
str r1, [sp, #8]
str r2, [sp, #0xc]
bl ov20_02252C40
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0x10]
bl GetPartyCount
ldr r1, [sp, #4]

View File

@ -210,7 +210,7 @@ ov56_02211F88: ; 0x02211F88
push {r3, r4, r5, r6, r7, lr}
add r0, #0xc4
ldr r0, [r0]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp]
bl GetPartyCount
mov r5, #0
@ -1984,7 +1984,7 @@ ov56_02212E0C: ; 0x02212E0C
add r0, r5, #0
add r0, #0xc4
ldr r0, [r0]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0xc]
add r0, r5, #0
add r0, #0xc4

633
arm9/src/encounter.c Normal file
View File

@ -0,0 +1,633 @@
#include "global.h"
#include "encounter.h"
#include "constants/game_stats.h"
#include "event_data.h"
#include "field_system.h"
#include "task.h"
#include "unk_020040F4.h"
#include "unk_02022504.h"
#include "unk_02029FB0.h"
#include "unk_0204AEA8.h"
#include "unk_0204AF24.h"
#include "unk_0205EC84.h"
#include "unk_0205FA2C.h"
#include "use_item_on_mon.h"
extern void sub_0203780C(FieldSystem *fieldSystem, BattleSetup *battleSetup);
extern void BattleSetup_Delete(BattleSetup *setup);
extern BOOL IsBattleResultWin(u32 winFlag);
extern void sub_02047F38(BattleSetup *setup, FieldSystem *fieldSystem);
extern void sub_02061080(FieldSystem *fieldSystem, u32 param1, u32 winFlag);
extern void MapObjectManager_PauseAllMovement(MapObjectManager *mapObjectManager);
extern void MapObjectManager_UnpauseAllMovement(MapObjectManager *mapObjectManager);
extern void sub_0202E25C(SaveData *saveData, s32 param1);
extern void sub_02047FA4(BattleSetup *setup, FieldSystem *fieldSystem);
extern BattleSetup *ov06_02244558(u32 param0, FieldSystem *fieldSystem);
extern s32 sub_020475A0(BattleSetup *battleSetup);
extern s32 sub_020475B0(BattleSetup *battleSetup);
extern BOOL FieldTask_BlackOut(TaskManager *taskManager);
extern void sub_0205DD40(u32 param0);
extern u32 sub_0205E128(u32 param0);
extern void sub_0205DED4(FieldSystem *fieldSystem, u32 winFlag, u32 param2);
extern void sub_0205DF44(FieldSystem *fieldSystem, u32 param1);
extern BOOL sub_0205DF9C(u32 param0);
extern u32 sub_0205E0A4(u32 param0);
extern void ov06_02248724(FieldSystem *fieldSystem, BattleSetup *setup);
extern void sub_02060FE0(SafariZone *safariZone, Pokemon *pokemon);
extern LocalFieldData *Save_LocalFieldData_Get(SaveData *save);
extern u16 *LocalFieldData_GetSafariBallsCounter(LocalFieldData *localFieldData);
extern Location *LocalFieldData_GetDynamicWarp(LocalFieldData *localFieldData);
extern void sub_02049160(TaskManager *taskManager, Location *location);
extern void QueueScript(TaskManager *taskManager, u16 script, LocalMapObject *lastInteracted, void *param3);
extern BattleSetup *BattleSetup_New(HeapID heapId, u32 flags);
extern void BattleSetup_InitFromFieldSystem(BattleSetup *setup, FieldSystem *fieldSystem);
extern void ov06_0223CCDC(FieldSystem *fieldSystem, BattleSetup *setup);
extern void ov06_0223CD7C(FieldSystem *fieldSystem, u16 species, u8 level, BattleSetup *setup);
extern void sub_0204BAA0(FieldSystem *fieldSystem, BattleSetup *setup);
extern u32 sub_0204BAB0(FieldSystem *fieldSystem);
extern void StartScriptFromMenu(TaskManager *taskManager, u16 script, LocalMapObject *lastInteracted);
extern BattleSetup *sub_02047814(HeapID heapId, FieldSystem *fieldSystem);
extern void sub_020472F4(FieldSystem *fieldSystem, BattleSetup *setup);
extern void sub_020473CC(FieldSystem *fieldSystem, BattleSetup *setup);
static BOOL sub_0204653C(TaskManager *taskManager);
static void sub_02046584(TaskManager *taskManager, BattleSetup *setup);
/*static*/ Encounter *Encounter_New(BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag);
static void Encounter_Delete(Encounter *encounter);
static BOOL GetEncounterResult(Encounter *encounter);
static void sub_020465E4(BattleSetup *setup, FieldSystem *fieldSystem);
static BOOL Task_StartEncounter(TaskManager *taskManager);
/*static*/ void CallTask_StartEncounter(TaskManager *taskManager, BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag);
static void sub_0204671C(s32 flag, FieldSystem *fieldSystem);
/*static*/ BOOL sub_02046758(TaskManager *taskManager);
/*static*/ BOOL sub_020467FC(TaskManager *taskManager);
static BOOL sub_02046878(TaskManager *taskManager);
static void sub_02046928(TaskManager *taskManager, BattleSetup *battleSetup, s32 effect, s32 bgm, u32 *winFlag);
static WildEncounter *WildEncounter_New(BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag);
static void WildEncounter_Delete(WildEncounter *encounter);
static BOOL Task_WildEncounter(TaskManager *taskManager);
static BOOL Task_SafariEncounter(TaskManager *taskManager);
static BOOL Task_PalParkEncounter(TaskManager *taskManager);
static BOOL Task_TutorialBattle(TaskManager *taskManager);
static BOOL sub_0204653C(TaskManager *taskManager) { //Task_StartBattle
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
BattleSetup *battleSetup = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
sub_0203780C(fieldSystem, battleSetup);
(*state)++;
break;
case 1:
if (!FieldSystem_ApplicationIsRunning(fieldSystem)) {
return TRUE;
}
break;
}
return FALSE;
}
static void sub_02046584(TaskManager *taskManager, BattleSetup *setup) { //CallTask_StartBattle
TaskManager_Call(taskManager, sub_0204653C, setup);
}
/*static*/ Encounter *Encounter_New(BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag) {
Encounter *encounter = AllocFromHeapAtEnd(HEAP_ID_FIELD, sizeof(Encounter));
encounter->winFlag = winFlag;
if (winFlag != NULL) {
*winFlag = 0;
}
encounter->effect = effect;
encounter->bgm = bgm;
encounter->setup = setup;
return encounter;
}
static void Encounter_Delete(Encounter *encounter) {
BattleSetup_Delete(encounter->setup);
FreeToHeap(encounter);
}
static BOOL GetEncounterResult(Encounter *encounter) {
if (encounter->winFlag != NULL) {
*(encounter->winFlag) = encounter->setup->winFlag;
}
return IsBattleResultWin(encounter->setup->winFlag);
}
static void sub_020465E4(BattleSetup *setup, FieldSystem *fieldSystem) {
if (!(setup->flags & BATTLE_SETUP_FLAG_UNK_31)) {
sub_02047F38(setup, fieldSystem);
}
}
static BOOL Task_StartEncounter(TaskManager *taskManager) { //todo: better name
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager);
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
(*state)++;
break;
case 1:
sub_0204AF3C(taskManager);
(*state)++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 3:
sub_020465E4(encounter->setup, fieldSystem);
if (encounter->setup->flags == BATTLE_SETUP_FLAG_NONE || encounter->setup->flags == BATTLE_SETUP_FLAG_UNK_8 || encounter->setup->flags == (BATTLE_SETUP_FLAG_UNK_1 | BATTLE_SETUP_FLAG_UNK_3 | BATTLE_SETUP_FLAG_UNK_6)) {
sub_02061080(fieldSystem, encounter->setup->unk134, encounter->setup->winFlag);
}
if (GetEncounterResult(encounter) == FALSE) {
Encounter_Delete(encounter);
return TRUE;
}
if (Save_VarsFlags_CheckHaveFollower(Save_VarsFlags_Get(fieldSystem->saveData))) {
HealParty(SaveArray_Party_Get(fieldSystem->saveData));
}
sub_020472F4(fieldSystem, encounter->setup);
sub_020473CC(fieldSystem, encounter->setup);
CallTask_RestoreOverworld(taskManager);
(*state)++;
break;
case 4:
MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager);
CallTask_FadeFromBlack(taskManager);
(*state)++;
break;
case 5:
Encounter_Delete(encounter);
return TRUE;
break;
}
return FALSE;
}
/*static*/ void CallTask_StartEncounter(TaskManager *taskManager, BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag) {
Encounter *encounter = Encounter_New(setup, effect, bgm, winFlag);
TaskManager_Call(taskManager, Task_StartEncounter, encounter);
}
static void sub_0204671C(s32 flag, FieldSystem *fieldSystem) {
switch(flag & 0xF) {
case 1:
case 6:
sub_0202E25C(fieldSystem->saveData, 1);
break;
case 2:
case 5:
sub_0202E25C(fieldSystem->saveData, -1);
break;
}
}
/*static*/ BOOL sub_02046758(TaskManager *taskManager) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
(*state)++;
break;
case 1:
sub_0204AF3C(taskManager);
(*state)++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 3:
sub_0204671C(encounter->setup->winFlag, fieldSystem);
sub_02047FA4(encounter->setup, fieldSystem);
GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK21);
CallTask_RestoreOverworld(taskManager);
(*state)++;
break;
case 4:
case 5: //??
Encounter_Delete(encounter);
return TRUE;
}
return FALSE;
}
/*static*/ BOOL sub_020467FC(TaskManager *taskManager) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
sub_0200433C(5, encounter->bgm, 1);
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 1:
sub_0204671C(encounter->setup->winFlag, fieldSystem);
sub_02047FA4(encounter->setup, fieldSystem);
GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK21);
(*state)++;
break;
case 2:
Encounter_Delete(encounter);
return TRUE;
}
return FALSE;
}
static BOOL sub_02046878(TaskManager *taskManager) { //Task_02046878
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
(*state)++;
break;
case 1:
sub_0204AF3C(taskManager);
(*state)++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 3:
sub_02047FA4(encounter->setup, fieldSystem);
sub_02060044(fieldSystem, &encounter->setup->unk138);
GetEncounterResult(encounter);
CallTask_RestoreOverworld(taskManager);
(*state)++;
break;
case 4:
CallTask_FadeFromBlack(taskManager);
(*state)++;
break;
case 5:
Encounter_Delete(encounter);
return TRUE;
}
return FALSE;
}
static void sub_02046928(TaskManager *taskManager, BattleSetup *battleSetup, s32 effect, s32 bgm, u32 *winFlag) { //CallTask_02046878
Encounter *encounter = Encounter_New(battleSetup, effect, bgm, winFlag);
TaskManager_Call(taskManager, sub_02046878, encounter);
}
void sub_02046948(TaskManager *taskManager, u32 param1, u32 *winFlag) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
BattleSetup *battleSetup = ov06_02244558(param1, fieldSystem);
s32 effect = sub_020475A0(battleSetup);
s32 bgm = sub_020475B0(battleSetup);
sub_02046928(taskManager, battleSetup, effect, bgm, winFlag);
}
static WildEncounter *WildEncounter_New(BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag) {
WildEncounter *encounter = AllocFromHeapAtEnd(HEAP_ID_FIELD, sizeof(WildEncounter));
encounter->winFlag = winFlag;
if (winFlag != NULL) {
*winFlag = 0;
}
encounter->effect = effect;
encounter->bgm = bgm;
encounter->setup = setup;
encounter->state = 0;
return encounter;
}
static void WildEncounter_Delete(WildEncounter *encounter) {
BattleSetup_Delete(encounter->setup);
FreeToHeap(encounter);
}
void sub_020469B8(FieldSystem *fieldSystem, BattleSetup *setup) {
SaveVarsFlags *flags = Save_VarsFlags_Get(fieldSystem->saveData);
if (Save_VarsFlags_CheckSafariSysFlag(flags)) {
Encounter *encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
FieldSystem_CreateTask(fieldSystem, Task_SafariEncounter, encounter);
} else {
WildEncounter *encounter = WildEncounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
FieldSystem_CreateTask(fieldSystem, Task_WildEncounter, encounter);
}
}
void sub_02046A20(FieldSystem *fieldSystem, TaskManager *taskManager, BattleSetup *setup) {
SaveVarsFlags *flags = Save_VarsFlags_Get(fieldSystem->saveData);
if (Save_VarsFlags_CheckSafariSysFlag(flags)) {
Encounter *encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
TaskManager_Jump(taskManager, Task_SafariEncounter, encounter);
} else {
WildEncounter *encounter = WildEncounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
TaskManager_Jump(taskManager, Task_WildEncounter, encounter);
}
}
static BOOL Task_WildEncounter(TaskManager *taskManager) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
WildEncounter *encounter = TaskManager_GetEnvironment(taskManager);
switch (encounter->state) {
case 0:
MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager);
GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7);
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
encounter->state++;
break;
case 1:
sub_0204AF3C(taskManager);
encounter->state++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
encounter->state++;
break;
case 3:
sub_020465E4(encounter->setup, fieldSystem);
sub_02061080(fieldSystem, encounter->setup->unk134, encounter->setup->winFlag);
if (IsBattleResultWin(encounter->setup->winFlag) == FALSE) {
WildEncounter_Delete(encounter);
sub_0205DD40(fieldSystem->unk90);
TaskManager_Jump(taskManager, FieldTask_BlackOut, NULL);
return FALSE;
}
if (Save_VarsFlags_CheckHaveFollower(Save_VarsFlags_Get(fieldSystem->saveData))) {
HealParty(SaveArray_Party_Get(fieldSystem->saveData));
}
sub_020472F4(fieldSystem, encounter->setup);
sub_020473CC(fieldSystem, encounter->setup);
if (sub_0205E128(fieldSystem->unk90) != 0) {
if (sub_0205E0A4(fieldSystem->unk90) != 0) {
if (encounter->setup->winFlag != 1 && encounter->setup->winFlag != 4) {
sub_0205DD40(fieldSystem->unk90);
}
} else {
sub_0205DD40(fieldSystem->unk90);
}
}
CallTask_RestoreOverworld(taskManager);
encounter->state++;
break;
case 4:
ov06_02248724(fieldSystem, encounter->setup);
CallTask_FadeFromBlack(taskManager);
encounter->state++;
break;
case 5:
if (sub_0205E128(fieldSystem->unk90) != 0) {
sub_0205DED4(fieldSystem, encounter->setup->winFlag, fieldSystem->unk90);
sub_0205DF44(fieldSystem, fieldSystem->unk90);
}
encounter->state++;
break;
case 6:
if (sub_0205DF9C(fieldSystem->unk90)) {
MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager);
WildEncounter_Delete(encounter);
return TRUE;
}
break;
}
return FALSE;
}
static BOOL Task_SafariEncounter(TaskManager *taskManager) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
u16 *safariBalls = LocalFieldData_GetSafariBallsCounter(Save_LocalFieldData_Get(fieldSystem->saveData));
switch (*state) {
case 0:
MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager);
GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7);
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
(*state)++;
break;
case 1:
sub_0204AF3C(taskManager);
(*state)++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 3:
sub_020465E4(encounter->setup, fieldSystem);
if (encounter->setup->winFlag == 4) {
SafariZone *safariZone = Save_SafariZone_Get(fieldSystem->saveData);
Pokemon *pokemon = GetPartyMonByIndex(encounter->setup->party[1], 0);
sub_02060FE0(safariZone, pokemon);
}
sub_020472F4(fieldSystem, encounter->setup);
if (*safariBalls == 0 && encounter->setup->winFlag != 4) {
Location *location = LocalFieldData_GetDynamicWarp(Save_LocalFieldData_Get(fieldSystem->saveData));
sub_02049160(taskManager, location);
}
sub_020473CC(fieldSystem, encounter->setup);
(*state)++;
break;
case 4:
CallTask_RestoreOverworld(taskManager);
(*state)++;
break;
case 5:
MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager);
CallTask_FadeFromBlack(taskManager);
(*state)++;
break;
case 6:
if (*safariBalls == 0) {
if (encounter->setup->winFlag == 4) {
QueueScript(taskManager, 0x2262, NULL, NULL);
} else {
QueueScript(taskManager, 0x2269, NULL, NULL);
}
} else {
PCStorage *pc = Save_PCStorage_Get(fieldSystem->saveData);
Party *party = SaveArray_Party_Get(fieldSystem->saveData);
if (PCStorage_FindFirstBoxWithEmptySlot(pc) == NUM_BOXES && GetPartyCount(party) == PARTY_SIZE) {
QueueScript(taskManager, 0x2276, NULL, NULL);
}
}
(*state)++;
break;
case 7:
Encounter_Delete(encounter);
return TRUE;
}
return FALSE;
}
void SetupAndStartHoneyTreeBattle(TaskManager *taskManager, u32 *winFlag) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
sub_0205DD40(fieldSystem->unk90);
BattleSetup *setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_SETUP_FLAG_NONE);
BattleSetup_InitFromFieldSystem(setup, fieldSystem);
setup->unk150 = 0;
setup->unk154 = 0;
ov06_0223CCDC(fieldSystem, setup);
GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7);
CallTask_StartEncounter(taskManager, setup, sub_020475A0(setup), sub_020475B0(setup), winFlag);
}
void SetupAndStartWildBattle(TaskManager *taskManager, u16 species, u8 level, u32 *winFlag, BOOL canFlee) {
BattleSetup *setup;
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
sub_0205DD40(fieldSystem->unk90);
setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_SETUP_FLAG_NONE);
BattleSetup_InitFromFieldSystem(setup, fieldSystem);
ov06_0223CD7C(fieldSystem, species, level, setup);
if (canFlee) {
setup->unk18C |= 8;
}
GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7);
CallTask_StartEncounter(taskManager, setup, sub_020475A0(setup), sub_020475B0(setup), winFlag);
}
static BOOL Task_PalParkEncounter(TaskManager *taskManager) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager);
GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7);
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
(*state)++;
break;
case 1:
sub_0204AF3C(taskManager);
(*state)++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 3:
sub_020465E4(encounter->setup, fieldSystem);
sub_0204BAA0(fieldSystem, encounter->setup);
sub_020472F4(fieldSystem, encounter->setup);
(*state)++;
break;
case 4:
CallTask_RestoreOverworld(taskManager);
(*state)++;
break;
case 5:
MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager);
CallTask_FadeFromBlack(taskManager);
(*state)++;
break;
case 6:
Encounter_Delete(encounter);
if (sub_0204BAB0(fieldSystem) == 0) {
StartScriptFromMenu(taskManager, 3, NULL);
return FALSE;
}
return TRUE;
}
return FALSE;
}
void sub_02046F70(FieldSystem *fieldSystem, BattleSetup *setup) {
Encounter *encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
FieldSystem_CreateTask(fieldSystem, Task_PalParkEncounter, encounter);
}
void SetupAndStartFirstBattle(TaskManager *taskManager, u16 species, u8 level) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
BattleSetup *setup = BattleSetup_New(HEAP_ID_FIELD, 0);
BattleSetup_InitFromFieldSystem(setup, fieldSystem);
ov06_0223CD7C(fieldSystem, species, level, setup);
setup->unk18C = 1;
GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7);
CallTask_StartEncounter(taskManager, setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
}
static BOOL Task_TutorialBattle(TaskManager *taskManager) {
Encounter *encounter = TaskManager_GetEnvironment(taskManager);
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
u32 *state = TaskManager_GetStatePtr(taskManager);
switch (*state) {
case 0:
MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager);
sub_0204AEF8(taskManager, encounter->effect, encounter->bgm);
(*state)++;
break;
case 1:
sub_0204AF3C(taskManager);
(*state)++;
break;
case 2:
sub_02046584(taskManager, encounter->setup);
(*state)++;
break;
case 3:
(*state)++;
break;
case 4:
CallTask_RestoreOverworld(taskManager);
(*state)++;
break;
case 5:
MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager);
CallTask_FadeFromBlack(taskManager);
(*state)++;
break;
case 6:
Encounter_Delete(encounter);
return TRUE;
}
return FALSE;
}
void SetupAndStartTutorialBattle(TaskManager *taskManager) {
Encounter *encounter;
BattleSetup *setup;
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
setup = sub_02047814(HEAP_ID_FIELD, fieldSystem);
encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL);
TaskManager_Call(taskManager, Task_TutorialBattle, encounter);
}

View File

@ -18,7 +18,7 @@ void Save_HOF_Init(struct HallOfFame * hof)
MI_CpuClear32(hof, sizeof(struct HallOfFame));
}
void Save_HOF_RecordParty(struct HallOfFame * hof, struct PlayerParty * party, RTCDate * date)
void Save_HOF_RecordParty(struct HallOfFame * hof, struct Party * party, RTCDate * date)
{
GF_ASSERT(hof != NULL);
GF_ASSERT(hof->next_record < NUM_HOF_RECORDS);

View File

@ -52,7 +52,7 @@ void Mail_SetNewMessageDetails(struct Mail * mail, u8 type, u8 monIdx, struct Sa
u32 form;
BOOL is_egg;
u16 species;
struct PlayerParty * party;
struct Party * party;
PlayerProfile * profile;
struct Pokemon * pokemon;
u16 r7;
@ -60,7 +60,7 @@ void Mail_SetNewMessageDetails(struct Mail * mail, u8 type, u8 monIdx, struct Sa
Mail_Init(mail);
mail->mail_type = type;
party = SaveArray_PlayerParty_Get(save);
party = SaveArray_Party_Get(save);
profile = Save_PlayerData_GetProfileAddr(save);
CopyU16StringArray(mail->author_name, PlayerProfile_GetNamePtr(profile));

View File

@ -2,38 +2,38 @@
#include "party.h"
#include "heap.h"
void SaveArray_Party_Init(struct PlayerParty * party);
void InitPartyWithMaxSize(struct PlayerParty * party, int count);
void SaveArray_Party_Init(struct Party * party);
void InitPartyWithMaxSize(struct Party * party, int count);
u32 SaveArray_Party_sizeof(void)
{
return sizeof(struct PlayerParty);
return sizeof(struct Party);
}
struct PlayerParty * SaveArray_Party_Alloc(HeapID heapId)
struct Party * SaveArray_Party_Alloc(HeapID heapId)
{
struct PlayerParty * ret = (struct PlayerParty *)AllocFromHeap(heapId, sizeof(struct PlayerParty));
struct Party * ret = (struct Party *)AllocFromHeap(heapId, sizeof(struct Party));
SaveArray_Party_Init(ret);
return ret;
}
void SaveArray_Party_Init(struct PlayerParty * party)
void SaveArray_Party_Init(struct Party * party)
{
InitPartyWithMaxSize(party, PARTY_SIZE);
}
void InitPartyWithMaxSize(struct PlayerParty * party, int count)
void InitPartyWithMaxSize(struct Party * party, int count)
{
int i;
GF_ASSERT(count <= PARTY_SIZE);
memset(party, 0, sizeof(struct PlayerParty));
memset(party, 0, sizeof(struct Party));
party->curCount = 0;
party->maxCount = count;
for (i = 0; i < PARTY_SIZE; i++)
ZeroMonData(&party->mons[i]);
}
BOOL AddMonToParty(struct PlayerParty * party, struct Pokemon * pokemon)
BOOL AddMonToParty(struct Party * party, struct Pokemon * pokemon)
{
if (party->curCount >= party->maxCount)
return FALSE;
@ -42,7 +42,7 @@ BOOL AddMonToParty(struct PlayerParty * party, struct Pokemon * pokemon)
return TRUE;
}
BOOL RemoveMonFromParty(struct PlayerParty * party, int pos)
BOOL RemoveMonFromParty(struct Party * party, int pos)
{
int i;
@ -61,12 +61,12 @@ BOOL RemoveMonFromParty(struct PlayerParty * party, int pos)
return TRUE;
}
int GetPartyCount(struct PlayerParty * party)
int GetPartyCount(struct Party * party)
{
return party->curCount;
}
struct Pokemon * GetPartyMonByIndex(struct PlayerParty * party, int pos)
struct Pokemon * GetPartyMonByIndex(struct Party * party, int pos)
{
GF_ASSERT(pos >= 0);
GF_ASSERT(pos < party->curCount);
@ -74,7 +74,7 @@ struct Pokemon * GetPartyMonByIndex(struct PlayerParty * party, int pos)
return &party->mons[pos];
}
void ReplacePartySlotWithMon(struct PlayerParty * party, int pos, struct Pokemon * pokemon)
void ReplacePartySlotWithMon(struct Party * party, int pos, struct Pokemon * pokemon)
{
int r2;
GF_ASSERT(pos >= 0);
@ -85,7 +85,7 @@ void ReplacePartySlotWithMon(struct PlayerParty * party, int pos, struct Pokemon
party->curCount += r2;
}
BOOL SwapSlotsInParty(struct PlayerParty * party, int pos1, int pos2)
BOOL SwapSlotsInParty(struct Party * party, int pos1, int pos2)
{
struct Pokemon * buffer;
GF_ASSERT(pos1 >= 0);
@ -102,12 +102,12 @@ BOOL SwapSlotsInParty(struct PlayerParty * party, int pos1, int pos2)
return FALSE;
}
void CopyPlayerParty(struct PlayerParty * src, struct PlayerParty * dest)
void CopyParty(struct Party * src, struct Party * dest)
{
*dest = *src;
}
BOOL PartyHasMon(struct PlayerParty * party, u16 species)
BOOL PartyHasMon(struct Party * party, u16 species)
{
int i;
for (i = 0; i < party->curCount; i++)
@ -118,7 +118,7 @@ BOOL PartyHasMon(struct PlayerParty * party, u16 species)
return i != party->curCount;
}
struct PlayerParty * SaveArray_PlayerParty_Get(struct SaveData * ptr)
struct Party * SaveArray_Party_Get(struct SaveData * ptr)
{
return (struct PlayerParty *)SaveArray_Get(ptr, 2);
return (struct Party *)SaveArray_Get(ptr, 2);
}

View File

@ -39,7 +39,7 @@ void BoxMonSetMoveInSlot(struct BoxPokemon * boxmon, u16 move, u8 slot);
void sub_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2);
s8 BoxMonGetFlavorPreference(struct BoxPokemon * boxmon, int flavor);
s8 GetFlavorPreferenceFromPID(u32 personality, int flavor);
u8 Party_MaskMonsWithPokerus(struct PlayerParty * party_p, u8 mask);
u8 Party_MaskMonsWithPokerus(struct Party * party_p, u8 mask);
BOOL BoxMon_HasPokerus(struct BoxPokemon * boxmon);
BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon * boxmon);
void BoxMon_UpdateArceusForm(struct BoxPokemon * boxmon);
@ -2498,7 +2498,7 @@ BOOL sub_020690E8(struct Pokemon * pokemon)
return FALSE;
}
u16 GetMonEvolution(struct PlayerParty * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret)
u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret)
{
u16 target = SPECIES_NONE;
u32 sp40;
@ -3009,7 +3009,7 @@ void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest)
CalcMonLevelAndStats(dest);
}
u8 Party_GetMaxLevel(struct PlayerParty * party)
u8 Party_GetMaxLevel(struct Party * party)
{
int i;
int r7 = GetPartyCount(party);
@ -3088,7 +3088,7 @@ int Species_LoadLearnsetTable(u16 species, u32 form, u16 * dest)
return i;
}
void Party_GivePokerusAtRandom(struct PlayerParty * party)
void Party_GivePokerusAtRandom(struct Party * party)
{
int count = GetPartyCount(party);
int idx;
@ -3120,7 +3120,7 @@ void Party_GivePokerusAtRandom(struct PlayerParty * party)
}
}
u8 Party_MaskMonsWithPokerus(struct PlayerParty * party, u8 mask)
u8 Party_MaskMonsWithPokerus(struct Party * party, u8 mask)
{
int i = 0;
u32 flag = 1;
@ -3151,7 +3151,7 @@ u8 Party_MaskMonsWithPokerus(struct PlayerParty * party, u8 mask)
return ret;
}
void Party_UpdatePokerus(struct PlayerParty * party, int r5)
void Party_UpdatePokerus(struct Party * party, int r5)
{
int i;
u8 pokerus;
@ -3177,7 +3177,7 @@ void Party_UpdatePokerus(struct PlayerParty * party, int r5)
}
}
void Party_SpreadPokerus(struct PlayerParty * party)
void Party_SpreadPokerus(struct Party * party)
{
int count = GetPartyCount(party);
int i;

View File

@ -8,6 +8,8 @@
#include "constants/items.h"
#include "constants/sndseq.h"
#include "constants/weather.h"
#include "easy_chat.h"
#include "encounter.h"
#include "fashion_case.h"
#include "gf_rtc.h"
#include "hall_of_fame.h"
@ -31,8 +33,8 @@
#include "task.h"
#include "text.h"
#include "text_02054590.h"
#include "unk_020040F4.h"
#include "unk_0200CA44.h"
#include "easy_chat.h"
#include "unk_02022504.h"
#include "unk_02029FB0.h"
#include "unk_020337E8.h"
@ -90,14 +92,14 @@ extern LocalMapObject *sub_020580B4(MapObjectManager *mapObjectManager, u32 para
extern LocalMapObject *GetMapObjectByID(MapObjectManager *mapObjectManager, u16 eventId);
extern BOOL sub_0205AEF0(u32 param0);
extern void sub_0205AEFC(u32 param0);
extern void sub_02058780(MapObjectManager *mapObjectManager);
extern void MapObjectManager_PauseAllMovement(MapObjectManager *mapObjectManager);
extern LocalMapObject *PlayerAvatar_GetMapObject(PlayerAvatar *playerAvatar);
extern u32 sub_0205AE28(LocalMapObject *event);
extern void sub_02058908(LocalMapObject *event);
extern u32 sub_02058854(LocalMapObject *event);
extern LocalMapObject *sub_0205E7C4(LocalMapObject *event);
extern void sub_02058914(LocalMapObject *event);
extern void sub_020587B0(MapObjectManager *mapObjectManager);
extern void MapObjectManager_UnpauseAllMovement(MapObjectManager *mapObjectManager);
extern u32 sub_02034B64(FieldSystem *fieldSystem);
extern u32 sub_02034B6C(FieldSystem *fieldSystem);
extern u32 sub_020575D4(MapObjectManager *mapObjectManager, u16 eventVar, u32 param2, u32 mapId, u32 param4);
@ -133,7 +135,6 @@ extern u16 sub_02037A78(void *runningAppData);
extern u16 ov05_021E1858(FieldSystem *fieldSystem, LocalMapObject *event, u16 param2);
extern void *sub_02029048(u32 param0);
extern void sub_02028AD4(u32 *param0, void *param1, BOOL param2);
extern void sub_0204AF3C(TaskManager *taskManager);
extern SaveFashionData *Save_FashionData_Get(SaveData *save);
extern BOOL CheckPortraitSlotFull(SaveFashionData *fashionData, u32 portraitSlot);
extern BOOL CheckContestPortraitSlotFull(SaveFashionData *fashionData, u32 portraitSlot);
@ -213,12 +214,8 @@ extern u16 MapNumToFloorNo(u32 mapId);
extern void PrintCurrentFloorInNewWindow(FieldSystem *fieldSystem, u32 x, u32 y, u16 *var, MessageFormat *messageFormat);
extern u16 sub_02054CC8(u32 param0, u16 param1);
extern u16 sub_02054D1C(u32 param0, u16 param1);
extern void SetupAndStartWildBattle(TaskManager *taskManager, u16 species, u8 level, u32 *winFlag, BOOL isLegendary);
extern void SetupAndStartFirstBattle(TaskManager *taskManager, u16 species, u8 level);
extern void SetupAndStartTutorialBattle(TaskManager *taskManager);
extern void UpdateHoneyTree(FieldSystem *fieldSystem);
extern u16 CheckHoneyTree(FieldSystem *fieldSystem);
extern void SetupAndStartHoneyTreeBattle(TaskManager *taskManager, u32 *winFlag);
extern void ov05_021F4E7C(FieldSystem *fieldSystem);
extern void sub_020386B4(FieldSystem *fieldSystem);
extern u16 Field_SaveGame(FieldSystem *fieldSystem);
@ -254,7 +251,7 @@ extern u16 sub_020536D0(PlayerGender playerGender, u16 param1, u16 param2);
extern void sub_02049EA4(TaskManager *taskManager);
extern void LocalFieldData_SetBlackoutSpawn(LocalFieldData *localFieldData, u16 spawnPoint);
extern void CallFieldTask_BlackOut(TaskManager *taskManager);
extern void HealParty(PlayerParty *playerParty);
extern void HealParty(Party *playerParty);
extern void sub_02050024(void);
extern u32 sub_02031810(void);
extern u32 sub_0202EDF8(void);
@ -311,7 +308,6 @@ extern u16 sub_02027100(FashionCase *fashionCase, u16 param1);
extern PokedexAppData *sub_02038AF4(FieldSystem *fieldSystem, HeapID heapId, BOOL isNational);
extern void ov06_0224CBB0(SaveData *saveData);
extern u16 ov06_0224CC24(SaveData *saveData);
extern SafariZone *Save_SafariZone_Get(SaveData *saveData);
extern u16 *LocalFieldData_GetSafariBallsCounter(LocalFieldData *localFieldData);
extern u16 *LocalFieldData_GetSafariStepsCounter(LocalFieldData *localFieldData);
extern void Save_VarsFlags_SetSafariSysFlag(SaveVarsFlags *varsFlags);
@ -319,7 +315,6 @@ extern void sub_02060FD0(SafariZone *safariZone);
extern void Save_VarsFlags_ClearSafariSysFlag(SaveVarsFlags *varsFlags);
extern void sub_02061574(FieldSystem *fieldSystem);
extern u16 SpearPillarSequence(FieldSystem *fieldSystem, u8 operation);
extern void sub_0200433C(u32 param0, u32 param1, u32 param2);
extern void ov06_0224525C(FieldSystem *fieldSystem, u16 var, u16 type);
extern u16 ov06_02245340(FieldSystem *fieldSystem, u16 position);
extern void PlayerAvatar_ToggleAutomaticHeightUpdating(PlayerAvatar *avatar, u8 flag);
@ -1722,7 +1717,7 @@ BOOL ScrCmd_LockAllEvents(ScriptContext *ctx) { //0060
LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED);
if (*lastInteracted == NULL) {
sub_02058780(fieldSystem->mapObjectManager);
MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager);
} else {
ScrCmd_LockAllEvents2(ctx);
}
@ -1776,7 +1771,7 @@ BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { //02B4
MapObjectManager *mapObjectManager = fieldSystem->mapObjectManager;
UNK_021C5A0C[0] = 0;
sub_02058780(mapObjectManager);
MapObjectManager_PauseAllMovement(mapObjectManager);
if (sub_0205AE28(playerAvatar) == 0) {
UNK_021C5A0C[0] |= 1;
sub_02058914(playerAvatar);
@ -1787,7 +1782,7 @@ BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { //02B4
}
if (unk1 != NULL) {
SaveVarsFlags *state = Save_VarsFlags_Get(fieldSystem->saveData);
if (sub_0205ED3C(state) == TRUE) {
if (Save_VarsFlags_CheckHaveFollower(state) == TRUE) {
if (sub_02058854(unk1) != 0) {
UNK_021C5A0C[0] |= 2;
sub_02058914(unk1);
@ -1805,7 +1800,7 @@ BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { //02B4
}
BOOL ScrCmd_ReleaseAllEvents(ScriptContext *ctx) { //0061
sub_020587B0(ctx->fieldSystem->mapObjectManager);
MapObjectManager_UnpauseAllMovement(ctx->fieldSystem->mapObjectManager);
return TRUE;
}
@ -1985,7 +1980,7 @@ BOOL ScrCmd_GetPokemonForm(ScriptContext *ctx) { //0095
u16 partyPosition = ScriptGetVar(ctx);
u16 *variable = ScriptGetVarPointer(ctx);
PlayerParty *party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
*variable = GetMonUnownLetter(GetPartyMonByIndex(party, partyPosition));
return FALSE;
@ -2113,7 +2108,7 @@ BOOL ScrCmd_DummyGetMapPosition(ScriptContext *ctx) { //009F
FieldSystem *fieldSystem = ctx->fieldSystem;
void **runningAppData = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_RUNNING_APP_DATA);
if (sub_0204647C(fieldSystem)) {
if (FieldSystem_ApplicationIsRunning(fieldSystem)) {
return FALSE;
}
FreeToHeap(*runningAppData);
@ -2125,7 +2120,7 @@ static BOOL sub_0203BBBC(ScriptContext *ctx) {
FieldSystem *fieldSystem = ctx->fieldSystem;
PCBoxAppData **pcBoxDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA);
PCBoxAppData *pcBoxData = *pcBoxDataPtr;
if (sub_0204647C(fieldSystem)) {
if (FieldSystem_ApplicationIsRunning(fieldSystem)) {
return FALSE;
}
if (pcBoxData->unk08 == TRUE) {
@ -2137,11 +2132,11 @@ static BOOL sub_0203BBBC(ScriptContext *ctx) {
}
BOOL sub_0203BC04(ScriptContext *ctx) {
return !sub_0204647C(ctx->fieldSystem);
return !FieldSystem_ApplicationIsRunning(ctx->fieldSystem);
}
BOOL ScrCmd_RestoreOverworld(ScriptContext *ctx) { //00A1
sub_0204AF84(ctx->fieldSystem->taskManager);
CallTask_RestoreOverworld(ctx->fieldSystem->taskManager);
return TRUE;
}
@ -2214,7 +2209,7 @@ BOOL ScrCmd_ShowPokemonPic(ScriptContext *ctx) { //0208
BOOL ScrCmd_ShowPartyPokemonPic(ScriptContext *ctx) { //028C
PokepicManager **pokepicManager = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
u16 partyId = ScriptGetVar(ctx);
Pokemon *mon = GetPartyMonByIndex(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData), partyId);
Pokemon *mon = GetPartyMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyId);
LoadUserFrameGfx1(ctx->fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 0x3D9, 11, 0, HEAP_ID_4);
*pokepicManager = DrawPokemonPicFromMon(ctx->fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 10, 5, 11, 0x3D9, mon, HEAP_ID_4);
u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
@ -2507,7 +2502,7 @@ BOOL ScrCmd_NamePokemonScreen(ScriptContext *ctx) { //00BB
FieldSystem *fieldSystem = ctx->fieldSystem;
u16 partyPos = ScriptGetVar(ctx);
PlayerParty *party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
Party *party = SaveArray_Party_Get(fieldSystem->saveData);
Pokemon *mon = GetPartyMonByIndex(party, partyPos);
u16 monNick[20];
@ -2660,7 +2655,7 @@ BOOL ScrCmd_Defog(ScriptContext *ctx) { //00C4
BOOL ScrCmd_Cut(ScriptContext *ctx) { //00C5
void **miscData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); //todo identify
u16 partyPosition = ScriptGetVar(ctx);
Pokemon *mon = GetPartyMonByIndex(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData), partyPosition);
Pokemon *mon = GetPartyMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition);
u32 gender = PlayerAvatar_GetGender(ctx->fieldSystem->playerAvatar);
*miscData = ov06_0224666C(ctx->fieldSystem, 0, mon, gender);
SetupNativeScript(ctx, sub_0203C9F8);
@ -3274,7 +3269,7 @@ BOOL ScrCmd_GetPlayerGender(ScriptContext *ctx) { //014D
BOOL ScrCmd_HealParty(ScriptContext *ctx) { //014E
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(ctx->taskManager);
HealParty(SaveArray_PlayerParty_Get(fieldSystem->saveData));
HealParty(SaveArray_Party_Get(fieldSystem->saveData));
return FALSE;
}
@ -3848,7 +3843,7 @@ BOOL ScrCmd_KeepSafariTrain(ScriptContext *ctx) { //020E
BOOL ScrCmd_MoveSafariTrain(ScriptContext *ctx) { //020F
u16 *var = ScriptGetVarPointer(ctx);
u16 type = ScriptReadHalfword(ctx);
sub_0200433C(65, 0, 0);
sub_0200433C(65, SEQ_PV001, 0);
ov06_0224525C(ctx->fieldSystem, *var, type);
return TRUE;
}
@ -3980,7 +3975,7 @@ BOOL ScrCmd_NationalDex(ScriptContext *ctx) { //022D
BOOL ScrCmd_GetTotalPokemonEVs(ScriptContext *ctx) { //0233
u16 *var = ScriptGetVarPointer(ctx);
u16 partyPosition = ScriptGetVar(ctx);
Pokemon *mon = GetPartyMonByIndex(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData), partyPosition);
Pokemon *mon = GetPartyMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition);
u32 hpEv = GetMonData(mon, MON_DATA_HP_EV, NULL);
u32 atkEv = GetMonData(mon, MON_DATA_ATK_EV, NULL);
@ -4011,7 +4006,7 @@ BOOL ScrCmd_GetPokemonFootprint(ScriptContext *ctx) { //023A
u16 *var = ScriptGetVarPointer(ctx);
u16 *var2 = ScriptGetVarPointer(ctx);
u16 partyPosition = ScriptGetVar(ctx);
Pokemon *mon = GetPartyMonByIndex(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData), partyPosition);
Pokemon *mon = GetPartyMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition);
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
*var = ov05_021F61E8(species);
*var2 = ov05_021F61DC(species);
@ -4052,7 +4047,7 @@ BOOL ScrCmd_GiveWallpaper(ScriptContext *ctx) { //0249 - used for easy chat unlo
FieldSystem *fieldSystem = ctx->fieldSystem;
PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveDataPtr(fieldSystem));
u16 *var = ScriptGetVarPointer(ctx);
PCStorage *pcStorage = GetStoragePCPointer(fieldSystem->saveData);
PCStorage *pcStorage = Save_PCStorage_Get(fieldSystem->saveData);
u16 unk0 = ScriptGetVar(ctx);
u16 unk1 = ScriptGetVar(ctx);
u16 unk2 = ScriptGetVar(ctx);
@ -4113,7 +4108,7 @@ static void Script_SetMonSeenFlagBySpecies(FieldSystem *fieldSystem, u16 species
BOOL ScrCmd_CountPCFreeSpace(ScriptContext *ctx) { //0252
u16 *var = ScriptGetVarPointer(ctx);
u16 count = PCStorage_CountMonsAndEggsInAllBoxes(GetStoragePCPointer(ctx->fieldSystem->saveData));
u16 count = PCStorage_CountMonsAndEggsInAllBoxes(Save_PCStorage_Get(ctx->fieldSystem->saveData));
*var = MONS_PER_BOX * NUM_BOXES - count;
return FALSE;
}
@ -4176,13 +4171,13 @@ BOOL ScrCmd_AddSpecialGameStat(ScriptContext *ctx) { //0260
BOOL ScrCmd_CheckPokemonInParty(ScriptContext *ctx) { //0262
u16 species = ScriptGetVar(ctx);
u16 *var = ScriptGetVarPointer(ctx);
*var = PartyHasMon(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData), species);
*var = PartyHasMon(SaveArray_Party_Get(ctx->fieldSystem->saveData), species);
return TRUE;
}
BOOL ScrCmd_SetDeoxysForm(ScriptContext *ctx) { //0263
u16 form = ScriptGetVar(ctx);
PlayerParty *playerParty = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
Party *playerParty = SaveArray_Party_Get(ctx->fieldSystem->saveData);
s32 partyCount = GetPartyCount(playerParty);
Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData);
@ -4200,7 +4195,7 @@ BOOL ScrCmd_SetDeoxysForm(ScriptContext *ctx) { //0263
#ifdef NONMATCHING
BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) { //0264
u16 *var = ScriptGetVarPointer(ctx);
PlayerParty *playerParty = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
Party *playerParty = SaveArray_Party_Get(ctx->fieldSystem->saveData);
s32 partyCount = GetPartyCount(playerParty);
u32 unk0[PARTY_SIZE];
@ -4244,7 +4239,7 @@ asm BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) {
str r0, [sp, #0x0]
ldr r0, [r4, #0x0]
ldr r0, [r0, #0xc]
bl SaveArray_PlayerParty_Get
bl SaveArray_Party_Get
str r0, [sp, #0xc]
bl GetPartyCount
add r2, sp, #0x18

View File

@ -6,7 +6,7 @@
#include "pokemon_storage_system.h"
#include "unk_0202C144.h"
extern struct PCStorage* GetStoragePCPointer(struct SaveData* save);
extern struct PCStorage* Save_PCStorage_Get(struct SaveData* save);
extern void* sub_02022528(struct SaveData* save);
extern void sub_0202BEDC(struct Pokemon* pokemon);
extern void sub_0202BFD8(void* a0, s32 a1, struct Pokemon* pokemon);
@ -64,7 +64,7 @@ BOOL ScrCmd_Unk0254(struct ScriptContext* ctx) //0254
BOOL ScrCmd_Unk0255(struct ScriptContext* ctx) //0255
{
void* unk = sub_02022528(ctx->fieldSystem->saveData);
struct PCStorage* pc = GetStoragePCPointer(ctx->fieldSystem->saveData);
struct PCStorage* pc = Save_PCStorage_Get(ctx->fieldSystem->saveData);
struct Pokemon* pokemon = AllocMonZeroed(HEAP_ID_32);
PlayerProfile* player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData);
struct Pokedex* pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); // unused

View File

@ -6,15 +6,15 @@
extern void* FieldSysGetAttrAddr(struct FieldSystem*, int idx);
extern void ov05_021EC57C(struct PlayerParty* party, u8 idx, struct Daycare* daycare, struct SaveData* save);
extern u16 ov05_021EC71C(struct PlayerParty* party, MessageFormat *messageFormat, struct Daycare* daycare, u8 idx);
extern void ov05_021EC57C(struct Party* party, u8 idx, struct Daycare* daycare, struct SaveData* save);
extern u16 ov05_021EC71C(struct Party* party, MessageFormat *messageFormat, struct Daycare* daycare, u8 idx);
extern u16 ov05_021EC854(struct Daycare* daycare, u8 idx, MessageFormat *messageFormat);
extern u8 ov05_021EC864(struct Daycare* daycare, int idx, MessageFormat *messageFormat);
extern void ov05_021ECD64(struct Daycare* daycare);
extern void ov05_Daycare_GiveEggToPlayer(struct Daycare* daycare, struct PlayerParty* party, PlayerProfile* player);
extern void ov05_Daycare_GiveEggToPlayer(struct Daycare* daycare, struct Party* party, PlayerProfile* player);
extern void ov05_021ED4E0(struct Daycare* daycare, MessageFormat *messageFormat);
extern void ov05_021ED52C(struct Daycare* daycare, u8 idx1, u8 idx2, u8 idx3, u8 idx4, MessageFormat *messageFormat);
extern u16 ov05_021ED5C4(struct PlayerParty* party, int idx, MessageFormat *messageFormat);
extern u16 ov05_021ED5C4(struct Party* party, int idx, MessageFormat *messageFormat);
extern u16 ov05_021ED5EC(struct Daycare* daycare);
extern u32 ov05_021ED644(struct Daycare* daycare);
@ -53,7 +53,7 @@ BOOL ScrCmd_GiveDaycareEgg(struct ScriptContext* ctx) //01A9
{
struct FieldSystem* fieldSystem = ctx->fieldSystem;
struct Daycare* daycare = SaveArray_Get(fieldSystem->saveData, 8);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct SaveData* save = FieldSystem_GetSaveDataPtr(ctx->fieldSystem);
PlayerProfile* player = Save_PlayerData_GetProfileAddr(save);
@ -70,7 +70,7 @@ BOOL ScrCmd_Unk01A4(struct ScriptContext* ctx) //01A4
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 idx = ScriptGetVar(ctx);
struct Daycare* daycare = SaveArray_Get(save, 8);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
*ret_ptr = ov05_021EC71C(party, *messageFormat, daycare, (u8)idx);
@ -111,7 +111,7 @@ BOOL ScrCmd_Unk01AF(struct ScriptContext* ctx) //01AF
u16 unused = ScriptReadHalfword(ctx);
u16 idx = ScriptGetVar(ctx);
u16* ret_ptr = ScriptGetVarPointer(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
*ret_ptr = ov05_021ED5C4(party, idx, *messageFormat);
@ -123,7 +123,7 @@ BOOL ScrCmd_Unk01B0(struct ScriptContext* ctx) //01B0
struct FieldSystem* fieldSystem = ctx->fieldSystem;
struct SaveData* save = fieldSystem->saveData;
u16 idx = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Daycare* daycare = SaveArray_Get(save, 8);
ov05_021EC57C(party, (u8)idx, daycare, save);

View File

@ -13,7 +13,7 @@ extern void sub_0205ECFC(struct SaveVarsFlags* state);
extern BOOL sub_0205ED0C(struct SaveVarsFlags* state);
extern void sub_0205ED1C(struct SaveVarsFlags* state);
extern void sub_0205ED2C(struct SaveVarsFlags* state);
extern BOOL sub_0205ED3C(struct SaveVarsFlags* state);
extern BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags* state);
extern void sub_0205ED4C(struct SaveVarsFlags* state);
extern void sub_0205ED5C(struct SaveVarsFlags* state);
extern BOOL sub_0205ED6C(struct SaveVarsFlags* state);
@ -136,7 +136,7 @@ BOOL ScrCmd_Unk0160(struct ScriptContext* ctx) //0160 - todo: HasPartner? CheckP
u16* ret_ptr = ScriptGetVarPointer(ctx);
struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData);
*ret_ptr = (u16)sub_0205ED3C(state);
*ret_ptr = (u16)Save_VarsFlags_CheckHaveFollower(state);
return FALSE;
}

View File

@ -46,7 +46,7 @@ BOOL ScrCmd_Unk021E(struct ScriptContext* ctx) //021E
BOOL ScrCmd_Unk021F(struct ScriptContext* ctx) { //021F
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_idx = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
u16 *eligibleMoves = GetEligibleLevelUpMoves(pokemon, HEAP_ID_32);
@ -84,7 +84,7 @@ BOOL ScrCmd_Unk0220(struct ScriptContext* ctx) //0220
BOOL ScrCmd_Unk0221(struct ScriptContext* ctx) //0221 - todo: RememberMove?
{
u16 mon_idx = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
u16 *eligibleMoves = GetEligibleLevelUpMoves(pokemon, HEAP_ID_32);
@ -96,7 +96,7 @@ BOOL ScrCmd_Unk0224(struct ScriptContext* ctx) //0224 - todo: TeachMove?
{
u16 mon_idx = ScriptGetVar(ctx);
u16 move = ScriptGetVar(ctx);
struct PlayerParty *party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon *pokemon = GetPartyMonByIndex(party, mon_idx);
u16 *eligibleMoves = AllocFromHeap(HEAP_ID_32, 2 * sizeof(u16));

View File

@ -18,7 +18,7 @@ extern void *FieldSysGetAttrAddr(FieldSystem *fieldSystem, int idx);
extern u32 sub_020536D0(u32 gender, u32 avatar, u32 a2);
extern u32 Save_VarsFlags_GetStarter(SaveVarsFlags *state);
extern u32 sub_0205F398(SaveVarsFlags *state);
extern PCStorage *GetStoragePCPointer(SaveData *save);
extern PCStorage *Save_PCStorage_Get(SaveData *save);
extern u32 sub_0205F3C0(SaveVarsFlags *state);
extern u32 sub_02054C14(u32 number);
@ -65,7 +65,7 @@ BOOL ScrCmd_GetPokemonName(ScriptContext *ctx) //00D0 - todo: BufferPartyPokemon
MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT);
u8 idx = ScriptReadByte(ctx);
u16 mon_idx = ScriptGetVar(ctx);
PlayerParty *party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
Party *party = SaveArray_Party_Get(fieldSystem->saveData);
Pokemon *mon = GetPartyMonByIndex(party, mon_idx);
BufferBoxMonSpeciesName(*messageFormat, idx, &mon->box);
@ -157,7 +157,7 @@ BOOL ScrCmd_GetPokemonNickname(ScriptContext *ctx) //00D6 - todo: BufferPartyPok
MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT);
u8 idx = ScriptReadByte(ctx);
u16 mon_idx = ScriptGetVar(ctx);
PlayerParty *party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
Party *party = SaveArray_Party_Get(fieldSystem->saveData);
Pokemon *pokemon = GetPartyMonByIndex(party, mon_idx);
BufferBoxMonNickname(*messageFormat, idx, &pokemon->box);
@ -168,7 +168,7 @@ BOOL ScrCmd_GetPokemonNickname(ScriptContext *ctx) //00D6 - todo: BufferPartyPok
BOOL ScrCmd_Unk0251(ScriptContext *ctx) //0251 - todo: BufferBoxPokemonNickname? TextBoxPokemonNickname?
{
FieldSystem *fieldSystem = ctx->fieldSystem;
PCStorage *pc = GetStoragePCPointer(fieldSystem->saveData);
PCStorage *pc = Save_PCStorage_Get(fieldSystem->saveData);
MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT);
u8 idx = ScriptReadByte(ctx);
u16 box_mon_idx = ScriptGetVar(ctx);
@ -390,7 +390,7 @@ BOOL ScrCmd_GetPokemonMoveName(ScriptContext *ctx) //01CB - todo: BufferPartyPok
u8 idx = ScriptReadByte(ctx);
u16 mon_idx = ScriptGetVar(ctx);
u16 mon_move_idx = ScriptGetVar(ctx);
PlayerParty *party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
Party *party = SaveArray_Party_Get(fieldSystem->saveData);
Pokemon *pokemon = GetPartyMonByIndex(party, mon_idx);
u16 move = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + mon_move_idx, NULL);

View File

@ -22,7 +22,7 @@ BOOL ScrCmd_GiveMon(struct ScriptContext* ctx) //0096 - todo: GivePokemon?
u16 level = ScriptGetVar(ctx);
u16 item = ScriptGetVar(ctx);
u16 * varPtr = ScriptGetVarPointer(ctx);
struct PlayerParty * party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party * party = SaveArray_Party_Get(fieldSystem->saveData);
*varPtr = (u16)GiveMon(HEAP_ID_FIELD, fieldSystem->saveData, species, (u8)level, item, mapSec, 12);
return FALSE;
}
@ -35,7 +35,7 @@ BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext* ctx) //0198 - todo: GetPart
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* mon_slot = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); //for some reason this is *required* for matching, cannot use ScriptGetVarPointer here
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, *mon_slot);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -61,7 +61,7 @@ BOOL ScrCmd_CheckPartyMonOTID(struct ScriptContext* ctx) //0199 - todo: CheckPar
u16* mon_slot = ScriptGetVarPointer(ctx);
u16* ret_ptr = ScriptGetVarPointer(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, *mon_slot);
u16 party_mon_otid = (u16)GetMonData(party_mon, MON_DATA_OTID, NULL);
@ -84,7 +84,7 @@ BOOL ScrCmd_GiveEgg(struct ScriptContext* ctx) //0097
PlayerProfile* player = Save_PlayerData_GetProfileAddr(fieldSystem->saveData);
u16 species = ScriptGetVar(ctx);
u16 unk = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
u8 party_count = (u8)GetPartyCount(party);
if (party_count < PARTY_SIZE)
@ -107,7 +107,7 @@ BOOL ScrCmd_SetPartyMonMove(struct ScriptContext* ctx) //0098 - todo: ReplacePar
u16 mon_slot = ScriptGetVar(ctx);
u16 move_slot = ScriptGetVar(ctx);
u16 move = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
PartyMonSetMoveInSlot(party, mon_slot, move_slot, move);
@ -120,7 +120,7 @@ BOOL ScrCmd_PartyMonHasMove(struct ScriptContext* ctx) //0099
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 required_move = ScriptGetVar(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = 0;
@ -147,12 +147,12 @@ BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext* ctx) //009A - todo: Check
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 required_move = ScriptGetVar(ctx);
u8 party_count = (u8)GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
u8 party_count = (u8)GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
u8 i;
for (i = 0, *ret_ptr = PARTY_SIZE; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -176,7 +176,7 @@ BOOL ScrCmd_SurvivePsn(struct ScriptContext* ctx) //01F7
{
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)SurvivePoisoning(party_mon);
@ -191,12 +191,12 @@ BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext* ctx) //01F6
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 highest_level = ScriptGetVar(ctx);
party_count = (u8)GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
party_count = (u8)GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
u8 mons;
for (i = 0, mons = 0, *ret_ptr = 0; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -219,7 +219,7 @@ BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext* ctx) //0278
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = 0;
@ -238,7 +238,7 @@ BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx) //0212
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
u8 party_count = (u8)GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
u8 party_count = (u8)GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
if (mon_slot >= party_count)
{
@ -246,7 +246,7 @@ BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx) //0212
return FALSE;
}
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -265,12 +265,12 @@ BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext* ctx) //0213 - todo: Che
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 required_nature = ScriptGetVar(ctx);
u8 party_count = (u8)GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
u8 party_count = (u8)GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
u8 i;
for (i = 0, *ret_ptr = 0xFF; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -293,7 +293,7 @@ BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext* ctx) //01B9
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)GetMonData(party_mon, MON_DATA_FRIENDSHIP, NULL);
@ -306,7 +306,7 @@ BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext* ctx) //01BA
u16 friendship_to_add = ScriptGetVar(ctx);
u16 mon_slot = ScriptGetVar(ctx);
u16 map_sec = MapHeader_GetMapSec(ctx->fieldSystem->location->mapId);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
u16 friendship = (u16)GetMonData(party_mon, MON_DATA_FRIENDSHIP, NULL);
@ -349,7 +349,7 @@ BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext* ctx) //01BB
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16 friendship_to_deplete = ScriptGetVar(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
u16 friendship = (u16)GetMonData(party_mon, MON_DATA_FRIENDSHIP, NULL);
@ -372,7 +372,7 @@ BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext* ctx) //0281
u16 mon_slot = ScriptGetVar(ctx);
u16 contest_condition_id = ScriptGetVar(ctx);
u16* ret_ptr = ScriptGetVarPointer(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)GetMonData(party_mon, MON_DATA_COOL + contest_condition_id, NULL);
@ -393,7 +393,7 @@ BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext* ctx) //0248
u16* type1 = ScriptGetVarPointer(ctx);
u16* type2 = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*type1 = (u16)GetMonData(party_mon, MON_DATA_TYPE_1, NULL);
@ -405,7 +405,7 @@ BOOL ScrCmd_CountPartyMons(struct ScriptContext* ctx) //0177
{
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
*ret_ptr = (u16)GetPartyCount(party);
return FALSE;
@ -418,11 +418,11 @@ BOOL ScrCmd_CountPartyMons_OmitEggs(struct ScriptContext* ctx) //019A
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
s32 party_count = GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
s32 party_count = GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
for (i = 0, non_egg_mons = 0; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -445,7 +445,7 @@ BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext* ctx) //019B
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
slot_to_ignore = ScriptGetVar(ctx);
party_count = GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
party_count = GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
u32 available_mons;
s32 i;
@ -453,7 +453,7 @@ BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext* ctx) //019B
{
if (i != slot_to_ignore)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -479,14 +479,14 @@ BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext* ctx) //019C
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
pc = GetStoragePCPointer(fieldSystem->saveData);
party_count = GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
pc = Save_PCStorage_Get(fieldSystem->saveData);
party_count = GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
u32 mons;
s32 i;
for (i = 0, mons = 0; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -511,12 +511,12 @@ BOOL ScrCmd_GetPartyEggCount(struct ScriptContext* ctx) //019D
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
party_count = GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
party_count = GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
s32 i;
for (i = 0, eggs_in_party = 0; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -537,11 +537,11 @@ BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext* ctx) //0119
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
party_count = (u16)GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
party_count = (u16)GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
for (i = 0, *ret_ptr = 0; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_has_pokerus = (BOOL)GetMonData(party_mon, MON_DATA_POKERUS, NULL);
@ -559,7 +559,7 @@ BOOL ScrCmd_GetPartyMonGender(struct ScriptContext* ctx) //011A
{
u16 mon_slot = ScriptGetVar(ctx);
u16* ret_ptr = ScriptGetVarPointer(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)GetMonData(party_mon, MON_DATA_GENDER, NULL);
@ -574,7 +574,7 @@ BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx) //01C8
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
party_mon = GetPartyMonByIndex(party, mon_slot);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -619,7 +619,7 @@ BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext* ctx) //01C9
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16 mon_slot = ScriptGetVar(ctx);
u16 move_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
sub_020699A4(party_mon, move_slot);
@ -633,7 +633,7 @@ BOOL ScrCmd_GetPartyMonMove(struct ScriptContext* ctx) //01CA
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
u16 move_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)GetMonData(party_mon, MON_DATA_MOVE1 + move_slot, NULL);
@ -645,7 +645,7 @@ BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext* ctx) //01EE
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)GetMonData(party_mon, MON_DATA_HELD_ITEM, NULL);
@ -656,7 +656,7 @@ BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext* ctx) //01F0
{
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
u16 party_mon_held_item = ITEM_NONE;
@ -670,12 +670,12 @@ BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext* ctx) //01C0
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 species = ScriptGetVar(ctx);
u8 party_count = (u8)GetPartyCount(SaveArray_PlayerParty_Get(fieldSystem->saveData));
u8 party_count = (u8)GetPartyCount(SaveArray_Party_Get(fieldSystem->saveData));
u8 i;
for (i = 0, *ret_ptr = 0; i < party_count; i++)
{
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, i);
BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL);
@ -697,7 +697,7 @@ BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext* ctx) //022E
{
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
u16 ribbon_idx;
@ -717,13 +717,13 @@ BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext* ctx) //022E
BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext* ctx) //022F
{
struct PlayerParty* party;
struct Party* party;
u16 ribbon_idx;
u16 ribbons;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 party_count = (u16)GetPartyCount(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData));
party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
u16 party_count = (u16)GetPartyCount(SaveArray_Party_Get(ctx->fieldSystem->saveData));
party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
for (ribbon_idx = 0, ribbons = 0; ribbon_idx < 80; ribbon_idx++)
{
@ -757,7 +757,7 @@ BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext* ctx) //0230
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 mon_slot = ScriptGetVar(ctx);
u16 ribbon_idx = ScriptGetVar(ctx);
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
*ret_ptr = (u16)GetMonData(party_mon, sub_0207FC5C((u8)ribbon_idx, 0), NULL);
@ -769,7 +769,7 @@ BOOL ScrCmd_GivePartyMonRibbon(struct ScriptContext* ctx) //0231
u16 mon_slot = ScriptGetVar(ctx);
u16 ribbon_idx = ScriptGetVar(ctx);
u8 mon_has_ribbon = TRUE;
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
SetMonData(party_mon, (s32)sub_0207FC5C((u8)ribbon_idx, 0), &mon_has_ribbon);
@ -782,8 +782,8 @@ BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext* ctx) //02B7
u16 ribbon_idx;
u16* ret_ptr = ScriptGetVarPointer(ctx);
u16 party_count = (u16)GetPartyCount(SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData));
struct PlayerParty* party = SaveArray_PlayerParty_Get(ctx->fieldSystem->saveData);
u16 party_count = (u16)GetPartyCount(SaveArray_Party_Get(ctx->fieldSystem->saveData));
struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData);
// BUG: Probably a copy-paste fail. Checks if your party has a Bad Egg in it,
// 80 times.

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "scrcmd.h"
#include "constants/sndseq.h"
#include "unk_020040F4.h"
#include "sound_chatot.h"
@ -245,7 +246,7 @@ BOOL ScrCmd_SaveChatotCry(struct ScriptContext* ctx) //005C
BOOL ScrCmd_Unk005D(struct ScriptContext* ctx) //005D - todo: LoadSpearPillarAudio?
{
#pragma unused(ctx)
sub_0200433C(0x3F, 0, 0);
sub_0200433C(0x3F, SEQ_PV001, 0);
return TRUE;
}

View File

@ -24,7 +24,7 @@ BOOL GiveMon(HeapID heapId, struct SaveData * save, u16 species, u8 level, u16 i
{
u32 ptr;
PlayerProfile * data = Save_PlayerData_GetProfileAddr(save);
struct PlayerParty * party = SaveArray_PlayerParty_Get(save);
struct Party * party = SaveArray_Party_Get(save);
struct Pokemon * mon = AllocMonZeroed(heapId);
ZeroMonData(mon);
CreateMon(mon, species, level, 32, 0, 0, OT_ID_PLAYER_ID, 0);
@ -45,7 +45,7 @@ BOOL GiveEgg(HeapID heapId, struct SaveData * save, u16 species, int level, int
{
#pragma unused(heapId)
PlayerProfile * data = Save_PlayerData_GetProfileAddr(save);
struct PlayerParty * party = SaveArray_PlayerParty_Get(save);
struct Party * party = SaveArray_Party_Get(save);
struct Pokemon * mon = AllocMonZeroed(HEAP_ID_32);
ZeroMonData(mon);
ov05_SetEggStats(mon, species, level, data, 4, sub_02015CF8(metLocIndex, a3));
@ -54,13 +54,13 @@ BOOL GiveEgg(HeapID heapId, struct SaveData * save, u16 species, int level, int
return isAdded;
}
void PartyMonSetMoveInSlot(struct PlayerParty * party, int partySlot, int moveSlot, u16 move)
void PartyMonSetMoveInSlot(struct Party * party, int partySlot, int moveSlot, u16 move)
{
struct Pokemon * mon = GetPartyMonByIndex(party, partySlot);
MonSetMoveInSlot(mon, move, (u8)moveSlot);
}
int GetIdxOfFirstPartyMonWithMove(struct PlayerParty * party, int move)
int GetIdxOfFirstPartyMonWithMove(struct Party * party, int move)
{
int partyCount = GetPartyCount(party);
@ -79,7 +79,7 @@ int GetIdxOfFirstPartyMonWithMove(struct PlayerParty * party, int move)
return 0xFF;
}
int CountAlivePokemon(struct PlayerParty * party)
int CountAlivePokemon(struct Party * party)
{
int partyCount = GetPartyCount(party);
int i;
@ -95,7 +95,7 @@ int CountAlivePokemon(struct PlayerParty * party)
return aliveCount;
}
struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct PlayerParty * party)
struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct Party * party)
{
int i;
int partyCount = GetPartyCount(party);
@ -111,7 +111,7 @@ struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct PlayerParty * party)
return 0;
}
struct Pokemon * GetFirstNonEggInParty(struct PlayerParty * party)
struct Pokemon * GetFirstNonEggInParty(struct Party * party)
{
u16 i;
u16 partyCount = (u16)GetPartyCount(party);
@ -126,12 +126,12 @@ struct Pokemon * GetFirstNonEggInParty(struct PlayerParty * party)
return 0;
}
BOOL HasEnoughAlivePokemonForDoubleBattle(struct PlayerParty * party)
BOOL HasEnoughAlivePokemonForDoubleBattle(struct Party * party)
{
return (CountAlivePokemon(party) >= 2);
}
void GiveAllMonsTheSinnohChampRibbon(struct PlayerParty * party)
void GiveAllMonsTheSinnohChampRibbon(struct Party * party)
{
u8 var = 1;
int partyCount = GetPartyCount(party);
@ -148,7 +148,7 @@ void GiveAllMonsTheSinnohChampRibbon(struct PlayerParty * party)
}
}
int ApplyPoisonStep(struct PlayerParty * party, int location)
int ApplyPoisonStep(struct Party * party, int location)
{
u32 hp;
int numPoisoned = 0;

View File

@ -3,7 +3,7 @@
#include "script.h"
#include "heap.h"
struct TaskManager *FieldSys_CreateTask(struct FieldSystem * fieldSystem, TaskFunc taskFunc, void *env)
struct TaskManager *Task_New(struct FieldSystem * fieldSystem, TaskFunc taskFunc, void *env)
{
struct TaskManager *taskManager = AllocFromHeapAtEnd(HEAP_ID_32, sizeof(struct TaskManager));
taskManager->prev = NULL;
@ -17,13 +17,13 @@ struct TaskManager *FieldSys_CreateTask(struct FieldSystem * fieldSystem, TaskFu
return taskManager;
}
void sub_020463CC(struct FieldSystem * fieldSystem, TaskFunc taskFunc, void *env)
void FieldSystem_CreateTask(struct FieldSystem * fieldSystem, TaskFunc taskFunc, void *env)
{
GF_ASSERT(fieldSystem->taskManager == NULL);
fieldSystem->taskManager = FieldSys_CreateTask(fieldSystem, taskFunc, env);
fieldSystem->taskManager = Task_New(fieldSystem, taskFunc, env);
}
void sub_020463EC(struct TaskManager *taskManager, TaskFunc taskFunc, void *env)
void TaskManager_Jump(struct TaskManager *taskManager, TaskFunc taskFunc, void *env)
{
taskManager->func = taskFunc;
taskManager->state = 0;
@ -38,7 +38,7 @@ void sub_020463EC(struct TaskManager *taskManager, TaskFunc taskFunc, void *env)
void TaskManager_Call(struct TaskManager *taskManager, TaskFunc taskFunc, void *env)
{
struct TaskManager *taskManager2 = FieldSys_CreateTask(taskManager->fieldSystem, taskFunc, env);
struct TaskManager *taskManager2 = Task_New(taskManager->fieldSystem, taskFunc, env);
taskManager2->prev = taskManager;
taskManager->fieldSystem->taskManager = taskManager2;
}
@ -66,7 +66,7 @@ BOOL sub_0204646C(struct TaskManager *taskManager)
return (taskManager->unk10 != NULL);
}
BOOL sub_0204647C(struct FieldSystem *fieldSystem)
BOOL FieldSystem_ApplicationIsRunning(struct FieldSystem *fieldSystem)
{
return (sub_0203739C(fieldSystem) || sub_020373C4(fieldSystem));
}
@ -84,7 +84,7 @@ BOOL sub_020464A4(void * r0)
BOOL sub_020464B8(struct TaskManager *taskManager)
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
u32 * r4_2 = sub_0204652C(taskManager);
u32 * r4_2 = TaskManager_GetEnvironment(taskManager);
switch (r4_2[0])
{
case 0:
@ -92,7 +92,7 @@ BOOL sub_020464B8(struct TaskManager *taskManager)
r4_2[0]++;
break;
case 1:
if (!sub_0204647C(fieldSystem))
if (!FieldSystem_ApplicationIsRunning(fieldSystem))
{
FreeToHeap(r4_2);
return TRUE;
@ -116,12 +116,12 @@ struct FieldSystem *TaskManager_GetFieldSystem(struct TaskManager *taskManager)
return taskManager->fieldSystem;
}
void * sub_0204652C(struct TaskManager *taskManager)
void * TaskManager_GetEnvironment(struct TaskManager *taskManager)
{
return taskManager->env;
}
u32 * sub_02046530(struct TaskManager *taskManager)
u32 * TaskManager_GetStatePtr(struct TaskManager *taskManager)
{
return &taskManager->state;
}

View File

@ -208,7 +208,7 @@ BOOL sub_02004180(s32 param0)
return res;
}
BOOL sub_0200433C(u8 param0, int param1, u32 param2)
BOOL sub_0200433C(u8 param0, u16 param1, u32 param2)
{
u8 *st0 = sub_02003D38(20);
u8 *st4 = sub_02003D38(21);

View File

@ -7,7 +7,7 @@ SafariZone *Save_SafariZone_Get(struct SaveData *save)
return SaveArray_Get(save, SAVE_SAFARI_ZONE);
}
struct PCStorage *GetStoragePCPointer(struct SaveData *save)
struct PCStorage *Save_PCStorage_Get(struct SaveData *save)
{
return SaveArray_Get(save, 35);
}

View File

@ -9,13 +9,13 @@ extern void ov05_021E3444(u32, struct FieldSystem *, u32);
BOOL sub_0204AEA8(struct TaskManager *taskManager)
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
u32 *v1 = sub_0204652C(taskManager);
u32 *v1 = TaskManager_GetEnvironment(taskManager);
switch (v1[0])
{
case 0:
ov05_021E3444(v1[2], fieldSystem, (u32)v1 + 4);
sub_0200433C(5, (u16)v1[3], 1);
sub_0200433C(5, v1[3], 1);
v1[0]++;
break;
case 1:
@ -30,14 +30,14 @@ BOOL sub_0204AEA8(struct TaskManager *taskManager)
return FALSE;
}
void sub_0204AEF8(struct TaskManager *taskManager, u32 a1, u32 a2)
void sub_0204AEF8(struct TaskManager *taskManager, u32 a1, u32 a2) //taskManager, effect, bgm
{
u32 *v0 = AllocFromHeapAtEnd(HEAP_ID_FIELD, 4 * sizeof(u32));
u32 *v0 = AllocFromHeapAtEnd(HEAP_ID_FIELD, 4 * sizeof(u32)); //todo: make a struct
v0[0] = 0;
v0[1] = 0;
v0[2] = a1;
v0[3] = a2;
v0[0] = 0; //state
v0[1] = 0; //unk
v0[2] = a1; //effect
v0[3] = a2; //bgm
TaskManager_Call(taskManager, sub_0204AEA8, v0);
}

View File

@ -18,7 +18,7 @@ BOOL sub_0204AF24(struct TaskManager *taskManager)
void sub_0204AF3C(struct TaskManager *taskManager)
{
struct FieldSystem * fieldSystem= TaskManager_GetFieldSystem(taskManager);
struct FieldSystem * fieldSystem = TaskManager_GetFieldSystem(taskManager);
if(!sub_0203739C(fieldSystem))
{
GF_ASSERT(FALSE);
@ -37,7 +37,7 @@ BOOL sub_0204AF6C(struct TaskManager *taskManager)
return FALSE;
}
void sub_0204AF84(struct TaskManager *taskManager) //TODO: RestoreOverworld
void CallTask_RestoreOverworld(struct TaskManager *taskManager) //TODO: RestoreOverworld
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
if(sub_0203739C(fieldSystem))
@ -49,7 +49,7 @@ void sub_0204AF84(struct TaskManager *taskManager) //TODO: RestoreOverworld
TaskManager_Call(taskManager, &sub_0204AF6C, NULL);
}
BOOL sub_0204AFB4(struct TaskManager *taskManager)
BOOL Task_ProcessFade(struct TaskManager *taskManager)
{
#pragma unused(taskManager)
if(IsPaletteFadeFinished())
@ -59,18 +59,18 @@ BOOL sub_0204AFB4(struct TaskManager *taskManager)
return FALSE;
}
void sub_0204AFC8(struct TaskManager *taskManager)
void CallTask_FadeToBlack(struct TaskManager *taskManager)
{
if(!sub_0203739C(TaskManager_GetFieldSystem(taskManager)))
{
GF_ASSERT(0);
return;
}
BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, HEAP_ID_4);
TaskManager_Call(taskManager, &sub_0204AFB4, 0);
BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, HEAP_ID_4); //TODO: find constants for palette fade
TaskManager_Call(taskManager, Task_ProcessFade, 0);
}
void sub_0204B00C(struct TaskManager *taskManager)
void CallTask_FadeFromBlack(struct TaskManager *taskManager)
{
if(!sub_0203739C(TaskManager_GetFieldSystem(taskManager)))
{
@ -78,16 +78,16 @@ void sub_0204B00C(struct TaskManager *taskManager)
return;
}
BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, HEAP_ID_4);
TaskManager_Call(taskManager, sub_0204AFB4, 0);
TaskManager_Call(taskManager, Task_ProcessFade, 0);
}
BOOL sub_0204B050(struct TaskManager *taskManager)
{
u32 * r4 = sub_02046530(taskManager);
u32 * r4 = TaskManager_GetStatePtr(taskManager);
switch(r4[0])
{
case 0:
sub_0204AFC8(taskManager);
CallTask_FadeToBlack(taskManager);
r4[0]++;
break;
case 1:
@ -109,17 +109,17 @@ void sub_0204B090(struct TaskManager *taskManager)
BOOL sub_0204B0A0(struct TaskManager *taskManager)
{
u32 * r4 = sub_02046530(taskManager);
u32 * r4 = TaskManager_GetStatePtr(taskManager);
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
switch(r4[0])
{
case 0:
sub_0204AF84(taskManager);
CallTask_RestoreOverworld(taskManager);
r4[0]++;
break;
case 1:
ov05_021E331C(fieldSystem);
sub_0204B00C(taskManager);
CallTask_FadeFromBlack(taskManager);
r4[0]++;
break;
case 2:

View File

@ -92,7 +92,7 @@ void sub_0204B1DC(struct FieldSystem *fieldSystem, s32 a1)
u32 unk1 = sub_020287A4(unk_sav_ptr1);
sub_0202A988(unk_sav_ptr2, unk1);
struct PlayerParty* party = SaveArray_PlayerParty_Get(fieldSystem->saveData);
struct Party* party = SaveArray_Party_Get(fieldSystem->saveData);
Party_UpdatePokerus(party, a1);
struct SaveVarsFlags* state = Save_VarsFlags_Get(fieldSystem->saveData);

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "proto.h"
#include "unk_0205EC84.h"
#include "constants/flags.h"
#include "constants/sndseq.h"
#include "constants/maps.h"
@ -72,7 +73,7 @@ void sub_0205ED2C(struct SaveVarsFlags * state)
_flag_clear(state, 0x961);
}
BOOL sub_0205ED3C(struct SaveVarsFlags * state)
BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags * state)
{
return _flag_check(state, 0x961);
}
@ -353,17 +354,17 @@ BOOL sub_0205F1E4(struct SaveVarsFlags * state)
void Save_VarsFlags_SetSafariSysFlag(struct SaveVarsFlags * state)
{
_flag_set(state, 0x967);
_flag_set(state, FLAG_SYS_SAFARI);
}
void Save_VarsFlags_ClearSafariSysFlag(struct SaveVarsFlags * state)
{
_flag_clear(state, 0x967);
_flag_clear(state, FLAG_SYS_SAFARI);
}
BOOL sub_0205F214(struct SaveVarsFlags * state)
BOOL Save_VarsFlags_CheckSafariSysFlag(struct SaveVarsFlags * state) //Save_VarsFlags_CheckSafariSysFlag?
{
return _flag_check(state, 0x967);
return _flag_check(state, FLAG_SYS_SAFARI);
}
void sub_0205F224(struct SaveVarsFlags * state)

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "unk_0205FA2C.h"
#include "battle_setup.h"
#include "unk_020337E8.h"
#include "unk_0202A1E0.h"
#include "overlay_manager.h"
@ -40,7 +41,7 @@ u32 sub_0205FA2C(
ptr->options = Save_PlayerData_GetOptionsAddr(save);
ptr->player_party = SaveArray_PlayerParty_Get(save);
ptr->player_party = SaveArray_Party_Get(save);
ptr->bag = Save_Bag_Get(save);
@ -66,7 +67,7 @@ u32 sub_0205FA2C(
u32 sub_0205FAD8(
struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem)
{
if (sub_0204647C(fieldSystem))
if (FieldSystem_ApplicationIsRunning(fieldSystem))
{
return 1;
}
@ -108,7 +109,7 @@ u32 sub_0205FB34(
MI_CpuFill8(ptr, 0, sizeof(struct UnkPlayerStruct2_0205FA2C));
ptr->options = Save_PlayerData_GetOptionsAddr(save);
ptr->player_party = SaveArray_PlayerParty_Get(save);
ptr->player_party = SaveArray_Party_Get(save);
ptr->IsNatDex = SaveArray_IsNatDexEnabled(save);
ptr->unk2c = sub_02079C70(save);
@ -136,7 +137,7 @@ u32 sub_0205FB34(
u32 sub_0205FBC0(
struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem)
{
if (sub_0204647C(fieldSystem))
if (FieldSystem_ApplicationIsRunning(fieldSystem))
{
return 3;
}
@ -154,7 +155,7 @@ BOOL sub_0205FBE8(struct TaskManager *taskManager)
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
struct UnkCallbackStruct1_0205FA2C *res2 =
(struct UnkCallbackStruct1_0205FA2C *)sub_0204652C(taskManager);
(struct UnkCallbackStruct1_0205FA2C *)TaskManager_GetEnvironment(taskManager);
switch (res2->unk04)
{
case 0:
@ -220,7 +221,7 @@ u32 sub_0205FC9C(
u32 sub_0205FCC4(
struct UnkCallbackStruct2_0205FA2C *param0, struct FieldSystem *fieldSystem)
{
if (sub_0204647C(fieldSystem))
if (FieldSystem_ApplicationIsRunning(fieldSystem))
{
return 1;
}
@ -235,7 +236,7 @@ BOOL sub_0205FCE8(struct TaskManager *taskManager)
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
struct UnkCallbackStruct2_0205FA2C *res2 =
(struct UnkCallbackStruct2_0205FA2C *)sub_0204652C(taskManager);
(struct UnkCallbackStruct2_0205FA2C *)TaskManager_GetEnvironment(taskManager);
switch (res2->unk04)
{
@ -273,7 +274,7 @@ void sub_0205FD38(struct TaskManager *taskManager, u16 param1, u16 param2, u16 p
BOOL sub_0205FD70(struct TaskManager *taskManager)
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
u16 *res2 = (u16 *)sub_0204652C(taskManager);
u16 *res2 = (u16 *)TaskManager_GetEnvironment(taskManager);
u8 *res3 = sub_020316E0(1 - sub_02031190());
if (res3 == NULL)
{
@ -459,13 +460,11 @@ u32 sub_0205FF5C(struct SaveData *save)
return 3;
}
void sub_02060044(u16 **param0, u32 *param1)
{
u16 *ptr = param0[42];
ptr[18] += param1[0];
ptr[20] += param1[1];
ptr[19] += param1[2];
void sub_02060044(FieldSystem *fieldSystem, BattleSetupUnkSub138 *battleSetupSub) {
UnkStruct_02046444 *unkA8 = fieldSystem->unkA8;
unkA8->unk24 += battleSetupSub->unk0;
unkA8->unk28 += battleSetupSub->unk4;
unkA8->unk26 += battleSetupSub->unk8;
}
u32 sub_02060064(u32 param0)

View File

@ -47,7 +47,7 @@ void CallTask_UseGreatMarshBinoculars(struct FieldSystem *fieldSystem)
BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager)
{
struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
struct UnkStruct_0204652C *unkStruct1 = (struct UnkStruct_0204652C *)sub_0204652C(taskManager);
struct UnkStruct_0204652C *unkStruct1 = (struct UnkStruct_0204652C *)TaskManager_GetEnvironment(taskManager);
switch (unkStruct1->action)
{
@ -55,7 +55,7 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager)
sub_0206367C(fieldSystem, 1);
ov06_02245198(unkStruct1->unkD, unkStruct1->unk4);
unkStruct1->unk8 = ov06_022451F0(unkStruct1->unk4);
sub_0204AFC8(taskManager);
CallTask_FadeToBlack(taskManager);
unkStruct1->action = 1;
break;
@ -80,7 +80,7 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager)
break;
case 3:
sub_0204AF84(taskManager);
CallTask_RestoreOverworld(taskManager);
unkStruct1->action = 4;
break;
@ -101,7 +101,7 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager)
else
{
MapObject_SetVisible(playerObject, FALSE);
sub_0204B00C(taskManager);
CallTask_FadeFromBlack(taskManager);
unkStruct1->action = 8;
}
break;

View File

@ -7,7 +7,7 @@
struct UnkStruct_0206439C* sub_0206439C(HeapID heapId, u8 mon_idx, struct SaveData* save)
{
struct UnkStruct_0206439C* ret = AllocFromHeapAtEnd(heapId, sizeof(struct UnkStruct_0206439C));
struct PlayerParty* party = SaveArray_PlayerParty_Get(save);
struct Party* party = SaveArray_Party_Get(save);
ret->pokemon = GetPartyMonByIndex(party, mon_idx);
ret->unk4 = NULL;

View File

@ -266,7 +266,7 @@ BOOL CanUseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveId, HeapI
return FALSE;
}
BOOL CanUseItemOnMonInParty(struct PlayerParty * party, u16 itemId, s32 partyIdx, s32 moveIdx, HeapID heapId)
BOOL CanUseItemOnMonInParty(struct Party * party, u16 itemId, s32 partyIdx, s32 moveIdx, HeapID heapId)
{
struct Pokemon * pokemon = GetPartyMonByIndex(party, partyIdx);
return CanUseItemOnPokemon(pokemon, itemId, moveIdx, heapId);
@ -534,7 +534,7 @@ BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 loc
#undef sp54
#undef sp50
BOOL UseItemOnMonInParty(struct PlayerParty * party, u16 itemId, s32 partyIdx, s32 moveIdx, u16 location, HeapID heapId)
BOOL UseItemOnMonInParty(struct Party * party, u16 itemId, s32 partyIdx, s32 moveIdx, u16 location, HeapID heapId)
{
struct Pokemon * pokemon = GetPartyMonByIndex(party, partyIdx);
return UseItemOnPokemon(pokemon, itemId, moveIdx, location, heapId);
@ -688,7 +688,7 @@ BOOL DoItemFriendshipMod(struct Pokemon * pokemon, s32 friendship, s32 mod, u16
return TRUE;
}
void HealParty(struct PlayerParty * party)
void HealParty(struct Party * party)
{
u32 sp8;
s32 nmons;

41
include/battle_setup.h Normal file
View File

@ -0,0 +1,41 @@
#ifndef POKEDIAMOND_BATTLE_SETUP_H
#define POKEDIAMOND_BATTLE_SETUP_H
#include "global.h"
#include "party.h"
#define BATTLE_SETUP_FLAG_NONE (0)
#define BATTLE_SETUP_FLAG_UNK_0 (1 << 0)
#define BATTLE_SETUP_FLAG_UNK_1 (1 << 1)
#define BATTLE_SETUP_FLAG_UNK_2 (1 << 2)
#define BATTLE_SETUP_FLAG_UNK_3 (1 << 3)
#define BATTLE_SETUP_FLAG_UNK_4 (1 << 4)
#define BATTLE_SETUP_FLAG_UNK_5 (1 << 5)
#define BATTLE_SETUP_FLAG_UNK_6 (1 << 6)
#define BATTLE_SETUP_FLAG_UNK_8 (1 << 8)
#define BATTLE_SETUP_FLAG_UNK_9 (1 << 9)
#define BATTLE_SETUP_FLAG_UNK_10 (1 << 10)
#define BATTLE_SETUP_FLAG_HEAL_AFTER_DEFEAT (1 << 11)
#define BATTLE_SETUP_FLAG_UNK_31 (1 << 31)
typedef struct BattleSetupUnkSub138 {
u32 unk0;
u32 unk4;
u32 unk8;
} BattleSetupUnkSub138;
typedef struct BattleSetup {
u32 flags;
Party *party[4];
u32 winFlag;
u8 padding[0x11C];
u32 unk134;
BattleSetupUnkSub138 unk138;
u8 padding2[0xC];
u32 unk150;
u32 unk154;
u8 padding3[0x34];
u32 unk18C;
} BattleSetup;
#endif //POKEDIAMOND_BATTLE_SETUP_H

View File

@ -0,0 +1,6 @@
#ifndef POKEDIAMOND_CONSTANTS_FLAGS_H
#define POKEDIAMOND_CONSTANTS_FLAGS_H
#define FLAG_SYS_SAFARI 0x967
#endif //POKEDIAMOND_CONSTANTS_FLAGS_H

View File

@ -0,0 +1,7 @@
#ifndef POKEDIAMOND_CONSTANTS_GAME_STATS_H
#define POKEDIAMOND_CONSTANTS_GAME_STATS_H
#define GAME_STAT_UNK7 7
#define GAME_STAT_UNK21 21
#endif //POKEDIAMOND_CONSTANTS_GAME_STATS_H

34
include/encounter.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef POKEDIAMOND_ENCOUNTER_H
#define POKEDIAMOND_ENCOUNTER_H
#include "battle_setup.h"
#include "field_system.h"
#include "party.h"
#include "task.h"
typedef struct Encounter {
u32 *winFlag;
s32 effect;
s32 bgm;
s32 unkC;
BattleSetup *setup;
} Encounter;
typedef struct WildEncounter {
s32 state;
s32 effect;
s32 bgm;
u32 *winFlag;
BattleSetup *setup;
} WildEncounter;
void sub_02046948(TaskManager *taskManager, u32 param1, u32 *winFlag);
void sub_020469B8(FieldSystem *fieldSystem, BattleSetup *setup);
void sub_02046A20(FieldSystem *fieldSystem, TaskManager *taskManager, BattleSetup *setup);
void SetupAndStartHoneyTreeBattle(TaskManager *taskManager, u32 *winFlag);
void SetupAndStartWildBattle(TaskManager *taskManager, u16 species, u8 level, u32 *winFlag, BOOL canFlee);
void sub_02046F70(FieldSystem *fieldSystem, BattleSetup *setup);
void SetupAndStartFirstBattle(TaskManager *taskManager, u16 species, u8 level);
void SetupAndStartTutorialBattle(TaskManager *taskManager);
#endif //POKEDIAMOND_ENCOUNTER_H

71
include/field_system.h Normal file
View File

@ -0,0 +1,71 @@
#ifndef POKEDIAMOND_FIELD_SYSTEM_H
#define POKEDIAMOND_FIELD_SYSTEM_H
#include "global.h"
#include "bg_window.h"
#include "camera.h"
#include "field_player_avatar.h"
#include "save.h"
#include "task.h"
typedef struct Location {
u32 mapId;
u32 warpId;
u32 x;
u32 y;
u32 direction;
} Location;
typedef struct UnkFieldStruct04 {
u8 padding[0xC];
u32 unk0C;
} UnkFieldStruct04;
typedef struct MapObjectManager {
} MapObjectManager; //todo: fill out
typedef struct UnkStruct_020464D4
{
u16 unk0[4];
u8 padding[0x108];
} UnkStruct_020464D4;
typedef struct UnkStruct_02046444
{
u8 padding[0x24];
u16 unk24;
u16 unk26;
u16 unk28;
u8 padding2[0x66];
UnkStruct_020464D4 unk90[1]; //todo find size
} UnkStruct_02046444;
typedef struct FieldSystem
{
u32 *unk00;
UnkFieldStruct04 *unk04;
BgConfig *bgConfig;
SaveData *saveData; //0xC
TaskManager *taskManager;
u8 padding2[0x8];
Location *location;
Camera *camera;
u32 unk24;
u8 padding3[0xC];
MapObjectManager *mapObjectManager;
PlayerAvatar *playerAvatar;
u8 padding4[0x24];
u32 unk60;
u8 padding5[0x14];
u32 unk78;
u32 unk7C;
u8 padding6[0x10];
u32 unk90;
u8 padding7[0x4];
u32 *unk98;
u8 padding8[0xC];
UnkStruct_02046444 * unkA8;
} FieldSystem;
#endif //POKEDIAMOND_FIELD_SYSTEM_H

View File

@ -48,7 +48,7 @@ struct HofDisplayMon
u32 Save_HOF_sizeof(void);
void Save_HOF_Init(struct HallOfFame * hof);
void Save_HOF_RecordParty(struct HallOfFame * hof, struct PlayerParty * party, RTCDate * date);
void Save_HOF_RecordParty(struct HallOfFame * hof, struct Party * party, RTCDate * date);
u32 Save_HOF_GetNumRecords(struct HallOfFame * hof);
int Save_HOF_TranslateRecordIdx(struct HallOfFame * hof, int a1);
u32 Save_HOF_RecordCountMons(struct HallOfFame * hof, int a1);

View File

@ -4,18 +4,18 @@
#include "pokemon.h"
#include "save.h"
BOOL PartyHasMon(struct PlayerParty * party_p, u16 species);
int GetPartyCount(struct PlayerParty * party_p);
struct Pokemon * GetPartyMonByIndex(struct PlayerParty * party_p, int idx);
BOOL PartyHasMon(struct Party * party_p, u16 species);
int GetPartyCount(struct Party * party_p);
struct Pokemon * GetPartyMonByIndex(struct Party * party_p, int idx);
u32 SaveArray_Party_sizeof(void);
struct PlayerParty * SaveArray_Party_Alloc(HeapID heapId);
void SaveArray_Party_Init(struct PlayerParty * party);
void InitPartyWithMaxSize(struct PlayerParty * party, int count);
BOOL AddMonToParty(struct PlayerParty * party, struct Pokemon * pokemon);
BOOL RemoveMonFromParty(struct PlayerParty * party, int pos);
void ReplacePartySlotWithMon(struct PlayerParty * party, int pos, struct Pokemon * pokemon);
BOOL SwapSlotsInParty(struct PlayerParty * party, int pos1, int pos2);
void CopyPlayerParty(struct PlayerParty * src, struct PlayerParty * dest);
struct PlayerParty * SaveArray_PlayerParty_Get(struct SaveData * ptr);
struct Party * SaveArray_Party_Alloc(HeapID heapId);
void SaveArray_Party_Init(struct Party * party);
void InitPartyWithMaxSize(struct Party * party, int count);
BOOL AddMonToParty(struct Party * party, struct Pokemon * pokemon);
BOOL RemoveMonFromParty(struct Party * party, int pos);
void ReplacePartySlotWithMon(struct Party * party, int pos, struct Pokemon * pokemon);
BOOL SwapSlotsInParty(struct Party * party, int pos1, int pos2);
void CopyParty(struct Party * src, struct Party * dest);
struct Party * SaveArray_Party_Get(struct SaveData * ptr);
#endif //POKEDIAMOND_PARTY_H

View File

@ -193,12 +193,12 @@ struct Evolution
#define PARTY_SIZE 6
typedef struct PlayerParty
typedef struct Party
{
int maxCount;
int curCount;
struct Pokemon mons[PARTY_SIZE];
} PlayerParty;
} Party;
void ZeroMonData(struct Pokemon * pokemon);
void ZeroBoxMonData(struct BoxPokemon * boxmon);
@ -268,7 +268,7 @@ u8 GetBoxMonUnownLetter(struct BoxPokemon * boxmon);
u8 GetMonUnownLetter(struct Pokemon * pokemon);
struct BoxPokemon * sub_020690E4(struct Pokemon * pokemon);
u16 GetMonEvolution(struct PlayerParty * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret);
u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret);
u16 ReadFromPersonalPmsNarc(u16 species);
u16 GetEggSpecies(u16 species);
BOOL sub_020690E8(struct Pokemon * pokemon);
@ -281,7 +281,7 @@ void sub_020698E0(struct Pokemon * pokemon, int slot1, int slot2);
void sub_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2);
void sub_020699A4(struct Pokemon * pokemon, u32 slot);
void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest);
u8 Party_GetMaxLevel(struct PlayerParty * party);
u8 Party_GetMaxLevel(struct Party * party);
u16 SpeciesToSinnohDexNo(u16 species);
u16 SinnohDexNoToSpecies(u16 sinnoh_dex);
void CopyPokemonToPokemon(struct Pokemon * src, struct Pokemon * dest);
@ -289,9 +289,9 @@ void CopyPokemonToBoxPokemon(struct Pokemon * src, struct BoxPokemon * dest);
void CopyBoxPokemonToBoxPokemon(struct BoxPokemon * src, struct BoxPokemon * dest);
s8 MonGetFlavorPreference(struct Pokemon * pokemon, int flavor);
int Species_LoadLearnsetTable(u16 species, u32 form, u16 * dest);
void Party_GivePokerusAtRandom(struct PlayerParty * party);
void Party_UpdatePokerus(struct PlayerParty * party, int r5);
void Party_SpreadPokerus(struct PlayerParty * party);
void Party_GivePokerusAtRandom(struct Party * party);
void Party_UpdatePokerus(struct Party * party, int r5);
void Party_SpreadPokerus(struct Party * party);
BOOL Pokemon_HasPokerus(struct Pokemon * pokemon);
BOOL Pokemon_IsImmuneToPokerus(struct Pokemon * pokemon);
void Pokemon_UpdateArceusForm(struct Pokemon * pokemon);

View File

@ -10,24 +10,13 @@
#include "render_window.h"
#include "save.h"
#include "task.h"
#include "field_system.h"
struct ScriptContext;
typedef u8 (*ScrCmdFunc)(struct ScriptContext *);
typedef u8 Script[];
struct UnkStruct_020464D4
{
u16 unk0[4];
u8 padding[0x108];
};
struct UnkStruct_02046444
{
u8 padding[0x90];
struct UnkStruct_020464D4 unk90[1]; //todo find size
};
typedef struct LocalMapObject { //todo move to local_map_object.c
u8 padding[0x12C]; //todo verify size
} LocalMapObject;
@ -78,19 +67,6 @@ typedef struct ScrCmdUnkStruct00F4 {
u32 unk2C;
} ScrCmdUnkStruct00F4; //todo identify and move to own file
typedef struct Location {
u32 mapId;
u32 warpId;
u32 x;
u32 y;
u32 direction;
} Location;
typedef struct UnkFieldStruct04 {
u8 padding[0xC];
u32 unk0C;
} UnkFieldStruct04;
typedef struct LocalFieldData {
} LocalFieldData; //todo fill out and move to own file
@ -99,10 +75,6 @@ typedef struct RoamerSaveData {
} RoamerSaveData; //todo: fill out and move to own file
typedef struct MapObjectManager {
} MapObjectManager; //todo: fill out
typedef struct PokedexAppData {
} PokedexAppData; //todo: fill out and move to own file
@ -123,32 +95,6 @@ typedef struct SaveStatsPrinter {
} SaveStatsPrinter; //todo: fill out and move to own file
typedef struct FieldSystem //todo move to field_system.c
{
u32 *unk00;
UnkFieldStruct04 *unk04;
struct BgConfig *bgConfig;
struct SaveData *saveData; //0xC
TaskManager *taskManager;
u8 padding2[0x8];
Location *location;
struct Camera *camera;
u32 unk24;
u8 padding3[0xC];
MapObjectManager *mapObjectManager;
struct PlayerAvatar *playerAvatar;
u8 padding4[0x24];
u32 unk60;
u8 padding5[0x14];
u32 unk78;
u32 unk7C;
u8 padding6[0x10];
u32 unk90;
u8 padding7[0x4];
u32 *unk98;
u8 padding8[0xC];
struct UnkStruct_02046444 * unkA8;
} FieldSystem;
typedef struct ScriptContext
{

View File

@ -4,14 +4,14 @@
BOOL MonNotFaintedOrEgg(struct Pokemon * pokemon);
BOOL GiveMon(HeapID heapId, struct SaveData * save, u16 species, u8 level, u16 item, u32 mapSec, u32 encounterType);
BOOL GiveEgg(HeapID heapId, struct SaveData * save, u16 species, int level, int metLocIndex, int a3);
void PartyMonSetMoveInSlot(struct PlayerParty * party, int partySlot, int moveSlot, u16 move);
int GetIdxOfFirstPartyMonWithMove(struct PlayerParty * party, int move);
int CountAlivePokemon(struct PlayerParty * party);
struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct PlayerParty * party);
struct Pokemon * GetFirstNonEggInParty(struct PlayerParty * party);
BOOL HasEnoughAlivePokemonForDoubleBattle(struct PlayerParty * party);
void GiveAllMonsTheSinnohChampRibbon(struct PlayerParty * party);
int ApplyPoisonStep(struct PlayerParty * party, int location);
void PartyMonSetMoveInSlot(struct Party * party, int partySlot, int moveSlot, u16 move);
int GetIdxOfFirstPartyMonWithMove(struct Party * party, int move);
int CountAlivePokemon(struct Party * party);
struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct Party * party);
struct Pokemon * GetFirstNonEggInParty(struct Party * party);
BOOL HasEnoughAlivePokemonForDoubleBattle(struct Party * party);
void GiveAllMonsTheSinnohChampRibbon(struct Party * party);
int ApplyPoisonStep(struct Party * party, int location);
BOOL SurvivePoisoning(struct Pokemon * mon);
#endif //POKEDIAMOND_SCRIPT_POKEMON_UTIL_H

View File

@ -28,19 +28,19 @@ extern BOOL sub_020373AC(void *);
extern BOOL sub_0203739C(struct FieldSystem *fieldSystem);
extern BOOL sub_020373C4(struct FieldSystem *fieldSystem);
struct TaskManager *FieldSys_CreateTask(struct FieldSystem *fieldSystem, TaskFunc taskFunc, void *env);
void sub_020463CC(struct FieldSystem *fieldSystem, TaskFunc taskFunc, void *env);
void sub_020463EC(struct TaskManager *taskManager, TaskFunc taskFunc, void *env);
struct TaskManager *Task_New(struct FieldSystem *fieldSystem, TaskFunc taskFunc, void *env);
void FieldSystem_CreateTask(struct FieldSystem *fieldSystem, TaskFunc taskFunc, void *env);
void TaskManager_Jump(struct TaskManager *taskManager, TaskFunc taskFunc, void *env);
void TaskManager_Call(struct TaskManager *taskManager, TaskFunc taskFunc, void *env);
BOOL sub_02046420(struct TaskManager *taskManager);
BOOL sub_0204646C(struct TaskManager *taskManager);
BOOL sub_0204647C(struct FieldSystem *fieldSystem);
BOOL FieldSystem_ApplicationIsRunning(struct FieldSystem *fieldSystem);
void sub_0204649C(void * r0);
BOOL sub_020464A4(void * r0);
BOOL sub_020464B8(struct TaskManager *taskManager);
void sub_02046500(struct TaskManager *taskManager, u32 r5, u32 r4);
void * sub_0204652C(struct TaskManager *taskManager);
u32 * sub_02046530(struct TaskManager *taskManager);
void * TaskManager_GetEnvironment(struct TaskManager *taskManager);
u32 * TaskManager_GetStatePtr(struct TaskManager *taskManager);
u32 sub_02046534(struct TaskManager *taskManager);
struct FieldSystem *TaskManager_GetFieldSystem(struct TaskManager *taskManager);

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