libc8
CHIP-8 utility library
defs.h
Go to the documentation of this file.
1
7
#ifndef LIBC8_DEFS_H
8
#define LIBC8_DEFS_H
9
10
#define C8_X(i) ((i & 0x0F00) >> 8)
11
#define C8_Y(i) ((i & 0x00F0) >> 4)
12
#define C8_NNN(i) (i & 0x0FFF)
13
#define C8_A(i) ((i & 0xF000) >> 12)
14
#define C8_B(i) (i & 0x000F)
15
#define C8_KK(i) (i & 0x00FF)
16
#define C8_EXPAND(i) \
17
int x = C8_X(i); \
18
int y = C8_Y(i); \
19
int nnn = C8_NNN(i); \
20
int a = C8_A(i); \
21
int b = C8_B(i); \
22
int kk = C8_KK(i);
23
24
#define C8_PROG_START 0x200
25
#define C8_MEMSIZE 0x1000
26
27
28
#endif
libc8
c8
defs.h
Generated by
1.9.4