A tool for deriving PKG packet encryption keys for ps4 written in c++
| 1 | // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <filesystem> |
| 7 | #include <vector> |
| 8 | #include "shadpkg_types.h" |
| 9 | |
| 10 | namespace Config { |
| 11 | |
| 12 | enum HideCursorState : s16 { Never, Idle, Always }; |
| 13 | |
| 14 | void load(const std::filesystem::path& path); |
| 15 | void save(const std::filesystem::path& path); |
| 16 | void saveMainWindow(const std::filesystem::path& path); |
| 17 | |
| 18 | std::string getTrophyKey(); |
| 19 | void setTrophyKey(std::string key); |
| 20 | bool GetLoadGameSizeEnabled(); |
| 21 | std::filesystem::path GetSaveDataPath(); |
| 22 | void setLoadGameSizeEnabled(bool enable); |
| 23 | bool getIsFullscreen(); |
| 24 | std::string getFullscreenMode(); |
| 25 | bool isNeoModeConsole(); |
| 26 | bool getPlayBGM(); |
| 27 | int getBGMvolume(); |
| 28 | bool getisTrophyPopupDisabled(); |
| 29 | bool getEnableDiscordRPC(); |
| 30 | bool getSeparateUpdateEnabled(); |
| 31 | bool getCompatibilityEnabled(); |
| 32 | bool getCheckCompatibilityOnStartup(); |
| 33 | |
| 34 | std::string getLogFilter(); |
| 35 | std::string getLogType(); |
| 36 | std::string getUserName(); |
| 37 | std::string getUpdateChannel(); |
| 38 | std::string getChooseHomeTab(); |
| 39 | |
| 40 | u16 leftDeadZone(); |
| 41 | u16 rightDeadZone(); |
| 42 | s16 getCursorState(); |
| 43 | int getCursorHideTimeout(); |
| 44 | std::string getBackButtonBehavior(); |
| 45 | bool getUseSpecialPad(); |
| 46 | int getSpecialPadClass(); |
| 47 | bool getIsMotionControlsEnabled(); |
| 48 | |
| 49 | u32 getScreenWidth(); |
| 50 | u32 getScreenHeight(); |
| 51 | s32 getGpuId(); |
| 52 | |
| 53 | bool debugDump(); |
| 54 | bool collectShadersForDebug(); |
| 55 | bool showSplash(); |
| 56 | bool autoUpdate(); |
| 57 | bool nullGpu(); |
| 58 | bool copyGPUCmdBuffers(); |
| 59 | bool dumpShaders(); |
| 60 | bool patchShaders(); |
| 61 | bool isRdocEnabled(); |
| 62 | u32 vblankDiv(); |
| 63 | |
| 64 | void setDebugDump(bool enable); |
| 65 | void setCollectShaderForDebug(bool enable); |
| 66 | void setShowSplash(bool enable); |
| 67 | void setAutoUpdate(bool enable); |
| 68 | void setNullGpu(bool enable); |
| 69 | void setCopyGPUCmdBuffers(bool enable); |
| 70 | void setDumpShaders(bool enable); |
| 71 | void setVblankDiv(u32 value); |
| 72 | void setGpuId(s32 selectedGpuId); |
| 73 | void setScreenWidth(u32 width); |
| 74 | void setScreenHeight(u32 height); |
| 75 | void setIsFullscreen(bool enable); |
| 76 | void setFullscreenMode(std::string mode); |
| 77 | void setisTrophyPopupDisabled(bool disable); |
| 78 | void setPlayBGM(bool enable); |
| 79 | void setBGMvolume(int volume); |
| 80 | void setEnableDiscordRPC(bool enable); |
| 81 | void setLanguage(u32 language); |
| 82 | void setNeoMode(bool enable); |
| 83 | void setUserName(const std::string& type); |
| 84 | void setUpdateChannel(const std::string& type); |
| 85 | void setChooseHomeTab(const std::string& type); |
| 86 | void setSeparateUpdateEnabled(bool use); |
| 87 | void setGameInstallDirs(const std::vector<std::filesystem::path>& settings_install_dirs_config); |
| 88 | void setSaveDataPath(const std::filesystem::path& path); |
| 89 | void setCompatibilityEnabled(bool use); |
| 90 | void setCheckCompatibilityOnStartup(bool use); |
| 91 | |
| 92 | void setCursorState(s16 cursorState); |
| 93 | void setCursorHideTimeout(int newcursorHideTimeout); |
| 94 | void setBackButtonBehavior(const std::string& type); |
| 95 | void setUseSpecialPad(bool use); |
| 96 | void setSpecialPadClass(int type); |
| 97 | void setIsMotionControlsEnabled(bool use); |
| 98 | |
| 99 | void setLogType(const std::string& type); |
| 100 | void setLogFilter(const std::string& type); |
| 101 | |
| 102 | void setVkValidation(bool enable); |
| 103 | void setVkSyncValidation(bool enable); |
| 104 | void setRdocEnabled(bool enable); |
| 105 | |
| 106 | bool vkValidationEnabled(); |
| 107 | bool vkValidationSyncEnabled(); |
| 108 | bool vkValidationGpuEnabled(); |
| 109 | bool getVkCrashDiagnosticEnabled(); |
| 110 | bool getVkHostMarkersEnabled(); |
| 111 | bool getVkGuestMarkersEnabled(); |
| 112 | void setVkCrashDiagnosticEnabled(bool enable); |
| 113 | void setVkHostMarkersEnabled(bool enable); |
| 114 | void setVkGuestMarkersEnabled(bool enable); |
| 115 | |
| 116 | // Gui |
| 117 | void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h); |
| 118 | bool addGameInstallDir(const std::filesystem::path& dir); |
| 119 | void removeGameInstallDir(const std::filesystem::path& dir); |
| 120 | void setAddonInstallDir(const std::filesystem::path& dir); |
| 121 | void setMainWindowTheme(u32 theme); |
| 122 | void setIconSize(u32 size); |
| 123 | void setIconSizeGrid(u32 size); |
| 124 | void setSliderPosition(u32 pos); |
| 125 | void setSliderPositionGrid(u32 pos); |
| 126 | void setTableMode(u32 mode); |
| 127 | void setMainWindowWidth(u32 width); |
| 128 | void setMainWindowHeight(u32 height); |
| 129 | void setPkgViewer(const std::vector<std::string>& pkgList); |
| 130 | void setElfViewer(const std::vector<std::string>& elfList); |
| 131 | void setRecentFiles(const std::vector<std::string>& recentFiles); |
| 132 | void setEmulatorLanguage(std::string language); |
| 133 | |
| 134 | u32 getMainWindowGeometryX(); |
| 135 | u32 getMainWindowGeometryY(); |
| 136 | u32 getMainWindowGeometryW(); |
| 137 | u32 getMainWindowGeometryH(); |
| 138 | const std::vector<std::filesystem::path>& getGameInstallDirs(); |
| 139 | std::filesystem::path getAddonInstallDir(); |
| 140 | u32 getMainWindowTheme(); |
| 141 | u32 getIconSize(); |
| 142 | u32 getIconSizeGrid(); |
| 143 | u32 getSliderPosition(); |
| 144 | u32 getSliderPositionGrid(); |
| 145 | u32 getTableMode(); |
| 146 | u32 getMainWindowWidth(); |
| 147 | u32 getMainWindowHeight(); |
| 148 | std::vector<std::string> getPkgViewer(); |
| 149 | std::vector<std::string> getElfViewer(); |
| 150 | std::vector<std::string> getRecentFiles(); |
| 151 | std::string getEmulatorLanguage(); |
| 152 | |
| 153 | void setDefaultValues(); |
| 154 | |
| 155 | // settings |
| 156 | u32 GetLanguage(); |
| 157 | }; // namespace Config |
| 158 |