-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathchip8.h
More file actions
33 lines (25 loc) · 737 Bytes
/
chip8.h
File metadata and controls
33 lines (25 loc) · 737 Bytes
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
#include <cstdint>
class chip8 {
public:
chip8();
~chip8();
bool drawFlag;
void emulateCycle();
void debugRender();
void debugMemory();
void debugStack();
bool loadRom(const char *filename);
uint8_t gfx[64*32]; // Total amount of pixels: 2048
uint8_t key[16];
private:
uint16_t pc; // Program counter
uint16_t opcode; // Current opcode
uint16_t sp; // Stack pointer
uint16_t I; // Index register
uint8_t V[16]; // V registers (V0-VF)
uint8_t memory[4096]; // Memory (size = 4k)
uint16_t stack[16]; // Stack (16 levels)
uint8_t delay_timer;
uint8_t sound_timer;
void init();
};