mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-31 12:35:51 +00:00
feat(libSceGnmDriverForNeoMode): write the compute semaphore and address wait packets
This commit is contained in:
1 parent
69c273a101
commit
4a080ff525
1 file changed
+19
-4
@@ -75,13 +75,28 @@ int APS5_VABI sceGnmBeginWorkload(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceGnmComputeWaitOnAddress(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
int APS5_VABI sceGnmComputeWaitOnAddress(std::uint32_t* cmdbuf, std::uint32_t size, std::uint64_t address, std::uint32_t mask, std::uint32_t compare, std::uint32_t reference) {
|
||||
if (!cmdbuf || size != 14) return CommandFailed;
|
||||
auto* at = Nop(cmdbuf, 3);
|
||||
const bool memory = address > 0xffff;
|
||||
at[0] = Header(0x3c, 6);
|
||||
at[1] = (memory ? 1u << 4 : 0u) | (compare & 7);
|
||||
at[2] = static_cast<std::uint32_t>(address & (memory ? 0xfffffffcu : 0xffffu));
|
||||
at[3] = static_cast<std::uint32_t>(address >> 32);
|
||||
at[4] = reference;
|
||||
at[5] = mask;
|
||||
at[6] = 10;
|
||||
Nop(at + 7, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceGnmComputeWaitSemaphore(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
int APS5_VABI sceGnmComputeWaitSemaphore(std::uint32_t* cmdbuf, std::uint32_t size, std::uint64_t semaphoreAddress, std::uint32_t flags) {
|
||||
if (!cmdbuf || size != 10) return CommandFailed;
|
||||
auto* at = Nop(cmdbuf, 3);
|
||||
at[0] = Header(0x39, 2);
|
||||
at[1] = static_cast<std::uint32_t>(semaphoreAddress);
|
||||
at[2] = (flags == 1 ? 0x100000u : 0u) - 0x20000000u + static_cast<std::uint32_t>(semaphoreAddress >> 32);
|
||||
Nop(at + 3, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user