mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-25 03:09:13 +01:00
The jitted GE_LOGIC_NAND ANDed into temp1Reg, which is uninitialized at that point and whose result is never read - leaving just the NOT, i.e. COPY_INVERTED rather than ~(new & old). Every bit where new is 1 and old is 0 came out inverted. It differed between x86-64 (which has the pixel JIT) and ARM64/UWP/x86 (which don't), and even within one x86-64 run, since GetSingleFunc falls back to the C++ path when it has to queue a compile. Subtractive blending clamped to 0 on SSE and in the JIT (PSUBUSW) but not on NEON (vqsubq saturates at INT_MIN) or the generic path. Normally invisible because ToRGB() clamps at the end - except the caller adds the dither value in between, so an underflowing dithered pixel came out up to 7/255 brighter on x86 than on ARM64. Clamp in all paths. stencil << 24 is signed overflow for stencil >= 128, which is the common case, not an edge case. Cast to u32 - SetPixelStencil already does this correctly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vd8ntC2brCUtCrDJMqLbs8