diff --git a/codescript.txt b/codescript.txt index da887bdde1..851ce4fe7c 100644 --- a/codescript.txt +++ b/codescript.txt @@ -202,7 +202,8 @@ SECTIONS build/asm/code_0x800BFB80.o(.text) build/asm/code_0x800CAAD0.o(.text) build/asm/code_0x800CAE10.o(.text) - build/asm/code_0x800E03A0.o(.text) + build/src/code/code_0x800E03A0.o(.text) + . += 0x10; /* XXX pad with NOPs*/ build/asm/code_0x800E0410.o(.text) build/asm/code_0x800E8EA0.o(.text) build/asm/code_0x800E9360.o(.text) diff --git a/functions.py b/functions.py index 7bf3b91f8b..278f5a6a41 100644 --- a/functions.py +++ b/functions.py @@ -213,6 +213,8 @@ known_funcs = { 0x800CAE88:("func_800CAE88","UNK_RET","UNK_TYPE"), 0x800CAF24:("func_800CAF24","UNK_RET","UNK_TYPE"), 0x800CAF38:("func_800CAF38","UNK_RET","UNK_TYPE"), + 0x800E03A0:("func_800E03A0","s800E03A0*","s32"), + 0x800E03A0:("func_800E03CC","u8*","void"), 0x800E11EC:("func_800E11EC","UNK_RET","UNK_TYPE, UNK_PTR"), 0x800E1374:("func_800E1374","UNK_RET","UNK_TYPE, UNK_PTR, struct s800A5AC0*, UNK_PTR"), 0x800E2928:("func_800E2928","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_PTR"), diff --git a/include/functions.h b/include/functions.h index 4bf7bf8a92..26bcbeb251 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1333,7 +1333,8 @@ UNK_RET func_800CAF38(UNK_TYPE); // func_800CAF38 // UNK_RET func_800E0308(UNK_ARGS); // UNK_RET func_800E031C(UNK_ARGS); // UNK_RET func_800E0348(UNK_ARGS); -// UNK_RET func_800E03A0(UNK_ARGS); +s800E03A0* func_800E03A0(s32); +void func_800E03CC(u8* a0); // UNK_RET func_800E0410(UNK_ARGS); // UNK_RET func_800E04BC(UNK_ARGS); // UNK_RET func_800E04EC(UNK_ARGS); diff --git a/include/structs.h b/include/structs.h index 6fa764f136..778f2957be 100644 --- a/include/structs.h +++ b/include/structs.h @@ -89,6 +89,10 @@ typedef struct s800CAAD0_s { /* 164 */ f32 unk164; } s800CAAD0; +typedef struct s800E03A0_s { + /* 000 */ u8 pad[32]; +} s800E03A0; + // TODO everything past here should be placed in an appropiate libultra header typedef long Mtx_t[4][4]; diff --git a/include/variables.h b/include/variables.h index ca81562b9a..07a387b072 100644 --- a/include/variables.h +++ b/include/variables.h @@ -2312,7 +2312,7 @@ extern UNK_TYPE D_801B4610; // D_801B4610 //extern UNK_TYPE D_801B9F04; //extern UNK_TYPE D_801B9F0C; //extern UNK_TYPE D_801B9F10; -//extern UNK_TYPE D_801B9F20; +extern s800E03A0 D_801B9F20; //extern UNK_TYPE D_801BA200; //extern UNK_TYPE D_801BA240; //extern UNK_TYPE D_801BA258; diff --git a/src/code/code_0x800E03A0.c b/src/code/code_0x800E03A0.c new file mode 100644 index 0000000000..cf2e33159e --- /dev/null +++ b/src/code/code_0x800E03A0.c @@ -0,0 +1,17 @@ +#include +#include + +s800E03A0* func_800E03A0(s32 a0) { + if ((a0 < 0) || (a0 > 22)) return 0; + return &((&D_801B9F20)[a0]); +} + +// Probably zeroes out a s800E03A0? +void func_800E03CC(u8* a0) { + s32 i; + u8* v1; + + for (i = 0, v1 = a0; i < 32; i++) { + *v1++ = 0; + } +} diff --git a/variables.py b/variables.py index 512d10cb01..2b55b3651d 100644 --- a/variables.py +++ b/variables.py @@ -105,6 +105,7 @@ known_vars = { 0x801ADEB0:("D_801ADEB0","int",True), # TODO better array representation 0x801AEFD0:("","s800BF9A0_s",False), 0x801B4610:("","UNK_TYPE",False), + 0x801B9F20:("","s800E03A0",False), # actually an array of size 23? 0x801DCBB0:("","UNK_TYPE",False), 0x801DCBC4:("","UNK_TYPE",False), 0x801DCBE4:("","UNK_TYPE",False),