-
Notifications
You must be signed in to change notification settings - Fork 1
/
interp.h
28 lines (21 loc) · 822 Bytes
/
interp.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
#ifndef INTERP_H_
#define INTERP_H_
struct machine;
// Create a new CHIP-8 machine - you have to pass all the required callbacks
struct machine * chip8_create(
void (*cb_clear)(void),
void (*cb_plot)(unsigned char x, unsigned char y, unsigned char set),
unsigned char (*cb_get_timer_delay)(void),
void (*cb_set_timer_delay)(unsigned char value),
void (*cb_set_timer_sound)(unsigned char value),
unsigned char (*cb_check_key)(unsigned char key),
unsigned char (*cb_await_key)(void)
);
// load a chip8 program into RAM
void chip8_load(struct machine * sys, const unsigned char * rom, unsigned short size);
// Runs one step of a machine
int chip8_step(struct machine * sys);
// Frees a machine
void chip8_destroy(struct machine * sys);
void chip8_perror(const struct machine * sys);
#endif