pvr: FB_W_CTRL.fb_alpha_threshold comparison is greater or equal

Fixes black tile under player feet in Izumo.
Force CopyToVRAM.
Issue #1040
This commit is contained in:
Flyinghead 2023-05-12 10:13:48 +02:00
parent d9ec14e048
commit ae2bc8182f
2 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}