Repository navigation
Expand file tree
/
Copy pathUnimplemented.cpp
More file actions
250 lines (195 loc) · 6.07 KB
/
Copy pathUnimplemented.cpp
File metadata and controls
250 lines (195 loc) · 6.07 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#include "prx/libSceAgcDriver/include/AgcDriver.hpp"
#include <cstdint>
#include <cstddef>
#include <cstring>
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"
namespace {
constexpr int DEBUG_UNAVAILABLE = static_cast<int>(0x8A6C1000);
constexpr int DRIVER_FEATURE_UNAVAILABLE = static_cast<int>(0x8A6D0001);
constexpr int DRIVER_NULL_OUTPUT = static_cast<int>(0x8A6D0003);
constexpr int GPU_RESET_UNAVAILABLE = static_cast<int>(0x8A6C0045);
constexpr int MODULE_REGISTRATION_FAILED = static_cast<int>(0x8A6D0003);
constexpr std::size_t TOOL_MEMORY_RANGE_SIZE = 12;
}
extern "C" {
int APS5_VABI sceAgcDriverGetShaderDebuggingStatus() {
return 1;
}
int APS5_VABI sceAgcDriverRegisterDefaultOwner(uint32_t owner) {
(void)owner;
return 0;
}
int APS5_VABI sceAgcDriverSetValidationErrorOutputFrequency(uint32_t frequency) {
(void)frequency;
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSetSubmitValidationMode(uint32_t mode) {
(void)mode;
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetSubmitValidationConfig(void* config) {
(void)config;
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetSubmitValidationMode(uint32_t* mode) {
(void)mode;
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSetSubmitValidationConfig(const void* config) {
(void)config;
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetHsOffchipParam(uint16_t* first, uint16_t* second) {
(void)first;
(void)second;
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverNopDataWritePacket(void* destination, uint32_t address, const void* data, uint32_t bytes) {
const auto alignedBytes = (static_cast<std::uint64_t>(bytes) + 3) & ~std::uint64_t{3};
const auto totalBytes = alignedBytes + 8;
std::memset(destination, 0, static_cast<std::size_t>(totalBytes));
const auto header = (static_cast<std::uint32_t>(totalBytes) << 14) + 0x3ffe0000U | 0xc0001000U;
std::memcpy(destination, &header, sizeof(header));
std::memcpy(static_cast<std::byte*>(destination) + 4, &address, sizeof(address));
if (data != nullptr && bytes != 0) std::memcpy(static_cast<std::byte*>(destination) + 8, data, bytes);
return data == nullptr || bytes == 0 ? 2 : static_cast<int>(totalBytes / 4);
}
int APS5_VABI sceAgcDriverSetValidationDisabled() {
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetCaptureConfig() {
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSetCaptureConfig() {
return DEBUG_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetGpuPrintfWorkArea() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSetGpuPrintfEnabled() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverDbgReadRegister() {
return 0;
}
int APS5_VABI sceAgcDriverDbgWriteRegister() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetGpuRefClks() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverIsSuspendPointInFlight() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverIsPaDebug() {
return 0;
}
int APS5_VABI sceAgcDriverGetExceptionStatus() {
return 0;
}
int APS5_VABI sceAgcDriverGetTraceInitiator() {
return 0;
}
int APS5_VABI sceAgcDriverRegisterGpuResetCallbacks() {
return 0;
}
int APS5_VABI sceAgcDriverUnregisterGpuResetCallbacks() {
return 0;
}
int APS5_VABI sceAgdResetGpu() {
return GPU_RESET_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSysSubmitFlipHandleProxy() {
return 0;
}
int APS5_VABI sceAgcDriverUserDataImmediateWrite() {
return 0;
}
int APS5_VABI sceAgcDriverUserDataImmediateWritePacket() {
return 0;
}
int APS5_VABI sceAgcDriverGetCoredumpMode(uint32_t* mode) {
if (mode == nullptr) return DRIVER_NULL_OUTPUT;
*mode = 0;
return 0;
}
int APS5_VABI sceAgcDriverAllocateToolMemoryForGpuReset(uint64_t, uint64_t, uint64_t, void* range) {
if (range != nullptr) std::memset(range, 0, TOOL_MEMORY_RANGE_SIZE);
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetAllocatedToolMemoryForGpuReset(uint64_t, void* range) {
if (range != nullptr) std::memset(range, 0, TOOL_MEMORY_RANGE_SIZE);
return DRIVER_FEATURE_UNAVAILABLE;
}
}
extern "C" {
int APS5_VABI sceAgcDriverAcquireHDRScopesACQ() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
void* APS5_VABI sceAgcDriverGetCoredumpAddress() {
return nullptr;
}
int APS5_VABI sceAgcDriverHp3dLockEnd() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverHp3dLockStart() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverIsEsvmProcess() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverReleaseHDRScopesACQ() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverSetTargetRingForDiag() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverAcquireRazorACQ() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverGetPaDebugInterfaceVersion() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSetHsOffchipParamDirect() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSubmitMultiCommandBuffersDirect() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSubmitToRazorACQ() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverSuspendPointSubmitDirect() {
return DRIVER_FEATURE_UNAVAILABLE;
}
int APS5_VABI sceAgcDriverModuleRegistration() {
return MODULE_REGISTRATION_FAILED;
}
int APS5_VABI sceAgcDriverSetValueToSharedGds() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverSetWorkloadStreamInactive() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverSubmitReprojectionAcb() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverSuspendPointSubmitCdbg() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceAgcDriverSysGetGfxAppGpuResetStatus() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
}