Seregon/ShadPKG

A tool for deriving PKG packet encryption keys for ps4 written in c++

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