|
SpaghettiKart
|
#include <libultraship.h>#include <libultra/types.h>#include <align_asset_macro.h>#include <macros.h>#include <string.h>#include <common_structs.h>#include <segments.h>#include <decode.h>#include <stubs.h>#include "memory.h"#include "main.h"#include "code_800029B0.h"#include "defines.h"#include "course_offsets.h"#include "engine/tracks/Track.h"#include "engine/editor/Editor.h"#include <stdio.h>#include "port/Game.h"Macros | |
| #define | PRINT_MEMPOOL |
Functions | |
| 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. | |
| static uintptr_t | get_texture2 (size_t offset, const course_texture *textures) |
| void | initialize_memory_pool () |
| Sets the starting location for allocating memory and calculates pool size. | |
| void * | allocate_memory (size_t size) |
| Allocates memory and adjusts gFreeMemorySize. | |
| UNUSED void | func_802A7D54 (s32 arg0, s32 arg1) |
| void * | load_data (uintptr_t startAddr, uintptr_t endAddr) |
| Allocate and DMA. | |
| UNUSED void | main_pool_init (uintptr_t start, uintptr_t end) |
| UNUSED void * | main_pool_alloc (uintptr_t size, uintptr_t side) |
| UNUSED uintptr_t | main_pool_free (void *addr) |
| UNUSED void * | main_pool_realloc (void *addr, uintptr_t size) |
| UNUSED uintptr_t | main_pool_available (void) |
| UNUSED uintptr_t | main_pool_push_state (void) |
| UNUSED uintptr_t | main_pool_pop_state (void) |
| UNUSED void * | func_802A80B0 (u8 *dest, u8 *srcStart, u8 *srcEnd) |
| uintptr_t | MIO0_0F (u8 *arg0, uintptr_t arg1, uintptr_t arg2) |
| u8 * | load_lakitu_tlut_x64 (const char **textureList, size_t length) |
| void | load_track (s32 trackId) |
| Loads & DMAs track data. Vtx, textures, displaylists, etc. | |
Variables | |
| s32 | sGfxSeekPosition |
| s32 | sPackedSeekPosition |
| static u8 | sMemoryPool [0xFFFFFFF] |
| uintptr_t | sPoolEnd = sMemoryPool + sizeof(sMemoryPool) |
| uintptr_t | sPoolFreeSpace |
| struct MainPoolBlock * | sPoolListHeadL |
| struct MainPoolBlock * | sPoolListHeadR |
| struct MainPoolState * | gMainPoolState = NULL |
| struct UnkStruct_802B8CD4 | D_802B8CD4 [] = { 0 } |
| s32 | D_802B8CE4 = 0 |
| s32 | memoryPadding [2] |
| uintptr_t | vtxSegEnd |
| uintptr_t | dlSegEnd |
| uintptr_t | texSegEnd |
| size_t | texSegSize |
| Gfx * | testaaa |
| #define PRINT_MEMPOOL |
| void * allocate_memory | ( | size_t | size | ) |
Allocates memory and adjusts gFreeMemorySize.
| UNUSED void func_802A7D54 | ( | s32 | arg0, |
| s32 | arg1 ) |
| UNUSED void * func_802A80B0 | ( | u8 * | dest, |
| u8 * | srcStart, | ||
| u8 * | srcEnd ) |
| 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.
| size | of memory to allocate. |
|
static |
| void initialize_memory_pool | ( | void | ) |
Sets the starting location for allocating memory and calculates pool size.
Default memory size, 701.984 Kilobytes.
| void * load_data | ( | uintptr_t | startAddr, |
| uintptr_t | endAddr ) |
Allocate and DMA.
| u8 * load_lakitu_tlut_x64 | ( | const char ** | textureList, |
| size_t | length ) |
| void load_track | ( | s32 | trackId | ) |
Loads & DMAs track data. Vtx, textures, displaylists, etc.
| trackId |
| UNUSED 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.
| UNUSED uintptr_t main_pool_available | ( | void | ) |
| UNUSED 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.
| UNUSED void main_pool_init | ( | uintptr_t | start, |
| uintptr_t | end ) |
| UNUSED 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.
| UNUSED uintptr_t main_pool_push_state | ( | void | ) |
| UNUSED void * main_pool_realloc | ( | void * | addr, |
| uintptr_t | size ) |
| uintptr_t MIO0_0F | ( | u8 * | arg0, |
| uintptr_t | arg1, | ||
| uintptr_t | arg2 ) |
| struct UnkStruct_802B8CD4 D_802B8CD4[] = { 0 } |
| s32 D_802B8CE4 = 0 |
| uintptr_t dlSegEnd |
| struct MainPoolState* gMainPoolState = NULL |
| s32 memoryPadding[2] |
| s32 sGfxSeekPosition |
|
static |
| s32 sPackedSeekPosition |
| uintptr_t sPoolEnd = sMemoryPool + sizeof(sMemoryPool) |
| uintptr_t sPoolFreeSpace |
| struct MainPoolBlock* sPoolListHeadL |
| struct MainPoolBlock* sPoolListHeadR |
| Gfx* testaaa |
| uintptr_t texSegEnd |
| size_t texSegSize |
| uintptr_t vtxSegEnd |