|
Mario Kart 64
|
#include "types.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) (((val) + 0x3) & ~0x3) |
Functions | |
| void * | get_next_available_memory_addr (u32) |
| 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. More... | |
| uintptr_t | set_segment_base_addr (s32, void *) |
Stores the physical memory addr for segmented memory in gSegmentTable using the segment number as an index. More... | |
| void * | get_segment_base_addr (s32) |
| Returns the physical memory location of a segment. More... | |
| void * | segmented_to_virtual (const void *) |
| converts an RSP segment + offset address to a normal memory address More... | |
| void | move_segment_table_to_dmem (void) |
| void | initialize_memory_pool (uintptr_t, uintptr_t) |
| Sets the starting location for allocating memory and calculates pool size. More... | |
| void * | decompress_segments (u8 *, u8 *) |
| void * | allocate_memory (u32) |
| Allocates memory and adjusts gFreeMemorySize. More... | |
| void * | load_data (uintptr_t, uintptr_t) |
| Allocate and DMA. More... | |
| void | func_802A7D54 (s32, s32) |
| void | main_pool_init (u32, u32) |
| void * | main_pool_alloc (u32, u32) |
| u32 | main_pool_free (void *) |
| void * | main_pool_realloc (void *, u32) |
| s32 | main_pool_available (void) |
| u32 | main_pool_push_state (void) |
| u32 | main_pool_pop_state (void) |
| void * | func_802A80B0 (u8 *, u8 *, u8 *) |
| void | func_802A81EC (void) |
| struct AllocOnlyPool * | alloc_only_pool_init (u32, u32) |
| u32 | func_802A82AC (s32) |
| s32 | func_802A8348 (s32, s32, s32) |
| u8 * | dma_textures (u8 *, u32, u32) |
| u32 | MIO0_0F (u8 *, u32, u32) |
| void | func_802A8844 (void) |
| void | unpack_lights (Gfx *, u8 *, s8) |
| void | unpack_displaylist (Gfx *, u8 *, s8) |
| void | unpack_end_displaylist (Gfx *, u8 *, s8) |
| void | unpack_set_geometry_mode (Gfx *, u8 *, s8) |
| void | unpack_clear_geometry_mode (Gfx *, u8 *, s8) |
| void | unpack_cull_displaylist (Gfx *, u8 *, s8) |
| void | unpack_combine_mode1 (Gfx *, u8 *, u32) |
| void | unpack_combine_mode2 (Gfx *, u8 *, u32) |
| void | unpack_combine_mode_shade (Gfx *, u8 *, u32) |
| void | unpack_combine_mode4 (Gfx *, u8 *, u32) |
| void | unpack_combine_mode5 (Gfx *, u8 *, u32) |
| void | unpack_render_mode_opaque (Gfx *, u8 *, u32) |
| void | unpack_render_mode_tex_edge (Gfx *, u8 *, u32) |
| void | unpack_render_mode_translucent (Gfx *, u8 *, u32) |
| void | unpack_render_mode_opaque_decal (Gfx *, u8 *, u32) |
| void | unpack_render_mode_translucent_decal (Gfx *, u8 *, u32) |
| void | unpack_tile_sync (Gfx *, u8 *, s8) |
| void | unpack_tile_load_sync (Gfx *, u8 *, s8) |
| void | unpack_texture_on (Gfx *, u8 *, s8) |
| void | unpack_texture_off (Gfx *, u8 *, s8) |
| u8 * | load_course (s32) |
| Loads & DMAs course data. Vtx, textures, displaylists, etc. More... | |
Variables | |
| f32 | vtxStretchY |
| u8 | _other_texturesSegmentRomStart [] |
| #define ALIGN4 | ( | val | ) | (((val) + 0x3) & ~0x3) |
| #define MEMORY_POOL_LEFT 0 |
| #define MEMORY_POOL_RIGHT 1 |
| struct AllocOnlyPool* alloc_only_pool_init | ( | u32 | size, |
| u32 | side | ||
| ) |
| void* allocate_memory | ( | u32 | size | ) |
Allocates memory and adjusts gFreeMemorySize.
| void func_802A81EC | ( | void | ) |
| void func_802A8844 | ( | void | ) |
| void* get_next_available_memory_addr | ( | u32 | 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. |
| void* get_segment_base_addr | ( | s32 | segment | ) |
Returns the physical memory location of a segment.
| permits | segment numbers from 0x0 to 0xF. |
| void initialize_memory_pool | ( | uintptr_t | poolStart, |
| uintptr_t | poolEnd | ||
| ) |
Sets the starting location for allocating memory and calculates pool size.
Default memory size, 701.984 Kilobytes.
Loads & DMAs course data. Vtx, textures, displaylists, etc.
| courseId |
| void* load_data | ( | uintptr_t | startAddr, |
| uintptr_t | endAddr | ||
| ) |
Allocate and DMA.
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.
| s32 main_pool_available | ( | void | ) |
| u32 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.
| u32 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.
| u32 main_pool_push_state | ( | void | ) |
| void* main_pool_realloc | ( | void * | addr, |
| u32 | size | ||
| ) |
| void move_segment_table_to_dmem | ( | void | ) |
| void* segmented_to_virtual | ( | const void * | addr | ) |
converts an RSP segment + offset address to a normal memory address
| uintptr_t set_segment_base_addr | ( | s32 | segment, |
| void * | addr | ||
| ) |
Stores the physical memory addr for segmented memory in gSegmentTable using the segment number as an index.
This function takes a segment number and a pointer to a memory address, and stores the address in the gSegmentTable array at the specified segment index. The stored address is truncated to a 29-bit value to ensure that it fits within the memory address. This allows converting between segmented memory and physical memory.
| segment | A segment number from 0x0 to 0xF to set the base address. |
| addr | A pointer containing the physical memory address of the data. |
|
extern |
|
extern |