diff --git a/core/libs/prx/libSceAgc/Predication/src/Predication.cpp b/core/libs/prx/libSceAgc/Predication/src/Predication.cpp index 586b40e41..dcaad59b9 100644 --- a/core/libs/prx/libSceAgc/Predication/src/Predication.cpp +++ b/core/libs/prx/libSceAgc/Predication/src/Predication.cpp @@ -23,7 +23,7 @@ int APS5_VABI sceAgcSetRangePredication(uint32_t* start, const volatile uint32_t auto* packet = start; while (packet < end) { const auto type = packet[0] >> 30u; - if (type == 2u) { + if (type == 2u || (packet[0] & 0x3fffff00u) == 0x3fff1000u) { ++packet; continue; } diff --git a/core/libs/prx/libSceAgc/tests/Predication.cpp b/core/libs/prx/libSceAgc/tests/Predication.cpp index b01d77ad2..32a6619ed 100644 --- a/core/libs/prx/libSceAgc/tests/Predication.cpp +++ b/core/libs/prx/libSceAgc/tests/Predication.cpp @@ -65,12 +65,13 @@ void testRange() { Storage storage; auto* first = sceAgcDcbSetIndexCount(&storage.buffer, 3); *storage.buffer.cursor_up++ = 0x80000000u; + *storage.buffer.cursor_up++ = 0xffff1000u; auto* second = sceAgcDcbSetIndexBuffer(&storage.buffer, 0x1000); auto* third = sceAgcDcbSetIndexCount(&storage.buffer, 5); const std::array headers{first[0], second[0], third[0]}; check(sceAgcSetRangePredication(first, storage.buffer.cursor_up, 1) == 0, "range predication failed"); check(first[0] == (headers[0] | 1u) && second[0] == (headers[1] | 1u) && third[0] == (headers[2] | 1u), "range did not predicate every packet"); - check(first[2] == 0x80000000u && second[1] == 0x1000u && third[1] == 5u, "range predication changed a payload or filler"); + check(first[2] == 0x80000000u && first[3] == 0xffff1000u && second[1] == 0x1000u && third[1] == 5u, "range predication changed a payload, filler or pad"); check(sceAgcSetRangePredication(second, third, 0) == 0 && second[0] == headers[1] && third[0] == (headers[2] | 1u), "range end is not exclusive"); check(sceAgcSetRangePredication(first, first, 0) == 0 && first[0] == (headers[0] | 1u), "empty range changed a packet"); expectFailure([&] { sceAgcSetRangePredication(first, first + 1, 1); });