Skip to content

Commit

Permalink
Merge pull request #112 from RevoSucks/3FB0_2_functions
Browse files Browse the repository at this point in the history
2 functions in 3FB0
  • Loading branch information
RevoSucks authored Aug 22, 2024
2 parents e152a51 + 3276a5e commit 2e7a8ed
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions src/3FB0.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,44 @@

#pragma GLOBAL_ASM("asm/us/nonmatchings/3FB0/func_80003BE0.s")

#pragma GLOBAL_ASM("asm/us/nonmatchings/3FB0/func_80003C80.s")
// PERSJPEG header
struct UnkInputStruct80003C80 {
char filler0[0x8];
u32 unk8;
u32 unkC;
};

s32 func_80003C80(s32 arg0, struct UnkInputStruct80003C80* arg1, s32 side) {
s32 addr = main_pool_alloc(arg1->unkC + 0x100, side);

if (addr != 0) {
s32 size = func_80003680(addr, arg1->unkC + 0x100, (u32)arg1 + arg1->unk8, arg1);
if (size == 0) {
main_pool_try_free(addr);
addr = NULL;
} else if (side == 0) {
main_pool_realloc(addr, size);
}
}
main_pool_try_free(arg0);
return addr;
}

// PERS-SZP header
struct UnkInputStruct80003D18 {
char filler0[0x10];
u32 unk10;
};

s32 func_80003D18(s32 arg0, struct UnkInputStruct80003D18* arg1, s32 side) {
s32 vaddr = main_pool_alloc(arg1->unk10, side);

#pragma GLOBAL_ASM("asm/us/nonmatchings/3FB0/func_80003D18.s")
if (vaddr != NULL) {
func_80003890(arg1, vaddr);
}
main_pool_try_free(arg0);
return vaddr;
}

#pragma GLOBAL_ASM("asm/us/nonmatchings/3FB0/func_80003D64.s")

Expand Down

0 comments on commit 2e7a8ed

Please sign in to comment.