summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/pokenav_unk_1.s56
-rw-r--r--include/pokenav.h3
-rw-r--r--ld_script.txt2
-rw-r--r--src/pokenav.c1
-rw-r--r--src/pokenav_unk_1.c43
5 files changed, 48 insertions, 57 deletions
diff --git a/asm/pokenav_unk_1.s b/asm/pokenav_unk_1.s
index bc4a5968f..c9342ebe8 100644
--- a/asm/pokenav_unk_1.s
+++ b/asm/pokenav_unk_1.s
@@ -3,62 +3,6 @@
.syntax unified
-@ File centered around AllocSubstruct(1)
-
- thumb_func_start sub_81C9268
-sub_81C9268: @ 81C9268
- push {r4,lr}
- movs r4, 0
- movs r0, 0x98
- lsls r0, 1
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _081C928A
- movs r4, 0x1
- ldr r0, =0x0000089b
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _081C928A
- movs r4, 0x2
-_081C928A:
- adds r0, r4, 0
- pop {r4}
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_81C9268
-
- thumb_func_start sub_81C9298
-sub_81C9298: @ 81C9298
- push {r4,lr}
- movs r0, 0x1
- movs r1, 0x10
- bl AllocSubstruct
- adds r4, r0, 0
- cmp r4, 0
- beq _081C92C4
- bl sub_81C9268
- lsls r0, 24
- lsrs r0, 24
- movs r1, 0
- strh r0, [r4]
- strh r1, [r4, 0x2]
- strh r1, [r4, 0x4]
- strh r1, [r4, 0x6]
- adds r0, r4, 0
- bl sub_81C939C
- movs r0, 0x1
- b _081C92C6
-_081C92C4:
- movs r0, 0
-_081C92C6:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_81C9298
-
thumb_func_start sub_81C92CC
sub_81C92CC: @ 81C92CC
push {r4,lr}
diff --git a/include/pokenav.h b/include/pokenav.h
index d1bdbb2e9..4c928068c 100644
--- a/include/pokenav.h
+++ b/include/pokenav.h
@@ -25,4 +25,7 @@ bool32 IsLoopedTaskActive(u32 taskId);
// pokenav_match_call_ui.c
+// pokenav_unk_1.c
+u32 sub_81C9298(void);
+
#endif //GUARD_POKENAV_H
diff --git a/ld_script.txt b/ld_script.txt
index faff51bb6..da2d0f430 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -303,6 +303,7 @@ SECTIONS {
src/pokenav.o(.text);
src/pokenav_main_menu.o(.text);
src/pokenav_match_call_ui.o(.text);
+ src/pokenav_unk_1.o(.text);
asm/pokenav_unk_1.o(.text);
asm/pokenav_unk_2.o(.text);
asm/pokenav_unk_3.o(.text);
@@ -632,6 +633,7 @@ SECTIONS {
src/pokenav.o(.rodata);
src/pokenav_main_menu.o(.rodata);
src/pokenav_match_call_ui.o(.rodata);
+ src/pokenav_unk_1.o(.rodata);
data/pokenav.o(.rodata);
src/pokenav_match_call_data.o(.rodata);
src/menu_specialized.o(.rodata);
diff --git a/src/pokenav.c b/src/pokenav.c
index 5fcf9e9bb..fba5bd1a6 100644
--- a/src/pokenav.c
+++ b/src/pokenav.c
@@ -47,7 +47,6 @@ struct PokenavResources
};
extern u32 sub_81C9430(void);
-extern u32 sub_81C9298(void);
extern u32 sub_81C941C(void);
extern u32 sub_81C9924(void);
extern u32 sub_81C99C0(void);
diff --git a/src/pokenav_unk_1.c b/src/pokenav_unk_1.c
new file mode 100644
index 000000000..dd2411e01
--- /dev/null
+++ b/src/pokenav_unk_1.c
@@ -0,0 +1,43 @@
+#include "global.h"
+#include "pokenav.h"
+#include "event_data.h"
+
+struct Pokenav1Struct
+{
+ u16 unk0;
+ u16 unk2;
+ u16 unk4;
+ u16 unk6;
+ u8 unk8[8];
+};
+
+extern void sub_81C939C(struct Pokenav1Struct *state);
+
+u8 sub_81C9268(void)
+{
+ u32 ret = 0;
+ if (FlagGet(FLAG_ADDED_MATCH_CALL_TO_POKENAV))
+ {
+ ret = 1;
+ if (FlagGet(FLAG_SYS_RIBBON_GET))
+ ret = 2;
+ }
+
+ return ret;
+}
+
+u32 sub_81C9298(void)
+{
+ struct Pokenav1Struct *state = AllocSubstruct(1, sizeof(struct Pokenav1Struct));
+
+ if (state == NULL)
+ return 0;
+
+ state->unk0 = sub_81C9268();
+ state->unk2 = 0;
+ state->unk4 = 0;
+ state->unk6 = 0;
+ sub_81C939C(state);
+
+ return 1;
+} \ No newline at end of file