misc cleanup

This commit is contained in:
Jaklyy 2024-02-26 12:25:49 -05:00
parent 9ffa04dfbc
commit 56e506ef9a
4 changed files with 5 additions and 6 deletions

View File

@ -1043,7 +1043,7 @@ void GPU::StartScanline(u32 line) noexcept
} }
else if (VCount == 183) else if (VCount == 183)
{ {
GPU3D.DispCnt |= GPU3D.RDLinesUnderflow << 12; GPU3D.DispCnt |= GPU3D.RDLinesUnderflow << 12; // CHECKME: does this get set *exactly* at vcount 183? earlier? later?
} }
} }

View File

@ -242,7 +242,7 @@ void GPU3D::Reset() noexcept
AlphaRef = 0; AlphaRef = 0;
RDLines = 63; // defaults to 63 for one frame? (CHECKME: when does it reset?) RDLines = 63; // defaults to 63 for one frame? (CHECKME: when does it reset?)
RDLinesTemp = 46; RDLinesTemp = 63;
memset(ToonTable, 0, sizeof(ToonTable)); memset(ToonTable, 0, sizeof(ToonTable));
memset(EdgeTable, 0, sizeof(EdgeTable)); memset(EdgeTable, 0, sizeof(EdgeTable));

View File

@ -1843,7 +1843,6 @@ void SoftRenderer::FinishPushScanline(s32 y, s32 pixelsremain)
memcpy(&RDBuffer[bufferpos*ScanlineWidth], &ColorBuffer[y*ScanlineWidth], 4 * pixelsremain); memcpy(&RDBuffer[bufferpos*ScanlineWidth], &ColorBuffer[y*ScanlineWidth], 4 * pixelsremain);
} }
template <bool threaded>
void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys) void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
{ {
int j = 0; int j = 0;
@ -2015,7 +2014,7 @@ void SoftRenderer::RenderFrame(GPU& gpu)
// "Render thread, you're up! Get moving." // "Render thread, you're up! Get moving."
Platform::Semaphore_Post(Sema_RenderStart); Platform::Semaphore_Post(Sema_RenderStart);
} }
else if (!FrameIdentical) RenderPolygons<false>(gpu, &gpu.GPU3D.RenderPolygonRAM[0], gpu.GPU3D.RenderNumPolygons); else if (!FrameIdentical) RenderPolygons(gpu, &gpu.GPU3D.RenderPolygonRAM[0], gpu.GPU3D.RenderNumPolygons);
} }
void SoftRenderer::RestartFrame(GPU& gpu) void SoftRenderer::RestartFrame(GPU& gpu)
@ -2043,7 +2042,7 @@ void SoftRenderer::RenderThreadFunc(GPU& gpu)
{ // If no rendering is needed, just say we're done. { // If no rendering is needed, just say we're done.
Platform::Semaphore_Post(Sema_ScanlineCount, 192); Platform::Semaphore_Post(Sema_ScanlineCount, 192);
} }
else RenderPolygons<true>(gpu, &gpu.GPU3D.RenderPolygonRAM[0], gpu.GPU3D.RenderNumPolygons); else RenderPolygons(gpu, &gpu.GPU3D.RenderPolygonRAM[0], gpu.GPU3D.RenderNumPolygons);
// Tell the main thread that we're done rendering // Tell the main thread that we're done rendering
// and that it's safe to access the GPU state again. // and that it's safe to access the GPU state again.

View File

@ -478,7 +478,7 @@ private:
u16 BeginPushScanline(s32 y, s32 pixelstodraw); u16 BeginPushScanline(s32 y, s32 pixelstodraw);
void ReadScanline(s32 y); void ReadScanline(s32 y);
void FinishPushScanline(s32 y, s32 pixelsremain); void FinishPushScanline(s32 y, s32 pixelsremain);
template <bool threaded> void RenderPolygons(GPU& gpu, Polygon** polygons, int npolys); void RenderPolygons(GPU& gpu, Polygon** polygons, int npolys);
void RenderThreadFunc(GPU& gpu); void RenderThreadFunc(GPU& gpu);