SaturnRingLibrary 0.9
SGL wrapper
 
Loading...
Searching...
No Matches

◆ Allocate()

static void * SRL::VDP2::VRAM::Allocate ( uint32_t size,
uint32_t boundary,
VDP2::VramBank bank,
uint8_t cycles = 0 )
inlinestatic

Linearly Allocates Vram in a bank and returns address to start of allocation. Allocation fails if there is not enough free space in the bank or if access requires too many cycles.

Parameters
sizeNumber of bytes to allocate
boundaryByte Boundary that the allocation should be aligned to (must be multiple of 32 for all VDP2 Data types)
bankThe VRAM bank to allocate in
cycles(Optional) Number of Bank Cycles this data will require to access during frame(0-8).
Returns
void* start of the Allocated region in VRAM (nullptr if allocation failed)
Note
Any VRAM padded to maintain alignment to a requested boundary is rendered inaccessible to further allocations until VRAM is cleared and reset.