-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatebox.h
120 lines (96 loc) · 3.71 KB
/
statebox.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include <array>
#include <memory>
#include <wx/wx.h>
#include "ui/staterow.h"
#include "core/rom.h"
class reBaseStateBox : public wxStaticBox
{
public:
reBaseStateBox(wxWindow* parent, const wxString& label, int orient);
public:
wxStaticBoxSizer* GetStaticBoxSizer() const { return sizer_; }
void SetStaticBoxSizer(wxStaticBoxSizer* sizer) { sizer_ = sizer; }
protected:
virtual void CreateRows() = 0;
private:
wxStaticBoxSizer* sizer_;
};
class reRegisterStateBox : public reBaseStateBox
{
public:
reRegisterStateBox(wxWindow *parent);
public:
void SetAValue(uint8_t value) { A_->SetValue(value); }
void SetBValue(uint8_t value) { B_->SetValue(value); }
void SetCValue(uint8_t value) { C_->SetValue(value); }
void SetDValue(uint8_t value) { D_->SetValue(value); }
void SetMValue(uint8_t value) { M_->SetValue(value); }
void SetSValue(uint8_t value) { S_->SetValue(value); }
void SetLValue(uint8_t value) { L_->SetValue(value); }
void SetPCValue(uint8_t value) { PC_->SetValue(value); }
private:
void CreateRows() override;
void CreateSubSizers();
private:
reRegisterStateRow* A_;
reRegisterStateRow* B_;
reRegisterStateRow* C_;
reRegisterStateRow* D_;
reRegisterStateRow* M_;
reRegisterStateRow* S_;
reRegisterStateRow* L_;
reRegisterStateRow* PC_;
wxBoxSizer* left_label_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* left_first_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* left_second_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* left_hex_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* left_signed_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* left_unsigned_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* right_label_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* right_first_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* right_second_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* right_hex_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* right_signed_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* right_unsigned_column_ = new wxBoxSizer(wxVERTICAL);
};
class reFlagStateBox : public reBaseStateBox
{
public:
reFlagStateBox(wxWindow *parent);
public:
void SetSValue(uint8_t value) { S_->SetValue(value); }
void SetZValue(uint8_t value) { Z_->SetValue(value); }
void SetCYValue(uint8_t value) { CY_->SetValue(value); }
private:
void CreateRows() override;
private:
reFlagStateRow* S_;
reFlagStateRow* Z_;
reFlagStateRow* CY_;
wxBoxSizer* label_column_ = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* value_column_ = new wxBoxSizer(wxVERTICAL);
};
class reROMStateBox : public reBaseStateBox
{
public:
reROMStateBox(wxWindow *parent);
public:
void SetProgramDataValues(
const std::array<uint16_t, ROM::kProgramDataSize>& values);
void SetInputSwitchesValues(
const std::array<uint8_t, ROM::kInputSwitchesSize>& values);
private:
void CreateRows() override;
void CreateSubSizers();
private:
std::array<reProgramDataStateRow*, ROM::kProgramDataSize> program_;
std::array<reInputSwitchesStateRow*, ROM::kInputSwitchesSize> input_;
wxSizer* addr_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* ls_byte_ms_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* ls_byte_ls_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* ls_byte_hex_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* ms_byte_ms_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* ms_byte_ls_nibble_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* ms_byte_hex_column_ = new wxBoxSizer(wxVERTICAL);
wxSizer* disassembled_column_ = new wxBoxSizer(wxVERTICAL);
};