Some more bk2 and movies 2.0 stuff

This commit is contained in:
adelikat 2014-06-14 19:13:21 +00:00
parent edacc9b8c8
commit c08e6bbf93
8 changed files with 17 additions and 11 deletions
BizHawk.Client.Common/movie
BizHawk.Client.EmuHawk/movie

View File

@ -6,6 +6,7 @@ using System.IO;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.SNES;
namespace BizHawk.Client.Common
{
@ -1115,9 +1116,7 @@ namespace BizHawk.Client.Common
case "sgb_ntsc":
case "sgb_pal":
platform = "SNES";
// Movies 2.0 TODO: populating this flag wasn't doing anything useful
// Figure out how to properly set sync settings to set it to sgb
//m.Header[HeaderKeys.SGB] = "True";
Global.Config.GB_AsSGB = true;
break;
}
bool pal = (gametype == "snes_pal" || gametype == "sgb_pal");

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using BizHawk.Common;
@ -47,7 +48,6 @@ namespace BizHawk.Client.Common
/// </summary>
public static IEnumerable<string> MovieExtensions
{
// Movies 2.0 TODO: consider using reflection to find IMovie implementations
get
{
yield return "bkm";

View File

@ -133,7 +133,7 @@ namespace BizHawk.Client.Common
return true;
}
public bool PreLoadText(HawkFile hawkFile)
public bool PreLoadHeaderAndLength(HawkFile hawkFile)
{
// For now, preload simply loads everything
var file = new FileInfo(Filename);

View File

@ -11,7 +11,6 @@ namespace BizHawk.Client.Common
{
public partial class Bk2Movie : IMovie
{
// Movies 2.0 TODO: save and load loopOffset, put in header object
private readonly PlatformFrameRates _frameRates = new PlatformFrameRates();
private bool _makeBackup = true;

View File

@ -116,7 +116,7 @@ namespace BizHawk.Client.Common
/// Load Header information only for displaying file information in dialogs such as play movie
/// TODO - consider not loading the SavestateBinaryBase64Blob key?
/// </summary>
public bool PreLoadText(HawkFile hawkFile)
public bool PreLoadHeaderAndLength(HawkFile hawkFile)
{
Loaded = false;
var file = new FileInfo(hawkFile.CanonicalFullPath);

View File

@ -56,10 +56,14 @@ namespace BizHawk.Client.Common
/// </summary>
string SyncSettingsJson { get; set; }
// TODO: document these
SubtitleList Subtitles { get; }
IList<string> Comments { get; }
/// <summary>
/// For savestate anchored movies, this is the starting savestate
/// </summary>
string SavestateBinaryBase64Blob { get; set; }
ulong Rerecords { get; set; }
bool StartsFromSavestate { get; set; }
string GameName { get; set; }
@ -72,7 +76,11 @@ namespace BizHawk.Client.Common
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>
/// Loads from the HawkFile the minimal amount of information needed to determine Header info and Movie length
/// This method is intended to be more performant than a full load
/// </summary>
bool PreLoadHeaderAndLength(HawkFile hawkFile);
/// <summary>
/// Returns header key value pairs stored in the movie file

View File

@ -267,7 +267,7 @@ namespace BizHawk.Client.Common
}
}
public bool PreLoadText(HawkFile hawkFile)
public bool PreLoadHeaderAndLength(HawkFile hawkFile)
{
throw new NotImplementedException();
}

View File

@ -128,7 +128,7 @@ namespace BizHawk.Client.EmuHawk
try
{
movie.PreLoadText(hf);
movie.PreLoadHeaderAndLength(hf);
// Don't do this from browse
if (movie.Hash == Global.Game.Hash ||