Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/ConfigValues.h
5654 views
1
// Copyright (c) 2012- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include <cstdint>
21
#include <cmath>
22
#include <string>
23
#include <string_view>
24
#ifndef _MSC_VER
25
#include <strings.h>
26
#endif
27
#include "Common/Common.h"
28
#include "Common/CommonFuncs.h"
29
30
struct ConfigBlock {
31
virtual ~ConfigBlock() = default;
32
virtual bool CanResetToDefault() const { return false; }
33
// If a block returns false here (like Config itself does), resetting to default will happen by the old per-setting mechanism.
34
virtual bool ResetToDefault(std::string_view blockName) { return false; }
35
virtual size_t Size() const { return sizeof(ConfigBlock); } // For sanity checks
36
};
37
38
constexpr int PSP_MODEL_FAT = 0;
39
constexpr int PSP_MODEL_SLIM = 1;
40
constexpr int PSP_DEFAULT_FIRMWARE = 660;
41
constexpr int VOLUME_OFF = 0;
42
constexpr int VOLUME_FULL = 10;
43
constexpr int VOLUMEHI_FULL = 100; // for newer volume params. will convert them all later
44
constexpr int AUDIOSAMPLES_MIN = 0;
45
constexpr int AUDIOSAMPLES_MAX = 2048;
46
constexpr float NO_DEFAULT_FLOAT = -1000000.0f;
47
constexpr int NO_DEFAULT_INT = -1000000;
48
49
// This matches exactly the old shift-based curve.
50
float Volume10ToMultiplier(int volume);
51
52
// NOTE: This is used for new volume parameters.
53
// It uses a more intuitive-feeling curve.
54
float Volume100ToMultiplier(int volume);
55
56
// Used for migration from the old settings.
57
int MultiplierToVolume100(float multiplier);
58
59
float UIScaleFactorToMultiplier(int factor);
60
61
struct ConfigTouchPos {
62
float x = -1.0f;
63
float y = -1.0f;
64
float scale = 1.0f;
65
// Note: Show is not used for all settings.
66
bool show = true;
67
};
68
69
struct ConfigCustomButton {
70
uint64_t key;
71
int image;
72
int shape;
73
bool toggle;
74
bool repeat;
75
};
76
77
enum class CPUCore {
78
INTERPRETER = 0,
79
JIT = 1,
80
IR_INTERPRETER = 2,
81
JIT_IR = 3,
82
};
83
84
enum {
85
ROTATION_AUTO = 0,
86
ROTATION_LOCKED_HORIZONTAL = 1,
87
ROTATION_LOCKED_VERTICAL = 2,
88
ROTATION_LOCKED_HORIZONTAL180 = 3,
89
ROTATION_LOCKED_VERTICAL180 = 4, // Deprecated
90
ROTATION_AUTO_HORIZONTAL = 5, // Deprecated
91
};
92
93
enum TextureFiltering {
94
TEX_FILTER_AUTO = 1,
95
TEX_FILTER_FORCE_NEAREST = 2,
96
TEX_FILTER_FORCE_LINEAR = 3,
97
TEX_FILTER_AUTO_MAX_QUALITY = 4,
98
};
99
100
// Can't be named WindowState due to collision with SDL.
101
enum class WindowSizeState {
102
Normal = 0,
103
Minimized = 1,
104
Maximized = 2,
105
};
106
107
enum ReplacementTextureLoadSpeed {
108
SLOW = 0,
109
MEDIUM = 1,
110
FAST = 2,
111
INSTANT = 3,
112
};
113
114
enum BufferFilter {
115
SCALE_LINEAR = 1,
116
SCALE_NEAREST = 2,
117
};
118
119
enum class ScreenshotMode {
120
FinalOutput = 0,
121
GameImage = 1,
122
};
123
124
// Software is not among these because it will have one of these perform the blit to display.
125
enum class GPUBackend {
126
OPENGL = 0,
127
DIRECT3D11 = 2,
128
VULKAN = 3,
129
};
130
131
enum class DepthRasterMode {
132
DEFAULT = 0,
133
LOW_QUALITY = 1,
134
OFF = 2,
135
FORCE_ON = 3,
136
};
137
138
enum class AudioSyncMode {
139
GRANULAR = 0,
140
CLASSIC_PITCH = 1,
141
};
142
143
// TODO: We can make this more fine-grained.
144
enum class RestoreSettingsBits : int {
145
SETTINGS = 1,
146
CONTROLS = 2,
147
RECENT = 4,
148
};
149
ENUM_CLASS_BITOPS(RestoreSettingsBits);
150
151
// Modules that are candidates for disabling HLE of.
152
enum class DisableHLEFlags : int {
153
sceFont = (1 << 0),
154
sceAtrac = (1 << 1),
155
scePsmf = (1 << 2),
156
scePsmfPlayer = (1 << 3),
157
sceMpeg = (1 << 4),
158
sceMp3 = (1 << 5),
159
sceParseHttp = (1 << 6),
160
sceCcc = (1 << 7), // character conversion library.
161
Count = 8,
162
// TODO: Some of the networking libraries may be interesting candidates, like HTTP.
163
};
164
ENUM_CLASS_BITOPS(DisableHLEFlags);
165
166
std::string GPUBackendToString(GPUBackend backend);
167
GPUBackend GPUBackendFromString(std::string_view backend);
168
169
// For iIOTimingMethod.
170
enum IOTimingMethods {
171
IOTIMING_FAST = 0,
172
IOTIMING_HOST = 1,
173
IOTIMING_REALISTIC = 2,
174
IOTIMING_UMDSLOWREALISTIC = 3,
175
};
176
177
enum class AutoLoadSaveState {
178
OFF = 0,
179
OLDEST = 1,
180
NEWEST = 2,
181
};
182
183
enum class FastForwardMode {
184
CONTINUOUS = 0,
185
SKIP_FLIP = 2,
186
};
187
188
enum class BackgroundAnimation {
189
OFF = 0,
190
FLOATING_SYMBOLS = 1,
191
RECENT_GAMES = 2,
192
WAVE = 3,
193
MOVING_BACKGROUND = 4,
194
BOUNCING_ICON = 5,
195
FLOATING_SYMBOLS_COLORED = 6,
196
};
197
198
// iOS only
199
enum class AppSwitchMode {
200
SINGLE_SWIPE_NO_INDICATOR = 0,
201
DOUBLE_SWIPE_INDICATOR = 1,
202
};
203
204
// for Config.iShowStatusFlags
205
enum class ShowStatusFlags {
206
FPS_COUNTER = 1 << 1,
207
SPEED_COUNTER = 1 << 2,
208
BATTERY_PERCENT = 1 << 3,
209
};
210
211
enum class SplineQuality {
212
LOW_QUALITY = 0,
213
MEDIUM_QUALITY = 1,
214
HIGH_QUALITY = 2,
215
};
216
217
enum class DumpFileType {
218
EBOOT = (1 << 0),
219
PRX = (1 << 1),
220
Atrac3 = (1 << 2),
221
};
222
ENUM_CLASS_BITOPS(DumpFileType);
223
224
// for iTiltInputType
225
enum TiltTypes {
226
TILT_NULL = 0,
227
TILT_ANALOG,
228
TILT_DPAD,
229
TILT_ACTION_BUTTON,
230
TILT_TRIGGER_BUTTONS,
231
};
232
233
enum class ScreenEdgePosition {
234
BOTTOM_LEFT = 0,
235
BOTTOM_CENTER = 1,
236
BOTTOM_RIGHT = 2,
237
TOP_LEFT = 3,
238
TOP_CENTER = 4,
239
TOP_RIGHT = 5,
240
CENTER_LEFT = 6,
241
CENTER_RIGHT = 7,
242
CENTER = 8, // Used for REALLY important messages! Not RetroAchievements notifications.
243
VALUE_COUNT,
244
};
245
246
enum class DebugOverlay : int {
247
OFF,
248
DEBUG_STATS,
249
FRAME_GRAPH,
250
FRAME_TIMING,
251
#ifdef USE_PROFILER
252
FRAME_PROFILE,
253
#endif
254
CONTROL,
255
Audio,
256
GPU_PROFILE,
257
GPU_ALLOCATOR,
258
FRAMEBUFFER_LIST,
259
};
260
261
// Android-only for now
262
enum class DisplayFramerateMode : int {
263
DEFAULT,
264
REQUEST_60HZ,
265
FORCE_60HZ_METHOD1,
266
FORCE_60HZ_METHOD2,
267
};
268
269
enum class SkipGPUReadbackMode : int {
270
NO_SKIP,
271
SKIP,
272
COPY_TO_TEXTURE,
273
};
274
275
enum class RemoteISOShareType : int {
276
RECENT,
277
LOCAL_FOLDER,
278
};
279
280