More movies 2.0 work
This commit is contained in:
parent
3dce396261
commit
b26b26efbe
|
@ -154,6 +154,84 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public string Author
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public string Platform
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public string EmulatorVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public string FirmwareHash
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public string Core
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public string BoardName
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveBackup()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace BizHawk.Client.Common
|
|||
public Movie(bool startsFromSavestate = false)
|
||||
{
|
||||
Header = new MovieHeader();
|
||||
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v0.0.1";
|
||||
Filename = string.Empty;
|
||||
_preloadFramecount = 0;
|
||||
StartsFromSavestate = startsFromSavestate;
|
||||
|
@ -146,6 +147,84 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public string Author
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.AUTHOR];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.AUTHOR] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Core
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.CORE];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.CORE] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Platform
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.PLATFORM];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.PLATFORM] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string BoardName
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.BOARDNAME];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.BOARDNAME] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string EmulatorVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.EMULATIONVERSION];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.EMULATIONVERSION] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string FirmwareHash
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.FIRMWARESHA1];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.FIRMWARESHA1] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public IDictionary<string, string> HeaderEntries
|
||||
{
|
||||
get
|
||||
|
|
|
@ -65,6 +65,13 @@ namespace BizHawk.Client.Common
|
|||
string GameName { get; set; }
|
||||
string SystemID { get; set; }
|
||||
string Hash { get; set; }
|
||||
string Author { get; set; }
|
||||
string Core { get; set; }
|
||||
string Platform { get; set; }
|
||||
string EmulatorVersion { get; set; }
|
||||
string FirmwareHash { get; set; }
|
||||
string BoardName { get; set; }
|
||||
|
||||
bool PreLoadText(HawkFile hawkFile); // Movies 2.0 TODO: find a better way to not need this
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace BizHawk.Client.Common
|
|||
_mg = MnemonicGeneratorFactory.Generate();
|
||||
Filename = string.Empty;
|
||||
Header = new MovieHeader { StartsFromSavestate = startsFromSavestate };
|
||||
Header[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion2;
|
||||
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0";
|
||||
_records = new MovieRecordList();
|
||||
_mode = Moviemode.Inactive;
|
||||
IsCountingRerecords = true;
|
||||
|
@ -189,6 +189,84 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public string Author
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.AUTHOR];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.AUTHOR] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Core
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.CORE];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.CORE] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Platform
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.PLATFORM];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.PLATFORM] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string FirmwareHash
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.FIRMWARESHA1];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.FIRMWARESHA1] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string EmulatorVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.EMULATIONVERSION];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.EMULATIONVERSION] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string BoardName
|
||||
{
|
||||
get
|
||||
{
|
||||
return Header[HeaderKeys.BOARDNAME];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Header[HeaderKeys.BOARDNAME] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool PreLoadText(HawkFile hawkFile)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
// Movies 2.0 TODO
|
||||
Movie _movieToRecord;
|
||||
IMovie _movieToRecord = MovieService.Get(path);
|
||||
|
||||
if (StartFromCombo.SelectedItem.ToString() == "Now")
|
||||
{
|
||||
|
@ -84,7 +84,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
Directory.CreateDirectory(fileInfo.DirectoryName);
|
||||
}
|
||||
|
||||
_movieToRecord = new Movie(path, startsFromSavestate: true);
|
||||
_movieToRecord.StartsFromSavestate = true;
|
||||
|
||||
//TODO - some emulators (c++ cores) are just returning a hex string already
|
||||
//theres no sense hexifying those again. we need to record that fact in the IEmulator somehow
|
||||
var bytestate = Global.Emulator.SaveStateBinary();
|
||||
|
@ -93,36 +94,35 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else
|
||||
{
|
||||
_movieToRecord = new Movie(path);
|
||||
|
||||
}
|
||||
|
||||
// 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;
|
||||
_movieToRecord.Author = AuthorBox.Text;
|
||||
_movieToRecord.EmulatorVersion = VersionInfo.GetEmuVersion();
|
||||
_movieToRecord.Platform = Global.Game.System;
|
||||
|
||||
// Sync Settings, for movies 1.0, just dump a json blob into a header line
|
||||
_movieToRecord.SyncSettingsJson = ConfigService.SaveWithType(Global.Emulator.GetSyncSettings());
|
||||
|
||||
if (Global.Game != null)
|
||||
{
|
||||
_movieToRecord.Header[HeaderKeys.GAMENAME] = PathManager.FilesystemSafeName(Global.Game);
|
||||
_movieToRecord.Header[HeaderKeys.SHA1] = Global.Game.Hash;
|
||||
_movieToRecord.GameName = PathManager.FilesystemSafeName(Global.Game);
|
||||
_movieToRecord.Hash = Global.Game.Hash;
|
||||
if (Global.Game.FirmwareHash != null)
|
||||
{
|
||||
_movieToRecord.Header[HeaderKeys.FIRMWARESHA1] = Global.Game.FirmwareHash;
|
||||
_movieToRecord.FirmwareHash = Global.Game.FirmwareHash;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_movieToRecord.Header[HeaderKeys.GAMENAME] = "NULL";
|
||||
_movieToRecord.GameName = "NULL";
|
||||
}
|
||||
|
||||
if (Global.Emulator.BoardName != null)
|
||||
{
|
||||
_movieToRecord.Header[HeaderKeys.BOARDNAME] = Global.Emulator.BoardName;
|
||||
_movieToRecord.BoardName = Global.Emulator.BoardName;
|
||||
}
|
||||
|
||||
if (Global.Emulator.HasPublicProperty("DisplayType"))
|
||||
|
@ -130,16 +130,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
var region = Global.Emulator.GetPropertyValue("DisplayType");
|
||||
if ((DisplayType)region == DisplayType.PAL)
|
||||
{
|
||||
_movieToRecord.Header[HeaderKeys.PAL] = "1";
|
||||
_movieToRecord.HeaderEntries.Add(HeaderKeys.PAL, "1");
|
||||
}
|
||||
}
|
||||
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
_movieToRecord.Header[HeaderKeys.SGB] = (Global.Emulator as LibsnesCore).IsSGB.ToString();
|
||||
// TODO: shouldn't the Boardname property have sgb?
|
||||
_movieToRecord.HeaderEntries[HeaderKeys.SGB] = (Global.Emulator as LibsnesCore).IsSGB.ToString();
|
||||
}
|
||||
|
||||
_movieToRecord.Header[HeaderKeys.CORE] = ((CoreAttributes)Attribute
|
||||
_movieToRecord.Core = ((CoreAttributes)Attribute
|
||||
.GetCustomAttribute(Global.Emulator.GetType(), typeof(CoreAttributes)))
|
||||
.CoreName;
|
||||
|
||||
|
|
Loading…
Reference in New Issue