summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorred031000 <rubenru09@aol.com>2021-06-01 19:03:15 +0100
committerred031000 <rubenru09@aol.com>2021-06-01 19:03:15 +0100
commit66c988dd6b2d62e930d897c4a4d0c575464c8d0c (patch)
treef34a244ae20a28758188748ccf9ad59b39b9e438
parentf84ce2d813902c7c4bdd6db34b40152ddf9cadde (diff)
decomp unk_02033778.c
-rw-r--r--arm9/asm/unk_02033778.s60
-rw-r--r--arm9/src/unk_02033778.c37
-rw-r--r--include/unk_02033778.h9
3 files changed, 46 insertions, 60 deletions
diff --git a/arm9/asm/unk_02033778.s b/arm9/asm/unk_02033778.s
deleted file mode 100644
index 763e7b30..00000000
--- a/arm9/asm/unk_02033778.s
+++ /dev/null
@@ -1,60 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
-
- .text
-
- thumb_func_start FUN_02033778
-FUN_02033778: ; 0x02033778
- push {r3-r7, lr}
- str r0, [sp, #0x0]
- bl FUN_02030F20
- add r7, r0, #0x0
- mov r0, #0x0
- bl FUN_0202DFA4
- cmp r0, #0x0
- beq _020337C6
- mov r5, #0x0
- cmp r7, #0x0
- ble _020337C6
-_02033792:
- bl FUN_02031190
- cmp r5, r0
- beq _020337C0
- add r0, r5, #0x0
- bl FUN_0202E020
- add r4, r0, #0x0
- add r0, r5, #0x0
- bl FUN_0202E044
- add r6, r0, #0x0
- add r0, r5, #0x0
- bl FUN_0202DFA4
- bl PlayerProfile_GetLanguage
- add r3, r0, #0x0
- ldr r0, [sp, #0x0]
- add r1, r4, #0x0
- add r2, r6, #0x0
- bl FUN_020337C8
-_020337C0:
- add r5, r5, #0x1
- cmp r5, r7
- blt _02033792
-_020337C6:
- pop {r3-r7, pc}
-
- thumb_func_start FUN_020337C8
-FUN_020337C8: ; 0x020337C8
- push {r4-r6, lr}
- add r5, r0, #0x0
- add r4, r1, #0x0
- add r6, r2, #0x0
- bl FUN_02029B40
- cmp r0, #0x0
- bne _020337E4
- add r0, r5, #0x0
- add r1, r4, #0x0
- add r2, r6, #0x0
- mov r3, #0x1
- bl FUN_02029B90
-_020337E4:
- pop {r4-r6, pc}
- .balign 4
diff --git a/arm9/src/unk_02033778.c b/arm9/src/unk_02033778.c
new file mode 100644
index 00000000..1c191eff
--- /dev/null
+++ b/arm9/src/unk_02033778.c
@@ -0,0 +1,37 @@
+#include "global.h"
+#include "unk_02033778.h"
+#include "unk_0202F150.h"
+#include "player_data.h"
+
+extern struct PlayerData *FUN_0202DFA4(s32 param0);
+extern u32 FUN_0202E020(s32 param0);
+extern u32 FUN_0202E044(s32 param0);
+extern u32 FUN_02029B40(u32 param0, u32 param1, u32 param2, u32 language);
+extern void FUN_02029B90(u32 param0, u32 param1, u32 param2, u32 param3);
+
+THUMB_FUNC void FUN_02033778(u32 param0)
+{
+ s32 unk = FUN_02030F20();
+ if (FUN_0202DFA4(0) == NULL)
+ {
+ return;
+ }
+
+ for (s32 i = 0; i < unk; i++)
+ {
+ if (FUN_02031190() == i)
+ {
+ continue;
+ }
+ FUN_020337C8(param0, FUN_0202E020(i), FUN_0202E044(i), PlayerProfile_GetLanguage(FUN_0202DFA4(i)));
+ }
+}
+
+THUMB_FUNC void FUN_020337C8(u32 param0, u32 param1, u32 param2, u32 language)
+{
+ if (FUN_02029B40(param0, param1, param2, language) != 0)
+ {
+ return;
+ }
+ FUN_02029B90(param0, param1, param2, 1);
+}
diff --git a/include/unk_02033778.h b/include/unk_02033778.h
new file mode 100644
index 00000000..e1f64e05
--- /dev/null
+++ b/include/unk_02033778.h
@@ -0,0 +1,9 @@
+#ifndef POKEDIAMOND_UNK_02033778_H
+#define POKEDIAMOND_UNK_02033778_H
+
+#include "nitro/types.h"
+
+void FUN_02033778(u32 param0);
+void FUN_020337C8(u32 param0, u32 param1, u32 param2, u32 language);
+
+#endif //POKEDIAMOND_UNK_02033778_H