2019-10-04 05:00:32 +00:00
|
|
|
#pragma once
|
|
|
|
#include "types.h"
|
2019-12-16 06:46:43 +00:00
|
|
|
#include <array>
|
2019-11-06 15:43:51 +00:00
|
|
|
#include <optional>
|
2019-11-27 15:55:33 +00:00
|
|
|
#include <string>
|
2019-10-04 05:00:32 +00:00
|
|
|
|
2019-12-30 11:22:22 +00:00
|
|
|
class SettingsInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual int GetIntValue(const char* section, const char* key, int default_value = 0) = 0;
|
|
|
|
virtual float GetFloatValue(const char* section, const char* key, float default_value = 0.0f) = 0;
|
|
|
|
virtual bool GetBoolValue(const char* section, const char* key, bool default_value = false) = 0;
|
|
|
|
virtual std::string GetStringValue(const char* section, const char* key, const char* default_value = "") = 0;
|
|
|
|
|
|
|
|
virtual void SetIntValue(const char* section, const char* key, int value) = 0;
|
|
|
|
virtual void SetFloatValue(const char* section, const char* key, float value) = 0;
|
|
|
|
virtual void SetBoolValue(const char* section, const char* key, bool value) = 0;
|
|
|
|
virtual void SetStringValue(const char* section, const char* key, const char* value) = 0;
|
|
|
|
|
|
|
|
virtual void DeleteValue(const char* section, const char* key) = 0;
|
|
|
|
};
|
|
|
|
|
2019-10-04 05:00:32 +00:00
|
|
|
struct Settings
|
|
|
|
{
|
|
|
|
Settings();
|
|
|
|
|
2019-11-16 10:50:11 +00:00
|
|
|
ConsoleRegion region = ConsoleRegion::Auto;
|
2019-11-16 05:27:57 +00:00
|
|
|
|
2019-11-23 10:22:09 +00:00
|
|
|
CPUExecutionMode cpu_execution_mode = CPUExecutionMode::Interpreter;
|
|
|
|
|
2019-10-27 11:22:33 +00:00
|
|
|
bool start_paused = false;
|
2019-11-07 13:52:19 +00:00
|
|
|
bool speed_limiter_enabled = true;
|
2019-10-27 11:22:33 +00:00
|
|
|
|
2019-11-03 15:45:03 +00:00
|
|
|
GPURenderer gpu_renderer = GPURenderer::Software;
|
2019-10-04 05:00:32 +00:00
|
|
|
u32 gpu_resolution_scale = 1;
|
2019-11-07 15:07:39 +00:00
|
|
|
mutable u32 max_gpu_resolution_scale = 1;
|
2019-11-01 14:31:25 +00:00
|
|
|
bool gpu_true_color = false;
|
2019-12-07 07:03:54 +00:00
|
|
|
bool gpu_texture_filtering = false;
|
2019-12-10 12:52:46 +00:00
|
|
|
bool gpu_force_progressive_scan = false;
|
2019-10-26 14:02:01 +00:00
|
|
|
bool display_linear_filtering = true;
|
2019-11-07 13:52:19 +00:00
|
|
|
bool display_fullscreen = false;
|
2019-12-23 07:02:37 +00:00
|
|
|
bool video_sync_enabled = true;
|
|
|
|
|
|
|
|
AudioBackend audio_backend = AudioBackend::Default;
|
|
|
|
bool audio_sync_enabled = true;
|
2019-10-26 02:55:56 +00:00
|
|
|
|
|
|
|
struct DebugSettings
|
|
|
|
{
|
|
|
|
bool show_vram = false;
|
|
|
|
bool dump_cpu_to_vram_copies = false;
|
|
|
|
bool dump_vram_to_cpu_copies = false;
|
|
|
|
|
2019-11-07 15:07:39 +00:00
|
|
|
// Mutable because the imgui window can close itself.
|
|
|
|
mutable bool show_gpu_state = false;
|
|
|
|
mutable bool show_cdrom_state = false;
|
|
|
|
mutable bool show_spu_state = false;
|
|
|
|
mutable bool show_timers_state = false;
|
|
|
|
mutable bool show_mdec_state = false;
|
2019-10-26 02:55:56 +00:00
|
|
|
} debugging;
|
|
|
|
|
2019-10-04 05:00:32 +00:00
|
|
|
// TODO: Controllers, memory cards, etc.
|
2019-10-27 06:45:23 +00:00
|
|
|
|
2019-11-06 15:43:51 +00:00
|
|
|
std::string bios_path;
|
2019-12-10 13:06:43 +00:00
|
|
|
bool bios_patch_tty_enable = false;
|
2019-11-15 15:04:51 +00:00
|
|
|
bool bios_patch_fast_boot = false;
|
|
|
|
|
2019-12-16 06:46:43 +00:00
|
|
|
std::array<ControllerType, NUM_CONTROLLER_AND_CARD_PORTS> controller_types{};
|
|
|
|
std::array<std::string, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_paths{};
|
2019-11-06 15:43:51 +00:00
|
|
|
|
|
|
|
void SetDefaults();
|
2019-12-30 11:22:22 +00:00
|
|
|
void Load(SettingsInterface& si);
|
|
|
|
void Save(SettingsInterface& si) const;
|
2019-11-06 15:43:51 +00:00
|
|
|
|
2019-11-16 05:27:57 +00:00
|
|
|
static std::optional<ConsoleRegion> ParseConsoleRegionName(const char* str);
|
|
|
|
static const char* GetConsoleRegionName(ConsoleRegion region);
|
|
|
|
static const char* GetConsoleRegionDisplayName(ConsoleRegion region);
|
|
|
|
|
2019-11-23 10:22:09 +00:00
|
|
|
static std::optional<CPUExecutionMode> ParseCPUExecutionMode(const char* str);
|
|
|
|
static const char* GetCPUExecutionModeName(CPUExecutionMode mode);
|
|
|
|
static const char* GetCPUExecutionModeDisplayName(CPUExecutionMode mode);
|
|
|
|
|
2019-11-06 15:43:51 +00:00
|
|
|
static std::optional<GPURenderer> ParseRendererName(const char* str);
|
|
|
|
static const char* GetRendererName(GPURenderer renderer);
|
2019-11-07 13:52:19 +00:00
|
|
|
static const char* GetRendererDisplayName(GPURenderer renderer);
|
2019-12-14 13:29:26 +00:00
|
|
|
|
2019-12-23 07:02:37 +00:00
|
|
|
static std::optional<AudioBackend> ParseAudioBackend(const char* str);
|
|
|
|
static const char* GetAudioBackendName(AudioBackend backend);
|
|
|
|
static const char* GetAudioBackendDisplayName(AudioBackend backend);
|
|
|
|
|
2019-12-14 13:29:26 +00:00
|
|
|
static std::optional<ControllerType> ParseControllerTypeName(const char* str);
|
|
|
|
static const char* GetControllerTypeName(ControllerType type);
|
|
|
|
static const char* GetControllerTypeDisplayName(ControllerType type);
|
2019-10-04 05:00:32 +00:00
|
|
|
};
|