aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/registersdock.h
blob: 3504608d9eb26e3325e81be850709e916d464c95 (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
39
#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(machine::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 machine::Registers *regs;

    QWidget *widg;
    QScrollArea *scrollarea;
    QFormLayout *layout;

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

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

#endif // REGISTERSDOCK_H