SpaghettiKart
Loading...
Searching...
No Matches
memory.h File Reference
#include "common_structs.h"
#include "course_offsets.h"
Include dependency graph for memory.h:

Go to the source code of this file.

Data Structures

struct  MainPoolBlock
 
struct  MainPoolState
 
struct  UnkStruct802AF7B4
 
struct  UnkStruct_802B8CD4
 
struct  AllocOnlyPool
 

Macros

#define MEMORY_POOL_LEFT   0
 
#define MEMORY_POOL_RIGHT   1
 
#define ALIGN4(val)
 

Functions

u8 * load_lakitu_tlut_x64 (const char **textureList, size_t length)
 
void * get_next_available_memory_addr (uintptr_t)
 Returns the address of the next available memory location and updates the memory pointer to reference the next location of available memory based provided size to allocate.
 
void initialize_memory_pool (void)
 Sets the starting location for allocating memory and calculates pool size.
 
void * allocate_memory (size_t)
 Allocates memory and adjusts gFreeMemorySize.
 
void * load_data (uintptr_t, uintptr_t)
 Allocate and DMA.
 
void func_802A7D54 (s32, s32)
 
void func_802A86A8 (CourseVtx *data, Vtx *vtx, size_t arg1)
 
void main_pool_init (uintptr_t, uintptr_t)
 
void * main_pool_alloc (uintptr_t, uintptr_t)
 
uintptr_t main_pool_free (void *)
 
void * main_pool_realloc (void *, uintptr_t)
 
uintptr_t main_pool_available (void)
 
uintptr_t main_pool_push_state (void)
 
uintptr_t main_pool_pop_state (void)
 
void * func_802A80B0 (u8 *, u8 *, u8 *)
 
uintptr_t MIO0_0F (u8 *, uintptr_t, uintptr_t)
 
void load_track (s32)
 Loads & DMAs track data. Vtx, textures, displaylists, etc.
 

Variables

u8 _other_texturesSegmentRomStart []
 

Macro Definition Documentation

◆ ALIGN4

#define ALIGN4 ( val)
Value:
(((val) + 0x3) & ~0x3)

◆ MEMORY_POOL_LEFT

#define MEMORY_POOL_LEFT   0

◆ MEMORY_POOL_RIGHT

#define MEMORY_POOL_RIGHT   1

Function Documentation

◆ allocate_memory()

void * allocate_memory ( size_t size)

Allocates memory and adjusts gFreeMemorySize.

Here is the caller graph for this function:

◆ func_802A7D54()

void func_802A7D54 ( s32 arg0,
s32 arg1 )

◆ func_802A80B0()

void * func_802A80B0 ( u8 * dest,
u8 * srcStart,
u8 * srcEnd )
Here is the call graph for this function:

◆ func_802A86A8()

void func_802A86A8 ( CourseVtx * data,
Vtx * vtx,
size_t arg1 )

◆ get_next_available_memory_addr()

void * get_next_available_memory_addr ( uintptr_t size)

Returns the address of the next available memory location and updates the memory pointer to reference the next location of available memory based provided size to allocate.

Parameters
sizeof memory to allocate.
Returns
Address of free memory
Here is the caller graph for this function:

◆ initialize_memory_pool()

void initialize_memory_pool ( void )

Sets the starting location for allocating memory and calculates pool size.

Default memory size, 701.984 Kilobytes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_data()

void * load_data ( uintptr_t startAddr,
uintptr_t endAddr )

Allocate and DMA.

Here is the call graph for this function:

◆ load_lakitu_tlut_x64()

u8 * load_lakitu_tlut_x64 ( const char ** textureList,
size_t length )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_track()

void load_track ( s32 trackId)

Loads & DMAs track data. Vtx, textures, displaylists, etc.

Parameters
trackId
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main_pool_alloc()

void * main_pool_alloc ( uintptr_t size,
uintptr_t side )

Allocate a block of memory from the pool of given size, and from the specified side of the pool (MEMORY_POOL_LEFT or MEMORY_POOL_RIGHT). If there is not enough space, return NULL.

Here is the caller graph for this function:

◆ main_pool_available()

uintptr_t main_pool_available ( void )

◆ main_pool_free()

uintptr_t main_pool_free ( void * addr)

Free a block of memory that was allocated from the pool. The block must be the most recently allocated block from its end of the pool, otherwise all newer blocks are freed as well. Return the amount of free space left in the pool.

Here is the caller graph for this function:

◆ main_pool_init()

void main_pool_init ( uintptr_t start,
uintptr_t end )

◆ main_pool_pop_state()

uintptr_t main_pool_pop_state ( void )

Restore pool state from a previous call to main_pool_push_state. Return the amount of free space left in the pool.

◆ main_pool_push_state()

uintptr_t main_pool_push_state ( void )
Here is the call graph for this function:

◆ main_pool_realloc()

void * main_pool_realloc ( void * addr,
uintptr_t size )
Here is the call graph for this function:

◆ MIO0_0F()

uintptr_t MIO0_0F ( u8 * arg0,
uintptr_t arg1,
uintptr_t arg2 )
Here is the call graph for this function:

Variable Documentation

◆ _other_texturesSegmentRomStart

u8 _other_texturesSegmentRomStart[]
extern