libmsx
C library for MSX
Loading...
Searching...
No Matches

Color palettes. More...

+ Collaboration diagram for Palette registers:

Macros

#define RGB(r, g, b)    ((palette_t)((((g) & 7) << 8) | (((r) & 7) << 4) | ((b) & 7)))
 Constructs RGB color palette value.
 

Typedefs

typedef uint16_t palette_t
 Type for RGB color palette value.
 

Functions

void vdp_set_palette (uint8_t idx, const palette_t palette)
 MSX2 Write to a VDP palette register.
 
void vdp_write_palette (const palette_t palettes[16])
 MSX2 Write to a series of VDP palette registers.
 

Detailed Description

Color palettes.

Macro Definition Documentation

◆ RGB

#define RGB (   r,
  g,
 
)     ((palette_t)((((g) & 7) << 8) | (((r) & 7) << 4) | ((b) & 7)))

Constructs RGB color palette value.

Parameters
rRed component (0..7)
gGreen component (0..7)
bBlue component (0..7)
Returns
RGB color palette value.

Definition at line 176 of file vdp.h.

Typedef Documentation

◆ palette_t

typedef uint16_t palette_t

Type for RGB color palette value.

See also
RGB()

Definition at line 166 of file vdp.h.

Function Documentation

◆ vdp_set_palette()

void vdp_set_palette ( uint8_t  idx,
const palette_t  palette 
)

MSX2 Write to a VDP palette register.

Parameters
idxcolor palette number. (0..15)
palettecolor palette value.
See also
RGB()

◆ vdp_write_palette()

void vdp_write_palette ( const palette_t  palettes[16])

MSX2 Write to a series of VDP palette registers.

Parameters
palettes16 color palette values.
See also
RGB()