summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-05-24 23:47:08 +0100
committerGitHub <noreply@github.com>2021-05-24 23:47:08 +0100
commit1f92eced46da4bdd0c31cb27d1b110aa8a9d75dd (patch)
treeeb0ce57a2ffa307da47026fb9d862bd2c208279d
parentfebbf5dc3d673ae40df7b6c545a40e945e6eda17 (diff)
parentd523142098cb0d0fb37eca7d91931859776b085d (diff)
Merge pull request #387 from tgsm/unk_0206439C
Decompile unk_0206439C
-rw-r--r--arm9/asm/unk_0206439C.s22
-rw-r--r--arm9/src/unk_0206439C.c16
-rw-r--r--include/unk_0206439C.h15
3 files changed, 31 insertions, 22 deletions
diff --git a/arm9/asm/unk_0206439C.s b/arm9/asm/unk_0206439C.s
deleted file mode 100644
index 4cc91f4f..00000000
--- a/arm9/asm/unk_0206439C.s
+++ /dev/null
@@ -1,22 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
-
- .text
-
- thumb_func_start FUN_0206439C
-FUN_0206439C: ; 0x0206439C
- push {r4-r6, lr}
- add r5, r1, #0x0
- add r6, r2, #0x0
- mov r1, #0x8
- bl AllocFromHeapAtEnd
- add r4, r0, #0x0
- add r0, r6, #0x0
- bl SavArray_PlayerParty_get
- add r1, r5, #0x0
- bl GetPartyMonByIndex
- str r0, [r4, #0x0]
- mov r0, #0x0
- str r0, [r4, #0x4]
- add r0, r4, #0x0
- pop {r4-r6, pc}
diff --git a/arm9/src/unk_0206439C.c b/arm9/src/unk_0206439C.c
new file mode 100644
index 00000000..80d93557
--- /dev/null
+++ b/arm9/src/unk_0206439C.c
@@ -0,0 +1,16 @@
+#include "global.h"
+#include "heap.h"
+#include "party.h"
+#include "save_block_2.h"
+#include "unk_0206439C.h"
+
+THUMB_FUNC struct UnkStruct_0206439C* FUN_0206439C(u32 heap_id, u8 mon_idx, struct SaveBlock2* sav2)
+{
+ struct UnkStruct_0206439C* ret = AllocFromHeapAtEnd(heap_id, sizeof(struct UnkStruct_0206439C));
+ struct PlayerParty* party = SavArray_PlayerParty_get(sav2);
+
+ ret->pokemon = GetPartyMonByIndex(party, mon_idx);
+ ret->unk4 = NULL;
+
+ return ret;
+}
diff --git a/include/unk_0206439C.h b/include/unk_0206439C.h
new file mode 100644
index 00000000..6d094e5c
--- /dev/null
+++ b/include/unk_0206439C.h
@@ -0,0 +1,15 @@
+#ifndef POKEDIAMOND_UNK_0206439C_H
+#define POKEDIAMOND_UNK_0206439C_H
+
+struct Pokemon;
+struct SaveBlock2;
+
+struct UnkStruct_0206439C
+{
+ struct Pokemon* pokemon;
+ void* unk4;
+};
+
+struct UnkStruct_0206439C* FUN_0206439C(u32 heap_id, u8 mon_idx, struct SaveBlock2* sav2);
+
+#endif