diff --git a/asm/pokenav.s b/asm/pokenav.s index b5f33872c..744ed90c4 100644 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -5,94 +5,6 @@ .text - thumb_func_start sub_81C763C -sub_81C763C: @ 81C763C - ldr r1, =gUnknown_0203CF40 - ldr r1, [r1] - lsls r0, 2 - adds r1, 0x10 - adds r1, r0 - ldr r0, [r1] - bx lr - .pool - thumb_func_end sub_81C763C - - thumb_func_start sub_81C7650 -sub_81C7650: @ 81C7650 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CF40 - ldr r1, [r5] - lsls r4, r0, 2 - adds r1, 0x10 - adds r1, r4 - ldr r0, [r1] - cmp r0, 0 - beq _081C7670 - bl Free - ldr r0, [r5] - adds r0, 0x10 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_081C7670: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7650 - - thumb_func_start sub_81C767C -sub_81C767C: @ 81C767C - ldr r0, =gUnknown_0203CF40 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - bx lr - .pool - thumb_func_end sub_81C767C - - thumb_func_start sub_81C7688 -sub_81C7688: @ 81C7688 - ldr r1, =gUnknown_0203CF40 - ldr r1, [r1] - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_81C7688 - - thumb_func_start sub_81C7694 -sub_81C7694: @ 81C7694 - push {lr} - adds r1, r0, 0 - cmp r1, 0x4 - bls _081C769E - movs r1, 0 -_081C769E: - ldr r0, =gUnknown_0203CF40 - ldr r0, [r0] - strh r1, [r0, 0xA] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7694 - - thumb_func_start sub_81C76AC -sub_81C76AC: @ 81C76AC - ldr r0, =gUnknown_0203CF40 - ldr r0, [r0] - ldrh r0, [r0, 0xA] - bx lr - .pool - thumb_func_end sub_81C76AC - - thumb_func_start sub_81C76B8 -sub_81C76B8: @ 81C76B8 - ldr r0, =gUnknown_0203CF40 - ldr r0, [r0] - ldr r0, [r0, 0xC] - bx lr - .pool - thumb_func_end sub_81C76B8 - thumb_func_start sub_81C76C4 sub_81C76C4: @ 81C76C4 push {r4,lr} diff --git a/src/pokenav_main.c b/src/pokenav_main.c index b2e0589ce..f35564ee7 100644 --- a/src/pokenav_main.c +++ b/src/pokenav_main.c @@ -13,6 +13,7 @@ struct UnknownStruct_0203CF40 { u32 (*field0)(void); u32 field4; u16 field8; + u16 fieldA; u32 fieldC; u32* field10[19]; //u32* field14[18]; @@ -26,12 +27,11 @@ 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_81C7650(s32 a0); +extern void sub_81C7834(u32 (*a0)(void), u32(*a1)(void)); +extern void sub_81C7850(u32 a0); extern void sub_81C76C4(void); extern void sub_81C7710(void); -extern void sub_81C7850(u32 a0); extern void sub_81C9430(void); -extern void sub_81C7834(u32 (*a0)(void), u32(*a1)(void)); extern u32 sub_81C76FC(void); extern u32 sub_81C786C(void); extern u32 sub_81C7738(void); @@ -40,15 +40,16 @@ bool32 sub_81C756C(u32 a0); u32 AnyMonHasRibbon(void); u32 sub_81C75E0(void); u32 sub_81C75D4(void); -void sub_81C75F4(void); -void sub_81C7334(void); +void sub_81C7360(struct UnknownStruct_0203CF40 *a0); +void sub_81C7650(u32 index); void sub_81C71E4(u8 a0); void sub_81C7170(u8 a0); +void sub_81C742C(u8 taskId); +void sub_81C75F4(void); +void sub_81C7334(void); void sub_81C7418(void); void sub_81C7400(void); -void sub_81C742C(u8 taskId); void sub_81C72BC(void); -void sub_81C7360(struct UnknownStruct_0203CF40 *a0); u32 sub_81C7078(u32 (*a0)(u32), u32 a1) { @@ -369,4 +370,42 @@ void sub_81C760C(void) { u32* sub_81C761C(u32 a0, u32 a1) { return gUnknown_0203CF40->field10[a0] = (u32*)Alloc(a1); -} \ No newline at end of file +} + +u32* sub_81C763C(u32 a0) { + return gUnknown_0203CF40->field10[a0]; +} + +void sub_81C7650(u32 index) { + if (gUnknown_0203CF40->field10[index] != NULL) { + Free(gUnknown_0203CF40->field10[index]); + gUnknown_0203CF40->field10[index] = NULL; + } +} + +u16 sub_81C767C(void) { + return gUnknown_0203CF40->field8; +} + +void sub_81C7688(u16 a0) { + gUnknown_0203CF40->field8 = a0; +} + +void sub_81C7694(u32 a0) { + u32 value; + value = a0; + if (a0 > 4) { + value = 0; + } + gUnknown_0203CF40->fieldA = value; +} + +u16 sub_81C76AC(void) { + return gUnknown_0203CF40->fieldA; +} + +u32 sub_81C76B8(void) { + return gUnknown_0203CF40->fieldC; +} + +