libc8
CHIP-8 utility library
Loading...
Searching...
No Matches
font.h File Reference
#include "chip8.h"

Go to the source code of this file.

Macros

#define C8_FONT_START   0x000
 Font storage address in memory.
 
#define C8_HIGH_FONT_START   (C8_FONT_START + (0x10 * 5))
 HD font storage address in memory.
 

Enumerations

enum  C8_SmallFont {
  C8_SMALLFONT_OCTO = 0 , C8_SMALLFONT_VIP = 1 , C8_SMALLFONT_DREAM6800 = 2 , C8_SMALLFONT_ETI660 = 3 ,
  C8_SMALLFONT_FISH = 4
}
 Small font IDs. More...
 
enum  C8_BigFont { C8_BIGFONT_OCTO = 0 , C8_BIGFONT_SCHIP = 1 , C8_BIGFONT_FISH = 2 }
 Big font IDs. More...
 

Functions

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

Variables

const char * c8_fontNames [2][5]
 Font names.
 

Detailed Description

Stuff related to loading fonts.

Macro Definition Documentation

◆ C8_FONT_START

#define C8_FONT_START   0x000

Font storage address in memory.

◆ C8_HIGH_FONT_START

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

HD font storage address in memory.

Enumeration Type Documentation

◆ C8_BigFont

enum C8_BigFont

Big font IDs.

Enumerator
C8_BIGFONT_OCTO 
C8_BIGFONT_SCHIP 
C8_BIGFONT_FISH 

◆ C8_SmallFont

Small font IDs.

Enumerator
C8_SMALLFONT_OCTO 
C8_SMALLFONT_VIP 
C8_SMALLFONT_DREAM6800 
C8_SMALLFONT_ETI660 
C8_SMALLFONT_FISH 

Function Documentation

◆ c8_print_fonts()

void c8_print_fonts ( C8 c8)

Print fonts (for debug)

Parameters
c8C8 to get fonts from

◆ c8_set_big_font()

int c8_set_big_font ( C8 c8,
const char *  s 
)

Set big font from s (fontNames name)

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

◆ c8_set_fonts()

void c8_set_fonts ( C8 c8,
C8_SmallFont  small,
C8_BigFont  big 
)

Loads small and/or big fonts in c8

Parameters
c8C8 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 c8,
char *  s 
)

Set fonts from string.

Parameters
c8C8 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 c8,
const char *  s 
)

Set small font from s (fontNames name)

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

Variable Documentation

◆ c8_fontNames

const char* c8_fontNames[2][5]
extern

Font names.