snes: fix crash when advancing after tracer was disabled

This commit is contained in:
feos 2016-08-19 18:53:50 +03:00
parent 0b1d9c3c48
commit 57b9ff875e
1 changed files with 5 additions and 5 deletions

View File

@ -645,6 +645,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
IsLagFrame = true;
if (!nocallbacks && Tracer.Enabled)
api.QUERY_set_trace_callback(tracecb);
else
api.QUERY_set_trace_callback(null);
// 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)
@ -660,11 +665,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
savestatebuff = ms.ToArray();
}
if (!nocallbacks && Tracer.Enabled)
api.QUERY_set_trace_callback(tracecb);
else
api.QUERY_set_trace_callback(null);
// speedup when sound rendering is not needed
if (!rendersound)
api.QUERY_set_audio_sample(null);