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 ROM_WIDGET_HXX
19#define ROM_WIDGET_HXX
20
21class GuiObject;
22class EditTextWidget;
23class RomListWidget;
24
25#include "Base.hxx"
26#include "Command.hxx"
27#include "Widget.hxx"
28
29class RomWidget : public Widget, public CommandSender
30{
31 public:
32 // This enum needs to be seen outside the class
33 enum {
34 kInvalidateListing = 'INli'
35 };
36
37 public:
38 RomWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
39 int x, int y, int w, int h);
40 virtual ~RomWidget() = default;
41
42 void invalidate(bool forcereload = true)
43 { myListIsDirty = true; if(forcereload) loadConfig(); }
44
45 void scrollTo(int line);
46
47 private:
48 void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
49 void loadConfig() override;
50
51 void toggleBreak(int disasm_line);
52 void setPC(int disasm_line);
53 void runtoPC(int disasm_line);
54 void patchROM(int disasm_line, const string& bytes,
55 Common::Base::Format base);
56
57 private:
58 RomListWidget* myRomList;
59 EditTextWidget* myBank;
60
61 bool myListIsDirty;
62
63 private:
64 // Following constructors and assignment operators not supported
65 RomWidget() = delete;
66 RomWidget(const RomWidget&) = delete;
67 RomWidget(RomWidget&&) = delete;
68 RomWidget& operator=(const RomWidget&) = delete;
69 RomWidget& operator=(RomWidget&&) = delete;
70};
71
72#endif
73