I don't understand why we're clearing the rewind buffer, but if we want to do that, just do it, and don't deallocate + reallocate many megs of ram on every loadstate (#2282)
This commit is contained in:
parent
f08ab6dda8
commit
2feece847f
|
@ -19,5 +19,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
void Suspend();
|
void Suspend();
|
||||||
void Resume();
|
void Resume();
|
||||||
|
|
||||||
|
void Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,5 +85,10 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
// this possess no resources to dispose of, but other IRewinder impls might
|
// this possess no resources to dispose of, but other IRewinder impls might
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
_buffer.InvalidateEnd(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -887,17 +887,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public IRewinder Rewinder { get; private set; }
|
public IRewinder Rewinder { get; private set; }
|
||||||
|
|
||||||
public void CreateRewinder()
|
public void CreateRewinder()
|
||||||
{
|
|
||||||
RecreateRewinder();
|
|
||||||
AddOnScreenMessage(Rewinder?.Active == true ? "Rewind started" : "Rewind disabled");
|
|
||||||
}
|
|
||||||
|
|
||||||
void RecreateRewinder()
|
|
||||||
{
|
{
|
||||||
Rewinder?.Dispose();
|
Rewinder?.Dispose();
|
||||||
Rewinder = Emulator.HasSavestates() && Config.Rewind.Enabled
|
Rewinder = Emulator.HasSavestates() && Config.Rewind.Enabled
|
||||||
? new Zwinder(Emulator.AsStatable(), Config.Rewind)
|
? new Zwinder(Emulator.AsStatable(), Config.Rewind)
|
||||||
: null;
|
: null;
|
||||||
|
AddOnScreenMessage(Rewinder?.Active == true ? "Rewind started" : "Rewind disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
private FirmwareManager FirmwareManager => GlobalWin.FirmwareManager;
|
private FirmwareManager FirmwareManager => GlobalWin.FirmwareManager;
|
||||||
|
@ -3992,7 +3987,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
//so purge rewind history when loading a state while doing a movie
|
//so purge rewind history when loading a state while doing a movie
|
||||||
if (!IsRewindSlave && MovieSession.Movie.IsActive())
|
if (!IsRewindSlave && MovieSession.Movie.IsActive())
|
||||||
{
|
{
|
||||||
RecreateRewinder();
|
Rewinder?.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!suppressOSD)
|
if (!suppressOSD)
|
||||||
|
|
Loading…
Reference in New Issue