diff --git a/BizHawk.Client.Common/BinarySaveStates.cs b/BizHawk.Client.Common/BinarySaveStates.cs index d5f9b2a11f..22712d7a42 100644 --- a/BizHawk.Client.Common/BinarySaveStates.cs +++ b/BizHawk.Client.Common/BinarySaveStates.cs @@ -296,7 +296,7 @@ namespace BizHawk.Client.Common public void GetCoreState(Action callbackBinary, Action callbackText) { if (!GetLump(BinaryStateLump.Corestate, false, callbackBinary) - && !GetLump(BinaryStateLump.CorestateText, false, callbackText)) + && !GetLump(BinaryStateLump.CorestateText, false, callbackText)) { throw new Exception("Couldn't find Binary or Text savestate"); } diff --git a/BizHawk.Client.Common/ControllerBinding.cs b/BizHawk.Client.Common/ControllerBinding.cs index 90fac267ec..442b826399 100644 --- a/BizHawk.Client.Common/ControllerBinding.cs +++ b/BizHawk.Client.Common/ControllerBinding.cs @@ -21,7 +21,7 @@ namespace BizHawk.Client.Common public ControllerDefinition Definition => _type; - public bool IsPressed(string button) + public bool IsPressed(string button) { return _buttons[button]; } diff --git a/BizHawk.Client.Common/PathManager.cs b/BizHawk.Client.Common/PathManager.cs index 730502b64a..1f142ca82a 100644 --- a/BizHawk.Client.Common/PathManager.cs +++ b/BizHawk.Client.Common/PathManager.cs @@ -23,9 +23,9 @@ namespace BizHawk.Client.Common return path; } - /// - /// Makes a path relative to the %exe% directory - /// + /// + /// Makes a path relative to the %exe% directory + /// public static string MakeProgramRelativePath(string path) { return MakeAbsolutePath("%exe%/" + path, null); diff --git a/BizHawk.Client.Common/QuickBmpFile.cs b/BizHawk.Client.Common/QuickBmpFile.cs index 47e7299f23..f3b0c2d4fd 100644 --- a/BizHawk.Client.Common/QuickBmpFile.cs +++ b/BizHawk.Client.Common/QuickBmpFile.cs @@ -207,18 +207,18 @@ namespace BizHawk.Client.Common /// public class LoadedBMP : IVideoProvider { - public int[] VideoBuffer { get; set; } + public int[] VideoBuffer { get; set; } - public int[] GetVideoBuffer() - { - return VideoBuffer; - } + public int[] GetVideoBuffer() + { + return VideoBuffer; + } - public int VirtualWidth => BufferWidth; + public int VirtualWidth => BufferWidth; - public int VirtualHeight => BufferHeight; + public int VirtualHeight => BufferHeight; - public int BufferWidth { get; set; } + public int BufferWidth { get; set; } public int BufferHeight { get; set; } public int BackgroundColor => unchecked((int)0xff000000); } diff --git a/BizHawk.Client.Common/RecentFiles.cs b/BizHawk.Client.Common/RecentFiles.cs index 75c97d12cd..791f069b2d 100644 --- a/BizHawk.Client.Common/RecentFiles.cs +++ b/BizHawk.Client.Common/RecentFiles.cs @@ -33,13 +33,13 @@ namespace BizHawk.Client.Common [JsonIgnore] public bool Empty => !recentlist.Any(); - [JsonIgnore] + [JsonIgnore] public int Count => recentlist.Count; - [JsonIgnore] + [JsonIgnore] public string MostRecent => recentlist.Any() ? recentlist[0] : string.Empty; - public string this[int index] + public string this[int index] { get { diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index dceeb2b93c..1c6f53a30d 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -59,7 +59,7 @@ namespace BizHawk.Client.Common private void DoMessageCallback(string message) { - MessageCallback?.Invoke(message); + MessageCallback?.Invoke(message); } // TODO: reconsider the need for exposing these; @@ -636,7 +636,7 @@ namespace BizHawk.Client.Common nextEmulator.CoreComm.RomStatusDetails = sw.ToString(); game = new GameInfo { - Name = Path.GetFileNameWithoutExtension(file.Name), + Name = Path.GetFileNameWithoutExtension(file.Name), System = "PSX" }; break; diff --git a/BizHawk.Client.Common/SystemInfo.cs b/BizHawk.Client.Common/SystemInfo.cs index 937d953bb7..0198701e03 100644 --- a/BizHawk.Client.Common/SystemInfo.cs +++ b/BizHawk.Client.Common/SystemInfo.cs @@ -316,21 +316,21 @@ namespace BizHawk.Client.Common /// public JoypadButton AvailableButtons => _AvailableButtons; - /// + /// /// Gets the sytem name as /// public string DisplayName => _DisplayName; - /// + /// /// Gets the maximum amount of controller allowed for this system /// public int MaxControllers => _MaxControllers; - /// + /// /// Gets core used for this system as enum /// public CoreSystem System => _System; - #endregion + #endregion } } diff --git a/BizHawk.Client.Common/config/ConfigService.cs b/BizHawk.Client.Common/config/ConfigService.cs index 112349a557..b8ddccca82 100644 --- a/BizHawk.Client.Common/config/ConfigService.cs +++ b/BizHawk.Client.Common/config/ConfigService.cs @@ -92,7 +92,7 @@ namespace BizHawk.Client.Common // in the case of trying to deserialize nothing, tne will be nothing // we want to return nothing - return tne?.o; + return tne?.o; } } diff --git a/BizHawk.Client.Common/config/PathEntry.cs b/BizHawk.Client.Common/config/PathEntry.cs index a9779b3fe7..34a9cbf902 100644 --- a/BizHawk.Client.Common/config/PathEntry.cs +++ b/BizHawk.Client.Common/config/PathEntry.cs @@ -126,7 +126,7 @@ namespace BizHawk.Client.Common } } - private static string ResolveToolsPath(string subPath) + private static string ResolveToolsPath(string subPath) { if (Path.IsPathRooted(subPath)) { @@ -166,7 +166,7 @@ namespace BizHawk.Client.Common // this one is special public string GlobalBaseFragment => Global.Config.PathEntries["Global", "Base"].Path; - public static List DefaultValues => new List + public static List DefaultValues => new List { new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Base", Path = ".", Ordinal = 1 }, new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "ROM", Path = ".", Ordinal = 2 }, diff --git a/BizHawk.Client.Common/inputAdapters/BitwiseAdapters.cs b/BizHawk.Client.Common/inputAdapters/BitwiseAdapters.cs index fef8b9d401..4987babdff 100644 --- a/BizHawk.Client.Common/inputAdapters/BitwiseAdapters.cs +++ b/BizHawk.Client.Common/inputAdapters/BitwiseAdapters.cs @@ -6,7 +6,7 @@ namespace BizHawk.Client.Common { public ControllerDefinition Definition => Source.Definition; - public bool IsPressed(string button) + public bool IsPressed(string button) { if (Source != null && SourceAnd != null) { @@ -31,7 +31,7 @@ namespace BizHawk.Client.Common { public ControllerDefinition Definition => Source.Definition; - public bool IsPressed(string button) + public bool IsPressed(string button) { return (Source?.IsPressed(button) ?? false) | (SourceOr?.IsPressed(button) ?? false); diff --git a/BizHawk.Client.Common/inputAdapters/CopyController.cs b/BizHawk.Client.Common/inputAdapters/CopyController.cs index 709ce9d1d8..e1be847648 100644 --- a/BizHawk.Client.Common/inputAdapters/CopyController.cs +++ b/BizHawk.Client.Common/inputAdapters/CopyController.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common { public ControllerDefinition Definition => Curr.Definition; - public bool IsPressed(string button) + public bool IsPressed(string button) { return Curr.IsPressed(button); } diff --git a/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs b/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs index 4963ab651e..34b290ac09 100644 --- a/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs +++ b/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs @@ -19,7 +19,7 @@ namespace BizHawk.Client.Common { public ControllerDefinition Definition => Source.Definition; - public bool IsPressed(string button) + public bool IsPressed(string button) { return Source.StickyIsInEffect(button) || SourceStickyOr.StickyIsInEffect(button); @@ -55,7 +55,7 @@ namespace BizHawk.Client.Common public ControllerDefinition Definition => Source.Definition; - public bool IsPressed(string button) + public bool IsPressed(string button) { var source = Source.IsPressed(button); source ^= stickySet.Contains(button); @@ -282,7 +282,7 @@ namespace BizHawk.Client.Common public HashSet CurrentStickies => new HashSet(_boolPatterns.Keys); - public void ClearStickies() + public void ClearStickies() { _boolPatterns.Clear(); _floatPatterns.Clear(); diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Bit.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Bit.cs index a7efe23b01..966cb58a55 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Bit.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Bit.cs @@ -16,7 +16,7 @@ namespace BizHawk.Client.Common public override string Name => "bit"; - [LuaMethodAttributes( + [LuaMethodAttributes( "band", "Bitwise AND of 'val' against 'amt'" )] diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs index 9ea964b6c0..ae37751a1a 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs @@ -45,7 +45,7 @@ namespace BizHawk.Client.Common public override string Name => "emu"; - [LuaMethodAttributes( + [LuaMethodAttributes( "displayvsync", "Sets the display vsync property of the emulator" )] diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Events.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Events.cs index 77fd445d92..37dea1ac11 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Events.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Events.cs @@ -32,7 +32,7 @@ namespace BizHawk.Client.Common public override string Name => "event"; - #region Events Library Helpers + #region Events Library Helpers public void CallExitEvent(Lua thread) { diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs index 76b67ab5ff..79703900a1 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.Common public override string Name => "gameinfo"; - [LuaMethodAttributes( + [LuaMethodAttributes( "getromname", "returns the path of the currently loaded rom, if a rom is loaded" )] diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Genesis.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Genesis.cs index 3359c80f08..09dda7fddd 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Genesis.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Genesis.cs @@ -20,7 +20,7 @@ namespace BizHawk.Client.Common public override string Name => "genesis"; - private GPGX.GPGXSettings GetSettings() + private GPGX.GPGXSettings GetSettings() { if (Genesis != null) { @@ -32,7 +32,7 @@ namespace BizHawk.Client.Common private void PutSettings(GPGX.GPGXSettings settings) { - Genesis?.PutSettings(settings); + Genesis?.PutSettings(settings); } [LuaMethodAttributes( diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs index 76348b99cd..e24346f73f 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Joypad.cs @@ -13,7 +13,7 @@ namespace BizHawk.Client.Common public override string Name => "joypad"; - [LuaMethodAttributes( + [LuaMethodAttributes( "get", "returns a lua table of the controller buttons pressed. If supplied, it will only return a table of buttons for the given controller" )] diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.MainMemory.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.MainMemory.cs index 2a514f905a..9e1063e859 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.MainMemory.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.MainMemory.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.Common public override string Name => "mainmemory"; - protected override MemoryDomain Domain + protected override MemoryDomain Domain { get { diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs index c8ef9528aa..489f66d580 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs @@ -26,7 +26,7 @@ namespace BizHawk.Client.Common public override string Name => "memory"; - protected override MemoryDomain Domain + protected override MemoryDomain Domain { get { diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.MemorySavestate.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.MemorySavestate.cs index 5840b106cb..e84348f7d7 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.MemorySavestate.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.MemorySavestate.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.Common public override string Name => "memorysavestate"; - private readonly Dictionary MemorySavestates = new Dictionary(); + private readonly Dictionary MemorySavestates = new Dictionary(); [RequiredService] private IStatable _statableCore { get; set; } diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs index 4d4f60abd5..71dc1f7ea9 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs @@ -15,7 +15,7 @@ namespace BizHawk.Client.Common public override string Name => "movie"; - [LuaMethodAttributes( + [LuaMethodAttributes( "startsfromsavestate", "Returns whether or not the movie is a savestate-anchored movie" )] diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.NES.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.NES.cs index 87dc1002d5..930c7d786f 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.NES.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.NES.cs @@ -31,14 +31,14 @@ namespace BizHawk.Client.Common private bool NESAvailable => _neshawk != null || _quicknes != null; - private bool HasMemoryDOmains => _memoryDomains != null; + private bool HasMemoryDOmains => _memoryDomains != null; - public NesLuaLibrary(Lua lua, Action logOutputCallback) + public NesLuaLibrary(Lua lua, Action logOutputCallback) : base(lua, logOutputCallback) { } public override string Name => "nes"; - [LuaMethodAttributes( + [LuaMethodAttributes( "addgamegenie", "Adds the specified game genie code. If an NES game is not currently loaded or the code is not a valid game genie code, this will have no effect" )] diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.SNES.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.SNES.cs index ff5f5e540c..0f0c0193f2 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.SNES.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.SNES.cs @@ -20,7 +20,7 @@ namespace BizHawk.Client.Common public override string Name => "snes"; - private LibsnesCore.SnesSettings GetSettings() + private LibsnesCore.SnesSettings GetSettings() { if (Snes != null) { diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs index 3bdc06ec35..c3f870cecc 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs @@ -11,7 +11,7 @@ namespace BizHawk.Client.Common { public override string Name => "bizstring"; - public StringLuaLibrary(Lua lua) + public StringLuaLibrary(Lua lua) : base(lua) { } public StringLuaLibrary(Lua lua, Action logOutputCallback) diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs index 4d941681f0..e342a12849 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs @@ -21,7 +21,7 @@ namespace BizHawk.Client.EmuHawk public override string Name => "userdata"; - [LuaMethodAttributes( + [LuaMethodAttributes( "set", "adds or updates the data with the given key with the given value" )] diff --git a/BizHawk.Client.Common/lua/LuaDocumentation.cs b/BizHawk.Client.Common/lua/LuaDocumentation.cs index 6f83d44422..0861048fcf 100644 --- a/BizHawk.Client.Common/lua/LuaDocumentation.cs +++ b/BizHawk.Client.Common/lua/LuaDocumentation.cs @@ -182,11 +182,11 @@ __Types and notation__ public MethodInfo Method => _method; - public string Name => _luaAttributes.Name; + public string Name => _luaAttributes.Name; - public string Description => _luaAttributes.Description; + public string Description => _luaAttributes.Description; - private string _paramterList = null; + private string _paramterList = null; public string ParameterList { diff --git a/BizHawk.Client.Common/lua/LuaFile.cs b/BizHawk.Client.Common/lua/LuaFile.cs index 7f31bcf2bd..c626c4cd26 100644 --- a/BizHawk.Client.Common/lua/LuaFile.cs +++ b/BizHawk.Client.Common/lua/LuaFile.cs @@ -46,7 +46,7 @@ public static LuaFile SeparatorInstance => new LuaFile(true); - public void Stop() + public void Stop() { State = RunState.Disabled; Thread = null; diff --git a/BizHawk.Client.Common/lua/LuaFileList.cs b/BizHawk.Client.Common/lua/LuaFileList.cs index 135fb0a6d1..7d9a2a135d 100644 --- a/BizHawk.Client.Common/lua/LuaFileList.cs +++ b/BizHawk.Client.Common/lua/LuaFileList.cs @@ -117,9 +117,9 @@ namespace BizHawk.Client.Common ForEach(lua => Global.Config.RecentLua.Add(lua.Path)); _filename = path; - LoadCallback?.Invoke(); + LoadCallback?.Invoke(); - return true; + return true; } return false; diff --git a/BizHawk.Client.Common/lua/LuaSandbox.cs b/BizHawk.Client.Common/lua/LuaSandbox.cs index bcfe17d1b8..c73bbccd78 100644 --- a/BizHawk.Client.Common/lua/LuaSandbox.cs +++ b/BizHawk.Client.Common/lua/LuaSandbox.cs @@ -92,7 +92,7 @@ namespace BizHawk.Client.Common { Console.WriteLine(ex); Logger(ex.ToString()); - exceptionCallback?.Invoke(); + exceptionCallback?.Invoke(); } finally { diff --git a/BizHawk.Client.Common/lua/NamedLuaFunction.cs b/BizHawk.Client.Common/lua/NamedLuaFunction.cs index a1441b7da6..c7b6db432e 100644 --- a/BizHawk.Client.Common/lua/NamedLuaFunction.cs +++ b/BizHawk.Client.Common/lua/NamedLuaFunction.cs @@ -7,7 +7,7 @@ namespace BizHawk.Client.Common { private readonly LuaFunction _function; - public NamedLuaFunction(LuaFunction function, string theevent, Action logCallback, Lua lua, string name = null) + public NamedLuaFunction(LuaFunction function, string theevent, Action logCallback, Lua lua, string name = null) { _function = function; Name = name ?? "Anonymous"; @@ -36,13 +36,13 @@ namespace BizHawk.Client.Common public string Name { get; } - public Lua Lua { get; } + public Lua Lua { get; } public string Event { get; } - public Action Callback { get; } + public Action Callback { get; } - public void Call(string name = null) + public void Call(string name = null) { LuaSandbox.Sandbox(Lua, () => { diff --git a/BizHawk.Client.Common/movie/MultitrackRecording.cs b/BizHawk.Client.Common/movie/MultitrackRecording.cs index ed5632de7e..226c3351e8 100644 --- a/BizHawk.Client.Common/movie/MultitrackRecording.cs +++ b/BizHawk.Client.Common/movie/MultitrackRecording.cs @@ -95,9 +95,9 @@ namespace BizHawk.Client.Common public ControllerDefinition Definition => Source.Definition; - public bool this[string button] => IsPressed(button); + public bool this[string button] => IsPressed(button); - public bool IsPressed(string button) + public bool IsPressed(string button) { return Source.IsPressed(RemapButtonName(button)); } diff --git a/BizHawk.Client.Common/movie/Subtitle.cs b/BizHawk.Client.Common/movie/Subtitle.cs index 0096ff3ad1..92be032c85 100644 --- a/BizHawk.Client.Common/movie/Subtitle.cs +++ b/BizHawk.Client.Common/movie/Subtitle.cs @@ -104,6 +104,6 @@ namespace BizHawk.Client.Common sb.Append("\r\n"); return sb.ToString(); - } + } } } diff --git a/BizHawk.Client.Common/movie/SubtitleList.cs b/BizHawk.Client.Common/movie/SubtitleList.cs index cf11d973f3..b2894c7b7b 100644 --- a/BizHawk.Client.Common/movie/SubtitleList.cs +++ b/BizHawk.Client.Common/movie/SubtitleList.cs @@ -74,9 +74,9 @@ namespace BizHawk.Client.Common }); } - public string ToSubRip(double fps) - { - int index = 1; + public string ToSubRip(double fps) + { + int index = 1; var sb = new StringBuilder(); List subs = new List(); foreach (var subtitle in this) @@ -116,7 +116,7 @@ namespace BizHawk.Client.Common foreach (var subtitle in subs) sb.Append(subtitle.ToSubRip(index++, fps, AddColorTag)); - return sb.ToString(); - } + return sb.ToString(); + } } } \ No newline at end of file diff --git a/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs b/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs index fb74bd385e..5bb376ac36 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs @@ -21,7 +21,7 @@ namespace BizHawk.Client.Common public IMovieController MovieControllerAdapter => new Bk2ControllerAdapter(_logKey); - #region ILogEntryGenerator Implementation + #region ILogEntryGenerator Implementation public void SetSource(IController source) { @@ -35,9 +35,9 @@ namespace BizHawk.Client.Common public bool IsEmpty => EmptyEntry == GenerateLogEntry(); - public string EmptyEntry => CreateLogEntry(createEmpty: true); + public string EmptyEntry => CreateLogEntry(createEmpty: true); - public string GenerateLogEntry() + public string GenerateLogEntry() { return CreateLogEntry(); } diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.ModeApi.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.ModeApi.cs index 99a5d9a1a4..2945307c39 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.ModeApi.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.ModeApi.cs @@ -9,13 +9,13 @@ namespace BizHawk.Client.Common public bool IsActive => _mode != Moviemode.Inactive; - public bool IsPlaying => _mode == Moviemode.Play || _mode == Moviemode.Finished; + public bool IsPlaying => _mode == Moviemode.Play || _mode == Moviemode.Finished; - public bool IsRecording => _mode == Moviemode.Record; + public bool IsRecording => _mode == Moviemode.Record; - public bool IsFinished => _mode == Moviemode.Finished; + public bool IsFinished => _mode == Moviemode.Finished; - public virtual void StartNewRecording() + public virtual void StartNewRecording() { _mode = Moviemode.Record; if (Global.Config.EnableBackupMovies && MakeBackup && _log.Any()) diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs index 1baa11da3d..23b289b8aa 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs @@ -48,7 +48,7 @@ namespace BizHawk.Client.Common public virtual string PreferredExtension => Extension; - public const string Extension = "bk2"; + public const string Extension = "bk2"; public virtual bool Changes { get; protected set; } public bool IsCountingRerecords { get; set; } @@ -73,7 +73,7 @@ namespace BizHawk.Client.Common public int InputLogLength => _log.Count; - #region Log Editing + #region Log Editing public void AppendFrame(IController source) { diff --git a/BizHawk.Client.Common/movie/bk2/StringLogs.cs b/BizHawk.Client.Common/movie/bk2/StringLogs.cs index 3df10d02c8..97b8a11a09 100644 --- a/BizHawk.Client.Common/movie/bk2/StringLogs.cs +++ b/BizHawk.Client.Common/movie/bk2/StringLogs.cs @@ -104,7 +104,7 @@ namespace BizHawk.Client.Common public int Count => Offsets.Count; - public void Clear() + public void Clear() { stream.SetLength(0); Offsets.Clear(); diff --git a/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs b/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs index b878d283b9..c75bcda530 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs @@ -279,7 +279,7 @@ namespace BizHawk.Client.Common private string ControlType => Definition.Name; - private void SetGBAControllersAsMnemonic(string mnemonic) + private void SetGBAControllersAsMnemonic(string mnemonic) { MnemonicChecker c = new MnemonicChecker(mnemonic); MyBoolButtons.Clear(); diff --git a/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs b/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs index ff1a8a187d..ec014f7cc7 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs @@ -205,7 +205,7 @@ namespace BizHawk.Client.Common public bool IsEmpty => EmptyEntry == GenerateLogEntry(); - public string EmptyEntry + public string EmptyEntry { get { @@ -256,7 +256,7 @@ namespace BizHawk.Client.Common public IMovieController MovieControllerAdapter => new BkmControllerAdapter(); - #region Privates + #region Privates private bool IsBasePressed(string name) { diff --git a/BizHawk.Client.Common/movie/bkm/BkmMnemonicConstants.cs b/BizHawk.Client.Common/movie/bkm/BkmMnemonicConstants.cs index f158e27455..e2334999a7 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMnemonicConstants.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMnemonicConstants.cs @@ -80,7 +80,7 @@ namespace BizHawk.Client.Common {"0", "0"}, {"1", "1"}, {"2", "2"}, {"3", "3"}, {"4", "4"}, {"5", "5"}, {"6", "6"}, {"7", "7"}, {"8", "8"}, {"9", "9"}, {"DOT", "`"}, {"ON", "O"}, {"ENTER", "="}, {"UP", "U"}, {"DOWN", "D"}, {"LEFT", "L"}, {"RIGHT", "R"}, {"PLUS", "+"}, {"MINUS", "_"}, {"MULTIPLY", "*"}, {"DIVIDE", "/"}, - {"CLEAR", "c"}, {"EXP", "^"}, {"DASH", "-"}, {"PARAOPEN", "("}, {"PARACLOSE", ")"}, {"TAN", "T"}, + {"CLEAR", "c"}, {"EXP", "^"}, {"DASH", "-"}, {"PARAOPEN", "("}, {"PARACLOSE", ")"}, {"TAN", "T"}, {"VARS", "V"}, {"COS", "C"}, {"PRGM", "P"}, {"STAT", "s"}, {"MATRIX", "m"}, {"X", "X"}, {"STO", ">"}, {"LN", "n"}, {"LOG", "L"}, {"SQUARED", "2"}, {"NEG1", "1"}, {"MATH", "H"}, {"ALPHA", "A"}, {"GRAPH", "G"}, {"TRACE", "t"}, {"ZOOM", "Z"}, {"WINDOW", "W"}, {"Y", "Y"}, {"2ND", "&"}, {"MODE", "O"}, diff --git a/BizHawk.Client.Common/movie/bkm/BkmMovie.HeaderApi.cs b/BizHawk.Client.Common/movie/bkm/BkmMovie.HeaderApi.cs index c700e38895..3661b76c04 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMovie.HeaderApi.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMovie.HeaderApi.cs @@ -6,11 +6,11 @@ namespace BizHawk.Client.Common { public IDictionary HeaderEntries => Header; - public SubtitleList Subtitles => Header.Subtitles; + public SubtitleList Subtitles => Header.Subtitles; - public IList Comments => Header.Comments; + public IList Comments => Header.Comments; - public string SyncSettingsJson + public string SyncSettingsJson { get { return Header[HeaderKeys.SYNCSETTINGS]; } set { Header[HeaderKeys.SYNCSETTINGS] = value; } diff --git a/BizHawk.Client.Common/movie/bkm/BkmMovie.ModeApi.cs b/BizHawk.Client.Common/movie/bkm/BkmMovie.ModeApi.cs index bd5df0b42e..1dc77d9141 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMovie.ModeApi.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMovie.ModeApi.cs @@ -10,13 +10,13 @@ namespace BizHawk.Client.Common public bool IsPlaying => _mode == Moviemode.Play || _mode == Moviemode.Finished; - public bool IsRecording => _mode == Moviemode.Record; + public bool IsRecording => _mode == Moviemode.Record; - public bool IsActive => _mode != Moviemode.Inactive; + public bool IsActive => _mode != Moviemode.Inactive; - public bool IsFinished => _mode == Moviemode.Finished; + public bool IsFinished => _mode == Moviemode.Finished; - public void StartNewRecording() + public void StartNewRecording() { _mode = Moviemode.Record; if (Global.Config.EnableBackupMovies && _makeBackup && _log.Any()) diff --git a/BizHawk.Client.Common/movie/bkm/BkmMovie.cs b/BizHawk.Client.Common/movie/bkm/BkmMovie.cs index 6478acb5e9..c531f2757a 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMovie.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMovie.cs @@ -36,7 +36,7 @@ namespace BizHawk.Client.Common public string PreferredExtension => Extension; - public const string Extension = "bkm"; + public const string Extension = "bkm"; public BkmHeader Header { get; } public string Filename { get; set; } @@ -45,7 +45,7 @@ namespace BizHawk.Client.Common public int InputLogLength => _log.Count; - public double FrameCount + public double FrameCount { get { diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs index 98730e2a56..4c81a43ca1 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs @@ -344,10 +344,10 @@ namespace BizHawk.Client.Common Global.MovieSession.MovieControllerAdapter.LatchSticky(); var lg = LogGeneratorInstance(); - lg.SetSource(Global.MovieOutputHardpoint); // account for autohold. needs autohold pattern to be already recorded in the current frame + lg.SetSource(Global.MovieOutputHardpoint); // account for autohold. needs autohold pattern to be already recorded in the current frame for (int i = 0; i < numFrames; i++) - _log.Add(lg.GenerateLogEntry()); + _log.Add(lg.GenerateLogEntry()); Changes = true; diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 71cf6f3de2..ef79cf5af3 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -149,7 +149,7 @@ namespace BizHawk.Client.Common StateManager.Invalidate(frame + 1); Changes = true; // TODO check if this actually removed anything before flagging changes - if (anyInvalidated && Global.MovieSession.Movie.IsCountingRerecords) + if (anyInvalidated && Global.MovieSession.Movie.IsCountingRerecords) { base.Rerecords++; } diff --git a/BizHawk.Client.Common/tools/Cheat.cs b/BizHawk.Client.Common/tools/Cheat.cs index 386c48452b..8b4c8c900d 100644 --- a/BizHawk.Client.Common/tools/Cheat.cs +++ b/BizHawk.Client.Common/tools/Cheat.cs @@ -63,33 +63,33 @@ namespace BizHawk.Client.Common public static Cheat Separator => new Cheat(SeparatorWatch.Instance, 0, null, false); - public bool IsSeparator => _watch.IsSeparator; + public bool IsSeparator => _watch.IsSeparator; - public bool Enabled => !IsSeparator && _enabled; + public bool Enabled => !IsSeparator && _enabled; - public long? Address => _watch.Address; + public long? Address => _watch.Address; - public int? Value => IsSeparator ? (int?)null : _val; + public int? Value => IsSeparator ? (int?)null : _val; - public bool? BigEndian => IsSeparator ? (bool?)null : _watch.BigEndian; + public bool? BigEndian => IsSeparator ? (bool?)null : _watch.BigEndian; - public int? Compare => _compare.HasValue && !IsSeparator ? _compare : null; + public int? Compare => _compare.HasValue && !IsSeparator ? _compare : null; - public MemoryDomain Domain => _watch.Domain; + public MemoryDomain Domain => _watch.Domain; - public WatchSize Size => _watch.Size; + public WatchSize Size => _watch.Size; - public char SizeAsChar => _watch.SizeAsChar; + public char SizeAsChar => _watch.SizeAsChar; - public DisplayType Type => _watch.Type; + public DisplayType Type => _watch.Type; - public char TypeAsChar => _watch.TypeAsChar; + public char TypeAsChar => _watch.TypeAsChar; - public string Name => IsSeparator ? string.Empty : _watch.Notes; + public string Name => IsSeparator ? string.Empty : _watch.Notes; - public string AddressStr => _watch.AddressString; + public string AddressStr => _watch.AddressString; - public string ValueStr + public string ValueStr { get { @@ -134,7 +134,7 @@ namespace BizHawk.Client.Common public COMPARISONTYPE ComparisonType => _comparisonType; - public void Enable(bool handleChange = true) + public void Enable(bool handleChange = true) { if (!IsSeparator) { @@ -354,7 +354,7 @@ namespace BizHawk.Client.Common private void Changes() { - Changed?.Invoke(this); + Changed?.Invoke(this); } public override bool Equals(object obj) diff --git a/BizHawk.Client.Common/tools/CheatList.cs b/BizHawk.Client.Common/tools/CheatList.cs index 637634a41a..0ae2df92df 100644 --- a/BizHawk.Client.Common/tools/CheatList.cs +++ b/BizHawk.Client.Common/tools/CheatList.cs @@ -23,7 +23,7 @@ namespace BizHawk.Client.Common public int Count => _cheatList.Count; - public int CheatCount + public int CheatCount { get { return _cheatList.Count(x => !x.IsSeparator); } } @@ -52,11 +52,11 @@ namespace BizHawk.Client.Common public string CurrentFileName => _currentFileName; - public bool IsReadOnly => false; + public bool IsReadOnly => false; - public Cheat this[int index] => _cheatList[index]; + public Cheat this[int index] => _cheatList[index]; - public Cheat this[MemoryDomain domain, long address] + public Cheat this[MemoryDomain domain, long address] { get { diff --git a/BizHawk.Client.Common/tools/RamSearchEngine.cs b/BizHawk.Client.Common/tools/RamSearchEngine.cs index a765dd92b3..a624d48930 100644 --- a/BizHawk.Client.Common/tools/RamSearchEngine.cs +++ b/BizHawk.Client.Common/tools/RamSearchEngine.cs @@ -510,9 +510,9 @@ namespace BizHawk.Client.Common public bool CanUndo => _keepHistory && _history.CanUndo; - public bool CanRedo => _keepHistory && _history.CanRedo; + public bool CanRedo => _keepHistory && _history.CanRedo; - public void ClearHistory() + public void ClearHistory() { _history.Clear(); } @@ -945,7 +945,7 @@ namespace BizHawk.Client.Common public long Previous => _previous; - public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian) + public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian) { _previous = domain.PeekByte(Address % domain.Size); } @@ -986,7 +986,7 @@ namespace BizHawk.Client.Common public long Previous => _previous; - public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian) + public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian) { _previous = domain.PeekUint(Address, bigendian); } @@ -1013,9 +1013,9 @@ namespace BizHawk.Client.Common public long Previous => _previous; - public int ChangeCount => _changecount; + public int ChangeCount => _changecount; - public void Update(PreviousType type, MemoryDomain domain, bool bigendian) + public void Update(PreviousType type, MemoryDomain domain, bool bigendian) { var value = domain.PeekByte(Address % domain.Size); @@ -1068,9 +1068,9 @@ namespace BizHawk.Client.Common public long Previous => _previous; - public int ChangeCount => _changecount; + public int ChangeCount => _changecount; - public void Update(PreviousType type, MemoryDomain domain, bool bigendian) + public void Update(PreviousType type, MemoryDomain domain, bool bigendian) { var value = domain.PeekUshort(Address % domain.Size, bigendian); if (value != Previous) diff --git a/BizHawk.Client.Common/tools/Watch/ByteWatch.cs b/BizHawk.Client.Common/tools/Watch/ByteWatch.cs index f0fcc0cec3..93ac6d1873 100644 --- a/BizHawk.Client.Common/tools/Watch/ByteWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/ByteWatch.cs @@ -252,29 +252,29 @@ namespace BizHawk.Client.Common /// public override uint MaxValue => byte.MaxValue; - /// + /// /// Get the current value /// public override int Value => GetByte(); - /// + /// /// Gets the current value /// but with stuff I don't understand /// /// zero 15-nov-2015 - bypass LIAR LOGIC, see fdc9ea2aa922876d20ba897fb76909bf75fa6c92 https://github.com/TASVideos/BizHawk/issues/326 public override int ValueNoFreeze => GetByte(true); - /// + /// /// Get a string representation of the current value /// public override string ValueString => FormatValue(GetByte()); - /// + /// /// Get the previous value /// public override int Previous => _previous; - /// + /// /// Get a string representation of the previous value /// public override string PreviousStr => FormatValue(_previous); diff --git a/BizHawk.Client.Common/tools/Watch/DwordWatch.cs b/BizHawk.Client.Common/tools/Watch/DwordWatch.cs index 075931a620..a6050a0dad 100644 --- a/BizHawk.Client.Common/tools/Watch/DwordWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/DwordWatch.cs @@ -262,38 +262,38 @@ namespace BizHawk.Client.Common /// public override string Diff => FormatValue(_previous - _value); - /// + /// /// Get the maximum possible value /// public override uint MaxValue => uint.MaxValue; - /// + /// /// Get the current value /// public override int Value => (int)GetDWord(); - /// + /// /// Gets the current value /// but with stuff I don't understand /// public override int ValueNoFreeze => (int)GetDWord(true); - /// + /// /// Get a string representation of the current value /// public override string ValueString => FormatValue(GetDWord()); - /// + /// /// Get the previous value /// public override int Previous => (int)_previous; - /// + /// /// Get a string representation of the previous value /// public override string PreviousStr => FormatValue(_previous); - #endregion Implements + #endregion Implements #endregion } diff --git a/BizHawk.Client.EmuHawk/AboutBox.cs b/BizHawk.Client.EmuHawk/AboutBox.cs index 1c6b3be5de..5229ca78c8 100644 --- a/BizHawk.Client.EmuHawk/AboutBox.cs +++ b/BizHawk.Client.EmuHawk/AboutBox.cs @@ -160,8 +160,8 @@ namespace BizHawk.Client.EmuHawk 0,0,0,0,0,0,0,0,0,0, 0,0,0,0}; - private void AboutBox_Load(object sender, EventArgs e) - { + private void AboutBox_Load(object sender, EventArgs e) + { #if DEBUG Text = "BizHawk Developer Build (DEBUG MODE) GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH; #else diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll.cs index d45bbfd577..a09bb32df5 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll.cs @@ -1071,7 +1071,7 @@ namespace BizHawk.Client.EmuHawk { if (ModifierKeys == Keys.Alt) { - // do marker drag here + // do marker drag here } else if (ModifierKeys == Keys.Shift) { diff --git a/BizHawk.Client.EmuHawk/Input/GamePad360.cs b/BizHawk.Client.EmuHawk/Input/GamePad360.cs index 65ae025514..ab0a4a2d2a 100644 --- a/BizHawk.Client.EmuHawk/Input/GamePad360.cs +++ b/BizHawk.Client.EmuHawk/Input/GamePad360.cs @@ -125,14 +125,14 @@ namespace BizHawk.Client.EmuHawk // ********************************** Instance Members ********************************** readonly Controller controller; - uint index0; + uint index0; XINPUT_STATE state; - public int PlayerNumber { get { return (int)index0 + 1; } } + public int PlayerNumber { get { return (int)index0 + 1; } } GamePad360(uint index0, Controller c) { - this.index0 = index0; + this.index0 = index0; controller = c; InitializeButtons(); Update(); diff --git a/BizHawk.Client.EmuHawk/Watch.cs b/BizHawk.Client.EmuHawk/Watch.cs index f76c1f3765..789632b08e 100644 --- a/BizHawk.Client.EmuHawk/Watch.cs +++ b/BizHawk.Client.EmuHawk/Watch.cs @@ -5,105 +5,105 @@ using System.Text; namespace BizHawk.Client.EmuHawk { - //Data structure for a watch item in the RAM Watch Dialog - public enum atype { BYTE, WORD, DWORD, SEPARATOR }; //TODO: more custom types too like 12.4 and 24.12 fixed point - public enum asigned { SIGNED, UNSIGNED, HEX }; - public class Watch - { - public Watch() - { - address = 0; - value = 0; - type = atype.BYTE; - signed = asigned.UNSIGNED; - bigendian = true; - notes = ""; - } - public Watch(int Address, int Value, atype Type, asigned Signed, bool BigEndian, string Notes) - { - address = Address; - value = Value; - type = Type; - signed = Signed; - bigendian = BigEndian; - notes = Notes; - } - public int address { get; set; } - public int value { get; set; } //Current value - public atype type { get; set; } //Address type (byte, word, dword, etc - public asigned signed { get; set; } //Signed/Unsigned? - public bool bigendian { get; set; } - public string notes { get; set; } //User notes + //Data structure for a watch item in the RAM Watch Dialog + public enum atype { BYTE, WORD, DWORD, SEPARATOR }; //TODO: more custom types too like 12.4 and 24.12 fixed point + public enum asigned { SIGNED, UNSIGNED, HEX }; + public class Watch + { + public Watch() + { + address = 0; + value = 0; + type = atype.BYTE; + signed = asigned.UNSIGNED; + bigendian = true; + notes = ""; + } + public Watch(int Address, int Value, atype Type, asigned Signed, bool BigEndian, string Notes) + { + address = Address; + value = Value; + type = Type; + signed = Signed; + bigendian = BigEndian; + notes = Notes; + } + public int address { get; set; } + public int value { get; set; } //Current value + public atype type { get; set; } //Address type (byte, word, dword, etc + public asigned signed { get; set; } //Signed/Unsigned? + public bool bigendian { get; set; } + public string notes { get; set; } //User notes - public bool SetTypeByChar(char c) //b = byte, w = word, d = dword - { - switch (c) - { - case 'b': - type = atype.BYTE; - return true; - case 'w': - type = atype.WORD; - return true; - case 'd': - type = atype.DWORD; - return true; - case 'S': - type = atype.SEPARATOR; - return true; - default: - return false; - } - } + public bool SetTypeByChar(char c) //b = byte, w = word, d = dword + { + switch (c) + { + case 'b': + type = atype.BYTE; + return true; + case 'w': + type = atype.WORD; + return true; + case 'd': + type = atype.DWORD; + return true; + case 'S': + type = atype.SEPARATOR; + return true; + default: + return false; + } + } - public char GetTypeByChar() - { - switch (type) - { - case atype.BYTE: - return 'b'; - case atype.WORD: - return 'w'; - case atype.DWORD: - return 'd'; - case atype.SEPARATOR: - return 'S'; - default: - return 'b'; //Just in case - } - } + public char GetTypeByChar() + { + switch (type) + { + case atype.BYTE: + return 'b'; + case atype.WORD: + return 'w'; + case atype.DWORD: + return 'd'; + case atype.SEPARATOR: + return 'S'; + default: + return 'b'; //Just in case + } + } - public bool SetSignedByChar(char c) //s = signed, u = unsigned, h = hex - { - switch (c) - { - case 's': - signed = asigned.SIGNED; - return true; - case 'u': - signed = asigned.UNSIGNED; - return true; - case 'h': - signed = asigned.HEX; - return true; - default: - return false; - } - } + public bool SetSignedByChar(char c) //s = signed, u = unsigned, h = hex + { + switch (c) + { + case 's': + signed = asigned.SIGNED; + return true; + case 'u': + signed = asigned.UNSIGNED; + return true; + case 'h': + signed = asigned.HEX; + return true; + default: + return false; + } + } - public char GetSignedByChar() - { - switch (signed) - { - case asigned.SIGNED: - return 's'; - case asigned.UNSIGNED: - return 'u'; - case asigned.HEX: - return 'h'; - default: - return 's'; //Just in case - } - } - } + public char GetSignedByChar() + { + switch (signed) + { + case asigned.SIGNED: + return 's'; + case asigned.UNSIGNED: + return 'u'; + case asigned.HEX: + return 'h'; + default: + return 's'; //Just in case + } + } + } } diff --git a/BizHawk.Client.EmuHawk/config/MessageConfig.cs b/BizHawk.Client.EmuHawk/config/MessageConfig.cs index 2573ec1b27..29b8217fa5 100644 --- a/BizHawk.Client.EmuHawk/config/MessageConfig.cs +++ b/BizHawk.Client.EmuHawk/config/MessageConfig.cs @@ -423,34 +423,34 @@ namespace BizHawk.Client.EmuHawk { Global.Config.DispFPSx = Config.DefaultMessageOptions.DispFPSx; Global.Config.DispFPSy = Config.DefaultMessageOptions.DispFPSy; - Global.Config.DispFrameCx = Config.DefaultMessageOptions.DispFrameCx; - Global.Config.DispFrameCy = Config.DefaultMessageOptions.DispFrameCy; - Global.Config.DispLagx = Config.DefaultMessageOptions.DispLagx; - Global.Config.DispLagy = Config.DefaultMessageOptions.DispLagy; - Global.Config.DispInpx = Config.DefaultMessageOptions.DispInpx; - Global.Config.DispInpy = Config.DefaultMessageOptions.DispInpy; - Global.Config.DispRecx = Config.DefaultMessageOptions.DispRecx; - Global.Config.DispRecy = Config.DefaultMessageOptions.DispRecy; - Global.Config.DispMultix = Config.DefaultMessageOptions.DispMultix; - Global.Config.DispMultiy = Config.DefaultMessageOptions.DispMultiy; - Global.Config.DispMessagex = Config.DefaultMessageOptions.DispMessagex; - Global.Config.DispMessagey = Config.DefaultMessageOptions.DispMessagey; - Global.Config.DispAutoholdx = Config.DefaultMessageOptions.DispAutoholdx; - Global.Config.DispAutoholdy = Config.DefaultMessageOptions.DispAutoholdy; + Global.Config.DispFrameCx = Config.DefaultMessageOptions.DispFrameCx; + Global.Config.DispFrameCy = Config.DefaultMessageOptions.DispFrameCy; + Global.Config.DispLagx = Config.DefaultMessageOptions.DispLagx; + Global.Config.DispLagy = Config.DefaultMessageOptions.DispLagy; + Global.Config.DispInpx = Config.DefaultMessageOptions.DispInpx; + Global.Config.DispInpy = Config.DefaultMessageOptions.DispInpy; + Global.Config.DispRecx = Config.DefaultMessageOptions.DispRecx; + Global.Config.DispRecy = Config.DefaultMessageOptions.DispRecy; + Global.Config.DispMultix = Config.DefaultMessageOptions.DispMultix; + Global.Config.DispMultiy = Config.DefaultMessageOptions.DispMultiy; + Global.Config.DispMessagex = Config.DefaultMessageOptions.DispMessagex; + Global.Config.DispMessagey = Config.DefaultMessageOptions.DispMessagey; + Global.Config.DispAutoholdx = Config.DefaultMessageOptions.DispAutoholdx; + Global.Config.DispAutoholdy = Config.DefaultMessageOptions.DispAutoholdy; - Global.Config.DispFPSanchor = Config.DefaultMessageOptions.DispFPSanchor; - Global.Config.DispFrameanchor = Config.DefaultMessageOptions.DispFrameanchor; - Global.Config.DispLaganchor = Config.DefaultMessageOptions.DispLaganchor; - Global.Config.DispInpanchor = Config.DefaultMessageOptions.DispInpanchor; - Global.Config.DispRecanchor = Config.DefaultMessageOptions.DispRecanchor; - Global.Config.DispMultianchor = Config.DefaultMessageOptions.DispMultianchor; - Global.Config.DispMessageanchor = Config.DefaultMessageOptions.DispMessageanchor; - Global.Config.DispAutoholdanchor = Config.DefaultMessageOptions.DispAutoholdanchor; + Global.Config.DispFPSanchor = Config.DefaultMessageOptions.DispFPSanchor; + Global.Config.DispFrameanchor = Config.DefaultMessageOptions.DispFrameanchor; + Global.Config.DispLaganchor = Config.DefaultMessageOptions.DispLaganchor; + Global.Config.DispInpanchor = Config.DefaultMessageOptions.DispInpanchor; + Global.Config.DispRecanchor = Config.DefaultMessageOptions.DispRecanchor; + Global.Config.DispMultianchor = Config.DefaultMessageOptions.DispMultianchor; + Global.Config.DispMessageanchor = Config.DefaultMessageOptions.DispMessageanchor; + Global.Config.DispAutoholdanchor = Config.DefaultMessageOptions.DispAutoholdanchor; - Global.Config.MessagesColor = Config.DefaultMessageOptions.MessagesColor; - Global.Config.AlertMessageColor = Config.DefaultMessageOptions.AlertMessageColor; - Global.Config.LastInputColor = Config.DefaultMessageOptions.LastInputColor; - Global.Config.MovieInput = Config.DefaultMessageOptions.MovieInput; + Global.Config.MessagesColor = Config.DefaultMessageOptions.MessagesColor; + Global.Config.AlertMessageColor = Config.DefaultMessageOptions.AlertMessageColor; + Global.Config.LastInputColor = Config.DefaultMessageOptions.LastInputColor; + Global.Config.MovieInput = Config.DefaultMessageOptions.MovieInput; _dispFpSx = Global.Config.DispFPSx; _dispFpSy = Global.Config.DispFPSy; @@ -476,17 +476,17 @@ namespace BizHawk.Client.EmuHawk _dispRecanchor = Global.Config.DispRecanchor; _dispMultiAnchor = Global.Config.DispMultianchor; _dispMessageAnchor = Global.Config.DispMessageanchor; - _dispAutoholdAnchor = Global.Config.DispAutoholdanchor; + _dispAutoholdAnchor = Global.Config.DispAutoholdanchor; - _messageColor = Global.Config.MessagesColor; - _alertColor = Global.Config.AlertMessageColor; - _lastInputColor = Global.Config.LastInputColor; - _movieInput = Global.Config.MovieInput; + _messageColor = Global.Config.MessagesColor; + _alertColor = Global.Config.AlertMessageColor; + _lastInputColor = Global.Config.LastInputColor; + _movieInput = Global.Config.MovieInput; - MessageColorDialog.Color = Color.FromArgb(_messageColor); - AlertColorDialog.Color = Color.FromArgb(_alertColor); - LInputColorDialog.Color = Color.FromArgb(_lastInputColor); - MovieInputColorDialog.Color = Color.FromArgb(_movieInput); + MessageColorDialog.Color = Color.FromArgb(_messageColor); + AlertColorDialog.Color = Color.FromArgb(_alertColor); + LInputColorDialog.Color = Color.FromArgb(_lastInputColor); + MovieInputColorDialog.Color = Color.FromArgb(_movieInput); SetMaxXY(); SetColorBox(); diff --git a/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs b/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs index 54306e6c9b..a0a5686108 100644 --- a/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs +++ b/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs @@ -64,7 +64,7 @@ namespace BizHawk.Client.EmuHawk private void Cancel_Click(object sender, EventArgs e) { // restore previous value - _nes.PutSettings(_oldSettings); + _nes.PutSettings(_oldSettings); Close(); } @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk { label6.Text = trackBar1.Value.ToString(); _settings.Square1 = trackBar1.Value; - _nes.PutSettings(_settings); + _nes.PutSettings(_settings); } private void trackBar2_ValueChanged(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs b/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs index 373a963add..f2f26b5b95 100644 --- a/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs +++ b/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs @@ -169,54 +169,54 @@ namespace BizHawk.Client.EmuHawk } } - private void Export_Click(object sender, EventArgs e) - { - // Get file to save as - var form = new SaveFileDialog(); - form.AddExtension = true; - form.Filter = "SubRip Files (*.srt)|*.srt|All files (*.*)|*.*"; + private void Export_Click(object sender, EventArgs e) + { + // Get file to save as + var form = new SaveFileDialog(); + form.AddExtension = true; + form.Filter = "SubRip Files (*.srt)|*.srt|All files (*.*)|*.*"; - var result = form.ShowDialog(); - var fileName = form.FileName; + var result = form.ShowDialog(); + var fileName = form.FileName; - form.Dispose(); + form.Dispose(); - if (result != System.Windows.Forms.DialogResult.OK) - return; + if (result != System.Windows.Forms.DialogResult.OK) + return; - // Fetch fps - var system = _selectedMovie.HeaderEntries[HeaderKeys.PLATFORM]; - var pal = _selectedMovie.HeaderEntries.ContainsKey(HeaderKeys.PAL) - && _selectedMovie.HeaderEntries[HeaderKeys.PAL] == "1"; - var pfr = new PlatformFrameRates(); - double fps = 1; + // Fetch fps + var system = _selectedMovie.HeaderEntries[HeaderKeys.PLATFORM]; + var pal = _selectedMovie.HeaderEntries.ContainsKey(HeaderKeys.PAL) + && _selectedMovie.HeaderEntries[HeaderKeys.PAL] == "1"; + var pfr = new PlatformFrameRates(); + double fps = 1; - try - { - fps = pfr[system, pal]; - } - catch - { - MessageBox.Show( - "Could not determine movie fps, export failed.", - "Error", - MessageBoxButtons.OK, - MessageBoxIcon.Error - ); + try + { + fps = pfr[system, pal]; + } + catch + { + MessageBox.Show( + "Could not determine movie fps, export failed.", + "Error", + MessageBoxButtons.OK, + MessageBoxIcon.Error + ); - return; - } + return; + } - // Create string and write to file - var str = _selectedMovie.Subtitles.ToSubRip(fps); - File.WriteAllText(fileName, str); + // Create string and write to file + var str = _selectedMovie.Subtitles.ToSubRip(fps); + File.WriteAllText(fileName, str); - // Display success - MessageBox.Show( - string.Format("Subtitles succesfully exported to {0}.", fileName), - "Success" - ); - } + // Display success + MessageBox.Show( + string.Format("Subtitles succesfully exported to {0}.", fileName), + "Success" + ); + } private void SubGrid_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e) { diff --git a/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index 79b4a5d7ea..bcdcf9a272 100644 --- a/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -96,7 +96,7 @@ namespace BizHawk.Client.EmuHawk Settings = new BasicBotSettings(); _comparisonBotAttempt = new BotAttempt(); - } + } private void BasicBot_Load(object sender, EventArgs e) { @@ -287,59 +287,59 @@ namespace BizHawk.Client.EmuHawk } } - public byte MainComparisonType - { - get - { - return (byte)MainOperator.SelectedIndex; - } - set - { - if (value < 5) MainOperator.SelectedIndex = value; - else MainOperator.SelectedIndex = 0; - } - } + public byte MainComparisonType + { + get + { + return (byte)MainOperator.SelectedIndex; + } + set + { + if (value < 5) MainOperator.SelectedIndex = value; + else MainOperator.SelectedIndex = 0; + } + } - public byte Tie1ComparisonType - { - get - { - return (byte)Tiebreak1Operator.SelectedIndex; - } - set - { - if (value < 5) Tiebreak1Operator.SelectedIndex = value; - else Tiebreak1Operator.SelectedIndex = 0; - } - } + public byte Tie1ComparisonType + { + get + { + return (byte)Tiebreak1Operator.SelectedIndex; + } + set + { + if (value < 5) Tiebreak1Operator.SelectedIndex = value; + else Tiebreak1Operator.SelectedIndex = 0; + } + } - public byte Tie2ComparisonType - { - get - { - return (byte)Tiebreak2Operator.SelectedIndex; - } - set - { - if (value < 5) Tiebreak2Operator.SelectedIndex = value; - else Tiebreak2Operator.SelectedIndex = 0; - } - } + public byte Tie2ComparisonType + { + get + { + return (byte)Tiebreak2Operator.SelectedIndex; + } + set + { + if (value < 5) Tiebreak2Operator.SelectedIndex = value; + else Tiebreak2Operator.SelectedIndex = 0; + } + } - public byte Tie3ComparisonType - { - get - { - return (byte)Tiebreak3Operator.SelectedIndex; - } - set - { - if (value < 5) Tiebreak3Operator.SelectedIndex = value; - else Tiebreak3Operator.SelectedIndex = 0; - } - } + public byte Tie3ComparisonType + { + get + { + return (byte)Tiebreak3Operator.SelectedIndex; + } + set + { + if (value < 5) Tiebreak3Operator.SelectedIndex = value; + else Tiebreak3Operator.SelectedIndex = 0; + } + } - public string FromSlot + public string FromSlot { get { @@ -449,10 +449,10 @@ namespace BizHawk.Client.EmuHawk TieBreaker2Address = 0; TieBreaker3Address = 0; StartFromSlotBox.SelectedIndex = 0; - MainOperator.SelectedIndex = 0; - Tiebreak1Operator.SelectedIndex = 0; - Tiebreak2Operator.SelectedIndex = 0; - Tiebreak3Operator.SelectedIndex = 0; + MainOperator.SelectedIndex = 0; + Tiebreak1Operator.SelectedIndex = 0; + Tiebreak2Operator.SelectedIndex = 0; + Tiebreak3Operator.SelectedIndex = 0; MainBestRadio.Checked = true; MainValueNumeric.Value = 0; TieBreak1Numeric.Value = 0; @@ -622,10 +622,10 @@ namespace BizHawk.Client.EmuHawk public int TieBreak1 { get; set; } public int TieBreak2 { get; set; } public int TieBreak3 { get; set; } - public byte ComparisonTypeMain { get; set; } - public byte ComparisonTypeTie1 { get; set; } - public byte ComparisonTypeTie2 { get; set; } - public byte ComparisonTypeTie3 { get; set; } + public byte ComparisonTypeMain { get; set; } + public byte ComparisonTypeTie1 { get; set; } + public byte ComparisonTypeTie2 { get; set; } + public byte ComparisonTypeTie3 { get; set; } public List Log { get; set; } } @@ -981,23 +981,23 @@ namespace BizHawk.Client.EmuHawk return true; } - private bool TestValue(byte operation, int currentValue, int bestValue) - { - switch (operation) - { - case 0: - return currentValue > bestValue; - case 1: - return currentValue >= bestValue; - case 2: - return currentValue == bestValue; - case 3: - return currentValue <= bestValue; - case 4: - return currentValue < bestValue; - } - return false; - } + private bool TestValue(byte operation, int currentValue, int bestValue) + { + switch (operation) + { + case 0: + return currentValue > bestValue; + case 1: + return currentValue >= bestValue; + case 2: + return currentValue == bestValue; + case 3: + return currentValue <= bestValue; + case 4: + return currentValue < bestValue; + } + return false; + } private void UpdateBestAttempt() { @@ -1088,7 +1088,7 @@ namespace BizHawk.Client.EmuHawk _cachedControlProbabilities = ControlProbabilities; _logGenerator = Global.MovieSession.LogGeneratorInstance(); _logGenerator.SetSource(Global.ClickyVirtualPadController); - } + } private bool CanStart() { @@ -1212,7 +1212,7 @@ namespace BizHawk.Client.EmuHawk if (TieBreak2BestRadio.Checked && _bestBotAttempt.TieBreak2 != _comparisonBotAttempt.TieBreak2) { _comparisonBotAttempt.TieBreak2 = _bestBotAttempt.TieBreak2; - } + } if (TieBreak3BestRadio.Checked && _bestBotAttempt.TieBreak3 != _comparisonBotAttempt.TieBreak3) { @@ -1228,7 +1228,7 @@ namespace BizHawk.Client.EmuHawk { this.MainValueNumeric.Enabled = false; _comparisonBotAttempt.Maximize = _bestBotAttempt == null ? 0 : _bestBotAttempt.Maximize; - } + } } private void Tiebreak1BestRadio_CheckedChanged(object sender, EventArgs e) @@ -1268,7 +1268,7 @@ namespace BizHawk.Client.EmuHawk { this.MainValueNumeric.Enabled = true; _comparisonBotAttempt.Maximize = (int)this.MainValueNumeric.Value; - } + } } private void TieBreak1ValueRadio_CheckedChanged(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/CDL.cs b/BizHawk.Client.EmuHawk/tools/CDL.cs index a2308fb7cc..e42e97fdc2 100644 --- a/BizHawk.Client.EmuHawk/tools/CDL.cs +++ b/BizHawk.Client.EmuHawk/tools/CDL.cs @@ -169,12 +169,12 @@ namespace BizHawk.Client.EmuHawk lvi[4] = string.Format("of {0} Bytes", kvp.Value.Length); for (int i = 0; i < 8; i++) { - if (tsbViewStyle.SelectedIndex == 0) - lvi[5 + i] = string.Format("{0:0.00}%", totals[i] / (float)kvp.Value.Length * 100f); - if (tsbViewStyle.SelectedIndex == 1) - lvi[5 + i] = string.Format("{0}", totals[i]); - if (tsbViewStyle.SelectedIndex == 2) - lvi[5 + i] = string.Format("{0:0.00}", totals[i] / 1024.0f); + if (tsbViewStyle.SelectedIndex == 0) + lvi[5 + i] = string.Format("{0:0.00}%", totals[i] / (float)kvp.Value.Length * 100f); + if (tsbViewStyle.SelectedIndex == 1) + lvi[5 + i] = string.Format("{0}", totals[i]); + if (tsbViewStyle.SelectedIndex == 2) + lvi[5 + i] = string.Format("{0:0.00}", totals[i] / 1024.0f); } } diff --git a/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs b/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs index 6e4064214e..217362e171 100644 --- a/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs +++ b/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs @@ -30,7 +30,7 @@ namespace BizHawk.Client.EmuHawk // other emulators use "vivid color" modes, such as: // r' = 8.25r // g' = 8.25g - // b' = 8.25b + // b' = 8.25b // gambatte doesn't modify these memory locations unless you reconstruct, so we can store private IntPtr _vram; diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index c2abbc5687..25f0b0aead 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -756,7 +756,7 @@ namespace BizHawk.Client.EmuHawk default: case 1: return Watch.GenerateWatch(_domain, address, WatchSize.Byte, Client.Common.DisplayType.Hex, BigEndian, string.Empty); - case 2: + case 2: return Watch.GenerateWatch(_domain, address, WatchSize.Word, Client.Common.DisplayType.Hex, BigEndian, string.Empty); case 4: return Watch.GenerateWatch(_domain, address, WatchSize.DWord, Client.Common.DisplayType.Hex, BigEndian, string.Empty); diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs index 4929f00187..96d6429d05 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs @@ -545,16 +545,16 @@ namespace BizHawk.Client.EmuHawk int? fontsize = null, string fontfamily = null, string fontstyle = null, - string horizalign = null, - string vertalign = null) + string horizalign = null, + string vertalign = null) { DrawText(x, y, message, forecolor, backcolor, fontsize, fontfamily, fontstyle, horizalign, vertalign); } [LuaMethodAttributes( "drawText", - "Draws the given message in the emulator screen space (like all draw functions) at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates." - )] + "Draws the given message in the emulator screen space (like all draw functions) at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates." + )] public void DrawText( int x, int y, @@ -564,8 +564,8 @@ namespace BizHawk.Client.EmuHawk int? fontsize = null, string fontfamily = null, string fontstyle = null, - string horizalign = null, - string vertalign = null) + string horizalign = null, + string vertalign = null) { using (var g = GetGraphics()) { @@ -600,42 +600,42 @@ namespace BizHawk.Client.EmuHawk } } - // The text isn't written out using GenericTypographic, so measuring it using GenericTypographic seemed to make it worse. - // And writing it out with GenericTypographic just made it uglier. :p - StringFormat f = new StringFormat(StringFormat.GenericDefault); - var font = new Font(family, fontsize ?? 12, fstyle, GraphicsUnit.Pixel); + // The text isn't written out using GenericTypographic, so measuring it using GenericTypographic seemed to make it worse. + // And writing it out with GenericTypographic just made it uglier. :p + StringFormat f = new StringFormat(StringFormat.GenericDefault); + var font = new Font(family, fontsize ?? 12, fstyle, GraphicsUnit.Pixel); Size sizeOfText = g.MeasureString(message, font, 0, f).ToSize(); - if (horizalign != null) - { - switch (horizalign.ToLower()) - { - default: - case "left": - break; - case "center": - x -= sizeOfText.Width / 2; - break; - case "right": - x -= sizeOfText.Width; - break; - } - } - if (vertalign != null) - { - switch (vertalign.ToLower()) - { - default: - case "bottom": - break; - case "middle": - y -= sizeOfText.Height / 2; - break; - case "top": - y -= sizeOfText.Height; - break; - } - } - Rectangle rect = new Rectangle(new Point(x, y), sizeOfText); + if (horizalign != null) + { + switch (horizalign.ToLower()) + { + default: + case "left": + break; + case "center": + x -= sizeOfText.Width / 2; + break; + case "right": + x -= sizeOfText.Width; + break; + } + } + if (vertalign != null) + { + switch (vertalign.ToLower()) + { + default: + case "bottom": + break; + case "middle": + y -= sizeOfText.Height / 2; + break; + case "top": + y -= sizeOfText.Height; + break; + } + } + Rectangle rect = new Rectangle(new Point(x, y), sizeOfText); g.FillRectangle(GetBrush(backcolor ?? DefaultTextBackground.Value), rect); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; g.DrawString(message, font, GetBrush(forecolor ?? DefaultForeground), x, y); diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index cfa7ea4133..f21b947c49 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -225,7 +225,7 @@ namespace BizHawk.Client.EmuHawk watcher.Changed += new FileSystemEventHandler(OnChanged); _watches.Add(watcher); - } + } private void OnChanged(object source, FileSystemEventArgs e) { @@ -634,7 +634,7 @@ namespace BizHawk.Client.EmuHawk } AddFileWatches(); - } + } public bool AskSaveChanges() { @@ -1079,7 +1079,7 @@ namespace BizHawk.Client.EmuHawk if (Global.Config.LuaReloadOnScriptFileChange) { AddFileWatches(); - } + } else { _watches.Clear(); diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index edf5ab9a99..a1bb98d667 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -426,7 +426,7 @@ namespace BizHawk.Client.EmuHawk void DebugCallback() { //fpulse = fCPU/(16*(t+1)) (where fCPU is 1.789773 MHz for NTSC, 1.662607 MHz for PAL, and 1.773448 MHz for Dendy) - //ftriangle = fCPU/(32*(tval + 1)) + //ftriangle = fCPU/(32*(tval + 1)) var apu = nes.apu; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index 8d39efa121..6e9efce84a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -174,13 +174,13 @@ namespace BizHawk.Client.EmuHawk offsetY = 1; if (CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithIcons) - bitmap = icon_marker; + bitmap = icon_marker; else if (record.HasState && Settings.DenoteStatesWithIcons) { - if (record.Lagged.HasValue && record.Lagged.Value) - bitmap = icon_anchor_lag; - else - bitmap = icon_anchor; + if (record.Lagged.HasValue && record.Lagged.Value) + bitmap = icon_anchor_lag; + else + bitmap = icon_anchor; } } } @@ -196,10 +196,10 @@ namespace BizHawk.Client.EmuHawk } string columnName = column.Name; - + if (columnName == CursorColumnName) - color = Color.FromArgb(0xFEFFFF); - + color = Color.FromArgb(0xFEFFFF); + if (columnName == FrameColumnName) { if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithBGColor) @@ -234,13 +234,13 @@ namespace BizHawk.Client.EmuHawk else if (record.Lagged.HasValue) { if (!record.HasState && Settings.DenoteStatesWithBGColor) - color = record.Lagged.Value ? - LagZone_InputLog : - GreenZone_InputLog; - else - color = record.Lagged.Value ? - LagZone_InputLog_Stated : - GreenZone_InputLog_Stated; + color = record.Lagged.Value ? + LagZone_InputLog : + GreenZone_InputLog; + else + color = record.Lagged.Value ? + LagZone_InputLog_Stated : + GreenZone_InputLog_Stated; } else if (record.WasLagged.HasValue) { @@ -757,10 +757,10 @@ namespace BizHawk.Client.EmuHawk e.NewCell == null || e.NewCell.RowIndex == null || e.NewCell.Column == null) { return; - } + } - // skip rerecord counting on drawing entirely, mouse down is enough - // avoid introducing another global + // skip rerecord counting on drawing entirely, mouse down is enough + // avoid introducing another global bool wasCountingRerecords = Global.MovieSession.Movie.IsCountingRerecords; WasRecording = CurrentTasMovie.IsRecording || WasRecording; @@ -914,8 +914,8 @@ namespace BizHawk.Client.EmuHawk } else if (TasView.IsPaintDown && e.NewCell.RowIndex.HasValue && !string.IsNullOrEmpty(_startFloatDrawColumn)) - { - Global.MovieSession.Movie.IsCountingRerecords = false; + { + Global.MovieSession.Movie.IsCountingRerecords = false; if (e.OldCell.RowIndex.HasValue && e.NewCell.RowIndex.HasValue) { @@ -941,7 +941,7 @@ namespace BizHawk.Client.EmuHawk } } - Global.MovieSession.Movie.IsCountingRerecords = wasCountingRerecords; + Global.MovieSession.Movie.IsCountingRerecords = wasCountingRerecords; if (mouseButtonHeld) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 849619d4a3..edbf5f910c 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -698,7 +698,7 @@ namespace BizHawk.Client.EmuHawk private void RemoveMarkersMenuItem_Click(object sender, EventArgs e) { IEnumerable markers = CurrentTasMovie.Markers.Where(m => TasView.SelectedRows.Contains(m.Frame)); - foreach (TasMovieMarker m in markers.ToList()) + foreach (TasMovieMarker m in markers.ToList()) { CurrentTasMovie.Markers.Remove(m); } @@ -1072,31 +1072,31 @@ namespace BizHawk.Client.EmuHawk private void scrollToCenterToolStripMenuItem_Click(object sender, EventArgs e) { TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "center"; - } + } - private void DenoteStatesWithIconsToolStripMenuItem_Click(object sender, EventArgs e) - { - Settings.DenoteStatesWithIcons = DenoteStatesWithIconsToolStripMenuItem.Checked; - RefreshDialog(); - } + private void DenoteStatesWithIconsToolStripMenuItem_Click(object sender, EventArgs e) + { + Settings.DenoteStatesWithIcons = DenoteStatesWithIconsToolStripMenuItem.Checked; + RefreshDialog(); + } - private void DenoteStatesWithBGColorToolStripMenuItem_Click(object sender, EventArgs e) - { - Settings.DenoteStatesWithBGColor = DenoteStatesWithBGColorToolStripMenuItem.Checked; - RefreshDialog(); - } + private void DenoteStatesWithBGColorToolStripMenuItem_Click(object sender, EventArgs e) + { + Settings.DenoteStatesWithBGColor = DenoteStatesWithBGColorToolStripMenuItem.Checked; + RefreshDialog(); + } - private void DenoteMarkersWithIconsToolStripMenuItem_Click(object sender, EventArgs e) - { - Settings.DenoteMarkersWithIcons = DenoteMarkersWithIconsToolStripMenuItem.Checked; - RefreshDialog(); - } + private void DenoteMarkersWithIconsToolStripMenuItem_Click(object sender, EventArgs e) + { + Settings.DenoteMarkersWithIcons = DenoteMarkersWithIconsToolStripMenuItem.Checked; + RefreshDialog(); + } - private void DenoteMarkersWithBGColorToolStripMenuItem_Click(object sender, EventArgs e) - { - Settings.DenoteMarkersWithBGColor = DenoteMarkersWithBGColorToolStripMenuItem.Checked; - RefreshDialog(); - } + private void DenoteMarkersWithBGColorToolStripMenuItem_Click(object sender, EventArgs e) + { + Settings.DenoteMarkersWithBGColor = DenoteMarkersWithBGColorToolStripMenuItem.Checked; + RefreshDialog(); + } private void wheelScrollSpeedToolStripMenuItem_Click(object sender, EventArgs e) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index faba5b6135..b019936ee7 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -68,11 +68,11 @@ namespace BizHawk.Client.EmuHawk AutosaveAsBackupFile = false; BackupPerFileSave = false; SingleClickFloatEdit = false; - // default to taseditor fashion - DenoteStatesWithIcons = false; - DenoteStatesWithBGColor = true; - DenoteMarkersWithIcons = false; - DenoteMarkersWithBGColor = true; + // default to taseditor fashion + DenoteStatesWithIcons = false; + DenoteStatesWithBGColor = true; + DenoteMarkersWithIcons = false; + DenoteMarkersWithBGColor = true; } public RecentFiles RecentTas { get; set; } @@ -83,7 +83,7 @@ namespace BizHawk.Client.EmuHawk public bool EmptyMarkers { get; set; } public int ScrollSpeed { get; set; } public bool FollowCursorAlwaysScroll { get; set; } - public string FollowCursorScrollMethod { get; set; } + public string FollowCursorScrollMethod { get; set; } public int BranchCellHoverInterval { get; set; } public int SeekingCutoffInterval { get; set; } public bool AutoRestoreOnMouseUpOnly { get; set; } @@ -92,10 +92,10 @@ namespace BizHawk.Client.EmuHawk public bool AutosaveAsBackupFile { get; set; } public bool BackupPerFileSave { get; set; } public bool SingleClickFloatEdit { get; set; } - public bool DenoteStatesWithIcons { get; set; } - public bool DenoteStatesWithBGColor { get; set; } - public bool DenoteMarkersWithIcons { get; set; } - public bool DenoteMarkersWithBGColor { get; set; } + public bool DenoteStatesWithIcons { get; set; } + public bool DenoteStatesWithBGColor { get; set; } + public bool DenoteMarkersWithIcons { get; set; } + public bool DenoteMarkersWithBGColor { get; set; } public int MainVerticalSplitDistance { get; set; } public int BranchMarkerSplitDistance { get; set; } } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs index 550aa2fc5b..7446983dab 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs @@ -5,10 +5,10 @@ using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { - [SchemaAttributes("PCECD")] - public class PceCdSchema : PceSchema { } + [SchemaAttributes("PCECD")] + public class PceCdSchema : PceSchema { } - [SchemaAttributes("PCE")] + [SchemaAttributes("PCE")] public class PceSchema : IVirtualPadSchema { public IEnumerable GetPadSchemas(IEmulator core) diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs index 39e5a9ea8c..387c3b748b 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs @@ -655,7 +655,7 @@ namespace BizHawk.Client.EmuHawk private void SetSize(WatchSize size) { _settings.Size = size; - SpecificValueBox.ByteSize = size; + SpecificValueBox.ByteSize = size; if (!string.IsNullOrEmpty(SpecificAddressBox.Text)) { SpecificAddressBox.Text = "0"; diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 308037623e..ead2910ed4 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk public bool UpdateBefore => false; - #region API + #region API public void AddWatch(Watch watch) { @@ -391,15 +391,15 @@ namespace BizHawk.Client.EmuHawk if (SelectedWatches.Any()) { - foreach (var sw in SelectedWatches) - { - if (sw.Domain != SelectedWatches.First().Domain) - { - throw new InvalidOperationException("Can't edit multiple watches on varying memorydomains"); - } - } + foreach (var sw in SelectedWatches) + { + if (sw.Domain != SelectedWatches.First().Domain) + { + throw new InvalidOperationException("Can't edit multiple watches on varying memorydomains"); + } + } - var we = new WatchEditor + var we = new WatchEditor { InitialLocation = this.ChildPointToScreen(WatchListView), MemoryDomains = _memoryDomains diff --git a/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs b/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs index 795efba33a..4f421c042d 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs @@ -163,7 +163,7 @@ namespace BizHawk.Client.EmuHawk foreach(DisplayType t in ByteWatch.ValidTypes) { DisplayTypeDropDown.Items.Add(Watch.DisplayTypeToString(t)); - } + } break; case 1: foreach (DisplayType t in WordWatch.ValidTypes) @@ -313,7 +313,7 @@ namespace BizHawk.Client.EmuHawk _watchList[i].Type, _watchList[i].BigEndian, _watchList[i].Notes - ); + ); } } diff --git a/BizHawk.Client.MultiHawk/Input/Keyboard.cs b/BizHawk.Client.MultiHawk/Input/Keyboard.cs index 44895ac913..33f5ba938a 100644 --- a/BizHawk.Client.MultiHawk/Input/Keyboard.cs +++ b/BizHawk.Client.MultiHawk/Input/Keyboard.cs @@ -75,35 +75,35 @@ namespace BizHawk.Client.MultiHawk return false; } - public static bool ShiftModifier - { - get - { - if (state.IsPressed(Key.LeftShift)) return true; - if (state.IsPressed(Key.RightShift)) return true; - return false; - } - } + public static bool ShiftModifier + { + get + { + if (state.IsPressed(Key.LeftShift)) return true; + if (state.IsPressed(Key.RightShift)) return true; + return false; + } + } - public static bool CtrlModifier - { - get - { - if (state.IsPressed(Key.LeftControl)) return true; - if (state.IsPressed(Key.RightControl)) return true; - return false; - } - } + public static bool CtrlModifier + { + get + { + if (state.IsPressed(Key.LeftControl)) return true; + if (state.IsPressed(Key.RightControl)) return true; + return false; + } + } - public static bool AltModifier - { - get - { - if (state.IsPressed(Key.LeftAlt)) return true; - if (state.IsPressed(Key.RightAlt)) return true; - return false; - } - } + public static bool AltModifier + { + get + { + if (state.IsPressed(Key.LeftAlt)) return true; + if (state.IsPressed(Key.RightAlt)) return true; + return false; + } + } public static Input.ModifierKey GetModifierKeysAsKeys() { @@ -116,17 +116,17 @@ namespace BizHawk.Client.MultiHawk } - internal static class KeyExtensions - { - public static bool IsModifier(this Key key) - { - if (key == Key.LeftShift) return true; - if (key == Key.RightShift) return true; - if (key == Key.LeftControl) return true; - if (key == Key.RightControl) return true; - if (key == Key.LeftAlt) return true; - if (key == Key.RightAlt) return true; - return false; - } - } + internal static class KeyExtensions + { + public static bool IsModifier(this Key key) + { + if (key == Key.LeftShift) return true; + if (key == Key.RightShift) return true; + if (key == Key.LeftControl) return true; + if (key == Key.RightControl) return true; + if (key == Key.LeftAlt) return true; + if (key == Key.RightAlt) return true; + return false; + } + } } diff --git a/BizHawk.Common/Extensions/ReflectionExtensions.cs b/BizHawk.Common/Extensions/ReflectionExtensions.cs index a626c220d5..c727f31a96 100644 --- a/BizHawk.Common/Extensions/ReflectionExtensions.cs +++ b/BizHawk.Common/Extensions/ReflectionExtensions.cs @@ -188,9 +188,9 @@ namespace BizHawk.Common.ReflectionExtensions return (T)o.GetType().GetCustomAttributes(typeof(T), false)[0]; } - /// - /// where the fields begin relative to the address an object references points to - /// + /// + /// where the fields begin relative to the address an object references points to + /// public static IntPtr ManagedFieldStart => _managedfieldstart; [StructLayout(LayoutKind.Explicit)] diff --git a/BizHawk.Common/HawkFile.cs b/BizHawk.Common/HawkFile.cs index 959ead5fa8..116467d162 100644 --- a/BizHawk.Common/HawkFile.cs +++ b/BizHawk.Common/HawkFile.cs @@ -60,57 +60,57 @@ namespace BizHawk.Common /// public bool Exists => _exists; - /// + /// /// Gets the directory containing the root /// public string Directory => Path.GetDirectoryName(_rootPath); - /// + /// /// Gets a value indicating whether this instance is bound /// public bool IsBound => _boundStream != null; - /// + /// /// returns the complete canonical full path ("c:\path\to\archive|member") of the bound file /// public string CanonicalFullPath => MakeCanonicalName(_rootPath, _memberPath); - /// + /// /// returns the complete canonical name ("archive|member") of the bound file /// public string CanonicalName => MakeCanonicalName(Path.GetFileName(_rootPath), _memberPath); - /// + /// /// returns the virtual name of the bound file (disregarding the archive) /// public string Name => GetBoundNameFromCanonical(MakeCanonicalName(_rootPath, _memberPath)); - /// + /// /// returns the complete full path of the bound file, excluding the archive member portion /// public string FullPathWithoutMember => _rootPath; - /// + /// /// returns the member path part of the bound file /// public string ArchiveMemberPath => _memberPath; - /// + /// /// returns the extension of Name /// public string Extension => Path.GetExtension(Name).ToUpper(); - /// + /// /// Indicates whether this file is an archive /// public bool IsArchive => _isArchive; - /// + /// /// Indicates whether the file is an archive member (IsArchive && IsBound[to member]) /// public bool IsArchiveMember => IsArchive && IsBound; - public IList ArchiveItems + public IList ArchiveItems { get { diff --git a/BizHawk.Common/MruStack.cs b/BizHawk.Common/MruStack.cs index b9697c9087..9406ef54d0 100644 --- a/BizHawk.Common/MruStack.cs +++ b/BizHawk.Common/MruStack.cs @@ -14,7 +14,7 @@ public int Count => _count; - public void Clear() + public void Clear() { _head = 0; _count = 0; diff --git a/BizHawk.Common/SwitcherStream.cs b/BizHawk.Common/SwitcherStream.cs index 14d0b63664..50dfc8b42e 100644 --- a/BizHawk.Common/SwitcherStream.cs +++ b/BizHawk.Common/SwitcherStream.cs @@ -26,13 +26,13 @@ namespace BizHawk.Common public override bool CanRead => _currStream.CanRead; - public override bool CanSeek => _currStream.CanSeek; + public override bool CanSeek => _currStream.CanSeek; - public override bool CanWrite => _currStream.CanWrite; + public override bool CanWrite => _currStream.CanWrite; - public override long Length => _currStream.Length; + public override long Length => _currStream.Length; - public override long Position + public override long Position { get { diff --git a/BizHawk.Common/UndoHistory.cs b/BizHawk.Common/UndoHistory.cs index 44dd3f933c..a17e5d054f 100644 --- a/BizHawk.Common/UndoHistory.cs +++ b/BizHawk.Common/UndoHistory.cs @@ -26,11 +26,11 @@ namespace BizHawk.Common public bool CanUndo => Enabled && _curPos > 1; - public bool CanRedo => Enabled && _curPos < _history.Count; + public bool CanRedo => Enabled && _curPos < _history.Count; - public bool HasHistory => Enabled && _history.Any(); + public bool HasHistory => Enabled && _history.Any(); - public void Clear() + public void Clear() { _history = new List>(); _curPos = 0; diff --git a/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs b/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs index 8055a0c5fa..b31010f11b 100644 --- a/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs +++ b/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs @@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Common public bool Enabled => Sink != null; - public void Put(TraceInfo info) + public void Put(TraceInfo info) { Sink.Put(info); } @@ -86,9 +86,9 @@ namespace BizHawk.Emulation.Common public MemoryCallbackType Type => MemoryCallbackType.Execute; - public string Name => "Trace Logging"; + public string Name => "Trace Logging"; - public Action Callback { get; } + public Action Callback { get; } public uint? Address => null; diff --git a/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs b/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs index 1caed3a800..9109004a4e 100644 --- a/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs +++ b/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs @@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Common { if ((hadAny && !hasAny) || (!hadAny && hasAny)) { - ActiveChanged?.Invoke(); + ActiveChanged?.Invoke(); } } } diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs index 2aacbf7784..25a459e97c 100644 --- a/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs +++ b/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs @@ -98,11 +98,11 @@ namespace BizHawk.Emulation.Common public bool HasReads => _hasReads; - public bool HasWrites => _hasWrites; + public bool HasWrites => _hasWrites; - public bool HasExecutes => _hasExecutes; + public bool HasExecutes => _hasExecutes; - private void UpdateHasVariables() + private void UpdateHasVariables() { _hasReads = Reads.Count > 0; _hasWrites = Writes.Count > 0; @@ -210,7 +210,7 @@ namespace BizHawk.Emulation.Common private void Changes() { - ActiveChanged?.Invoke(); + ActiveChanged?.Invoke(); } public void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args) @@ -220,13 +220,13 @@ namespace BizHawk.Emulation.Common case NotifyCollectionChangedAction.Add: foreach(IMemoryCallback callback in args.NewItems) { - CallbackAdded?.Invoke(callback); + CallbackAdded?.Invoke(callback); } break; case NotifyCollectionChangedAction.Remove: foreach(IMemoryCallback callback in args.OldItems) { - CallbackRemoved?.Invoke(callback); + CallbackRemoved?.Invoke(callback); } break; } diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs index 8c4adfc7f7..8fcc1414e9 100644 --- a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs +++ b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs @@ -115,7 +115,7 @@ namespace BizHawk.Emulation.Common { var d1 = dest as T; var s1 = src as T; - if (d1 != null && s1 != null) + if (d1 != null && s1 != null) { func(d1, s1); } diff --git a/BizHawk.Emulation.Common/Base Implementations/NullController.cs b/BizHawk.Emulation.Common/Base Implementations/NullController.cs index f234f68266..d3fb18f099 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullController.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullController.cs @@ -14,7 +14,7 @@ public bool this[string button] => false; - public bool IsPressed(string button) + public bool IsPressed(string button) { return false; } diff --git a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs index b4b6ef8a7c..104706c22e 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Common public ControllerDefinition ControllerDefinition => NullController.Instance.Definition; - public IController Controller { get; set; } + public IController Controller { get; set; } public void FrameAdvance(bool render, bool rendersound) { @@ -78,16 +78,16 @@ namespace BizHawk.Emulation.Common public string SystemId => "NULL"; - public bool DeterministicEmulation => true; + public bool DeterministicEmulation => true; - public void ResetCounters() + public void ResetCounters() { Frame = 0; } public string BoardName => null; - public CoreComm CoreComm { get; } + public CoreComm CoreComm { get; } public void Dispose() { @@ -104,15 +104,15 @@ namespace BizHawk.Emulation.Common public int VirtualWidth => 256; - public int VirtualHeight => 192; + public int VirtualHeight => 192; - public int BufferWidth => 256; + public int BufferWidth => 256; - public int BufferHeight => 192; + public int BufferHeight => 192; - public int BackgroundColor => 0; + public int BackgroundColor => 0; - #endregion + #endregion #region ISoundProvider @@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Common public bool CanProvideAsync => true; - public SyncSoundMode SyncMode { get; private set; } + public SyncSoundMode SyncMode { get; private set; } public void SetSyncMode(SyncSoundMode mode) { diff --git a/BizHawk.Emulation.Common/Base Implementations/NullSound.cs b/BizHawk.Emulation.Common/Base Implementations/NullSound.cs index c86f4c140b..9fdace5af3 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullSound.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullSound.cs @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Common public bool CanProvideAsync => true; - public SyncSoundMode SyncMode { get; private set; } + public SyncSoundMode SyncMode { get; private set; } public void GetSamplesSync(out short[] samples, out int nsamp) { diff --git a/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs b/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs index 451cb3826d..414b268da9 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullVideo.cs @@ -14,15 +14,15 @@ public int VirtualWidth => 256; - public int VirtualHeight => 192; + public int VirtualHeight => 192; - public int BufferWidth => 256; + public int BufferWidth => 256; - public int BufferHeight => 192; + public int BufferHeight => 192; - public int BackgroundColor => 0; + public int BackgroundColor => 0; - private static readonly NullVideo _nullVideo = new NullVideo(); + private static readonly NullVideo _nullVideo = new NullVideo(); public static NullVideo Instance => _nullVideo; } diff --git a/BizHawk.Emulation.Common/Base Implementations/SimpleSyncSoundProvider.cs b/BizHawk.Emulation.Common/Base Implementations/SimpleSyncSoundProvider.cs index 9341fd3c66..5c7231f2ff 100644 --- a/BizHawk.Emulation.Common/Base Implementations/SimpleSyncSoundProvider.cs +++ b/BizHawk.Emulation.Common/Base Implementations/SimpleSyncSoundProvider.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Common.Base_Implementations public bool CanProvideAsync => false; - public void SetSyncMode(SyncSoundMode mode) + public void SetSyncMode(SyncSoundMode mode) { if (mode != SyncSoundMode.Sync) { @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Common.Base_Implementations public SyncSoundMode SyncMode => SyncSoundMode.Sync; - /// + /// /// Add samples to be output. no queueing; must be drained every frame /// /// diff --git a/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs b/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs index 0b27d3f286..4068b1e8cf 100644 --- a/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs +++ b/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs @@ -475,7 +475,7 @@ namespace BizHawk.Emulation.Common.BizInvoke { public CallingConvention CallingConvention { get; } - /// + /// /// name of entry point; if not given, the method's name is used /// public string EntryPoint { get; set; } diff --git a/BizHawk.Emulation.Common/CoreComms.cs b/BizHawk.Emulation.Common/CoreComms.cs index c7b4ee1b02..90572f7f7b 100644 --- a/BizHawk.Emulation.Common/CoreComms.cs +++ b/BizHawk.Emulation.Common/CoreComms.cs @@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Common public double VsyncRate => VsyncNum / (double)VsyncDen; - public int VsyncNum = 60; + public int VsyncNum = 60; public int VsyncDen = 1; // a core should set these if you wish to provide rom status information yourself. otherwise it will be calculated by the frontend in a way you may not like, using RomGame-related concepts. diff --git a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs index 76ebc816fa..658ed51adb 100644 --- a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs +++ b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs @@ -50,12 +50,12 @@ namespace BizHawk.Emulation.Common FirmwareAndOption("1D503E56DF85A62FEE696E7618DC5B4E781DF1BB", 8192, "C64", "Kernal", "c64-kernal.bin", "Kernal Rom"); FirmwareAndOption("79015323128650C742A3694C9429AA91F355905E", 8192, "C64", "Basic", "c64-basic.bin", "Basic Rom"); FirmwareAndOption("ADC7C31E18C7C7413D54802EF2F4193DA14711AA", 4096, "C64", "Chargen", "c64-chargen.bin", "Chargen Rom"); - FirmwareAndOption("AB16F56989B27D89BABE5F89C5A8CB3DA71A82F0", 16384, "C64", "Drive1541", "drive-1541.bin", "1541 Disk Drive Rom"); - FirmwareAndOption("D3B78C3DBAC55F5199F33F3FE0036439811F7FB3", 16384, "C64", "Drive1541II", "drive-1541ii.bin", "1541-II Disk Drive Rom"); + FirmwareAndOption("AB16F56989B27D89BABE5F89C5A8CB3DA71A82F0", 16384, "C64", "Drive1541", "drive-1541.bin", "1541 Disk Drive Rom"); + FirmwareAndOption("D3B78C3DBAC55F5199F33F3FE0036439811F7FB3", 16384, "C64", "Drive1541II", "drive-1541ii.bin", "1541-II Disk Drive Rom"); - //for saturn, we think any bios region can pretty much run any iso - //so, we're going to lay this out carefully so that we choose things in a sensible order, but prefer the correct region - var ss_100_j = File("2B8CB4F87580683EB4D760E4ED210813D667F0A2", 524288, "saturn-1.00-(J).bin", "Bios v1.00 (J)"); + //for saturn, we think any bios region can pretty much run any iso + //so, we're going to lay this out carefully so that we choose things in a sensible order, but prefer the correct region + var ss_100_j = File("2B8CB4F87580683EB4D760E4ED210813D667F0A2", 524288, "saturn-1.00-(J).bin", "Bios v1.00 (J)"); var ss_100_ue = File("FAA8EA183A6D7BBE5D4E03BB1332519800D3FBC3", 524288, "saturn-1.00-(U+E).bin", "Bios v1.00 (U+E)"); var ss_100a_ue = File("3BB41FEB82838AB9A35601AC666DE5AACFD17A58", 524288, "saturn-1.00a-(U+E).bin", "Bios v1.00a (U+E)"); //?? is this size correct? var ss_101_j = File("DF94C5B4D47EB3CC404D88B33A8FDA237EAF4720", 524288, "saturn-1.01-(J).bin", "Bios v1.01 (J)"); //?? is this size correct? diff --git a/BizHawk.Emulation.Common/ServiceAttributes.cs b/BizHawk.Emulation.Common/ServiceAttributes.cs index ce0ceab9bb..f41e4c9fea 100644 --- a/BizHawk.Emulation.Common/ServiceAttributes.cs +++ b/BizHawk.Emulation.Common/ServiceAttributes.cs @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Common { public ServiceNotApplicable(params Type[] types) { - NotApplicableTypes = types?.ToList() ?? new List(); + NotApplicableTypes = types?.ToList() ?? new List(); } public IEnumerable NotApplicableTypes { get; private set; } diff --git a/BizHawk.Emulation.Common/Sound/Utilities/DCFilter.cs b/BizHawk.Emulation.Common/Sound/Utilities/DCFilter.cs index 7b3e9efcf5..3dcaaa3d2d 100644 --- a/BizHawk.Emulation.Common/Sound/Utilities/DCFilter.cs +++ b/BizHawk.Emulation.Common/Sound/Utilities/DCFilter.cs @@ -138,9 +138,9 @@ namespace BizHawk.Emulation.Common public SyncSoundMode SyncMode => _soundProvider.SyncMode; - public bool CanProvideAsync => _soundProvider.CanProvideAsync; + public bool CanProvideAsync => _soundProvider.CanProvideAsync; - public void SetSyncMode(SyncSoundMode mode) + public void SetSyncMode(SyncSoundMode mode) { _soundProvider.SetSyncMode(mode); } diff --git a/BizHawk.Emulation.Common/Sound/Utilities/Metaspu.cs b/BizHawk.Emulation.Common/Sound/Utilities/Metaspu.cs index 8560b9ec8c..ab631dbece 100644 --- a/BizHawk.Emulation.Common/Sound/Utilities/Metaspu.cs +++ b/BizHawk.Emulation.Common/Sound/Utilities/Metaspu.cs @@ -36,9 +36,9 @@ namespace BizHawk.Emulation.Common public bool CanProvideAsync => true; - public SyncSoundMode SyncMode => SyncSoundMode.Async; + public SyncSoundMode SyncMode => SyncSoundMode.Async; - public void SetSyncMode(SyncSoundMode mode) + public void SetSyncMode(SyncSoundMode mode) { if (mode != SyncSoundMode.Async) { @@ -262,7 +262,7 @@ namespace BizHawk.Emulation.Common public ssamp(short ll, short rr) { l = ll; r = rr; } }; - readonly List sampleQueue = new List(); + readonly List sampleQueue = new List(); // returns values going between 0 and y-1 in a saw wave pattern, based on x static int pingpong(int x, int y) diff --git a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs index 0cace32345..dece4fc4cf 100644 --- a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs @@ -310,18 +310,18 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 case 0x026: case 0x027: dest = (byte)(opcode & 0x7); - dest_value = Register[dest]; - var ones = (dest_value ^ 0xFFFF); - result = ones + 1; - Calc_FlagC(result); - Calc_FlagO_Add(ones, 1, result); - result &= 0xFFFF; - Calc_FlagS(result); - Calc_FlagZ(result); - Register[dest] = (ushort)result; - cycles = 6; - Interruptible = true; - break; + dest_value = Register[dest]; + var ones = (dest_value ^ 0xFFFF); + result = ones + 1; + Calc_FlagC(result); + Calc_FlagO_Add(ones, 1, result); + result &= 0xFFFF; + Calc_FlagS(result); + Calc_FlagZ(result); + Register[dest] = (ushort)result; + cycles = 6; + Interruptible = true; + break; // ADCR case 0x028: case 0x029: @@ -332,18 +332,18 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 case 0x02E: case 0x02F: dest = (byte)(opcode & 0x7); - dest_value = Register[dest]; - var carry = FlagC ? 1 : 0; - result = dest_value + carry; - Calc_FlagC(result); - Calc_FlagO_Add(dest_value, carry, result); - result &= 0xFFFF; - Calc_FlagS(result); - Calc_FlagZ(result); - Register[dest] = (ushort)result; - cycles = 6; - Interruptible = true; - break; + dest_value = Register[dest]; + var carry = FlagC ? 1 : 0; + result = dest_value + carry; + Calc_FlagC(result); + Calc_FlagO_Add(dest_value, carry, result); + result &= 0xFFFF; + Calc_FlagS(result); + Calc_FlagZ(result); + Register[dest] = (ushort)result; + cycles = 6; + Interruptible = true; + break; // GSWD case 0x030: case 0x031: @@ -1008,15 +1008,15 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 case 0x1BD: case 0x1BE: case 0x1BF: - src = (byte)((opcode >> 3) & 0x7); - dest = (byte)(opcode & 0x7); - result = Register[dest] & Register[src]; - Calc_FlagS(result); - Calc_FlagZ(result); - Register[dest] = (ushort)result; - cycles = 6; - Interruptible = true; - break; + src = (byte)((opcode >> 3) & 0x7); + dest = (byte)(opcode & 0x7); + result = Register[dest] & Register[src]; + Calc_FlagS(result); + Calc_FlagZ(result); + Register[dest] = (ushort)result; + cycles = 6; + Interruptible = true; + break; // XORR case 0x1C0: case 0x1C1: @@ -1510,21 +1510,21 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 case 0x305: case 0x306: case 0x307: - dest = (byte)(opcode & 0x7); - addr = ReadMemory(RegisterPC++, false); - dest_value = Register[dest]; - addr_read = ReadMemory(addr, false); - twos = (0xFFFF ^ addr_read) + 1; - result = dest_value + twos; - Calc_FlagC(result); + dest = (byte)(opcode & 0x7); + addr = ReadMemory(RegisterPC++, false); + dest_value = Register[dest]; + addr_read = ReadMemory(addr, false); + twos = (0xFFFF ^ addr_read) + 1; + result = dest_value + twos; + Calc_FlagC(result); Calc_FlagO_Add(dest_value, twos, result); result &= 0xFFFF; - Calc_FlagS(result); - Calc_FlagZ(result); - Register[dest] = (ushort)result; - cycles = 10; - Interruptible = true; - break; + Calc_FlagS(result); + Calc_FlagZ(result); + Register[dest] = (ushort)result; + cycles = 10; + Interruptible = true; + break; // SUB@ case 0x308: case 0x309: @@ -1701,16 +1701,16 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 case 0x386: case 0x387: dest = (byte)(opcode & 0x7); - addr = ReadMemory(RegisterPC++, false); - dest_value = Register[dest]; - addr_read = ReadMemory(addr, false); - result = dest_value & addr_read; - Calc_FlagS(result); - Calc_FlagZ(result); - Register[dest] = (ushort)result; - cycles = 10; - Interruptible = true; - break; + addr = ReadMemory(RegisterPC++, false); + dest_value = Register[dest]; + addr_read = ReadMemory(addr, false); + result = dest_value & addr_read; + Calc_FlagS(result); + Calc_FlagZ(result); + Register[dest] = (ushort)result; + cycles = 10; + Interruptible = true; + break; // AND@ case 0x388: case 0x389: @@ -1787,17 +1787,17 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 case 0x3C5: case 0x3C6: case 0x3C7: - dest = (byte)(opcode & 0x7); - addr = ReadMemory(RegisterPC++, false); - dest_value = Register[dest]; - addr_read = ReadMemory(addr, false); - result = dest_value ^ addr_read; - Calc_FlagS(result); - Calc_FlagZ(result); - Register[dest] = (ushort)result; - cycles = 10; - Interruptible = true; - break; + dest = (byte)(opcode & 0x7); + addr = ReadMemory(RegisterPC++, false); + dest_value = Register[dest]; + addr_read = ReadMemory(addr, false); + result = dest_value ^ addr_read; + Calc_FlagS(result); + Calc_FlagZ(result); + Register[dest] = (ushort)result; + cycles = 10; + Interruptible = true; + break; // XOR@ case 0x3C8: case 0x3C9: diff --git a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs index 9def223102..5187e5f028 100644 --- a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs @@ -944,8 +944,8 @@ namespace BizHawk.Emulation.Cores.Components.M6502 rdy_freeze = !RDY; if (RDY) { - ReadMemory((ushort)ea); - if (alu_temp.Bit(8)) + ReadMemory((ushort)ea); + if (alu_temp.Bit(8)) ea = (ushort)(ea + 0x100); } @@ -1095,7 +1095,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 void IndIdx_RMW_Stage8() { WriteMemory((ushort)ea, (byte)alu_temp); - } + } void RelBranch_Stage2_BVS() { branch_taken = FlagV == true; @@ -1155,59 +1155,59 @@ namespace BizHawk.Emulation.Cores.Components.M6502 } void RelBranch_Stage3() { - rdy_freeze = !RDY; - if (RDY) - { - FetchDummy(); - alu_temp = (byte)PC + (int)(sbyte)opcode2; - PC &= 0xFF00; - PC |= (ushort)((alu_temp & 0xFF)); - if (alu_temp.Bit(8)) - { - //we need to carry the add, and then we'll be ready to fetch the next instruction - opcode = VOP_RelativeStuff2; - mi = -1; - } - else - { - //to pass cpu_interrupts_v2/5-branch_delays_irq we need to handle a quirk here - //if we decide to interrupt in the next cycle, this condition will cause it to get deferred by one instruction - if (!interrupt_pending) - branch_irq_hack = true; - } - } - } + rdy_freeze = !RDY; + if (RDY) + { + FetchDummy(); + alu_temp = (byte)PC + (int)(sbyte)opcode2; + PC &= 0xFF00; + PC |= (ushort)((alu_temp & 0xFF)); + if (alu_temp.Bit(8)) + { + //we need to carry the add, and then we'll be ready to fetch the next instruction + opcode = VOP_RelativeStuff2; + mi = -1; + } + else + { + //to pass cpu_interrupts_v2/5-branch_delays_irq we need to handle a quirk here + //if we decide to interrupt in the next cycle, this condition will cause it to get deferred by one instruction + if (!interrupt_pending) + branch_irq_hack = true; + } + } + } void RelBranch_Stage4() { - rdy_freeze = !RDY; - if (RDY) - { - FetchDummy(); - if (alu_temp.Bit(31)) - PC = (ushort)(PC - 0x100); - else PC = (ushort)(PC + 0x100); - } - } + rdy_freeze = !RDY; + if (RDY) + { + FetchDummy(); + if (alu_temp.Bit(31)) + PC = (ushort)(PC - 0x100); + else PC = (ushort)(PC + 0x100); + } + } void NOP() { - rdy_freeze = !RDY; - } - void DecS() + rdy_freeze = !RDY; + } + void DecS() { - rdy_freeze = !RDY; - if (RDY) - { - S--; - } - } + rdy_freeze = !RDY; + if (RDY) + { + S--; + } + } void IncS() { - rdy_freeze = !RDY; - if (RDY) - { - S++; - } - } + rdy_freeze = !RDY; + if (RDY) + { + S++; + } + } void JSR() { rdy_freeze = !RDY; @@ -2058,50 +2058,50 @@ namespace BizHawk.Emulation.Cores.Components.M6502 } void Imp_ASL_A() { - rdy_freeze = !RDY; - if (RDY) - { - FetchDummy(); - FlagC = (A & 0x80) != 0; - A = (byte)(A << 1); - NZ_A(); - } - } + rdy_freeze = !RDY; + if (RDY) + { + FetchDummy(); + FlagC = (A & 0x80) != 0; + A = (byte)(A << 1); + NZ_A(); + } + } void Imp_ROL_A() { - rdy_freeze = !RDY; - if (RDY) - { - FetchDummy(); - temp8 = A; - A = (byte)((A << 1) | (P & 1)); - FlagC = (temp8 & 0x80) != 0; - NZ_A(); - } - } + rdy_freeze = !RDY; + if (RDY) + { + FetchDummy(); + temp8 = A; + A = (byte)((A << 1) | (P & 1)); + FlagC = (temp8 & 0x80) != 0; + NZ_A(); + } + } void Imp_ROR_A() { - rdy_freeze = !RDY; - if (RDY) - { - FetchDummy(); - temp8 = A; - A = (byte)((A >> 1) | ((P & 1) << 7)); - FlagC = (temp8 & 1) != 0; - NZ_A(); - } - } + rdy_freeze = !RDY; + if (RDY) + { + FetchDummy(); + temp8 = A; + A = (byte)((A >> 1) | ((P & 1) << 7)); + FlagC = (temp8 & 1) != 0; + NZ_A(); + } + } void Imp_LSR_A() { - rdy_freeze = !RDY; - if (RDY) - { - FetchDummy(); - FlagC = (A & 1) != 0; - A = (byte)(A >> 1); - NZ_A(); - } - } + rdy_freeze = !RDY; + if (RDY) + { + FetchDummy(); + FlagC = (A & 1) != 0; + A = (byte)(A >> 1); + NZ_A(); + } + } void JMP_abs() { rdy_freeze = !RDY; @@ -2275,9 +2275,9 @@ namespace BizHawk.Emulation.Cores.Components.M6502 rdy_freeze = !RDY; if (RDY) { - //bleh.. redundant code to make sure we dont clobber alu_temp before using it to decide whether to change ea + //bleh.. redundant code to make sure we dont clobber alu_temp before using it to decide whether to change ea - if (alu_temp.Bit(8)) + if (alu_temp.Bit(8)) { alu_temp = ReadMemory((ushort)ea); ea = (ushort)(ea + 0x100); @@ -2307,10 +2307,10 @@ namespace BizHawk.Emulation.Cores.Components.M6502 } void AbsIdx_WRITE_Stage5_ERROR() { - S = (byte)(X & A); - WriteMemory((ushort)ea, (byte)(S & (opcode3+1))); + S = (byte)(X & A); + WriteMemory((ushort)ea, (byte)(S & (opcode3+1))); - } + } void AbsIdx_RMW_Stage5() { rdy_freeze = !RDY; @@ -2529,11 +2529,11 @@ namespace BizHawk.Emulation.Cores.Components.M6502 if (RDY) { alu_temp = ReadMemory((ushort)ea); - S &= (byte)alu_temp; - X = S; - A = S; - P = (byte)((P & 0x7D) | TableNZ[S]); - } + S &= (byte)alu_temp; + X = S; + A = S; + P = (byte)((P & 0x7D) | TableNZ[S]); + } } void AbsInd_JMP_Stage4() @@ -2967,9 +2967,9 @@ namespace BizHawk.Emulation.Cores.Components.M6502 public void ExecuteOne() { - // total cycles now incraments every time a cycle is called to accurately count during RDY - TotalExecutedCycles++; - if (!rdy_freeze) + // total cycles now incraments every time a cycle is called to accurately count during RDY + TotalExecutedCycles++; + if (!rdy_freeze) { diff --git a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs index 4c1fd10aa7..b3e30a9a30 100644 --- a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs +++ b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs @@ -248,11 +248,11 @@ namespace BizHawk.Emulation.Cores.Components.M6502 return (ushort)(ReadMemory(address) | (ReadMemory(highAddress) << 8)); } - // SO pin - public void SetOverflow() - { - FlagV = true; - } + // SO pin + public void SetOverflow() + { + FlagV = true; + } private static readonly byte[] TableNZ = { diff --git a/BizHawk.Emulation.Cores/CPUs/Z80/Disassembler.cs b/BizHawk.Emulation.Cores/CPUs/Z80/Disassembler.cs index 5c77552720..d5b9c2c4e1 100644 --- a/BizHawk.Emulation.Cores/CPUs/Z80/Disassembler.cs +++ b/BizHawk.Emulation.Cores/CPUs/Z80/Disassembler.cs @@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80 readonly static string[] mnemonics = new string[] { - "NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04 + "NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04 "INC B", "DEC B", "LD B, n", "RLCA", //0x08 "EX AF, AF'", "ADD HL, BC", "LD A, (BC)", "DEC BC", //0x0C "INC C", "DEC C", "LD C, n", "RRCA", //0x10 diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs index 12a5df23d5..2e603a6d38 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs @@ -43,12 +43,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 if ((addr & 0x1080) == 0x0080) { - _tia.bus_state = M6532.ReadMemory(addr, false); - return M6532.ReadMemory(addr, false); + _tia.bus_state = M6532.ReadMemory(addr, false); + return M6532.ReadMemory(addr, false); } - _tia.bus_state = Rom[addr & 0x0FFF]; - return Rom[addr & 0x0FFF]; + _tia.bus_state = Rom[addr & 0x0FFF]; + return Rom[addr & 0x0FFF]; } internal byte BasePeekMemory(ushort addr) @@ -61,15 +61,15 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 if ((addr & 0x1080) == 0x0080) { - return M6532.ReadMemory(addr, true); + return M6532.ReadMemory(addr, true); } - return Rom[addr & 0x0FFF]; + return Rom[addr & 0x0FFF]; } internal void BaseWriteMemory(ushort addr, byte value) { - _tia.bus_state = value; - if (addr != LastAddress) + _tia.bus_state = value; + if (addr != LastAddress) { DistinctAccessCount++; LastAddress = addr; @@ -92,7 +92,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 internal void BasePokeMemory(ushort addr, byte value) { - addr = (ushort)(addr & 0x1FFF); + addr = (ushort)(addr & 0x1FFF); if ((addr & 0x1080) == 0) { _tia.WriteMemory(addr, value, true); @@ -117,7 +117,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _mapper.Bit13 = addr.Bit(13); var temp = _mapper.ReadMemory((ushort)(addr & 0x1FFF)); - _tia.bus_state = temp; + _tia.bus_state = temp; MemoryCallbacks.CallReads(addr); return temp; @@ -250,13 +250,13 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _mapper = new mUA(); break; - // Special Sega Mapper which has swapped banks - case "F8_sega": - _mapper = new mF8_sega(); - break; + // Special Sega Mapper which has swapped banks + case "F8_sega": + _mapper = new mF8_sega(); + break; - // Homebrew mappers - case "3E": + // Homebrew mappers + case "3E": _mapper = new m3E(); break; case "0840": @@ -332,10 +332,10 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _mapper.GetType()); - // as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves. - // some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532 - // executing a reset sequence at power on, but it's needed so let's hard code it for now - Cpu.S = 0xFD; + // as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves. + // some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532 + // executing a reset sequence at power on, but it's needed so let's hard code it for now + Cpu.S = 0xFD; } private bool _pal; @@ -359,19 +359,19 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 M6532 = new M6532(this); Cpu.PC = (ushort)(ReadMemory(0x1FFC) + (ReadMemory(0x1FFD) << 8)); // set the initial PC - // as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves. - // some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532 - // executing a reset sequence at power on, but it's needed so let's hard code it for now - Cpu.S = 0xFD; - } + // as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves. + // some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532 + // executing a reset sequence at power on, but it's needed so let's hard code it for now + Cpu.S = 0xFD; + } public void FrameAdvance(bool render, bool rendersound) { StartFrameCond(); while (_tia.LineCount < _tia.NominalNumScanlines) Cycle(); - if (rendersound==false) - _tia._audioClocks = 0; // we need this here since the async sound provider won't check in this case + if (rendersound==false) + _tia._audioClocks = 0; // we need this here since the async sound provider won't check in this case FinishFrameCond(); } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs index de52b48868..d4a8eca0ae 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs @@ -90,7 +90,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public int TotalExecutedCycles => Cpu.TotalExecutedCycles; - private void StepInto() + private void StepInto() { do { diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IStatable.cs index 1ca2bcf6e8..a46639fc03 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IStatable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IStatable.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { public bool BinarySaveStatesPreferred => false; - public void SaveStateText(TextWriter writer) + public void SaveStateText(TextWriter writer) { SyncState(Serializer.CreateTextWriter(writer)); } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index affe158134..03df0d3511 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -73,9 +73,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public string SystemId => "A26"; - public string BoardName => _mapper.GetType().Name; + public string BoardName => _mapper.GetType().Name; - public CoreComm CoreComm { get; private set; } + public CoreComm CoreComm { get; private set; } public ControllerDefinition ControllerDefinition { get { return Atari2600ControllerDefinition; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs index 5f5155a5f3..198285cf61 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public byte DDRa = 0x00; public byte DDRb = 0x00; - public byte outputA = 0x00; + public byte outputA = 0x00; public TimerData Timer; @@ -36,12 +36,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { // Read Output reg A // Combine readings from player 1 and player 2 - // actually depends on setting in SWCHCNTA (aka DDRa) + // actually depends on setting in SWCHCNTA (aka DDRa) - var temp = (byte)(_core.ReadControls1(peek) & 0xF0 | ((_core.ReadControls2(peek) >> 4) & 0x0F)); - temp = (byte)(temp & ~DDRa); - temp = (byte)(temp + (outputA & DDRa)); - return temp; + var temp = (byte)(_core.ReadControls1(peek) & 0xF0 | ((_core.ReadControls2(peek) >> 4) & 0x0F)); + temp = (byte)(temp & ~DDRa); + temp = (byte)(temp + (outputA & DDRa)); + return temp; } @@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 return Timer.Value; } // TODO: fix this to match real behaviour - // This is an undocumented instruction whose behaviour is more dynamic then indicated here + // This is an undocumented instruction whose behaviour is more dynamic then indicated here if ((registerAddr & 0x5) == 0x5) { // Read interrupt flag @@ -118,7 +118,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Write to Timer/1 Timer.PrescalerShift = 0; Timer.Value = value; - Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; + Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; Timer.InterruptFlag = false; } else if (registerAddr == 0x05) @@ -126,7 +126,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Write to Timer/8 Timer.PrescalerShift = 3; Timer.Value = value; - Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; + Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; Timer.InterruptFlag = false; } else if (registerAddr == 0x06) @@ -134,7 +134,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Write to Timer/64 Timer.PrescalerShift = 6; Timer.Value = value; - Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; + Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; Timer.InterruptFlag = false; } else if (registerAddr == 0x07) @@ -142,7 +142,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Write to Timer/1024 Timer.PrescalerShift = 10; Timer.Value = value; - Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; + Timer.PrescalerCount = 0;// 1 << Timer.PrescalerShift; Timer.InterruptFlag = false; } } @@ -155,8 +155,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 if (registerAddr == 0x00) { - // Write Output reg A - outputA = value; + // Write Output reg A + outputA = value; } else if (registerAddr == 0x01) { @@ -165,8 +165,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } else if (registerAddr == 0x02) { - // Write Output reg B - // But is read only + // Write Output reg B + // But is read only } else if (registerAddr == 0x03) { @@ -182,8 +182,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.BeginSection("M6532"); ser.Sync("ddra", ref DDRa); ser.Sync("ddrb", ref DDRb); - ser.Sync("OutputA", ref outputA); - Timer.SyncState(ser); + ser.Sync("OutputA", ref outputA); + Timer.SyncState(ser); ser.EndSection(); } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs index e786465806..bd3bc8f96a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs @@ -176,11 +176,11 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ((addr & 0x70) << 4); } } - if (!peek) - { - _lastData = val; - _lastAddress = (ushort)(addr & 0x1fff); - } + if (!peek) + { + _lastData = val; + _lastAddress = (ushort)(addr & 0x1fff); + } return val; } @@ -254,56 +254,56 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private void CheckBankSwitch(ushort address, byte value) { - if (((_lastData & 0xe0) == 0x60) && // Switch lower/middle/upper bank - ((_lastAddress >= 0x1000) || (_lastAddress < 0x200))) - { - if ((address & 0x0f00) == 0x0c00) // Enable 256B of ROM at 0x1e00 - 0x1eff - { - _isRomHigh = true; - _sliceHigh = (address & 0xff) << 8; - } - else if ((address & 0x0f00) == 0x0d00) // Enable 256B of RAM at 0x1e00 - 0x1eff - { - _isRomHigh = false; - _sliceHigh = (address & 0x7f) << 8; - } - else if ((address & 0x0f40) == 0x0e00) // Enable 2K of ROM at 0x1000 - 0x17ff - { - _isRomLow = true; - _sliceLow = (address & 0x1f) << 11; - } - else if ((address & 0x0f40) == 0x0e40) // Enable 2K of RAM at 0x1000 - 0x17ff - { - _isRomLow = false; - _sliceLow = (address & 0xf) << 11; - } - else if ((address & 0x0f40) == 0x0f00) // Enable 1.5K of ROM at 0x1800 - 0x1dff - { - _isRomMiddle = true; - _sliceMiddle = (address & 0x1f) << 11; - } - else if ((address & 0x0f50) == 0x0f40) // Enable 1.5K of RAM at 0x1800 - 0x1dff - { - _isRomMiddle = false; - _sliceMiddle = (address & 0xf) << 11; - } - else if ((address & 0x0f00) == 0x0400) // Toggle bit A11 of lower block address - { - _sliceLow = _sliceLow ^ 0x800; - } - else if ((address & 0x0f00) == 0x0500) // Toggle bit A12 of lower block address - { - _sliceLow = _sliceLow ^ 0x1000; - } - else if ((address & 0x0f00) == 0x0800) // Toggle bit A11 of middle block address - { - _sliceMiddle = _sliceMiddle ^ 0x800; - } - else if ((address & 0x0f00) == 0x0900) // Toggle bit A12 of middle block address - { - _sliceMiddle = _sliceMiddle ^ 0x1000; - } - } + if (((_lastData & 0xe0) == 0x60) && // Switch lower/middle/upper bank + ((_lastAddress >= 0x1000) || (_lastAddress < 0x200))) + { + if ((address & 0x0f00) == 0x0c00) // Enable 256B of ROM at 0x1e00 - 0x1eff + { + _isRomHigh = true; + _sliceHigh = (address & 0xff) << 8; + } + else if ((address & 0x0f00) == 0x0d00) // Enable 256B of RAM at 0x1e00 - 0x1eff + { + _isRomHigh = false; + _sliceHigh = (address & 0x7f) << 8; + } + else if ((address & 0x0f40) == 0x0e00) // Enable 2K of ROM at 0x1000 - 0x17ff + { + _isRomLow = true; + _sliceLow = (address & 0x1f) << 11; + } + else if ((address & 0x0f40) == 0x0e40) // Enable 2K of RAM at 0x1000 - 0x17ff + { + _isRomLow = false; + _sliceLow = (address & 0xf) << 11; + } + else if ((address & 0x0f40) == 0x0f00) // Enable 1.5K of ROM at 0x1800 - 0x1dff + { + _isRomMiddle = true; + _sliceMiddle = (address & 0x1f) << 11; + } + else if ((address & 0x0f50) == 0x0f40) // Enable 1.5K of RAM at 0x1800 - 0x1dff + { + _isRomMiddle = false; + _sliceMiddle = (address & 0xf) << 11; + } + else if ((address & 0x0f00) == 0x0400) // Toggle bit A11 of lower block address + { + _sliceLow = _sliceLow ^ 0x800; + } + else if ((address & 0x0f00) == 0x0500) // Toggle bit A12 of lower block address + { + _sliceLow = _sliceLow ^ 0x1000; + } + else if ((address & 0x0f00) == 0x0800) // Toggle bit A11 of middle block address + { + _sliceMiddle = _sliceMiddle ^ 0x800; + } + else if ((address & 0x0f00) == 0x0900) // Toggle bit A12 of middle block address + { + _sliceMiddle = _sliceMiddle ^ 0x1000; + } + } // Zero-page hotspots for upper page // 0xf4, 0xf6, 0xfc, 0xfe for ROM // 0xf5, 0xf7, 0xfd, 0xff for RAM diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs index 21463346cf..e4005b6eab 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs @@ -184,8 +184,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private bool _disableRam = true; private bool _writeMode = false; private int _column = 0; - public bool _func_key = false; - public bool _shift_key = false; + public bool _func_key = false; + public bool _shift_key = false; public override void Dispose() { @@ -214,59 +214,59 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.Sync("column", ref _column); ser.Sync("disableRam", ref _disableRam); ser.Sync("writeMode", ref _writeMode); - ser.Sync("FuncKey", ref _func_key); - ser.Sync("ShiftKey", ref _shift_key); + ser.Sync("FuncKey", ref _func_key); + ser.Sync("ShiftKey", ref _shift_key); - base.SyncState(ser); + base.SyncState(ser); } private byte ReadMem(ushort addr, bool peek) { - // A unique feature of the keyboard is that it changes the operation of inputs 0-3 - // by holding them high in the no-button-pressed state. - // However exposing this behaviour to the rest of the system would be overly cunmbersome - // so instead we bypass these cases here + // A unique feature of the keyboard is that it changes the operation of inputs 0-3 + // by holding them high in the no-button-pressed state. + // However exposing this behaviour to the rest of the system would be overly cunmbersome + // so instead we bypass these cases here - if ((addr & 0x000F) == 8 && (addr & 0x1080)==0 && addr<1000) - { - // if func key pressed - if (_func_key == true) - { - return 0x80; - } - else - { - return 0; - } - - } - else if ((addr & 0x000F) == 9 && (addr & 0x1080) == 0 && addr < 1000) - { - return 0x80; - } - else if ((addr & 0x000F) == 0xA && (addr & 0x1080) == 0 && addr < 1000) - { - return 0x80; - } - else if ((addr & 0x000F) == 0xB && (addr & 0x1080) == 0 && addr < 1000) - { - // if shift key pressed - if (_shift_key == true) - { - return 0x80; - } - else - { - return 0; - } - } - else if (addr < 0x1000) + if ((addr & 0x000F) == 8 && (addr & 0x1080)==0 && addr<1000) { - return base.ReadMemory(addr); - } - + // if func key pressed + if (_func_key == true) + { + return 0x80; + } + else + { + return 0; + } + + } + else if ((addr & 0x000F) == 9 && (addr & 0x1080) == 0 && addr < 1000) + { + return 0x80; + } + else if ((addr & 0x000F) == 0xA && (addr & 0x1080) == 0 && addr < 1000) + { + return 0x80; + } + else if ((addr & 0x000F) == 0xB && (addr & 0x1080) == 0 && addr < 1000) + { + // if shift key pressed + if (_shift_key == true) + { + return 0x80; + } + else + { + return 0; + } + } + else if (addr < 0x1000) + { + return base.ReadMemory(addr); + } + // Lower 2K is always the first 2K of the ROM bank @@ -282,21 +282,21 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 return _ram[addr & 0x7FF]; } - // Attempting to read while in write mode - throw new NotTestedException(); + // Attempting to read while in write mode + throw new NotTestedException(); } - public override byte ReadMemory(ushort addr) - { - return ReadMem(addr, false); - } + public override byte ReadMemory(ushort addr) + { + return ReadMem(addr, false); + } - public override byte PeekMemory(ushort addr) + public override byte PeekMemory(ushort addr) { return ReadMem(addr,true); } - private void WriteMem(ushort addr, byte value, bool poke) + private void WriteMem(ushort addr, byte value, bool poke) { //Mimicking the 6532 logic for accesing port A, for testing var isPortA = false; @@ -346,9 +346,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _bank4K = value & 0x03; - //D6 = 1 -> increase key column (0 to 9) - //D5 = 1 -> reset key column to 0 (if D4 = 0) - if (bit5 && !bit4) + //D6 = 1 -> increase key column (0 to 9) + //D5 = 1 -> reset key column to 0 (if D4 = 0) + if (bit5 && !bit4) { _column = 0; } @@ -366,20 +366,20 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _ram[addr & 0x7FF] = value; } } - if (addr<0x1000) { - base.WriteMemory(addr, value); - } + if (addr<0x1000) { + base.WriteMemory(addr, value); + } } - public override void WriteMemory(ushort addr, byte value) - { - WriteMem(addr, value, false); - } + public override void WriteMemory(ushort addr, byte value) + { + WriteMem(addr, value, false); + } - public override void PokeMemory(ushort addr, byte value) - { - WriteMem(addr, value, true); - } - } + public override void PokeMemory(ushort addr, byte value) + { + WriteMem(addr, value, true); + } + } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8_sega.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8_sega.cs index 871c7d412f..f26cf9ff62 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8_sega.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8_sega.cs @@ -2,14 +2,14 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { - /* + /* F8 Sega ----- Apparently some of Sega's games have banks that are physically flipped, so even though this game uses a common mapper, the initial bank that gets pointed to is incorrect. */ - internal class mF8_sega : MapperBase + internal class mF8_sega : MapperBase { private int _bank4K=1; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs index 724ad65783..803aff1a52 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs @@ -1647,76 +1647,76 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 #endregion public void SyncState(Serializer ser) - { - ser.BeginSection("TIA"); - _ball.SyncState(ser); - _hmove.SyncState(ser); - ser.Sync("hsyncCnt", ref _hsyncCnt); + { + ser.BeginSection("TIA"); + _ball.SyncState(ser); + _hmove.SyncState(ser); + ser.Sync("hsyncCnt", ref _hsyncCnt); - // add everything to the state - ser.Sync("Bus_State", ref bus_state); + // add everything to the state + ser.Sync("Bus_State", ref bus_state); - ser.Sync("PF0_up",ref pf0_update); - ser.Sync("PF1_up", ref pf1_update); - ser.Sync("PF2_up", ref pf2_update); - ser.Sync("PF0_upper", ref pf0_updater); - ser.Sync("PF1_upper", ref pf1_updater); - ser.Sync("PF2_upper", ref pf2_updater); - ser.Sync("PF0_delay", ref pf0_delay_clock); - ser.Sync("PF1_delay", ref pf1_delay_clock); - ser.Sync("PF2_delay", ref pf2_delay_clock); - ser.Sync("PF0_max", ref pf0_max_delay); - ser.Sync("PF1_max", ref pf1_max_delay); - ser.Sync("PF2_max", ref pf2_max_delay); + ser.Sync("PF0_up",ref pf0_update); + ser.Sync("PF1_up", ref pf1_update); + ser.Sync("PF2_up", ref pf2_update); + ser.Sync("PF0_upper", ref pf0_updater); + ser.Sync("PF1_upper", ref pf1_updater); + ser.Sync("PF2_upper", ref pf2_updater); + ser.Sync("PF0_delay", ref pf0_delay_clock); + ser.Sync("PF1_delay", ref pf1_delay_clock); + ser.Sync("PF2_delay", ref pf2_delay_clock); + ser.Sync("PF0_max", ref pf0_max_delay); + ser.Sync("PF1_max", ref pf1_max_delay); + ser.Sync("PF2_max", ref pf2_max_delay); - ser.Sync("Enam0_delay", ref enam0_delay); - ser.Sync("Enam1_delay", ref enam1_delay); - ser.Sync("Enab_delay", ref enamb_delay); - ser.Sync("Enam0_val", ref enam0_val); - ser.Sync("Enam1_val", ref enam1_val); - ser.Sync("Enab_val", ref enamb_val); + ser.Sync("Enam0_delay", ref enam0_delay); + ser.Sync("Enam1_delay", ref enam1_delay); + ser.Sync("Enab_delay", ref enamb_delay); + ser.Sync("Enam0_val", ref enam0_val); + ser.Sync("Enam1_val", ref enam1_val); + ser.Sync("Enab_val", ref enamb_val); - ser.Sync("P0_stuff", ref p0_stuff); - ser.Sync("P1_stuff", ref p1_stuff); - ser.Sync("M0_stuff", ref m0_stuff); - ser.Sync("M1_stuf", ref m1_stuff); - ser.Sync("b_stuff", ref b_stuff); + ser.Sync("P0_stuff", ref p0_stuff); + ser.Sync("P1_stuff", ref p1_stuff); + ser.Sync("M0_stuff", ref m0_stuff); + ser.Sync("M1_stuf", ref m1_stuff); + ser.Sync("b_stuff", ref b_stuff); - ser.Sync("hmp0_delay", ref HMP0_delay); - ser.Sync("hmp0_val", ref HMP0_val); - ser.Sync("hmp1_delay", ref HMP1_delay); - ser.Sync("hmp1_val", ref HMP1_val); + ser.Sync("hmp0_delay", ref HMP0_delay); + ser.Sync("hmp0_val", ref HMP0_val); + ser.Sync("hmp1_delay", ref HMP1_delay); + ser.Sync("hmp1_val", ref HMP1_val); - ser.Sync("PRG0_delay", ref prg0_delay); - ser.Sync("PRG1_delay", ref prg1_delay); - ser.Sync("PRG0_val", ref prg0_val); - ser.Sync("PRG1_val", ref prg1_val); + ser.Sync("PRG0_delay", ref prg0_delay); + ser.Sync("PRG1_delay", ref prg1_delay); + ser.Sync("PRG0_val", ref prg0_val); + ser.Sync("PRG1_val", ref prg1_val); - ser.Sync("Ticks", ref do_ticks); + ser.Sync("Ticks", ref do_ticks); - ser.Sync("VBlankDelay", ref vblank_delay); - ser.Sync("VBlankValue", ref vblank_value); + ser.Sync("VBlankDelay", ref vblank_delay); + ser.Sync("VBlankValue", ref vblank_value); - // some of these things weren't in the state because they weren't needed if - // states were always taken at frame boundaries - ser.Sync("capChargeStart", ref _capChargeStart); - ser.Sync("capCharging", ref _capCharging); - ser.Sync("vblankEnabled", ref _vblankEnabled); - ser.Sync("vsyncEnabled", ref _vsyncEnabled); - ser.Sync("CurrentScanLine", ref _CurrentScanLine); - ser.Sync("scanlinebuffer", ref _scanlinebuffer, false); - ser.Sync("AudioClocks", ref _audioClocks); - ser.Sync("FrameStartCycles", ref frameStartCycles); - ser.Sync("FrameEndCycles", ref frameEndCycles); + // some of these things weren't in the state because they weren't needed if + // states were always taken at frame boundaries + ser.Sync("capChargeStart", ref _capChargeStart); + ser.Sync("capCharging", ref _capCharging); + ser.Sync("vblankEnabled", ref _vblankEnabled); + ser.Sync("vsyncEnabled", ref _vsyncEnabled); + ser.Sync("CurrentScanLine", ref _CurrentScanLine); + ser.Sync("scanlinebuffer", ref _scanlinebuffer, false); + ser.Sync("AudioClocks", ref _audioClocks); + ser.Sync("FrameStartCycles", ref frameStartCycles); + ser.Sync("FrameEndCycles", ref frameEndCycles); - ser.BeginSection("Player0"); - _player0.SyncState(ser); - ser.EndSection(); - ser.BeginSection("Player1"); - _player1.SyncState(ser); - ser.EndSection(); - _playField.SyncState(ser); - ser.EndSection(); - } - } + ser.BeginSection("Player0"); + _player0.SyncState(ser); + ser.EndSection(); + ser.BeginSection("Player1"); + _player1.SyncState(ser); + ser.EndSection(); + _playField.SyncState(ser); + ser.EndSection(); + } + } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs index 585a9c3d37..fb83e6ef0f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs @@ -25,8 +25,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // 5 bit shift register private int sr5 = 0x1f; - // 9 bit shift register - private int sr9 = 0x1ff; + // 9 bit shift register + private int sr9 = 0x1ff; // 3 state counter private int sr3 = 2; @@ -87,11 +87,11 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private bool Run9() { - bool ret = (sr9 & 1) != 0; - bool c = ((sr9 & 1) != 0) ^ ((sr9 & 16) != 0); - sr9 = (sr9 >> 1) | (c ? 256 : 0); - return ret; - } + bool ret = (sr9 & 1) != 0; + bool c = ((sr9 & 1) != 0) ^ ((sr9 & 16) != 0); + sr9 = (sr9 >> 1) | (c ? 256 : 0); + return ret; + } /// /// call me approx 31k times a second @@ -143,7 +143,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Run4(); on = Run1(); break; - + case 0x06: case 0x0a: Run5(); @@ -162,7 +162,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 case 0x09: on = Run5(); break; - + case 0x08: on = Run9(); break; @@ -203,8 +203,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.Sync("sr3", ref sr3); ser.Sync("sr4", ref sr4); ser.Sync("sr5", ref sr5); - ser.Sync("sr9", ref sr9); - ser.Sync("freqcnt", ref freqcnt); + ser.Sync("sr9", ref sr9); + ser.Sync("freqcnt", ref freqcnt); ser.Sync("on", ref on); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.HMoveData.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.HMoveData.cs index 48a6ec8244..9262cdcf7c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.HMoveData.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.HMoveData.cs @@ -19,13 +19,13 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public byte HMoveDelayCnt; public byte HMoveCnt; - public int test_count_p0; - public int test_count_p1; - public int test_count_m0; - public int test_count_m1; - public int test_count_b; + public int test_count_p0; + public int test_count_p1; + public int test_count_m0; + public int test_count_m1; + public int test_count_b; - public byte Player0Cnt; + public byte Player0Cnt; public byte Player1Cnt; public byte Missile0Cnt; public byte Missile1Cnt; @@ -49,12 +49,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.Sync("missile0Cnt", ref Missile0Cnt); ser.Sync("missile1Cnt", ref Missile1Cnt); ser.Sync("Test_count_p0", ref test_count_p0); - ser.Sync("Test_count_p1", ref test_count_p1); - ser.Sync("Test_count_m0", ref test_count_m0); - ser.Sync("Test_count_m1", ref test_count_m1); - ser.Sync("Test_count_b", ref test_count_b); - ser.Sync("ballCnt", ref BallCnt); - ser.EndSection(); + ser.Sync("Test_count_p1", ref test_count_p1); + ser.Sync("Test_count_m0", ref test_count_m0); + ser.Sync("Test_count_m1", ref test_count_m1); + ser.Sync("Test_count_b", ref test_count_b); + ser.Sync("ballCnt", ref BallCnt); + ser.EndSection(); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs index bb7c6984a4..0a65d8201c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs @@ -14,36 +14,36 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public byte Hm; public byte Collisions; - // Resp commands do not trigger start signals for main copies. We need to model this - public int Draw_To; - public byte ScanCnt; - public bool ScanCntInit; - public int Start_Signal; - public int Signal_Reached; + // Resp commands do not trigger start signals for main copies. We need to model this + public int Draw_To; + public byte ScanCnt; + public bool ScanCntInit; + public int Start_Signal; + public int Signal_Reached; - public bool Tick() + public bool Tick() { var result = false; - if (ScanCntInit==true) - { - if (ScanCnt < (1 << Size) && Enabled && !ResetToPlayer) - { - result = true; - ScanCnt++; - - } else - { - ScanCntInit = false; - } + if (ScanCntInit==true) + { + if (ScanCnt < (1 << Size) && Enabled && !ResetToPlayer) + { + result = true; + ScanCnt++; + + } else + { + ScanCntInit = false; + } - } + } - /* - // At hPosCnt == 0, start drawing the missile, if enabled - if (HPosCnt < (1 << Size)) + /* + // At hPosCnt == 0, start drawing the missile, if enabled + if (HPosCnt < (1 << Size)) { if (Enabled && !ResetToPlayer) { @@ -88,54 +88,54 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } }*/ - if (Start_Signal == 160) - { - ScanCnt = 0; - Start_Signal++; - ScanCntInit = true; - } + if (Start_Signal == 160) + { + ScanCnt = 0; + Start_Signal++; + ScanCntInit = true; + } - if (Start_Signal == 16 && ((Number & 0x07) == 0x01 || ((Number & 0x07) == 0x03))) - { - ScanCnt = 0; - Start_Signal++; - ScanCntInit = true; - } + if (Start_Signal == 16 && ((Number & 0x07) == 0x01 || ((Number & 0x07) == 0x03))) + { + ScanCnt = 0; + Start_Signal++; + ScanCntInit = true; + } - if (Start_Signal == 32 && ((Number & 0x07) == 0x02 || ((Number & 0x07) == 0x03) || ((Number & 0x07) == 0x06))) - { - ScanCnt = 0; - Start_Signal++; - ScanCntInit = true; - } + if (Start_Signal == 32 && ((Number & 0x07) == 0x02 || ((Number & 0x07) == 0x03) || ((Number & 0x07) == 0x06))) + { + ScanCnt = 0; + Start_Signal++; + ScanCntInit = true; + } - if (Start_Signal == 64 && ((Number & 0x07) == 0x04 || ((Number & 0x07) == 0x06))) - { - ScanCnt = 0; - Start_Signal++; - ScanCntInit = true; - } + if (Start_Signal == 64 && ((Number & 0x07) == 0x04 || ((Number & 0x07) == 0x06))) + { + ScanCnt = 0; + Start_Signal++; + ScanCntInit = true; + } - // Increment the counter - HPosCnt++; + // Increment the counter + HPosCnt++; // Counter loops at 160 HPosCnt %= 160; - //our goal here is to send a start signal 4 clocks before drawing begins. The properly emulates - //drawing on a real TIA - if (HPosCnt == 156 || HPosCnt == 12 || HPosCnt == 28 || HPosCnt == 60) - { - Start_Signal = HPosCnt; - Signal_Reached = HPosCnt + 5; - } + //our goal here is to send a start signal 4 clocks before drawing begins. The properly emulates + //drawing on a real TIA + if (HPosCnt == 156 || HPosCnt == 12 || HPosCnt == 28 || HPosCnt == 60) + { + Start_Signal = HPosCnt; + Signal_Reached = HPosCnt + 5; + } - if (Start_Signal < Signal_Reached) - { - Start_Signal++; - } + if (Start_Signal < Signal_Reached) + { + Start_Signal++; + } - return result; + return result; } public void SyncState(Serializer ser) @@ -148,12 +148,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.Sync("number", ref Number); ser.Sync("HM", ref Hm); ser.Sync("collisions", ref Collisions); - ser.Sync("start_signal", ref Start_Signal); - ser.Sync("signal_reached", ref Signal_Reached); - ser.Sync("draw_to", ref Draw_To); - ser.Sync("scanCnt", ref ScanCnt); - ser.Sync("scanCntInit", ref ScanCntInit); - ser.EndSection(); + ser.Sync("start_signal", ref Start_Signal); + ser.Sync("signal_reached", ref Signal_Reached); + ser.Sync("draw_to", ref Draw_To); + ser.Sync("scanCnt", ref ScanCnt); + ser.Sync("scanCntInit", ref ScanCntInit); + ser.EndSection(); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs index 83dc7ae9c1..89f92aee84 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs @@ -20,11 +20,11 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public byte Nusiz; public byte Collisions; - // Resp commands do not trigger start signals for main copies. We need to model this - public int Start_Signal; - public int Signal_Reached; + // Resp commands do not trigger start signals for main copies. We need to model this + public int Start_Signal; + public int Signal_Reached; - public bool Tick() + public bool Tick() { var result = false; if (ScanCnt < 8) @@ -115,9 +115,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // At counter position 0 we should initalize the scan counter. // Note that for double and quad sized players that the scan counter is not started immediately. if (Start_Signal==160) - { + { ScanCnt = 0; - Start_Signal++; + Start_Signal++; if ((Nusiz & 0x07) == 0x05) { ScanCntInit = true; @@ -135,20 +135,20 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 if (Start_Signal == 16 && ((Nusiz & 0x07) == 0x01 || ((Nusiz & 0x07) == 0x03))) { ScanCnt = 0; - Start_Signal++; - } + Start_Signal++; + } if (Start_Signal == 32 && ((Nusiz & 0x07) == 0x02 || ((Nusiz & 0x07) == 0x03) || ((Nusiz & 0x07) == 0x06))) { ScanCnt = 0; - Start_Signal++; - } + Start_Signal++; + } if (Start_Signal == 64 && ((Nusiz & 0x07) == 0x04 || ((Nusiz & 0x07) == 0x06))) { ScanCnt = 0; - Start_Signal++; - } + Start_Signal++; + } // Increment the counter HPosCnt++; @@ -156,18 +156,18 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Counter loops at 160 HPosCnt %= 160; - //our goal here is to send a start signal 4 clocks before drawing begins. This properly emulates - //drawing on a real TIA - if (HPosCnt==156 || HPosCnt==12 || HPosCnt==28 || HPosCnt==60) - { - Start_Signal = HPosCnt-1; - Signal_Reached = HPosCnt + 5; - } + //our goal here is to send a start signal 4 clocks before drawing begins. This properly emulates + //drawing on a real TIA + if (HPosCnt==156 || HPosCnt==12 || HPosCnt==28 || HPosCnt==60) + { + Start_Signal = HPosCnt-1; + Signal_Reached = HPosCnt + 5; + } - if (Start_Signal(); - s.Prepare(); - var ff = s.GetFunctionPointersSave(); - LibLynx.TxtStateSave(Core, ref ff); - s.ExtraData.IsLagFrame = IsLagFrame; - s.ExtraData.LagCount = LagCount; - s.ExtraData.Frame = Frame; + public void SaveStateText(TextWriter writer) + { + var s = new TextState(); + s.Prepare(); + var ff = s.GetFunctionPointersSave(); + LibLynx.TxtStateSave(Core, ref ff); + s.ExtraData.IsLagFrame = IsLagFrame; + s.ExtraData.LagCount = LagCount; + s.ExtraData.Frame = Frame; - ser.Serialize(writer, s); - // write extra copy of stuff we don't use - writer.WriteLine(); - writer.WriteLine("Frame {0}", Frame); + ser.Serialize(writer, s); + // write extra copy of stuff we don't use + writer.WriteLine(); + writer.WriteLine("Frame {0}", Frame); - //Console.WriteLine(BizHawk.Common.BufferExtensions.BufferExtensions.HashSHA1(SaveStateBinary())); - } + //Console.WriteLine(BizHawk.Common.BufferExtensions.BufferExtensions.HashSHA1(SaveStateBinary())); + } - public void LoadStateText(TextReader reader) - { - var s = (TextState)ser.Deserialize(reader, typeof(TextState)); - s.Prepare(); - var ff = s.GetFunctionPointersLoad(); - LibLynx.TxtStateLoad(Core, ref ff); - IsLagFrame = s.ExtraData.IsLagFrame; - LagCount = s.ExtraData.LagCount; - Frame = s.ExtraData.Frame; - } + public void LoadStateText(TextReader reader) + { + var s = (TextState)ser.Deserialize(reader, typeof(TextState)); + s.Prepare(); + var ff = s.GetFunctionPointersLoad(); + LibLynx.TxtStateLoad(Core, ref ff); + IsLagFrame = s.ExtraData.IsLagFrame; + LagCount = s.ExtraData.LagCount; + Frame = s.ExtraData.Frame; + } - public void SaveStateBinary(BinaryWriter writer) - { - if (!LibLynx.BinStateSave(Core, savebuff, savebuff.Length)) - { - throw new InvalidOperationException("Core's BinStateSave() returned false!"); - } + public void SaveStateBinary(BinaryWriter writer) + { + if (!LibLynx.BinStateSave(Core, savebuff, savebuff.Length)) + { + throw new InvalidOperationException("Core's BinStateSave() returned false!"); + } - writer.Write(savebuff.Length); - writer.Write(savebuff); + writer.Write(savebuff.Length); + writer.Write(savebuff); - // other variables - writer.Write(IsLagFrame); - writer.Write(LagCount); - writer.Write(Frame); - } + // other variables + writer.Write(IsLagFrame); + writer.Write(LagCount); + writer.Write(Frame); + } - public void LoadStateBinary(BinaryReader reader) - { - int length = reader.ReadInt32(); - if (length != savebuff.Length) - { - throw new InvalidOperationException("Save buffer size mismatch!"); - } + public void LoadStateBinary(BinaryReader reader) + { + int length = reader.ReadInt32(); + if (length != savebuff.Length) + { + throw new InvalidOperationException("Save buffer size mismatch!"); + } - reader.Read(savebuff, 0, length); - if (!LibLynx.BinStateLoad(Core, savebuff, savebuff.Length)) - { - throw new InvalidOperationException("Core's BinStateLoad() returned false!"); - } + reader.Read(savebuff, 0, length); + if (!LibLynx.BinStateLoad(Core, savebuff, savebuff.Length)) + { + throw new InvalidOperationException("Core's BinStateLoad() returned false!"); + } - // other variables - IsLagFrame = reader.ReadBoolean(); - LagCount = reader.ReadInt32(); - Frame = reader.ReadInt32(); - } + // other variables + IsLagFrame = reader.ReadBoolean(); + LagCount = reader.ReadInt32(); + Frame = reader.ReadInt32(); + } - public byte[] SaveStateBinary() - { - var ms = new MemoryStream(savebuff2, true); - var bw = new BinaryWriter(ms); - SaveStateBinary(bw); - bw.Flush(); - if (ms.Position != savebuff2.Length) - { - throw new InvalidOperationException(); - } + public byte[] SaveStateBinary() + { + var ms = new MemoryStream(savebuff2, true); + var bw = new BinaryWriter(ms); + SaveStateBinary(bw); + bw.Flush(); + if (ms.Position != savebuff2.Length) + { + throw new InvalidOperationException(); + } - ms.Close(); - return savebuff2; - } + ms.Close(); + return savebuff2; + } - private JsonSerializer ser = new JsonSerializer { Formatting = Formatting.Indented }; - private byte[] savebuff; - private byte[] savebuff2; + private JsonSerializer ser = new JsonSerializer { Formatting = Formatting.Indented }; + private byte[] savebuff; + private byte[] savebuff2; - private class TextStateData - { - public int Frame; - public int LagCount; - public bool IsLagFrame; - } - } + private class TextStateData + { + public int Frame; + public int LagCount; + public bool IsLagFrame; + } + } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IVideoProvider.cs b/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IVideoProvider.cs index 941af16c9f..2fe125f4a9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IVideoProvider.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.IVideoProvider.cs @@ -6,35 +6,35 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Atari.Lynx { - public partial class Lynx : IVideoProvider - { - private const int WIDTH = 160; - private const int HEIGHT = 102; + public partial class Lynx : IVideoProvider + { + private const int WIDTH = 160; + private const int HEIGHT = 102; - private int[] videobuff = new int[WIDTH * HEIGHT]; + private int[] videobuff = new int[WIDTH * HEIGHT]; - public int[] GetVideoBuffer() - { - return videobuff; - } + public int[] GetVideoBuffer() + { + return videobuff; + } - public int VirtualWidth - { - get { return BufferWidth; } - } + public int VirtualWidth + { + get { return BufferWidth; } + } - public int VirtualHeight - { - get { return BufferHeight; } - } + public int VirtualHeight + { + get { return BufferHeight; } + } - public int BufferWidth { get; private set; } + public int BufferWidth { get; private set; } - public int BufferHeight { get; private set; } + public int BufferHeight { get; private set; } - public int BackgroundColor - { - get { return unchecked((int)0xff000000); } - } - } + public int BackgroundColor + { + get { return unchecked((int)0xff000000); } + } + } } diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IDebuggable.cs index 356e02550d..79a3899bd6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IDebuggable.cs @@ -124,11 +124,11 @@ namespace BizHawk.Emulation.Cores.ColecoVision public bool CanStep(StepType type) => false; - [FeatureNotImplemented] + [FeatureNotImplemented] public void Step(StepType type) - { - throw new NotImplementedException(); - } + { + throw new NotImplementedException(); + } public int TotalExecutedCycles => Cpu.TotalExecutedCycles; } diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs index e876bfb69c..71d825f22d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IStatable.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision { public bool BinarySaveStatesPreferred => false; - public void SaveStateBinary(BinaryWriter bw) + public void SaveStateBinary(BinaryWriter bw) { SyncState(Serializer.CreateBinaryWriter(bw)); } diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index 8e8380a6be..6ce3c6d088 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision MemoryCallbacks = MemoryCallbacks }; - PSG = new SN76489(); + PSG = new SN76489(); _fakeSyncSound = new FakeSyncSound(PSG, 735); (ServiceProvider as BasicServiceProvider).Register(_fakeSyncSound); @@ -187,7 +187,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision public bool DeterministicEmulation => true; - public void Dispose() { } + public void Dispose() { } public void ResetCounters() { diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs index 7d7d7a6c87..c171972367 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs @@ -84,13 +84,13 @@ namespace BizHawk.Emulation.Cores.ColecoVision VdpWaitingForLatchByte = true; VdpAddress = (ushort)(((value & 63) << 8) | VdpLatch); - VdpAddress &= 0x3FFF; + VdpAddress &= 0x3FFF; switch (value & 0xC0) { case 0x00: // read VRAM VdpBuffer = VRAM[VdpAddress]; VdpAddress++; - VdpAddress &= 0x3FFF; + VdpAddress &= 0x3FFF; break; case 0x40: // write VRAM break; @@ -107,10 +107,10 @@ namespace BizHawk.Emulation.Cores.ColecoVision VdpBuffer = value; VRAM[VdpAddress] = value; - //if (!Mode16k) - // Console.WriteLine("VRAM written while not in 16k addressing mode!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + //if (!Mode16k) + // Console.WriteLine("VRAM written while not in 16k addressing mode!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); VdpAddress++; - VdpAddress &= 0x3FFF; + VdpAddress &= 0x3FFF; } void WriteRegister(int reg, byte data) @@ -161,7 +161,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision byte value = VdpBuffer; VdpBuffer = VRAM[VdpAddress]; VdpAddress++; - VdpAddress &= 0x3FFF; + VdpAddress &= 0x3FFF; return value; } @@ -172,8 +172,8 @@ namespace BizHawk.Emulation.Cores.ColecoVision else if (Mode3Bit) TmsMode = 3; else TmsMode = 0; - if (TmsMode == 1) - throw new Exception("TMS video mode 1! please tell vecna which game uses this!"); + if (TmsMode == 1) + throw new Exception("TMS video mode 1! please tell vecna which game uses this!"); } void RenderScanline(int scanLine) @@ -191,12 +191,12 @@ namespace BizHawk.Emulation.Cores.ColecoVision RenderBackgroundM0(scanLine); RenderTmsSprites(scanLine); } - else if (TmsMode == 3) - { - RenderBackgroundM3(scanLine); - RenderTmsSprites(scanLine); - } - // This may seem silly but if I ever implement mode 1, sprites are not rendered in that. + else if (TmsMode == 3) + { + RenderBackgroundM3(scanLine); + RenderTmsSprites(scanLine); + } + // This may seem silly but if I ever implement mode 1, sprites are not rendered in that. } void RenderBackgroundM0(int scanLine) @@ -234,88 +234,88 @@ namespace BizHawk.Emulation.Cores.ColecoVision } } - void RenderBackgroundM2(int scanLine) - { - if (DisplayOn == false) - { - Array.Clear(FrameBuffer, scanLine * 256, 256); - return; - } + void RenderBackgroundM2(int scanLine) + { + if (DisplayOn == false) + { + Array.Clear(FrameBuffer, scanLine * 256, 256); + return; + } - int yrow = scanLine / 8; - int yofs = scanLine % 8; - int FrameBufferOffset = scanLine * 256; - int PatternNameOffset = TmsPatternNameTableBase + (yrow * 32); - int PatternGeneratorOffset = (((Registers[4] & 4) << 11) & 0x2000); - int ColorOffset = (ColorTableBase & 0x2000); - int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F]; + int yrow = scanLine / 8; + int yofs = scanLine % 8; + int FrameBufferOffset = scanLine * 256; + int PatternNameOffset = TmsPatternNameTableBase + (yrow * 32); + int PatternGeneratorOffset = (((Registers[4] & 4) << 11) & 0x2000); + int ColorOffset = (ColorTableBase & 0x2000); + int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F]; - for (int xc = 0; xc < 32; xc++) - { - int pn = VRAM[PatternNameOffset++] + ((yrow / 8) * 0x100); - int pv = VRAM[PatternGeneratorOffset + (pn * 8) + yofs]; - int colorEntry = VRAM[ColorOffset + (pn * 8) + yofs]; - int fgIndex = (colorEntry >> 4) & 0x0F; - int bgIndex = colorEntry & 0x0F; - int fgColor = fgIndex == 0 ? ScreenBGColor : PaletteTMS9918[fgIndex]; - int bgColor = bgIndex == 0 ? ScreenBGColor : PaletteTMS9918[bgIndex]; + for (int xc = 0; xc < 32; xc++) + { + int pn = VRAM[PatternNameOffset++] + ((yrow / 8) * 0x100); + int pv = VRAM[PatternGeneratorOffset + (pn * 8) + yofs]; + int colorEntry = VRAM[ColorOffset + (pn * 8) + yofs]; + int fgIndex = (colorEntry >> 4) & 0x0F; + int bgIndex = colorEntry & 0x0F; + int fgColor = fgIndex == 0 ? ScreenBGColor : PaletteTMS9918[fgIndex]; + int bgColor = bgIndex == 0 ? ScreenBGColor : PaletteTMS9918[bgIndex]; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x80) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x40) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x20) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x10) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x08) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x04) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x02) > 0) ? fgColor : bgColor; - FrameBuffer[FrameBufferOffset++] = ((pv & 0x01) > 0) ? fgColor : bgColor; - } - } + FrameBuffer[FrameBufferOffset++] = ((pv & 0x80) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x40) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x20) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x10) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x08) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x04) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x02) > 0) ? fgColor : bgColor; + FrameBuffer[FrameBufferOffset++] = ((pv & 0x01) > 0) ? fgColor : bgColor; + } + } - void RenderBackgroundM3(int scanLine) - { - if (DisplayOn == false) - { - Array.Clear(FrameBuffer, scanLine * 256, 256); - return; - } + void RenderBackgroundM3(int scanLine) + { + if (DisplayOn == false) + { + Array.Clear(FrameBuffer, scanLine * 256, 256); + return; + } - int yc = scanLine / 8; - bool top = (scanLine & 4) == 0; // am I in the top 4 pixels of an 8-pixel character? - int FrameBufferOffset = scanLine * 256; - int PatternNameOffset = TmsPatternNameTableBase + (yc * 32); - int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F]; + int yc = scanLine / 8; + bool top = (scanLine & 4) == 0; // am I in the top 4 pixels of an 8-pixel character? + int FrameBufferOffset = scanLine * 256; + int PatternNameOffset = TmsPatternNameTableBase + (yc * 32); + int ScreenBGColor = PaletteTMS9918[Registers[7] & 0x0F]; - for (int xc = 0; xc < 32; xc++) - { - int pn = VRAM[PatternNameOffset++]; - int pv = VRAM[PatternGeneratorBase + (pn * 8) + ((yc & 3) * 2) + (top ? 0 : 1)]; + for (int xc = 0; xc < 32; xc++) + { + int pn = VRAM[PatternNameOffset++]; + int pv = VRAM[PatternGeneratorBase + (pn * 8) + ((yc & 3) * 2) + (top ? 0 : 1)]; - int lColorIndex = pv & 0xF; - int rColorIndex = pv >> 4; - int lColor = lColorIndex == 0 ? ScreenBGColor : PaletteTMS9918[lColorIndex]; - int rColor = rColorIndex == 0 ? ScreenBGColor : PaletteTMS9918[rColorIndex]; + int lColorIndex = pv & 0xF; + int rColorIndex = pv >> 4; + int lColor = lColorIndex == 0 ? ScreenBGColor : PaletteTMS9918[lColorIndex]; + int rColor = rColorIndex == 0 ? ScreenBGColor : PaletteTMS9918[rColorIndex]; - FrameBuffer[FrameBufferOffset++] = lColor; - FrameBuffer[FrameBufferOffset++] = lColor; - FrameBuffer[FrameBufferOffset++] = lColor; - FrameBuffer[FrameBufferOffset++] = lColor; - FrameBuffer[FrameBufferOffset++] = rColor; - FrameBuffer[FrameBufferOffset++] = rColor; - FrameBuffer[FrameBufferOffset++] = rColor; - FrameBuffer[FrameBufferOffset ] = rColor; - } - } + FrameBuffer[FrameBufferOffset++] = lColor; + FrameBuffer[FrameBufferOffset++] = lColor; + FrameBuffer[FrameBufferOffset++] = lColor; + FrameBuffer[FrameBufferOffset++] = lColor; + FrameBuffer[FrameBufferOffset++] = rColor; + FrameBuffer[FrameBufferOffset++] = rColor; + FrameBuffer[FrameBufferOffset++] = rColor; + FrameBuffer[FrameBufferOffset ] = rColor; + } + } byte[] ScanlinePriorityBuffer = new byte[256]; byte[] SpriteCollisionBuffer = new byte[256]; - void RenderTmsSprites(int scanLine) - { - if (EnableDoubledSprites == false) - RenderTmsSpritesStandard(scanLine); - else - RenderTmsSpritesDouble(scanLine); - } + void RenderTmsSprites(int scanLine) + { + if (EnableDoubledSprites == false) + RenderTmsSpritesStandard(scanLine); + else + RenderTmsSpritesDouble(scanLine); + } void RenderTmsSpritesStandard(int scanLine) { @@ -328,7 +328,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision int SpriteSize = 8; if (LargeSprites) SpriteSize *= 2; - const int OneCellSize = 8; + const int OneCellSize = 8; int NumSpritesOnScanline = 0; for (int i = 0; i < 32; i++) @@ -356,9 +356,9 @@ namespace BizHawk.Emulation.Cores.ColecoVision if (LargeSprites) Pattern &= 0xFC; // 16x16 sprites forced to 4-byte alignment int SpriteLine = scanLine - y; - // pv contains the VRAM byte holding the pattern data for this character at this scanline. - // each byte contains the pattern data for each the 8 pixels on this line. - // the bit-shift further down on PV pulls out the relevant horizontal pixel. + // pv contains the VRAM byte holding the pattern data for this character at this scanline. + // each byte contains the pattern data for each the 8 pixels on this line. + // the bit-shift further down on PV pulls out the relevant horizontal pixel. byte pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine]; @@ -370,13 +370,13 @@ namespace BizHawk.Emulation.Cores.ColecoVision if (Color != 0 && (pv & (1 << (7 - (xp & 7)))) > 0) { - if (SpriteCollisionBuffer[x + xp] != 0) - StatusByte |= 0x20; // Set sprite collision flag + if (SpriteCollisionBuffer[x + xp] != 0) + StatusByte |= 0x20; // Set sprite collision flag if (ScanlinePriorityBuffer[x + xp] == 0) { ScanlinePriorityBuffer[x + xp] = 1; - SpriteCollisionBuffer[x + xp] = 1; + SpriteCollisionBuffer[x + xp] = 1; FrameBuffer[(scanLine * 256) + x + xp] = PaletteTMS9918[Color & 0x0F]; } } @@ -384,70 +384,70 @@ namespace BizHawk.Emulation.Cores.ColecoVision } } - void RenderTmsSpritesDouble(int scanLine) - { - if (DisplayOn == false) return; + void RenderTmsSpritesDouble(int scanLine) + { + if (DisplayOn == false) return; - Array.Clear(ScanlinePriorityBuffer, 0, 256); - Array.Clear(SpriteCollisionBuffer, 0, 256); + Array.Clear(ScanlinePriorityBuffer, 0, 256); + Array.Clear(SpriteCollisionBuffer, 0, 256); - bool LargeSprites = EnableLargeSprites; + bool LargeSprites = EnableLargeSprites; - int SpriteSize = 8; - if (LargeSprites) SpriteSize *= 2; - SpriteSize *= 2; // because sprite magnification - const int OneCellSize = 16; // once 8-pixel cell, doubled, will take 16 pixels + int SpriteSize = 8; + if (LargeSprites) SpriteSize *= 2; + SpriteSize *= 2; // because sprite magnification + const int OneCellSize = 16; // once 8-pixel cell, doubled, will take 16 pixels - int NumSpritesOnScanline = 0; - for (int i = 0; i < 32; i++) - { - int SpriteBase = TmsSpriteAttributeBase + (i * 4); - int y = VRAM[SpriteBase++]; - int x = VRAM[SpriteBase++]; - int Pattern = VRAM[SpriteBase++]; - int Color = VRAM[SpriteBase]; + int NumSpritesOnScanline = 0; + for (int i = 0; i < 32; i++) + { + int SpriteBase = TmsSpriteAttributeBase + (i * 4); + int y = VRAM[SpriteBase++]; + int x = VRAM[SpriteBase++]; + int Pattern = VRAM[SpriteBase++]; + int Color = VRAM[SpriteBase]; - if (y == 208) break; // terminator sprite - if (y > 224) y -= 256; // sprite Y wrap - y++; // inexplicably, sprites start on Y+1 - if (y > scanLine || y + SpriteSize <= scanLine) continue; // sprite is not on this scanline - if ((Color & 0x80) > 0) x -= 32; // Early Clock adjustment + if (y == 208) break; // terminator sprite + if (y > 224) y -= 256; // sprite Y wrap + y++; // inexplicably, sprites start on Y+1 + if (y > scanLine || y + SpriteSize <= scanLine) continue; // sprite is not on this scanline + if ((Color & 0x80) > 0) x -= 32; // Early Clock adjustment - if (++NumSpritesOnScanline == 5) - { - StatusByte &= 0xE0; // Clear FS0-FS4 bits - StatusByte |= (byte)i; // set 5th sprite index - StatusByte |= 0x40; // set overflow bit - break; - } + if (++NumSpritesOnScanline == 5) + { + StatusByte &= 0xE0; // Clear FS0-FS4 bits + StatusByte |= (byte)i; // set 5th sprite index + StatusByte |= 0x40; // set overflow bit + break; + } - if (LargeSprites) Pattern &= 0xFC; // 16x16 sprites forced to 4-byte alignment - int SpriteLine = scanLine - y; - SpriteLine /= 2; // because of sprite magnification + if (LargeSprites) Pattern &= 0xFC; // 16x16 sprites forced to 4-byte alignment + int SpriteLine = scanLine - y; + SpriteLine /= 2; // because of sprite magnification - byte pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine]; + byte pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine]; - for (int xp = 0; xp < SpriteSize && x + xp < 256; xp++) - { - if (x + xp < 0) continue; - if (LargeSprites && xp == OneCellSize) - pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine + 16]; + for (int xp = 0; xp < SpriteSize && x + xp < 256; xp++) + { + if (x + xp < 0) continue; + if (LargeSprites && xp == OneCellSize) + pv = VRAM[SpritePatternGeneratorBase + (Pattern * 8) + SpriteLine + 16]; - if (Color != 0 && (pv & (1 << (7 - ((xp / 2) & 7)))) > 0) // xp/2 is due to sprite magnification - { - if (SpriteCollisionBuffer[x + xp] != 0) - StatusByte |= 0x20; // Set sprite collision flag + if (Color != 0 && (pv & (1 << (7 - ((xp / 2) & 7)))) > 0) // xp/2 is due to sprite magnification + { + if (SpriteCollisionBuffer[x + xp] != 0) + StatusByte |= 0x20; // Set sprite collision flag - if (ScanlinePriorityBuffer[x + xp] == 0) - { - ScanlinePriorityBuffer[x + xp] = 1; - SpriteCollisionBuffer[x + xp] = 1; - FrameBuffer[(scanLine * 256) + x + xp] = PaletteTMS9918[Color & 0x0F]; - } - } - } - } - } + if (ScanlinePriorityBuffer[x + xp] == 0) + { + ScanlinePriorityBuffer[x + xp] = 1; + SpriteCollisionBuffer[x + xp] = 1; + FrameBuffer[(scanLine * 256) + x + xp] = PaletteTMS9918[Color & 0x0F]; + } + } + } + } + } Z80A Cpu; diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index ec1e7ef4a5..98ded4f658 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Intellivision public ControllerDefinition ControllerDefinition => ControllerDeck.Definition; - public IController Controller { get; set; } + public IController Controller { get; set; } public void FrameAdvance(bool render, bool rendersound) { @@ -126,14 +126,14 @@ namespace BizHawk.Emulation.Cores.Intellivision public int Frame => _frame; - public string SystemId => "INTV"; + public string SystemId => "INTV"; - public bool DeterministicEmulation => true; + public bool DeterministicEmulation => true; - [FeatureNotImplemented] + [FeatureNotImplemented] public string BoardName => null; - public void ResetCounters() + public void ResetCounters() { _frame = 0; lagcount = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index 336c3c0667..974fc98b76 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -184,31 +184,31 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public IEmulatorServiceProvider ServiceProvider { get; private set; } - #region ALL SAVESTATEABLE STATE GOES HERE + #region ALL SAVESTATEABLE STATE GOES HERE - /// - /// internal gambatte state - /// - internal IntPtr GambatteState = IntPtr.Zero; + /// + /// internal gambatte state + /// + internal IntPtr GambatteState = IntPtr.Zero; - public int Frame { get; set; } - public int LagCount { get; set; } - public bool IsLagFrame { get; set; } + public int Frame { get; set; } + public int LagCount { get; set; } + public bool IsLagFrame { get; set; } - // all cycle counts are relative to a 2*1024*1024 mhz refclock + // all cycle counts are relative to a 2*1024*1024 mhz refclock - /// - /// total cycles actually executed - /// - private ulong _cycleCount = 0; + /// + /// total cycles actually executed + /// + private ulong _cycleCount = 0; - /// - /// number of extra cycles we overran in the last frame - /// - private uint frameOverflow = 0; - public ulong CycleCount { get { return _cycleCount; } } + /// + /// number of extra cycles we overran in the last frame + /// + private uint frameOverflow = 0; + public ulong CycleCount { get { return _cycleCount; } } - #endregion + #endregion #region controller diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 5b7b27d42c..38244648b9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -163,7 +163,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 // Hack: Saving a state on frame 0 has been shown to not be sync stable. Advance past that frame to avoid the problem. // Advancing 2 frames was chosen to deal with a problem with the dynamic recompiler. The dynarec seems to take 2 frames to set // things up correctly. If a state is loaded on frames 0 or 1 mupen tries to access null pointers and the emulator crashes, so instead - // advance past both to again avoid the problem. + // advance past both to again avoid the problem. api.frame_advance(); api.frame_advance(); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs index 503ab67eda..7b269dbe8a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs @@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES static byte[] TRIANGLE_TABLE = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; static int[] NOISE_TABLE_NTSC = { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs index 52d5fc1c46..2382627ed5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else return base.ReadPPU(addr); - } + } public override void WritePPU(int addr, byte value) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs index 77ef96096d..69649784f3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs @@ -41,13 +41,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (!direct) { Buffer.BlockCopy(flash_rom, (bank << 2 | (addr >> 12) & 3) << 2, value, 0, 4); - if(value[0] < 0xFFFFFFFF) value[0]++; + if(value[0] < 0xFFFFFFFF) value[0]++; Buffer.BlockCopy(value, 0, flash_rom, (bank << 2 | (addr >> 12) & 3) << 2, 4); } else { Buffer.BlockCopy(flash_rom, addr << 2, value, 0, 4); - if (value[0] < 0xFFFFFFFF) value[0]++; + if (value[0] < 0xFFFFFFFF) value[0]++; Buffer.BlockCopy(value, 0, flash_rom, addr << 2, 4); } } @@ -196,24 +196,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (flash_mode == flashmode.fm_id) { - switch (addr & 0x1FF) - { - case 0: - return 0xBF; - case 1: - switch (Cart.prg_size) - { - case 128: - return 0xB5; - case 256: - return 0xB6; - case 512: - return 0xB7; - } - return 0xFF; //Shouldn't ever reach here, as the size was asserted earlier. - default: - return 0xFF; //Other unknown data is returned from addresses 2-511, in software ID mode, mostly 0xFF. - } + switch (addr & 0x1FF) + { + case 0: + return 0xBF; + case 1: + switch (Cart.prg_size) + { + case 128: + return 0xB5; + case 256: + return 0xB6; + case 512: + return 0xB7; + } + return 0xFF; //Shouldn't ever reach here, as the size was asserted earlier. + default: + return 0xFF; //Other unknown data is returned from addresses 2-511, in software ID mode, mostly 0xFF. + } } if (get_flash_write_count(addr) > 0) return flash_rom[Cart.prg_size + (bank << 14 | addr & 0x3fff)]; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs index 4b730da258..95d55040d2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs @@ -86,7 +86,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (prg_mode == false) { - return ROM[baseAddr + (( ((prg_page >> 1) & prg_mask_32k) << 15) + (addr & 0x7FFF))]; + return ROM[baseAddr + (( ((prg_page >> 1) & prg_mask_32k) << 15) + (addr & 0x7FFF))]; } else { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs index e54bf7171f..ac1ad692f0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs @@ -211,10 +211,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("VRAMBuffer", ref VRAMBuffer); ser.Sync("ppu_addr_temp", ref ppu_addr_temp); - ser.Sync("Read_Value", ref read_value); - ser.Sync("Prev_soam_index", ref soam_index_prev); - ser.Sync("Spr_Zero_Go", ref sprite_zero_go); - ser.Sync("Spr_zero_in_Range", ref sprite_zero_in_range); + ser.Sync("Read_Value", ref read_value); + ser.Sync("Prev_soam_index", ref soam_index_prev); + ser.Sync("Spr_Zero_Go", ref sprite_zero_go); + ser.Sync("Spr_zero_in_Range", ref sprite_zero_in_range); ser.Sync("Is_even_cycle", ref is_even_cycle); ser.Sync("soam_index", ref soam_index); ser.Sync("install_2006", ref install_2006); @@ -317,7 +317,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } ppur.status.cycle++; - is_even_cycle = !is_even_cycle; + is_even_cycle = !is_even_cycle; //might not actually run a cpu cycle if there are none to be run right now nes.RunCpuOne(); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs index bec89e93de..8b9a487054 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs @@ -438,44 +438,44 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES reg_2003++; } byte read_2004() - { + { byte ret; // behaviour depends on whether things are being rendered or not - if (PPUON) - { - if (ppur.status.sl < 241) - { + if (PPUON) + { + if (ppur.status.sl < 241) + { if (ppur.status.cycle <= 64) - { - ret = 0xFF; // during this time all reads return FF - } - else if (ppur.status.cycle <= 256) - { - ret = read_value; - } - else if (ppur.status.cycle <= 320) - { - ret = read_value; - } - else - { - ret = soam[0]; - } - } - else - { - ret = OAM[reg_2003]; - } - } - else - { - ret = OAM[reg_2003]; + { + ret = 0xFF; // during this time all reads return FF + } + else if (ppur.status.cycle <= 256) + { + ret = read_value; + } + else if (ppur.status.cycle <= 320) + { + ret = read_value; + } + else + { + ret = soam[0]; + } + } + else + { + ret = OAM[reg_2003]; + } + } + else + { + ret = OAM[reg_2003]; } ppu_open_bus = ret; ppu_open_bus_decay(1); return ret; - } + } byte peek_2004() { return OAM[reg_2003]; } //SCROLL (write) diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs index 03ec7dba05..6251ae7f4e 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs @@ -189,57 +189,57 @@ namespace BizHawk.Emulation.Cores.PCEngine int magnitude; static readonly int[] StepSize = - { - 0x0002, 0x0006, 0x000A, 0x000E, 0x0012, 0x0016, 0x001A, 0x001E, - 0x0002, 0x0006, 0x000A, 0x000E, 0x0013, 0x0017, 0x001B, 0x001F, - 0x0002, 0x0006, 0x000B, 0x000F, 0x0015, 0x0019, 0x001E, 0x0022, - 0x0002, 0x0007, 0x000C, 0x0011, 0x0017, 0x001C, 0x0021, 0x0026, - 0x0002, 0x0007, 0x000D, 0x0012, 0x0019, 0x001E, 0x0024, 0x0029, - 0x0003, 0x0009, 0x000F, 0x0015, 0x001C, 0x0022, 0x0028, 0x002E, - 0x0003, 0x000A, 0x0011, 0x0018, 0x001F, 0x0026, 0x002D, 0x0034, - 0x0003, 0x000A, 0x0012, 0x0019, 0x0022, 0x0029, 0x0031, 0x0038, - 0x0004, 0x000C, 0x0015, 0x001D, 0x0026, 0x002E, 0x0037, 0x003F, - 0x0004, 0x000D, 0x0016, 0x001F, 0x0029, 0x0032, 0x003B, 0x0044, - 0x0005, 0x000F, 0x0019, 0x0023, 0x002E, 0x0038, 0x0042, 0x004C, - 0x0005, 0x0010, 0x001B, 0x0026, 0x0032, 0x003D, 0x0048, 0x0053, - 0x0006, 0x0012, 0x001F, 0x002B, 0x0038, 0x0044, 0x0051, 0x005D, - 0x0006, 0x0013, 0x0021, 0x002E, 0x003D, 0x004A, 0x0058, 0x0065, - 0x0007, 0x0016, 0x0025, 0x0034, 0x0043, 0x0052, 0x0061, 0x0070, - 0x0008, 0x0018, 0x0029, 0x0039, 0x004A, 0x005A, 0x006B, 0x007B, - 0x0009, 0x001B, 0x002D, 0x003F, 0x0052, 0x0064, 0x0076, 0x0088, - 0x000A, 0x001E, 0x0032, 0x0046, 0x005A, 0x006E, 0x0082, 0x0096, - 0x000B, 0x0021, 0x0037, 0x004D, 0x0063, 0x0079, 0x008F, 0x00A5, - 0x000C, 0x0024, 0x003C, 0x0054, 0x006D, 0x0085, 0x009D, 0x00B5, - 0x000D, 0x0027, 0x0042, 0x005C, 0x0078, 0x0092, 0x00AD, 0x00C7, - 0x000E, 0x002B, 0x0049, 0x0066, 0x0084, 0x00A1, 0x00BF, 0x00DC, - 0x0010, 0x0030, 0x0051, 0x0071, 0x0092, 0x00B2, 0x00D3, 0x00F3, - 0x0011, 0x0034, 0x0058, 0x007B, 0x00A0, 0x00C3, 0x00E7, 0x010A, - 0x0013, 0x003A, 0x0061, 0x0088, 0x00B0, 0x00D7, 0x00FE, 0x0125, - 0x0015, 0x0040, 0x006B, 0x0096, 0x00C2, 0x00ED, 0x0118, 0x0143, - 0x0017, 0x0046, 0x0076, 0x00A5, 0x00D5, 0x0104, 0x0134, 0x0163, - 0x001A, 0x004E, 0x0082, 0x00B6, 0x00EB, 0x011F, 0x0153, 0x0187, - 0x001C, 0x0055, 0x008F, 0x00C8, 0x0102, 0x013B, 0x0175, 0x01AE, - 0x001F, 0x005E, 0x009D, 0x00DC, 0x011C, 0x015B, 0x019A, 0x01D9, - 0x0022, 0x0067, 0x00AD, 0x00F2, 0x0139, 0x017E, 0x01C4, 0x0209, - 0x0026, 0x0072, 0x00BF, 0x010B, 0x0159, 0x01A5, 0x01F2, 0x023E, - 0x002A, 0x007E, 0x00D2, 0x0126, 0x017B, 0x01CF, 0x0223, 0x0277, - 0x002E, 0x008A, 0x00E7, 0x0143, 0x01A1, 0x01FD, 0x025A, 0x02B6, - 0x0033, 0x0099, 0x00FF, 0x0165, 0x01CB, 0x0231, 0x0297, 0x02FD, - 0x0038, 0x00A8, 0x0118, 0x0188, 0x01F9, 0x0269, 0x02D9, 0x0349, - 0x003D, 0x00B8, 0x0134, 0x01AF, 0x022B, 0x02A6, 0x0322, 0x039D, - 0x0044, 0x00CC, 0x0154, 0x01DC, 0x0264, 0x02EC, 0x0374, 0x03FC, - 0x004A, 0x00DF, 0x0175, 0x020A, 0x02A0, 0x0335, 0x03CB, 0x0460, - 0x0052, 0x00F6, 0x019B, 0x023F, 0x02E4, 0x0388, 0x042D, 0x04D1, - 0x005A, 0x010F, 0x01C4, 0x0279, 0x032E, 0x03E3, 0x0498, 0x054D, - 0x0063, 0x012A, 0x01F1, 0x02B8, 0x037F, 0x0446, 0x050D, 0x05D4, - 0x006D, 0x0148, 0x0223, 0x02FE, 0x03D9, 0x04B4, 0x058F, 0x066A, - 0x0078, 0x0168, 0x0259, 0x0349, 0x043B, 0x052B, 0x061C, 0x070C, - 0x0084, 0x018D, 0x0296, 0x039F, 0x04A8, 0x05B1, 0x06BA, 0x07C3, - 0x0091, 0x01B4, 0x02D8, 0x03FB, 0x051F, 0x0642, 0x0766, 0x0889, - 0x00A0, 0x01E0, 0x0321, 0x0461, 0x05A2, 0x06E2, 0x0823, 0x0963, - 0x00B0, 0x0210, 0x0371, 0x04D1, 0x0633, 0x0793, 0x08F4, 0x0A54, - 0x00C2, 0x0246, 0x03CA, 0x054E, 0x06D2, 0x0856, 0x09DA, 0x0B5E - }; + { + 0x0002, 0x0006, 0x000A, 0x000E, 0x0012, 0x0016, 0x001A, 0x001E, + 0x0002, 0x0006, 0x000A, 0x000E, 0x0013, 0x0017, 0x001B, 0x001F, + 0x0002, 0x0006, 0x000B, 0x000F, 0x0015, 0x0019, 0x001E, 0x0022, + 0x0002, 0x0007, 0x000C, 0x0011, 0x0017, 0x001C, 0x0021, 0x0026, + 0x0002, 0x0007, 0x000D, 0x0012, 0x0019, 0x001E, 0x0024, 0x0029, + 0x0003, 0x0009, 0x000F, 0x0015, 0x001C, 0x0022, 0x0028, 0x002E, + 0x0003, 0x000A, 0x0011, 0x0018, 0x001F, 0x0026, 0x002D, 0x0034, + 0x0003, 0x000A, 0x0012, 0x0019, 0x0022, 0x0029, 0x0031, 0x0038, + 0x0004, 0x000C, 0x0015, 0x001D, 0x0026, 0x002E, 0x0037, 0x003F, + 0x0004, 0x000D, 0x0016, 0x001F, 0x0029, 0x0032, 0x003B, 0x0044, + 0x0005, 0x000F, 0x0019, 0x0023, 0x002E, 0x0038, 0x0042, 0x004C, + 0x0005, 0x0010, 0x001B, 0x0026, 0x0032, 0x003D, 0x0048, 0x0053, + 0x0006, 0x0012, 0x001F, 0x002B, 0x0038, 0x0044, 0x0051, 0x005D, + 0x0006, 0x0013, 0x0021, 0x002E, 0x003D, 0x004A, 0x0058, 0x0065, + 0x0007, 0x0016, 0x0025, 0x0034, 0x0043, 0x0052, 0x0061, 0x0070, + 0x0008, 0x0018, 0x0029, 0x0039, 0x004A, 0x005A, 0x006B, 0x007B, + 0x0009, 0x001B, 0x002D, 0x003F, 0x0052, 0x0064, 0x0076, 0x0088, + 0x000A, 0x001E, 0x0032, 0x0046, 0x005A, 0x006E, 0x0082, 0x0096, + 0x000B, 0x0021, 0x0037, 0x004D, 0x0063, 0x0079, 0x008F, 0x00A5, + 0x000C, 0x0024, 0x003C, 0x0054, 0x006D, 0x0085, 0x009D, 0x00B5, + 0x000D, 0x0027, 0x0042, 0x005C, 0x0078, 0x0092, 0x00AD, 0x00C7, + 0x000E, 0x002B, 0x0049, 0x0066, 0x0084, 0x00A1, 0x00BF, 0x00DC, + 0x0010, 0x0030, 0x0051, 0x0071, 0x0092, 0x00B2, 0x00D3, 0x00F3, + 0x0011, 0x0034, 0x0058, 0x007B, 0x00A0, 0x00C3, 0x00E7, 0x010A, + 0x0013, 0x003A, 0x0061, 0x0088, 0x00B0, 0x00D7, 0x00FE, 0x0125, + 0x0015, 0x0040, 0x006B, 0x0096, 0x00C2, 0x00ED, 0x0118, 0x0143, + 0x0017, 0x0046, 0x0076, 0x00A5, 0x00D5, 0x0104, 0x0134, 0x0163, + 0x001A, 0x004E, 0x0082, 0x00B6, 0x00EB, 0x011F, 0x0153, 0x0187, + 0x001C, 0x0055, 0x008F, 0x00C8, 0x0102, 0x013B, 0x0175, 0x01AE, + 0x001F, 0x005E, 0x009D, 0x00DC, 0x011C, 0x015B, 0x019A, 0x01D9, + 0x0022, 0x0067, 0x00AD, 0x00F2, 0x0139, 0x017E, 0x01C4, 0x0209, + 0x0026, 0x0072, 0x00BF, 0x010B, 0x0159, 0x01A5, 0x01F2, 0x023E, + 0x002A, 0x007E, 0x00D2, 0x0126, 0x017B, 0x01CF, 0x0223, 0x0277, + 0x002E, 0x008A, 0x00E7, 0x0143, 0x01A1, 0x01FD, 0x025A, 0x02B6, + 0x0033, 0x0099, 0x00FF, 0x0165, 0x01CB, 0x0231, 0x0297, 0x02FD, + 0x0038, 0x00A8, 0x0118, 0x0188, 0x01F9, 0x0269, 0x02D9, 0x0349, + 0x003D, 0x00B8, 0x0134, 0x01AF, 0x022B, 0x02A6, 0x0322, 0x039D, + 0x0044, 0x00CC, 0x0154, 0x01DC, 0x0264, 0x02EC, 0x0374, 0x03FC, + 0x004A, 0x00DF, 0x0175, 0x020A, 0x02A0, 0x0335, 0x03CB, 0x0460, + 0x0052, 0x00F6, 0x019B, 0x023F, 0x02E4, 0x0388, 0x042D, 0x04D1, + 0x005A, 0x010F, 0x01C4, 0x0279, 0x032E, 0x03E3, 0x0498, 0x054D, + 0x0063, 0x012A, 0x01F1, 0x02B8, 0x037F, 0x0446, 0x050D, 0x05D4, + 0x006D, 0x0148, 0x0223, 0x02FE, 0x03D9, 0x04B4, 0x058F, 0x066A, + 0x0078, 0x0168, 0x0259, 0x0349, 0x043B, 0x052B, 0x061C, 0x070C, + 0x0084, 0x018D, 0x0296, 0x039F, 0x04A8, 0x05B1, 0x06BA, 0x07C3, + 0x0091, 0x01B4, 0x02D8, 0x03FB, 0x051F, 0x0642, 0x0766, 0x0889, + 0x00A0, 0x01E0, 0x0321, 0x0461, 0x05A2, 0x06E2, 0x0823, 0x0963, + 0x00B0, 0x0210, 0x0371, 0x04D1, 0x0633, 0x0793, 0x08F4, 0x0A54, + 0x00C2, 0x0246, 0x03CA, 0x054E, 0x06D2, 0x0856, 0x09DA, 0x0B5E + }; static readonly int[] StepFactor = { -1, -1, -1, -1, 2, 4, 6, 8 }; diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.cs index 341bb0e6be..09b70c64a3 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.cs @@ -124,7 +124,7 @@ namespace BizHawk.Emulation.Cores.PCEngine if (RegisterLatch == BYR) BackgroundY = Registers[BYR] & 0x1FF; - RegisterCommit(RegisterLatch, msbComplete: false); + RegisterCommit(RegisterLatch, msbComplete: false); } else if (port == MSB) { @@ -139,11 +139,11 @@ namespace BizHawk.Emulation.Cores.PCEngine switch (register) { case MARR: // Memory Address Read Register - if (!msbComplete) break; + if (!msbComplete) break; ReadBuffer = VRAM[Registers[MARR] & 0x7FFF]; break; case VWR: // VRAM Write Register - if (!msbComplete) break; + if (!msbComplete) break; if (Registers[MAWR] < VramSize) // Several games attempt to write past the end of VRAM { VRAM[Registers[MAWR]] = Registers[VWR]; @@ -176,11 +176,11 @@ namespace BizHawk.Emulation.Cores.PCEngine FrameBuffer = new int[FramePitch * FrameHeight]; break; case LENR: // Initiate DMA transfer - if (!msbComplete) break; + if (!msbComplete) break; DmaRequested = true; break; case SATB: - if (!msbComplete) break; + if (!msbComplete) break; SatDmaRequested = true; break; } diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Native68000/Musashi.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Native68000/Musashi.cs index d661d3cc15..6493555494 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Native68000/Musashi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Native68000/Musashi.cs @@ -4,89 +4,89 @@ using System.IO; namespace Native68000 { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - delegate int VdpCallback(int i); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - delegate uint ReadCallback(uint a); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - delegate void WriteCallback(uint a, uint v); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + delegate int VdpCallback(int i); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + delegate uint ReadCallback(uint a); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + delegate void WriteCallback(uint a, uint v); - public class Musashi - { - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterVdpCallback(IntPtr callback); + public class Musashi + { + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterVdpCallback(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterRead8(IntPtr callback); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterRead8(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterRead16(IntPtr callback); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterRead16(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterRead32(IntPtr callback); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterRead32(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterWrite8(IntPtr callback); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterWrite8(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterWrite16(IntPtr callback); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterWrite16(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void RegisterWrite32(IntPtr callback); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void RegisterWrite32(IntPtr callback); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void Init(); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void Init(); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void Reset(); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void Reset(); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void SetIRQ(int level); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetIRQ(int level); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int Execute(int cycles); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern int Execute(int cycles); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int QueryCpuState(int regcode); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern int QueryCpuState(int regcode); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void SetCpuState(int regcode, int value); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetCpuState(int regcode, int value); - [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetCyclesRemaining(); + [DllImport("MusashiDLL.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern int GetCyclesRemaining(); - public static int D0 { get { return QueryCpuState(0); } } - public static int D1 { get { return QueryCpuState(1); } } - public static int D2 { get { return QueryCpuState(2); } } - public static int D3 { get { return QueryCpuState(3); } } - public static int D4 { get { return QueryCpuState(4); } } - public static int D5 { get { return QueryCpuState(5); } } - public static int D6 { get { return QueryCpuState(6); } } - public static int D7 { get { return QueryCpuState(7); } } + public static int D0 { get { return QueryCpuState(0); } } + public static int D1 { get { return QueryCpuState(1); } } + public static int D2 { get { return QueryCpuState(2); } } + public static int D3 { get { return QueryCpuState(3); } } + public static int D4 { get { return QueryCpuState(4); } } + public static int D5 { get { return QueryCpuState(5); } } + public static int D6 { get { return QueryCpuState(6); } } + public static int D7 { get { return QueryCpuState(7); } } - public static int A0 { get { return QueryCpuState(8); } } - public static int A1 { get { return QueryCpuState(9); } } - public static int A2 { get { return QueryCpuState(10); } } - public static int A3 { get { return QueryCpuState(11); } } - public static int A4 { get { return QueryCpuState(12); } } - public static int A5 { get { return QueryCpuState(13); } } - public static int A6 { get { return QueryCpuState(14); } } - public static int A7 { get { return QueryCpuState(15); } } + public static int A0 { get { return QueryCpuState(8); } } + public static int A1 { get { return QueryCpuState(9); } } + public static int A2 { get { return QueryCpuState(10); } } + public static int A3 { get { return QueryCpuState(11); } } + public static int A4 { get { return QueryCpuState(12); } } + public static int A5 { get { return QueryCpuState(13); } } + public static int A6 { get { return QueryCpuState(14); } } + public static int A7 { get { return QueryCpuState(15); } } - public static int PC { get { return QueryCpuState(16); } } - public static int SR { get { return QueryCpuState(17); } } - public static int SP { get { return QueryCpuState(18); } } + public static int PC { get { return QueryCpuState(16); } } + public static int SR { get { return QueryCpuState(17); } } + public static int SP { get { return QueryCpuState(18); } } - public static void SaveStateBinary(BinaryWriter writer) - { - for (int i=0; i<31; i++) - writer.Write(QueryCpuState(i)); - } + public static void SaveStateBinary(BinaryWriter writer) + { + for (int i=0; i<31; i++) + writer.Write(QueryCpuState(i)); + } - public static void LoadStateBinary(BinaryReader reader) - { - for (int i = 0; i < 31; i++) - SetCpuState(i, reader.ReadInt32()); - } - } + public static void LoadStateBinary(BinaryReader reader) + { + for (int i = 0; i < 31; i++) + SetCpuState(i, reader.ReadInt32()); + } + } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs index 39196adc99..7ae2c963aa 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx )] public partial class GPGX : IEmulator, IVideoProvider, ISaveRam, IStatable, IRegionable, IInputPollable, IDebuggable, IDriveLight, ICodeDataLogger, IDisassemblable - { + { static GPGX AttachedCore = null; DiscSystem.Disc CD; diff --git a/BizHawk.Emulation.Cores/ExternalCores/PsxCore.cs b/BizHawk.Emulation.Cores/ExternalCores/PsxCore.cs index c97dc960c7..10ffc26519 100644 --- a/BizHawk.Emulation.Cores/ExternalCores/PsxCore.cs +++ b/BizHawk.Emulation.Cores/ExternalCores/PsxCore.cs @@ -92,7 +92,7 @@ namespace BizHawk public byte[] SaveStateBinary() { return new byte[1]; } public void GetSamples(short[] samples) { } public void DiscardSamples() { } - public int MaxVolume { get; set; } + public int MaxVolume { get; set; } private IList memoryDomains; public IList MemoryDomains { get { return memoryDomains; } } public MemoryDomain MainMemory { get { return memoryDomains[0]; } } diff --git a/BizHawk.Emulation.Cores/Sound/YM2413.cs b/BizHawk.Emulation.Cores/Sound/YM2413.cs index c902e88a4e..f0d961f8f7 100644 --- a/BizHawk.Emulation.Cores/Sound/YM2413.cs +++ b/BizHawk.Emulation.Cores/Sound/YM2413.cs @@ -92,50 +92,50 @@ namespace BizHawk.Emulation.Common.Components const int OPLL_TONE_NUM = 3; static byte[][] default_inst = new byte[3][] { - new byte[] { - 0x49,0x4c,0x4c,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x61,0x61,0x1E,0x17,0xF0,0x7F,0x00,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x13,0x41,0x17,0x0E,0xFF,0xFF,0x23,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x23,0x01,0x9A,0x04,0xA3,0xf4,0xF0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x11,0x61,0x0e,0x07,0xfa,0x64,0x70,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x22,0x21,0x1e,0x06,0xf0,0x76,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x22,0x16,0x05,0xf0,0x71,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x61,0x1d,0x07,0x82,0x80,0x10,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x23,0x21,0x2d,0x16,0x90,0x90,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x21,0x1b,0x06,0x64,0x65,0x10,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x21,0x0b,0x1a,0x85,0xa0,0x70,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x23,0x01,0x83,0x10,0xff,0xb0,0x10,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x97,0xc1,0x20,0x07,0xff,0xff,0x22,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x61,0x00,0x0c,0x05,0xd2,0xf6,0x40,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x01,0x56,0x03,0xf4,0xf0,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x41,0x89,0x03,0xf1,0xf4,0xf0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }, + new byte[] { + 0x49,0x4c,0x4c,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x61,0x61,0x1E,0x17,0xF0,0x7F,0x00,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x13,0x41,0x17,0x0E,0xFF,0xFF,0x23,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x23,0x01,0x9A,0x04,0xA3,0xf4,0xF0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x11,0x61,0x0e,0x07,0xfa,0x64,0x70,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x22,0x21,0x1e,0x06,0xf0,0x76,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x22,0x16,0x05,0xf0,0x71,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x61,0x1d,0x07,0x82,0x80,0x10,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x23,0x21,0x2d,0x16,0x90,0x90,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x21,0x1b,0x06,0x64,0x65,0x10,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x21,0x0b,0x1a,0x85,0xa0,0x70,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x23,0x01,0x83,0x10,0xff,0xb0,0x10,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x97,0xc1,0x20,0x07,0xff,0xff,0x22,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x61,0x00,0x0c,0x05,0xd2,0xf6,0x40,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x01,0x56,0x03,0xf4,0xf0,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x41,0x89,0x03,0xf1,0xf4,0xf0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + }, /* - new byte[] { - // VRC7 TONES by okazaki@angel.ne.jp - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x33,0x01,0x09,0x0e,0x94,0x90,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x13,0x41,0x0f,0x0d,0xce,0xd3,0x43,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x12,0x1b,0x06,0xff,0xd2,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x61,0x61,0x1b,0x07,0xaf,0x63,0x20,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x22,0x21,0x1e,0x06,0xf0,0x76,0x08,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x66,0x21,0x15,0x00,0x93,0x94,0x20,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x61,0x1c,0x07,0x82,0x81,0x10,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x23,0x21,0x20,0x1f,0xc0,0x71,0x07,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x25,0x31,0x26,0x05,0x64,0x41,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x17,0x21,0x28,0x07,0xff,0x83,0x02,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x97,0x81,0x25,0x07,0xcf,0xc8,0x02,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x21,0x54,0x0f,0x80,0x7f,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x01,0x56,0x03,0xd3,0xb2,0x43,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x31,0x21,0x0c,0x03,0x82,0xc0,0x40,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x01,0x0c,0x03,0xd4,0xd3,0x40,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - }, + new byte[] { + // VRC7 TONES by okazaki@angel.ne.jp + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x33,0x01,0x09,0x0e,0x94,0x90,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x13,0x41,0x0f,0x0d,0xce,0xd3,0x43,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x12,0x1b,0x06,0xff,0xd2,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x61,0x61,0x1b,0x07,0xaf,0x63,0x20,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x22,0x21,0x1e,0x06,0xf0,0x76,0x08,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x66,0x21,0x15,0x00,0x93,0x94,0x20,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x61,0x1c,0x07,0x82,0x81,0x10,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x23,0x21,0x20,0x1f,0xc0,0x71,0x07,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x25,0x31,0x26,0x05,0x64,0x41,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x17,0x21,0x28,0x07,0xff,0x83,0x02,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x97,0x81,0x25,0x07,0xcf,0xc8,0x02,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x21,0x54,0x0f,0x80,0x7f,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x01,0x56,0x03,0xd3,0xb2,0x43,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x31,0x21,0x0c,0x03,0x82,0xc0,0x40,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x01,0x0c,0x03,0xd4,0xd3,0x40,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + }, */ new byte[] { @@ -160,29 +160,29 @@ namespace BizHawk.Emulation.Common.Components 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - new byte[] { - // YMF281B tone by Chabin - 0x49,0x4c,0x4c,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x62,0x21,0x1a,0x07,0xf0,0x6f,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x10,0x44,0x02,0xf6,0xf4,0x54,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x03,0x01,0x97,0x04,0xf3,0xf3,0x13,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x61,0x0a,0x0f,0xfa,0x64,0x70,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x22,0x21,0x1e,0x06,0xf0,0x76,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x61,0x8a,0x0e,0xc0,0x61,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x61,0x1b,0x07,0x84,0x80,0x17,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x37,0x32,0xc9,0x01,0x66,0x64,0x40,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x21,0x06,0x03,0xa5,0x71,0x51,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x06,0x11,0x5e,0x07,0xf3,0xf2,0xf6,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x20,0x18,0x06,0xf5,0xf3,0x20,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x97,0x41,0x20,0x07,0xff,0xf4,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x65,0x61,0x15,0x00,0xf7,0xf3,0x16,0xf4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x31,0x0e,0x07,0xfa,0xf3,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x48,0x61,0x09,0x07,0xf1,0x94,0xf0,0xf5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - } - }; + new byte[] { + // YMF281B tone by Chabin + 0x49,0x4c,0x4c,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x62,0x21,0x1a,0x07,0xf0,0x6f,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x10,0x44,0x02,0xf6,0xf4,0x54,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x03,0x01,0x97,0x04,0xf3,0xf3,0x13,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x61,0x0a,0x0f,0xfa,0x64,0x70,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x22,0x21,0x1e,0x06,0xf0,0x76,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x61,0x8a,0x0e,0xc0,0x61,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x21,0x61,0x1b,0x07,0x84,0x80,0x17,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x37,0x32,0xc9,0x01,0x66,0x64,0x40,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x21,0x06,0x03,0xa5,0x71,0x51,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x06,0x11,0x5e,0x07,0xf3,0xf2,0xf6,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x20,0x18,0x06,0xf5,0xf3,0x20,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x97,0x41,0x20,0x07,0xff,0xf4,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x65,0x61,0x15,0x00,0xf7,0xf3,0x16,0xf4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x31,0x0e,0x07,0xfa,0xf3,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x48,0x61,0x09,0x07,0xf1,0x94,0xf0,0xf5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + } + }; /* Size of Sintable ( 8 -- 18 can be used. 9 recommended.) */ const int PG_BITS = 9; @@ -427,9 +427,9 @@ namespace BizHawk.Emulation.Common.Components static void makeTllTable() { double[] kltable = new double[] { - dB2 (0.000), dB2 (9.000), dB2 (12.000), dB2 (13.875), dB2 (15.000), dB2 (16.125), dB2 (16.875), dB2 (17.625), - dB2 (18.000), dB2 (18.750), dB2 (19.125), dB2 (19.500), dB2 (19.875), dB2 (20.250), dB2 (20.625), dB2 (21.000) - }; + dB2 (0.000), dB2 (9.000), dB2 (12.000), dB2 (13.875), dB2 (15.000), dB2 (16.125), dB2 (16.875), dB2 (17.625), + dB2 (18.000), dB2 (18.750), dB2 (19.125), dB2 (19.500), dB2 (19.875), dB2 (20.250), dB2 (20.625), dB2 (21.000) + }; int tmp; int fnum, block, TL, KL; @@ -1114,9 +1114,9 @@ namespace BizHawk.Emulation.Common.Components /* EG */ static uint S2E(double x) { return (SL2EG((uint)(x / SL_STEP)) << (EG_DP_BITS - EG_BITS)); } static uint[] SL = new[] { - S2E (0.0), S2E (3.0), S2E (6.0), S2E (9.0), S2E (12.0), S2E (15.0), S2E (18.0), S2E (21.0), - S2E (24.0), S2E (27.0), S2E (30.0), S2E (33.0), S2E (36.0), S2E (39.0), S2E (42.0), S2E (48.0) - }; + S2E (0.0), S2E (3.0), S2E (6.0), S2E (9.0), S2E (12.0), S2E (15.0), S2E (18.0), S2E (21.0), + S2E (24.0), S2E (27.0), S2E (30.0), S2E (33.0), S2E (36.0), S2E (39.0), S2E (42.0), S2E (48.0) + }; static void calc_envelope(OPLL_SLOT slot, int lfo) { diff --git a/CpuCoreGenerator/HuC6280/CDL.cs b/CpuCoreGenerator/HuC6280/CDL.cs index 2a0f635264..47356ddd04 100644 --- a/CpuCoreGenerator/HuC6280/CDL.cs +++ b/CpuCoreGenerator/HuC6280/CDL.cs @@ -54,7 +54,7 @@ namespace HuC6280 return; } - w.WriteLine("\t\t\t\tcase 0x{0:X2}: // {1}", opcode, op); + w.WriteLine("\t\t\t\tcase 0x{0:X2}: // {1}", opcode, op); w.WriteLine("\t\t\t\t\tMarkCode(PC, {0});", op.Size);