libc8
CHIP-8 utility library
defs.h File Reference

Go to the source code of this file.

Macros

#define C8_X(i)   ((i & 0x0F00) >> 8)
 
#define C8_Y(i)   ((i & 0x00F0) >> 4)
 
#define C8_NNN(i)   (i & 0x0FFF)
 
#define C8_A(i)   ((i & 0xF000) >> 12)
 
#define C8_B(i)   (i & 0x000F)
 
#define C8_KK(i)   (i & 0x00FF)
 
#define C8_EXPAND(i)
 
#define C8_PROG_START   0x200
 
#define C8_MEMSIZE   0x1000
 

Detailed Description

Base CHIP-8 definitions/macros

Macro Definition Documentation

◆ C8_A

#define C8_A (   i)    ((i & 0xF000) >> 12)

◆ C8_B

#define C8_B (   i)    (i & 0x000F)

◆ C8_EXPAND

#define C8_EXPAND (   i)
Value:
int x = C8_X(i); \
int y = C8_Y(i); \
int nnn = C8_NNN(i); \
int a = C8_A(i); \
int b = C8_B(i); \
int kk = C8_KK(i);
#define C8_X(i)
Definition: defs.h:10
#define C8_A(i)
Definition: defs.h:13
#define C8_Y(i)
Definition: defs.h:11
#define C8_B(i)
Definition: defs.h:14
#define C8_KK(i)
Definition: defs.h:15
#define C8_NNN(i)
Definition: defs.h:12

◆ C8_KK

#define C8_KK (   i)    (i & 0x00FF)

◆ C8_MEMSIZE

#define C8_MEMSIZE   0x1000

◆ C8_NNN

#define C8_NNN (   i)    (i & 0x0FFF)

◆ C8_PROG_START

#define C8_PROG_START   0x200

◆ C8_X

#define C8_X (   i)    ((i & 0x0F00) >> 8)

◆ C8_Y

#define C8_Y (   i)    ((i & 0x00F0) >> 4)