35#ifndef __JO_VDP2_MALLOC_H__
36# define __JO_VDP2_MALLOC_H__
41# define JO_VDP2_KTABLE_SIZE (0x1FE00)
42# define JO_VDP2_ROTATION_TABLE_SIZE (0x00080)
43# define JO_VDP2_MAP_SIZE (8192)
44# define JO_VDP2_CELL_TO_MAP_OFFSET(CELL_PTR) JO_DIV_BY_32(JO_MOD_POW2((int)CELL_PTR, JO_VDP2_BANK_SIZE))
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39
void * jo_vdp2_malloc(const jo_vdp2_ram_usage usage, const unsigned int n)
Dynamic VDP2 memory allocator.
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,...
Definition vdp2_malloc.h:90
bool __jo_vdp2_a0_start_is_free(const unsigned int n)
Whether jo_vdp2_malloc() would return the start of the bank A0 for n bytes (bitmap,...
jo_vdp2_ram_usage
Definition vdp2_malloc.h:47
@ JO_VDP2_RAM_MAP_NBG1
Definition vdp2_malloc.h:52
@ JO_VDP2_RAM_BITMAP_NBG0
CELL (NBG0 and NBG1 bitmaps).
Definition vdp2_malloc.h:71
@ JO_VDP2_RAM_CELL_RBG0
Definition vdp2_malloc.h:65
@ JO_VDP2_RAM_MAP_NBG2
Definition vdp2_malloc.h:53
@ JO_VDP2_RAM_MAP_NBG3
Definition vdp2_malloc.h:54
@ JO_VDP2_RAM_USER
For user.
Definition vdp2_malloc.h:49
@ JO_VDP2_RAM_KTABLE
KTABLE (rotation coefficient table).
Definition vdp2_malloc.h:57
@ JO_VDP2_RAM_BITMAP_NBG1
Definition vdp2_malloc.h:72
@ JO_VDP2_RAM_RTABLE
Rotation table (rotation parameters).
Definition vdp2_malloc.h:59
@ JO_VDP2_RAM_MAP_RBG0
Definition vdp2_malloc.h:55
@ JO_VDP2_RAM_COLOR
Color RAM for Palette, etc.
Definition vdp2_malloc.h:74
@ JO_VDP2_RAM_CELL_NBG0
CELL (rotation and normal scroll screen cells).
Definition vdp2_malloc.h:61
@ JO_VDP2_RAM_BACK_COLOR
Back color (back screen color).
Definition vdp2_malloc.h:67
@ JO_VDP2_RAM_MAP_NBG0
MAP (rotation and normal scroll screen maps).
Definition vdp2_malloc.h:51
@ JO_VDP2_RAM_CELL_NBG3
Definition vdp2_malloc.h:64
@ JO_VDP2_RAM_CELL_NBG1
Definition vdp2_malloc.h:62
@ JO_VDP2_LINE_COLOR_TABLE
Line color table (line color screen).
Definition vdp2_malloc.h:76
@ JO_VDP2_RAM_CELL_NBG2
Definition vdp2_malloc.h:63
@ JO_VDP2_RAM_LINE_SCROLL
Line Scroll table (NBG0 and NBG1 line scroll).
Definition vdp2_malloc.h:69
void jo_vdp2_free(const void *const p)
function frees VDP2 memory space pointed to by p