Duckstation/src/core/settings.h

74 lines
2.3 KiB
C
Raw Normal View History

#pragma once
#include "types.h"
#include <optional>
2019-11-27 15:55:33 +00:00
#include <string>
struct Settings
{
Settings();
ConsoleRegion region = ConsoleRegion::Auto;
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;
bool audio_sync_enabled = true;
bool video_sync_enabled = true;
2019-10-27 11:22:33 +00:00
GPURenderer gpu_renderer = GPURenderer::Software;
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;
bool gpu_texture_filtering = false;
bool gpu_force_progressive_scan = false;
bool display_linear_filtering = true;
2019-11-07 13:52:19 +00:00
bool display_fullscreen = false;
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;
} debugging;
// TODO: Controllers, memory cards, etc.
2019-10-27 06:45:23 +00:00
std::string bios_path;
bool bios_patch_tty_enable = false;
bool bios_patch_fast_boot = false;
ControllerType controller_a_type = ControllerType::None;
ControllerType controller_b_type = ControllerType::None;
2019-11-07 13:52:19 +00:00
std::string memory_card_a_path;
std::string memory_card_b_path;
void SetDefaults();
void Load(const char* filename);
bool Save(const char* filename) const;
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);
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);
static std::optional<ControllerType> ParseControllerTypeName(const char* str);
static const char* GetControllerTypeName(ControllerType type);
static const char* GetControllerTypeDisplayName(ControllerType type);
};