/
ConfigManager.h
350 lines (294 loc) · 8.49 KB
/
ConfigManager.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <string>
#include <vector>
#include "Common/IniFile.h"
#include "Common/NonCopyable.h"
#include "Common/SysConf.h"
#include "Core/HW/EXI_Device.h"
#include "Core/HW/SI_Device.h"
namespace DiscIO
{
enum class Language;
}
// DSP Backend Types
#define BACKEND_NULLSOUND _trans("No audio output")
#define BACKEND_ALSA "ALSA"
#define BACKEND_AOSOUND "AOSound"
#define BACKEND_COREAUDIO "CoreAudio"
#define BACKEND_OPENAL "OpenAL"
#define BACKEND_PULSEAUDIO "Pulse"
#define BACKEND_XAUDIO2 "XAudio2"
#define BACKEND_OPENSLES "OpenSLES"
enum GPUDeterminismMode
{
GPU_DETERMINISM_AUTO,
GPU_DETERMINISM_NONE,
// This is currently the only mode. There will probably be at least
// one more at some point.
GPU_DETERMINISM_FAKE_COMPLETION,
};
struct SConfig : NonCopyable
{
// Wii Devices
bool m_WiiSDCard;
bool m_WiiKeyboard;
bool m_WiimoteContinuousScanning;
bool m_WiimoteEnableSpeaker;
// name of the last used filename
std::string m_LastFilename;
// ISO folder
std::vector<std::string> m_ISOFolder;
bool m_RecursiveISOFolder;
// Settings
bool bEnableDebugging = false;
#ifdef USE_GDBSTUB
int iGDBPort;
#ifndef _WIN32
std::string gdb_socket;
#endif
#endif
bool bAutomaticStart = false;
bool bBootToPause = false;
int iCPUCore;
// JIT (shared between JIT and JITIL)
bool bJITNoBlockCache = false;
bool bJITNoBlockLinking = false;
bool bJITOff = false;
bool bJITLoadStoreOff = false;
bool bJITLoadStorelXzOff = false;
bool bJITLoadStorelwzOff = false;
bool bJITLoadStorelbzxOff = false;
bool bJITLoadStoreFloatingOff = false;
bool bJITLoadStorePairedOff = false;
bool bJITFloatingPointOff = false;
bool bJITIntegerOff = false;
bool bJITPairedOff = false;
bool bJITSystemRegistersOff = false;
bool bJITBranchOff = false;
bool bJITILTimeProfiling = false;
bool bJITILOutputIR = false;
bool bFastmem;
bool bFPRF = false;
bool bAccurateNaNs = false;
int iTimingVariance = 40; // in milli secounds
bool bCPUThread = true;
bool bDSPThread = false;
bool bDSPHLE = true;
bool bSkipIdle = true;
bool bSyncGPUOnSkipIdleHack = true;
bool bNTSC = false;
bool bForceNTSCJ = false;
bool bHLE_BS2 = true;
bool bEnableCheats = false;
bool bEnableMemcardSdWriting = true;
bool bDPL2Decoder = false;
int iLatency = 14;
bool bRunCompareServer = false;
bool bRunCompareClient = false;
bool bMMU = false;
bool bDCBZOFF = false;
int iBBDumpPort = 0;
bool bFastDiscSpeed = false;
bool bSyncGPU = false;
int iSyncGpuMaxDistance;
int iSyncGpuMinDistance;
float fSyncGpuOverclock;
int SelectedLanguage = 0;
bool bOverrideGCLanguage = false;
bool bWii = false;
// Interface settings
bool bConfirmStop = false;
bool bHideCursor = false, bAutoHideCursor = false;
bool bUsePanicHandlers = true;
bool bOnScreenDisplayMessages = true;
std::string theme_name;
// Display settings
std::string strFullscreenResolution;
int iRenderWindowXPos = -1, iRenderWindowYPos = -1;
int iRenderWindowWidth = 640, iRenderWindowHeight = 480;
bool bRenderWindowAutoSize = false, bKeepWindowOnTop = false;
bool bFullscreen = false, bRenderToMain = false;
bool bProgressive = false, bPAL60 = false;
bool bDisableScreenSaver = false;
int iPosX, iPosY, iWidth, iHeight;
// Analytics settings.
std::string m_analytics_id;
bool m_analytics_enabled = false;
bool m_analytics_permission_asked = false;
// Bluetooth passthrough mode settings
bool m_bt_passthrough_enabled = false;
int m_bt_passthrough_pid = -1;
int m_bt_passthrough_vid = -1;
std::string m_bt_passthrough_link_keys;
// Fifo Player related settings
bool bLoopFifoReplay = true;
// Custom RTC
bool bEnableCustomRTC;
u32 m_customRTCValue;
enum EBootBS2
{
BOOT_DEFAULT,
BOOT_BS2_JAP,
BOOT_BS2_USA,
BOOT_BS2_EUR,
};
enum EBootType
{
BOOT_ISO,
BOOT_ELF,
BOOT_DOL,
BOOT_WII_NAND,
BOOT_BS2,
BOOT_DFF
};
EBootType m_BootType;
std::string m_strVideoBackend;
std::string m_strGPUDeterminismMode;
// set based on the string version
GPUDeterminismMode m_GPUDeterminismMode;
// files
std::string m_strFilename;
std::string m_strBootROM;
std::string m_strSRAM;
std::string m_strDefaultISO;
std::string m_strDVDRoot;
std::string m_strApploader;
std::string m_strUniqueID;
std::string m_strName;
std::string m_strWiiSDCardPath;
u16 m_revision;
std::string m_perfDir;
void LoadDefaults();
bool AutoSetup(EBootBS2 _BootBS2);
const std::string& GetUniqueID() const { return m_strUniqueID; }
void CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion, bool isSlotA);
DiscIO::Language GetCurrentLanguage(bool wii) const;
IniFile LoadDefaultGameIni() const;
IniFile LoadLocalGameIni() const;
IniFile LoadGameIni() const;
static IniFile LoadDefaultGameIni(const std::string& id, u16 revision);
static IniFile LoadLocalGameIni(const std::string& id, u16 revision);
static IniFile LoadGameIni(const std::string& id, u16 revision);
static std::vector<std::string> GetGameIniFilenames(const std::string& id, u16 revision);
std::string m_NANDPath;
std::string m_DumpPath;
std::string m_strMemoryCardA;
std::string m_strMemoryCardB;
std::string m_strGbaCartA;
std::string m_strGbaCartB;
TEXIDevices m_EXIDevice[3];
SIDevices m_SIDevice[4];
std::string m_bba_mac;
// interface language
std::string m_InterfaceLanguage;
float m_EmulationSpeed;
bool m_OCEnable;
float m_OCFactor;
// other interface settings
bool m_InterfaceToolbar;
bool m_InterfaceStatusbar;
bool m_InterfaceLogWindow;
bool m_InterfaceLogConfigWindow;
bool m_InterfaceExtendedFPSInfo;
bool m_ListDrives;
bool m_ListWad;
bool m_ListElfDol;
bool m_ListWii;
bool m_ListGC;
bool m_ListPal;
bool m_ListUsa;
bool m_ListJap;
bool m_ListAustralia;
bool m_ListFrance;
bool m_ListGermany;
bool m_ListItaly;
bool m_ListKorea;
bool m_ListNetherlands;
bool m_ListRussia;
bool m_ListSpain;
bool m_ListTaiwan;
bool m_ListWorld;
bool m_ListUnknown;
int m_ListSort;
int m_ListSort2;
// Game list column toggles
bool m_showSystemColumn;
bool m_showBannerColumn;
bool m_showMakerColumn;
bool m_showFileNameColumn;
bool m_showIDColumn;
bool m_showRegionColumn;
bool m_showSizeColumn;
bool m_showStateColumn;
// Toggles whether compressed titles show up in blue in the game list
bool m_ColorCompressed;
std::string m_WirelessMac;
bool m_PauseMovie;
bool m_ShowLag;
bool m_ShowFrameCount;
bool m_ShowRTC;
std::string m_strMovieAuthor;
unsigned int m_FrameSkip;
bool m_DumpFrames;
bool m_DumpFramesSilent;
bool m_ShowInputDisplay;
bool m_PauseOnFocusLost;
// DSP settings
bool m_DSPEnableJIT;
bool m_DSPCaptureLog;
bool m_DumpAudio;
bool m_IsMuted;
bool m_DumpUCode;
int m_Volume;
std::string sBackend;
// Input settings
bool m_BackgroundInput;
bool m_AdapterRumble[4];
bool m_AdapterKonga[4];
// Network settings
bool m_SSLDumpRead;
bool m_SSLDumpWrite;
bool m_SSLVerifyCert;
bool m_SSLDumpRootCA;
bool m_SSLDumpPeerCert;
SysConf* m_SYSCONF;
// Save settings
void SaveSettings();
// Load settings
void LoadSettings();
// Return the permanent and somewhat globally used instance of this struct
static SConfig& GetInstance() { return (*m_Instance); }
static void Init();
static void Shutdown();
private:
SConfig();
~SConfig();
void SaveGeneralSettings(IniFile& ini);
void SaveInterfaceSettings(IniFile& ini);
void SaveDisplaySettings(IniFile& ini);
void SaveGameListSettings(IniFile& ini);
void SaveCoreSettings(IniFile& ini);
void SaveDSPSettings(IniFile& ini);
void SaveInputSettings(IniFile& ini);
void SaveMovieSettings(IniFile& ini);
void SaveFifoPlayerSettings(IniFile& ini);
void SaveNetworkSettings(IniFile& ini);
void SaveAnalyticsSettings(IniFile& ini);
void SaveBluetoothPassthroughSettings(IniFile& ini);
void LoadGeneralSettings(IniFile& ini);
void LoadInterfaceSettings(IniFile& ini);
void LoadDisplaySettings(IniFile& ini);
void LoadGameListSettings(IniFile& ini);
void LoadCoreSettings(IniFile& ini);
void LoadDSPSettings(IniFile& ini);
void LoadInputSettings(IniFile& ini);
void LoadMovieSettings(IniFile& ini);
void LoadFifoPlayerSettings(IniFile& ini);
void LoadNetworkSettings(IniFile& ini);
void LoadAnalyticsSettings(IniFile& ini);
void LoadBluetoothPassthroughSettings(IniFile& ini);
static SConfig* m_Instance;
};