openTRI 0.1
VRAM MMU

Functions

triVoid * vrelptr (triVoid *ptr)
 Make a pointer relative to VRAM base.
triVoid * vabsptr (triVoid *ptr)
 Make a pointer absolute (useable by CPU).
triVoid * triVAlloc (triU32 size)
 Allocate memory from VRAM.
triVoid triVFree (triVoid *ptr)
 Free allocated memory from VRAM.
triU32 triVMemavail ()
 Return remaining unallocated VRAM.
triU32 triVLargestblock ()
 Return largest free memory block in VRAM.

Detailed Description

Function Documentation

◆ vrelptr()

triVoid * vrelptr ( triVoid * ptr)

Make a pointer relative to VRAM base.

Note
A relative NULL pointer is NOT illegal!
Parameters
ptr- Pointer to make relative
Returns
relative pointer matching ptr

◆ vabsptr()

triVoid * vabsptr ( triVoid * ptr)

Make a pointer absolute (useable by CPU).

Note
A relative NULL pointer is NOT illegal!
Parameters
ptr- Pointer to make absolute
Returns
absolute pointer matching ptr

◆ triVAlloc()

triVoid * triVAlloc ( triU32 size)

Allocate memory from VRAM.

Parameters
size- Number of bytes to allocate
Returns
absolute pointer on success, NULL on failure

◆ triVFree()

triVoid triVFree ( triVoid * ptr)

Free allocated memory from VRAM.

Parameters
ptr- Previously allocated pointer

◆ triVMemavail()

triU32 triVMemavail ( )

Return remaining unallocated VRAM.

Returns
Size of remaining VRAM in bytes

◆ triVLargestblock()

triU32 triVLargestblock ( )

Return largest free memory block in VRAM.

Returns
Size of largest free block in bytes