diff --git a/asm/pokenav.s b/asm/pokenav.s index 74cf91ca4..904822ee4 100644 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -5,92 +5,6 @@ .text - thumb_func_start sub_81C7834 -sub_81C7834: @ 81C7834 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - bl sub_81C763C - str r4, [r0] - str r5, [r0, 0x4] - movs r1, 0 - str r1, [r0, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C7834 - - thumb_func_start sub_81C7850 -sub_81C7850: @ 81C7850 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - movs r1, 0 - str r1, [r0, 0x8] - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C7850 - - thumb_func_start sub_81C786C -sub_81C786C: @ 81C786C - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0x4] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81C786C - - thumb_func_start sub_81C7880 -sub_81C7880: @ 81C7880 - push {r4,lr} - movs r0, 0 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =atk47_cmd47 - movs r1, 0x4 - bl sub_81C7078 - str r0, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7880 - - thumb_func_start sub_81C78A0 -sub_81C78A0: @ 81C78A0 - push {r4,lr} - movs r0, 0 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =sub_81C791C - movs r1, 0x4 - bl sub_81C7078 - str r0, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C78A0 - - thumb_func_start sub_81C78C0 -sub_81C78C0: @ 81C78C0 - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0xC] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81C78C0 - thumb_func_start atk47_cmd47 atk47_cmd47: @ 81C78D4 push {lr} diff --git a/src/pokenav_main.c b/src/pokenav_main.c index 21d3e90e8..29df2b40f 100644 --- a/src/pokenav_main.c +++ b/src/pokenav_main.c @@ -29,6 +29,11 @@ struct UnknownStruct_0861F3EC { u32 (*data[7])(void); }; +struct UnknownStruct_sub_81C7850 { + // Unknown size; at least 3. + void (*data[3])(u32); +}; + struct UnknownStruct_sub_81C76C4 { u32 data[523]; }; @@ -39,10 +44,7 @@ extern struct UnknownStruct_0203CF40 *gUnknown_0203CF40; extern u8 gUnknown_0203CF3C; extern struct UnknownStruct_0861F3EC gUnknown_0861F3EC[7]; // Unknown size; at least 7. -extern void sub_81C7834(u32 (*a0)(void), u32(*a1)(void)); -extern void sub_81C7850(u32 a0); extern void sub_81C9430(void); -extern u32 sub_81C786C(void); extern void sub_81CAADC(void); extern void sub_81C99D4(void); extern void sub_81C7C94(void); @@ -51,6 +53,8 @@ extern void sub_81C7944(void* palette, u32 a1, u32 a2); extern void sub_81C7B74(void); extern void sub_81C7C28(void); extern void sub_81C7D28(void); +extern u32 atk47_cmd47(s32 a0); +extern u32 sub_81C791C(s32 a0); bool32 sub_81C756C(u32 a0); @@ -59,10 +63,13 @@ u32 AnyMonHasRibbon(void); u32 sub_81C75E0(void); u32 sub_81C75D4(void); u32 sub_81C76FC(void); +u32 sub_81C786C(void); u32 sub_81C7764(s32 a0); bool32 sub_81C7738(void); +void sub_81C7834(u32 (*a0)(void), u32(*a1)(void)); void sub_81C7360(struct UnknownStruct_0203CF40 *a0); void sub_81C7650(u32 index); +void sub_81C7850(u32 a0); void sub_81C71E4(u8 a0); void sub_81C7170(u8 a0); void sub_81C742C(u8 taskId); @@ -508,4 +515,55 @@ u32 sub_81C7764(s32 a0) { default: return 4; } +} + +void sub_81C7834(u32 (*a0)(void), u32(*a1)(void)) { + // This is a guess. + struct UnknownStruct_0861F3EC *v1; + + v1 = sub_81C763C(0); + v1->data[0] = a0; + v1->data[1] = a1; + v1->data[2] = NULL; +} + +void sub_81C7850(u32 a0) { + // This is a guess. + struct UnknownStruct_sub_81C7850 *v1; + + v1 = sub_81C763C(0); + v1->data[2] = NULL; + v1->data[0](a0); +} + +u32 sub_81C786C(void) { + // This is a guess. + struct UnknownStruct_0861F3EC *v1; + + v1 = sub_81C763C(0); + return v1->data[1](); +} + +void sub_81C7880(void) { + // This is a guess. + struct UnknownStruct_0203CF40* v1; + + v1 = sub_81C763C(0); + v1->fieldC = sub_81C7078(atk47_cmd47, 4); +} + +void sub_81C78A0(void) { + // This is a guess. + struct UnknownStruct_0203CF40* v1; + + v1 = sub_81C763C(0); + v1->fieldC = sub_81C7078(sub_81C791C, 4); +} + +bool32 sub_81C78C0(void) { + // This is a guess. + struct UnknownStruct_0203CF40* v1; + + v1 = sub_81C763C(0); + return sub_81C70D8(v1->fieldC); } \ No newline at end of file