mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
Update Packet.cpp
validated count-replacement helper.
This commit is contained in:
@@ -159,4 +159,11 @@ void PatchIndirectCount(std::uint32_t* packet, std::uint32_t opcode, std::uint32
|
||||
packet[4] += count;
|
||||
}
|
||||
|
||||
void SetIndirectCount(std::uint32_t* packet, std::uint32_t opcode, std::uint32_t count, const char* function) {
|
||||
ValidatePacket(packet, opcode, 5, function);
|
||||
Require(packet[3] == 0x80000000u && packet[4] <= 0x3fffu, function, "invalid indirect register packet");
|
||||
CheckBits(count, 0x3fffu, function);
|
||||
packet[4] = count;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user