-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchip8ui.h
More file actions
44 lines (33 loc) · 736 Bytes
/
chip8ui.h
File metadata and controls
44 lines (33 loc) · 736 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
34
35
36
37
38
39
40
41
42
43
44
#ifndef CHIP8UI_H
#define CHIP8UI_H
#include <QMainWindow>
#include <QEvent>
#include <QKeyEvent>
#include <QTimer>
#include <QTimerEvent>
#include <cpu.h>
#include <interface.h>
#define UPDATE_MILLISEC 2
namespace Ui {
class Chip8UI;
}
class Chip8UI : public QMainWindow
{
Q_OBJECT
public:
explicit Chip8UI(QWidget *parent = nullptr);
~Chip8UI();
void readChip8ROM(const char* fileName);
protected:
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
void timerEvent(QTimerEvent *event);
private:
Ui::Chip8UI *ui;
CPU* cpu;
Interface* interface;
int chip8Timer;
uint8_t updateTimer;
void showErrorAndExit(QString message);
};
#endif // CHIP8UI_H