snes: fix a bug which caused false positives in lagframe detection (frames marked as lag where input was actually used). this is purely a display issue and did not affect emulation at all. the bug was not caused by r4206, but r4206 causes it to occur more often.

This commit is contained in:
goyuken 2013-06-29 23:32:41 +00:00
parent a18ed625ca
commit aa6b743b86
1 changed files with 8 additions and 3 deletions

View File

@ -411,6 +411,14 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
if(CoreComm.SNES_UseRingBuffer)
api.BeginBufferIO();
/* if the input poll callback is called, it will set this to false
* this has to be done before we save the per-frame state in deterministic
* mode, because in there, the core actually advances, and might advance
* through the point in time where IsLagFrame gets set to false. makes sense?
*/
IsLagFrame = true;
// for deterministic emulation, save the state we're going to use before frame advance
// don't do this during nocallbacks though, since it's already been done
if (!nocallbacks && DeterministicEmulation)
@ -457,9 +465,6 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
api.snes_set_layer_enable(4, 2, CoreComm.SNES_ShowOBJ_2);
api.snes_set_layer_enable(4, 3, CoreComm.SNES_ShowOBJ_3);
// if the input poll callback is called, it will set this to false
IsLagFrame = true;
//apparently this is one frame?
timeFrameCounter++;
api.snes_run();