-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu.h
52 lines (50 loc) · 2.25 KB
/
cpu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
struct chip8{
unsigned char registers[16];
unsigned char memory[4096];
unsigned short index_register;
unsigned short pc;
unsigned short stack[16];
unsigned char sp;
unsigned char delay_timer;
unsigned char sound_timer;
unsigned char keys[16];
unsigned char display_memory[256];
};
void load_fonts(struct chip8 *);
struct chip8 *new_chip8();
void load_rom(struct chip8 *, const char *);
void load_fonts(struct chip8 *);
void cls(struct chip8 *);
void ret(struct chip8 *);
void jmp(struct chip8 *, unsigned short);
void call(struct chip8 *, unsigned short);
void iskip_on_equal(struct chip8 *, unsigned short, unsigned char);
void iskip_on_not_equal(struct chip8 *, unsigned short, unsigned char);
void skip_on_equal(struct chip8 *, unsigned short, unsigned short);
void iload(struct chip8 *, unsigned short, unsigned char);
void iadd(struct chip8 *, unsigned short, unsigned char);
void assign(struct chip8 *, unsigned short, unsigned short);
void _or(struct chip8 *, unsigned short, unsigned short);
void _and(struct chip8 *, unsigned short, unsigned short);
void _xor(struct chip8 *, unsigned short, unsigned short);
void add(struct chip8 *, unsigned short, unsigned short);
void sub(struct chip8 *, unsigned short, unsigned short);
void shr(struct chip8 *, unsigned short);
void subn(struct chip8 *, unsigned short, unsigned short);
void shl(struct chip8 *, unsigned short);
void skip_on_not_equal(struct chip8 *, unsigned short, unsigned short);
void set_index(struct chip8 *, unsigned short);
void jmp_rel(struct chip8 *, unsigned short);
void set_rand(struct chip8 *, unsigned short , unsigned char);
void display_sprite(struct chip8 *, unsigned short , unsigned short, unsigned short);
void skip_pressed(struct chip8 *, unsigned short );
void skip_not_pressed(struct chip8 *, unsigned short );
void load_delay(struct chip8 *, unsigned short );
void wait_for_key(struct chip8 *, unsigned short );
void set_delay(struct chip8 *, unsigned short );
void set_sound(struct chip8 *, unsigned short );
void add_to_index(struct chip8 *, unsigned short);
void load_location(struct chip8 *, unsigned short);
void store_bcd(struct chip8 *, unsigned short);
void store_registers(struct chip8 *, unsigned short);
void load_registers(struct chip8 *, unsigned short);