2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 22:43:11 -04:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-08-14 19:54:01 +00:00
|
|
|
#include <limits>
|
2016-11-11 01:33:52 +01:00
|
|
|
#include <set>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <string>
|
2016-11-11 01:33:52 +01:00
|
|
|
#include <utility>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2015-06-12 13:56:53 +02:00
|
|
|
#include "Common/IniFile.h"
|
2015-09-26 16:13:54 -04:00
|
|
|
#include "Common/NonCopyable.h"
|
2017-01-20 15:33:43 -05:00
|
|
|
#include "Core/HW/EXI/EXI_Device.h"
|
2017-01-20 18:45:11 -05:00
|
|
|
#include "Core/HW/SI/SI_Device.h"
|
2016-07-06 20:33:05 +02:00
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
enum class Language;
|
2016-12-23 21:53:36 +01:00
|
|
|
enum class Region;
|
2017-03-09 09:47:43 +01:00
|
|
|
class IVolume;
|
|
|
|
}
|
|
|
|
namespace IOS
|
|
|
|
{
|
|
|
|
namespace ES
|
|
|
|
{
|
|
|
|
class TMDReader;
|
|
|
|
}
|
2016-07-06 20:33:05 +02:00
|
|
|
}
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2013-01-16 20:16:56 -05:00
|
|
|
// DSP Backend Types
|
2016-06-24 10:43:46 +02:00
|
|
|
#define BACKEND_NULLSOUND _trans("No audio output")
|
|
|
|
#define BACKEND_ALSA "ALSA"
|
|
|
|
#define BACKEND_COREAUDIO "CoreAudio"
|
|
|
|
#define BACKEND_OPENAL "OpenAL"
|
|
|
|
#define BACKEND_PULSEAUDIO "Pulse"
|
|
|
|
#define BACKEND_XAUDIO2 "XAudio2"
|
|
|
|
#define BACKEND_OPENSLES "OpenSLES"
|
2015-06-12 13:56:53 +02:00
|
|
|
|
|
|
|
enum GPUDeterminismMode
|
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
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,
|
2015-06-12 13:56:53 +02:00
|
|
|
};
|
|
|
|
|
2010-11-15 05:29:10 +00:00
|
|
|
struct SConfig : NonCopyable
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
// 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
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bEnableDebugging = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
#ifdef USE_GDBSTUB
|
|
|
|
int iGDBPort;
|
|
|
|
#ifndef _WIN32
|
|
|
|
std::string gdb_socket;
|
|
|
|
#endif
|
|
|
|
#endif
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bAutomaticStart = false;
|
|
|
|
bool bBootToPause = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
int iCPUCore;
|
|
|
|
|
|
|
|
// JIT (shared between JIT and JITIL)
|
2016-09-25 19:20:02 +02:00
|
|
|
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;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
bool bFastmem;
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bFPRF = false;
|
|
|
|
bool bAccurateNaNs = false;
|
|
|
|
|
|
|
|
int iTimingVariance = 40; // in milli secounds
|
|
|
|
bool bCPUThread = true;
|
|
|
|
bool bDSPThread = false;
|
|
|
|
bool bDSPHLE = true;
|
|
|
|
bool bSyncGPUOnSkipIdleHack = true;
|
|
|
|
bool bForceNTSCJ = false;
|
|
|
|
bool bHLE_BS2 = true;
|
|
|
|
bool bEnableCheats = false;
|
|
|
|
bool bEnableMemcardSdWriting = true;
|
2016-12-23 20:37:23 -05:00
|
|
|
bool bCopyWiiSaveNetplay = true;
|
2016-09-25 19:20:02 +02:00
|
|
|
|
|
|
|
bool bDPL2Decoder = false;
|
|
|
|
int iLatency = 14;
|
|
|
|
|
|
|
|
bool bRunCompareServer = false;
|
|
|
|
bool bRunCompareClient = false;
|
|
|
|
|
|
|
|
bool bMMU = false;
|
|
|
|
bool bDCBZOFF = false;
|
2017-01-26 04:57:03 -05:00
|
|
|
bool bLowDCBZHack = false;
|
2016-09-25 19:20:02 +02:00
|
|
|
int iBBDumpPort = 0;
|
|
|
|
bool bFastDiscSpeed = false;
|
|
|
|
|
|
|
|
bool bSyncGPU = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
int iSyncGpuMaxDistance;
|
|
|
|
int iSyncGpuMinDistance;
|
|
|
|
float fSyncGpuOverclock;
|
|
|
|
|
2016-09-25 19:20:02 +02:00
|
|
|
int SelectedLanguage = 0;
|
|
|
|
bool bOverrideGCLanguage = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bWii = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
// Interface settings
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bConfirmStop = false;
|
|
|
|
bool bHideCursor = false, bAutoHideCursor = false;
|
|
|
|
bool bUsePanicHandlers = true;
|
|
|
|
bool bOnScreenDisplayMessages = true;
|
2016-06-24 10:43:46 +02:00
|
|
|
std::string theme_name;
|
|
|
|
|
|
|
|
// Display settings
|
|
|
|
std::string strFullscreenResolution;
|
2016-08-14 19:54:01 +00:00
|
|
|
int iRenderWindowXPos = std::numeric_limits<int>::min();
|
|
|
|
int iRenderWindowYPos = std::numeric_limits<int>::min();
|
|
|
|
int iRenderWindowWidth = -1;
|
|
|
|
int iRenderWindowHeight = -1;
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bRenderWindowAutoSize = false, bKeepWindowOnTop = false;
|
|
|
|
bool bFullscreen = false, bRenderToMain = false;
|
|
|
|
bool bProgressive = false, bPAL60 = false;
|
|
|
|
bool bDisableScreenSaver = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
int iPosX, iPosY, iWidth, iHeight;
|
|
|
|
|
|
|
|
// Analytics settings.
|
|
|
|
std::string m_analytics_id;
|
2016-09-25 19:20:02 +02:00
|
|
|
bool m_analytics_enabled = false;
|
|
|
|
bool m_analytics_permission_asked = false;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2016-08-23 16:19:30 +02:00
|
|
|
// Bluetooth passthrough mode settings
|
|
|
|
bool m_bt_passthrough_enabled = false;
|
|
|
|
int m_bt_passthrough_pid = -1;
|
|
|
|
int m_bt_passthrough_vid = -1;
|
2016-09-16 23:25:57 +02:00
|
|
|
std::string m_bt_passthrough_link_keys;
|
2016-08-23 16:19:30 +02:00
|
|
|
|
2016-11-11 01:33:52 +01:00
|
|
|
// USB passthrough settings
|
|
|
|
std::set<std::pair<u16, u16>> m_usb_passthrough_devices;
|
|
|
|
bool IsUSBDeviceWhitelisted(std::pair<u16, u16> vid_pid) const;
|
|
|
|
|
2016-10-07 21:57:07 +02:00
|
|
|
// SYSCONF settings
|
|
|
|
int m_sensor_bar_position = 0x01;
|
|
|
|
int m_sensor_bar_sensitivity = 0x03;
|
|
|
|
int m_speaker_volume = 0x58;
|
|
|
|
bool m_wiimote_motor = true;
|
|
|
|
int m_wii_language = 0x01;
|
|
|
|
int m_wii_aspect_ratio = 0x01;
|
|
|
|
int m_wii_screensaver = 0x00;
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
// Fifo Player related settings
|
2016-09-25 19:20:02 +02:00
|
|
|
bool bLoopFifoReplay = true;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2016-07-13 16:46:14 -04:00
|
|
|
// Custom RTC
|
|
|
|
bool bEnableCustomRTC;
|
|
|
|
u32 m_customRTCValue;
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
enum EBootBS2
|
|
|
|
{
|
|
|
|
BOOT_DEFAULT,
|
|
|
|
BOOT_BS2_JAP,
|
|
|
|
BOOT_BS2_USA,
|
|
|
|
BOOT_BS2_EUR,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum EBootType
|
|
|
|
{
|
|
|
|
BOOT_ISO,
|
|
|
|
BOOT_ELF,
|
|
|
|
BOOT_DOL,
|
|
|
|
BOOT_WII_NAND,
|
2017-01-28 18:12:05 +01:00
|
|
|
BOOT_MIOS,
|
2016-06-24 10:43:46 +02:00
|
|
|
BOOT_BS2,
|
|
|
|
BOOT_DFF
|
|
|
|
};
|
2016-12-23 21:53:36 +01:00
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
EBootType m_BootType;
|
2016-12-23 21:53:36 +01:00
|
|
|
DiscIO::Region m_region;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
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;
|
2016-07-27 09:32:27 +02:00
|
|
|
std::string m_strWiiSDCardPath;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
std::string m_perfDir;
|
|
|
|
|
2017-03-09 09:47:43 +01:00
|
|
|
const std::string& GetGameID() const { return m_game_id; }
|
|
|
|
u64 GetTitleID() const { return m_title_id; }
|
|
|
|
u16 GetRevision() const { return m_revision; }
|
|
|
|
void ResetRunningGameMetadata();
|
|
|
|
void SetRunningGameMetadata(const DiscIO::IVolume& volume);
|
|
|
|
void SetRunningGameMetadata(const IOS::ES::TMDReader& tmd);
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
void LoadDefaults();
|
2016-12-23 21:53:36 +01:00
|
|
|
static const char* GetDirectoryForRegion(DiscIO::Region region);
|
2016-06-24 10:43:46 +02:00
|
|
|
bool AutoSetup(EBootBS2 _BootBS2);
|
|
|
|
void CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion, bool isSlotA);
|
2016-07-06 20:33:05 +02:00
|
|
|
DiscIO::Language GetCurrentLanguage(bool wii) const;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
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;
|
2016-06-25 11:24:43 -04:00
|
|
|
std::string m_DumpPath;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
std::string m_strMemoryCardA;
|
|
|
|
std::string m_strMemoryCardB;
|
|
|
|
std::string m_strGbaCartA;
|
|
|
|
std::string m_strGbaCartB;
|
2017-03-18 17:46:05 -04:00
|
|
|
ExpansionInterface::TEXIDevices m_EXIDevice[3];
|
2017-03-16 04:41:36 -04:00
|
|
|
SerialInterface::SIDevices m_SIDevice[4];
|
2016-06-24 10:43:46 +02:00
|
|
|
std::string m_bba_mac;
|
|
|
|
|
|
|
|
// interface language
|
2016-08-12 14:01:09 +02:00
|
|
|
std::string m_InterfaceLanguage;
|
2016-06-24 10:43:46 +02:00
|
|
|
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;
|
|
|
|
|
|
|
|
std::string m_WirelessMac;
|
|
|
|
bool m_PauseMovie;
|
|
|
|
bool m_ShowLag;
|
|
|
|
bool m_ShowFrameCount;
|
2016-07-19 20:23:25 -04:00
|
|
|
bool m_ShowRTC;
|
2016-06-24 10:43:46 +02:00
|
|
|
std::string m_strMovieAuthor;
|
|
|
|
unsigned int m_FrameSkip;
|
|
|
|
bool m_DumpFrames;
|
|
|
|
bool m_DumpFramesSilent;
|
|
|
|
bool m_ShowInputDisplay;
|
|
|
|
|
|
|
|
bool m_PauseOnFocusLost;
|
|
|
|
|
2016-12-07 13:20:37 -05:00
|
|
|
bool m_DisableTooltips;
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
// DSP settings
|
|
|
|
bool m_DSPEnableJIT;
|
|
|
|
bool m_DSPCaptureLog;
|
|
|
|
bool m_DumpAudio;
|
2017-01-08 13:51:00 -05:00
|
|
|
bool m_DumpAudioSilent;
|
2016-06-24 10:43:46 +02:00
|
|
|
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];
|
|
|
|
|
2015-06-16 21:48:09 +02:00
|
|
|
// Network settings
|
|
|
|
bool m_SSLDumpRead;
|
|
|
|
bool m_SSLDumpWrite;
|
2015-06-09 20:23:56 +02:00
|
|
|
bool m_SSLVerifyCert;
|
2015-07-11 10:31:03 +02:00
|
|
|
bool m_SSLDumpRootCA;
|
|
|
|
bool m_SSLDumpPeerCert;
|
2015-06-16 21:48:09 +02:00
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
// Save settings
|
|
|
|
void SaveSettings();
|
|
|
|
|
|
|
|
// Load settings
|
|
|
|
void LoadSettings();
|
|
|
|
|
2016-10-07 21:57:07 +02:00
|
|
|
void LoadSettingsFromSysconf();
|
|
|
|
void SaveSettingsToSysconf();
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
// Return the permanent and somewhat globally used instance of this struct
|
|
|
|
static SConfig& GetInstance() { return (*m_Instance); }
|
|
|
|
static void Init();
|
|
|
|
static void Shutdown();
|
2010-02-16 04:34:41 +00:00
|
|
|
|
2010-02-19 18:50:01 +00:00
|
|
|
private:
|
2016-06-24 10:43:46 +02:00
|
|
|
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);
|
2015-06-16 21:48:09 +02:00
|
|
|
void SaveNetworkSettings(IniFile& ini);
|
2016-06-24 10:43:46 +02:00
|
|
|
void SaveAnalyticsSettings(IniFile& ini);
|
2016-08-23 16:19:30 +02:00
|
|
|
void SaveBluetoothPassthroughSettings(IniFile& ini);
|
2016-11-11 01:33:52 +01:00
|
|
|
void SaveUSBPassthroughSettings(IniFile& ini);
|
2016-10-07 21:57:07 +02:00
|
|
|
void SaveSysconfSettings(IniFile& ini);
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
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);
|
2015-06-16 21:48:09 +02:00
|
|
|
void LoadNetworkSettings(IniFile& ini);
|
2016-06-24 10:43:46 +02:00
|
|
|
void LoadAnalyticsSettings(IniFile& ini);
|
2016-08-23 16:19:30 +02:00
|
|
|
void LoadBluetoothPassthroughSettings(IniFile& ini);
|
2016-11-11 01:33:52 +01:00
|
|
|
void LoadUSBPassthroughSettings(IniFile& ini);
|
2016-10-07 21:57:07 +02:00
|
|
|
void LoadSysconfSettings(IniFile& ini);
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2017-03-09 09:47:43 +01:00
|
|
|
void SetRunningGameMetadata(const std::string& game_id, u64 title_id, u16 revision);
|
2017-01-25 14:42:11 +01:00
|
|
|
bool SetRegion(DiscIO::Region region, std::string* directory_name);
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
static SConfig* m_Instance;
|
2017-03-09 09:47:43 +01:00
|
|
|
|
|
|
|
std::string m_game_id;
|
|
|
|
u64 m_title_id;
|
|
|
|
u16 m_revision;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|