openMSX
ImGuiDisassembly.hh
Go to the documentation of this file.
1#ifndef IMGUI_DISASSEMBLY_HH
2#define IMGUI_DISASSEMBLY_HH
3
4#include "ImGuiPart.hh"
5
6#include <optional>
7#include <string>
8#include <utility>
9
10namespace openmsx {
11
12class Debugger;
13class MSXDevice;
14class MSXRom;
15class RomBlockDebuggableBase;
16class SymbolManager;
17
18class ImGuiDisassembly final : public ImGuiPart
19{
20public:
21 ImGuiDisassembly(ImGuiManager& manager_, size_t index);
22
23 [[nodiscard]] zstring_view iniName() const override { return title; }
24 void save(ImGuiTextBuffer& buf) override;
25 void loadLine(std::string_view name, zstring_view value) override;
26 void loadEnd() override;
27 void paint(MSXMotherBoard* motherBoard) override;
28
29 void signalBreak() { if (scrollToPcOnBreak) syncDisassemblyWithPC = true; }
30 void setGotoTarget(uint16_t target);
31 void syncWithPC() { syncDisassemblyWithPC = true; }
32
33public:
34 static void actionToggleBp(MSXMotherBoard& motherBoard);
35 [[nodiscard]] static std::pair<const MSXRom*, RomBlockDebuggableBase*>
36 getRomBlocks(Debugger& debugger, const MSXDevice* device);
37
38public:
39 bool show = true;
40
41private:
42 SymbolManager& symbolManager;
43 std::string title;
44 size_t cycleLabelsCounter = 0;
45
46 std::string gotoAddr;
47 std::string runToAddr;
48 std::optional<unsigned> gotoTarget;
49 std::optional<float> setDisassemblyScrollY;
50 bool followPC = false;
51 bool scrollToPcOnBreak = true;
52
53 bool syncDisassemblyWithPC = false;
54 float disassemblyScrollY = 0.0f;
55
56 static constexpr auto persistentElements = std::tuple{
58 PersistentElement{"followPC", &ImGuiDisassembly::followPC},
59 PersistentElement{"scrollToPcOnBreak", &ImGuiDisassembly::scrollToPcOnBreak},
60 PersistentElement{"disassemblyY", &ImGuiDisassembly::disassemblyScrollY},
61 };
62};
63
64} // namespace openmsx
65
66#endif
void loadLine(std::string_view name, zstring_view value) override
void save(ImGuiTextBuffer &buf) override
static std::pair< const MSXRom *, RomBlockDebuggableBase * > getRomBlocks(Debugger &debugger, const MSXDevice *device)
static void actionToggleBp(MSXMotherBoard &motherBoard)
void setGotoTarget(uint16_t target)
void paint(MSXMotherBoard *motherBoard) override
zstring_view iniName() const override
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:11