summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Calixte <remicalixte.rmc@gmail.com>2021-04-03 15:11:23 +0200
committerRémi Calixte <remicalixte.rmc@gmail.com>2021-04-03 15:11:23 +0200
commitb20e00af7417022971bdf37870b66ccb8d3c52a0 (patch)
tree5b104cd1ef8fe8998cc15c7cb4a90749179eba76
parent8958487e95618eaea84f4aaa02f68d3ef467a874 (diff)
better structs and signatures
-rw-r--r--arm9/asm/unk_02035068.s6
-rw-r--r--arm9/asm/unk_020377F0.s10
-rw-r--r--arm9/asm/unk_02050E48.s2
-rw-r--r--arm9/global.inc4
-rw-r--r--arm9/modules/11/asm/module_11_thumb2.s2
-rw-r--r--arm9/modules/14/asm/module_14.s4
-rw-r--r--arm9/src/unk_0205FA2C.c245
-rw-r--r--arm9/src/unk_0206BB28.c6
-rw-r--r--include/unk_0205FA2C.h108
-rw-r--r--include/unk_0206BB28.h4
10 files changed, 218 insertions, 173 deletions
diff --git a/arm9/asm/unk_02035068.s b/arm9/asm/unk_02035068.s
index 0c8e3612..f0cdc150 100644
--- a/arm9/asm/unk_02035068.s
+++ b/arm9/asm/unk_02035068.s
@@ -1870,7 +1870,7 @@ _02035ECC:
bl FUN_0202A918
str r0, [r7, #0x20]
ldr r0, [r5, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r7, #0x1c]
ldr r0, [r5, #0xc]
bl FUN_02079C70
@@ -1918,7 +1918,7 @@ _02035F4A:
mov r0, #0x2
strb r0, [r7, #0x12]
ldr r0, [r5, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r7, #0x1c]
ldr r0, [r5, #0xc]
bl FUN_02079C70
@@ -1975,7 +1975,7 @@ _02035FD0:
mov r0, #0x2
strb r0, [r7, #0x12]
ldr r0, [r5, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r7, #0x1c]
ldr r0, [r5, #0xc]
bl FUN_02079C70
diff --git a/arm9/asm/unk_020377F0.s b/arm9/asm/unk_020377F0.s
index 9d5e2f32..7c45ad7a 100644
--- a/arm9/asm/unk_020377F0.s
+++ b/arm9/asm/unk_020377F0.s
@@ -773,7 +773,7 @@ FUN_02037C00: ; 0x02037C00
bl FUN_0202A918
str r0, [r4, #0x20]
ldr r0, [r5, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r4, #0x1c]
ldr r0, [r5, #0xc]
bl FUN_02079C70
@@ -827,7 +827,7 @@ FUN_02037C7C: ; 0x02037C7C
strh r0, [r4, #0x18]
strb r6, [r4, #0x12]
add r0, r5, #0x0
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r4, #0x1c]
add r0, r5, #0x0
bl FUN_02079C70
@@ -874,7 +874,7 @@ FUN_02037CF0: ; 0x02037CF0
mov r0, #0x2
strb r0, [r4, #0x12]
ldr r0, [r5, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r4, #0x1c]
ldr r0, [r5, #0xc]
bl FUN_02079C70
@@ -1426,7 +1426,7 @@ FUN_02038144: ; 0x02038144
bl Sav2_Pokedex_get
str r0, [r5, #0x24]
ldr r0, [r4, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r5, #0x30]
ldr r0, [r4, #0xc]
str r0, [r5, #0x10]
@@ -2157,7 +2157,7 @@ FUN_020386E0: ; 0x020386E0
ldr r0, [r5, #0xc]
str r0, [r4, #0x20]
ldr r0, [r5, #0xc]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r4, #0x34]
ldr r0, [r4, #0x14]
bl FUN_02033830
diff --git a/arm9/asm/unk_02050E48.s b/arm9/asm/unk_02050E48.s
index 5746b23f..c8a8a153 100644
--- a/arm9/asm/unk_02050E48.s
+++ b/arm9/asm/unk_02050E48.s
@@ -35,7 +35,7 @@ FUN_02050E48: ; 0x02050E48
add r0, r4, #0x0
bl FUN_0207C2A4
add r0, r6, #0x0
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
str r0, [r4, #0x1c]
add r0, r6, #0x0
bl FUN_02079C70
diff --git a/arm9/global.inc b/arm9/global.inc
index a2fd15c3..d77b0a72 100644
--- a/arm9/global.inc
+++ b/arm9/global.inc
@@ -4887,8 +4887,8 @@
.extern CopyPlayerParty
.extern PartyHasMon
.extern SavArray_PlayerParty_get
-.extern FUN_0206BB28
-.extern FUN_0206BB34
+.extern SavArray_IsNatDexEnabled
+.extern Pokedex_IsNatDexEnabled
.extern FUN_0206BB48
.extern FUN_0206BB5C
.extern FUN_0206BB74
diff --git a/arm9/modules/11/asm/module_11_thumb2.s b/arm9/modules/11/asm/module_11_thumb2.s
index 3e416af6..62996375 100644
--- a/arm9/modules/11/asm/module_11_thumb2.s
+++ b/arm9/modules/11/asm/module_11_thumb2.s
@@ -25381,7 +25381,7 @@ _0223B916:
str r0, [sp, #0xe0]
ldr r0, [r4]
bl MOD11_022300D0
- bl FUN_0206BB34
+ bl Pokedex_IsNatDexEnabled
str r0, [sp, #0xe4]
bl FUN_0201D658
str r0, [r4, #0x54]
diff --git a/arm9/modules/14/asm/module_14.s b/arm9/modules/14/asm/module_14.s
index edbb6d86..37a18d6d 100644
--- a/arm9/modules/14/asm/module_14.s
+++ b/arm9/modules/14/asm/module_14.s
@@ -1925,7 +1925,7 @@ _021D84AA:
str r1, [r4, r0]
sub r0, #0x38
ldr r0, [r4, r0]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
mov r1, #0x52
lsl r1, r1, #2
str r0, [r4, r1]
@@ -9205,7 +9205,7 @@ MOD14_021DBEAC: ; 0x021DBEAC
mov r0, #0x47
lsl r0, r0, #2
ldr r0, [r6, r0]
- bl FUN_0206BB28
+ bl SavArray_IsNatDexEnabled
ldrh r1, [r4, #4]
bl FUN_0206BB48
strh r0, [r4, #8]
diff --git a/arm9/src/unk_0205FA2C.c b/arm9/src/unk_0205FA2C.c
index e5c717b8..dde83a06 100644
--- a/arm9/src/unk_0205FA2C.c
+++ b/arm9/src/unk_0205FA2C.c
@@ -3,11 +3,11 @@
extern void *UNK_020F96DC;
extern void *UNK_020FA6E8;
extern u32 FUN_02079C70(struct SaveBlock2 *sav2);
-extern void FUN_0207B000(void *ptr, u8 param1[12]);
-extern void FUN_0207C2A4(void *ptr, struct PlayerData *player_data);
-extern u32 FUN_0203384C(u32 param0);
-extern u32 FUN_02038790(u32 *param0, u16 param1, u16 param2);
-extern u16 *GetVarPointer(void *arg, u16);
+extern void FUN_0207B000(struct UnkPlayerStruct2_0205FA2C *ptr, const u8 param1[12]);
+extern void FUN_0207C2A4(struct UnkPlayerStruct2_0205FA2C *ptr, struct PlayerData *player_data);
+extern u32 FUN_0203384C(u32 *param0);
+extern u32 *FUN_02038790(struct UnkStruct_0204639C *param0, u16 param1, u16 param2);
+extern u16 *GetVarPointer(struct UnkSavStruct80 *arg, u16);
extern u32 FUN_02031190();
extern u32 FUN_020316E0(u32 param0);
extern u16 MOD06_02244660(struct UnkStruct_0204639C *param0, u32 param1);
@@ -25,32 +25,15 @@ extern void FUN_0202A2C4(u32 param0, u32 param1, u32 *param2);
extern u32 FUN_0202A240(u32 param0, u32 param1, u32 param2);
extern int FUN_0202A538(u32 param0, u16 param1, u32 param2);
-struct UnkStruct3
-{
- /* 0x00 */ struct PlayerParty *player_party;
- /* 0x04 */ struct Bag *bag;
- u32 unk08;
- /* 0x0c */ struct Options *options;
- u32 unk10[4];
- u8 unk20;
- u8 unk21;
- u8 unk22;
- u8 unk23;
- u32 unk24[2];
- u8 unk2c[6];
- u8 unk32:4;
- u8 unk322:4;
- u8 unk33;
- u32 unk34[3];
-};
-
-THUMB_FUNC u32 FUN_0205FA2C(u8 *param0, struct UnkStruct_0204639C *param1, u32 heap_id)
+
+
+THUMB_FUNC u32 FUN_0205FA2C(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1, u32 heap_id)
{
- struct UnkStruct3 *ptr =
- (struct UnkStruct3 *)AllocFromHeapAtEnd(heap_id, sizeof(struct UnkStruct3));
+ struct UnkPlayerStruct1_0205FA2C *ptr =
+ (struct UnkPlayerStruct1_0205FA2C *)AllocFromHeapAtEnd(heap_id, sizeof(struct UnkPlayerStruct1_0205FA2C));
struct SaveBlock2 *sav2 = (struct SaveBlock2 *)(param1->unkC);
- MI_CpuFill8(ptr, 0, sizeof(struct UnkStruct3));
+ MI_CpuFill8(ptr, 0, sizeof(struct UnkPlayerStruct1_0205FA2C));
ptr->options = Sav2_PlayerData_GetOptionsAddr(sav2);
@@ -59,101 +42,83 @@ THUMB_FUNC u32 FUN_0205FA2C(u8 *param0, struct UnkStruct_0204639C *param1, u32 h
ptr->bag = Sav2_Bag_get(sav2);
ptr->unk21 = 0;
- ptr->unk20 = param0[8];
- ptr->unk32 = param0[10];
- ptr->unk322 = param0[11];
- ptr->unk33 = param0[0xc];
- ptr->unk22 = param0[0xd];
+ ptr->unk20 = param0->unk08;
+ ptr->unk32 = param0->unk0a;
+ ptr->unk322 = param0->unk0b;
+ ptr->unk33 = param0->unk0c;
+ ptr->unk22 = param0->unk0d;
for (u8 i = 0; i < 6; i++)
{
- ptr->unk2c[i] = param0[i + 0xe];
+ ptr->unk2c[i] = param0->unk0e[i];
}
- FUN_020373D4(param1, &UNK_020F96DC, ptr);
+ FUN_020373D4(param1, (u32)&UNK_020F96DC, (u32)ptr);
- *((u32 **)param0)[5] = ptr;
+ *param0->unk14 = ptr;
return 1;
}
-THUMB_FUNC u32 FUN_0205FAD8(u8 *param0, void *param1)
+THUMB_FUNC u32 FUN_0205FAD8(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1)
{
if (FUN_0204647C(param1))
{
return 1;
}
- void *ptr = *((u32 **)param0)[5];
+ struct UnkPlayerStruct1_0205FA2C *ptr = (struct UnkPlayerStruct1_0205FA2C *)*param0->unk14;
- u8 r1 = *(u8 *)(ptr + 0x22);
+ u8 r1 = ptr->unk22;
if (r1 != 6)
{
if (r1 == 7)
{
- ((u32 *)param0)[0] = 0;
+ param0->unk00 = 0;
return 4;
}
}
else
{
- ((u32 *)param0)[0] = 1;
+ param0->unk00 = 1;
return 4;
}
- MI_CpuCopy8(ptr + 0x2c, param0 + 0xe, 6);
+ MI_CpuCopy8(ptr->unk2c, param0->unk0e, 6);
- param0[0xd] = *(u8 *)(ptr + 0x22);
+ param0->unk0d = ptr->unk22;
FreeToHeap(ptr);
- *((u32 **)param0)[5] = 0;
+ *param0->unk14 = NULL;
return 2;
}
-struct UnkStruct4 {
- /* 0x00 */ struct PlayerData *player_data;
- /* 0x04 */ struct Options *options;
- u32 unk08;
- u32 unk0c;
- u8 unk10;
- u8 unk11;
- u8 unk12;
- u8 unk13;
- u8 unk14;
- u8 unk15[3];
- u16 unk18;
- u16 unk1a;
- u32 unk1c;
- u32 unk20;
- u32 unk24;
- u32 unk28;
- u32 unk2c;
-
-};
-
-THUMB_FUNC u32 FUN_0205FB34(u8 *param0, struct UnkStruct_0204639C *param1, u32 heap_id)
+
+
+
+THUMB_FUNC u32 FUN_0205FB34(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1, u32 heap_id)
{
struct SaveBlock2 *sav2 = (struct SaveBlock2 *)(param1->unkC);
- struct UnkStruct4 *ptr = (struct UnkStruct4 *)AllocFromHeapAtEnd(heap_id, sizeof(struct UnkStruct4));
- MI_CpuFill8(ptr, 0, sizeof(struct UnkStruct4));
+ struct UnkPlayerStruct2_0205FA2C *ptr = (struct UnkPlayerStruct2_0205FA2C *)AllocFromHeapAtEnd(heap_id, sizeof(struct UnkPlayerStruct2_0205FA2C));
+ MI_CpuFill8(ptr, 0, sizeof(struct UnkPlayerStruct2_0205FA2C));
ptr->options = Sav2_PlayerData_GetOptionsAddr(sav2);
- ptr->player_data = SavArray_PlayerParty_get(sav2);
- ptr->unk1c = FUN_0206BB28(sav2);
+ ptr->player_party = SavArray_PlayerParty_get(sav2);
+ ptr->IsNatDex = SavArray_IsNatDexEnabled(sav2);
ptr->unk2c = FUN_02079C70(sav2);
ptr->unk11 = 1;
- ptr->unk14 = param0[0xd];
+ ptr->unk14 = param0->unk0d;
- ptr->unk13 = GetPartyCount(*(u32 *)ptr);
+ ptr->party_count = (u8)GetPartyCount(ptr->player_party);
ptr->unk18 = 0;
- ptr->unk12 = param0[9];
+ ptr->unk12 = param0->unk09;
ptr->unk20 = FUN_0202A918(sav2);
@@ -161,25 +126,25 @@ THUMB_FUNC u32 FUN_0205FB34(u8 *param0, struct UnkStruct_0204639C *param1, u32 h
FUN_0207C2A4(ptr, Sav2_PlayerData_GetProfileAddr(sav2));
- FUN_020373D4(param1, &UNK_020FA6E8, ptr);
+ FUN_020373D4(param1, (u32)&UNK_020FA6E8, (u32)ptr);
- *((u32 **)param0)[5] = ptr;
+ *param0->unk14 = ptr;
return 3;
}
-THUMB_FUNC u32 FUN_0205FBC0(u8 ***param0, void *param1)
+THUMB_FUNC u32 FUN_0205FBC0(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1)
{
if (FUN_0204647C(param1))
{
return 3;
}
- u8 *r0 = param0[5][0];
- ((u8 *)param0)[0xd] = r0[20];
- FreeToHeap(r0);
+ struct UnkPlayerStruct2_0205FA2C *ptr = (struct UnkPlayerStruct2_0205FA2C *)*param0->unk14;
+ param0->unk0d = ptr->unk14;
+ FreeToHeap(ptr);
- param0[5][0] = 0;
+ *param0->unk14 = NULL;
return 0;
}
@@ -187,46 +152,32 @@ THUMB_FUNC u32 FUN_0205FBC0(u8 ***param0, void *param1)
THUMB_FUNC int FUN_0205FBE8(struct UnkStruct_0204639C *param0)
{
struct UnkStruct_0204639C *res = FUN_02046528(param0);
- struct SaveBlock2 *sav2 = (struct SaveBlock2 *)FUN_0204652C(param0);
- switch (sav2->unk_00004)
+ struct UnkCallbackStruct1_0205FA2C *res2 = (struct UnkCallbackStruct1_0205FA2C *)FUN_0204652C(param0);
+ switch (res2->unk04)
{
case 0:
- sav2->unk_00004 = FUN_0205FA2C((u8 *)sav2, res, 0xb);
+ res2->unk04 = FUN_0205FA2C(res2, res, 0xb);
break;
case 1:
- sav2->unk_00004 = FUN_0205FAD8((u8 *)sav2, res);
+ res2->unk04 = FUN_0205FAD8(res2, res);
break;
case 2:
- sav2->unk_00004 = FUN_0205FB34((u8 *)sav2, res, 0xb);
+ res2->unk04 = FUN_0205FB34(res2, res, 0xb);
break;
case 3:
- sav2->unk_00004 = FUN_0205FBC0((u8 ***)sav2, res);
+ res2->unk04 = FUN_0205FBC0(res2, res);
break;
case 4:
- FreeToHeap(sav2);
+ FreeToHeap(res2);
return 1;
}
return 0;
}
-struct UnkStruct1
-{
- u32 unk00;
- u32 unk04;
- u8 unk08;
- u8 unk09;
- u8 unk0a;
- u8 unk0b;
- u8 unk0c;
- u8 unk0d;
- u16 unk0e;
- u32 unk10;
- u32 unk14;
-};
THUMB_FUNC void FUN_0205FC50(struct UnkStruct_0204639C *param0,
- u32 param1,
+ void **param1,
u8 param2,
u8 param3,
u8 param4,
@@ -236,11 +187,11 @@ THUMB_FUNC void FUN_0205FC50(struct UnkStruct_0204639C *param0,
{
struct UnkStruct_0204639C *res = FUN_02046528(param0);
- struct UnkStruct1 *ptr = (struct UnkStruct1 *)AllocFromHeap(0xb, sizeof(struct UnkStruct1));
- MI_CpuFill8(ptr, 0, sizeof(struct UnkStruct1));
+ struct UnkCallbackStruct1_0205FA2C *ptr = (struct UnkCallbackStruct1_0205FA2C *)AllocFromHeap(0xb, sizeof(struct UnkCallbackStruct1_0205FA2C));
+ MI_CpuFill8(ptr, 0, sizeof(struct UnkCallbackStruct1_0205FA2C));
+
ptr->unk08 = param2;
ptr->unk09 = param3;
-
ptr->unk0a = param4;
ptr->unk0b = param5;
ptr->unk0c = param6;
@@ -250,28 +201,29 @@ THUMB_FUNC void FUN_0205FC50(struct UnkStruct_0204639C *param0,
FUN_0204640C(res->unk10, &FUN_0205FBE8, (u32 *)ptr);
}
-THUMB_FUNC u32 FUN_0205FC9C(u16 *param0, u32 *param1)
+
+THUMB_FUNC u32 FUN_0205FC9C(struct UnkCallbackStruct2_0205FA2C *param0, struct UnkStruct_0204639C *param1)
{
- if (FUN_0203384C(param1[3]))
+ if (FUN_0203384C(param1->unkC))
{
- ((u32 *)param0)[2] = FUN_02038790(param1, param0[9], param0[10]);
+ param0->unk08 = FUN_02038790(param1, param0->unk12, param0->unk14);
return 1;
}
- ((u32 *)param0)[0] = 1;
+ param0->unk00 = 1;
return 2;
}
-THUMB_FUNC u32 FUN_0205FCC4(u32 **param0, void *param1)
+THUMB_FUNC u32 FUN_0205FCC4(struct UnkCallbackStruct2_0205FA2C *param0, struct UnkStruct_0204639C *param1)
{
if (FUN_0204647C(param1))
{
return 1;
}
- param0[0] = param0[2][8];
- FreeToHeap(param0[2]);
+ param0->unk00 = param0->unk08[8];
+ FreeToHeap(param0->unk08);
return 2;
}
@@ -279,20 +231,20 @@ THUMB_FUNC u32 FUN_0205FCC4(u32 **param0, void *param1)
THUMB_FUNC int FUN_0205FCE8(struct UnkStruct_0204639C *param0)
{
struct UnkStruct_0204639C *res = FUN_02046528(param0);
- struct SaveBlock2 *sav2 = (struct SaveBlock2 *)FUN_0204652C(param0);
+ struct UnkCallbackStruct2_0205FA2C *res2 = (struct UnkCallbackStruct2_0205FA2C *)FUN_0204652C(param0);
- switch (sav2->unk_00004)
+ switch (res2->unk04)
{
case 0:
- sav2->unk_00004 = FUN_0205FC9C((u16 *)sav2, (u32 *)res);
+ res2->unk04 = FUN_0205FC9C(res2, res);
break;
case 1:
- sav2->unk_00004 = FUN_0205FCC4((u32 **)sav2, (void *)res);
+ res2->unk04 = FUN_0205FCC4(res2, res);
break;
case 2:
- u16 *var = GetVarPointer(res, ((u16 *)sav2)[8]);
- *var = sav2->flashOkay;
- FreeToHeap(sav2);
+ u16 *var = GetVarPointer((struct UnkSavStruct80 *)res, res2->unk10);
+ *var = (u16)res2->unk00;
+ FreeToHeap(res2);
return 1;
}
@@ -300,28 +252,13 @@ THUMB_FUNC int FUN_0205FCE8(struct UnkStruct_0204639C *param0)
return 0;
}
-struct UnkStruct2
-{
- u32 unk00;
- u32 unk04;
- u8 unk08;
- u8 unk09;
- u8 unk0a;
- u8 unk0b;
- u8 unk0c;
- u8 unk0d;
- u16 unk0e;
- u16 unk10;
- u16 unk12;
- u16 unk14;
- u16 unk16;
-};
+
THUMB_FUNC void FUN_0205FD38(struct UnkStruct_0204639C *param0, u16 param1, u16 param2, u16 param3)
{
struct UnkStruct_0204639C *res = FUN_02046528(param0);
- struct UnkStruct2 *ptr = (struct UnkStruct2 *)AllocFromHeap(0xb, sizeof(struct UnkStruct2));
- MI_CpuFill8(ptr, 0, sizeof(struct UnkStruct2));
+ struct UnkCallbackStruct2_0205FA2C *ptr = (struct UnkCallbackStruct2_0205FA2C *)AllocFromHeap(0xb, sizeof(struct UnkCallbackStruct2_0205FA2C));
+ MI_CpuFill8(ptr, 0, sizeof(struct UnkCallbackStruct2_0205FA2C));
ptr->unk12 = param1;
ptr->unk14 = param3;
@@ -340,7 +277,7 @@ THUMB_FUNC int FUN_0205FD70(struct UnkStruct_0204639C *param0)
return 0;
}
- u16 *var = GetVarPointer(res, res2[1]);
+ u16 *var = GetVarPointer((struct UnkSavStruct80 *)res, res2[1]);
switch (res2[0])
{
case 0:
@@ -371,13 +308,13 @@ THUMB_FUNC void FUN_0205FDDC(struct UnkStruct_0204639C *param0, u16 param1, u16
ptr[0] = param1;
ptr[1] = param2;
- FUN_0204640C(res->unk10, &FUN_0205FD70, ptr);
+ FUN_0204640C(res->unk10, &FUN_0205FD70, (u32 *)ptr);
}
THUMB_FUNC u32 FUN_0205FE10(struct SaveBlock2 *sav2)
{
- u16 res = FUN_0202A150(FUN_02029FC8(sav2), 0x35);
+ u16 res = (u16)FUN_0202A150(FUN_02029FC8(sav2), 0x35);
if (res < 20)
{
return 0;
@@ -385,13 +322,13 @@ THUMB_FUNC u32 FUN_0205FE10(struct SaveBlock2 *sav2)
u32 res2 = FUN_0202A8D8(sav2);
- u8 res3 = FUN_0202A578(res2, 0xd, 0);
- u8 res4 = FUN_0202A578(res2, 0, 0);
- u8 res5 = FUN_0202A578(res2, 1, 0);
+ u8 res3 = (u8)FUN_0202A578(res2, 0xd, 0);
+ u8 res4 = (u8)FUN_0202A578(res2, 0, 0);
+ u8 res5 = (u8)FUN_0202A578(res2, 1, 0);
- u8 res6 = FUN_0202A578(res2, 0xe, 0);
- u8 res7 = FUN_0202A578(res2, 2, 0);
- u8 res8 = FUN_0202A578(res2, 3, 0);
+ u8 res6 = (u8)FUN_0202A578(res2, 0xe, 0);
+ u8 res7 = (u8)FUN_0202A578(res2, 2, 0);
+ u8 res8 = (u8)FUN_0202A578(res2, 3, 0);
if (res3 != 0 && res4 != 0 && res5 != 0)
{
@@ -457,7 +394,7 @@ THUMB_FUNC u32 FUN_0205FE10(struct SaveBlock2 *sav2)
THUMB_FUNC u32 FUN_0205FF5C(struct SaveBlock2 *sav2)
{
- u16 res = FUN_0202A150(FUN_02029FC8(sav2), 0x35);
+ u16 res = (u16)FUN_0202A150(FUN_02029FC8(sav2), 0x35);
if (res < 20)
{
return 0;
@@ -465,13 +402,13 @@ THUMB_FUNC u32 FUN_0205FF5C(struct SaveBlock2 *sav2)
u32 res2 = FUN_0202A8D8(sav2);
- u8 res3 = FUN_0202A578(res2, 0xd, 0);
- u8 res4 = FUN_0202A578(res2, 0, 0);
- u8 res5 = FUN_0202A578(res2, 1, 0);
+ u8 res3 = (u8)FUN_0202A578(res2, 0xd, 0);
+ u8 res4 = (u8)FUN_0202A578(res2, 0, 0);
+ u8 res5 = (u8)FUN_0202A578(res2, 1, 0);
- u8 res6 = FUN_0202A578(res2, 0xe, 0);
- u8 res7 = FUN_0202A578(res2, 2, 0);
- u8 res8 = FUN_0202A578(res2, 3, 0);
+ u8 res6 = (u8)FUN_0202A578(res2, 0xe, 0);
+ u8 res7 = (u8)FUN_0202A578(res2, 2, 0);
+ u8 res8 = (u8)FUN_0202A578(res2, 3, 0);
if (res3 != 0 && res4 != 0 && res5 != 0)
{
@@ -572,7 +509,7 @@ THUMB_FUNC u32 FUN_020600DC(struct SaveBlock2 *sav2)
u32 res3 = FUN_02060064(FUN_0202A5D0(res));
int i = 0;
- int res4 = FUN_0202A538(res, FUN_0202A240(res2, 0, 0), 0) * 0x18;
+ int res4 = FUN_0202A538(res, (u16)FUN_0202A240(res2, 0, 0), 0) * 0x18;
for (i = 0; i < res4; i++)
{
diff --git a/arm9/src/unk_0206BB28.c b/arm9/src/unk_0206BB28.c
index baaecc6a..e7c12793 100644
--- a/arm9/src/unk_0206BB28.c
+++ b/arm9/src/unk_0206BB28.c
@@ -6,12 +6,12 @@
#pragma thumb on
-BOOL FUN_0206BB28(struct SaveBlock2 * sav2)
+BOOL SavArray_IsNatDexEnabled(struct SaveBlock2 * sav2)
{
- return FUN_0206BB34(Sav2_Pokedex_get(sav2));
+ return Pokedex_IsNatDexEnabled(Sav2_Pokedex_get(sav2));
}
-BOOL FUN_0206BB34(struct Pokedex * pokedex)
+BOOL Pokedex_IsNatDexEnabled(struct Pokedex * pokedex)
{
return Pokedex_GetNatDexFlag(pokedex) == TRUE;
}
diff --git a/include/unk_0205FA2C.h b/include/unk_0205FA2C.h
index 7418c4a3..7875b5e9 100644
--- a/include/unk_0205FA2C.h
+++ b/include/unk_0205FA2C.h
@@ -8,6 +8,7 @@
#include "heap.h"
#include "party.h"
#include "player_data.h"
+#include "script.h"
#include "unk_0202A8F4.h"
#include "unk_0204639C.h"
#include "unk_0206BB28.h"
@@ -31,4 +32,111 @@ const u8 UNK_020F7454[] = {
};
+struct UnkPlayerStruct1_0205FA2C
+{
+ /* 0x00 */ struct PlayerParty *player_party;
+ /* 0x04 */ struct Bag *bag;
+ u32 unk08;
+ /* 0x0c */ struct Options *options;
+ u32 unk10[4];
+ u8 unk20;
+ u8 unk21;
+ u8 unk22;
+ u8 unk23;
+ u32 unk24[2];
+ u8 unk2c[6];
+ u8 unk32:4;
+ u8 unk322:4;
+ u8 unk33;
+ u32 unk34[3];
+};
+
+
+struct UnkPlayerStruct2_0205FA2C {
+ /* 0x00 */ struct PlayerParty *player_party;
+ /* 0x04 */ struct Options *options;
+ u32 unk08;
+ u32 unk0c;
+ u8 unk10;
+ u8 unk11;
+ u8 unk12;
+ /* 0x04 */ u8 party_count;
+ u8 unk14;
+ u8 unk15[3];
+ u16 unk18;
+ u16 unk1a;
+ /* 0x1c */ BOOL IsNatDex;
+ void *unk20;
+ u32 unk24;
+ u32 unk28;
+ u32 unk2c;
+
+};
+
+
+
+struct UnkCallbackStruct1_0205FA2C {
+ u32 unk00;
+ u32 unk04;
+ u8 unk08;
+ u8 unk09;
+ u8 unk0a;
+ u8 unk0b;
+ u8 unk0c;
+ u8 unk0d;
+ u8 unk0e[6];
+ void **unk14;
+};
+
+
+
+
+struct UnkCallbackStruct2_0205FA2C {
+ u32 unk00;
+ u32 unk04;
+ u32 *unk08;
+ u32 unk0c;
+ u16 unk10;
+ u16 unk12;
+ u16 unk14;
+};
+
+
+
+
+
+
+THUMB_FUNC u32 FUN_0205FA2C(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1, u32 heap_id);
+THUMB_FUNC u32 FUN_0205FAD8(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1);
+THUMB_FUNC u32 FUN_0205FB34(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1, u32 heap_id);
+THUMB_FUNC u32 FUN_0205FBC0(struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1);
+THUMB_FUNC int FUN_0205FBE8(struct UnkStruct_0204639C *param0);
+THUMB_FUNC void FUN_0205FC50(struct UnkStruct_0204639C *param0,
+ void **param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ u8 param6,
+ u8 param7);
+
+THUMB_FUNC u32 FUN_0205FC9C(struct UnkCallbackStruct2_0205FA2C *param0, struct UnkStruct_0204639C *param1);
+THUMB_FUNC u32 FUN_0205FCC4(struct UnkCallbackStruct2_0205FA2C *param0, struct UnkStruct_0204639C *param1);
+THUMB_FUNC int FUN_0205FCE8(struct UnkStruct_0204639C *param0);
+THUMB_FUNC void FUN_0205FD38(struct UnkStruct_0204639C *param0, u16 param1, u16 param2, u16 param3);
+
+
+THUMB_FUNC int FUN_0205FD70(struct UnkStruct_0204639C *param0);
+THUMB_FUNC void FUN_0205FDDC(struct UnkStruct_0204639C *param0, u16 param1, u16 param2);
+
+THUMB_FUNC u32 FUN_0205FE10(struct SaveBlock2 *sav2);
+THUMB_FUNC u32 FUN_0205FF5C(struct SaveBlock2 *sav2);
+THUMB_FUNC void FUN_02060044(u16 **param0, u32 *param1);
+THUMB_FUNC u32 FUN_02060064(u32 param0);
+THUMB_FUNC u32 FUN_02060070(u32 param0);
+THUMB_FUNC u32 FUN_0206007C(struct SaveBlock2 *sav2);
+THUMB_FUNC u32 FUN_020600A0(struct SaveBlock2 *sav2);
+THUMB_FUNC u32 FUN_020600DC(struct SaveBlock2 *sav2);
+THUMB_FUNC BOOL FUN_02060144(u32 **param0);
+
#endif //POKEDIAMOND_UNK_0205FA2C_H \ No newline at end of file
diff --git a/include/unk_0206BB28.h b/include/unk_0206BB28.h
index ff60e220..44997e73 100644
--- a/include/unk_0206BB28.h
+++ b/include/unk_0206BB28.h
@@ -5,8 +5,8 @@
#include "pokedex.h"
#include "pokemon.h"
-BOOL FUN_0206BB28(struct SaveBlock2 * sav2);
-BOOL FUN_0206BB34(struct Pokedex * pokedex);
+BOOL SavArray_IsNatDexEnabled(struct SaveBlock2 * sav2);
+BOOL Pokedex_IsNatDexEnabled(struct Pokedex * pokedex);
u32 FUN_0206BB48(BOOL isNationalDex, u32 species);
#endif //POKEDIAMOND_UNK_0206BB28_H