-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nagaa Dhaba <[email protected]>
- Loading branch information
Showing
4 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters