summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm9/asm/unk_020061E8.s45
-rw-r--r--arm9/asm/unk_020222E8.s46
-rw-r--r--arm9/asm/unk_02064E20.s25
-rw-r--r--arm9/src/palette.c5
-rw-r--r--arm9/src/unk_020061E8.c35
-rw-r--r--arm9/src/unk_020222E8.c33
-rw-r--r--arm9/src/unk_02064E20.c17
-rw-r--r--include/unk_020061E8.h10
-rw-r--r--include/unk_020222E8.h11
-rw-r--r--include/unk_02064E20.h8
10 files changed, 115 insertions, 120 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/asm/unk_020222E8.s b/arm9/asm/unk_020222E8.s
deleted file mode 100644
index 047712a5..00000000
--- a/arm9/asm/unk_020222E8.s
+++ /dev/null
@@ -1,46 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
-
- .text
-
- thumb_func_start FUN_020222E8
-FUN_020222E8: ; 0x020222E8
- mov r0, #0x5
- lsl r0, r0, #0x18
- bx lr
- .balign 4
-
- thumb_func_start FUN_020222F0
-FUN_020222F0: ; 0x020222F0
- mov r0, #0x2
- lsl r0, r0, #0x8
- bx lr
- .balign 4
-
- thumb_func_start FUN_020222F8
-FUN_020222F8: ; 0x020222F8
- ldr r0, _020222FC ; =0x05000400
- bx lr
- .balign 4
-_020222FC: .word 0x05000400
-
- thumb_func_start FUN_02022300
-FUN_02022300: ; 0x02022300
- mov r0, #0x2
- lsl r0, r0, #0x8
- bx lr
- .balign 4
-
- thumb_func_start FUN_02022308
-FUN_02022308: ; 0x02022308
- ldr r0, _0202230C ; =0x05000200
- bx lr
- .balign 4
-_0202230C: .word 0x05000200
-
- thumb_func_start FUN_02022310
-FUN_02022310: ; 0x02022310
- ldr r0, _02022314 ; =0x05000600
- bx lr
- .balign 4
-_02022314: .word 0x05000600
diff --git a/arm9/asm/unk_02064E20.s b/arm9/asm/unk_02064E20.s
deleted file mode 100644
index 19ada5a3..00000000
--- a/arm9/asm/unk_02064E20.s
+++ /dev/null
@@ -1,25 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
-
- .text
-
- thumb_func_start FUN_02064E20
-FUN_02064E20: ; 0x02064E20
- push {r4, lr}
- bl ScriptEnvironment_GetSav2Ptr
- bl FUN_02024ED8
- add r4, r0, #0x0
- bl FUN_020254B4
- cmp r0, #0x6
- beq _02064E48
- add r0, r4, #0x0
- mov r1, #0x6
- bl FUN_02025490
- add r0, r4, #0x0
- mov r1, #0x6
- bl FUN_020254A0
- mov r1, #0x2
- strh r1, [r0, #0x0]
-_02064E48:
- pop {r4, pc}
- .balign 4
diff --git a/arm9/src/palette.c b/arm9/src/palette.c
index 6726a0ec..e4c42cc4 100644
--- a/arm9/src/palette.c
+++ b/arm9/src/palette.c
@@ -3,11 +3,8 @@
#include "MI_memory.h"
#include "gf_gfx_loader.h"
#include "unk_0200CA44.h"
+#include "unk_020222E8.h"
-extern void *FUN_020222E8();
-extern void *FUN_020222F8();
-extern void *FUN_02022308();
-extern void *FUN_02022310();
extern int abs(int);
THUMB_FUNC struct PaletteData *FUN_02002FD0(u32 heap_id)
diff --git a/arm9/src/unk_020061E8.c b/arm9/src/unk_020061E8.c
new file mode 100644
index 00000000..424fea34
--- /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;
+ }
+ memset(r4, 0, r1);
+ }
+ else
+ {
+ r4 = NULL;
+ }
+ 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/arm9/src/unk_020222E8.c b/arm9/src/unk_020222E8.c
new file mode 100644
index 00000000..30a2a2c4
--- /dev/null
+++ b/arm9/src/unk_020222E8.c
@@ -0,0 +1,33 @@
+#include "global.h"
+#include "unk_020222E8.h"
+
+THUMB_FUNC void * FUN_020222E8()
+{
+ return 0x5 << 0x18;
+}
+
+THUMB_FUNC void * FUN_020222F0()
+{
+ return 0x2 << 0x8;
+}
+
+THUMB_FUNC void * FUN_020222F8()
+{
+ return 0x05000400;
+}
+
+THUMB_FUNC void * FUN_02022300()
+{
+ return 0x2 << 0x8;
+}
+
+THUMB_FUNC void * FUN_02022308()
+{
+ return 0x05000200;
+}
+
+THUMB_FUNC void * FUN_02022310()
+{
+ return 0x05000600;
+}
+
diff --git a/arm9/src/unk_02064E20.c b/arm9/src/unk_02064E20.c
new file mode 100644
index 00000000..8586981b
--- /dev/null
+++ b/arm9/src/unk_02064E20.c
@@ -0,0 +1,17 @@
+#include "global.h"
+#include "scrcmd.h"
+#include "unk_02025484.h"
+#include "unk_02024E64.h"
+#include "unk_02064E20.h"
+
+THUMB_FUNC void FUN_02064E20(struct UnkSavStruct80* unk0)
+{
+ struct unk_2025484 * r4 = (struct unk_2025484 *)FUN_02024ED8(ScriptEnvironment_GetSav2Ptr(unk0));
+ if((u32)FUN_020254B4(r4) == 6)
+ {
+ return;
+ }
+ FUN_02025490(r4, 6);
+ u16 * ptr0 = (u16 *)FUN_020254A0(r4 , 6);
+ ptr0[0] = 2;
+}
diff --git a/include/unk_020061E8.h b/include/unk_020061E8.h
new file mode 100644
index 00000000..d94ea88f
--- /dev/null
+++ b/include/unk_020061E8.h
@@ -0,0 +1,10 @@
+#ifndef POKEDIAMOND_UNK_020061E8_H
+#define POKEDIAMOND_UNK_020061E8_H
+
+#include "nitro/types.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
diff --git a/include/unk_020222E8.h b/include/unk_020222E8.h
new file mode 100644
index 00000000..ac6e1932
--- /dev/null
+++ b/include/unk_020222E8.h
@@ -0,0 +1,11 @@
+#ifndef POKEDIAMOND_UNK_020222E8_H
+#define POKEDIAMOND_UNK_020222E8_H
+
+void * FUN_020222E8();
+void * FUN_020222F0();
+void * FUN_020222F8();
+void * FUN_02022300();
+void * FUN_02022308();
+void * FUN_02022310();
+
+#endif // POKEDIAMOND_UNK_020222E8_H
diff --git a/include/unk_02064E20.h b/include/unk_02064E20.h
new file mode 100644
index 00000000..a9bcd0e0
--- /dev/null
+++ b/include/unk_02064E20.h
@@ -0,0 +1,8 @@
+#ifndef POKEDIAMOND_UNK_02064E20_H
+#define POKEDIAMOND_UNK_02064E20_H
+
+#include "script.h"
+
+void FUN_02064E20(struct UnkSavStruct80* unk0);
+
+#endif // POKEDIAMOND_UNK_02064E20_H