mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
fix another crash + bug w/ scanline delay
This commit is contained in:
parent
ee3e38aed3
commit
4f3b99f5c4
@ -1747,9 +1747,9 @@ u16 SoftRenderer::BeginPushScanline(s32 y, s32 pixelstodraw)
|
|||||||
{
|
{
|
||||||
// push the finished scanline to the appropriate frame buffers.
|
// push the finished scanline to the appropriate frame buffers.
|
||||||
// if a scanline is late enough to intersect with the 2d engine read time it will be partially drawn
|
// if a scanline is late enough to intersect with the 2d engine read time it will be partially drawn
|
||||||
|
|
||||||
u16 start;
|
u16 start;
|
||||||
if (pixelstodraw >= 256) // if scheduled after or 256 cycles before a scanline read render full scanline
|
if (pixelstodraw >= 256 || pixelstodraw <= 0) // if scheduled after or 256 cycles before a scanline read render full scanline
|
||||||
{
|
{
|
||||||
start = 0;
|
start = 0;
|
||||||
pixelstodraw = 256;
|
pixelstodraw = 256;
|
||||||
@ -1919,7 +1919,10 @@ void SoftRenderer::RenderPolygons(GPU& gpu, Polygon** polygons, int npolys)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
leftovers = BeginPushScanline(scanlinespushed, (rasterevents[ScanlineRead] + (ScanlineReadInc*scanlineswaitingforread)) - rasterevents[PushScanline]);
|
{
|
||||||
|
s32 pixelstopush = (scanlinespushed > scanlinesread ? 256 : (rasterevents[ScanlineRead] + (ScanlineReadInc*scanlineswaitingforread)) - rasterevents[PushScanline]);
|
||||||
|
leftovers = BeginPushScanline(scanlinespushed, pixelstopush);
|
||||||
|
}
|
||||||
scanlineswaitingforpush--;
|
scanlineswaitingforpush--;
|
||||||
scanlinespushed++;
|
scanlinespushed++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user