Jo Engine  2024.04.28
Jo Sega Saturn Engine
Macros | Functions
palette.h File Reference

Jo Engine Palette Handling. More...

Go to the source code of this file.

Macros

#define JO_PALETTE_MAX_COLORS
 Define the maximum of color entry available on each palette. More...
 
#define JO_PALETTE_MAX
 Define the maximum of palette. More...
 

Functions

void jo_create_palette (jo_palette *const output)
 Create a new palette with 255 entries maximum. More...
 
static __jo_force_inline void jo_palette_to_cram (unsigned short *restrict data, unsigned short *restrict cram_addr, unsigned int size)
 Copies the image palette data to CRAM. More...
 
static __jo_force_inline void jo_create_palette_from (jo_palette *const output, unsigned short *data, unsigned int size)
 Create a new palette from existing data. More...
 
void jo_set_palette_register (const unsigned short palette_index, const jo_color color)
 Set palette index color. More...
 
jo_color jo_get_palette_register (const unsigned short palette_index)
 Get palette color from index. More...
 

Detailed Description

Jo Engine Palette Handling.

Author
Johannes Fetz
Bug:
No known bugs.

Macro Definition Documentation

◆ JO_PALETTE_MAX

#define JO_PALETTE_MAX

Define the maximum of palette.

Warning
MC Hammer: don't touch this

◆ JO_PALETTE_MAX_COLORS

#define JO_PALETTE_MAX_COLORS

Define the maximum of color entry available on each palette.

Warning
MC Hammer: don't touch this

Function Documentation

◆ jo_create_palette()

void jo_create_palette ( jo_palette *const  output)

Create a new palette with 255 entries maximum.

Parameters
outputThe new palette

See also jo_sprite_set_palette_id()

◆ jo_create_palette_from()

static __jo_force_inline void jo_create_palette_from ( jo_palette *const  output,
unsigned short *  data,
unsigned int  size 
)
static

Create a new palette from existing data.

Parameters
outputThe new palette
dataData source
sizeData size

See also jo_sprite_set_palette_id()

◆ jo_get_palette_register()

jo_color jo_get_palette_register ( const unsigned short  palette_index)

Get palette color from index.

Parameters
palette_indexpalette Index
Returns
color Color

◆ jo_palette_to_cram()

static __jo_force_inline void jo_palette_to_cram ( unsigned short *restrict  data,
unsigned short *restrict  cram_addr,
unsigned int  size 
)
static

Copies the image palette data to CRAM.

Parameters
dataData source
cram_addrColor RAM address
sizeData size

◆ jo_set_palette_register()

void jo_set_palette_register ( const unsigned short  palette_index,
const jo_color  color 
)

Set palette index color.

Parameters
palette_indexpalette Index
colorColor