// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include "types.h" namespace Config { enum class ConfigMode { Default, Global, Clean, }; void setConfigMode(ConfigMode mode); struct GameInstallDir { std::filesystem::path path; bool enabled; }; enum HideCursorState : int { Never, Idle, Always }; void load(const std::filesystem::path& path, bool is_game_specific = false); void save(const std::filesystem::path& path, bool is_game_specific = false); void resetGameSpecificValue(std::string entry); bool getGameRunning(); void setGameRunning(bool running); int getVolumeSlider(); void setVolumeSlider(int volumeValue, bool is_game_specific = false); std::string getTrophyKey(); void setTrophyKey(std::string key); u32 getWindowWidth(); u32 getWindowHeight(); void setWindowWidth(u32 width, bool is_game_specific = false); void setWindowHeight(u32 height, bool is_game_specific = false); u32 getInternalScreenWidth(); u32 getInternalScreenHeight(); void setInternalScreenWidth(u32 width); void setInternalScreenHeight(u32 height); bool allowHDR(); void setAllowHDR(bool enable, bool is_game_specific = false); bool copyGPUCmdBuffers(); void setCopyGPUCmdBuffers(bool enable, bool is_game_specific = false); bool readbacks(); void setReadbacks(bool enable, bool is_game_specific = false); bool readbackLinearImages(); void setReadbackLinearImages(bool enable, bool is_game_specific = false); bool directMemoryAccess(); void setDirectMemoryAccess(bool enable, bool is_game_specific = false); bool dumpShaders(); void setDumpShaders(bool enable, bool is_game_specific = false); u32 vblankFreq(); void setVblankFreq(u32 value, bool is_game_specific = false); s16 getCursorState(); void setCursorState(s16 cursorState, bool is_game_specific = false); bool vkValidationEnabled(); void setVkValidation(bool enable, bool is_game_specific = false); bool vkValidationSyncEnabled(); void setVkSyncValidation(bool enable, bool is_game_specific = false); bool vkValidationGpuEnabled(); void setVkGpuValidation(bool enable, bool is_game_specific = false); bool vkValidationCoreEnabled(); void setVkCoreValidation(bool enable, bool is_game_specific = false); bool getVkCrashDiagnosticEnabled(); void setVkCrashDiagnosticEnabled(bool enable, bool is_game_specific = false); bool getVkHostMarkersEnabled(); void setVkHostMarkersEnabled(bool enable, bool is_game_specific = false); bool getVkGuestMarkersEnabled(); void setVkGuestMarkersEnabled(bool enable, bool is_game_specific = false); bool isRdocEnabled(); bool isPipelineCacheEnabled(); bool isPipelineCacheArchived(); void setRdocEnabled(bool enable, bool is_game_specific = false); void setPipelineCacheEnabled(bool enable, bool is_game_specific = false); void setPipelineCacheArchived(bool enable, bool is_game_specific = false); int getCursorHideTimeout(); std::string getMainOutputDevice(); void setMainOutputDevice(std::string device, bool is_game_specific = false); std::string getPadSpkOutputDevice(); void setPadSpkOutputDevice(std::string device, bool is_game_specific = false); std::string getMicDevice(); void setCursorHideTimeout(int newcursorHideTimeout, bool is_game_specific = false); void setMicDevice(std::string device, bool is_game_specific = false); u32 GetLanguage(); void setLanguage(u32 language, bool is_game_specific = false); void setUseSpecialPad(bool use); bool getUseSpecialPad(); void setSpecialPadClass(int type); int getSpecialPadClass(); bool patchShaders(); // no set bool fpsColor(); // no set bool getIsMotionControlsEnabled(); void setIsMotionControlsEnabled(bool use, bool is_game_specific = false); std::string getDefaultControllerID(); void setDefaultControllerID(std::string id); bool getBackgroundControllerInput(); void setBackgroundControllerInput(bool enable, bool is_game_specific = false); bool getFsrEnabled(); void setFsrEnabled(bool enable, bool is_game_specific = false); bool getRcasEnabled(); void setRcasEnabled(bool enable, bool is_game_specific = false); int getRcasAttenuation(); void setRcasAttenuation(int value, bool is_game_specific = false); void setUserName(const std::string& name, bool is_game_specific = false); bool getLoadAutoPatches(); void setLoadAutoPatches(bool enable); enum UsbBackendType : int { Real, SkylandersPortal, InfinityBase, DimensionsToypad }; int getUsbDeviceBackend(); void setUsbDeviceBackend(int value, bool is_game_specific = false); // TODO std::filesystem::path GetSaveDataPath(); std::string getUserName(int id); std::array const getUserNames(); bool GetUseUnifiedInputConfig(); void SetUseUnifiedInputConfig(bool use); bool GetOverrideControllerColor(); void SetOverrideControllerColor(bool enable); int* GetControllerCustomColor(); void SetControllerCustomColor(int r, int b, int g); void setSaveDataPath(const std::filesystem::path& path); void setDefaultValues(bool is_game_specific = false); constexpr std::string_view GetDefaultGlobalConfig(); std::filesystem::path GetFoolproofInputConfigFile(const std::string& game_id = ""); }; // namespace Config