mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Start decompiling pokenav_unk_3.c
This commit is contained in:
parent
19fdfaa5f2
commit
e3bdb08efa
@ -5,56 +5,6 @@
|
||||
|
||||
@ File centered around AllocSubstruct(5)
|
||||
|
||||
thumb_func_start sub_81CAAE8
|
||||
sub_81CAAE8: @ 81CAAE8
|
||||
push {r4,lr}
|
||||
movs r1, 0xD4
|
||||
lsls r1, 1
|
||||
movs r0, 0x5
|
||||
bl AllocSubstruct
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
beq _081CAB1C
|
||||
ldr r0, =sub_81CAB44
|
||||
str r0, [r4, 0x18]
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x8]
|
||||
str r0, [r4, 0x10]
|
||||
ldr r0, =sub_81CAD20
|
||||
movs r1, 0x1
|
||||
bl CreateLoopedTask
|
||||
str r0, [r4, 0x14]
|
||||
movs r0, 0x1
|
||||
b _081CAB1E
|
||||
.pool
|
||||
_081CAB1C:
|
||||
movs r0, 0
|
||||
_081CAB1E:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81CAAE8
|
||||
|
||||
thumb_func_start sub_81CAB24
|
||||
sub_81CAB24: @ 81CAB24
|
||||
push {lr}
|
||||
movs r0, 0x5
|
||||
bl GetSubstructPtr
|
||||
ldr r1, [r0, 0x18]
|
||||
bl _call_via_r1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81CAB24
|
||||
|
||||
thumb_func_start sub_81CAB38
|
||||
sub_81CAB38: @ 81CAB38
|
||||
push {lr}
|
||||
movs r0, 0x5
|
||||
bl FreePokenavSubstruct
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81CAB38
|
||||
|
||||
thumb_func_start sub_81CAB44
|
||||
sub_81CAB44: @ 81CAB44
|
||||
push {r4,r5,lr}
|
||||
|
@ -76,5 +76,9 @@ int sub_81C9894(void);
|
||||
u32 sub_81C99D4(void);
|
||||
void sub_81CAADC(void);
|
||||
|
||||
// pokenav_unk_3.c
|
||||
bool32 sub_81CAAE8(void);
|
||||
u32 sub_81CAB24(void);
|
||||
void sub_81CAB38(void);
|
||||
|
||||
#endif //GUARD_POKENAV_H
|
||||
|
@ -305,6 +305,7 @@ SECTIONS {
|
||||
src/pokenav_match_call_ui.o(.text);
|
||||
src/pokenav_unk_1.o(.text);
|
||||
asm/pokenav_unk_2.o(.text);
|
||||
src/pokenav_unk_3.o(.text);
|
||||
asm/pokenav_unk_3.o(.text);
|
||||
asm/pokenav_unk_4.o(.text);
|
||||
asm/pokenav_unk_5.o(.text);
|
||||
|
@ -28,7 +28,7 @@ struct PokenavResources
|
||||
|
||||
struct UnknownPokenavCallbackStruct
|
||||
{
|
||||
u32 (*unk0)(void);
|
||||
bool32 (*unk0)(void);
|
||||
u32 (*unk4)(void);
|
||||
u32 (*unk8)(void);
|
||||
u32 (*unkC)(void);
|
||||
@ -65,12 +65,9 @@ extern u32 sub_81CF3F8(void);
|
||||
extern u32 sub_81CD024(void);
|
||||
extern u32 sub_81CEF98(void);
|
||||
extern u32 sub_81CF368(void);
|
||||
extern u32 sub_81CAAE8(void);
|
||||
extern u32 sub_81CAB24(void);
|
||||
extern u32 sub_81CB260(void);
|
||||
extern u32 sub_81CB29C(void);
|
||||
extern u32 sub_81CB2CC(void);
|
||||
extern void sub_81CAB38(void);
|
||||
extern u32 sub_81CB2E0(void);
|
||||
extern u32 sub_81CF9BC(void);
|
||||
extern u32 sub_81CFA34(void);
|
||||
|
40
src/pokenav_unk_3.c
Executable file
40
src/pokenav_unk_3.c
Executable file
@ -0,0 +1,40 @@
|
||||
#include "global.h"
|
||||
#include "pokenav.h"
|
||||
|
||||
struct Pokenav3Struct
|
||||
{
|
||||
u8 filler0[0x8];
|
||||
u16 unk8;
|
||||
u8 fillerA[0x6];
|
||||
u32 unk10;
|
||||
u32 unk14;
|
||||
u32 (*unk18)(struct Pokenav3Struct*);
|
||||
u8 filler1C[0x18C];
|
||||
};
|
||||
|
||||
u32 sub_81CAB44(struct Pokenav3Struct *);
|
||||
u32 sub_81CAD20(int);
|
||||
|
||||
bool32 sub_81CAAE8(void)
|
||||
{
|
||||
struct Pokenav3Struct *state = AllocSubstruct(5, sizeof(struct Pokenav3Struct));
|
||||
if (!state)
|
||||
return FALSE;
|
||||
|
||||
state->unk18 = sub_81CAB44;
|
||||
state->unk8 = 0;
|
||||
state->unk10 = 0;
|
||||
state->unk14 = CreateLoopedTask(sub_81CAD20, 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_81CAB24(void)
|
||||
{
|
||||
struct Pokenav3Struct *state = GetSubstructPtr(5);
|
||||
return state->unk18(state);
|
||||
}
|
||||
|
||||
void sub_81CAB38(void)
|
||||
{
|
||||
FreePokenavSubstruct(5);
|
||||
}
|
Loading…
Reference in New Issue
Block a user