diff --git a/GPU/Software/DrawPixelX86.cpp b/GPU/Software/DrawPixelX86.cpp index c8a98ca3e8..cf670a3dc9 100644 --- a/GPU/Software/DrawPixelX86.cpp +++ b/GPU/Software/DrawPixelX86.cpp @@ -1382,19 +1382,18 @@ bool PixelJitCache::Jit_Dither(const PixelFuncID &id) { MOVSX(32, 8, valueReg, R(valueReg)); SAR(8, R(valueReg), Imm8(4)); #else - // Sum up (x + y * 4) * 2 + ditherMatrix offset to valueReg. - SHL(32, R(argXReg), Imm8(1)); - LEA(32, valueReg, MComplex(argXReg, valueReg, 8, offsetof(PixelFuncID, cached.ditherMatrix))); + // Sum up (x + y * 4) + ditherMatrix offset to valueReg. + LEA(32, valueReg, MComplex(argXReg, valueReg, 4, offsetof(PixelFuncID, cached.ditherMatrix))); // Okay, now abuse argXReg to read the PixelFuncID pointer on the stack. if (regCache_.Has(RegCache::GEN_ARG_ID)) { X64Reg idReg = regCache_.Find(RegCache::GEN_ARG_ID); - MOVSX(32, 16, valueReg, MRegSum(idReg, valueReg)); + MOVSX(32, 8, valueReg, MRegSum(idReg, valueReg)); regCache_.Unlock(idReg, RegCache::GEN_ARG_ID); } else { _assert_(stackIDOffset_ != -1); MOV(PTRBITS, R(argXReg), MDisp(RSP, stackIDOffset_)); - MOVSX(32, 16, valueReg, MRegSum(argXReg, valueReg)); + MOVSX(32, 8, valueReg, MRegSum(argXReg, valueReg)); } #endif if (argXReg != INVALID_REG) { diff --git a/GPU/Software/FuncId.h b/GPU/Software/FuncId.h index 565860f15d..c36df1bfdc 100644 --- a/GPU/Software/FuncId.h +++ b/GPU/Software/FuncId.h @@ -35,7 +35,7 @@ struct PixelFuncID { struct { // Warning: these are not hashed or compared for equal. Just cached values. uint32_t colorWriteMask{}; - int16_t ditherMatrix[16]{}; + int8_t ditherMatrix[16]{}; } cached; #endif