-
Notifications
You must be signed in to change notification settings - Fork 0
/
debugger.h
66 lines (55 loc) · 1.82 KB
/
debugger.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
57
58
59
60
61
62
63
64
65
66
#ifndef DEBUGGER_H
#define DEBUGGER_H
#include "chip8.h"
#include "SDL2Widget.h"
#include <QFontDatabase>
#include <QListWidgetItem>
#include <QMainWindow>
#include <QScrollBar>
#include <QSettings>
#include <QSignalMapper>
#include <QStyledItemDelegate>
#include <QString>
#include <QTextStream>
#include <QTranslator>
#include <string>
#include <vector>
#define UI_VERSION 1
namespace Ui {
class Debugger;
}
class Debugger : public QMainWindow
{
Q_OBJECT
public:
explicit Debugger(QWidget *parent = nullptr);
~Debugger();
void disassembleRom(QString filepath);
void updateWidgets();
void updateCurrentLine();
static Debugger* getDebugContext();
protected:
void closeEvent(QCloseEvent *event) override;
void changeEvent(QEvent *event) override;
// void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
private slots:
void on_listWidget_itemSelectionChanged();
void on_listWidget_2_itemSelectionChanged();
void on_listWidget_3_itemSelectionChanged();
void on_listWidget_4_itemSelectionChanged();
void on_leftRegisterListWidget_itemDoubleClicked(QListWidgetItem *item);
void on_rightRegisterListWidget_itemDoubleClicked(QListWidgetItem *item);
void on_stackListWidget_itemDoubleClicked(QListWidgetItem *item);
void on_listWidget_3_itemDoubleClicked(QListWidgetItem *item);
void on_listWidget_4_itemDoubleClicked(QListWidgetItem *item);
void documentChanged();
private:
Ui::Debugger *ui;
void updateInstruction(QString text, uint16_t index);
void updateDisassemblyViewItem(int index, QString text, uint16_t opcode);
void addDisassemblyViewItems(std::vector<std::vector<QString>> disasm);
void addRegisterViewItems();
void addStackViewItems();
bool animate = false;
};
#endif // DEBUGGER_H