minor corrections

This commit is contained in:
Jaklyy 2024-04-24 22:26:33 -04:00
parent 0d3ca9fde1
commit ba451574ee

View file

@ -732,16 +732,15 @@ void SoftRenderer::RenderShadowMaskScanline(const GPU3D& gpu3d, RendererPolygon*
bool (*fnDepthTest)(s32 dstz, s32 z, u32 attr, u32 dstattr, u8 flags);
// stencil buffer is only cleared when beginning a shadow mask after a shadow polygon is rendered
// the "Revised" Rasterizer Circuit bugs out stencil buffer clearing for opaque shadow masks
// the "Revised" Rasterizer Circuit bugs out stencil buffer clearing
// TODO: toggling the scfg bit appears to glitch the stencil buffer for a frame with translucent masks?
if (ShadowRendered[y&0x1] && !(gpu3d.RenderRasterRev && (((polygon->Attr >> 16) & 0x1F) == 31)))
if (ShadowRendered[y&0x1] && !gpu3d.RenderRasterRev)
{
StencilCleared = true;
memset(&StencilBuffer[256 * (y&0x1)], 0, 256);
ShadowRendered[y&0x1] = false;
}
ShadowRendered[y&0x1] = false;
if (polygon->YTop != polygon->YBottom)
{
if (y >= polygon->Vertices[rp->NextVL]->FinalPosition[1] && rp->CurVL != polygon->VBottom)
@ -793,9 +792,8 @@ void SoftRenderer::RenderShadowMaskScanline(const GPU3D& gpu3d, RendererPolygon*
else
fnDepthTest = DepthTest_LessThan;
// shadow masks follow the same fill rules as regular polygons, with the exception of not being filled when translucent w/ blending enabled
// although though they are filled when wireframe, despite not actually rendering as a wireframe
if ((gpu3d.RenderDispCnt & ((1<<4)|(1<<5))) || ((polygon->Attr & (0x1F << 16)) == 0))
// shadow masks follow the same fill rules as regular polygons
if ((gpu3d.RenderDispCnt & ((1<<4)|(1<<5))) || ((polygon->Attr & (0x1F << 16)) == 0) || (((polygon->Attr & (0x1F << 16)) != (31<<16)) && (gpu3d.RenderDispCnt & (1<<3))))
{
l_filledge = true;
r_filledge = true;
@ -822,9 +820,8 @@ void SoftRenderer::RenderShadowMaskScanline(const GPU3D& gpu3d, RendererPolygon*
else
fnDepthTest = DepthTest_LessThan;
// shadow masks follow the same fill rules as regular polygons, with the exception of not being filled when translucent w/ blending enabled
// although though they are filled when wireframe, despite not actually rendering as a wireframe
if ((gpu3d.RenderDispCnt & ((1<<4)|(1<<5))) || ((polygon->Attr & (0x1F << 16)) == 0))
// shadow masks follow the same fill rules as regular polygons
if ((gpu3d.RenderDispCnt & ((1<<4)|(1<<5))) || ((polygon->Attr & (0x1F << 16)) == 0) || (((polygon->Attr & (0x1F << 16)) != (31<<16)) && (gpu3d.RenderDispCnt & (1<<3))))
{
l_filledge = true;
r_filledge = true;