Store sync settings into the movie file, note: this does not include logic for deserializing sync settings and passing them to the core when loading a movie

This commit is contained in:
adelikat 2014-05-18 15:07:50 +00:00
parent 0e02a78073
commit 5634b085cf
4 changed files with 27 additions and 1 deletions

View File

@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
public const string FIRMWARESHA1 = "FirmwareSHA1";
public const string PAL = "PAL";
public const string BOARDNAME = "BoardName";
public const string SYNCSETTINGS = "SyncSettings";
// Core Setting
public const string CORE = "Core";

View File

@ -13,6 +13,7 @@ namespace BizHawk.Client.Common
string SavestateBinaryBase64Blob { get; set; }
string GameName { get; set; }
string SystemID { get; set; }
string SyncSettingsJson { get; set; }
/// <summary>
/// Receives a line and attempts to add as a header

View File

@ -35,6 +35,24 @@ namespace BizHawk.Client.Common
}
}
public string SyncSettingsJson
{
get
{
if (ContainsKey(HeaderKeys.SYNCSETTINGS))
{
return this[HeaderKeys.SYNCSETTINGS];
}
return string.Empty;
}
set
{
this[HeaderKeys.SYNCSETTINGS] = value;
}
}
public ulong Rerecords
{
get

View File

@ -15,6 +15,8 @@ using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
using System.Reflection;
using Newtonsoft.Json;
namespace BizHawk.Client.EmuHawk
{
public partial class RecordMovie : Form
@ -94,10 +96,15 @@ namespace BizHawk.Client.EmuHawk
}
// Header
_movieToRecord.Header[HeaderKeys.AUTHOR] = AuthorBox.Text;
_movieToRecord.Header[HeaderKeys.EMULATIONVERSION] = VersionInfo.GetEmuVersion();
_movieToRecord.Header[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion1;
_movieToRecord.Header[HeaderKeys.PLATFORM] = Global.Game.System;
// Sync Settings, for movies 1.0, just dump a json blob into a header line
_movieToRecord.Header[HeaderKeys.SYNCSETTINGS] = JsonConvert.SerializeObject(Global.Emulator.GetSyncSettings());
if (Global.Game != null)
{
_movieToRecord.Header[HeaderKeys.GAMENAME] = PathManager.FilesystemSafeName(Global.Game);