mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
fix a crash and scanlines being incorrectly partially read
This commit is contained in:
parent
fb5b2c299c
commit
f239d0cf0d
@ -1817,7 +1817,7 @@ void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
|
|||||||
u16 leftovers;
|
u16 leftovers;
|
||||||
|
|
||||||
// until all scanlines have been pushed and read continue looping... CHECKME: unless its time for the next 3d frame should begin
|
// until all scanlines have been pushed and read continue looping... CHECKME: unless its time for the next 3d frame should begin
|
||||||
while ((scanlinesread < 192 || scanlinespushed2 < 192) && (RasterTiming < FrameLength))
|
while ((scanlinesread < 192 || scanlinespushed2 < 192) && (RasterTiming < (FrameLength-RastDelay)))
|
||||||
{
|
{
|
||||||
// check all events to find the earliest scheduled one
|
// check all events to find the earliest scheduled one
|
||||||
nextevent = 0;
|
nextevent = 0;
|
||||||
@ -1932,8 +1932,6 @@ void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
|
|||||||
|
|
||||||
// read scanline from buffer
|
// read scanline from buffer
|
||||||
ReadScanline(scanlinesread);
|
ReadScanline(scanlinesread);
|
||||||
// reschedule event for one scanline later
|
|
||||||
rasterevents[ScanlineRead] += ScanlineReadInc;
|
|
||||||
|
|
||||||
// avoid breaking seperate thread.
|
// avoid breaking seperate thread.
|
||||||
if constexpr (threaded)
|
if constexpr (threaded)
|
||||||
@ -1941,6 +1939,10 @@ void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
|
|||||||
|
|
||||||
scanlinesread++;
|
scanlinesread++;
|
||||||
scanlineswaiting--;
|
scanlineswaiting--;
|
||||||
|
|
||||||
|
// reschedule event for one scanline later unless all scanlines have been read
|
||||||
|
if (scanlinesread < 192) rasterevents[ScanlineRead] += ScanlineReadInc;
|
||||||
|
else rasterevents[ScanlineRead] = INT_MAX/2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user