aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/registersdock.h
blob: 90be65945e760b950b855ac84074b57acf3a6b1d (plain)
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
#ifndef REGISTERSDOCK_H
#define REGISTERSDOCK_H

#include <QDockWidget>
#include <QLabel>
#include <QFormLayout>
#include <QScrollArea>
#include <QPropertyAnimation>
#include "qtmipsmachine.h"

class RegistersDock : public QDockWidget {
    Q_OBJECT
public:
    RegistersDock(QWidget *parent);
    ~RegistersDock();

    void setup(QtMipsMachine *machine);

private slots:
    void pc_changed(std::uint32_t val);
    void gp_changed(std::uint8_t i, std::uint32_t val);
    void hi_lo_changed(bool hi, std::uint32_t val);

private:
    const Registers *regs;

    QScrollArea *widg;
    QFormLayout *layout;

    QLabel *pc;
    QLabel *hi;
    QLabel *lo;
    QLabel *gp[32];

    void labelVal(QLabel *label, std::uint32_t val, bool dec);
};

#endif // REGISTERSDOCK_H