diff --git a/BizHawk.Client.Common/XmlGame.cs b/BizHawk.Client.Common/XmlGame.cs index a4a8429bf0..483fd9b6e7 100644 --- a/BizHawk.Client.Common/XmlGame.cs +++ b/BizHawk.Client.Common/XmlGame.cs @@ -40,7 +40,7 @@ namespace BizHawk.Client.Common }, Xml = x }; - string fullpath = ""; + string fullPath = ""; var n = y.SelectSingleNode("./LoadAssets"); if (n != null) @@ -75,25 +75,23 @@ namespace BizHawk.Client.Common else { // relative path - fullpath = Path.GetDirectoryName(f.CanonicalFullPath.Split('|').First()) ?? ""; - fullpath = Path.Combine(fullpath, filename.Split('|').First()); + fullPath = Path.GetDirectoryName(f.CanonicalFullPath.Split('|').First()) ?? ""; + fullPath = Path.Combine(fullPath, filename.Split('|').First()); try { - using (var hf = new HawkFile(fullpath)) + using var hf = new HawkFile(fullPath); + if (hf.IsArchive) { - if (hf.IsArchive) - { - var archiveItem = hf.ArchiveItems.First(ai => ai.Name == filename.Split('|').Skip(1).First()); - hf.Unbind(); - hf.BindArchiveMember(archiveItem); - data = hf.GetStream().ReadAllBytes(); + var archiveItem = hf.ArchiveItems.First(ai => ai.Name == filename.Split('|').Skip(1).First()); + hf.Unbind(); + hf.BindArchiveMember(archiveItem); + data = hf.GetStream().ReadAllBytes(); - filename = filename.Split('|').Skip(1).First(); - } - else - { - data = File.ReadAllBytes(fullpath.Split('|').First()); - } + filename = filename.Split('|').Skip(1).First(); + } + else + { + data = File.ReadAllBytes(fullPath.Split('|').First()); } } catch @@ -103,12 +101,10 @@ namespace BizHawk.Client.Common } ret.Assets.Add(new KeyValuePair(filename, data)); - ret.AssetFullPaths.Add(fullpath); - using (var sha1 = System.Security.Cryptography.SHA1.Create()) - { - sha1.TransformFinalBlock(data, 0, data.Length); - hashStream.Write(sha1.Hash, 0, sha1.Hash.Length); - } + ret.AssetFullPaths.Add(fullPath); + using var sha1 = System.Security.Cryptography.SHA1.Create(); + sha1.TransformFinalBlock(data, 0, data.Length); + hashStream.Write(sha1.Hash, 0, sha1.Hash.Length); } ret.GI.Hash = hashStream.GetBuffer().HashSHA1(0, (int)hashStream.Length); diff --git a/BizHawk.Client.Common/movie/HeaderKeys.cs b/BizHawk.Client.Common/movie/HeaderKeys.cs index 691c188aeb..351bb1ec33 100644 --- a/BizHawk.Client.Common/movie/HeaderKeys.cs +++ b/BizHawk.Client.Common/movie/HeaderKeys.cs @@ -13,7 +13,6 @@ namespace BizHawk.Client.Common public const string STARTSFROMSAVESTATE = "StartsFromSavestate"; public const string STARTSFROMSAVERAM = "StartsFromSaveRam"; public const string SAVESTATEBINARYBASE64BLOB = "SavestateBinaryBase64Blob"; // this string will not contain base64: ; it's implicit (this is to avoid another big string op to dice off the base64: substring) - public const string FOURSCORE = "FourScore"; public const string SHA1 = "SHA1"; public const string FIRMWARESHA1 = "FirmwareSHA1"; public const string PAL = "PAL"; @@ -24,9 +23,6 @@ namespace BizHawk.Client.Common // Core Setting public const string CORE = "Core"; - // Plugin Settings - public const string VIDEOPLUGIN = "VideoPlugin"; - public static bool Contains(string val) { return typeof(HeaderKeys) diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index 5598f75c63..c0cc233d6e 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -324,10 +324,8 @@ namespace BizHawk.Client.Common public bool HandleMovieLoadState(string path) { - using (var sr = new StreamReader(path)) - { - return HandleMovieLoadState(sr); - } + using var sr = new StreamReader(path); + return HandleMovieLoadState(sr); } // TODO: maybe someone who understands more about what's going on here could rename these step1 and step2 into something more descriptive diff --git a/BizHawk.Client.Common/movie/PlatformFrameRates.cs b/BizHawk.Client.Common/movie/PlatformFrameRates.cs index e5bed219d7..1515e4e23a 100644 --- a/BizHawk.Client.Common/movie/PlatformFrameRates.cs +++ b/BizHawk.Client.Common/movie/PlatformFrameRates.cs @@ -5,8 +5,8 @@ namespace BizHawk.Client.Common { public class PlatformFrameRates { - // these are political numbers, designed to be in accord with tasvideos.org tradition. theyre not necessarily mathematical factualities (although they may be in some cases) - // it would be nice if we could turn this into a rational expression natively, and also, to write some comments about the derivation and ideal values (since this seems to be where theyre all collected) + // these are political numbers, designed to be in accord with tasvideos.org tradition. they're not necessarily mathematical factualities (although they may be in some cases) + // it would be nice if we could turn this into a rational expression natively, and also, to write some comments about the derivation and ideal values (since this seems to be where they're all collected) // are we collecting them anywhere else? for avi-writing code perhaps? // just some constants, according to specs @@ -66,7 +66,7 @@ namespace BizHawk.Client.Common // according to ryphecha, using // clocks[2] = { 53.693182e06, 53.203425e06 }; //ntsc console, pal console - // lpf[2][2] = { { 263, 262.5 }, { 314, 312.5 } }; //ntsc,pal; noninterlaced, interlaced + // lpf[2][2] = { { 263, 262.5 }, { 314, 312.5 } }; //ntsc,pal; non-interlaced, interlaced // cpl[2] = { 3412.5, 3405 }; //ntsc mode, pal mode // PAL PS1: 0, PAL Mode: 0, Interlaced: 0 --- 59.826106 (53.693182e06/(263*3412.5)) // PAL PS1: 0, PAL Mode: 0, Interlaced: 1 --- 59.940060 (53.693182e06/(262.5*3412.5)) @@ -90,22 +90,22 @@ namespace BizHawk.Client.Common public TimeSpan MovieTime(IMovie movie) { - var dblseconds = GetSeconds(movie); - var seconds = (int)(dblseconds % 60); + var dblSeconds = GetSeconds(movie); + var seconds = (int)(dblSeconds % 60); var days = seconds / 86400; var hours = seconds / 3600; var minutes = (seconds / 60) % 60; - var milliseconds = (int)((dblseconds - seconds) * 1000); + var milliseconds = (int)((dblSeconds - seconds) * 1000); return new TimeSpan(days, hours, minutes, seconds, milliseconds); } private double Fps(IMovie movie) { var system = movie.HeaderEntries[HeaderKeys.PLATFORM]; - var pal = movie.HeaderEntries.ContainsKey(HeaderKeys.PAL) && - movie.HeaderEntries[HeaderKeys.PAL] == "1"; + var pal = movie.HeaderEntries.ContainsKey(HeaderKeys.PAL) + && movie.HeaderEntries[HeaderKeys.PAL] == "1"; - return this[system, pal]; + return this[system, pal]; } private double GetSeconds(IMovie movie) diff --git a/BizHawk.Client.Common/movie/Subtitle.cs b/BizHawk.Client.Common/movie/Subtitle.cs index 42e0c7a37e..69eda5b1cd 100644 --- a/BizHawk.Client.Common/movie/Subtitle.cs +++ b/BizHawk.Client.Common/movie/Subtitle.cs @@ -90,7 +90,7 @@ namespace BizHawk.Client.Common sb.Append("\r\n"); - // Seperator + // Separator sb.Append("\r\n"); return sb.ToString(); diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs index fdcf9e0199..d7c8cc9d3b 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs @@ -416,7 +416,6 @@ namespace BizHawk.Client.Common public void Undo(TasMovie movie) { bool wasRecording = movie.ChangeLog.IsRecording; - bool wasBinding = movie.BindMarkersToInput; movie.ChangeLog.IsRecording = false; movie.BindMarkersToInput = _bindMarkers; @@ -442,7 +441,6 @@ namespace BizHawk.Client.Common public void Redo(TasMovie movie) { bool wasRecording = movie.ChangeLog.IsRecording; - bool wasBinding = movie.BindMarkersToInput; movie.ChangeLog.IsRecording = false; movie.BindMarkersToInput = _bindMarkers; diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs index 01d68e9f50..39ea2089ab 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs @@ -28,9 +28,9 @@ namespace BizHawk.Client.Common Message = split[1]; } - public virtual int Frame { get; } + public int Frame { get; } - public virtual string Message { get; set; } + public string Message { get; set; } public override string ToString() { diff --git a/BizHawk.Client.Common/tools/RamSearchEngine.cs b/BizHawk.Client.Common/tools/RamSearchEngine.cs index 92baf4a619..5996673fa9 100644 --- a/BizHawk.Client.Common/tools/RamSearchEngine.cs +++ b/BizHawk.Client.Common/tools/RamSearchEngine.cs @@ -57,15 +57,9 @@ namespace BizHawk.Client.Common #region API - public IEnumerable OutOfRangeAddress - { - get - { - return _watchList - .Where(watch => watch.Address >= Domain.Size) - .Select(watch => watch.Address); - } - } + public IEnumerable OutOfRangeAddress => _watchList + .Where(watch => watch.Address >= Domain.Size) + .Select(watch => watch.Address); public void Start() { @@ -154,7 +148,7 @@ namespace BizHawk.Client.Common "", 0, _watchList[index].Previous, - (_watchList[index] as IMiniWatchDetails).ChangeCount); + ((IMiniWatchDetails)_watchList[index]).ChangeCount); } return Watch.GenerateWatch( diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings index 5048980c6c..936033440e 100644 --- a/BizHawk.sln.DotSettings +++ b/BizHawk.sln.DotSettings @@ -291,6 +291,7 @@ True True True + True True True True