From ae2bc8182f9a4957caf31bc57b87e26416cf8254 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Fri, 12 May 2023 10:13:48 +0200 Subject: [PATCH] pvr: FB_W_CTRL.fb_alpha_threshold comparison is greater or equal Fixes black tile under player feet in Izumo. Force CopyToVRAM. Issue #1040 --- core/emulator.cpp | 4 +++- core/rend/TexCache.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/emulator.cpp b/core/emulator.cpp index 4d1c0d451..9a2eea659 100644 --- a/core/emulator.cpp +++ b/core/emulator.cpp @@ -101,7 +101,9 @@ static void loadSpecialSettings() // Shenmue (EU) || prod_id == "MK-5105950" // Shenmue (JP) - || prod_id == "HDR-0016") + || prod_id == "HDR-0016" + // Izumo + || prod_id == "T46902M") { INFO_LOG(BOOT, "Enabling RTT Copy to VRAM for game %s", prod_id.c_str()); config::RenderToTextureBuffer.override(true); diff --git a/core/rend/TexCache.cpp b/core/rend/TexCache.cpp index 52dc491fd..df2b972ee 100644 --- a/core/rend/TexCache.cpp +++ b/core/rend/TexCache.cpp @@ -987,7 +987,7 @@ void WriteTextureToVRam(u32 width, u32 height, const u8 *data, u16 *dst, FB_W_CT break; case 3://0x3 1555 ARGB 16 bit The alpha value is determined by comparison with the value of fb_alpha_threshold. for (u32 c = 0; c < width; c++) { - *dst++ = (((p[Red] >> 3) & 0x1F) << 10) | (((p[Green] >> 3) & 0x1F) << 5) | ((p[Blue] >> 3) & 0x1F) | (p[Alpha] > fb_alpha_threshold ? 0x8000 : 0); + *dst++ = (((p[Red] >> 3) & 0x1F) << 10) | (((p[Green] >> 3) & 0x1F) << 5) | ((p[Blue] >> 3) & 0x1F) | (p[Alpha] >= fb_alpha_threshold ? 0x8000 : 0); p += 4; } break; @@ -1085,7 +1085,7 @@ void WriteFramebuffer(u32 width, u32 height, const u8 *data, u32 dstAddr, FB_W_C pvr_write32p(dstAddr, (u16)((roundColor<5>(p[Red]) << 10) | (roundColor<5>(p[Green]) << 5) | roundColor<5>(p[Blue]) - | (p[Alpha] > fb_alpha_threshold ? 0x8000 : 0))); + | (p[Alpha] >= fb_alpha_threshold ? 0x8000 : 0))); p += 4; dstAddr += bpp; }