2600: stop emulator from hanging, consuming all ram, and then crashing in some situations

This commit is contained in:
goyuken 2012-09-22 19:47:25 +00:00
parent 6e094b673c
commit 35013f07e8
1 changed files with 11 additions and 0 deletions

View File

@ -853,6 +853,17 @@ namespace BizHawk.Emulation.Consoles.Atari
scanlinesBuffer.Add(scanline);
scanline = new uint[160];
}
if (scanlinesBuffer.Count >= 1024)
{
/* if a rom never toggles vsync, FrameAdvance() will hang while consuming
* huge amounts of ram. this is most certainly due to emulation defects
* that need to be fixed; but it's preferable to not crash the emulator
* in such situations
*/
outputFrame();
scanlinesBuffer.Clear();
frameComplete = true;
}
}
// TODO: Remove the magic numbers from this function to allow for a variable height screen