summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm9/asm/unk_020061E8.s45
-rw-r--r--arm9/src/unk_020061E8.c35
-rw-r--r--include/unk_020061E8.h9
3 files changed, 44 insertions, 45 deletions
diff --git a/arm9/asm/unk_020061E8.s b/arm9/asm/unk_020061E8.s
deleted file mode 100644
index 22f390c7..00000000
--- a/arm9/asm/unk_020061E8.s
+++ /dev/null
@@ -1,45 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
- .section .text
-
- thumb_func_start FUN_020061E8
-FUN_020061E8: ; 0x020061E8
- push {r3-r7, lr}
- add r5, r1, #0x0
- add r6, r0, #0x0
- add r7, r2, #0x0
- cmp r5, #0x0
- beq _0200620C
- add r0, r3, #0x0
- bl AllocFromHeap
- add r4, r0, #0x0
- bne _02006202
- mov r0, #0x0
- pop {r3-r7, pc}
-_02006202:
- mov r1, #0x0
- add r2, r5, #0x0
- bl memset
- b _0200620E
-_0200620C:
- mov r4, #0x0
-_0200620E:
- add r0, r6, #0x0
- add r1, r4, #0x0
- add r2, r7, #0x0
- bl FUN_0200CA44
- pop {r3-r7, pc}
- .balign 4
-
- thumb_func_start FUN_0200621C
-FUN_0200621C: ; 0x0200621C
- push {r4, lr}
- add r4, r0, #0x0
- bl FUN_0201B6C8
- cmp r0, #0x0
- beq _0200622C
- bl FreeToHeap
-_0200622C:
- add r0, r4, #0x0
- bl FUN_0200CAB4
- pop {r4, pc}
diff --git a/arm9/src/unk_020061E8.c b/arm9/src/unk_020061E8.c
new file mode 100644
index 00000000..da8eac1b
--- /dev/null
+++ b/arm9/src/unk_020061E8.c
@@ -0,0 +1,35 @@
+#include "global.h"
+#include "heap.h"
+#include "unk_0200CA44.h"
+#include "unk_020061E8.h"
+
+extern struct TextPrinter *FUN_0201B6C8(void);
+
+THUMB_FUNC BOOL FUN_020061E8(void (*r0)(u32, struct TextPrinter *), u32 r1, u32 r2, u32 r3)
+{
+ void * r4;
+ if(r1 != 0)
+ {
+ r4 = AllocFromHeap(r3, r1);
+ if(r4 == 0)
+ {
+ return FALSE;
+ } // _02006202
+ memset(r4, 0, r1);
+ } // _0200620C
+ else
+ {
+ r4 = NULL;
+ } // _0200620E
+ return FUN_0200CA44(r0, r4, r2);
+}
+
+THUMB_FUNC void FUN_0200621C(s32 r4)
+{
+ struct TextPrinter * r0 = FUN_0201B6C8();
+ if(r0 != NULL)
+ {
+ FreeToHeap(r0);
+ }
+ FUN_0200CAB4(r4);
+}
diff --git a/include/unk_020061E8.h b/include/unk_020061E8.h
new file mode 100644
index 00000000..a2d571bf
--- /dev/null
+++ b/include/unk_020061E8.h
@@ -0,0 +1,9 @@
+#ifndef POKEDIAMOND_UNK_020061E8_H
+#define POKEDIAMOND_UNK_020061E8_H
+
+#include "text.h"
+
+BOOL FUN_020061E8(void (*r0)(u32, struct TextPrinter *), u32 r1, u32 r2, u32 r3);
+void FUN_0200621C(s32 r0);
+
+#endif // POKEDIAMOND_UNK_020061E8_H