Start decomp of pokenav_unk_1

Looks like it's the Ribbons menu, based on the first function.
This commit is contained in:
Phlosioneer 2019-04-07 22:42:31 -04:00 committed by huderlem
parent 518f9c0638
commit ee2edb068a
5 changed files with 48 additions and 57 deletions

View File

@ -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}

View File

@ -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

View File

@ -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);

View File

@ -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);

43
src/pokenav_unk_1.c Normal file
View File

@ -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;
}