Skip to content

Commit

Permalink
Match 9.26% of lbheap (2.19 KB)
Browse files Browse the repository at this point in the history
Co-authored-by: Nagaa Dhaba <[email protected]>
  • Loading branch information
ribbanya and ndhaba committed Feb 12, 2024
1 parent d5d9ae1 commit 4d310f1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 10 deletions.
6 changes: 3 additions & 3 deletions config/GALE01/scratches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func_8000CE30 = OK:0x8000CE30; // id:bvFEb updated:2022-04-01T18:59:07.265806Z c
lbl_8000D4F8 = OK:0x8000D4F8; // author:VetriTheRetri id:0NKML updated:2022-08-29T21:54:14.037292Z created:2022-08-29T21:52:07.56556Z
func_8000D530 = OK:0x8000D530; // author:r-burns id:65v0c parent:v3zIV updated:2022-04-10T18:14:00.337821Z created:2022-04-10T18:12:22.230033Z
lbMemory_800154BC = OK:0x800154BC; // author:ribbanya id:jYQ13 updated:2022-12-09T14:05:41.806299Z created:2022-12-09T13:56:19.199048Z
func_800158D0 = 100%:0x800158D0; // author:seizefire id:lFGSE updated:2022-12-24T05:47:04.270624Z created:2022-12-24T04:01:23.158451Z
lbHeap_800158D0 = 99.17%:0x800158D0; // author:ribbanya id:rXXQO updated:2022-12-09T13:39:53.34075Z created:2022-12-09T13:21:33.651336Z
lbHeap_800158D0 = OK:0x800158D0; // author:ribbanya id:rXXQO updated:2022-12-09T13:39:53.34075Z created:2022-12-09T13:21:33.651336Z
func_800158D0 = OK:0x800158D0; // author:seizefire id:lFGSE updated:2022-12-24T05:47:04.270624Z created:2022-12-24T04:01:23.158451Z
func_800158E8 = 100%:0x800158E8; // author:seizefire id:vJtoH updated:2022-12-24T05:48:31.816916Z created:2022-12-24T05:47:12.467555Z
func_80015BD0 = 72.48%:0x80015BD0; // author:seizefire id:3EZe0 updated:2022-12-24T22:27:10.57355Z created:2022-12-24T22:24:44.116511Z
func_80015BD0 = OK:0x80015BD0; // author:seizefire id:3EZe0 updated:2022-12-24T22:27:10.57355Z created:2022-12-24T22:24:44.116511Z
lbl_8001615C = OK:0x8001615C; // author:kiwi515 id:duJUh updated:2022-08-24T22:07:57.813015Z created:2022-08-24T22:07:57.27083Z
func_800161C4 = OK:0x800161C4; // author:r-burns id:AZH6v parent:5DLB6 updated:2022-11-14T23:59:37.150605Z created:2022-11-14T06:34:56.953236Z
func_80016204 = OK:0x80016204; // author:r-burns id:qWD27 updated:2022-11-14T23:59:35.209488Z created:2022-11-13T21:56:29.543088Z
Expand Down
48 changes: 48 additions & 0 deletions src/melee/lb/lbheap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "lbmemory.h"

#include <dolphin/os/OSInterrupt.h>
#include <baselib/archive.h>
#include <baselib/initialize.h>
#include <baselib/memory.h>

int lbHeap_80431FA0[46];

void lbHeap_800158D0(int arg0, int arg1)
{
lbHeap_80431FA0[arg0 * 7 + 9] = arg1;
}

int lbHeap_800158E8(int arg0)
{
return lbHeap_80431FA0[arg0 * 7 + 9];
}

HSD_Archive* lbHeap_80015BD0(s32 arg0, s32 arg1)
{
HSD_Archive* var_r31;
s32 temp_r29;
s32 temp_r30;
s32* temp_r31;
s32* temp_r4;

temp_r4 = ((s32*) lbHeap_80431FA0) + (arg0 * 0x1C);
temp_r31 = temp_r4 + 0x10;
temp_r30 = OSDisableInterrupts();
if (*(temp_r4 + 0x28) == 0) {
if (*(temp_r31 + 0x10) == 0) {
temp_r29 = HSD_GetHeap();
HSD_SetHeap(*temp_r31);
var_r31 = HSD_MemAlloc(arg1);
HSD_SetHeap(temp_r29);
} else {
var_r31 = lbMemory_80014FC8(*(temp_r31 + 4), arg1);
if (*(temp_r31 + 0x10) == 3) {
var_r31 = (HSD_Archive*) var_r31->header.data_size;
}
}
} else {
var_r31 = NULL;
}
OSRestoreInterrupts(temp_r30);
return var_r31;
}
13 changes: 6 additions & 7 deletions src/melee/lb/lbheap.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#ifndef MELEE_LB_LBHEAP_H
#define MELEE_LB_LBHEAP_H
#ifndef GALE01_0158D0
#define GALE01_0158D0

#include <platform.h>
#include <baselib/forward.h>

#include <baselib/archive.h>

void lbHeap_80015CA8(s32, u8*);
void* lbHeap_80015BD0(s32, s32);
void lbHeap_80015F3C(void);
/* 0158D0 */ void lbHeap_800158D0(int, int);
/* 015BD0 */ void* lbHeap_80015BD0(int, int);
/* 015CA8 */ void lbHeap_80015CA8(int, u8*);
/* 015F3C */ void lbHeap_80015F3C(void);

#endif
2 changes: 2 additions & 0 deletions src/melee/lb/lbmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#define GALE01_014E24

#include <platform.h>
#include <baselib/forward.h>

/* 014FC8 */ HSD_Archive* lbMemory_80014FC8(s32, s32);
/* 0154BC */ void lbMemory_800154BC(uintptr_t*, uintptr_t*);
/* 01564C */ void lbMemory_8001564C(void);

Expand Down

0 comments on commit 4d310f1

Please sign in to comment.