Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions core/libs/prx/libSceAgcDriver/State/src/Status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"

static constexpr int SCE_AGC_DRIVER_ERROR_DEBUG_UNAVAILABLE = static_cast<int>(0x8A6C1000);

extern "C" {

bool APS5_VABI sceAgcDriverIsCaptureInProgress(void) {
Expand All @@ -19,6 +21,31 @@ bool APS5_VABI sceAgcDriverIsSubmitValidationEnabled(void) {
return false;
}

int APS5_VABI sceAgcDriverSetSubmitValidationMode(uint32_t mode) {
(void)mode;
return SCE_AGC_DRIVER_ERROR_DEBUG_UNAVAILABLE;
}

int APS5_VABI sceAgcDriverGetSubmitValidationMode(uint32_t* mode) {
(void)mode;
return SCE_AGC_DRIVER_ERROR_DEBUG_UNAVAILABLE;
}

int APS5_VABI sceAgcDriverSetSubmitValidationConfig(const void* config) {
(void)config;
return SCE_AGC_DRIVER_ERROR_DEBUG_UNAVAILABLE;
}

int APS5_VABI sceAgcDriverGetSubmitValidationConfig(void* config) {
(void)config;
return SCE_AGC_DRIVER_ERROR_DEBUG_UNAVAILABLE;
}

int APS5_VABI sceAgcDriverSetValidationErrorOutputFrequency(uint32_t frequency) {
(void)frequency;
return SCE_AGC_DRIVER_ERROR_DEBUG_UNAVAILABLE;
}

int APS5_VABI sceAgcDriverRequestCaptureStart(const char* path) {
(void)path;
NotImplemented_nid_no_patch(__func__);
Expand Down
25 changes: 0 additions & 25 deletions core/libs/prx/libSceAgcDriver/Unimplemented.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,4 @@ int APS5_VABI sceAgcDriverRegisterDefaultOwner(uint32_t* owner_handle) {
return static_cast<int>(0x8A6C9018);
}

int APS5_VABI sceAgcDriverSetValidationErrorOutputFrequency() {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceAgcDriverSetSubmitValidationMode() {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceAgcDriverGetSubmitValidationConfig() {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceAgcDriverGetSubmitValidationMode() {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceAgcDriverSetSubmitValidationConfig() {
NotImplemented_nid_no_patch(__func__);
return 0;
}

}
17 changes: 17 additions & 0 deletions core/libs/tests/GuestAgcDriverResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ int APS5_VABI sceAgcDriverFindResourcesPublic(const void*, void*);
bool APS5_VABI sceAgcDriverIsCaptureInProgress(void);
bool APS5_VABI sceAgcDriverIsTraceInProgress(void);
bool APS5_VABI sceAgcDriverIsSubmitValidationEnabled(void);
int APS5_VABI sceAgcDriverSetSubmitValidationMode(std::uint32_t);
int APS5_VABI sceAgcDriverGetSubmitValidationMode(std::uint32_t*);
int APS5_VABI sceAgcDriverSetSubmitValidationConfig(const void*);
int APS5_VABI sceAgcDriverGetSubmitValidationConfig(void*);
int APS5_VABI sceAgcDriverSetValidationErrorOutputFrequency(std::uint32_t);
}

static constexpr int Unavailable = static_cast<int>(0x8A6C9018);
static constexpr int DebugUnavailable = static_cast<int>(0x8A6C1000);
static void Require(bool value) { if (!value) std::abort(); }

struct ResourceDescriptor {
Expand Down Expand Up @@ -91,4 +97,15 @@ int main() {
Require(!sceAgcDriverIsCaptureInProgress());
Require(!sceAgcDriverIsTraceInProgress());
Require(!sceAgcDriverIsSubmitValidationEnabled());
std::uint32_t mode = 5u;
std::array<std::uint8_t, 64> config{};
config.fill(0x5a);
const auto originalConfig = config;
Require(sceAgcDriverSetSubmitValidationMode(1u) == DebugUnavailable);
Require(sceAgcDriverGetSubmitValidationMode(&mode) == DebugUnavailable);
Require(sceAgcDriverSetSubmitValidationConfig(config.data()) == DebugUnavailable);
Require(sceAgcDriverGetSubmitValidationConfig(config.data()) == DebugUnavailable);
Require(sceAgcDriverSetValidationErrorOutputFrequency(10u) == DebugUnavailable);
Require(mode == 5u && config == originalConfig);
Require(!sceAgcDriverIsSubmitValidationEnabled());
}
1 change: 1 addition & 0 deletions docs/dev/TechnicalDebt.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ Throughout the project, every function at every stage either **does exactly what
- [sceShareGetRunningStatus](../../core/libs/prx/libSceShare/Export.cpp) (libSceShare) - only the first 32-bit word of the status is known: PPSA01317 treats bits 0x3c of it as a running share feature and gives the call a 40-byte buffer. The host never records or broadcasts, so it stores 0 in that word and leaves the rest untouched; a null status returns `INVALID_PARAM` by analogy with `sceShareGetCurrentStatus`
- [sceShareSetContentParamForApplicationTitle](../../core/libs/prx/libSceShare/Export.cpp) (libSceShare) - imported by PPSA12544's Unity plugins; the signature follows [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/main/src/libs/libShare.cpp), not confirmed on a PS5 title. The application title is only checked for null, as KytyPS5 does, since nothing is captured
- [sceAgcDcbSetZPassPredicationEnableGetSize, sceAgcDcbSetPredicationDisableGetSize, sceAgcDcbSetBoolPredicationEnableGetSize](../../core/libs/prx/libSceAgc/DcbState/src/Predication.cpp) (libSceAgc) - the builders are inline in the SDK and not exported; the size is assumed to be that of the SET_PREDICATION packet `sceAgcDcbSetPredication` writes (16 bytes)
- [Submit validation](../../core/libs/prx/libSceAgcDriver/State/src/Status.cpp) (libSceAgcDriver) - `sceAgcDriverSetSubmitValidationMode`, `sceAgcDriverGetSubmitValidationMode`, `sceAgcDriverSetSubmitValidationConfig`, `sceAgcDriverGetSubmitValidationConfig` and `sceAgcDriverSetValidationErrorOutputFrequency` return `DEBUG_UNAVAILABLE` (`0x8A6C1000`) without reading their arguments, as `sceAgcDriverIsSubmitValidationEnabled` reports validation off. [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/main/src/game_compat.c) describes each of these exports in a title's bundled `libSceAgcDriver.sprx` as `mov eax, 0x8a6c1000; ret`; not checked against a console's system module. Their parameter lists follow OpenAGC and are not read
- [Resource registration](../../core/libs/prx/libSceAgcDriver/Resource/src/Registration.cpp) (libSceAgcDriver) - registration always fails with `RESOURCE_REGISTRATION_UNAVAILABLE`, so the owner and resource queries, `sceAgcDriverSetResourceUserData`, `sceAgcDriverFindResourcesPublic` and `sceAgcDriverUnregisterAllResourcesForOwner` return the same error without reading their arguments. Their parameter lists follow the libSceGnmDriver counterparts and are unverified. `sceAgcDriverGetResourceRegistrationMaxNameLength` writes 0xfc and returns 0, as [prosper](https://github.com/mattias800/prosper) does from a title's registration configuration; the `uint32_t*` parameter matches the SDK wrapper `sce::Agc::ResourceRegistration::getMaxNameLength(unsigned int*)`. sharpemu writes 256 and KytyPS5 returns `RESOURCE_REGISTRATION_UNAVAILABLE`, so the value is unverified; a null output throws
- [sceAgcDriverRegisterMultipleResources](../../core/libs/prx/libSceAgcDriver/Resource/src/Registration.cpp) uses the existing unavailable-registration state and leaves caller memory untouched. Its four arguments (uint32 handle output, uint32 owner, descriptor pointer, uint32 count) follow the original PPSA34502 / 01.010.000 codzm call. The caller builds 40-byte descriptors and explicitly accepts 0x8A6C9018 with an invalid output handle. Enabled registration and console argument-validation precedence are unverified.
- [Shader registration](../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp) (libSceAgcDriver) - a shader header is accepted at any address: PPSA26344 passes headers 4 and 1 bytes past an 8-byte boundary; whether the console refuses an alignment is unknown
Expand Down
Loading