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-2021 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 DEV_SETTINGS_HANDLER_HXX
19 #define DEV_SETTINGS_HANDLER_HXX
20 
21 class OSystem;
22 
23 #include <array>
24 
25 /**
26   This class takes care of developer settings sets.
27 
28   @author  Thomas Jentzsch
29 */
30 class DevSettingsHandler
31 {
32   public:
33     enum SettingsSet {
34       player,
35       developer,
36       numSets
37     };
38 
39     DevSettingsHandler(OSystem& osystem);
40 
41     void loadSettings(SettingsSet set);
42     void saveSettings(SettingsSet set);
43     void applySettings(SettingsSet set);
44 
45   protected:
46     OSystem& myOSystem;
47     // Emulator sets
48     std::array<bool, numSets>   myFrameStats;
49     std::array<bool, numSets>   myDetectedInfo;
50     std::array<bool, numSets>   myExternAccess;
51     std::array<int, numSets>    myConsole;
52     std::array<bool, numSets>   myRandomBank;
53     std::array<bool, numSets>   myRandomizeTIA;
54     std::array<bool, numSets>   myRandomizeRAM;
55     std::array<string, numSets> myRandomizeCPU;
56     std::array<bool, numSets>   myColorLoss;
57     std::array<bool, numSets>   myTVJitter;
58     std::array<int, numSets>    myTVJitterRec;
59     std::array<bool, numSets>   myDebugColors;
60     std::array<bool, numSets>   myUndrivenPins;
61   #ifdef DEBUGGER_SUPPORT
62     std::array<bool, numSets>   myRWPortBreak;
63     std::array<bool, numSets>   myWRPortBreak;
64   #endif
65     std::array<bool, numSets>   myThumbException;
66     // TIA sets
67     std::array<string, numSets> myTIAType;
68     std::array<bool, numSets>   myPlInvPhase;
69     std::array<bool, numSets>   myMsInvPhase;
70     std::array<bool, numSets>   myBlInvPhase;
71     std::array<bool, numSets>   myPFBits;
72     std::array<bool, numSets>   myPFColor;
73     std::array<bool, numSets>   myBKColor;
74     std::array<bool, numSets>   myPlSwap;
75     std::array<bool, numSets>   myBlSwap;
76     // States sets
77     std::array<bool, numSets>   myTimeMachine;
78     std::array<int, numSets>    myStateSize;
79     std::array<int, numSets>    myUncompressed;
80     std::array<string, numSets> myStateInterval;
81     std::array<string, numSets> myStateHorizon;
82 
83   private:
84     void handleEnableDebugColors(bool enable);
85 
86     // Following constructors and assignment operators not supported
87     DevSettingsHandler() = delete;
88     DevSettingsHandler(const DevSettingsHandler&) = delete;
89     DevSettingsHandler(DevSettingsHandler&&) = delete;
90     DevSettingsHandler& operator=(const DevSettingsHandler&) = delete;
91     DevSettingsHandler& operator=(DevSettingsHandler&&) = delete;
92 };
93 
94 #endif
95