clear saveRam when loading a movie. Add movie name to saveram default path generation so that movies do not interfere with users saveram files
This commit is contained in:
parent
82cf9486f3
commit
a30a5290ca
|
@ -282,6 +282,9 @@ namespace BizHawk.MultiClient
|
||||||
public static string SaveRamPath(GameInfo game)
|
public static string SaveRamPath(GameInfo game)
|
||||||
{
|
{
|
||||||
string name = FilesystemSafeName(game);
|
string name = FilesystemSafeName(game);
|
||||||
|
if (Global.MainForm.MovieActive())
|
||||||
|
name += "." + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename);
|
||||||
|
|
||||||
switch (game.System)
|
switch (game.System)
|
||||||
{
|
{
|
||||||
case "SMS": return Path.Combine(MakeAbsolutePath(Global.Config.PathSMSSaveRAM, "SMS"), name + ".SaveRAM");
|
case "SMS": return Path.Combine(MakeAbsolutePath(Global.Config.PathSMSSaveRAM, "SMS"), name + ".SaveRAM");
|
||||||
|
|
|
@ -80,9 +80,16 @@ namespace BizHawk.MultiClient
|
||||||
Mode = MOVIEMODE.INACTIVE;
|
Mode = MOVIEMODE.INACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearSaveRAM()
|
||||||
|
{
|
||||||
|
var file = new FileInfo(PathManager.SaveRamPath(Global.Game));
|
||||||
|
if (file.Exists) file.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
public void StartNewRecording() { StartNewRecording(true); }
|
public void StartNewRecording() { StartNewRecording(true); }
|
||||||
public void StartNewRecording(bool truncate)
|
public void StartNewRecording(bool truncate)
|
||||||
{
|
{
|
||||||
|
ClearSaveRAM();
|
||||||
Mode = MOVIEMODE.RECORD;
|
Mode = MOVIEMODE.RECORD;
|
||||||
if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length() > 0)
|
if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length() > 0)
|
||||||
{
|
{
|
||||||
|
@ -94,6 +101,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public void StartPlayback()
|
public void StartPlayback()
|
||||||
{
|
{
|
||||||
|
ClearSaveRAM();
|
||||||
Mode = MOVIEMODE.PLAY;
|
Mode = MOVIEMODE.PLAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue