From 73de8db99677b5799df0e24f2ebd4cbc1770e498 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 22 Nov 2021 05:57:54 -0800 Subject: [PATCH] softgpu: Fix stencil DECR on 5551. --- GPU/Software/DrawPixel.cpp | 8 +++++--- GPU/Software/FuncId.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GPU/Software/DrawPixel.cpp b/GPU/Software/DrawPixel.cpp index 0dc5174414..1f80d1c33a 100644 --- a/GPU/Software/DrawPixel.cpp +++ b/GPU/Software/DrawPixel.cpp @@ -179,7 +179,7 @@ static inline bool StencilTestPassed(const PixelFuncID &pixelID, u8 stencil) { if (pixelID.hasStencilTestMask) stencil &= gstate.getStencilTestMask(); u8 ref = pixelID.stencilTestRef; - switch (GEComparison(pixelID.stencilTestFunc)) { + switch (pixelID.StencilTestFunc()) { case GE_COMP_NEVER: return false; @@ -246,6 +246,8 @@ static inline u8 ApplyStencilOp(GEBufferFormat fmt, GEStencilOp op, u8 old_stenc if (old_stencil >= 0x10) return old_stencil - 0x10; break; + case GE_FORMAT_5551: + return 0; default: if (old_stencil != 0) return old_stencil - 1; @@ -460,7 +462,7 @@ inline void DrawSinglePixel(int x, int y, int z, int fog, const Vec4 &color SingleFunc GetSingleFunc(const PixelFuncID &id) { if (id.clearMode) { - switch (id.FBFormat()) { + switch (id.fbFormat) { case GE_FORMAT_565: return &DrawSinglePixel; case GE_FORMAT_5551: @@ -471,7 +473,7 @@ SingleFunc GetSingleFunc(const PixelFuncID &id) { return &DrawSinglePixel; } } - switch (id.FBFormat()) { + switch (id.fbFormat) { case GE_FORMAT_565: return &DrawSinglePixel; case GE_FORMAT_5551: diff --git a/GPU/Software/FuncId.cpp b/GPU/Software/FuncId.cpp index b0913c8daf..7ba9a09bbb 100644 --- a/GPU/Software/FuncId.cpp +++ b/GPU/Software/FuncId.cpp @@ -110,7 +110,7 @@ std::string DescribePixelFuncID(const PixelFuncID &id) { if (id.applyColorWriteMask) desc += "Msk:"; - switch (id.FBFormat()) { + switch (id.fbFormat) { case GE_FORMAT_565: desc += "5650:"; break; case GE_FORMAT_5551: desc += "5551:"; break; case GE_FORMAT_4444: desc += "4444:"; break;