-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchip8.h
56 lines (43 loc) · 1.28 KB
/
chip8.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
52
53
54
55
56
#ifndef CHIP8_H
#define CHIP8_H
class chip8{
private:
unsigned short opcode;
unsigned char memory[4096];
unsigned char V[16];
unsigned short I;
unsigned short pc;
unsigned char gfx[64][32];
unsigned char delay_timer;
unsigned char sound_timer;
unsigned short stack[16];
unsigned short sp;
void fetchOpCode();
void decodeOpCode();
void draw(unsigned short x, unsigned short y, unsigned short n);
void op0(unsigned short[]);
void op1(unsigned short[]);
void op2(unsigned short[]);
void op3(unsigned short[]);
void op4(unsigned short[]);
void op5(unsigned short[]);
void op6(unsigned short[]);
void op7(unsigned short[]);
void op8(unsigned short[]);
void op9(unsigned short[]);
void opA(unsigned short[]);
void opB(unsigned short[]);
void opC(unsigned short[]);
void opD(unsigned short[]);
void opE(unsigned short[]);
void opF(unsigned short[]);
public:
bool drawFlag;
unsigned char key[16];
void initialise();
void loadFile(const char*);
void emulateCycle();
void drawGraphics();
void setKeys();
};
#endif