Repository navigation
Expand file tree
/
Copy pathExport.cpp
More file actions
173 lines (147 loc) · 5.21 KB
/
Copy pathExport.cpp
File metadata and controls
173 lines (147 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <cstdlib>
#include "prx/libc/include/Shutdown.hpp"
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"
#include "prx/libSceSystemService/SystemService.hpp"
extern "C" {
int APS5_VABI sceSystemServiceLoadExec(const char* path, const char* const* arguments) {
if (!path || !*path) return SYSTEM_SERVICE_ERROR_PARAMETER;
if (std::strcmp(path, "exit") != 0) {
NotImplemented_nid_no_patch("sceSystemServiceLoadExec: executable replacement");
}
(void)arguments;
LibcRunShutdown_nid_postfix();
std::exit(0);
}
int APS5_VABI sceSystemServiceDisableNoticeScreenSkipFlagAutoSet(void) {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceGetDisplaySafeAreaInfo(SystemServiceDisplaySafeAreaInfo* info) {
if (info == nullptr) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
*info = SystemServiceDisplaySafeAreaInfo{};
info->ratio = 1.0f;
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceGetHdrToneMapLuminance(SystemServiceHdrToneMapLuminance* luminance) {
if (luminance == nullptr) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
constexpr float SdrReferenceWhiteNits = 100.0f;
luminance->max_full_frame_tone_map_luminance = SdrReferenceWhiteNits;
luminance->max_tone_map_luminance = SdrReferenceWhiteNits;
luminance->min_tone_map_luminance = 0.0f;
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceGetNoticeScreenSkipFlag(bool* value) {
if (value == nullptr) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
*value = false;
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceGetStatus(SystemServiceStatus* status) {
if (status == nullptr) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
*status = SystemServiceStatus{};
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceHideSplashScreen(void) {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceParamGetInt(int paramId, int* value) {
if (value == nullptr) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
switch (paramId) {
case SYSTEM_SERVICE_PARAM_ID_LANG: *value = SYSTEM_SERVICE_PARAM_LANG_ENGLISH_US; break;
case SYSTEM_SERVICE_PARAM_ID_DATE_FORMAT: *value = SYSTEM_SERVICE_PARAM_DATE_FORMAT_DDMMYYYY; break;
case SYSTEM_SERVICE_PARAM_ID_TIME_FORMAT: *value = SYSTEM_SERVICE_PARAM_TIME_FORMAT_24HOUR; break;
case SYSTEM_SERVICE_PARAM_ID_TIME_ZONE: *value = 0; break;
case SYSTEM_SERVICE_PARAM_ID_SUMMERTIME: *value = 0; break;
case SYSTEM_SERVICE_PARAM_ID_GAME_PARENTAL_LEVEL: *value = SYSTEM_SERVICE_PARAM_GAME_PARENTAL_OFF; break;
case SYSTEM_SERVICE_PARAM_ID_ENTER_BUTTON_ASSIGN: *value = SYSTEM_SERVICE_PARAM_ENTER_BUTTON_CROSS; break;
default: *value = 0; break;
}
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceParamGetString(int paramId, char* buf, size_t bufSize) {
if (buf == nullptr || bufSize == 0) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
if (paramId != SYSTEM_SERVICE_PARAM_ID_SYSTEM_NAME) {
NotImplemented_nid_no_patch("sceSystemServiceParamGetString: parameter other than the system name");
}
if (bufSize < SYSTEM_SERVICE_MAX_SYSTEM_NAME_LENGTH) {
NotImplemented_nid_no_patch("sceSystemServiceParamGetString: buffer shorter than 65 bytes");
}
constexpr char SystemName[] = "PS5";
std::memcpy(buf, SystemName, sizeof(SystemName));
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServicePowerTick(void) {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceReceiveEvent(SystemServiceEvent* event) {
if (event == nullptr) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
return SYSTEM_SERVICE_ERROR_NO_EVENT;
}
int APS5_VABI sceSystemServiceReportAbnormalTermination(const void* info) {
(void)info;
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceSetNoticeScreenSkipFlag(void) {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceInitializePlayerDialogParam(void* param) {
if (param == nullptr) return SYSTEM_SERVICE_ERROR_PARAMETER;
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceDisableMediaPlay() {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceReenableMediaPlay() {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceLaunchPlayerDialog(const void* param) {
if (param == nullptr) return SYSTEM_SERVICE_ERROR_PARAMETER;
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceDisableMusicPlayer(void) {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceOpenChallengeActivity(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceSystemServiceOpenTournamentOccurrence(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceSystemServiceReenableMusicPlayer(void) {
return SYSTEM_SERVICE_OK;
}
int APS5_VABI sceSystemServiceShowControllerSettings(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceSystemServiceGetAppIdOfRunningBigApp(void) {
return SYSTEM_SERVICE_RUNNING_APP_ID;
}
int APS5_VABI sceSystemServiceKillApp(int appId, int how, int reason, int coreDump) {
if (appId != SYSTEM_SERVICE_RUNNING_APP_ID) {
NotImplemented_nid_no_patch("sceSystemServiceKillApp: application other than the running title");
}
if (how != -1 || reason != 0 || coreDump != 0) {
NotImplemented_nid_no_patch("sceSystemServiceKillApp: arguments other than -1, 0 and 0");
}
LibcExit_nid_no_patch(0);
}
}