diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp index b91dc9a7a..743f06a4b 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp @@ -313,7 +313,7 @@ DecodedColorFormat DecodeColorFormat(std::uint32_t format, std::uint32_t number, void intersect(VkRect2D& result, const Registers& registers, std::uint32_t offset, bool screen) { const auto tl = read(registers, offset); const auto br = read(registers, offset + 1); - if (!screen) Require((tl & 0x80008000u) == 0x80000000u && (br & 0x80008000u) == 0, "scissor window offsets or reserved bits are unsupported"); + if (!screen) Require((tl & 0x8000u) == 0 && (br & 0x80008000u) == 0, "scissor reserved bits are unsupported"); const auto x = tl & 0xffffu; const auto y = (tl >> 16u) & (screen ? 0xffffu : 0x7fffu); const auto right = br & 0xffffu; diff --git a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp index c5e2ff5f2..e823c75a6 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp @@ -113,6 +113,12 @@ void stateTests() { queue.context[0x91] = 0x30020; state = AgcDriver::Graphics::DecodeState(queue); Require(state.scissor.offset.x == 3 && state.scissor.offset.y == 1 && state.scissor.extent.width == 29 && state.scissor.extent.height == 2, "scissor intersection changed"); + queue.context[0x90] = 0x10003; + state = AgcDriver::Graphics::DecodeState(queue); + Require(state.scissor.offset.x == 3 && state.scissor.offset.y == 1 && state.scissor.extent.width == 29 && state.scissor.extent.height == 2, "a scissor that applies the zero window offset changed"); + queue.context[0x90] = 0x80008000; + expectFailure([&] { AgcDriver::Graphics::DecodeState(queue); }, "scissor reserved bits"); + queue.context[0x90] = 0x80010003; queue.context[0x31c] |= 0x10000000; queue.context[0x325] = 0x1234; Require(AgcDriver::Graphics::DecodeState(queue).color.dccAddress == 0x123400, "DCC key address decode changed");