diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs index 6bb3be3ca3..faf3ab2265 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs @@ -98,7 +98,7 @@ namespace BizHawk.Client.Common public static string movie_rerecordcount() { - return Global.MovieSession.Movie.Rerecords.ToString(); + return Global.MovieSession.Movie.Header.Rerecords.ToString(); } public static void movie_setreadonly(object lua_input) diff --git a/BizHawk.Client.Common/movie/IMovie.cs b/BizHawk.Client.Common/movie/IMovie.cs index ed653f23d2..fe1e5ab638 100644 --- a/BizHawk.Client.Common/movie/IMovie.cs +++ b/BizHawk.Client.Common/movie/IMovie.cs @@ -28,9 +28,7 @@ namespace BizHawk.Client.Common /// Actual length of the input log, should only be used by code that iterates or needs a real length /// int InputLogLength { get; } - - ulong Rerecords { get; set; } - + IMovieHeader Header { get; } #endregion diff --git a/BizHawk.Client.Common/movie/Movie.cs b/BizHawk.Client.Common/movie/Movie.cs index 447027c247..eaca46f629 100644 --- a/BizHawk.Client.Common/movie/Movie.cs +++ b/BizHawk.Client.Common/movie/Movie.cs @@ -15,7 +15,7 @@ namespace BizHawk.Client.Common public Movie(string filename, bool startsFromSavestate = false) : this(startsFromSavestate) { - Rerecords = 0; + Header.Rerecords = 0; Filename = filename; Loaded = !String.IsNullOrWhiteSpace(filename); } @@ -46,12 +46,6 @@ namespace BizHawk.Client.Common public bool Loaded { get; private set; } public bool IsText { get; private set; } - public ulong Rerecords - { - get { return Header.Rerecords; } - set { Header.Rerecords = value; } - } - public int InputLogLength { get { return Loaded ? _log.Length : _preloadFramecount; } @@ -572,7 +566,7 @@ namespace BizHawk.Client.Common if (IsCountingRerecords) { - Rerecords++; + Header.Rerecords++; } } diff --git a/BizHawk.Client.Common/movie/MovieImport.cs b/BizHawk.Client.Common/movie/MovieImport.cs index 9eee8f5d37..864983e610 100644 --- a/BizHawk.Client.Common/movie/MovieImport.cs +++ b/BizHawk.Client.Common/movie/MovieImport.cs @@ -379,7 +379,7 @@ namespace BizHawk.Client.Common { rerecordCount = 0; } - m.Rerecords = (ulong)rerecordCount; + m.Header.Rerecords = (ulong)rerecordCount; } else if (line.ToLower().StartsWith("guid")) { @@ -529,7 +529,7 @@ namespace BizHawk.Client.Common uint frameCount = r.ReadUInt32(); // 010 4-byte little-endian unsigned int: rerecord count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; /* 018 4-byte little-endian unsigned int: offset to the savestate inside file The savestate offset is . The savestate offset should be @@ -779,7 +779,7 @@ namespace BizHawk.Client.Common loaded, the number is 0. Famtasia however displays "1" in such case. It always adds 1 to the number found in the file. */ - m.Rerecords = rerecordCount + 1; + m.Header.Rerecords = rerecordCount + 1; // 00E 2-byte little-endian unsigned int: unknown, set to 0000 r.ReadInt16(); // 010 64-byte zero-terminated emulator identifier string @@ -886,7 +886,7 @@ namespace BizHawk.Client.Common m.Header.Comments.Add(EMULATIONORIGIN + " Gens"); // 010 4-byte little-endian unsigned int: rerecord count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; // 014 ASCII-encoded controller config for player 1. '3' or '6'. string player1Config = r.ReadStringFixedAscii(1); // 015 ASCII-encoded controller config for player 2. '3' or '6'. @@ -1157,7 +1157,7 @@ namespace BizHawk.Client.Common { rerecordCount = 0; } - m.Rerecords = (ulong)rerecordCount; + m.Header.Rerecords = (ulong)rerecordCount; hf.Unbind(); } else if (item.name.EndsWith(".sha256")) @@ -1252,7 +1252,7 @@ namespace BizHawk.Client.Common m.Header[HeaderKeys.GAMENAME] = gameName; // 070 uint32 Re-record Count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = (ulong)rerecordCount; + m.Header.Rerecords = (ulong)rerecordCount; // 074 5-byte Console indicator (pce, ngp, pcfx, wswan) string platform = NullTerminated(r.ReadStringFixedAscii(5)); Dictionary> platforms = new Dictionary> @@ -1367,7 +1367,7 @@ namespace BizHawk.Client.Common uint frameCount = r.ReadUInt32(); // 000c: 4-byte little endian unsigned int: rerecord count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; // 0010: 4-byte little endian flag: begin from reset? uint reset = r.ReadUInt32(); if (reset == 0) @@ -1632,7 +1632,7 @@ namespace BizHawk.Client.Common m.Header[HeaderKeys.PAL] = pal.ToString(); // 004 4-byte little-endian unsigned int: rerecord count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; /* 008 4-byte little-endian unsigned int: length of movie description 00C (variable) null-terminated UTF-8 text, movie description (currently not implemented) @@ -1734,7 +1734,7 @@ namespace BizHawk.Client.Common uint uid = r.ReadUInt32(); m.Header[HeaderKeys.GUID] = String.Format("{0:X8}", uid) + "-0000-0000-0000-000000000000"; // 00C 4-byte little-endian unsigned int: rerecord count - m.Rerecords = r.ReadUInt32(); + m.Header.Rerecords = r.ReadUInt32(); // 010 4-byte little-endian unsigned int: number of frames uint frameCount = r.ReadUInt32(); // 014 1-byte flags "controller mask" @@ -1996,7 +1996,7 @@ namespace BizHawk.Client.Common uint frameCount = r.ReadUInt32(); // 010 4-byte little-endian unsigned int: rerecord count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; // 014 1-byte flags: (movie start flags) byte flags = r.ReadByte(); // bit 0: if "1", movie starts from an embedded "quicksave" snapshot @@ -2298,7 +2298,7 @@ namespace BizHawk.Client.Common r.ReadBytes(2); // 01C 4-byte little-endian integer: rerecord count uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; /* 020 BYTE RenderMethod 0=POST_ALL,1=PRE_ALL @@ -2481,7 +2481,7 @@ namespace BizHawk.Client.Common uint frameCount = r.ReadUInt32(); // 00D 4-byte little-endian unsigned int: number of rerecords uint rerecordCount = r.ReadUInt32(); - m.Rerecords = rerecordCount; + m.Header.Rerecords = rerecordCount; // 011 4-byte little-endian unsigned int: number of frames removed by rerecord r.ReadBytes(4); // 015 4-byte little-endian unsigned int: number of frames advanced step by step diff --git a/BizHawk.Client.Common/movie/TasMovie.cs b/BizHawk.Client.Common/movie/TasMovie.cs index 834af7e6dd..b52cc73004 100644 --- a/BizHawk.Client.Common/movie/TasMovie.cs +++ b/BizHawk.Client.Common/movie/TasMovie.cs @@ -26,6 +26,7 @@ namespace BizHawk.Client.Common Header.StartsFromSavestate = startsFromSavestate; _records = new MovieRecordList(); _mode = Moviemode.Inactive; + IsCountingRerecords = true; } public string Filename { get; set; } @@ -52,17 +53,7 @@ namespace BizHawk.Client.Common get { return _mode == Moviemode.Finished; } } - public bool IsCountingRerecords - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } + public bool IsCountingRerecords { get; set; } public bool Changes { diff --git a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index 4ba39ac418..5c8555fba3 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -492,7 +492,7 @@ namespace BizHawk.Client.EmuHawk { if (Global.MovieSession.Movie.IsActive) { - return "Rerecord Count: " + Global.MovieSession.Movie.Rerecords; + return "Rerecord Count: " + Global.MovieSession.Movie.Header.Rerecords; } else {