Jo Engine  2023.08.26
Jo Sega Saturn Engine
Macros | Enumerations | Functions
vdp2_malloc.h File Reference

VDP2 memory allocation (cell, map, rotation, scroll, etc) More...

Go to the source code of this file.

Macros

#define JO_VDP2_KTABLE_SIZE
 
#define JO_VDP2_ROTATION_TABLE_SIZE
 
#define JO_VDP2_MAP_SIZE
 
#define JO_VDP2_CELL_TO_MAP_OFFSET(CELL_PTR)
 

Enumerations

enum  jo_vdp2_ram_usage {
  JO_VDP2_RAM_USER, JO_VDP2_RAM_MAP_NBG0, JO_VDP2_RAM_MAP_NBG1, JO_VDP2_RAM_MAP_NBG2,
  JO_VDP2_RAM_MAP_NBG3, JO_VDP2_RAM_MAP_RBG0, JO_VDP2_RAM_KTABLE, JO_VDP2_RAM_RTABLE,
  JO_VDP2_RAM_CELL_NBG0, JO_VDP2_RAM_CELL_NBG1, JO_VDP2_RAM_CELL_NBG2, JO_VDP2_RAM_CELL_NBG3,
  JO_VDP2_RAM_CELL_RBG0, JO_VDP2_RAM_BACK_COLOR, JO_VDP2_RAM_LINE_SCROLL, JO_VDP2_RAM_BITMAP_NBG0,
  JO_VDP2_RAM_BITMAP_NBG1, JO_VDP2_RAM_COLOR, JO_VDP2_LINE_COLOR_TABLE
}
 

Functions

void * jo_vdp2_malloc (const jo_vdp2_ram_usage usage, const unsigned int n)
 Dynamic VDP2 memory allocator. More...
 
static __jo_force_inline void * jo_vdp2_malloc_autosize (const jo_vdp2_ram_usage usage)
 Dynamic VDP2 memory allocator for known size usage (JO_VDP2_RAM_RTABLE, JO_VDP2_RAM_KTABLE, JO_VDP2_RAM_COLOR) More...
 
void jo_vdp2_free (const void *const p)
 function frees VDP2 memory space pointed to by p More...
 

Detailed Description

VDP2 memory allocation (cell, map, rotation, scroll, etc)

Author
Johannes Fetz
Bug:
No known bugs.

Macro Definition Documentation

◆ JO_VDP2_CELL_TO_MAP_OFFSET

#define JO_VDP2_CELL_TO_MAP_OFFSET (   CELL_PTR)

◆ JO_VDP2_KTABLE_SIZE

#define JO_VDP2_KTABLE_SIZE

◆ JO_VDP2_MAP_SIZE

#define JO_VDP2_MAP_SIZE

◆ JO_VDP2_ROTATION_TABLE_SIZE

#define JO_VDP2_ROTATION_TABLE_SIZE

Enumeration Type Documentation

◆ jo_vdp2_ram_usage

Enumerator
JO_VDP2_RAM_USER 

For user.

JO_VDP2_RAM_MAP_NBG0 

MAP (for sl1MapRA, slMapNbg1, etc)

JO_VDP2_RAM_MAP_NBG1 
JO_VDP2_RAM_MAP_NBG2 
JO_VDP2_RAM_MAP_NBG3 
JO_VDP2_RAM_MAP_RBG0 
JO_VDP2_RAM_KTABLE 

KTABLE (for slMakeKtable)

JO_VDP2_RAM_RTABLE 

Rotation table (for slRparaInitSet)

JO_VDP2_RAM_CELL_NBG0 

CELL (for slPageRbg0, slPageNbg1, etc)

JO_VDP2_RAM_CELL_NBG1 
JO_VDP2_RAM_CELL_NBG2 
JO_VDP2_RAM_CELL_NBG3 
JO_VDP2_RAM_CELL_RBG0 
JO_VDP2_RAM_BACK_COLOR 

Back color (for slBack1ColSet)

JO_VDP2_RAM_LINE_SCROLL 

Line Scroll table (for slLineScrollTable0 and slLineScrollTable1)

JO_VDP2_RAM_BITMAP_NBG0 

CELL (for slBitMapNbg0, slBitMapNbg1, etc)

JO_VDP2_RAM_BITMAP_NBG1 
JO_VDP2_RAM_COLOR 

Color RAM for Palette, etc.

JO_VDP2_LINE_COLOR_TABLE 

Line color table (for slLineColTable)

Function Documentation

◆ jo_vdp2_free()

void jo_vdp2_free ( const void *const  p)

function frees VDP2 memory space pointed to by p

Parameters
ppointer that must have been returned by a previous call to jo_vdp2_malloc()

◆ jo_vdp2_malloc()

void* jo_vdp2_malloc ( const jo_vdp2_ram_usage  usage,
const unsigned int  n 
)

Dynamic VDP2 memory allocator.

Parameters
usageVDP2 memory segment usage
nSegment size
Returns
a pointer to the allocated memory or NULL if failed

◆ jo_vdp2_malloc_autosize()

static __jo_force_inline void* jo_vdp2_malloc_autosize ( const jo_vdp2_ram_usage  usage)
static

Dynamic VDP2 memory allocator for known size usage (JO_VDP2_RAM_RTABLE, JO_VDP2_RAM_KTABLE, JO_VDP2_RAM_COLOR)

Parameters
usageVDP2 memory segment usage
Returns
a pointer to the allocated memory or NULL if failed