You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
464 B
29 lines
464 B
5 years ago
|
#ifndef SRC_INCLUDE_CHIP8_H_
|
||
|
#define SRC_INCLUDE_CHIP8_H_
|
||
|
|
||
|
#include <inttypes.h>
|
||
|
|
||
|
typedef struct {
|
||
|
struct {
|
||
|
uint8_t V[16], SP, TS, TD;
|
||
|
uint16_t PC, I;
|
||
|
} cpu;
|
||
|
struct {
|
||
|
uint8_t RAM[4096];
|
||
|
uint16_t STK[24];
|
||
|
} mem;
|
||
|
struct {
|
||
|
uint8_t KEYS[16], DSP[2048];
|
||
|
} io;
|
||
|
struct {
|
||
|
uint8_t draw;
|
||
|
} flags;
|
||
|
} chip8_t;
|
||
|
|
||
|
int chip8_dump(chip8_t *, const char *);
|
||
|
int chip8_init(chip8_t *);
|
||
|
int chip8_load(chip8_t *, const char *);
|
||
|
int chip8_cycle(chip8_t *);
|
||
|
|
||
|
#endif
|