Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/ConfigValues.h
3185 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
#ifndef _MSC_VER
24
#include <strings.h>
25
#endif
26
#include "Common/Common.h"
27
#include "Common/CommonFuncs.h"
28
29
constexpr int PSP_MODEL_FAT = 0;
30
constexpr int PSP_MODEL_SLIM = 1;
31
constexpr int PSP_DEFAULT_FIRMWARE = 660;
32
constexpr int VOLUME_OFF = 0;
33
constexpr int VOLUME_FULL = 10;
34
constexpr int VOLUMEHI_FULL = 100; // for newer volume params. will convert them all later
35
constexpr int AUDIOSAMPLES_MIN = 0;
36
constexpr int AUDIOSAMPLES_MAX = 2048;
37
38
// This matches exactly the old shift-based curve.
39
float Volume10ToMultiplier(int volume);
40
41
// NOTE: This is used for new volume parameters.
42
// It uses a more intuitive-feeling curve.
43
float Volume100ToMultiplier(int volume);
44
45
// Used for migration from the old settings.
46
int MultiplierToVolume100(float multiplier);
47
48
float UIScaleFactorToMultiplier(int factor);
49
50
struct ConfigTouchPos {
51
float x;
52
float y;
53
float scale;
54
// Note: Show is not used for all settings.
55
bool show;
56
};
57
58
struct ConfigCustomButton {
59
uint64_t key;
60
int image;
61
int shape;
62
bool toggle;
63
bool repeat;
64
};
65
66
enum class CPUCore {
67
INTERPRETER = 0,
68
JIT = 1,
69
IR_INTERPRETER = 2,
70
JIT_IR = 3,
71
};
72
73
enum {
74
ROTATION_AUTO = 0,
75
ROTATION_LOCKED_HORIZONTAL = 1,
76
ROTATION_LOCKED_VERTICAL = 2,
77
ROTATION_LOCKED_HORIZONTAL180 = 3,
78
ROTATION_LOCKED_VERTICAL180 = 4,
79
ROTATION_AUTO_HORIZONTAL = 5,
80
};
81
82
enum TextureFiltering {
83
TEX_FILTER_AUTO = 1,
84
TEX_FILTER_FORCE_NEAREST = 2,
85
TEX_FILTER_FORCE_LINEAR = 3,
86
TEX_FILTER_AUTO_MAX_QUALITY = 4,
87
};
88
89
enum ReplacementTextureLoadSpeed {
90
SLOW = 0,
91
MEDIUM = 1,
92
FAST = 2,
93
INSTANT = 3,
94
};
95
96
enum BufferFilter {
97
SCALE_LINEAR = 1,
98
SCALE_NEAREST = 2,
99
};
100
101
enum class ScreenshotMode {
102
FinalOutput = 0,
103
GameImage = 1,
104
};
105
106
// Software is not among these because it will have one of these perform the blit to display.
107
enum class GPUBackend {
108
OPENGL = 0,
109
DIRECT3D11 = 2,
110
VULKAN = 3,
111
};
112
113
enum class DepthRasterMode {
114
DEFAULT = 0,
115
LOW_QUALITY = 1,
116
OFF = 2,
117
FORCE_ON = 3,
118
};
119
120
enum class RestoreSettingsBits : int {
121
SETTINGS = 1,
122
CONTROLS = 2,
123
RECENT = 4,
124
};
125
ENUM_CLASS_BITOPS(RestoreSettingsBits);
126
127
// Modules that are candidates for disabling HLE of.
128
enum class DisableHLEFlags : int {
129
sceFont = (1 << 0),
130
sceAtrac = (1 << 1),
131
scePsmf = (1 << 2),
132
scePsmfPlayer = (1 << 3),
133
sceMpeg = (1 << 4),
134
sceMp3 = (1 << 5),
135
sceParseHttp = (1 << 6),
136
sceCcc = (1 << 7), // character conversion library.
137
Count = 8,
138
// TODO: Some of the networking libraries may be interesting candidates, like HTTP.
139
};
140
ENUM_CLASS_BITOPS(DisableHLEFlags);
141
142
std::string GPUBackendToString(GPUBackend backend);
143
GPUBackend GPUBackendFromString(std::string_view backend);
144
145
// For iIOTimingMethod.
146
enum IOTimingMethods {
147
IOTIMING_FAST = 0,
148
IOTIMING_HOST = 1,
149
IOTIMING_REALISTIC = 2,
150
IOTIMING_UMDSLOWREALISTIC = 3,
151
};
152
153
enum class AutoLoadSaveState {
154
OFF = 0,
155
OLDEST = 1,
156
NEWEST = 2,
157
};
158
159
enum class FastForwardMode {
160
CONTINUOUS = 0,
161
SKIP_FLIP = 2,
162
};
163
164
enum class BackgroundAnimation {
165
OFF = 0,
166
FLOATING_SYMBOLS = 1,
167
RECENT_GAMES = 2,
168
WAVE = 3,
169
MOVING_BACKGROUND = 4,
170
BOUNCING_ICON = 5,
171
FLOATING_SYMBOLS_COLORED = 6,
172
};
173
174
// iOS only
175
enum class AppSwitchMode {
176
SINGLE_SWIPE_NO_INDICATOR = 0,
177
DOUBLE_SWIPE_INDICATOR = 1,
178
};
179
180
// for Config.iShowStatusFlags
181
enum class ShowStatusFlags {
182
FPS_COUNTER = 1 << 1,
183
SPEED_COUNTER = 1 << 2,
184
BATTERY_PERCENT = 1 << 3,
185
};
186
187
enum class SplineQuality {
188
LOW_QUALITY = 0,
189
MEDIUM_QUALITY = 1,
190
HIGH_QUALITY = 2,
191
};
192
193
enum class DumpFileType {
194
EBOOT = (1 << 0),
195
PRX = (1 << 1),
196
Atrac3 = (1 << 2),
197
};
198
ENUM_CLASS_BITOPS(DumpFileType);
199
200
// for iTiltInputType
201
enum TiltTypes {
202
TILT_NULL = 0,
203
TILT_ANALOG,
204
TILT_DPAD,
205
TILT_ACTION_BUTTON,
206
TILT_TRIGGER_BUTTONS,
207
};
208
209
enum class ScreenEdgePosition {
210
BOTTOM_LEFT = 0,
211
BOTTOM_CENTER = 1,
212
BOTTOM_RIGHT = 2,
213
TOP_LEFT = 3,
214
TOP_CENTER = 4,
215
TOP_RIGHT = 5,
216
CENTER_LEFT = 6,
217
CENTER_RIGHT = 7,
218
CENTER = 8, // Used for REALLY important messages! Not RetroAchievements notifications.
219
VALUE_COUNT,
220
};
221
222
enum class DebugOverlay : int {
223
OFF,
224
DEBUG_STATS,
225
FRAME_GRAPH,
226
FRAME_TIMING,
227
#ifdef USE_PROFILER
228
FRAME_PROFILE,
229
#endif
230
CONTROL,
231
Audio,
232
GPU_PROFILE,
233
GPU_ALLOCATOR,
234
FRAMEBUFFER_LIST,
235
};
236
237
// Android-only for now
238
enum class DisplayFramerateMode : int {
239
DEFAULT,
240
REQUEST_60HZ,
241
FORCE_60HZ_METHOD1,
242
FORCE_60HZ_METHOD2,
243
};
244
245
enum class SkipGPUReadbackMode : int {
246
NO_SKIP,
247
SKIP,
248
COPY_TO_TEXTURE,
249
};
250
251
enum class RemoteISOShareType : int {
252
RECENT,
253
LOCAL_FOLDER,
254
};
255
256