libc8
CHIP-8 utility library
font.h File Reference
#include "chip8.h"

Go to the source code of this file.

Macros

#define C8_FONT_START   0x000
 
#define C8_HIGH_FONT_START   C8_FONT_START + (0x10 * 5)
 

Functions

void print_fonts (c8_t *)
 Print fonts (for debug) More...
 
void c8_set_fonts (c8_t *, int, int)
 Loads small and/or big fonts in c8 More...
 
int c8_set_fonts_s (c8_t *, char *)
 Set fonts from string. More...
 
int c8_set_small_font (c8_t *, const char *)
 Set small font from s (fontNames name) More...
 
int c8_set_big_font (c8_t *, const char *)
 Set big font from s (fontNames name) More...
 

Variables

const char * c8_fontNames [2][5]
 

Detailed Description

Stuff related to loading fonts.

Macro Definition Documentation

◆ C8_FONT_START

#define C8_FONT_START   0x000

◆ C8_HIGH_FONT_START

#define C8_HIGH_FONT_START   C8_FONT_START + (0x10 * 5)

Function Documentation

◆ c8_set_big_font()

int c8_set_big_font ( c8_t c8,
const char *  s 
)

Set big font from s (fontNames name)

Parameters
c8c8_t to set font from
sstring to get font from
Returns
1 if success, 0 otherwise

◆ c8_set_fonts()

void c8_set_fonts ( c8_t c8,
int  small,
int  big 
)

Loads small and/or big fonts in c8

Parameters
c8c8_t to set fonts
smallsmall font identifier (-1 to not set)
bigbig font identifier (-1 to not set)

◆ c8_set_fonts_s()

int c8_set_fonts_s ( c8_t c8,
char *  s 
)

Set fonts from string.

Parameters
c8c8_t to set fonts
sstring to get fonts from (comma-separated fontNames names)
Returns
1 if success, 0 otherwise

◆ c8_set_small_font()

int c8_set_small_font ( c8_t c8,
const char *  s 
)

Set small font from s (fontNames name)

Parameters
c8c8_t to set font from
sstring to get font from
Returns
1 if success, 0 otherwise

◆ print_fonts()

void print_fonts ( c8_t c8)

Print fonts (for debug)

Parameters
c8c8_t to get fonts from

Variable Documentation

◆ c8_fontNames

const char* c8_fontNames[2][5]
extern