1//============================================================================
2//
3// SSSS tt lll lll
4// SS SS tt ll ll
5// SS tttttt eeee ll ll aaaa
6// SSSS tt ee ee ll ll aa
7// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
8// SS SS tt ee ll ll aa aa
9// SSSS ttt eeeee llll llll aaaaa
10//
11// Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony
12// and the Stella Team
13//
14// See the file "License.txt" for information on usage and redistribution of
15// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16//============================================================================
17
18#ifndef CPU_WIDGET_HXX
19#define CPU_WIDGET_HXX
20
21class GuiObject;
22class ButtonWidget;
23class DataGridWidget;
24class DataGridOpsWidget;
25class EditTextWidget;
26class ToggleBitWidget;
27
28#include "Widget.hxx"
29#include "Command.hxx"
30
31class CpuWidget : public Widget, public CommandSender
32{
33 public:
34 CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
35 int x, int y, int max_w);
36 virtual ~CpuWidget() = default;
37
38 void setOpsWidget(DataGridOpsWidget* w);
39 void loadConfig() override;
40
41 private:
42 void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
43
44 private:
45 // ID's for the various widgets
46 // We need ID's, since there are more than one of several types of widgets
47 enum {
48 kPCRegID,
49 kCpuRegID,
50 kCpuRegDecID,
51 kCpuRegBinID
52 };
53
54 enum {
55 kPCRegAddr,
56 kSPRegAddr,
57 kARegAddr,
58 kXRegAddr,
59 kYRegAddr
60 };
61
62 enum {
63 kPSRegN = 0,
64 kPSRegV = 1,
65 kPSRegB = 3,
66 kPSRegD = 4,
67 kPSRegI = 5,
68 kPSRegZ = 6,
69 kPSRegC = 7
70 };
71
72 DataGridWidget* myPCGrid;
73 DataGridWidget* myCpuGrid;
74 DataGridWidget* myCpuGridDecValue;
75 DataGridWidget* myCpuGridBinValue;
76 EditTextWidget* myCpuDataSrc[4];
77 ToggleBitWidget* myPSRegister;
78 EditTextWidget* myPCLabel;
79
80 private:
81 // Following constructors and assignment operators not supported
82 CpuWidget() = delete;
83 CpuWidget(const CpuWidget&) = delete;
84 CpuWidget(CpuWidget&&) = delete;
85 CpuWidget& operator=(const CpuWidget&) = delete;
86 CpuWidget& operator=(CpuWidget&&) = delete;
87};
88
89#endif
90