diff --git a/src/BizHawk.Bizware.Audio/SDL2WavStream.cs b/src/BizHawk.Bizware.Audio/SDL2WavStream.cs index 1251a451c7..737998d0ee 100644 --- a/src/BizHawk.Bizware.Audio/SDL2WavStream.cs +++ b/src/BizHawk.Bizware.Audio/SDL2WavStream.cs @@ -38,7 +38,7 @@ namespace BizHawk.Bizware.Audio AudioFormat.S32LSB or AudioFormat.F32LSB => 32, _ => throw new InvalidOperationException(), }; - + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr SDL_LoadWAV_RW( IntPtr src, diff --git a/src/BizHawk.Bizware.Graphics.Controls/Controls/RetainedGraphicsControl.cs b/src/BizHawk.Bizware.Graphics.Controls/Controls/RetainedGraphicsControl.cs index 14515add78..a4e5360ae3 100644 --- a/src/BizHawk.Bizware.Graphics.Controls/Controls/RetainedGraphicsControl.cs +++ b/src/BizHawk.Bizware.Graphics.Controls/Controls/RetainedGraphicsControl.cs @@ -100,7 +100,7 @@ namespace BizHawk.Bizware.Graphics.Controls _graphicsControl.SwapBuffers(); return; } - + // if we're retaining, then we cant draw until we unbind! its semantically a bit odd, but we expect users to call SwapBuffers() before end, so we cant unbind in End() even thoug hit makes a bit more sense. _gl.BindDefaultRenderTarget(); Draw(); diff --git a/src/BizHawk.Bizware.Graphics/BitmapBuffer.cs b/src/BizHawk.Bizware.Graphics/BitmapBuffer.cs index f5dc16c4f1..df8a1fcdaf 100644 --- a/src/BizHawk.Bizware.Graphics/BitmapBuffer.cs +++ b/src/BizHawk.Bizware.Graphics/BitmapBuffer.cs @@ -145,7 +145,7 @@ namespace BizHawk.Bizware.Graphics } UnlockBits(bmpdata); - + Pixels = newPixels; } @@ -266,7 +266,7 @@ namespace BizHawk.Bizware.Graphics Width = widthRound; Height = heightRound; } - + /// /// Creates a BitmapBuffer image from the specified filename /// @@ -376,7 +376,7 @@ namespace BizHawk.Bizware.Graphics if (srcPixel != 0) { var color = palette[srcPixel].ToArgb(); - + // make transparent pixels turn into black to avoid filtering issues and other annoying issues with stray junk in transparent pixels. // (yes, we can have palette entries with transparency in them (PNGs support this, annoyingly)) if (cleanup) diff --git a/src/BizHawk.Bizware.Graphics/OpenGL/SDL2OpenGLContext.cs b/src/BizHawk.Bizware.Graphics/OpenGL/SDL2OpenGLContext.cs index 2e195f31c0..677fa93244 100644 --- a/src/BizHawk.Bizware.Graphics/OpenGL/SDL2OpenGLContext.cs +++ b/src/BizHawk.Bizware.Graphics/OpenGL/SDL2OpenGLContext.cs @@ -128,7 +128,7 @@ namespace BizHawk.Bizware.Graphics { throw new($"Could not set GL Major Version! SDL Error: {SDL_GetError()}"); } - + if (SDL_GL_SetAttribute(SDL_GLattr.SDL_GL_CONTEXT_MINOR_VERSION, minorVersion) != 0) { throw new($"Could not set GL Minor Version! SDL Error: {SDL_GetError()}"); diff --git a/src/BizHawk.Bizware.Graphics/Renderers/SDLImGui2DRenderer.cs b/src/BizHawk.Bizware.Graphics/Renderers/SDLImGui2DRenderer.cs index b937913757..383c4db278 100644 --- a/src/BizHawk.Bizware.Graphics/Renderers/SDLImGui2DRenderer.cs +++ b/src/BizHawk.Bizware.Graphics/Renderers/SDLImGui2DRenderer.cs @@ -164,7 +164,7 @@ namespace BizHawk.Bizware.Graphics { RenderCommand(sdlRenderer, IntPtr.Zero, _imGuiDrawList, cmd); } - + break; } case DrawCallbackId.DisableBlending: diff --git a/src/BizHawk.Bizware.Graphics/Renderers/StringRenderer.cs b/src/BizHawk.Bizware.Graphics/Renderers/StringRenderer.cs index 189c1229b0..9b50848274 100644 --- a/src/BizHawk.Bizware.Graphics/Renderers/StringRenderer.cs +++ b/src/BizHawk.Bizware.Graphics/Renderers/StringRenderer.cs @@ -16,7 +16,7 @@ namespace BizHawk.Bizware.Graphics Owner = owner; FontInfo = new(); FontInfo.LoadBinary(fontInfo); - + // load textures for (var i = 0; i < FontInfo.Pages.Length; i++) { diff --git a/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs b/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs index 6fceb3b8ac..f73543feff 100644 --- a/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs +++ b/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs @@ -22,7 +22,7 @@ namespace BizHawk.Bizware.Input /// Contains name and delegate function for all buttons, hats and axis public readonly IReadOnlyCollection<(string ButtonName, Func GetIsPressed)> ButtonGetters; - + /// For use in keybind boxes public string InputNamePrefix { get; private set; } diff --git a/src/BizHawk.Bizware.Input/SDL2/SDL2InputAdapter.cs b/src/BizHawk.Bizware.Input/SDL2/SDL2InputAdapter.cs index 343fd6d3fc..796244cd04 100644 --- a/src/BizHawk.Bizware.Input/SDL2/SDL2InputAdapter.cs +++ b/src/BizHawk.Bizware.Input/SDL2/SDL2InputAdapter.cs @@ -174,7 +174,7 @@ namespace BizHawk.Bizware.Input const float SCALE_FACTOR = (float) (WIDTH / (double) int.MaxValue); Console.WriteLine($"rumble: [{PACKED_BAR_GRAPHICS.Substring(startIndex: (leftStrength * SCALE_FACTOR).RoundToInt(), length: WIDTH)}] L / R [{PACKED_BAR_GRAPHICS.Substring(startIndex: 2 * WIDTH - (rightStrength * SCALE_FACTOR).RoundToInt(), length: WIDTH)}]"); #endif - pad.SetVibration(leftStrength, rightStrength); + pad.SetVibration(leftStrength, rightStrength); } } } diff --git a/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs b/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs index 9cc6a2246c..d874aa8755 100644 --- a/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs @@ -58,16 +58,16 @@ namespace BizHawk.Client.Common #pragma warning disable MA0091 // passing through `sender` is intentional private void CallBeforeQuickLoad(object sender, BeforeQuickLoadEventArgs args) => BeforeQuickLoad?.Invoke(sender, args); - + private void CallBeforeQuickSave(object sender, BeforeQuickSaveEventArgs args) => BeforeQuickSave?.Invoke(sender, args); - + private void CallRomLoaded(object sender, EventArgs args) => RomLoaded?.Invoke(sender, args); - + private void CallStateLoaded(object sender, StateLoadedEventArgs args) => StateLoaded?.Invoke(sender, args); - + private void CallStateSaved(object sender, StateSavedEventArgs args) => StateSaved?.Invoke(sender, args); #pragma warning restore MA0091 diff --git a/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs b/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs index ea6f47bbf7..d508d926da 100644 --- a/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs @@ -68,7 +68,7 @@ namespace BizHawk.Client.Common var buttonToSet = controller == null ? button : $"P{controller} {button}"; if (state == null) _inputManager.ButtonOverrideAdapter.UnSet(buttonToSet); else _inputManager.ButtonOverrideAdapter.SetButton(buttonToSet, state.Value); - + //"Overrides" is a gross line of code in that flushes overrides into the current controller. //That's not really the way it was meant to work which was that it should pull all its values through the filters before ever using them. //Of course the code that does that is in the main loop and the lua API wouldnt know how to do it. diff --git a/src/BizHawk.Client.Common/Controller.cs b/src/BizHawk.Client.Common/Controller.cs index eba8729950..0b7603ac94 100644 --- a/src/BizHawk.Client.Common/Controller.cs +++ b/src/BizHawk.Client.Common/Controller.cs @@ -72,7 +72,7 @@ namespace BizHawk.Client.Common public void LatchFromPhysical(IController finalHostController) { _buttons.Clear(); - + foreach (var (k, v) in _bindings) { _buttons[k] = false; diff --git a/src/BizHawk.Client.Common/OpenAdvanced.cs b/src/BizHawk.Client.Common/OpenAdvanced.cs index e76ec09671..490422d9d2 100644 --- a/src/BizHawk.Client.Common/OpenAdvanced.cs +++ b/src/BizHawk.Client.Common/OpenAdvanced.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.Common /// returns a sole path to use for opening a rom (not sure if this is a good idea) /// string SimplePath { get; } - + void Deserialize(string str); void Serialize(TextWriter tw); } @@ -96,7 +96,7 @@ namespace BizHawk.Client.Common { token = JsonConvert.DeserializeObject(str); } - + public void Serialize(TextWriter tw) { tw.Write(JsonConvert.SerializeObject(token)); diff --git a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs index 68cea796cb..859a530a84 100644 --- a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs @@ -138,7 +138,7 @@ namespace BizHawk.Client.Common.cheats { return SnesActionReplayDecoder.Decode(code); } - + return new InvalidCheatCode($"Unknown code type: {code}"); } } diff --git a/src/BizHawk.Client.Common/cheats/N64GameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/N64GameSharkDecoder.cs index 411ff6d971..224d77daec 100644 --- a/src/BizHawk.Client.Common/cheats/N64GameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/N64GameSharkDecoder.cs @@ -12,7 +12,7 @@ namespace BizHawk.Client.Common.cheats { throw new ArgumentNullException(nameof(code)); } - + if (code.IndexOf(" ", StringComparison.Ordinal) != 8) { return new InvalidCheatCode("GameShark Codes need to contain a space after the eighth character."); diff --git a/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs index 19c00f73ee..2da8269f0e 100644 --- a/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/SaturnGameSharkDecoder.cs @@ -36,7 +36,7 @@ namespace BizHawk.Client.Common.cheats { result.Size = WatchSize.Byte; } - + var s = code.Remove(0, 2); result.Address = int.Parse(s.Remove(6, 5), NumberStyles.HexNumber); result.Value = int.Parse(s.Remove(0, 7)); diff --git a/src/BizHawk.Client.Common/config/ConfigService.cs b/src/BizHawk.Client.Common/config/ConfigService.cs index 2b341b2b3e..70286ddedb 100644 --- a/src/BizHawk.Client.Common/config/ConfigService.cs +++ b/src/BizHawk.Client.Common/config/ConfigService.cs @@ -25,7 +25,7 @@ namespace BizHawk.Client.Common // because of the peculiar setup of Binding.cs and PathEntry.cs ObjectCreationHandling = ObjectCreationHandling.Replace, - + ContractResolver = new DefaultContractResolver { DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic, diff --git a/src/BizHawk.Client.Common/inputAdapters/InputManager.cs b/src/BizHawk.Client.Common/inputAdapters/InputManager.cs index afc8474a5d..a8466a232b 100644 --- a/src/BizHawk.Client.Common/inputAdapters/InputManager.cs +++ b/src/BizHawk.Client.Common/inputAdapters/InputManager.cs @@ -5,7 +5,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Client.Common { - + // don't take my word for it, but here is a guide... // user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> .. // .. -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs index e72d150447..c525292d55 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/ClientLuaLibrary.cs @@ -416,10 +416,10 @@ namespace BizHawk.Client.Common Log($"cheat codes not supported by the current system: {MainForm.Emulator.SystemId}"); return; } - + var decoder = new GameSharkDecoder(MainForm.Emulator.AsMemoryDomains(), MainForm.Emulator.SystemId); var result = decoder.Decode(code); - + if (result.IsValid(out var valid)) { var domain = decoder.CheatDomain(); diff --git a/src/BizHawk.Client.Common/lua/LuaDocumentation.cs b/src/BizHawk.Client.Common/lua/LuaDocumentation.cs index bbdb43b33d..21d489e81e 100644 --- a/src/BizHawk.Client.Common/lua/LuaDocumentation.cs +++ b/src/BizHawk.Client.Common/lua/LuaDocumentation.cs @@ -11,7 +11,7 @@ namespace BizHawk.Client.Common public string ToTASVideosWikiMarkup() { var sb = new StringBuilder(); - + sb.AppendLine("__This is an autogenerated page, do not edit.__ (To update, open the function list dialog on a Debug build and click the wiki button.)") .AppendLine() .AppendLine("This page documents the the behavior and parameters of Lua functions available for the [BizHawk] emulator. The function list is also available from within EmuHawk. From the Lua Console, click Help > Lua Functions List or press F1.") diff --git a/src/BizHawk.Client.Common/lua/LuaHelperLibs/GenesisLuaLibrary.cs b/src/BizHawk.Client.Common/lua/LuaHelperLibs/GenesisLuaLibrary.cs index 830000d97d..9d75a47dfe 100644 --- a/src/BizHawk.Client.Common/lua/LuaHelperLibs/GenesisLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/LuaHelperLibs/GenesisLuaLibrary.cs @@ -23,7 +23,7 @@ namespace BizHawk.Client.Common get => APIs.Emulation.GetSettings() as GPGX.GPGXSettings ?? new GPGX.GPGXSettings(); set => APIs.Emulation.PutSettings(value); } - + [LuaMethodExample("if ( genesis.getlayer_bga( ) ) then\r\n\tconsole.log( \"Returns whether the bg layer A is displayed\" );\r\nend;")] [LuaMethod("getlayer_bga", "Returns whether the bg layer A is displayed")] public bool GetLayerBgA() diff --git a/src/BizHawk.Client.Common/lua/LuaSandbox.cs b/src/BizHawk.Client.Common/lua/LuaSandbox.cs index 666b8911c3..2d909ad20b 100644 --- a/src/BizHawk.Client.Common/lua/LuaSandbox.cs +++ b/src/BizHawk.Client.Common/lua/LuaSandbox.cs @@ -100,7 +100,7 @@ namespace BizHawk.Client.Common { return sandbox; } - + // for now: throw exception (I want to manually creating them) // return CreateSandbox(thread); throw new InvalidOperationException("HOARY GORILLA HIJINX"); diff --git a/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs b/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs index b2c9c241e9..ef887a5961 100644 --- a/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs +++ b/src/BizHawk.Client.Common/movie/PlatformFrameRates.cs @@ -95,7 +95,7 @@ namespace BizHawk.Client.Common ["ChannelF"] = 234375.0 / 3872.0, // (NTSCCarrier * 8 / 7) / (256 * 264) // note: ChannelF II PAL timings might be slightly different... - ["ChannelF_PAL"] = 15625.0 / 312.0, // 4000000 / (256 * 312) + ["ChannelF_PAL"] = 15625.0 / 312.0, // 4000000 / (256 * 312) }; public static double GetFrameRate(string systemId, bool pal) diff --git a/src/BizHawk.Client.Common/movie/SubtitleList.cs b/src/BizHawk.Client.Common/movie/SubtitleList.cs index 9baf291c04..c20c5e305b 100644 --- a/src/BizHawk.Client.Common/movie/SubtitleList.cs +++ b/src/BizHawk.Client.Common/movie/SubtitleList.cs @@ -60,7 +60,7 @@ namespace BizHawk.Client.Common return false; } } - + return false; } diff --git a/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs b/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs index c2c3649012..f84e17b7be 100644 --- a/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs +++ b/src/BizHawk.Client.Common/movie/bk2/StringLogs.cs @@ -211,7 +211,7 @@ namespace BizHawk.Client.Common } void IEnumerator.Reset() { _index = -1; } - + public void Dispose() { } } diff --git a/src/BizHawk.Client.Common/movie/import/GmvImport.cs b/src/BizHawk.Client.Common/movie/import/GmvImport.cs index c6b07582c8..a09fa90612 100644 --- a/src/BizHawk.Client.Common/movie/import/GmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/GmvImport.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.Common.movie.import { using var fs = SourceFile.Open(FileMode.Open, FileAccess.Read); using var r = new BinaryReader(fs, Encoding.ASCII); - + // 000 16-byte signature and format version: "Gens Movie TEST9" byte[] signature = r.ReadBytes(15); if (!signature.SequenceEqual("Gens Movie TEST"u8)) @@ -37,7 +37,7 @@ namespace BizHawk.Client.Common.movie.import uint rerecordCount = r.ReadUInt32(); Result.Movie.Rerecords = rerecordCount; - + // 014 ASCII-encoded controller config for player 1. '3' or '6'. char player1Config = r.ReadChar(); diff --git a/src/BizHawk.Client.Common/movie/import/HereticLmpImport.cs b/src/BizHawk.Client.Common/movie/import/HereticLmpImport.cs index 7c70e4e564..fc8cd23c5f 100644 --- a/src/BizHawk.Client.Common/movie/import/HereticLmpImport.cs +++ b/src/BizHawk.Client.Common/movie/import/HereticLmpImport.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common // In better detail, from archive.org: http://web.archive.org/web/20070630072856/http://demospecs.planetquake.gamespy.com/lmp/lmp.html [ImporterFor("Heretic", ".hereticlmp")] internal class HereticLmpImport : MovieImporter - { + { protected override void RunImport() { var input = SourceFile.OpenRead().ReadAllBytes(); diff --git a/src/BizHawk.Client.Common/movie/import/HexenLmpImport.cs b/src/BizHawk.Client.Common/movie/import/HexenLmpImport.cs index 55ba32de29..98a3013708 100644 --- a/src/BizHawk.Client.Common/movie/import/HexenLmpImport.cs +++ b/src/BizHawk.Client.Common/movie/import/HexenLmpImport.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common // In better detail, from archive.org: http://web.archive.org/web/20070630072856/http://demospecs.planetquake.gamespy.com/lmp/lmp.html [ImporterFor("Hexen", ".hexenlmp")] internal class HexenLmpImport : MovieImporter - { + { protected override void RunImport() { var input = SourceFile.OpenRead().ReadAllBytes(); diff --git a/src/BizHawk.Client.Common/movie/interfaces/IMovie.cs b/src/BizHawk.Client.Common/movie/interfaces/IMovie.cs index 20822f3768..17bf1d5549 100644 --- a/src/BizHawk.Client.Common/movie/interfaces/IMovie.cs +++ b/src/BizHawk.Client.Common/movie/interfaces/IMovie.cs @@ -101,7 +101,7 @@ namespace BizHawk.Client.Common /// Returns an error message, if any /// Returns whether or not the input log in reader is in the same timeline as the movie bool CheckTimeLines(TextReader reader, out string errorMessage); - + /// /// Takes reader and extracts the input log, then replaces the movies input log with it /// diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs index 8a0120279c..4917ea1007 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs @@ -186,7 +186,7 @@ namespace BizHawk.Client.Common Changes = true; InvalidateAfter(frame); - + ChangeLog.AddInsertInput(frame, inputLog.ToList(), $"Insert {inputLog.Count()} frame(s) at {frame}"); } @@ -207,7 +207,7 @@ namespace BizHawk.Client.Common { int firstChangedFrame = -1; ChangeLog.BeginNewBatch($"Copy Over Input: {frame}"); - + var states = inputStates.ToList(); if (Log.Count < states.Count + frame) diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs index 4939b0e4ac..3a19ed4d7e 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs @@ -782,7 +782,7 @@ namespace BizHawk.Client.Common _onlyEmpty = false; _newInputs = newInputs; } - + public void Undo(ITasMovie movie) { bool wasRecording = movie.ChangeLog.IsRecording; @@ -826,7 +826,7 @@ namespace BizHawk.Client.Common _oldInputs = oldInputs; _removedMarkers = removedMarkers; } - + public void Undo(ITasMovie movie) { bool wasRecording = movie.ChangeLog.IsRecording; diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs index 0690668a74..492b3fe07c 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs @@ -60,7 +60,7 @@ namespace BizHawk.Client.Common Markers.Clear(); ChangeLog.Clear(); } - + protected override void LoadFields(ZipStateLoader bl) { base.LoadFields(bl); @@ -78,7 +78,7 @@ namespace BizHawk.Client.Common ChangeLog.Clear(); Changes = false; } - + private void LoadTasprojExtras(ZipStateLoader bl) { bl.GetLump(BinaryStateLump.LagLog, abort: false, tr => LagLog.Load(tr)); diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index c780ca3573..9fb2bb5dac 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -153,7 +153,7 @@ namespace BizHawk.Client.Common _displayCache.Controller.SetFromMnemonic(Log[frame]); _displayCache.Frame = frame; } - + return CreateDisplayValueForButton(_displayCache.Controller, buttonName); } @@ -192,7 +192,7 @@ namespace BizHawk.Client.Common TasStateManager.Capture(Emulator.Frame, Emulator.AsStatable(), Emulator.Frame == LastEditedFrame - 1); } - + public void CopyVerificationLog(IEnumerable log) { foreach (string entry in log) diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs index cde19c87f6..4bf4e5f9de 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs @@ -81,7 +81,7 @@ namespace BizHawk.Client.Common public class TasMovieMarkerList : List { private readonly ITasMovie _movie; - + public TasMovieMarkerList(ITasMovie movie) { _movie = movie; @@ -336,7 +336,7 @@ namespace BizHawk.Client.Common { return Find(m => m == frame); } - + public void ShiftAt(int frame, int offset) { foreach (var marker in this.Where(m => m.Frame >= frame).ToList()) diff --git a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs index ba12abd5c2..8b522b619d 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs @@ -62,7 +62,7 @@ namespace BizHawk.Client.Common // init the reserved dictionary RebuildReserved(); } - + public byte[] this[int frame] { get @@ -174,7 +174,7 @@ namespace BizHawk.Client.Common if (_reserveCallback(si.Frame)) AddToReserved(si); else - buffer.Capture(si.Frame, s => + buffer.Capture(si.Frame, s => { using var rs = si.GetReadStream(); rs.CopyTo(s); diff --git a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs index 97214aa761..37c52c421c 100644 --- a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs +++ b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs @@ -135,7 +135,7 @@ namespace BizHawk.Client.Common { return 1; // shrug } - + if (_fixedRewindInterval) { return _targetRewindInterval; diff --git a/src/BizHawk.Client.Common/tools/Cheat.cs b/src/BizHawk.Client.Common/tools/Cheat.cs index a9baa30bd4..bae019699e 100644 --- a/src/BizHawk.Client.Common/tools/Cheat.cs +++ b/src/BizHawk.Client.Common/tools/Cheat.cs @@ -116,7 +116,7 @@ namespace BizHawk.Client.Common _ => string.Empty, }; } - + return ""; } } diff --git a/src/BizHawk.Client.Common/tools/CheatList.cs b/src/BizHawk.Client.Common/tools/CheatList.cs index db5a8ae1a4..e685764ee6 100644 --- a/src/BizHawk.Client.Common/tools/CheatList.cs +++ b/src/BizHawk.Client.Common/tools/CheatList.cs @@ -177,7 +177,7 @@ namespace BizHawk.Client.Common Changes = true; return true; } - + return false; } @@ -320,7 +320,7 @@ namespace BizHawk.Client.Common } using var sr = file.OpenText(); - + if (!append) { Clear(); @@ -372,7 +372,7 @@ namespace BizHawk.Client.Common type = Watch.DisplayTypeFromChar(vals[7][0]); bigEndian = vals[8] == "1"; } - + // For backwards compatibility, don't assume these values exist if (vals.Length > 9) { diff --git a/src/BizHawk.Client.Common/tools/RamSearchEngine/RamSearchEngine.cs b/src/BizHawk.Client.Common/tools/RamSearchEngine/RamSearchEngine.cs index 78e47dd261..19a9f802f8 100644 --- a/src/BizHawk.Client.Common/tools/RamSearchEngine/RamSearchEngine.cs +++ b/src/BizHawk.Client.Common/tools/RamSearchEngine/RamSearchEngine.cs @@ -359,7 +359,7 @@ namespace BizHawk.Client.Common.RamSearchEngine get => _settings.UseUndoHistory; set => _settings.UseUndoHistory = value; } - + public bool CanUndo => UndoEnabled && _history.CanUndo; public bool CanRedo => UndoEnabled && _history.CanRedo; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs index c0c32d3a54..ae16339af6 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs @@ -485,7 +485,7 @@ namespace BizHawk.Client.EmuHawk opts = _comprOptions; } - + private byte[] SerializeToByteArray() { var m = new MemoryStream(); diff --git a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs index e95488cdcc..a3b3d88f9b 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs @@ -73,7 +73,7 @@ namespace BizHawk.Client.EmuHawk } } } - + //throw new Exception("test of download failure"); //if we were ordered to exit, bail without wasting any more time diff --git a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs index 5704493bb3..abf463493e 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs @@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk _segment = 0; OpenFileSegment(); } - + /// /// starts an ffmpeg process and sets up associated sockets /// diff --git a/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs index 092a72729f..cb841df44d 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs @@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk /// total length of the movie: ms /// public ulong LengthMs { get; set; } - + /// /// number of rerecords /// @@ -382,7 +382,7 @@ namespace BizHawk.Client.EmuHawk Data = source, Timestamp = TimestampCalc(_fpsNum, _fpsDen, _totalFrames), }; - + _totalFrames++; WriteVideo(j); } @@ -422,7 +422,7 @@ namespace BizHawk.Client.EmuHawk Subtype = 1, // raw PCM audio Data = new byte[4], }; - + j.Data[0] = (byte)(l >> 8); j.Data[1] = (byte)(l & 255); j.Data[2] = (byte)(r >> 8); @@ -628,7 +628,7 @@ namespace BizHawk.Client.EmuHawk /// blocking thread safe queue, used for communication between main program and file writing thread /// private BlockingCollection _threadQ; - + /// /// file writing thread; most of the work happens here /// @@ -738,7 +738,7 @@ namespace BizHawk.Client.EmuHawk /// VideoCopy to compress /// gzipped stream with width and height prepended private delegate byte[] GzipFrameD(VideoCopy v); - + // delegate for GzipFrame private GzipFrameD _gzipFrameDelegate; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs b/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs index f6a3377382..71d04c07bf 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/NutMuxer.cs @@ -257,7 +257,7 @@ namespace BizHawk.Client.EmuHawk _data = null; } - + public override long Length => throw new NotImplementedException(); public override long Position @@ -280,7 +280,7 @@ namespace BizHawk.Client.EmuHawk { throw new NotImplementedException(); } - + public override void Write(byte[] buffer, int offset, int count) { _data.Write(buffer, offset, count); @@ -324,13 +324,13 @@ namespace BizHawk.Client.EmuHawk // has EOR been written on this stream? private bool _videoDone; - + // has EOR been written on this stream? private bool _audioDone; // video packets waiting to be written private readonly Queue _videoQueue; - + // audio packets waiting to be written private readonly Queue _audioQueue; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs index 357fa4dfb5..6fd652477a 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs @@ -43,7 +43,7 @@ namespace BizHawk.Client.EmuHawk if (result is null) return; _mSynclessConfigFile = result; - + //---- this is pretty crappy: var lines = File.ReadAllLines(_mSynclessConfigFile); @@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk } _mFramesDirectory = Path.Combine(Path.GetDirectoryName(Path.GetFullPath(_mSynclessConfigFile)), framesDir); - + // scan frames directory int frame = 1; // hacky! skip frame 0, because we have a problem with dumping that frame somehow for (;;) @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk PngPath = png, WavPath = wav, }); - + frame++; } diff --git a/src/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs b/src/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs index 74c823ccfc..ef30edafe5 100644 --- a/src/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs +++ b/src/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs @@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk { InitializeComponent(); CoreNameLabel.Text = attributes.CoreName; - + if (!string.IsNullOrEmpty(attributes.Author)) { CoreAuthorLabel.Text = $"authors: {attributes.Author}"; diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ClipboardEventTextBox.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ClipboardEventTextBox.cs index a2ff671c34..bcfd227f82 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ClipboardEventTextBox.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ClipboardEventTextBox.cs @@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls { protected override void WndProc(ref Message m) { - // WM_PASTE is also sent when pasting through the OS context menu, but doesn't work on Mono + // WM_PASTE is also sent when pasting through the OS context menu, but doesn't work on Mono const int WM_PASTE = 0x302; if (m.Msg is WM_PASTE && !OSTailoredCode.IsUnixHost) diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs index dedfe7c8c4..391f05ab58 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ExceptionBox.designer.cs @@ -39,9 +39,9 @@ this.tableLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.SuspendLayout(); - // + // // btnOK - // + // this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnOK.Location = new System.Drawing.Point(625, 304); this.btnOK.Name = "btnOK"; @@ -50,9 +50,9 @@ this.btnOK.Text = "OK"; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // + // // tableLayoutPanel1 - // + // this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); @@ -68,9 +68,9 @@ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(703, 330); this.tableLayoutPanel1.TabIndex = 1; - // + // // txtException - // + // this.tableLayoutPanel1.SetColumnSpan(this.txtException, 2); this.txtException.Dock = System.Windows.Forms.DockStyle.Fill; this.txtException.Location = new System.Drawing.Point(3, 3); @@ -80,9 +80,9 @@ this.txtException.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.txtException.Size = new System.Drawing.Size(697, 295); this.txtException.TabIndex = 1; - // + // // flowLayoutPanel1 - // + // this.flowLayoutPanel1.AutoSize = true; this.flowLayoutPanel1.Controls.Add(this.btnCopy); this.flowLayoutPanel1.Controls.Add(this.lblDone); @@ -91,9 +91,9 @@ this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(87, 29); this.flowLayoutPanel1.TabIndex = 2; - // + // // btnCopy - // + // this.btnCopy.Location = new System.Drawing.Point(3, 3); this.btnCopy.Name = "btnCopy"; this.btnCopy.Size = new System.Drawing.Size(75, 23); @@ -101,23 +101,23 @@ this.btnCopy.Text = "Copy"; this.btnCopy.UseVisualStyleBackColor = true; this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); - // + // // lblDone - // + // this.lblDone.AutoSize = true; this.lblDone.Location = new System.Drawing.Point(84, 10); this.lblDone.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); this.lblDone.Name = "lblDone"; this.lblDone.Size = new System.Drawing.Size(0, 13); this.lblDone.TabIndex = 4; - // + // // timer1 - // + // this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // + // // ExceptionBox - // + // this.AcceptButton = this.btnOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs b/src/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs index bd3a40636b..5b872b7c60 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk { return; } - + if (!e.KeyChar.IsHex()) { e.Handled = true; @@ -154,7 +154,7 @@ namespace BizHawk.Client.EmuHawk { return null; } - + return 0; } @@ -212,7 +212,7 @@ namespace BizHawk.Client.EmuHawk { return; } - + if (!e.KeyChar.IsUnsigned()) { e.Handled = true; @@ -287,7 +287,7 @@ namespace BizHawk.Client.EmuHawk { return null; } - + return 0; } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs index 4ea717f8d0..9c168aceb5 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs @@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk ? string.CompareOrdinal(c1.Column?.Name, c2.Column?.Name) : row; } - + return 1; } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 317dac542b..13fb67680f 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -196,7 +196,7 @@ namespace BizHawk.Client.EmuHawk _columns.ColumnsChanged(); Refresh(); } - + } base.OnDoubleClick(e); @@ -1043,7 +1043,7 @@ namespace BizHawk.Client.EmuHawk } Cell newCell = CalculatePointedCell(_currentX.Value, _currentY.Value); - + // SuuperW: Hide lag frames if (QueryFrameLag != null && newCell.RowIndex.HasValue) { @@ -1485,7 +1485,7 @@ namespace BizHawk.Client.EmuHawk else { SelectRow(_lastSelectedRow.Value + 1, true); - + } Refresh(); @@ -1547,7 +1547,7 @@ namespace BizHawk.Client.EmuHawk //jump to above marker with selection courser if (LetKeysModifySelection) { - + } } else if (e.IsCtrl(Keys.PageDown)) @@ -1963,7 +1963,7 @@ namespace BizHawk.Client.EmuHawk var size2 = _renderer.MeasureString("AA", Font); _charSize = new SizeF(size2.Width - size1.Width, size1.Height); } - + if (_columns.VisibleColumns.Any()) { MaxColumnWidth = _columns.VisibleColumns.Max(c => c.VerticalWidth); diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputWidget.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputWidget.cs index 0565b7dd4a..c6941f81fe 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputWidget.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputWidget.cs @@ -131,7 +131,7 @@ namespace BizHawk.Client.EmuHawk { Input.Instance.Update(); var bindingStr = Input.Instance.GetNextBindEvent(ref _lastPress); - + if (bindingStr != null) { // has special meaning for the binding UI system (clear it). @@ -167,7 +167,7 @@ namespace BizHawk.Client.EmuHawk _bindings.Add(bindingStr); } - + UpdateLabel(); Increment(); } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs b/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs index 994927929f..b1e64c77c9 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/MiscControls.cs @@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk // draw text-label part of the control with something so that it isn't hallofmirrorsy using(var brush = new SolidBrush(Parent.BackColor)) pevent.Graphics.FillRectangle(brush, ClientRectangle); - + var r = new Rectangle(ClientRectangle.Location, SystemInformation.MenuCheckSize); var glyphLoc = ClientRectangle; glyphLoc.Size = SystemInformation.MenuCheckSize; diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/MsgBox.designer.cs b/src/BizHawk.Client.EmuHawk/CustomControls/MsgBox.designer.cs index 37280a8211..d959855c37 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/MsgBox.designer.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/MsgBox.designer.cs @@ -34,9 +34,9 @@ this.messageLbl = new BizHawk.WinForms.Controls.LocLabelEx(); this.btn3 = new System.Windows.Forms.Button(); this.SuspendLayout(); - // + // // chkBx - // + // this.chkBx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.chkBx.AutoSize = true; this.chkBx.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -47,9 +47,9 @@ this.chkBx.Text = "Don\'t show this again"; this.chkBx.UseVisualStyleBackColor = true; this.chkBx.Visible = false; - // + // // btn1 - // + // this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btn1.AutoSize = true; this.btn1.DialogResult = System.Windows.Forms.DialogResult.Cancel; @@ -61,9 +61,9 @@ this.btn1.UseVisualStyleBackColor = true; this.btn1.Visible = false; this.btn1.Click += new System.EventHandler(this.ButtonClick); - // + // // btn2 - // + // this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btn2.AutoSize = true; this.btn2.Location = new System.Drawing.Point(317, 114); @@ -74,16 +74,16 @@ this.btn2.UseVisualStyleBackColor = true; this.btn2.Visible = false; this.btn2.Click += new System.EventHandler(this.ButtonClick); - // + // // messageLbl - // + // this.messageLbl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.messageLbl.Location = new System.Drawing.Point(58, 10); this.messageLbl.Name = "messageLbl"; this.messageLbl.Text = "[Message]"; - // + // // btn3 - // + // this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btn3.AutoSize = true; this.btn3.Location = new System.Drawing.Point(398, 114); @@ -94,9 +94,9 @@ this.btn3.UseVisualStyleBackColor = true; this.btn3.Visible = false; this.btn3.Click += new System.EventHandler(this.ButtonClick); - // + // // DialogBox - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btn1; diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ScreenshotForm.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ScreenshotForm.cs index 628da278ef..9318c74022 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ScreenshotForm.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ScreenshotForm.cs @@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk public class ScreenshotForm : Form { private const int WS_EX_TOPMOST = 0x00000008; - + private const int Interval = 40; private const double AlphaStep = 0.125; diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs b/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs index 073c16c9a8..b30c117295 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/ViewportPanel.cs @@ -31,7 +31,7 @@ namespace BizHawk.Client.EmuHawk public RetainedViewportPanel(bool doubleBuffer = false) { CreateHandle(); - + SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.DoubleBuffer, doubleBuffer); diff --git a/src/BizHawk.Client.EmuHawk/LogWindow.cs b/src/BizHawk.Client.EmuHawk/LogWindow.cs index 7d53cf53e3..17d989b128 100644 --- a/src/BizHawk.Client.EmuHawk/LogWindow.cs +++ b/src/BizHawk.Client.EmuHawk/LogWindow.cs @@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk public void ShowReport(string title, string report) { var ss = report.Split('\n'); - + lock (_lines) foreach (var s in ss) { diff --git a/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs b/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs index bf96740bc9..7ecc26de30 100644 --- a/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs +++ b/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs @@ -95,7 +95,7 @@ namespace BizHawk.Client.EmuHawk Console.WriteLine($"{nameof(descr.NeedsRomAsPath)}: {descr.NeedsRomAsPath}"); Console.WriteLine($"{nameof(descr.NeedsArchives)}: {descr.NeedsArchives}"); Console.WriteLine($"{nameof(descr.SupportsNoGame)}: {descr.SupportsNoGame}"); - + foreach (var v in descr.Variables.Values) Console.WriteLine(v); } diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs index 668df2be2d..f315025b8a 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.Update.cs @@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk private static RAInterface _RA; private static DynamicLibraryImportResolver _resolver; private static Version _version; - + public static bool IsAvailable => _RA != null; // can't have both a proxy with a monitor and without one, so... diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs index 38588fbe7b..33fccff1a1 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RAIntegration.cs @@ -128,7 +128,7 @@ namespace BizHawk.Client.EmuHawk { _memGuard = new(_memLock, _memSema, _memSync); _memAccess = new(_memLock, _memSema, _memSync); - + RA = BizInvoker.GetInvoker(_resolver, _memAccess, CallingConventionAdapters.Native); // make sure clientName and clientVer match our user agent, as these get put into RAIntegration's user agent @@ -172,7 +172,7 @@ namespace BizHawk.Client.EmuHawk RA.OnLoadState(path); } - + private void QuickLoadCallback(object _, BeforeQuickLoadEventArgs e) { if (RA.HardcoreModeIsActive()) diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Achievements.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Achievements.cs index 4886789cab..f94b7f082f 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Achievements.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.Achievements.cs @@ -91,8 +91,8 @@ namespace BizHawk.Client.EmuHawk { _badgeUnlockedRequest = new(BadgeName, LibRCheevos.rc_api_image_type_t.RC_IMAGE_TYPE_ACHIEVEMENT); _badgeLockedRequest = new(BadgeName, LibRCheevos.rc_api_image_type_t.RC_IMAGE_TYPE_ACHIEVEMENT_LOCKED); - requests.Add(_badgeUnlockedRequest); - requests.Add(_badgeLockedRequest); + requests.Add(_badgeUnlockedRequest); + requests.Add(_badgeLockedRequest); } public Cheevo(in LibRCheevos.rc_api_achievement_definition_t cheevo, Func allowUnofficialCheevos) @@ -166,7 +166,7 @@ namespace BizHawk.Client.EmuHawk private void ToSoftcoreMode() { if (_gameData == null || _gameData.GameID == 0) return; - + // don't worry if the meanings of _active and _inactive are wrong // if they are, then they're both already finished diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs index bcc7578f4c..cfa511ce13 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.Memory.cs @@ -134,7 +134,7 @@ namespace BizHawk.Client.EmuHawk _domain.PokeByte(FixAddr(addr) ^ _addressMangler, val); } } - + protected virtual uint ReadMemBlock(uint addr, IntPtr buffer, uint bytes) { addr = FixAddr(addr); @@ -492,7 +492,7 @@ namespace BizHawk.Client.EmuHawk TryAddDomain(cartRam, 0x2000); mfs.Add(new(domains[wram], 0x0000, 0x2000)); mfs.Add(new(domains[sysBus], 0xE000, 0x2000)); - mfs.Add(domains[wram].Size == 0x8000 + mfs.Add(domains[wram].Size == 0x8000 ? new MemFunctions(domains[wram], 0x2000, 0x6000) : new NullMemFunctions(0x6000)); if (domains.Has(cartRam) && domains[cartRam].Size > 0x2000) diff --git a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.cs b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.cs index b2daafb06d..9f6cc38049 100644 --- a/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.cs +++ b/src/BizHawk.Client.EmuHawk/RetroAchievements/RetroAchievements.cs @@ -29,7 +29,7 @@ namespace BizHawk.Client.EmuHawk protected RetroAchievements( MainForm mainForm, InputManager inputManager, - ToolManager tools, + ToolManager tools, Func getConfig, ToolStripItemCollection raDropDownItems, Action shutdownRACallback) diff --git a/src/BizHawk.Client.EmuHawk/config/AnalogRangeConfig.cs b/src/BizHawk.Client.EmuHawk/config/AnalogRangeConfig.cs index e70c11dbb4..1d7602d8cf 100644 --- a/src/BizHawk.Client.EmuHawk/config/AnalogRangeConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/AnalogRangeConfig.cs @@ -104,7 +104,7 @@ namespace BizHawk.Client.EmuHawk ScaledX * 2 - 3, ScaledY * 2 - 3); } - + base.OnPaint(e); } diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index 0c674b1fb2..959028b2d3 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -179,7 +179,7 @@ namespace BizHawk.Client.EmuHawk _emulator = emulator; _config = config; DialogController = dialogController; - + InitializeComponent(); SuspendLayout(); diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs index ddb9fdcd5b..71dd390682 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs @@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk { _panelSize = Size; } - + _realConfigObject = config; _realConfigButtons = buttons; SetButtonList(); diff --git a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs index 112de7521a..6257de57f9 100755 --- a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs @@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk _config.DispFullscreenHacks = cbFullscreenHacks.Checked; _config.DispAutoPrescale = cbAutoPrescale.Checked; _config.ScaleOSDWithSystemScale = cbScaleOSD.Checked; - + _config.DispAllowTearing = cbAllowTearing.Checked; _config.DispChromeStatusBarWindowed = cbStatusBarWindowed.Checked; @@ -283,7 +283,7 @@ namespace BizHawk.Client.EmuHawk rbUser.Checked = true; var choice = Path.GetFullPath(result); - + //test the preset using (var stream = File.OpenRead(choice)) { diff --git a/src/BizHawk.Client.EmuHawk/config/FirmwareConfig.cs b/src/BizHawk.Client.EmuHawk/config/FirmwareConfig.cs index 440821c1ca..faa27505c8 100644 --- a/src/BizHawk.Client.EmuHawk/config/FirmwareConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/FirmwareConfig.cs @@ -317,7 +317,7 @@ namespace BizHawk.Client.EmuHawk { // lazy substring extraction. really should do a better job var basePath = _pathEntries.FirmwareAbsolutePath() + Path.DirectorySeparatorChar; - + var path = ri.FilePath.Replace(basePath, ""); // bolden the item if the user has specified a path for it diff --git a/src/BizHawk.Client.EmuHawk/config/GB/GBPrefControl.cs b/src/BizHawk.Client.EmuHawk/config/GB/GBPrefControl.cs index a460aa03e2..30efb9fa44 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/GBPrefControl.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/GBPrefControl.cs @@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk { _s.Muted = ((CheckBox)sender).Checked; } - + private void CbRgbdsSyntax_CheckedChanged(object sender, EventArgs e) { _s.RgbdsSyntax = ((CheckBox)sender).Checked; diff --git a/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs b/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs index 9e85120837..d669a584b0 100644 --- a/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs +++ b/src/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs @@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk var tsi = new ToolStripMenuItem(spec.BindingName) { ToolTipText = spec.TooltipText }; _dropdownMenu.Items.Add(tsi); } - + btnSpecial.ContextMenuStrip = _dropdownMenu; widget.CompositeWidget = this; diff --git a/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs b/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs index 27761beecb..6f8c47effc 100644 --- a/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/Messages/MessageConfig.cs @@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk _reRecordCounter = _config.ReRecordCounter.Clone(); _messages = _config.Messages.Clone(); _autohold = _config.Autohold.Clone(); - _ramWatches = _config.RamWatches.Clone(); + _ramWatches = _config.RamWatches.Clone(); InitializeComponent(); @@ -139,7 +139,7 @@ namespace BizHawk.Client.EmuHawk ColorBox.Controls.Add(row); } } - + private void Ok_Click(object sender, EventArgs e) { _config.Fps = _fps; diff --git a/src/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs b/src/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs index ca601ef6d3..43184e3ed5 100644 --- a/src/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs @@ -209,7 +209,7 @@ namespace BizHawk.Client.EmuHawk bestFit = 0; break; } - + bestFit = i - 1; break; } diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs index 22a5d9790b..dfdc015ebe 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs @@ -112,7 +112,7 @@ namespace BizHawk.Client.EmuHawk return _settings.Palette; } - + // no filename: interpret this as "reset to default" if (showMsg) { @@ -120,9 +120,9 @@ namespace BizHawk.Client.EmuHawk } return (byte[,])Palettes.QuickNESPalette.Clone(); - + } - + // checkbox unchecked: we're reusing whatever palette was set return _settings.Palette; } diff --git a/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs index 251b182932..3f43eae214 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk protected override void OnClosed(EventArgs e) { base.OnClosed(e); - + if (pictureBox1.Image != null) { pictureBox1.Image.Dispose(); diff --git a/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs b/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs index 6090d62fc1..db29fdfa75 100644 --- a/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/PSX/PSXControllerConfig.cs @@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk { _syncSettings.FIOConfig = UserConfigFromGui(); _settable.PutCoreSyncSettings(_syncSettings); - + DialogResult = DialogResult.OK; Close(); } diff --git a/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs b/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs index 0a6db6506f..9ac8dc3f28 100644 --- a/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs +++ b/src/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs @@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk for (int i = 0; i < SubGrid.Rows.Count - 1; i++) { var sub = new Subtitle(); - + var c = SubGrid.Rows[i].Cells[0]; try { sub.Frame = int.Parse(c.Value.ToString()); } catch { ShowError(i, 0); return; } @@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk { return new Subtitle(); } - + var sub = new Subtitle(); if (int.TryParse(SubGrid.Rows[index].Cells[0].Value.ToString(), out int frame)) @@ -171,12 +171,12 @@ namespace BizHawk.Client.EmuHawk { sub.Duration = duration; } - + if (uint.TryParse(SubGrid.Rows[index].Cells[4].Value.ToString(), out uint color)) { sub.Color = color; } - + sub.Message = SubGrid.Rows[index].Cells[5].Value?.ToString() ?? ""; _selectedMovie.Subtitles.Add(sub); diff --git a/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index ec75f93ba7..fb7c058b4b 100644 --- a/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -277,7 +277,7 @@ namespace BizHawk.Client.EmuHawk private void BrowseBtn_Click(object sender, EventArgs e) { string movieFolderPath = _config.PathEntries.MovieAbsolutePath(); - + // Create movie folder if it doesn't already exist try { @@ -292,7 +292,7 @@ namespace BizHawk.Client.EmuHawk } else throw; } - + var filterset = _movieSession.Movie.GetFSFilterSet(); var result = this.ShowFileSaveDialog( fileExt: $".{filterset.Filters[0].Extensions.First()}", diff --git a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index ace9a8deab..af4418ba92 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -58,7 +58,7 @@ namespace BizHawk.Client.EmuHawk private int _dataSize; private Dictionary _cachedControlProbabilities; - + private bool _previousDisplayMessage; private bool _previousInvisibleEmulation; @@ -153,7 +153,7 @@ namespace BizHawk.Client.EmuHawk ControlProbabilityPanel.Controls .OfType() .ToDictionary(tkey => tkey.ButtonName, tvalue => tvalue.Probability); - + private int SelectedSlot => 1 + StartFromSlotBox.SelectedIndex; diff --git a/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs b/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs index 7bd05913b4..521cd2a555 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BatchRunner.cs @@ -167,7 +167,7 @@ namespace BizHawk.Client.EmuHawk try { emu.FrameAdvance(controller, true); - + // some cores really really really like it if you drain their audio every frame if (emu.HasSoundProvider()) { diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.cs index 55ea9efcaf..a67d7f673d 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.cs @@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk [ConfigPersist] private bool CDLAutoStart { get; set; } = true; - + [ConfigPersist] private bool CDLAutoResume { get; set; } = true; @@ -145,7 +145,7 @@ namespace BizHawk.Client.EmuHawk { int[] totals = new int[8]; int total = 0; - + for (int i = 0; i < 256; i++) map[i] = 0; @@ -236,7 +236,7 @@ namespace BizHawk.Client.EmuHawk ShutdownCDL(); return true; } - + ShutdownCDL(); return false; } @@ -385,7 +385,7 @@ namespace BizHawk.Client.EmuHawk if (file == null) return false; - + SetCurrentFilename(file.FullName); RunSave(); return true; diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs index 12bbe683e3..17856fe6bb 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs @@ -56,15 +56,15 @@ namespace BizHawk.Client.EmuHawk this.menuStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); - // + // // menuStrip1 - // + // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FileSubMenu}); this.menuStrip1.TabIndex = 2; - // + // // FileSubMenu - // + // this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.NewMenuItem, this.OpenMenuItem, @@ -80,75 +80,75 @@ namespace BizHawk.Client.EmuHawk this.DisassembleMenuItem}); this.FileSubMenu.Text = "&File"; this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened); - // + // // NewMenuItem - // + // this.NewMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); this.NewMenuItem.Text = "&New"; this.NewMenuItem.Click += new System.EventHandler(this.NewMenuItem_Click); - // + // // OpenMenuItem - // + // this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); this.OpenMenuItem.Text = "&Open..."; this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click); - // + // // SaveMenuItem - // + // this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this.SaveMenuItem.Text = "&Save"; this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click); - // + // // SaveAsMenuItem - // - this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + // + this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); this.SaveAsMenuItem.Text = "&Save As..."; this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click); - // + // // AppendMenuItem - // + // this.AppendMenuItem.Text = "&Append File..."; this.AppendMenuItem.Click += new System.EventHandler(this.AppendMenuItem_Click); - // + // // RecentSubMenu - // + // this.RecentSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.noneToolStripMenuItem}); this.RecentSubMenu.Text = "Recent"; this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened); - // + // // noneToolStripMenuItem - // + // this.noneToolStripMenuItem.Text = "None"; - // + // // miAutoStart - // + // this.miAutoStart.Text = "Auto-Start"; this.miAutoStart.Click += new System.EventHandler(this.MiAutoStart_Click); - // + // // miAutoSave - // + // this.miAutoSave.Text = "Auto-Save"; this.miAutoSave.Click += new System.EventHandler(this.MiAutoSave_Click); - // + // // miAutoResume - // + // this.miAutoResume.Text = "Auto-Resume"; this.miAutoResume.Click += new System.EventHandler(this.MiAutoResume_Click); - // + // // ClearMenuItem - // + // this.ClearMenuItem.Text = "&Clear"; this.ClearMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click); - // + // // DisassembleMenuItem - // + // this.DisassembleMenuItem.Text = "&Disassemble..."; this.DisassembleMenuItem.Click += new System.EventHandler(this.DisassembleMenuItem_Click); - // + // // toolStrip1 - // + // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbLoggingActive, this.toolStripSeparator3, @@ -159,9 +159,9 @@ namespace BizHawk.Client.EmuHawk this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.TabIndex = 8; - // + // // tsbLoggingActive - // + // this.tsbLoggingActive.CheckOnClick = true; this.tsbLoggingActive.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.tsbLoggingActive.ImageTransparentColor = System.Drawing.Color.Magenta; @@ -169,9 +169,9 @@ namespace BizHawk.Client.EmuHawk this.tsbLoggingActive.Size = new System.Drawing.Size(44, 22); this.tsbLoggingActive.Text = "Active"; this.tsbLoggingActive.CheckedChanged += new System.EventHandler(this.TsbLoggingActive_CheckedChanged); - // + // // tsbViewUpdate - // + // this.tsbViewUpdate.Checked = true; this.tsbViewUpdate.CheckOnClick = true; this.tsbViewUpdate.CheckState = System.Windows.Forms.CheckState.Checked; @@ -180,9 +180,9 @@ namespace BizHawk.Client.EmuHawk this.tsbViewUpdate.Name = "tsbViewUpdate"; this.tsbViewUpdate.Size = new System.Drawing.Size(49, 22); this.tsbViewUpdate.Text = "Update"; - // + // // tsbViewStyle - // + // this.tsbViewStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.tsbViewStyle.Items.AddRange(new object[] { "Show %", @@ -191,17 +191,17 @@ namespace BizHawk.Client.EmuHawk this.tsbViewStyle.Name = "tsbViewStyle"; this.tsbViewStyle.Size = new System.Drawing.Size(121, 25); this.tsbViewStyle.SelectedIndexChanged += new System.EventHandler(this.TsbViewStyle_SelectedIndexChanged); - // + // // tsbExportText - // + // this.tsbExportText.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbExportText.Name = "tsbExportText"; this.tsbExportText.Size = new System.Drawing.Size(78, 22); this.tsbExportText.Text = "To Clipboard"; this.tsbExportText.Click += new System.EventHandler(this.TsbExportText_Click); - // + // // lvCDL - // + // this.lvCDL.AllowColumnReorder = false; this.lvCDL.AllowColumnResize = true; this.lvCDL.AllowMassNavigationShortcuts = true; @@ -219,9 +219,9 @@ namespace BizHawk.Client.EmuHawk this.lvCDL.Size = new System.Drawing.Size(992, 323); this.lvCDL.TabIndex = 9; this.lvCDL.QueryItemText += new BizHawk.Client.EmuHawk.InputRoll.QueryItemTextHandler(this.LvCDL_QueryItemText); - // + // // CDL - // + // this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; diff --git a/src/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs b/src/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs index 3216815e77..3e90a94fca 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs @@ -369,7 +369,7 @@ namespace BizHawk.Client.EmuHawk { return; } - + // Don't need to do anything in this case if (!empty && CompareTypeDropDown.Items.Count == 6) { diff --git a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs index 244e0ebc35..3c8447ea79 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs @@ -488,7 +488,7 @@ namespace BizHawk.Client.EmuHawk } private void DisableAllCheatsMenuItem_Click(object sender, EventArgs e) - { + { MainForm.CheatList.DisableAll(); } diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs index 2a76cc1e73..c10f28fb85 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs @@ -175,7 +175,7 @@ namespace BizHawk.Client.EmuHawk } private IEnumerable SelectedIndices => BreakpointView.SelectedIndices.Cast(); - + private IEnumerable SelectedItems => SelectedIndices.Select(index => _breakpoints[index]); private IEnumerable EditableItems => SelectedItems.Where(item => !item.ReadOnly); diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs index ea36b40c72..649d544367 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Disassembler.cs @@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk Disassemble(); } } - + private void Disassemble() { _disassemblyLines.Clear(); @@ -136,7 +136,7 @@ namespace BizHawk.Client.EmuHawk if (DisassemblerView.VisibleRows > 0) { DisassemblerView.RowCount = DisassemblerView.VisibleRows * 6 + 2; - } + } } private void DisassemblerView_SizeChanged(object sender, EventArgs e) diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs index a028c1f346..241de16c28 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs @@ -162,7 +162,7 @@ namespace BizHawk.Client.EmuHawk if (t.Text.Length is not 0) { Core.SetCpuRegister(t.Name, int.Parse(t.Text, System.Globalization.NumberStyles.HexNumber)); - } + } } catch (InvalidOperationException) { diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs index 794da4e6ff..52eb9516b7 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs @@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk } private Color _spriteback; - + [ConfigPersist] public Color Spriteback { diff --git a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index 7a48afa699..1e32aae52f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk private string _numDigitsStr = "{0:X4}"; private string _digitFormatString = "{0:X2}"; private long _addressOver = -1; - + private long _maxRow; private MemoryDomain _domain = new NullMemoryDomain(); @@ -253,7 +253,7 @@ namespace BizHawk.Client.EmuHawk _domain = _romDomain; } else - { + { _domain = MemoryDomains.Any(x => x.Name == _domain.Name) ? MemoryDomains[_domain.Name] : MemoryDomains.MainMemory; @@ -269,7 +269,7 @@ namespace BizHawk.Client.EmuHawk _lastRom = MainForm.CurrentlyOpenRom; ResetScrollBar(); } - + SetDataSize(DataSize); SetHeader(); @@ -427,12 +427,12 @@ namespace BizHawk.Client.EmuHawk } byte[] bytes = new byte[str.Length / 2]; - + for (int i = 0; i < str.Length; i += 2) { bytes[i / 2] = Convert.ToByte(str.Substring(i, 2), 16); } - + return bytes; } @@ -502,17 +502,17 @@ namespace BizHawk.Client.EmuHawk { return true; } - + if (key >= 'a' && key <= 'f') // A-F { return true; } - + if (key >= 'A' && key <= 'F') // A-F { return true; } - + return false; } @@ -603,7 +603,7 @@ namespace BizHawk.Client.EmuHawk { if (addr + k < _domain.Size) { - + byte b = (byte)charValues[addr + k]; char c = Remap(b); rowStr.Append(c); @@ -1164,7 +1164,7 @@ namespace BizHawk.Client.EmuHawk { return string.Format(_digitFormatString, MakeValue(DataSize, address)).Trim(); } - + return ""; } @@ -1175,7 +1175,7 @@ namespace BizHawk.Client.EmuHawk var values = ValueString(_highlightedAddress.Value); return _secondaryHighlightedAddresses.Aggregate(values, (current, x) => current + ValueString(x)); } - + return ""; } @@ -1243,7 +1243,7 @@ namespace BizHawk.Client.EmuHawk CloseTableFileMenuItem.Enabled = _textTable.Count is not 0; } - + private void SaveMenuItem_Click(object sender, EventArgs e) { if (!CurrentRomIsArchive()) @@ -1412,7 +1412,7 @@ namespace BizHawk.Client.EmuHawk { return; } - + var clipboardRaw = (string)data.GetData(DataFormats.Text); var hex = clipboardRaw.OnlyHex(); @@ -1956,7 +1956,7 @@ namespace BizHawk.Client.EmuHawk { newValue = HexScrollBar.Maximum - HexScrollBar.LargeChange + 1; } - + if (newValue != HexScrollBar.Value) { HexScrollBar.Value = newValue; @@ -1981,7 +1981,7 @@ namespace BizHawk.Client.EmuHawk } if (gaps < 0) { gaps = 0; } - + var width = (_fontWidth * 2 * (int)cheat.Size) + (gaps * _fontWidth); var rect = new Rectangle(GetAddressCoordinates(cheat.Address ?? 0), new Size(width, _fontHeight)); diff --git a/src/BizHawk.Client.EmuHawk/tools/InputPrompt.cs b/src/BizHawk.Client.EmuHawk/tools/InputPrompt.cs index 530d729bfd..33c1a59373 100644 --- a/src/BizHawk.Client.EmuHawk/tools/InputPrompt.cs +++ b/src/BizHawk.Client.EmuHawk/tools/InputPrompt.cs @@ -79,7 +79,7 @@ namespace BizHawk.Client.EmuHawk { return; } - + if (!e.KeyChar.IsHex()) { e.Handled = true; @@ -91,7 +91,7 @@ namespace BizHawk.Client.EmuHawk { return; } - + if (!e.KeyChar.IsSigned()) { e.Handled = true; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 005548660c..068ad349a2 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -129,7 +129,7 @@ namespace BizHawk.Client.EmuHawk if (AskSaveChanges()) { Settings.Columns = LuaListView.AllColumns; - + DisplayManager.ClearApiHawkSurfaces(); DisplayManager.ClearApiHawkTextureCache(); ResetDrawSurfacePadding(); @@ -502,7 +502,7 @@ namespace BizHawk.Client.EmuHawk OutputBox.SelectionStart = OutputBox.Text.Length; OutputBox.ScrollToCaret(); }); - + } public void ClearOutputWindow() diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs index 376c798585..bfa8db3bef 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs @@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk Clipboard.SetText(sb.ToString()); } } - + private void UpdateList() { GenerateFilteredList(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs index 67996e2e36..3e1ba9268a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs @@ -44,7 +44,7 @@ namespace BizHawk.Client.EmuHawk LogOutputCallback = logOutputCallback; TableHelper = tableHelper; } - + public void LuaResize(int width, int height) { Width = width; @@ -148,7 +148,7 @@ namespace BizHawk.Client.EmuHawk boxBackground.FillEllipse(brush, x, y, width, height); boxBackground = Graphics.FromImage(Image); } - + boxBackground.DrawEllipse(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x, y, width, height); } @@ -256,7 +256,7 @@ namespace BizHawk.Client.EmuHawk boxBackground.FillPie(brush, x, y, width, height, startAngle, sweepAngle); boxBackground = Graphics.FromImage(Image); } - + boxBackground.DrawPie(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x + 1, y + 1, width - 1, height - 1, startAngle, sweepAngle); } @@ -309,7 +309,7 @@ namespace BizHawk.Client.EmuHawk boxBackground.FillRectangle(GetBrush(bg.Value), x, y, width, height); boxBackground = Graphics.FromImage(Image); } - + boxBackground.DrawRectangle(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x, y, width, height); } @@ -400,7 +400,7 @@ namespace BizHawk.Client.EmuHawk boxBackground.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; boxBackground.DrawString(message, font, GetBrush(TableHelper.SafeParseColor(foreColor) ?? Color.Black), x, y); } - + public Point GetMouse() { var p = PointToClient(MousePosition); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs index 9b1c7f2c47..3620e33c71 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs @@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk private void PopulateListView() { FunctionView.Items.Clear(); - + var functions = _registeredFunctions .OrderBy(f => f.Event) .ThenBy(f => f.Name); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index c1d7c859ee..ed1014fef1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -435,7 +435,7 @@ namespace BizHawk.Client.EmuHawk ////ftriangle = fCPU/(32*(tval + 1)) var apu = Nes.apu; - + // evaluate the pitches int pulse0Period = apu.pulse[0].timer_reload_value; float pulse0Freq = 1789773.0f / (16.0f * (pulse0Period + 1)); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs index c8f3d517b3..422e4d6ca1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs @@ -540,7 +540,7 @@ namespace BizHawk.Client.EmuHawk { ClearDetails(); } - + private void SpriteView_MouseMove(object sender, MouseEventArgs e) { HandleSpriteViewMouseMove(e.Location); @@ -554,7 +554,7 @@ namespace BizHawk.Client.EmuHawk byte[] ppuBus = _ppu.GetPPUBus(); // caching is quicker, but not really correct in this case bool is8x16 = _ppu.SPTall; - + //figure out which sprite we're over int spriteSlotY = p.Y / 8; int spriteSlotX = p.X / 8; diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs index ff3ec63dec..cd8c58121a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs @@ -66,7 +66,7 @@ namespace BizHawk.Client.EmuHawk } } - + public void ScreenshotToClipboard() { diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index a0f6e5feea..fcb6681d5a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -170,7 +170,7 @@ namespace BizHawk.Client.EmuHawk if (index == Emulator.Frame) { bitmap = index == MainForm.PauseOnFrame - ? TasView.HorizontalOrientation ? ts_v_arrow_green_blue : ts_h_arrow_green_blue + ? TasView.HorizontalOrientation ? ts_v_arrow_green_blue : ts_h_arrow_green_blue : TasView.HorizontalOrientation ? ts_v_arrow_blue : ts_h_arrow_blue; } else if (index == LastPositionFrame) @@ -576,7 +576,7 @@ namespace BizHawk.Client.EmuHawk _axisEditYPos = e.Y; _axisPaintState = CurrentTasMovie.GetAxisState(frame, buttonName); - + _triggerAutoRestore = true; TastudioPlayMode(true); return; @@ -856,7 +856,7 @@ namespace BizHawk.Client.EmuHawk { // If painting up, we have altered frames without loading states (for smoothness) // So now we have to ensure that all the edited frames are invalidated - GoToLastEmulatedFrameIfNecessary(_paintingMinFrame); + GoToLastEmulatedFrameIfNecessary(_paintingMinFrame); } ClearLeftMouseStates(); diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index cec0f680da..9a95ba5cad 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -1030,17 +1030,17 @@ namespace BizHawk.Client.EmuHawk private void HideWasLagFramesMenuItem_Click(object sender, EventArgs e) => TasView.HideWasLagFrames = !TasView.HideWasLagFrames; - + private void AlwaysScrollMenuItem_Click(object sender, EventArgs e) { TasView.AlwaysScroll = Settings.FollowCursorAlwaysScroll = alwaysScrollToolStripMenuItem.Checked; } - + private void ScrollToViewMenuItem_Click(object sender, EventArgs e) { TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "near"; } - + private void ScrollToTopMenuItem_Click(object sender, EventArgs e) { TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "top"; diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs index f86bf776b9..f78411fd26 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs @@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk { // Get as close as we can then emulate there StartAtNearestFrameAndEmulate(frame, fromLua, fromRewinding); - if (!OnLeftMouseDown) { MaybeFollowCursor(); } + if (!OnLeftMouseDown) { MaybeFollowCursor(); } } else // Emulate to a future frame { diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs index 8116e659a4..32892bc021 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.cs @@ -8,7 +8,7 @@ namespace BizHawk.Client.EmuHawk { private const string IdColumnName = "ID"; private const string UndoColumnName = "Undo Step"; - + private readonly TAStudio _tastudio; private string _lastUndoAction; private IMovieChangeLog Log => _tastudio.CurrentTasMovie.ChangeLog; diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs index 1c0dccafb5..025a0cd9de 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs @@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk [ConfigPersist] public bool ClearAlsoClearsAnalog { get; set; } - + private bool _readOnly; private Control _lastFocusedNUD = null; diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs index 1680ef771d..6164de0acc 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs @@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk !value; _readonly = value; - + Refresh(); } } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadTargetScreen.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadTargetScreen.cs index e57e9c858b..5b7eba9205 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadTargetScreen.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadTargetScreen.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.EmuHawk private bool _isDragging; private bool _readonly; private bool _isSet; // The tool has to keep track of this because there is currently no way to know if an axis is being autoheld or just held - + private int? _overrideX; private int? _overrideY; @@ -185,7 +185,7 @@ namespace BizHawk.Client.EmuHawk if (value < 0) { XNumeric.Value = 0; - + } else if (value <= XNumeric.Maximum) { diff --git a/src/BizHawk.Common/Bit.cs b/src/BizHawk.Common/Bit.cs index 51da3672cc..349da6bcf3 100644 --- a/src/BizHawk.Common/Bit.cs +++ b/src/BizHawk.Common/Bit.cs @@ -11,7 +11,7 @@ namespace BizHawk.Common { _val = val; } - + public static implicit operator Bit(int rhs) { Debug.Assert((rhs & ~1) is 0, "higher bits can't be used"); diff --git a/src/BizHawk.Common/DeepEquality.cs b/src/BizHawk.Common/DeepEquality.cs index 4ef0646a85..7a3ac6872d 100644 --- a/src/BizHawk.Common/DeepEquality.cs +++ b/src/BizHawk.Common/DeepEquality.cs @@ -105,7 +105,7 @@ namespace BizHawk.Common { return o1.Equals(o2); } - + foreach (var field in GetAllFields(t1)) { if (!DeepEquals(field.GetValue(o1), field.GetValue(o2))) diff --git a/src/BizHawk.Common/DeltaSerializer.cs b/src/BizHawk.Common/DeltaSerializer.cs index 9ec2acb7e9..40b48412a3 100644 --- a/src/BizHawk.Common/DeltaSerializer.cs +++ b/src/BizHawk.Common/DeltaSerializer.cs @@ -69,7 +69,7 @@ namespace BizHawk.Common if (different > 0) // only not 0 if index == end immediately { different = index - blockStart - same; - + if (same < 4) // we have different bytes, but we hit the end of the spans before the 8 limit, and we have less than what a same block will save { different += same; diff --git a/src/BizHawk.Common/Serializer.cs b/src/BizHawk.Common/Serializer.cs index 6610ba655d..a9917623a3 100644 --- a/src/BizHawk.Common/Serializer.cs +++ b/src/BizHawk.Common/Serializer.cs @@ -134,7 +134,7 @@ namespace BizHawk.Common { throw new InvalidOperationException(); } - + if (_isText) { SyncEnumText(name, ref val); @@ -776,7 +776,7 @@ namespace BizHawk.Common } curs = ss.Pop(); - + // consume no data past the end of the last proper section if (curs == _readerSection) { diff --git a/src/BizHawk.Common/Win32/Ole32Imports.cs b/src/BizHawk.Common/Win32/Ole32Imports.cs index 83c9568646..1571a1a03c 100644 --- a/src/BizHawk.Common/Win32/Ole32Imports.cs +++ b/src/BizHawk.Common/Win32/Ole32Imports.cs @@ -43,7 +43,7 @@ namespace BizHawk.Common [In, MarshalAs(UnmanagedType.LPStruct)] Guid rclsid, IntPtr pUnkOuter, CLSCTX dwClsContext, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IntPtr ppv); } } diff --git a/src/BizHawk.Common/zstd/Zstd.cs b/src/BizHawk.Common/zstd/Zstd.cs index 566b561c91..cdc1fb38bb 100644 --- a/src/BizHawk.Common/zstd/Zstd.cs +++ b/src/BizHawk.Common/zstd/Zstd.cs @@ -128,7 +128,7 @@ namespace BizHawk.Common public override long Length => throw new NotImplementedException(); - public override long Position + public override long Position { get => throw new NotImplementedException(); set => throw new NotImplementedException(); diff --git a/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs b/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs index 21380f4060..729a489ad2 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/CodeDataLog.cs @@ -137,7 +137,7 @@ namespace BizHawk.Emulation.Common { SaveInternal(s, true); } - + private Dictionary SaveInternal(Stream s, bool forReal) { var ret = new Dictionary(); diff --git a/src/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs b/src/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs index d9af496981..1537a1b2ec 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs @@ -393,7 +393,7 @@ namespace BizHawk.Emulation.Common } public readonly IMemoryCallback Current => _items[_position]; - + object IEnumerator.Current => Current; public bool MoveNext() => ++_position < _items.Count; diff --git a/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs b/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs index 2d9ef3f61b..a51fac1828 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs @@ -134,7 +134,7 @@ namespace BizHawk.Emulation.Common } } - + public class MemoryDomainUshortArray : MemoryDomain { private ushort[] _data; @@ -155,7 +155,7 @@ namespace BizHawk.Emulation.Common addr >>= 1; if(bit0==0) return (byte)(_data[addr] & 0xFF); - else + else return (byte)((_data[addr]>>8)&0xFF); } @@ -409,7 +409,7 @@ namespace BizHawk.Emulation.Common else { base.SendCheatToCore(addr, value, compare, comparetype); - } + } } public MemoryDomainDelegateSysBusNES( diff --git a/src/BizHawk.Emulation.Common/DSKIdentifier.cs b/src/BizHawk.Emulation.Common/DSKIdentifier.cs index 10eff54865..766f03f08f 100644 --- a/src/BizHawk.Emulation.Common/DSKIdentifier.cs +++ b/src/BizHawk.Emulation.Common/DSKIdentifier.cs @@ -116,7 +116,7 @@ namespace BizHawk.Emulation.Common } // at this point the disk is not standard bootable - // try format analysis + // try format analysis if (trk.Sectors.Length == 9 && trk.Sectors[0].SectorSize == 2) { switch (trk.GetLowestSectorID()) diff --git a/src/BizHawk.Emulation.Common/Database/GameInfo.cs b/src/BizHawk.Emulation.Common/Database/GameInfo.cs index 9ae10b1c8e..4f1a4b82f5 100644 --- a/src/BizHawk.Emulation.Common/Database/GameInfo.cs +++ b/src/BizHawk.Emulation.Common/Database/GameInfo.cs @@ -123,7 +123,7 @@ namespace BizHawk.Emulation.Common { return false; } - + return defaultVal; } diff --git a/src/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs b/src/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs index 5e49dd7f35..6510aad6ae 100644 --- a/src/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs +++ b/src/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Common /// /// The to check bool HasService() where T : IEmulatorService; - + /// /// Returns whether or not t is available /// diff --git a/src/BizHawk.Emulation.Common/IpfIdentifier.cs b/src/BizHawk.Emulation.Common/IpfIdentifier.cs index c61fdffe2d..84c834fd71 100644 --- a/src/BizHawk.Emulation.Common/IpfIdentifier.cs +++ b/src/BizHawk.Emulation.Common/IpfIdentifier.cs @@ -210,7 +210,7 @@ namespace BizHawk.Emulation.Common } } - + /// /// Returns an int32 from a byte array based on offset (in BIG ENDIAN format) diff --git a/src/BizHawk.Emulation.Common/N3DSHasher.cs b/src/BizHawk.Emulation.Common/N3DSHasher.cs index dd08b7a2d8..c9bdc57c52 100644 --- a/src/BizHawk.Emulation.Common/N3DSHasher.cs +++ b/src/BizHawk.Emulation.Common/N3DSHasher.cs @@ -243,13 +243,13 @@ namespace BizHawk.Emulation.Common iv.AsSpan(9).Clear(); break; case 1: - // First 8 bytes is the partition id in normal byte order + // First 8 bytes is the partition id in normal byte order header.AsSpan(0x108, 8).CopyTo(iv); // Next 4 bytes are 0 iv.AsSpan(8, 4).Clear(); - // Last 4 bytes is the ExeFS byte offset in big endian + // Last 4 bytes is the ExeFS byte offset in big endian BinaryPrimitives.WriteUInt32BigEndian(iv.AsSpan(12, 4), (uint)exeFsOffset); break; default: diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs index cbc93ea37e..8fa480ef2e 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs @@ -55,7 +55,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME if (MAMEController.BoolButtons.Contains(field)) { - dupName = $" [{ tag }]"; + dupName = $" [{ tag }]"; } MAMEController.BoolButtons.Add(field + dupName); diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index 9ad060b87e..ddb9381142 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -288,7 +288,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME $"MAME is { mameVersion }\n" + $"MAMEHawk is { version }"); } - + private void MAMELogCallback(LibMAME.OutputChannel channel, int size, string data) { if (data.Contains("NOT FOUND") && channel == LibMAME.OutputChannel.ERROR) diff --git a/src/BizHawk.Emulation.Cores/CPUs/68000/OpcodeTable.cs b/src/BizHawk.Emulation.Cores/CPUs/68000/OpcodeTable.cs index 193c683b1d..398266d2ab 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/68000/OpcodeTable.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/68000/OpcodeTable.cs @@ -235,7 +235,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000 "011111", // (d8, PC, Xn) PC with Index "000111", // (xxx).W Absolute Short "001111", // (xxx).L Absolute Long - "100111", // #imm Immediate + "100111", // #imm Immediate }; private static readonly string[] Am3Xn3 = { @@ -306,7 +306,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000 "111011", // (d8, PC, Xn) PC with Index "111000", // (xxx).W Absolute Short "111001", // (xxx).L Absolute Long - "111100", // #imm Immediate + "111100", // #imm Immediate }; private static readonly string[] ConditionMain = { @@ -327,8 +327,8 @@ namespace BizHawk.Emulation.Cores.Components.M68000 }; private static readonly string[] ConditionAll = { - "0000", // T True - "0001", // F False + "0000", // T True + "0001", // F False "0010", // HI Higher (unsigned) "0011", // LS Lower or Same (unsigned) "0100", // CC Carry Clear (aka Higher or Same, unsigned) diff --git a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Execute.cs b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Execute.cs index 3ed24e25e8..dd553d29a7 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Execute.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Execute.cs @@ -33,18 +33,18 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 { switch (opcode) { - case 0x00: LR_A_KU(); break; // LR A, (KU) - case 0x01: LR_A_KL(); break; // LR A, (KL) - case 0x02: LR_A_QU(); break; // LR A, (QU) - case 0x03: LR_A_QL(); break; // LR A, (QL) - case 0x04: LR_KU_A(); break; // LR KU, (A) - case 0x05: LR_KL_A(); break; // LR KL, (A) - case 0x06: LR_QU_A(); break; // LR QU, (A) - case 0x07: LR_QL_A(); break; // LR QL, (A) - case 0x08: LR_K_P(); break; // LR K, (P) - case 0x09: LR_P_K(); break; // LR P, (K) - case 0x0A: LR_A_IS(); break; // LR A, (ISAR) - case 0x0B: LR_IS_A(); break; // LR ISAR, (A) + case 0x00: LR_A_KU(); break; // LR A, (KU) + case 0x01: LR_A_KL(); break; // LR A, (KL) + case 0x02: LR_A_QU(); break; // LR A, (QU) + case 0x03: LR_A_QL(); break; // LR A, (QL) + case 0x04: LR_KU_A(); break; // LR KU, (A) + case 0x05: LR_KL_A(); break; // LR KL, (A) + case 0x06: LR_QU_A(); break; // LR QU, (A) + case 0x07: LR_QL_A(); break; // LR QL, (A) + case 0x08: LR_K_P(); break; // LR K, (P) + case 0x09: LR_P_K(); break; // LR P, (K) + case 0x0A: LR_A_IS(); break; // LR A, (ISAR) + case 0x0B: LR_IS_A(); break; // LR ISAR, (A) case 0x0C: PK(); break; // LR PC1, (PC0); LR PC0l <- (r13); LR PC0h, (r12) case 0x0D: LR_P0_Q(); break; // LR PC0l, (r15); LR PC0h <- (r14) case 0x0E: LR_Q_DC(); break; // LR r14, (DC0h); r15 <- (DC0l) @@ -99,7 +99,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 case 0x3D: DS_ISAR_INC(); break; // SR <- (SR) + H'FF' (SR pointed to by the ISAR); ISAR incremented case 0x3E: DS_ISAR_DEC(); break; // SR <- (SR) + H'FF' (SR pointed to by the ISAR); ISAR decremented case 0x3F: ILLEGAL(); break; // No instruction - do a NOP - + case 0x40: LR_A_R(0); break; // A <- (SR) case 0x41: LR_A_R(1); break; // A <- (SR) case 0x42: LR_A_R(2); break; // A <- (SR) @@ -185,23 +185,23 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 case 0x8D: CM(); break; // Set status flags on basis of: ((DC)) + (A) + 1; DC0 <- (DC0) + 1; DC <- (DC) + (A) case 0x8E: ADC(); break; // DC <- (DC) + (A) - case 0x8F: BR7(); break; // Branch on ISAR (any of the low 3 bits of ISAR are reset) - // - case 0x90: BF(0); break; // BR - Unconditional branch relative (always) - case 0x91: BF(1); break; // BM - Branch on negative (sign bit is reset) - case 0x92: BF(2); break; // BNC - Branch if no carry (carry bit is reset) - case 0x93: BF(3); break; // BF_CS - Branch on false - negative and no carry - case 0x94: BF(4); break; // BNZ - Branch on not zero (zero bit is reset) - case 0x95: BF(5); break; // BF_ZS - Branch on false - negative and not zero - case 0x96: BF(6); break; // BF_ZC - Branch on false - no carry and not zero - case 0x97: BF(7); break; // BF_ZCS - Branch on false - no carry and not zero and negative - case 0x98: BF(8); break; // BNO - Branch if no overflow (OVF bit is reset) - case 0x99: BF(9); break; // BF_OS - Branch on false - no overflow and negative - case 0x9A: BF(10); break; // BF_OC - Branch on false - no overflow and no carry - case 0x9B: BF(11); break; // BF_OCS - Branch on false - no overflow and no carry and negative - case 0x9C: BF(12); break; // BF_OZ - Branch on false - no overflow and not zero - case 0x9D: BF(13); break; // BF_OZS - Branch on false - no overflow and not zero and negative - case 0x9E: BF(14); break; // BF_OZC - Branch on false - no overflow and not zero and no carry + case 0x8F: BR7(); break; // Branch on ISAR (any of the low 3 bits of ISAR are reset) + // + case 0x90: BF(0); break; // BR - Unconditional branch relative (always) + case 0x91: BF(1); break; // BM - Branch on negative (sign bit is reset) + case 0x92: BF(2); break; // BNC - Branch if no carry (carry bit is reset) + case 0x93: BF(3); break; // BF_CS - Branch on false - negative and no carry + case 0x94: BF(4); break; // BNZ - Branch on not zero (zero bit is reset) + case 0x95: BF(5); break; // BF_ZS - Branch on false - negative and not zero + case 0x96: BF(6); break; // BF_ZC - Branch on false - no carry and not zero + case 0x97: BF(7); break; // BF_ZCS - Branch on false - no carry and not zero and negative + case 0x98: BF(8); break; // BNO - Branch if no overflow (OVF bit is reset) + case 0x99: BF(9); break; // BF_OS - Branch on false - no overflow and negative + case 0x9A: BF(10); break; // BF_OC - Branch on false - no overflow and no carry + case 0x9B: BF(11); break; // BF_OCS - Branch on false - no overflow and no carry and negative + case 0x9C: BF(12); break; // BF_OZ - Branch on false - no overflow and not zero + case 0x9D: BF(13); break; // BF_OZS - Branch on false - no overflow and not zero and negative + case 0x9E: BF(14); break; // BF_OZC - Branch on false - no overflow and not zero and no carry case 0x9F: BF(15); break; // BF_OZCS - Branch on false - no overflow and not zero and no carry and negative case 0xA0: INS_0(0); break; // A <- (I/O Port 0 or 1) diff --git a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Operations.cs b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Operations.cs index 370293ba97..73c5bb10ef 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Operations.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Operations.cs @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 } /// - /// Helper method moving from accumulator to IO pins + /// Helper method moving from accumulator to IO pins /// (complement) /// public void OUT_Func(byte dest, byte src) @@ -117,7 +117,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Binary addition - /// Statuses modified: OVF, ZERO, CARRY, SIGN + /// Statuses modified: OVF, ZERO, CARRY, SIGN /// Statuses unaffected: ICB /// public void ADD_Func(byte dest, byte src, byte src2 = ZERO) @@ -145,19 +145,19 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 // The accumulator and the memory location addressed by the DCO registers are assumed to contain two BCD digits. // The content of the address memory byte is added to the contents of the accumulator to give a BCD result in the accumulator // providing these steps are followed: - // + // // Decimal addition is, in reality, three binary events. Consider 8-bit decimal addition. // Assume two BCD digit augend XY is added to two BCD digit addend l).N, to give a BCD result PQ: // XY // +ZW // -- // =PQ - // + // // Two carries are important: any intermediate carry (IC) out of the low order answer digit (Q), and any overall carry (C) out of the high order digit (P). // The three binary steps required to perform BCD addition are as follows: // STEP 1: Binary add H'66' to the augend. (this should happen before this function is called) - // STEP 2: Binary add the addend to the sum from Step 1. Record the status of the carry (C) and intermediate carry (IC). + // STEP 2: Binary add the addend to the sum from Step 1. Record the status of the carry (C) and intermediate carry (IC). var augend = Regs[dest]; var addend = Regs[src]; @@ -176,15 +176,15 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 FlagZ = (working & 0xFF) == 0; - // STEP 3: Add a factor to the sum from Step 2, based on the status of C and IC. The factor to be added is given by the following table: + // STEP 3: Add a factor to the sum from Step 2, based on the status of C and IC. The factor to be added is given by the following table: // C IC Sum to be added // ------------------------ // 0 0 0xAA // 0 1 0xA0 // 1 0 0x0A // 1 1 0x00 - // - // In Step 3, any carry from the low order digit to the high order digit is suppressed. + // + // In Step 3, any carry from the low order digit to the high order digit is suppressed. if (!highCarry && !lowCarry) { @@ -205,7 +205,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 Regs[dest] = (byte)(working & 0xFF); } - + /// /// Binary add the two's compliment of the accumulator to the value on the databus /// Set flags accordingly but accumlator is not touched @@ -217,7 +217,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 Regs[ALU0] = twosComp; Regs[ALU1] = Regs[DB]; ADD_Func(ALU0, ALU1, ONE); - } + } /// /// Logical AND regs[dest] with regs[src] and store the result in regs[dest] @@ -261,7 +261,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 Regs[dest] = (byte)(Regs[dest] ^ Regs[src]); FlagS = !Regs[dest].Bit(7); - FlagZ = (Regs[dest] & 0xFF) == 0; + FlagZ = (Regs[dest] & 0xFF) == 0; } } } diff --git a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs index ac09149a0c..629988890d 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Registers.cs @@ -124,7 +124,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Status Register - Carry Flag - /// The C bit (W register bit 1) may be visualized as an extension of an 8-bit data unit; i.e., bit 8 of a 9-bit data unit. + /// The C bit (W register bit 1) may be visualized as an extension of an 8-bit data unit; i.e., bit 8 of a 9-bit data unit. /// When two bytes are added and the sum is greater than 255, the carry out of bit 7 appears in the C bit. /// public bool FlagC @@ -135,7 +135,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Status Register - Zero Flag - /// The Z bit (W Register bit 2) is set whenever an arithmetic or logical operation generates a zero result. + /// The Z bit (W Register bit 2) is set whenever an arithmetic or logical operation generates a zero result. /// The Z bit is reset to 0 when an arithmetic or logical operation could have generated a zero result, but did not. /// public bool FlagZ @@ -146,9 +146,9 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Status Register - Overflow Flag - /// The high order Accumulator bit (bit 7) represents the sign of the number. - /// When the Accumulator contents are being interpreted as a signed binary number, some method must be provided for indicating carries out of the highest numeric bit (bit 6 of the Accumulator). - /// This is done using the 0 bit (W register bit 3). After arithmetic operations, the 0 bit is set to the EXCLUSIVE-OR of Carry Out of bits 6 and bits 7. This simplifies signed binary arithmetic. + /// The high order Accumulator bit (bit 7) represents the sign of the number. + /// When the Accumulator contents are being interpreted as a signed binary number, some method must be provided for indicating carries out of the highest numeric bit (bit 6 of the Accumulator). + /// This is done using the 0 bit (W register bit 3). After arithmetic operations, the 0 bit is set to the EXCLUSIVE-OR of Carry Out of bits 6 and bits 7. This simplifies signed binary arithmetic. /// public bool FlagO { @@ -158,7 +158,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Status Register - Interrupt Master Enable Flag - /// External logic can alter the operations sequence within the CPU by interrupting ongoing operations. + /// External logic can alter the operations sequence within the CPU by interrupting ongoing operations. /// However, interrupts are allowed only when t (W register bit 4) is set to 1; interrupts are disallowed when the ICB bit is reset to O. /// public bool FlagICB diff --git a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Tables.cs b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Tables.cs index eefbcfc777..baac4d1b74 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Tables.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.Tables.cs @@ -6,9 +6,9 @@ public sealed partial class F3850 { /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_KU() { @@ -21,9 +21,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_KL() { @@ -36,9 +36,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_QU() { @@ -51,9 +51,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_QL() { @@ -66,9 +66,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_KU_A() { @@ -81,9 +81,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_KL_A() { @@ -96,9 +96,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_QU_A() { @@ -111,9 +111,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_QL_A() { @@ -126,9 +126,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_K_P() { @@ -155,9 +155,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_P_K() { @@ -184,9 +184,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_IS() { @@ -199,9 +199,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_IS_A() { @@ -215,9 +215,9 @@ /// /// PK - CALL TO SUBROUTINE DIRECT AND RETURN FROM SUBROUTINE DIRECT - /// The contents of the Program Counter Registers (PCO) are stored in the Stack Registers (PC1), + /// The contents of the Program Counter Registers (PCO) are stored in the Stack Registers (PC1), /// then the contents of the Scratchpad K Registers (Registers 12 and 13 of scratchpad memory) are transferred into the Program Counter Registers. - /// No status bits are modified. + /// No status bits are modified. /// private void PK() { @@ -244,9 +244,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_P0_Q() { @@ -274,9 +274,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_Q_DC() { @@ -303,9 +303,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_DC_Q() { @@ -332,9 +332,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_DC_H() { @@ -361,9 +361,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_H_DC() { @@ -392,8 +392,8 @@ /// /// SR - SHIFT RIGHT /// The contents of the accumulator are shifted right either one or four bit positions, depending on the value of the SR instruction operand. - /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY + /// Statuses modified: ZERO, SIGN + /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// private void SR(byte index) @@ -408,7 +408,7 @@ /// /// SL - SHIFT LEFT - /// The contents of the accumulator are shifted left either one or four bit positions, depending upon the value of the SL instruction operand. + /// The contents of the accumulator are shifted left either one or four bit positions, depending upon the value of the SL instruction operand. /// Statuses modified: ZERO, SIGN /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB @@ -425,9 +425,9 @@ /// /// LM - LOAD ACCUMULATOR FROM MEMORY - /// The contents of the memory byte addressed by the DCO registers are loaded into the accumulator. + /// The contents of the memory byte addressed by the DCO registers are loaded into the accumulator. /// The contents of the DCO registers are incremented as a resu It of the LM instruction execution. - /// No status bits are modified. + /// No status bits are modified. /// private void LM() { @@ -450,7 +450,7 @@ /// ST - STORE TO MEMORY /// The contents of the accumulator are stored in the memory location addressed by the Data Counter (DCO) registers. /// The DC registers' contents are incremented as a result of the instruction execution. - /// No status bits are modified. + /// No status bits are modified. /// private void ST() { @@ -505,7 +505,7 @@ /// /// DI - DISABLE INTERRUPT /// The interrupt control bit, ICB, is reset; no interrupt requests will be acknowledged by the 3850 CPU - /// Statuses reset: ICB + /// Statuses reset: ICB /// Statuses unaffected: OVF, ZERO, CARRY, SIGN /// private void DI() @@ -526,7 +526,7 @@ /// /// EI - ENABLE INTERRUPT /// The interrupt control bit is set. Interrupt requests will now be acknowledged by the CPU. - /// ICB is set to 1. All other status bits are unaffected. + /// ICB is set to 1. All other status bits are unaffected. /// private void EI() { @@ -565,9 +565,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_W_J() { @@ -586,22 +586,22 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_J_W() { PopulateCURINSTR( // S - OP_LR8, J, W, // r9 <- (W) + OP_LR8, J, W, // r9 <- (W) ROMC_00_S, // DB <- ((PC0)); PC0++ IDLE, END); } /// - /// INC - INCREMENT ACCUMULATOR + /// INC - INCREMENT ACCUMULATOR /// The content of the accumulator is increased by one binary count. /// Statuses modified: OVF, ZERO, CARRY, SIGN /// Statuses unaffected: ICB @@ -610,16 +610,16 @@ { PopulateCURINSTR( // S - OP_INC8, A, ONE, // A <- A + 1 + OP_INC8, A, ONE, // A <- A + 1 ROMC_00_S, // DB <- ((PC0)); PC0++ IDLE, END); } /// - /// LI - LOAD IMMEDIATE - /// The value provided by the operand of the LI instruction is !oaded into the accumuator. - /// No status bits are affected. + /// LI - LOAD IMMEDIATE + /// The value provided by the operand of the LI instruction is !oaded into the accumuator. + /// No status bits are affected. /// private void LI() { @@ -640,11 +640,11 @@ /// /// NI - AND IMMEDIATE - /// An 8-bit value provided by the operand of the NI instruction is ANDed with the contents of the accumulator. - /// The results are stored in the accumulator. + /// An 8-bit value provided by the operand of the NI instruction is ANDed with the contents of the accumulator. + /// The results are stored in the accumulator. /// Statuses reset to 0: OVF, CARRY - /// Statuses modified: ZERO, SIGN - /// Statuses unaffected: ICB + /// Statuses modified: ZERO, SIGN + /// Statuses unaffected: ICB /// private void NI() { @@ -665,10 +665,10 @@ /// /// OI - OR IMMEDIATE - /// An 8-bit value provided by the operand of the 1/0 instruction is ORed with the contents of the accumulator. - /// The results are stored in the accumulator. + /// An 8-bit value provided by the operand of the 1/0 instruction is ORed with the contents of the accumulator. + /// The results are stored in the accumulator. /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY + /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// private void OI() @@ -690,8 +690,8 @@ /// /// XI - EXCLUSIVE-OR IMMEDIATE - /// The contents of the 8-bit value provided by the operand of the XI instruction are EXCLUSIVE-ORed with the contents of the accumulator. - /// The results are stored in the accumulator. + /// The contents of the 8-bit value provided by the operand of the XI instruction are EXCLUSIVE-ORed with the contents of the accumulator. + /// The results are stored in the accumulator. /// Statuses modified: ZERO, SIGN /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB @@ -715,7 +715,7 @@ /// /// AI - ADD IMMEDIATE TO ACCUMULATOR - /// The 8-bit (two hexadecimal digit) value provided by the instruction operand is added to the current contents of the accumulator. + /// The 8-bit (two hexadecimal digit) value provided by the instruction operand is added to the current contents of the accumulator. /// Binary addition is performed. /// Statuses modified: OVF, ZERO, CARRY, SIGN /// Statuses unaffected: ICB @@ -739,7 +739,7 @@ /// /// Compare Immediate - /// The contents of the accumulator are subtracted from the operand of the CI instruction. + /// The contents of the accumulator are subtracted from the operand of the CI instruction. /// The result is not saved but the status bits are set or reset to reflect the results of the operation /// Statuses modified: OVF, ZERO, CARRY, SIGN /// Statuses unaffected: ICB @@ -772,9 +772,9 @@ /// /// IN - INPUT LONG ADDRESS /// The data input to the 1/0 port specified by the operand of the IN instruction is stored in the accumulator. - /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY - /// Statuses unaffected: ICB + /// Statuses modified: ZERO, SIGN + /// Statuses reset: OVF, CARRY + /// Statuses unaffected: ICB /// private void IN() { @@ -787,7 +787,7 @@ IDLE, IDLE, // L - ROMC_1B, // DB <- ((IO)); + ROMC_1B, // DB <- ((IO)); IDLE, IDLE, OP_LR_A_DB_IO, A, DB, // A <- (DB) - flags set as result of IN or INS operation @@ -801,9 +801,9 @@ } /// - /// OUT - OUTPUT LONG ADDRESS - /// The I/O port addressed by the operand of the OUT instruction is loaded with the contents of the accumulator. - /// No status bits are modified. + /// OUT - OUTPUT LONG ADDRESS + /// The I/O port addressed by the operand of the OUT instruction is loaded with the contents of the accumulator. + /// No status bits are modified. /// private void OUT() { @@ -832,10 +832,10 @@ /// /// PI - CALL TO SUBROUTINE IMMEDIATE - /// The contents of the Program Counters are stored in the Stack Registers, PC1, then the 16-bit address contained in the operand of the - /// PI instruction is loaded into the Program Counters.· The accumulator is used as a temporary storage register during transfer of the most significant byte of the address. + /// The contents of the Program Counters are stored in the Stack Registers, PC1, then the 16-bit address contained in the operand of the + /// PI instruction is loaded into the Program Counters.· The accumulator is used as a temporary storage register during transfer of the most significant byte of the address. /// Previous accumulator results will be altered. - /// No status bits are modified. + /// No status bits are modified. /// private void PI() { @@ -876,10 +876,10 @@ /// /// JMP - Branch Immediate - /// As the result of a JMP instruction execution, a branch to the memory location addressed by the second and third bytes of the instruction occurs. - /// The second byte contains the high order eight bits of the memory address; + /// As the result of a JMP instruction execution, a branch to the memory location addressed by the second and third bytes of the instruction occurs. + /// The second byte contains the high order eight bits of the memory address; /// the third byte contains the low order eight bits of the memory address. - /// No status bits are affected. + /// No status bits are affected. /// private void JMP() { @@ -915,9 +915,9 @@ /// /// DCI - LOAD DC IMMEDIATE - /// The DCI instruction is a three-byte instruction. The contents of the second byte replace the high order byte of the DC0 registers; + /// The DCI instruction is a three-byte instruction. The contents of the second byte replace the high order byte of the DC0 registers; /// the contents of the third byte replace the low order byte of the DCO registers. - /// The status bits are not affected. + /// The status bits are not affected. /// private void DCI() { @@ -937,7 +937,7 @@ // L ROMC_0E, // DB <- ((PC0)); DC0l <- (DB) IDLE, - IDLE, + IDLE, IDLE, IDLE, IDLE, @@ -955,7 +955,7 @@ /// /// NOP - NO OPERATION - /// No function is performed. + /// No function is performed. /// No status bits are modified. /// private void NOP() @@ -970,9 +970,9 @@ /// /// XDC - EXCHANGE DATA COUNTERS - /// Execution of the instruction XDC causes the contents of the auxiliary data counter registers (DC1) to be exchanged with the contents of the data counter registers (DCO). + /// Execution of the instruction XDC causes the contents of the auxiliary data counter registers (DC1) to be exchanged with the contents of the data counter registers (DCO). /// This instruction is only significant when a 3852 or 3853 Memory Interface device is part of the system configuration. - /// No status bits are modified. + /// No status bits are modified. /// private void XDC() { @@ -991,7 +991,7 @@ /// /// OS - DECREMENT SCRATCHPAD CONTENT - /// The content of the scratchpad register addressed by the operand (Sreg) is decremented by one binary count. + /// The content of the scratchpad register addressed by the operand (Sreg) is decremented by one binary count. /// The decrement is performed by adding H'FF' to the scratchpad register. /// Statuses modified: OVF, ZERO, CARRY, SIGN /// Statuses unaffected: ICB @@ -1071,9 +1071,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_ISAR() { @@ -1086,10 +1086,10 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. /// ISAR incremented - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_ISAR_INC() { @@ -1102,10 +1102,10 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. /// ISAR deccremented - /// No status bits are modified. + /// No status bits are modified. /// private void LR_A_ISAR_DEC() { @@ -1118,9 +1118,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_R_A(byte rIndex) { @@ -1136,9 +1136,9 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. - /// No status bits are modified. + /// No status bits are modified. /// private void LR_ISAR_A() { @@ -1151,10 +1151,10 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. /// ISAR incremented - /// No status bits are modified. + /// No status bits are modified. /// private void LR_ISAR_A_INC() { @@ -1167,10 +1167,10 @@ } /// - /// LR - LOAD REGISTER + /// LR - LOAD REGISTER /// The LR group of instructions move one or two bytes of data between a source and destination register. /// ISAR decremented - /// No status bits are modified. + /// No status bits are modified. /// private void LR_ISAR_A_DEC() { @@ -1184,8 +1184,8 @@ /// /// LISU - LOAD UPPER OCTAL DIGIT OF ISAR - /// A 3-bit value provided by the LlSU instruction operand is loaded into the three most significant bits of the ISAR. The three least significant bits of the ISAR are not altered. - /// No status bits are affected. + /// A 3-bit value provided by the LlSU instruction operand is loaded into the three most significant bits of the ISAR. The three least significant bits of the ISAR are not altered. + /// No status bits are affected. /// private void LISU(byte octal) { @@ -1200,7 +1200,7 @@ /// /// LlSL - LOAD LOWER OCTAL DIGIT OF ISAR /// A 3-bit value provided by the USL instruction operand is loaded into the three least significant bits of the ISAR. The three most significant bits of the ISAR are not altered. - /// No status bits are modified. + /// No status bits are modified. /// private void LISL(byte octal) { @@ -1213,10 +1213,10 @@ } /// - /// LIS - LOAD IMMEDIATE SHORT - /// A 4-bit value provided by the LIS instruction operand is loaded into the four least significant bits of the accumulator. + /// LIS - LOAD IMMEDIATE SHORT + /// A 4-bit value provided by the LIS instruction operand is loaded into the four least significant bits of the accumulator. /// The most significant four bits of the accumulator are set to "0". - /// No status bits are modified. + /// No status bits are modified. /// private void LIS(byte index) { @@ -1252,14 +1252,14 @@ IDLE, IDLE, OP_BF, bit); - } + } /// - /// AM - ADD (BINARY) MEMORY TO ACCUMULATOR - /// The content of the memory iocation addressed by the DC0 registers is added to the accumulator. The sum is returned in the accumulator. + /// AM - ADD (BINARY) MEMORY TO ACCUMULATOR + /// The content of the memory iocation addressed by the DC0 registers is added to the accumulator. The sum is returned in the accumulator. /// Memory is not altered. Binary addition is performed. The contents of the DCO registers are incremented by 1 /// Statuses modified: OVF, ZERO, CARRY, SIGN - /// Statuses unaffected: ICB + /// Statuses unaffected: ICB /// private void AM() { @@ -1280,11 +1280,11 @@ /// /// AMD - DECIMAL ADD. MEMORY TO ACCUMULATOR - /// The accumulator and the memory location addressed by the DCO registers are assumed to contain two BCD digits. + /// The accumulator and the memory location addressed by the DCO registers are assumed to contain two BCD digits. /// The content of the address memory byte is added to the contents of the accumulator to give a BCD result in the accumulator /// Statuses modified: CARRY, ZERO - /// Statuses not significant: OVF, SIGN - /// Statuses unaffected: ICB + /// Statuses not significant: OVF, SIGN + /// Statuses unaffected: ICB /// private void AMD() { @@ -1305,11 +1305,11 @@ /// /// NM - LOGICAL AND FROM MEMORY - /// The content of memory addressed by the data counter registers is ANDed with the content of the accumulator. - /// The results are stored in the accumulator. The contents of the data counter registers are incremented. - /// Statuses reset to 0: OVF, CARRY - /// Statuses modified: ZERO, SIGN - /// Statuses unaffected: ICB + /// The content of memory addressed by the data counter registers is ANDed with the content of the accumulator. + /// The results are stored in the accumulator. The contents of the data counter registers are incremented. + /// Statuses reset to 0: OVF, CARRY + /// Statuses modified: ZERO, SIGN + /// Statuses unaffected: ICB /// private void NM() { @@ -1330,11 +1330,11 @@ /// /// OM - LOGICAL IIOR" FROM MEMORY - /// The content of memory byte addressed by the data counter registers is ORed with the content of the accumulator. - /// The results are stored in the accumulator. The data counter registers are incremented. + /// The content of memory byte addressed by the data counter registers is ORed with the content of the accumulator. + /// The results are stored in the accumulator. The data counter registers are incremented. /// Statuses modified: ZERO, SIGN /// Statuses reset: OVF, CARRY - /// Statuses unaffected: ICB + /// Statuses unaffected: ICB /// private void OM() { @@ -1355,9 +1355,9 @@ /// /// XM - EXCLUSIVE-OR FROM MEMORY - /// The content of the memory location addressed by the DCO registers is EXCLUSIVE-ORed with the contents of the accumulator. + /// The content of the memory location addressed by the DCO registers is EXCLUSIVE-ORed with the contents of the accumulator. /// The results are stored in the accumulator. The DCO registers are incremented. - /// Statuses modified: ZERO, SIGN + /// Statuses modified: ZERO, SIGN /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// @@ -1379,8 +1379,8 @@ } /// - /// CM - COMPARE MEMORY TO ACCUMULATOR - /// The CM instruction is the same as the CI instruction except the memory contents addressed by the DCO registers, + /// CM - COMPARE MEMORY TO ACCUMULATOR + /// The CM instruction is the same as the CI instruction except the memory contents addressed by the DCO registers, /// instead of an immediate value, are compared to the contents of the accumu lator. /// Statuses modified: OVF, ZERO, CARRY, SIGN /// Statuses unaffected: ICB @@ -1404,7 +1404,7 @@ /// /// ADC - ADD ACCUMULATOR TO DATA COUNTER - /// The contents of the accumulator are treated as a signed binary number, and are added to the contents of every DCO register. + /// The contents of the accumulator are treated as a signed binary number, and are added to the contents of every DCO register. /// The result is stored in the DCO registers. The accumulator contents do not change. /// private void ADC() @@ -1431,12 +1431,12 @@ private void BR7() { PopulateCURINSTR( - OP_BR7); + OP_BR7); } - + /// /// INS - INPUT SHORT ADDRESS - /// Data input to the I/O port specified by the operand of the INS instruction is loaded into the accumulator. + /// Data input to the I/O port specified by the operand of the INS instruction is loaded into the accumulator. /// An I/O port with an address within the range 0 through 1 may be accessed by this instruction /// Statuses modified: ZERO, SIGN /// Statuses reset: OVF, CARRY @@ -1450,7 +1450,7 @@ // S ROMC_1C_S, // Idle OP_IN, ALU0, IO, // A <- ((Port index - 0/1)) - IDLE, + IDLE, OP_LR_A_DB_IO, A, ALU0, // A <- (A) - flags set as result of IN or INS operation // S ROMC_00_S, // DB <- ((PC0)); PC0++ @@ -1461,7 +1461,7 @@ /// /// INS - INPUT SHORT ADDRESS - /// Data input to the I/O port specified by the operand of the INS instruction is loaded into the accumulator. + /// Data input to the I/O port specified by the operand of the INS instruction is loaded into the accumulator. /// An I/O port with an address within the range 4 through 15 may be accessed by this instruction /// Statuses modified: ZERO, SIGN /// Statuses reset: OVF, CARRY @@ -1495,9 +1495,9 @@ /// /// OUTS - OUTPUT SHORT ADDRESS - /// The I/O port addressed by the operand of the OUTS instruction object code is loaded with the contents of the accumulator. + /// The I/O port addressed by the operand of the OUTS instruction object code is loaded with the contents of the accumulator. /// I/O ports with addresses from 0 to 1 may be accessed by this instruction. (Outs O or 1 is CPU port only.) - /// No status bits are modified. + /// No status bits are modified. /// private void OUTS_0(byte index) { @@ -1518,9 +1518,9 @@ /// /// OUTS - OUTPUT SHORT ADDRESS - /// The I/O port addressed by the operand of the OUTS instruction object code is loaded with the contents of the accumulator. + /// The I/O port addressed by the operand of the OUTS instruction object code is loaded with the contents of the accumulator. /// I/O ports with addresses from 3 to 15 may be accessed by this instruction. - /// No status bits are modified. + /// No status bits are modified. /// private void OUTS_1(byte index) { @@ -1551,10 +1551,10 @@ /// /// AS - BINARY ADDITION, SCRATCHPAD MEMORY TO ACCUMULATOR - /// The content of the scratchpad register referenced by the instruction operand (Sreg) is added to the accumulator using binary addition. - /// The result of the binary addition is stored in the accumulator. + /// The content of the scratchpad register referenced by the instruction operand (Sreg) is added to the accumulator using binary addition. + /// The result of the binary addition is stored in the accumulator. /// Statuses modified: OVF, ZERO, CARRY, SIGN - /// Statuses unaffected: ICB + /// Statuses unaffected: ICB /// private void AS(byte rIndex) { @@ -1571,10 +1571,10 @@ /// /// AS - BINARY ADDITION, SCRATCHPAD MEMORY TO ACCUMULATOR - /// The content of the scratchpad register referenced indirectly by ISAR is added to the accumulator using binary addition. - /// The result of the binary addition is stored in the accumulator. + /// The content of the scratchpad register referenced indirectly by ISAR is added to the accumulator using binary addition. + /// The result of the binary addition is stored in the accumulator. /// Statuses modified: OVF, ZERO, CARRY, SIGN - /// Statuses unaffected: ICB + /// Statuses unaffected: ICB /// private void AS_IS() { @@ -1588,11 +1588,11 @@ /// /// AS - BINARY ADDITION, SCRATCHPAD MEMORY TO ACCUMULATOR - /// The content of the scratchpad register referenced indirectly by ISAR is added to the accumulator using binary addition. - /// The result of the binary addition is stored in the accumulator. + /// The content of the scratchpad register referenced indirectly by ISAR is added to the accumulator using binary addition. + /// The result of the binary addition is stored in the accumulator. /// The low order three bits of ISAR are incremented after the scratchpad register is accessed. /// Statuses modified: OVF, ZERO, CARRY, SIGN - /// Statuses unaffected: ICB + /// Statuses unaffected: ICB /// private void AS_IS_INC() { @@ -1606,11 +1606,11 @@ /// /// AS - BINARY ADDITION, SCRATCHPAD MEMORY TO ACCUMULATOR - /// The content of the scratchpad register referenced indirectly by ISAR is added to the accumulator using binary addition. - /// The result of the binary addition is stored in the accumulator. + /// The content of the scratchpad register referenced indirectly by ISAR is added to the accumulator using binary addition. + /// The result of the binary addition is stored in the accumulator. /// The low order three bits of ISAR are decremented after the scratchpad register is accessed. /// Statuses modified: OVF, ZERO, CARRY, SIGN - /// Statuses unaffected: ICB + /// Statuses unaffected: ICB /// private void AS_IS_DEC() { @@ -1624,8 +1624,8 @@ /// /// ASD - DECIMAL ADD, SCRATCHPAD TO ACCUMULATOR - /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, - /// the content of the scratchpad byte addressed by operand (Sreg) is added to the accumulator. + /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, + /// the content of the scratchpad byte addressed by operand (Sreg) is added to the accumulator. /// Statuses modified: CARRY, ZERO /// Statuses not significant: OVF, SIGN /// Statuses unaffected: ICB @@ -1637,7 +1637,7 @@ PopulateCURINSTR( // S - OP_ADD8D, A, rIndex, + OP_ADD8D, A, rIndex, IDLE, ROMC_1C_S, // Idle IDLE, @@ -1650,8 +1650,8 @@ /// /// ASD - DECIMAL ADD, SCRATCHPAD TO ACCUMULATOR - /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, - /// the content of the scratchpad byte referenced indirectly by ISAR is added to the accumulator. + /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, + /// the content of the scratchpad byte referenced indirectly by ISAR is added to the accumulator. /// Statuses modified: CARRY, ZERO /// Statuses not significant: OVF, SIGN /// Statuses unaffected: ICB @@ -1660,7 +1660,7 @@ { PopulateCURINSTR( // S - OP_ADD8D, A, Regs[ISAR], + OP_ADD8D, A, Regs[ISAR], IDLE, ROMC_1C_S, // Idle IDLE, @@ -1673,8 +1673,8 @@ /// /// ASD - DECIMAL ADD, SCRATCHPAD TO ACCUMULATOR - /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, - /// the content of the scratchpad byte referenced indirectly by ISAR is added to the accumulator. + /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, + /// the content of the scratchpad byte referenced indirectly by ISAR is added to the accumulator. /// The low order three bits of ISAR are incremented after the scratchpad register is accessed. /// Statuses modified: CARRY, ZERO /// Statuses not significant: OVF, SIGN @@ -1687,7 +1687,7 @@ OP_ADD8D, A, Regs[ISAR], OP_IS_INC, // Inc ISAR ROMC_1C_S, // Idle - IDLE, + IDLE, // S ROMC_00_S, // DB <- ((PC0)); PC0++ IDLE, @@ -1697,8 +1697,8 @@ /// /// ASD - DECIMAL ADD, SCRATCHPAD TO ACCUMULATOR - /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, - /// the content of the scratchpad byte referenced indirectly by ISAR is added to the accumulator. + /// The ASD instruction is similar to the AMD instruction, except that instead of adding the contents of the memory byte addressed by the DCO registers, + /// the content of the scratchpad byte referenced indirectly by ISAR is added to the accumulator. /// The low order three bits of ISAR are decremented after the scratchpad register is accessed. /// Statuses modified: CARRY, ZERO /// Statuses not significant: OVF, SIGN @@ -1711,7 +1711,7 @@ OP_ADD8D, A, Regs[ISAR], OP_IS_DEC, // Dec ISAR ROMC_1C_S, // Idle - IDLE, + IDLE, // S ROMC_00_S, // DB <- ((PC0)); PC0++ IDLE, @@ -1723,7 +1723,7 @@ /// XS - EXCLUSIVE-OR FROM SCRATCHPAD /// The content of the scratchpad register referenced by the operand (Sreg) is EXCLUSIVE-ORed with the contents of the accumulator. /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY + /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// private void XS(byte rIndex) @@ -1743,7 +1743,7 @@ /// XS - EXCLUSIVE-OR FROM SCRATCHPAD /// The content of the register referenced by ISAR is EXCLUSIVE-ORed with the contents of the accumulator. /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY + /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// private void XS_IS() @@ -1761,7 +1761,7 @@ /// The content of the register referenced by ISAR is EXCLUSIVE-ORed with the contents of the accumulator. /// ISAR is incremented /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY + /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// private void XS_IS_INC() @@ -1779,7 +1779,7 @@ /// The content of the register referenced by ISAR is EXCLUSIVE-ORed with the contents of the accumulator. /// ISAR is deccremented /// Statuses modified: ZERO, SIGN - /// Statuses reset: OVF, CARRY + /// Statuses reset: OVF, CARRY /// Statuses unaffected: ICB /// private void XS_IS_DEC() @@ -1794,8 +1794,8 @@ /// /// NS - LOGICAL AND FROM SCRATCHPAD MEMORY - /// The content of the scratch pad register addressed by the operand (Sreg) is ANDed with the content of the accumulator. - /// The results are stored in the accumulator. + /// The content of the scratch pad register addressed by the operand (Sreg) is ANDed with the content of the accumulator. + /// The results are stored in the accumulator. /// Statuses reset to 0: OVF, CARRY /// Statuses modified: ZERO, SIGN /// Statuses unaffected: ICB @@ -1815,8 +1815,8 @@ /// /// NS - LOGICAL AND FROM SCRATCHPAD MEMORY - /// The content of the scratch pad register addressed by the Register ISAR is pointing at is ANDed with the content of the accumulator. - /// The results are stored in the accumulator. + /// The content of the scratch pad register addressed by the Register ISAR is pointing at is ANDed with the content of the accumulator. + /// The results are stored in the accumulator. /// Statuses reset to 0: OVF, CARRY /// Statuses modified: ZERO, SIGN /// Statuses unaffected: ICB @@ -1833,8 +1833,8 @@ /// /// NS - LOGICAL AND FROM SCRATCHPAD MEMORY - /// The content of the scratch pad register addressed by the Register ISAR is pointing at is ANDed with the content of the accumulator. - /// The results are stored in the accumulator. + /// The content of the scratch pad register addressed by the Register ISAR is pointing at is ANDed with the content of the accumulator. + /// The results are stored in the accumulator. /// ISAR is incremented /// Statuses reset to 0: OVF, CARRY /// Statuses modified: ZERO, SIGN @@ -1852,8 +1852,8 @@ /// /// NS - LOGICAL AND FROM SCRATCHPAD MEMORY - /// The content of the scratch pad register addressed by the Register ISAR is pointing at is ANDed with the content of the accumulator. - /// The results are stored in the accumulator. + /// The content of the scratch pad register addressed by the Register ISAR is pointing at is ANDed with the content of the accumulator. + /// The results are stored in the accumulator. /// ISAR is decremented /// Statuses reset to 0: OVF, CARRY /// Statuses modified: ZERO, SIGN @@ -1884,7 +1884,7 @@ IDLE, IDLE, // S - ROMC_00_S, // DB <- ((PC0)); PC0++ + ROMC_00_S, // DB <- ((PC0)); PC0++ IDLE, IDLE, END); @@ -1903,7 +1903,7 @@ IDLE, IDLE, // S - ROMC_00_S, // DB <- ((PC0)); PC0++ + ROMC_00_S, // DB <- ((PC0)); PC0++ IDLE, IDLE, END); diff --git a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.cs b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.cs index 827185bf97..2f35043291 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/FairchildF8/F3850.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Fairchild F3850 (F8) CPU /// Author: Asnivor - /// + /// /// The F8 microprocessor is made up of separate interchangeable devices /// The Channel F has: /// * x1 F3850 CPU (central processing unit) @@ -18,9 +18,9 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// e.g. SPs and PCs should always be identical /// Each device has a factory ROM mask applied and with every ROMC change observed is able to know whether it should respond (via the shared data bus) /// or not based on the value within its counters. - /// + /// /// For this reason we will hold the PCs and SPs within the F3850 implementation. - /// + /// /// We are currently also *not* using a separate F3851 implementation. In reality the F3851 chip has/does: /// * 1024 byte masked ROM /// * x2 16-bit program counters @@ -97,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 public const byte OP_LISL = 116; public const byte OP_BT = 117; public const byte OP_ADD8D = 118; - public const byte OP_BR7 = 119; + public const byte OP_BR7 = 119; public const byte OP_BF = 141; public const byte OP_IN = 151; @@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 } if (Regs[W] > 0x1F) - { + { } switch (cur_instr[instr_pntr++]) @@ -290,12 +290,12 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 // Branch on ISARL - if any of the low 3 bits of ISAR are reset case OP_BR7: - + if (!Regs[ISAR].Bit(0) || !Regs[ISAR].Bit(1) || !Regs[ISAR].Bit(2)) DO_BRANCH(1); else DONT_BRANCH(1); - break; + break; // Branch on FALSE case OP_BF: @@ -304,8 +304,8 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 else DO_BRANCH(0); break; - - // A <- (I/O Port 0 or 1) + + // A <- (I/O Port 0 or 1) case OP_IN: IN_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++]); break; @@ -586,8 +586,8 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 byte_code.PadRight(12), disasm.PadRight(26)), registerInfo: string.Format( - "Flags:{75}{76}{77}{78}{79} " + - "PC1:{0:X4} DC0:{1:X4} A:{2:X2} ISAR:{3:X2} DB:{4:X2} IO:{5:X2} J:{6:X2} H:{7:X4} K:{8:X4} Q:{9:X4} " + + "Flags:{75}{76}{77}{78}{79} " + + "PC1:{0:X4} DC0:{1:X4} A:{2:X2} ISAR:{3:X2} DB:{4:X2} IO:{5:X2} J:{6:X2} H:{7:X4} K:{8:X4} Q:{9:X4} " + "R0:{10:X2} R1:{11:X2} R2:{12:X2} R3:{13:X2} R4:{14:X2} R5:{15:X2} R6:{16:X2} R7:{17:X2} R8:{18:X2} R9:{19:X2} " + "R10:{20:X2} R11:{21:X2} R12:{22:X2} R13:{23:X2} R14:{24:X2} R15:{25:X2} R16:{26:X2} R17:{27:X2} R18:{28:X2} R19:{29:X2} " + "R20:{30:X2} R21:{31:X2} R22:{32:X2} R23:{33:X2} R24:{34:X2} R25:{35:X2} R26:{36:X2} R27:{37:X2} R28:{38:X2} R29:{39:X2} " + @@ -623,7 +623,7 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8 /// /// Optimization method to set cur_instr - /// + /// private void PopulateCURINSTR(byte d0 = 0, byte d1 = 0, byte d2 = 0, byte d3 = 0, byte d4 = 0, byte d5 = 0, byte d6 = 0, byte d7 = 0, byte d8 = 0, byte d9 = 0, byte d10 = 0, byte d11 = 0, byte d12 = 0, byte d13 = 0, byte d14 = 0, byte d15 = 0, byte d16 = 0, byte d17 = 0, byte d18 = 0, byte d19 = 0, byte d20 = 0, byte d21 = 0, byte d22 = 0, byte d23 = 0, byte d24 = 0, byte d25 = 0, byte d26 = 0, byte d27 = 0, byte d28 = 0, diff --git a/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs b/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs index ce1ab42d21..b5c19378e6 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs @@ -247,7 +247,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280 { if (TimerTickCounter + 5 > 1024) { - // There exists a slight delay between when the timer counter is decremented and when + // There exists a slight delay between when the timer counter is decremented and when // the interrupt fires; games can detect it, so we hack it this way. return (byte)((TimerValue - 1) & 0x7F); } @@ -336,7 +336,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280 uint flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(address, result, flags, "System Bus"); } - + return result; } @@ -399,8 +399,8 @@ namespace BizHawk.Emulation.Cores.Components.H6280 FlagZ ? "Z" : "z", FlagC ? "C" : "c"))); - private static readonly byte[] TableNZ = - { + private static readonly byte[] TableNZ = + { 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs b/src/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs index c9618233cd..183475bbe1 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 { public int LY; // operations that can take place in an instruction - public const ushort IDLE = 0; + public const ushort IDLE = 0; public const ushort OP = 1; public const ushort RD = 2; public const ushort WR = 3; @@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 public const ushort RD_P = 61; public const ushort WR_P = 62; public const ushort EM = 63; - public const ushort DM = 64; + public const ushort DM = 64; public const ushort TEST_COND = 65; public I8048() @@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 Regs[PX + 2] = 0xFF; } - // Memory Access + // Memory Access public Func ReadMemory; public Action WriteMemory; public Func PeekMemory; @@ -325,7 +325,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 Regs[reg_d_ad] = (ushort)((Regs[reg_d_ad] + 1) & 0xFF); break; case RES_TF: - if (test_pass) { TF = false; } + if (test_pass) { TF = false; } break; case SET_ADDR_M3: Regs[ALU] &= 0xFF; @@ -391,7 +391,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 Regs[PSW] = (ushort)((((Regs[PSW] & 0x7) - 1) & 0x7) | (Regs[PSW] & 0xF8)); Regs[PC] = (ushort)(Regs[(Regs[PSW] & 0x7) * 2 + 8] & 0xFF); Regs[PC] |= (ushort)((Regs[(Regs[PSW] & 0x7) * 2 + 8 + 1] & 0xF) << 8); - break; + break; case EEA: EA = true; break; @@ -417,7 +417,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 break; case DM: INT_MSTR = false; - break; + break; case TEST_COND: reg_d_ad = cur_instr[instr_pntr++]; @@ -551,7 +551,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 /// /// Optimization method to set cur_instr - /// + /// private void PopulateCURINSTR(ushort d0 = 0, ushort d1 = 0, ushort d2 = 0, ushort d3 = 0, ushort d4 = 0, ushort d5 = 0, ushort d6 = 0, ushort d7 = 0, ushort d8 = 0, ushort d9 = 0, ushort d10 = 0, ushort d11 = 0, ushort d12 = 0, ushort d13 = 0, ushort d14 = 0, ushort d15 = 0, ushort d16 = 0, ushort d17 = 0, ushort d18 = 0, ushort d19 = 0, ushort d20 = 0, ushort d21 = 0, ushort d22 = 0, ushort d23 = 0, ushort d24 = 0, ushort d25 = 0, ushort d26 = 0) @@ -595,7 +595,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 ser.Sync(nameof(RB), ref RB); ser.Sync(nameof(MB), ref MB); ser.Sync(nameof(Regs), ref Regs, false); - + ser.Sync(nameof(F1), ref F1); ser.Sync(nameof(T0), ref T0); ser.Sync(nameof(T1), ref T1); diff --git a/src/BizHawk.Emulation.Cores/CPUs/Intel8048/OP_Tables.cs b/src/BizHawk.Emulation.Cores/CPUs/Intel8048/OP_Tables.cs index 2edd662926..8c5754757d 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Intel8048/OP_Tables.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Intel8048/OP_Tables.cs @@ -279,7 +279,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 DEA, WR_P, 0, A, IDLE, - IDLE, + IDLE, IDLE, IDLE, IDLE); @@ -345,13 +345,13 @@ namespace BizHawk.Emulation.Cores.Components.I8048 IDLE, IDLE); } - + IRQS = 9; } public void OP_EXP_A(ushort oper, ushort reg) { - // Lower 4 bits only + // Lower 4 bits only PopulateCURINSTR(IDLE, IDLE, IDLE, @@ -367,7 +367,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 public void CALL(ushort dest_h) { - // Lower 4 bits only + // Lower 4 bits only PopulateCURINSTR(IDLE, IDLE, IDLE, @@ -384,7 +384,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 public void DJNZ(ushort reg) { if ((Regs[reg + RB] - 1) == 0) - { + { PopulateCURINSTR(IDLE, IDLE, DEC8, (ushort)(reg + RB), @@ -409,7 +409,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 IDLE, SET_ADDR_8, PC, ALU); } - + IRQS = 9; } diff --git a/src/BizHawk.Emulation.Cores/CPUs/Intel8048/Registers.cs b/src/BizHawk.Emulation.Cores/CPUs/Intel8048/Registers.cs index 45af80c93e..48f569fd50 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Intel8048/Registers.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Intel8048/Registers.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 // EA gets set to true on external memory address latch public bool EA; - + // The 8048 has 2 flags that can be used for conditionals // F0 is on the PSW, F1 is seperate public bool F1; diff --git a/src/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs b/src/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs index 285e552646..e5f8af91c3 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 public sealed partial class LR35902 { // operations that can take place in an instruction - public const ushort IDLE = 0; + public const ushort IDLE = 0; public const ushort OP = 1; public const ushort RD = 2; public const ushort WR = 3; @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 CB_prefix = false; } - // Memory Access + // Memory Access public Func ReadMemory; public Action WriteMemory; public Func PeekMemory; @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 TraceCallback?.Invoke(new(disassembly: "====IRQ====", registerInfo: string.Empty)); - // call interrupt processor + // call interrupt processor // lowest bit set is highest priority instr_pntr = 256 * 60 * 2 + 60 * 6; // point to Interrupt } @@ -448,7 +448,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 { instr_pntr = 256 * 60 * 2 + 60 * 4; // point to spec Halt loop } - } + } } I_use = false; break; @@ -466,7 +466,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 if (stop_time > 0) { // Timer interrupts can prematurely terminate a speedchange, not sure about other sources - // NOTE: some testing around the edge case of where the speed actually changes is needed + // NOTE: some testing around the edge case of where the speed actually changes is needed if (I_use && interrupts_enabled) { interrupts_enabled = false; @@ -480,7 +480,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 TraceCallback?.Invoke(new(disassembly: "====IRQ====", registerInfo: string.Empty)); - // call interrupt processor + // call interrupt processor // lowest bit set is highest priority instr_pntr = 256 * 60 * 2 + 60 * 6; // point to Interrupt break; @@ -517,7 +517,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 break; } } - + // Button press will exit stop loop even if speed change in progress, even without interrupts enabled if ((buttons_pressed & 0xF) != 0xF) { @@ -577,14 +577,14 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 interrupt_enable_reg = GetIntRegs(1); //if (interrupt_src_reg.Bit(bit_check) && interrupt_enable_reg.Bit(bit_check)) { int_src = bit_check; int_clear = (byte)(1 << bit_check); } - + if (interrupt_src_reg.Bit(0) && interrupt_enable_reg.Bit(0)) { int_src = 0; int_clear = 1; } else if (interrupt_src_reg.Bit(1) && interrupt_enable_reg.Bit(1)) { int_src = 1; int_clear = 2; } else if (interrupt_src_reg.Bit(2) && interrupt_enable_reg.Bit(2)) { int_src = 2; int_clear = 4; } else if (interrupt_src_reg.Bit(3) && interrupt_enable_reg.Bit(3)) { int_src = 3; int_clear = 8; } else if (interrupt_src_reg.Bit(4) && interrupt_enable_reg.Bit(4)) { int_src = 4; int_clear = 16; } else { int_src = 5; int_clear = 0; } - + Regs[instr_table[instr_pntr++]] = INT_vectors[int_src]; break; @@ -597,7 +597,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 //Console.WriteLine("Halt_bug_3"); //Console.WriteLine(TotalExecutedCycles); } - + Halt_bug_2 = false; break; case HALT_CHK_2: @@ -640,7 +640,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 break; } - // true condition is what is represented in the instruction vectors + // true condition is what is represented in the instruction vectors // jump ahead if false if (checker) { @@ -683,8 +683,8 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 if (!is_GBC) { skip_once = true; } // If the interrupt flag is not currently set, but it does get set in the first check - // then a bug is triggered - // With interrupts enabled, this runs the halt command twice + // then a bug is triggered + // With interrupts enabled, this runs the halt command twice // when they are disabled, it reads the next byte twice if (!was_FlagI || (was_FlagI && !interrupts_enabled)) { Halt_bug_2 = true; } @@ -741,7 +741,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 private void FetchInstruction(int op) { instr_pntr = 0; - + if (CB_prefix) { instr_pntr += 256 * 60; } instr_pntr += op * 60; diff --git a/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs index 4b9c34a05f..84863fa091 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/LR35902/NewDisassembler.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 // adapted from http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html // and https://rgbds.gbdev.io/docs/gbz80.7 public sealed partial class LR35902 - { + { private static readonly string[] table = { "NOP", // 00 diff --git a/src/BizHawk.Emulation.Cores/CPUs/LR35902/Operations.cs b/src/BizHawk.Emulation.Cores/CPUs/LR35902/Operations.cs index 60e28cfe25..ee11e3e147 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/LR35902/Operations.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/LR35902/Operations.cs @@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 Regs[dest] = ReadMemory(addr); } - // special read for POP AF that always clears the lower 4 bits of F + // special read for POP AF that always clears the lower 4 bits of F public void Read_Func_F(ushort dest, ushort src_l, ushort src_h) { Regs[dest] = (byte)(ReadMemory((ushort)(Regs[src_l] | (Regs[src_h]) << 8)) & 0xF0); @@ -424,7 +424,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 Regs[src] = a_d; - FlagZ = a_d == 0; + FlagZ = a_d == 0; FlagH = false; } @@ -468,7 +468,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 FlagH = Reg16_d.Bit(4); FlagN = false; - FlagZ = false; + FlagZ = false; } Regs[dest_l] = ans_l; diff --git a/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Direct.cs b/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Direct.cs index ed4612d751..97a5370479 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Direct.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Direct.cs @@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 IDLE, RD, W, PCl, PCh, INC16, PCl, PCh, - COND_CHECK, cond, 0, + COND_CHECK, cond, 0, IDLE, ASGN, Z, 0, IDLE, @@ -197,7 +197,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 IDLE, RD, W, PCl, PCh, INC16, PCl, PCh, - IDLE, + IDLE, IDLE, RD, Z, PCl, PCh, INC16, PCl, PCh, @@ -208,10 +208,10 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 IDLE, IDLE, WR, SPl, SPh, PCh, - IDLE, + IDLE, IDLE, DEC16, SPl, SPh, - WR, SPl, SPh, PCl, + WR, SPl, SPh, PCl, TR, PCl, W, TR, PCh, Z, HALT_CHK, @@ -293,7 +293,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 INC16, SPl, SPh, HALT_CHK, OP }; - } + } } private void RST_(ushort n) @@ -303,12 +303,12 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 IDLE, IDLE, DEC16, SPl, SPh, - IDLE, - IDLE, + IDLE, + IDLE, IDLE, WR, SPl, SPh, PCh, DEC16, SPl, SPh, - IDLE, + IDLE, IDLE, WR, SPl, SPh, PCl, ASGN, PCh, 0, diff --git a/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Indirect.cs b/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Indirect.cs index ca6c01559d..3fca42a978 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Indirect.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/LR35902/Tables_Indirect.cs @@ -13,7 +13,7 @@ operation, Z, IDLE, WR, src_l, src_h, Z, - IDLE, + IDLE, IDLE, HALT_CHK, OP }; @@ -24,7 +24,7 @@ cur_instr = new ushort[] {IDLE, IDLE, - IDLE, + IDLE, RD, Z, src_l, src_h, IDLE, operation, bit, Z, @@ -52,8 +52,8 @@ private void REG_OP_IND_INC(ushort operation, ushort dest, ushort src_l, ushort src_h) { cur_instr = new ushort[] - {IDLE, - IDLE, + {IDLE, + IDLE, IDLE, RD, Z, src_l, src_h, operation, dest, Z, @@ -217,7 +217,7 @@ cur_instr = new ushort[] {IDLE, IDLE, - IDLE, + IDLE, RD, Z, src_l, src_h, IDLE, INC8, Z, @@ -234,7 +234,7 @@ cur_instr = new ushort[] {IDLE, IDLE, - IDLE, + IDLE, RD, Z, src_l, src_h, IDLE, DEC8, Z, @@ -250,15 +250,15 @@ private void LD_8_IND_FF(ushort dest, ushort src_l, ushort src_h) { cur_instr = new ushort[] - {IDLE, - IDLE, + {IDLE, + IDLE, IDLE, RD, W, src_l, src_h, INC16, src_l, src_h, IDLE, ASGN, Z , 0xFF, RD, dest, W, Z, - IDLE, + IDLE, IDLE, HALT_CHK, OP }; @@ -275,7 +275,7 @@ IDLE, ASGN, Z , 0xFF, WR, W, Z, src, - IDLE, + IDLE, IDLE, HALT_CHK, OP }; @@ -288,7 +288,7 @@ IDLE, ASGN, Z , 0xFF, RD, dest, C, Z, - IDLE, + IDLE, IDLE, HALT_CHK, OP }; @@ -301,7 +301,7 @@ IDLE, ASGN, Z , 0xFF, WR, C, Z, src, - IDLE, + IDLE, IDLE, HALT_CHK, OP }; diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6800/Disassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6800/Disassembler.cs index 841cbf8f9e..ad236c94ef 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6800/Disassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6800/Disassembler.cs @@ -297,7 +297,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 byte d = reader(addr++); ret.AppendFormat("{0:X2} ", d); result = result.Replace("ix16", "X + " + "ea"); - result = result.Replace("ea", string.Format("{0:N}h", d)); + result = result.Replace("ea", string.Format("{0:N}h", d)); } // else noop while (ret.Length < 22) diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs index 15ff5e1012..d69bfacb1b 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 public sealed partial class MC6800 { // operations that can take place in an instruction - public const ushort IDLE = 0; + public const ushort IDLE = 0; public const ushort OP = 1; public const ushort RD = 2; public const ushort WR = 3; @@ -92,7 +92,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 instr_pntr = irq_pntr = 0; } - // Memory Access + // Memory Access public Func ReadMemory; public Action WriteMemory; @@ -518,7 +518,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 /// /// Optimization method to set cur_instr - /// + /// private void PopulateCURINSTR(ushort d0 = 0, ushort d1 = 0, ushort d2 = 0, ushort d3 = 0, ushort d4 = 0, ushort d5 = 0, ushort d6 = 0, ushort d7 = 0, ushort d8 = 0, ushort d9 = 0, ushort d10 = 0, ushort d11 = 0, ushort d12 = 0, ushort d13 = 0, ushort d14 = 0, ushort d15 = 0, ushort d16 = 0, ushort d17 = 0, ushort d18 = 0, ushort d19 = 0, ushort d20 = 0, ushort d21 = 0, ushort d22 = 0, ushort d23 = 0, ushort d24 = 0, ushort d25 = 0, ushort d26 = 0, ushort d27 = 0, ushort d28 = 0, diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6800/OP_Tables.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6800/OP_Tables.cs index 177e8a7257..660396419c 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6800/OP_Tables.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6800/OP_Tables.cs @@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 private void DIRECT_MEM_4(ushort oper, ushort dest) { PopulateCURINSTR(RD_INC_OP, ALU, PC, SET_ADDR, ADDR, DP, ALU, - IDLE, + IDLE, RD_INC_OP, ALU, ADDR, oper, dest, ALU); IRQS = 3; @@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 { PopulateCURINSTR(RD_INC_OP, ALU, PC, SET_ADDR, ADDR, DP, ALU, IDLE, - WR_HI_INC, ADDR, src, + WR_HI_INC, ADDR, src, WR_DEC_LO, ADDR, src); IRQS = 4; @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 private void EXT_OP_ST_16(ushort src) { PopulateCURINSTR(RD_INC, ALU, PC, - RD_INC, ALU2, PC, + RD_INC, ALU2, PC, SET_ADDR, ADDR, ALU, ALU2, WR_HI_INC, ADDR, src, WR_DEC_LO, ADDR, src); @@ -197,7 +197,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 private void JSR_EXT() { PopulateCURINSTR(RD_INC, ALU, PC, - RD_INC, ALU2, PC, + RD_INC, ALU2, PC, SET_ADDR, ADDR, ALU, ALU2, TR, ALU, PC, IDLE, @@ -258,7 +258,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 RD_INC, ALU, SP, RD_INC_OP, ALU2, SP, SET_ADDR, X, ALU, ALU2, RD_INC, ALU, SP, - RD, ALU2, SP, + RD, ALU2, SP, SET_ADDR, PC, ALU, ALU2); IRQS = 9; diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6809/Disassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6809/Disassembler.cs index 218e94d901..016aab8e7c 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6809/Disassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6809/Disassembler.cs @@ -1002,7 +1002,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 break; } } - } + } } // else noop diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6809/Indexed_Modes.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6809/Indexed_Modes.cs index 5ccfc3acd4..eae13fbb2a 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6809/Indexed_Modes.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6809/Indexed_Modes.cs @@ -234,7 +234,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 case 0x5: Regs[ADDR] = (ushort)(Regs[indexed_reg] + (((Regs[B] & 0x80) == 0x80) ? (Regs[B] | 0xFF00) : Regs[B])); PopulateCURINSTR(RD_INC, ALU, ADDR, - RD_INC, ALU2, ADDR, + RD_INC, ALU2, ADDR, SET_ADDR, IDX_EA, ALU, ALU2, IDX_OP_BLD); break; @@ -310,7 +310,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 RD_INC_OP, ALU2, ADDR, SET_ADDR, IDX_EA, ALU, ALU2, IDX_OP_BLD); } - else + else { // illegal } diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs index 1059e1c3e6..ee62485f0d 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 public sealed partial class MC6809 { // operations that can take place in an instruction - public const ushort IDLE = 0; + public const ushort IDLE = 0; public const ushort OP = 1; public const ushort RD = 2; public const ushort WR = 3; @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 public const ushort CLR = 35; public const ushort OP_PG_2 = 36; public const ushort OP_PG_3 = 37; - public const ushort SEX = 38; + public const ushort SEX = 38; public const ushort EXG = 39; public const ushort TFR = 40; public const ushort ADD8BR = 41; @@ -101,7 +101,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 instr_pntr = irq_pntr = 0; } - // Memory Access + // Memory Access public Func ReadMemory; public Action WriteMemory; @@ -580,7 +580,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 instr_pntr = irq_pntr = 0; PopulateCURINSTR(SYNC); } - + break; } @@ -661,7 +661,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 /// /// Optimization method to set cur_instr - /// + /// private void PopulateCURINSTR(ushort d0 = 0, ushort d1 = 0, ushort d2 = 0, ushort d3 = 0, ushort d4 = 0, ushort d5 = 0, ushort d6 = 0, ushort d7 = 0, ushort d8 = 0, ushort d9 = 0, ushort d10 = 0, ushort d11 = 0, ushort d12 = 0, ushort d13 = 0, ushort d14 = 0, ushort d15 = 0, ushort d16 = 0, ushort d17 = 0, ushort d18 = 0, ushort d19 = 0, ushort d20 = 0, ushort d21 = 0, ushort d22 = 0, ushort d23 = 0, ushort d24 = 0, ushort d25 = 0, ushort d26 = 0, ushort d27 = 0, ushort d28 = 0, diff --git a/src/BizHawk.Emulation.Cores/CPUs/MC6809/OP_Tables.cs b/src/BizHawk.Emulation.Cores/CPUs/MC6809/OP_Tables.cs index 519758f904..7d188da577 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MC6809/OP_Tables.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MC6809/OP_Tables.cs @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 private void DIRECT_MEM_4(ushort oper, ushort dest) { PopulateCURINSTR(RD_INC_OP, ALU, PC, SET_ADDR, ADDR, DP, ALU, - IDLE, + IDLE, RD_INC_OP, ALU, ADDR, oper, dest, ALU); IRQS = 3; @@ -127,7 +127,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 { PopulateCURINSTR(RD_INC_OP, ALU, PC, SET_ADDR, ADDR, DP, ALU, RD_INC, ALU, ADDR, - RD, ALU2, ADDR, + RD, ALU2, ADDR, SET_ADDR, ADDR, ALU, ALU2, oper, ADDR); @@ -216,7 +216,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 { PopulateCURINSTR(RD_INC_OP, ALU, PC, SET_ADDR, ADDR, DP, ALU, ST_16, src, - WR_HI_INC, ADDR, src, + WR_HI_INC, ADDR, src, WR_DEC_LO, ADDR, src); IRQS = 4; @@ -362,7 +362,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 SET_ADDR, ADDR, ALU, ALU2); IRQS = 3; - } + } } private void BR_(bool cond) @@ -509,7 +509,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 PopulateCURINSTR(WR_DEC_LO, src, US, WR_DEC_HI_OP, src, US, PSH_n, src); } - + Regs[ALU] &= 0x3F; } else if (Regs[ALU].Bit(5)) diff --git a/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs b/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs index 381c0ded21..b964d8080f 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs @@ -467,7 +467,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 End_SuppressInterrupt, Jam, - + // More unofficial micro-ops Imm_ANE, AbsIdx_WRITE_Stage5_SHA, @@ -484,7 +484,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 // Unsupported,Fetch1, Fetch1_Real, Fetch2, Fetch3,FetchDummy, // NOP,JSR,IncPC, // Abs_WRITE_STA, Abs_WRITE_STX, Abs_WRITE_STY,Abs_WRITE_SAX,Abs_READ_BIT, Abs_READ_LDA, Abs_READ_LDY, Abs_READ_ORA, Abs_READ_LDX, Abs_READ_CMP, Abs_READ_ADC, Abs_READ_CPX, Abs_READ_SBC, Abs_READ_AND, Abs_READ_EOR, Abs_READ_CPY, Abs_READ_NOP, - // Abs_READ_LAX,Abs_RMW_Stage4, Abs_RMW_Stage6,Abs_RMW_Stage5_INC, Abs_RMW_Stage5_DEC, Abs_RMW_Stage5_LSR, Abs_RMW_Stage5_ROL, Abs_RMW_Stage5_ASL, Abs_RMW_Stage5_ROR,Abs_RMW_Stage5_SLO, Abs_RMW_Stage5_RLA, Abs_RMW_Stage5_SRE, Abs_RMW_Stage5_RRA, Abs_RMW_Stage5_DCP, Abs_RMW_Stage5_ISC, + // Abs_READ_LAX,Abs_RMW_Stage4, Abs_RMW_Stage6,Abs_RMW_Stage5_INC, Abs_RMW_Stage5_DEC, Abs_RMW_Stage5_LSR, Abs_RMW_Stage5_ROL, Abs_RMW_Stage5_ASL, Abs_RMW_Stage5_ROR,Abs_RMW_Stage5_SLO, Abs_RMW_Stage5_RLA, Abs_RMW_Stage5_SRE, Abs_RMW_Stage5_RRA, Abs_RMW_Stage5_DCP, Abs_RMW_Stage5_ISC, // JMP_abs,ZpIdx_Stage3_X, ZpIdx_Stage3_Y,ZpIdx_RMW_Stage4, ZpIdx_RMW_Stage6,ZP_WRITE_STA, ZP_WRITE_STX, ZP_WRITE_STY, ZP_WRITE_SAX,ZP_RMW_Stage3, ZP_RMW_Stage5, // ZP_RMW_DEC, ZP_RMW_INC, ZP_RMW_ASL, ZP_RMW_LSR, ZP_RMW_ROR, ZP_RMW_ROL,ZP_RMW_SLO, ZP_RMW_RLA, ZP_RMW_SRE, ZP_RMW_RRA, ZP_RMW_DCP, ZP_RMW_ISC, // ZP_READ_EOR, ZP_READ_BIT, ZP_READ_ORA, ZP_READ_LDA, ZP_READ_LDY, ZP_READ_LDX, ZP_READ_CPX, ZP_READ_SBC, ZP_READ_CPY, ZP_READ_NOP, ZP_READ_ADC, ZP_READ_AND, ZP_READ_CMP, ZP_READ_LAX, @@ -590,7 +590,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 mi = 0; opcode = VOP_Fetch1_NoInterrupt; - Fetch1_Real(); + Fetch1_Real(); } private void Fetch1_Real() @@ -997,7 +997,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 _link.ReadMemory((ushort)ea); if (alu_temp.Bit(8)) ea = (ushort)(ea + 0x100); - + } } @@ -1009,7 +1009,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 private void IndIdx_WRITE_Stage6_SHA() { alu_temp = A & X; - + if (RDY) { alu_temp &= unchecked((byte) ((ea >> 8) + 1)); @@ -1737,7 +1737,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 FlagV = ((A ^ next) & 0x40) != 0; FlagN = FlagC; FlagZ = (next & 0xFF) == 0; - + // BCD fixup if ((A & 0x0F) + (A & 0x01) > 0x05) { @@ -1784,7 +1784,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 { //there is some debate about what this should be. it may depend on the 6502 variant. //this is suggested by qeed's doc for the nes and passes blargg's instruction test - A |= LxaConstant; + A |= LxaConstant; A &= (byte)alu_temp; X = A; NZ_A(); @@ -2559,7 +2559,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 private void AbsIdx_WRITE_Stage5_SHY() { alu_temp = Y; - + if (RDY) { alu_temp &= unchecked((byte)((ea >> 8) + 1)); @@ -2571,7 +2571,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 private void AbsIdx_WRITE_Stage5_SHX() { alu_temp = X; - + if (RDY) { alu_temp &= unchecked((byte)((ea >> 8) + 1)); diff --git a/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs b/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs index 983dedab51..71bf48b041 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs @@ -265,8 +265,8 @@ namespace BizHawk.Emulation.Cores.Components.M6502 FlagV = true; } - private static readonly byte[] TableNZ = - { + private static readonly byte[] TableNZ = + { 0x02, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/BizHawk.Emulation.Cores/CPUs/W65816/Disassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/W65816/Disassembler.cs index 203fb7b8d7..6f3f3c55bf 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/W65816/Disassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/W65816/Disassembler.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816 public string Cpu { get; set; } private readonly W65816 disassemblerCpu = new W65816(); - + public IEnumerable AvailableCpus { get; } = [ "W65816" ]; public string PCRegisterName => "PC"; @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816 ibuf = "asl"; break; case 0x90: ibuf = "bcc"; break; - case 0xB0: + case 0xB0: ibuf = "bcs"; break; case 0xF0: ibuf = "beq"; break; @@ -70,7 +70,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816 ibuf = "brl"; break; case 0x89:case 0x2C:case 0x24:case 0x3C:case 0x34: ibuf = "bit"; break; - case 0x00: + case 0x00: ibuf = "brk"; break; case 0x18: ibuf = "clc"; break; @@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816 ibuf = "cpy"; break; case 0x3A:case 0xCE:case 0xC6:case 0xDE:case 0xD6: ibuf = "dec"; break; - case 0xCA: + case 0xCA: ibuf = "dex"; break; case 0x88: ibuf = "dey"; break; diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Execute.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Execute.cs index 0c1779ffbb..37110f9070 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Execute.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Execute.cs @@ -1356,7 +1356,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A case 0xA1: I_BIT_OP(RES, 4, C); break; // RES 4, (I* + n) -> C case 0xA2: I_BIT_OP(RES, 4, D); break; // RES 4, (I* + n) -> D case 0xA3: I_BIT_OP(RES, 4, E); break; // RES 4, (I* + n) -> E - case 0xA4: I_BIT_OP(RES, 4, H); break; // RES 4, (I* + n) -> H + case 0xA4: I_BIT_OP(RES, 4, H); break; // RES 4, (I* + n) -> H case 0xA5: I_BIT_OP(RES, 4, L); break; // RES 4, (I* + n) -> L case 0xA6: I_BIT_OP(RES, 4, ALU); break; // RES 4, (I* + n) case 0xA7: I_BIT_OP(RES, 4, A); break; // RES 4, (I* + n) -> A diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs index 66e162d3e4..187d37bc77 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A // Otherwise operation just continues as normal // For now assume a NOP is on the data bus, in which case no stack operations occur - //NOTE: TODO: When a CALL is present on the data bus, adjust WZ accordingly + //NOTE: TODO: When a CALL is present on the data bus, adjust WZ accordingly private void INTERRUPT_0(ushort src) { PopulateCURINSTR diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs index 1a701b8bb5..0bbc111d20 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs @@ -213,79 +213,79 @@ namespace BizHawk.Emulation.Cores.Components.Z80A private static readonly string[] mnemonicsDDCB = [ - "RLC (IX+d)->B", "RLC (IX+d)->C", "RLC (IX+d)->D", "RLC (IX+d)->E", "RLC (IX+d)->H", "RLC (IX+d)->L", "RLC (IX+d)", "RLC (IX+d)->A", - "RRC (IX+d)->B", "RRC (IX+d)->C", "RRC (IX+d)->D", "RRC (IX+d)->E", "RRC (IX+d)->H", "RRC (IX+d)->L", "RRC (IX+d)", "RRC (IX+d)->A", - "RL (IX+d)->B", "RL (IX+d)->C", "RL (IX+d)->D", "RL (IX+d)->E", "RL (IX+d)->H", "RL (IX+d)->L", "RL (IX+d)", "RL (IX+d)->A", - "RR (IX+d)->B", "RR (IX+d)->C", "RR (IX+d)->D", "RR (IX+d)->E", "RR (IX+d)->H", "RR (IX+d)->L", "RR (IX+d)", "RR (IX+d)->A", - "SLA (IX+d)->B", "SLA (IX+d)->C", "SLA (IX+d)->D", "SLA (IX+d)->E", "SLA (IX+d)->H", "SLA (IX+d)->L", "SLA (IX+d)", "SLA (IX+d)->A", - "SRA (IX+d)->B", "SRA (IX+d)->C", "SRA (IX+d)->D", "SRA (IX+d)->E", "SRA (IX+d)->H", "SRA (IX+d)->L", "SRA (IX+d)", "SRA (IX+d)->A", - "SL1 (IX+d)->B", "SL1 (IX+d)->C", "SL1 (IX+d)->D", "SL1 (IX+d)->E", "SL1 (IX+d)->H", "SL1 (IX+d)->L", "SL1 (IX+d)", "SL1 (IX+d)->A", - "SRL (IX+d)->B", "SRL (IX+d)->C", "SRL (IX+d)->D", "SRL (IX+d)->E", "SRL (IX+d)->H", "SRL (IX+d)->L", "SRL (IX+d)", "SRL (IX+d)->A", - "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", - "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", - "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", - "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", - "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", - "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", - "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", - "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", - "RES 0 (IX+d)->B", "RES 0 (IX+d)->C", "RES 0 (IX+d)->D", "RES 0 (IX+d)->E", "RES 0 (IX+d)->H", "RES 0 (IX+d)->L", "RES 0 (IX+d)", "RES 0 (IX+d)->A", - "RES 1 (IX+d)->B", "RES 1 (IX+d)->C", "RES 1 (IX+d)->D", "RES 1 (IX+d)->E", "RES 1 (IX+d)->H", "RES 1 (IX+d)->L", "RES 1 (IX+d)", "RES 1 (IX+d)->A", - "RES 2 (IX+d)->B", "RES 2 (IX+d)->C", "RES 2 (IX+d)->D", "RES 2 (IX+d)->E", "RES 2 (IX+d)->H", "RES 2 (IX+d)->L", "RES 2 (IX+d)", "RES 2 (IX+d)->A", - "RES 3 (IX+d)->B", "RES 3 (IX+d)->C", "RES 3 (IX+d)->D", "RES 3 (IX+d)->E", "RES 3 (IX+d)->H", "RES 3 (IX+d)->L", "RES 3 (IX+d)", "RES 3 (IX+d)->A", - "RES 4 (IX+d)->B", "RES 4 (IX+d)->C", "RES 4 (IX+d)->D", "RES 4 (IX+d)->E", "RES 4 (IX+d)->H", "RES 4 (IX+d)->L", "RES 4 (IX+d)", "RES 4 (IX+d)->A", - "RES 5 (IX+d)->B", "RES 5 (IX+d)->C", "RES 5 (IX+d)->D", "RES 5 (IX+d)->E", "RES 5 (IX+d)->H", "RES 5 (IX+d)->L", "RES 5 (IX+d)", "RES 5 (IX+d)->A", - "RES 6 (IX+d)->B", "RES 6 (IX+d)->C", "RES 6 (IX+d)->D", "RES 6 (IX+d)->E", "RES 6 (IX+d)->H", "RES 6 (IX+d)->L", "RES 6 (IX+d)", "RES 6 (IX+d)->A", - "RES 7 (IX+d)->B", "RES 7 (IX+d)->C", "RES 7 (IX+d)->D", "RES 7 (IX+d)->E", "RES 7 (IX+d)->H", "RES 7 (IX+d)->L", "RES 7 (IX+d)", "RES 7 (IX+d)->A", - "SET 0 (IX+d)->B", "SET 0 (IX+d)->C", "SET 0 (IX+d)->D", "SET 0 (IX+d)->E", "SET 0 (IX+d)->H", "SET 0 (IX+d)->L", "SET 0 (IX+d)", "SET 0 (IX+d)->A", - "SET 1 (IX+d)->B", "SET 1 (IX+d)->C", "SET 1 (IX+d)->D", "SET 1 (IX+d)->E", "SET 1 (IX+d)->H", "SET 1 (IX+d)->L", "SET 1 (IX+d)", "SET 1 (IX+d)->A", - "SET 2 (IX+d)->B", "SET 2 (IX+d)->C", "SET 2 (IX+d)->D", "SET 2 (IX+d)->E", "SET 2 (IX+d)->H", "SET 2 (IX+d)->L", "SET 2 (IX+d)", "SET 2 (IX+d)->A", - "SET 3 (IX+d)->B", "SET 3 (IX+d)->C", "SET 3 (IX+d)->D", "SET 3 (IX+d)->E", "SET 3 (IX+d)->H", "SET 3 (IX+d)->L", "SET 3 (IX+d)", "SET 3 (IX+d)->A", - "SET 4 (IX+d)->B", "SET 4 (IX+d)->C", "SET 4 (IX+d)->D", "SET 4 (IX+d)->E", "SET 4 (IX+d)->H", "SET 4 (IX+d)->L", "SET 4 (IX+d)", "SET 4 (IX+d)->A", - "SET 5 (IX+d)->B", "SET 5 (IX+d)->C", "SET 5 (IX+d)->D", "SET 5 (IX+d)->E", "SET 5 (IX+d)->H", "SET 5 (IX+d)->L", "SET 5 (IX+d)", "SET 5 (IX+d)->A", - "SET 6 (IX+d)->B", "SET 6 (IX+d)->C", "SET 6 (IX+d)->D", "SET 6 (IX+d)->E", "SET 6 (IX+d)->H", "SET 6 (IX+d)->L", "SET 6 (IX+d)", "SET 6 (IX+d)->A", - "SET 7 (IX+d)->B", "SET 7 (IX+d)->C", "SET 7 (IX+d)->D", "SET 7 (IX+d)->E", "SET 7 (IX+d)->H", "SET 7 (IX+d)->L", "SET 7 (IX+d)", "SET 7 (IX+d)->A", + "RLC (IX+d)->B", "RLC (IX+d)->C", "RLC (IX+d)->D", "RLC (IX+d)->E", "RLC (IX+d)->H", "RLC (IX+d)->L", "RLC (IX+d)", "RLC (IX+d)->A", + "RRC (IX+d)->B", "RRC (IX+d)->C", "RRC (IX+d)->D", "RRC (IX+d)->E", "RRC (IX+d)->H", "RRC (IX+d)->L", "RRC (IX+d)", "RRC (IX+d)->A", + "RL (IX+d)->B", "RL (IX+d)->C", "RL (IX+d)->D", "RL (IX+d)->E", "RL (IX+d)->H", "RL (IX+d)->L", "RL (IX+d)", "RL (IX+d)->A", + "RR (IX+d)->B", "RR (IX+d)->C", "RR (IX+d)->D", "RR (IX+d)->E", "RR (IX+d)->H", "RR (IX+d)->L", "RR (IX+d)", "RR (IX+d)->A", + "SLA (IX+d)->B", "SLA (IX+d)->C", "SLA (IX+d)->D", "SLA (IX+d)->E", "SLA (IX+d)->H", "SLA (IX+d)->L", "SLA (IX+d)", "SLA (IX+d)->A", + "SRA (IX+d)->B", "SRA (IX+d)->C", "SRA (IX+d)->D", "SRA (IX+d)->E", "SRA (IX+d)->H", "SRA (IX+d)->L", "SRA (IX+d)", "SRA (IX+d)->A", + "SL1 (IX+d)->B", "SL1 (IX+d)->C", "SL1 (IX+d)->D", "SL1 (IX+d)->E", "SL1 (IX+d)->H", "SL1 (IX+d)->L", "SL1 (IX+d)", "SL1 (IX+d)->A", + "SRL (IX+d)->B", "SRL (IX+d)->C", "SRL (IX+d)->D", "SRL (IX+d)->E", "SRL (IX+d)->H", "SRL (IX+d)->L", "SRL (IX+d)", "SRL (IX+d)->A", + "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", "BIT 0, (IX+d)", + "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", "BIT 1, (IX+d)", + "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", "BIT 2, (IX+d)", + "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", "BIT 3, (IX+d)", + "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", "BIT 4, (IX+d)", + "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", "BIT 5, (IX+d)", + "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", "BIT 6, (IX+d)", + "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", "BIT 7, (IX+d)", + "RES 0 (IX+d)->B", "RES 0 (IX+d)->C", "RES 0 (IX+d)->D", "RES 0 (IX+d)->E", "RES 0 (IX+d)->H", "RES 0 (IX+d)->L", "RES 0 (IX+d)", "RES 0 (IX+d)->A", + "RES 1 (IX+d)->B", "RES 1 (IX+d)->C", "RES 1 (IX+d)->D", "RES 1 (IX+d)->E", "RES 1 (IX+d)->H", "RES 1 (IX+d)->L", "RES 1 (IX+d)", "RES 1 (IX+d)->A", + "RES 2 (IX+d)->B", "RES 2 (IX+d)->C", "RES 2 (IX+d)->D", "RES 2 (IX+d)->E", "RES 2 (IX+d)->H", "RES 2 (IX+d)->L", "RES 2 (IX+d)", "RES 2 (IX+d)->A", + "RES 3 (IX+d)->B", "RES 3 (IX+d)->C", "RES 3 (IX+d)->D", "RES 3 (IX+d)->E", "RES 3 (IX+d)->H", "RES 3 (IX+d)->L", "RES 3 (IX+d)", "RES 3 (IX+d)->A", + "RES 4 (IX+d)->B", "RES 4 (IX+d)->C", "RES 4 (IX+d)->D", "RES 4 (IX+d)->E", "RES 4 (IX+d)->H", "RES 4 (IX+d)->L", "RES 4 (IX+d)", "RES 4 (IX+d)->A", + "RES 5 (IX+d)->B", "RES 5 (IX+d)->C", "RES 5 (IX+d)->D", "RES 5 (IX+d)->E", "RES 5 (IX+d)->H", "RES 5 (IX+d)->L", "RES 5 (IX+d)", "RES 5 (IX+d)->A", + "RES 6 (IX+d)->B", "RES 6 (IX+d)->C", "RES 6 (IX+d)->D", "RES 6 (IX+d)->E", "RES 6 (IX+d)->H", "RES 6 (IX+d)->L", "RES 6 (IX+d)", "RES 6 (IX+d)->A", + "RES 7 (IX+d)->B", "RES 7 (IX+d)->C", "RES 7 (IX+d)->D", "RES 7 (IX+d)->E", "RES 7 (IX+d)->H", "RES 7 (IX+d)->L", "RES 7 (IX+d)", "RES 7 (IX+d)->A", + "SET 0 (IX+d)->B", "SET 0 (IX+d)->C", "SET 0 (IX+d)->D", "SET 0 (IX+d)->E", "SET 0 (IX+d)->H", "SET 0 (IX+d)->L", "SET 0 (IX+d)", "SET 0 (IX+d)->A", + "SET 1 (IX+d)->B", "SET 1 (IX+d)->C", "SET 1 (IX+d)->D", "SET 1 (IX+d)->E", "SET 1 (IX+d)->H", "SET 1 (IX+d)->L", "SET 1 (IX+d)", "SET 1 (IX+d)->A", + "SET 2 (IX+d)->B", "SET 2 (IX+d)->C", "SET 2 (IX+d)->D", "SET 2 (IX+d)->E", "SET 2 (IX+d)->H", "SET 2 (IX+d)->L", "SET 2 (IX+d)", "SET 2 (IX+d)->A", + "SET 3 (IX+d)->B", "SET 3 (IX+d)->C", "SET 3 (IX+d)->D", "SET 3 (IX+d)->E", "SET 3 (IX+d)->H", "SET 3 (IX+d)->L", "SET 3 (IX+d)", "SET 3 (IX+d)->A", + "SET 4 (IX+d)->B", "SET 4 (IX+d)->C", "SET 4 (IX+d)->D", "SET 4 (IX+d)->E", "SET 4 (IX+d)->H", "SET 4 (IX+d)->L", "SET 4 (IX+d)", "SET 4 (IX+d)->A", + "SET 5 (IX+d)->B", "SET 5 (IX+d)->C", "SET 5 (IX+d)->D", "SET 5 (IX+d)->E", "SET 5 (IX+d)->H", "SET 5 (IX+d)->L", "SET 5 (IX+d)", "SET 5 (IX+d)->A", + "SET 6 (IX+d)->B", "SET 6 (IX+d)->C", "SET 6 (IX+d)->D", "SET 6 (IX+d)->E", "SET 6 (IX+d)->H", "SET 6 (IX+d)->L", "SET 6 (IX+d)", "SET 6 (IX+d)->A", + "SET 7 (IX+d)->B", "SET 7 (IX+d)->C", "SET 7 (IX+d)->D", "SET 7 (IX+d)->E", "SET 7 (IX+d)->H", "SET 7 (IX+d)->L", "SET 7 (IX+d)", "SET 7 (IX+d)->A", ]; private static readonly string[] mnemonicsFDCB = [ - "RLC (IY+d)->B", "RLC (IY+d)->C", "RLC (IY+d)->D", "RLC (IY+d)->E", "RLC (IY+d)->H", "RLC (IY+d)->L", "RLC (IY+d)", "RLC (IY+d)->A", - "RRC (IY+d)->B", "RRC (IY+d)->C", "RRC (IY+d)->D", "RRC (IY+d)->E", "RRC (IY+d)->H", "RRC (IY+d)->L", "RRC (IY+d)", "RRC (IY+d)->A", - "RL (IY+d)->B", "RL (IY+d)->C", "RL (IY+d)->D", "RL (IY+d)->E", "RL (IY+d)->H", "RL (IY+d)->L", "RL (IY+d)", "RL (IY+d)->A", - "RR (IY+d)->B", "RR (IY+d)->C", "RR (IY+d)->D", "RR (IY+d)->E", "RR (IY+d)->H", "RR (IY+d)->L", "RR (IY+d)", "RR (IY+d)->A", - "SLA (IY+d)->B", "SLA (IY+d)->C", "SLA (IY+d)->D", "SLA (IY+d)->E", "SLA (IY+d)->H", "SLA (IY+d)->L", "SLA (IY+d)", "SLA (IY+d)->A", - "SRA (IY+d)->B", "SRA (IY+d)->C", "SRA (IY+d)->D", "SRA (IY+d)->E", "SRA (IY+d)->H", "SRA (IY+d)->L", "SRA (IY+d)", "SRA (IY+d)->A", - "SL1 (IY+d)->B", "SL1 (IY+d)->C", "SL1 (IY+d)->D", "SL1 (IY+d)->E", "SL1 (IY+d)->H", "SL1 (IY+d)->L", "SL1 (IY+d)", "SL1 (IY+d)->A", - "SRL (IY+d)->B", "SRL (IY+d)->C", "SRL (IY+d)->D", "SRL (IY+d)->E", "SRL (IY+d)->H", "SRL (IY+d)->L", "SRL (IY+d)", "SRL (IY+d)->A", - "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", - "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", - "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", - "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", - "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", - "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", - "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", - "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", - "RES 0 (IY+d)->B", "RES 0 (IY+d)->C", "RES 0 (IY+d)->D", "RES 0 (IY+d)->E", "RES 0 (IY+d)->H", "RES 0 (IY+d)->L", "RES 0 (IY+d)", "RES 0 (IY+d)->A", - "RES 1 (IY+d)->B", "RES 1 (IY+d)->C", "RES 1 (IY+d)->D", "RES 1 (IY+d)->E", "RES 1 (IY+d)->H", "RES 1 (IY+d)->L", "RES 1 (IY+d)", "RES 1 (IY+d)->A", - "RES 2 (IY+d)->B", "RES 2 (IY+d)->C", "RES 2 (IY+d)->D", "RES 2 (IY+d)->E", "RES 2 (IY+d)->H", "RES 2 (IY+d)->L", "RES 2 (IY+d)", "RES 2 (IY+d)->A", - "RES 3 (IY+d)->B", "RES 3 (IY+d)->C", "RES 3 (IY+d)->D", "RES 3 (IY+d)->E", "RES 3 (IY+d)->H", "RES 3 (IY+d)->L", "RES 3 (IY+d)", "RES 3 (IY+d)->A", - "RES 4 (IY+d)->B", "RES 4 (IY+d)->C", "RES 4 (IY+d)->D", "RES 4 (IY+d)->E", "RES 4 (IY+d)->H", "RES 4 (IY+d)->L", "RES 4 (IY+d)", "RES 4 (IY+d)->A", - "RES 5 (IY+d)->B", "RES 5 (IY+d)->C", "RES 5 (IY+d)->D", "RES 5 (IY+d)->E", "RES 5 (IY+d)->H", "RES 5 (IY+d)->L", "RES 5 (IY+d)", "RES 5 (IY+d)->A", - "RES 6 (IY+d)->B", "RES 6 (IY+d)->C", "RES 6 (IY+d)->D", "RES 6 (IY+d)->E", "RES 6 (IY+d)->H", "RES 6 (IY+d)->L", "RES 6 (IY+d)", "RES 6 (IY+d)->A", - "RES 7 (IY+d)->B", "RES 7 (IY+d)->C", "RES 7 (IY+d)->D", "RES 7 (IY+d)->E", "RES 7 (IY+d)->H", "RES 7 (IY+d)->L", "RES 7 (IY+d)", "RES 7 (IY+d)->A", - "SET 0 (IY+d)->B", "SET 0 (IY+d)->C", "SET 0 (IY+d)->D", "SET 0 (IY+d)->E", "SET 0 (IY+d)->H", "SET 0 (IY+d)->L", "SET 0 (IY+d)", "SET 0 (IY+d)->A", - "SET 1 (IY+d)->B", "SET 1 (IY+d)->C", "SET 1 (IY+d)->D", "SET 1 (IY+d)->E", "SET 1 (IY+d)->H", "SET 1 (IY+d)->L", "SET 1 (IY+d)", "SET 1 (IY+d)->A", - "SET 2 (IY+d)->B", "SET 2 (IY+d)->C", "SET 2 (IY+d)->D", "SET 2 (IY+d)->E", "SET 2 (IY+d)->H", "SET 2 (IY+d)->L", "SET 2 (IY+d)", "SET 2 (IY+d)->A", - "SET 3 (IY+d)->B", "SET 3 (IY+d)->C", "SET 3 (IY+d)->D", "SET 3 (IY+d)->E", "SET 3 (IY+d)->H", "SET 3 (IY+d)->L", "SET 3 (IY+d)", "SET 3 (IY+d)->A", - "SET 4 (IY+d)->B", "SET 4 (IY+d)->C", "SET 4 (IY+d)->D", "SET 4 (IY+d)->E", "SET 4 (IY+d)->H", "SET 4 (IY+d)->L", "SET 4 (IY+d)", "SET 4 (IY+d)->A", - "SET 5 (IY+d)->B", "SET 5 (IY+d)->C", "SET 5 (IY+d)->D", "SET 5 (IY+d)->E", "SET 5 (IY+d)->H", "SET 5 (IY+d)->L", "SET 5 (IY+d)", "SET 5 (IY+d)->A", - "SET 6 (IY+d)->B", "SET 6 (IY+d)->C", "SET 6 (IY+d)->D", "SET 6 (IY+d)->E", "SET 6 (IY+d)->H", "SET 6 (IY+d)->L", "SET 6 (IY+d)", "SET 6 (IY+d)->A", - "SET 7 (IY+d)->B", "SET 7 (IY+d)->C", "SET 7 (IY+d)->D", "SET 7 (IY+d)->E", "SET 7 (IY+d)->H", "SET 7 (IY+d)->L", "SET 7 (IY+d)", "SET 7 (IY+d)->A", + "RLC (IY+d)->B", "RLC (IY+d)->C", "RLC (IY+d)->D", "RLC (IY+d)->E", "RLC (IY+d)->H", "RLC (IY+d)->L", "RLC (IY+d)", "RLC (IY+d)->A", + "RRC (IY+d)->B", "RRC (IY+d)->C", "RRC (IY+d)->D", "RRC (IY+d)->E", "RRC (IY+d)->H", "RRC (IY+d)->L", "RRC (IY+d)", "RRC (IY+d)->A", + "RL (IY+d)->B", "RL (IY+d)->C", "RL (IY+d)->D", "RL (IY+d)->E", "RL (IY+d)->H", "RL (IY+d)->L", "RL (IY+d)", "RL (IY+d)->A", + "RR (IY+d)->B", "RR (IY+d)->C", "RR (IY+d)->D", "RR (IY+d)->E", "RR (IY+d)->H", "RR (IY+d)->L", "RR (IY+d)", "RR (IY+d)->A", + "SLA (IY+d)->B", "SLA (IY+d)->C", "SLA (IY+d)->D", "SLA (IY+d)->E", "SLA (IY+d)->H", "SLA (IY+d)->L", "SLA (IY+d)", "SLA (IY+d)->A", + "SRA (IY+d)->B", "SRA (IY+d)->C", "SRA (IY+d)->D", "SRA (IY+d)->E", "SRA (IY+d)->H", "SRA (IY+d)->L", "SRA (IY+d)", "SRA (IY+d)->A", + "SL1 (IY+d)->B", "SL1 (IY+d)->C", "SL1 (IY+d)->D", "SL1 (IY+d)->E", "SL1 (IY+d)->H", "SL1 (IY+d)->L", "SL1 (IY+d)", "SL1 (IY+d)->A", + "SRL (IY+d)->B", "SRL (IY+d)->C", "SRL (IY+d)->D", "SRL (IY+d)->E", "SRL (IY+d)->H", "SRL (IY+d)->L", "SRL (IY+d)", "SRL (IY+d)->A", + "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", "BIT 0, (IY+d)", + "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", "BIT 1, (IY+d)", + "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", "BIT 2, (IY+d)", + "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", "BIT 3, (IY+d)", + "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", "BIT 4, (IY+d)", + "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", "BIT 5, (IY+d)", + "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", "BIT 6, (IY+d)", + "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", "BIT 7, (IY+d)", + "RES 0 (IY+d)->B", "RES 0 (IY+d)->C", "RES 0 (IY+d)->D", "RES 0 (IY+d)->E", "RES 0 (IY+d)->H", "RES 0 (IY+d)->L", "RES 0 (IY+d)", "RES 0 (IY+d)->A", + "RES 1 (IY+d)->B", "RES 1 (IY+d)->C", "RES 1 (IY+d)->D", "RES 1 (IY+d)->E", "RES 1 (IY+d)->H", "RES 1 (IY+d)->L", "RES 1 (IY+d)", "RES 1 (IY+d)->A", + "RES 2 (IY+d)->B", "RES 2 (IY+d)->C", "RES 2 (IY+d)->D", "RES 2 (IY+d)->E", "RES 2 (IY+d)->H", "RES 2 (IY+d)->L", "RES 2 (IY+d)", "RES 2 (IY+d)->A", + "RES 3 (IY+d)->B", "RES 3 (IY+d)->C", "RES 3 (IY+d)->D", "RES 3 (IY+d)->E", "RES 3 (IY+d)->H", "RES 3 (IY+d)->L", "RES 3 (IY+d)", "RES 3 (IY+d)->A", + "RES 4 (IY+d)->B", "RES 4 (IY+d)->C", "RES 4 (IY+d)->D", "RES 4 (IY+d)->E", "RES 4 (IY+d)->H", "RES 4 (IY+d)->L", "RES 4 (IY+d)", "RES 4 (IY+d)->A", + "RES 5 (IY+d)->B", "RES 5 (IY+d)->C", "RES 5 (IY+d)->D", "RES 5 (IY+d)->E", "RES 5 (IY+d)->H", "RES 5 (IY+d)->L", "RES 5 (IY+d)", "RES 5 (IY+d)->A", + "RES 6 (IY+d)->B", "RES 6 (IY+d)->C", "RES 6 (IY+d)->D", "RES 6 (IY+d)->E", "RES 6 (IY+d)->H", "RES 6 (IY+d)->L", "RES 6 (IY+d)", "RES 6 (IY+d)->A", + "RES 7 (IY+d)->B", "RES 7 (IY+d)->C", "RES 7 (IY+d)->D", "RES 7 (IY+d)->E", "RES 7 (IY+d)->H", "RES 7 (IY+d)->L", "RES 7 (IY+d)", "RES 7 (IY+d)->A", + "SET 0 (IY+d)->B", "SET 0 (IY+d)->C", "SET 0 (IY+d)->D", "SET 0 (IY+d)->E", "SET 0 (IY+d)->H", "SET 0 (IY+d)->L", "SET 0 (IY+d)", "SET 0 (IY+d)->A", + "SET 1 (IY+d)->B", "SET 1 (IY+d)->C", "SET 1 (IY+d)->D", "SET 1 (IY+d)->E", "SET 1 (IY+d)->H", "SET 1 (IY+d)->L", "SET 1 (IY+d)", "SET 1 (IY+d)->A", + "SET 2 (IY+d)->B", "SET 2 (IY+d)->C", "SET 2 (IY+d)->D", "SET 2 (IY+d)->E", "SET 2 (IY+d)->H", "SET 2 (IY+d)->L", "SET 2 (IY+d)", "SET 2 (IY+d)->A", + "SET 3 (IY+d)->B", "SET 3 (IY+d)->C", "SET 3 (IY+d)->D", "SET 3 (IY+d)->E", "SET 3 (IY+d)->H", "SET 3 (IY+d)->L", "SET 3 (IY+d)", "SET 3 (IY+d)->A", + "SET 4 (IY+d)->B", "SET 4 (IY+d)->C", "SET 4 (IY+d)->D", "SET 4 (IY+d)->E", "SET 4 (IY+d)->H", "SET 4 (IY+d)->L", "SET 4 (IY+d)", "SET 4 (IY+d)->A", + "SET 5 (IY+d)->B", "SET 5 (IY+d)->C", "SET 5 (IY+d)->D", "SET 5 (IY+d)->E", "SET 5 (IY+d)->H", "SET 5 (IY+d)->L", "SET 5 (IY+d)", "SET 5 (IY+d)->A", + "SET 6 (IY+d)->B", "SET 6 (IY+d)->C", "SET 6 (IY+d)->D", "SET 6 (IY+d)->E", "SET 6 (IY+d)->H", "SET 6 (IY+d)->L", "SET 6 (IY+d)", "SET 6 (IY+d)->A", + "SET 7 (IY+d)->B", "SET 7 (IY+d)->C", "SET 7 (IY+d)->D", "SET 7 (IY+d)->E", "SET 7 (IY+d)->H", "SET 7 (IY+d)->L", "SET 7 (IY+d)", "SET 7 (IY+d)->A", ]; private static readonly string[] mnemonicsCB = [ - "RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (HL)", "RLC A", + "RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (HL)", "RLC A", "RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (HL)", "RRC A", "RL B", "RL C", "RL D", "RL E", "RL H", "RL L", "RL (HL)", "RL A", "RR B", "RR C", "RR D", "RR E", "RR H", "RR L", "RR (HL)", "RR A", @@ -321,11 +321,11 @@ namespace BizHawk.Emulation.Cores.Components.Z80A private static readonly string[] mnemonicsED = [ - "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", - "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", - "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", - "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", - + "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", + "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", + "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", + "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", + "IN B, C", "OUT C, B", "SBC HL, BC", "LD (nn), BC", //0x44 "NEG", "RETN", "IM $0", "LD I, A", //0x48 "IN C, C", "OUT C, C", "ADC HL, BC", "LD BC, (nn)", //0x4C @@ -334,7 +334,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "NEG", "RETN", "IM $1", "LD A, I", //0x58 "IN E, C", "OUT C, E", "ADC HL, DE", "LD DE, (nn)", //0x5C "NEG", "RETI", "IM $2", "LD A, R", //0x60 - + "IN H, C", "OUT C, H", "SBC HL, HL", "LD (nn), HL", //0x64 "NEG", "RETN", "IM $0", "RRD", //0x68 "IN L, C", "OUT C, L", "ADC HL, HL", "LD HL, (nn)", //0x6C @@ -416,7 +416,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A break; default: format = mnemonics[A]; break; } - + string temp = Result(format, read, ref addr); addr += extra_inc; diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs index d533c7d2e9..2452e7178a 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs @@ -144,7 +144,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A Reg16_d += (Regs[src] & 0xF); FlagH = Reg16_d.Bit(4); - FlagN = false; + FlagN = false; Flag3 = (ans & 0x08) != 0; Flag5 = (ans & 0x20) != 0; FlagP = (Regs[dest].Bit(7) == Regs[src].Bit(7)) && (Regs[dest].Bit(7) != ans.Bit(7)); @@ -292,7 +292,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public void CCF_Func(ushort src) { FlagH = FlagC; - FlagC = !FlagC; + FlagC = !FlagC; FlagN = false; Flag3 = (Regs[src] & 0x08) != 0; Flag5 = (Regs[src] & 0x20) != 0; @@ -714,13 +714,13 @@ namespace BizHawk.Emulation.Cores.Components.Z80A FlagZ = (Reg16_d & 0xFF) == 0; FlagP = Regs[src] == 0x80; FlagS = (Reg16_d & 0xFF) > 127; - + ushort ans = (ushort)(Reg16_d & 0xFF); // redo for half carry flag Reg16_d = 0; Reg16_d -= (Regs[src] & 0xF); FlagH = Reg16_d.Bit(4); - Regs[src] = ans; + Regs[src] = ans; FlagN = true; Flag3 = (ans & 0x08) != 0; Flag5 = (ans & 0x20) != 0; @@ -760,7 +760,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A Flag5 = (temp1 & 0x20) != 0; } - // sets flags for LD/R + // sets flags for LD/R public void SET_FL_LD_Func() { FlagP = (Regs[C] | (Regs[B] << 8)) != 0; diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Tables_Indirect.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Tables_Indirect.cs index 1b18f004fc..4187ffe1e9 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Tables_Indirect.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Tables_Indirect.cs @@ -38,7 +38,7 @@ // Note that this operation uses I_BIT, same as indexed BIT. // This is where the strange behaviour in Flag bits 3 and 5 come from. - // normally WZ contain I* + n when doing I_BIT ops, but here we use that code path + // normally WZ contain I* + n when doing I_BIT ops, but here we use that code path // even though WZ is not assigned to, letting it's value from other operations show through private void BIT_TE_IND(ushort operation, ushort bit, ushort src_l, ushort src_h) { diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs index 76dfd59d4c..e59afef210 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public sealed partial class Z80A where TLink : IZ80ALink { // operations that can take place in an instruction - public const ushort IDLE = 0; + public const ushort IDLE = 0; public const ushort OP = 1; public const ushort OP_F = 2; // used for repeating operations public const ushort HALT = 3; @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public const ushort RLC = 22; public const ushort RL = 23; public const ushort RRC = 24; - public const ushort RR = 25; + public const ushort RR = 25; public const ushort CPL = 26; public const ushort DA = 27; public const ushort SCF = 28; @@ -55,9 +55,9 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public const ushort SLL = 37; public const ushort BIT = 38; public const ushort RES = 39; - public const ushort SET = 40; + public const ushort SET = 40; public const ushort EI = 41; - public const ushort DI = 42; + public const ushort DI = 42; public const ushort EXCH = 43; public const ushort EXX = 44; public const ushort EXCH_16 = 45; @@ -70,9 +70,9 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public const ushort EI_RETI = 52; // reti has no delay in interrupt enable public const ushort OUT = 53; public const ushort IN = 54; - public const ushort NEG = 55; + public const ushort NEG = 55; public const ushort RRD = 56; - public const ushort RLD = 57; + public const ushort RLD = 57; public const ushort SET_FL_LD_R = 58; public const ushort SET_FL_CP_R = 59; public const ushort SET_FL_IR = 60; @@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public const ushort IORQ = 75; // non-state variables - public ushort Ztemp1, Ztemp2, Ztemp3, Ztemp4; + public ushort Ztemp1, Ztemp2, Ztemp3, Ztemp4; public byte temp_R; private TLink _link; @@ -261,15 +261,15 @@ namespace BizHawk.Emulation.Cores.Components.Z80A break; case OP: // should never reach here - + break; case OP_F: - // Read the opcode of the next instruction + // Read the opcode of the next instruction _link.OnExecFetch(RegPC); TraceCallback?.Invoke(State()); opcode = _link.FetchMemory(RegPC++); FetchInstruction(); - + temp_R = (byte)(Regs[R] & 0x7F); temp_R++; temp_R &= 0x7F; @@ -488,7 +488,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A FetchInstruction(); instr_pntr = bus_pntr = mem_pntr = irq_pntr = 0; I_skip = true; - + // for prefetched case, the PC stays on the BUS one cycle longer if ((src_t == IXCBpre) || (src_t == IYCBpre)) { BUSRQ[0] = PCh; } @@ -562,7 +562,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A { if (Ztemp2 == INC16) { INC16_Func(E, D); } else { DEC16_Func(E, D); } - } + } break; case SET_FL_CP_R: SET_FL_CP_Func(); @@ -613,7 +613,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A Regs[Z] = cur_instr[instr_pntr++]; Regs[W] = 0; break; - case REP_OP_I: + case REP_OP_I: Write_Func(cur_instr[instr_pntr++], cur_instr[instr_pntr++], cur_instr[instr_pntr++]); Ztemp4 = cur_instr[instr_pntr++]; @@ -630,7 +630,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A FlagP = TableParity[((Regs[ALU] + Regs[C] - 1) & 7) ^ Regs[B]]; } else - { + { TR16_Func(Z, W, C, B); INC16_Func(Z, W); DEC8_Func(B); @@ -677,7 +677,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A DEC16_Func(L, H); DEC8_Func(B); TR16_Func(Z, W, C, B); - DEC16_Func(Z, W); + DEC16_Func(Z, W); } else { @@ -884,7 +884,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A /// /// Optimization method to set cur_instr - /// + /// private void PopulateCURINSTR(ushort d0 = 0, ushort d1 = 0, ushort d2 = 0, ushort d3 = 0, ushort d4 = 0, ushort d5 = 0, ushort d6 = 0, ushort d7 = 0, ushort d8 = 0, ushort d9 = 0, ushort d10 = 0, ushort d11 = 0, ushort d12 = 0, ushort d13 = 0, ushort d14 = 0, ushort d15 = 0, ushort d16 = 0, ushort d17 = 0, ushort d18 = 0, ushort d19 = 0, ushort d20 = 0, ushort d21 = 0, ushort d22 = 0, ushort d23 = 0, ushort d24 = 0, ushort d25 = 0, ushort d26 = 0, ushort d27 = 0, ushort d28 = 0, diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IEmulator.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IEmulator.cs index c24ce6fd02..edde18326e 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.IEmulator.cs @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Calculators.TI83 if (TIM_count >= TIM_hit) { TIM_count = 0; - + if (TIM_1_int_EN) { TIM_1_int = true; diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs index 23bb4eb3f9..4727ba8cdc 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs @@ -240,7 +240,7 @@ namespace BizHawk.Emulation.Cores.Calculators.TI83 // 3 - Set if ON key is up // 4-7 - Unknown - return (byte)((_controller.IsPressed("ON") ? 0 : 8) | + return (byte)((_controller.IsPressed("ON") ? 0 : 8) | (TIM_1_int ? 2 : 0) | (ON_key_int ? 1 : 0)); } diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83LinkPort.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83LinkPort.cs index 5291ab378d..464f812887 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83LinkPort.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83LinkPort.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Calculators.TI83 private byte[] _variableData; private Action _nextStep; - + private ushort _bytesToSend; private byte _bitsLeft; private byte _currentByte; diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.ISettable.cs index 44791b9639..0b165bc288 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.ISettable.cs @@ -293,7 +293,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga "-s", setting }); } - + public object GetSettings() => null; public PutSettingsDirtyBits PutSettings(object o) => PutSettingsDirtyBits.None; diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.cs index f99d8a50e9..9132fcf7d4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/UAE.cs @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga DefaultFpsNumerator = LibUAE.VIDEO_NUMERATOR_NTSC, DefaultFpsDenominator = LibUAE.VIDEO_DENOMINATOR_NTSC }; - + private readonly LibWaterboxCore.EmptyCallback _ledCallback; private readonly List _roms; private const int _messageDuration = 4; @@ -279,7 +279,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga _ejectPressed = controller.IsPressed(Inputs.EjectDisk); _insertPressed = controller.IsPressed(Inputs.InsertDisk); _nextSlotPressed = controller.IsPressed(Inputs.NextSlot); - _nextDrivePressed = controller.IsPressed(Inputs.NextDrive); + _nextDrivePressed = controller.IsPressed(Inputs.NextDrive); fi.CurrentDrive = _currentDrive; foreach (var (name, key) in _keyboardMap) diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs index ef3ce3749e..675fe16f61 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.Controllers.cs @@ -52,15 +52,15 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // Keyboard - row 1 "Key ESC", "Key 1", "Key 2", "Key 3", "Key 4", "Key 5", "Key 6", "Key 7", "Key 8", "Key 9", "Key 0", "Key Dash", "Key Hat", "Key CLR", "Key DEL", // Keyboard - row 2 - "Key TAB", "Key Q", "Key W", "Key E", "Key R", "Key T", "Key Y", "Key U", "Key I", "Key O", "Key P", "Key @", "Key LeftBracket", "Key RETURN", + "Key TAB", "Key Q", "Key W", "Key E", "Key R", "Key T", "Key Y", "Key U", "Key I", "Key O", "Key P", "Key @", "Key LeftBracket", "Key RETURN", // Keyboard - row 3 - "Key CAPSLOCK", "Key A", "Key S", "Key D", "Key F", "Key G", "Key H", "Key J", "Key K", "Key L", "Key Colon", "Key SemiColon", "Key RightBracket", + "Key CAPSLOCK", "Key A", "Key S", "Key D", "Key F", "Key G", "Key H", "Key J", "Key K", "Key L", "Key Colon", "Key SemiColon", "Key RightBracket", // Keyboard - row 4 - "Key SHIFT", "Key Z", "Key X", "Key C", "Key V", "Key B", "Key N", "Key M", "Key Comma", "Key Period", "Key ForwardSlash", "Key BackSlash", + "Key SHIFT", "Key Z", "Key X", "Key C", "Key V", "Key B", "Key N", "Key M", "Key Comma", "Key Period", "Key ForwardSlash", "Key BackSlash", // Keyboard - row 5 - "Key SPACE", "Key CONTROL", + "Key SPACE", "Key CONTROL", // Keyboard - Cursor - "Key CURUP", "Key CURDOWN", "Key CURLEFT", "Key CURRIGHT", "Key COPY", + "Key CURUP", "Key CURDOWN", "Key CURLEFT", "Key CURRIGHT", "Key COPY", // Keyboard - Numpad "Key NUM0", "Key NUM1", "Key NUM2", "Key NUM3", "Key NUM4", "Key NUM5", "Key NUM6", "Key NUM7", "Key NUM8", "Key NUM9", "Key NUMPERIOD", "KEY ENTER" }; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/AY38912.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/AY38912.cs index 84157ee241..b0f9ae9215 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/AY38912.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/AY38912.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { /// /// Based heavily on the YM-2149F / AY-3-8910 emulator used in Unreal Speccy - /// (Originally created under Public Domain license by SMT jan.2006) /// + /// (Originally created under Public Domain license by SMT jan.2006) /// /// https://github.com/mkoloberdin/unrealspeccy/blob/master/sndrender/sndchip.cpp /// https://github.com/mkoloberdin/unrealspeccy/blob/master/sndrender/sndchip.h /// @@ -203,7 +203,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC break; - // write reg + // write reg case 2: if (_activeRegister == 14) @@ -385,15 +385,15 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 14 I/O port A 8-bit (0-255) 15 I/O port B 8-bit (0-255) (Not present on the AY-3-8912) - * The volume registers (8, 9 and 10) contain a 4-bit setting but if bit 5 is set then that channel uses the + * The volume registers (8, 9 and 10) contain a 4-bit setting but if bit 5 is set then that channel uses the envelope defined by register 13 and ignores its volume setting. * The mixer (register 7) is made up of the following bits (low=enabled): - + Bit: 7 6 5 4 3 2 1 0 Register: I/O I/O Noise Noise Noise Tone Tone Tone Channel: B A C B A C B A - The AY-3-8912 ignores bit 7 of this register. + The AY-3-8912 ignores bit 7 of this register. */ private int[] _registers = new int[16]; @@ -583,7 +583,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC _tStatesPerFrame = frameTactCount; _samplesPerFrame = sampleRate / 50; //882 - _tStatesPerSample = frameTactCount / (double)_samplesPerFrame; // 90; //(int)Math.Round(((double)_tStatesPerFrame * 50D) / + _tStatesPerSample = frameTactCount / (double)_samplesPerFrame; // 90; //(int)Math.Round(((double)_tStatesPerFrame * 50D) / //(16D * (double)_sampleRate), //MidpointRounding.AwayFromZero); _audioBuffer = new short[_samplesPerFrame * 2]; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Beeper.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Beeper.cs index 5decb62384..a99309dc95 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Beeper.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Beeper.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public class Beeper : ISoundProvider, IBeeperDevice { /// - /// Sample Rate + /// Sample Rate /// This usually has to be 44100 for ISoundProvider /// private int _sampleRate; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type0.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type0.cs index 98693e0d5a..82271f8e4c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type0.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type0.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public override int CrtcType => 0; public override void Clock() => throw new InvalidOperationException("CRTC Type 0 not implemented yet"); - + /* public override void Clock() @@ -238,7 +238,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC */ /// - /// R3l: CRTC-type horizontal sync width independent helper function + /// R3l: CRTC-type horizontal sync width independent helper function /// protected override int R3_HorizontalSyncWidth { @@ -251,7 +251,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } /// - /// R3h: CRTC-type vertical sync width independent helper function + /// R3h: CRTC-type vertical sync width independent helper function /// protected override int R3_VerticalSyncWidth { @@ -397,7 +397,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { // ACCC1.8 - 21.3.2 // CRTC0 randomly apparently returns 255 or 127 on this port - + // For the purposes of Bizhawk determinism, we will return one of the above values based on the current HCC data = HCC.Bit(0) ? 255 : 127; return true; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type1.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type1.cs index d60317c2e2..08dfb432ca 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type1.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type1.cs @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } if (VCC == R7_VerticalSyncPosition // C4 == R7 - && !VSYNC) // ACCC 16.3: It is not possible to trigger or inhibit VSYNC during a VSYNC + && !VSYNC) // ACCC 16.3: It is not possible to trigger or inhibit VSYNC during a VSYNC { // VSYNC enabled VSYNC = true; @@ -111,7 +111,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } if (HCC == R2_HorizontalSyncPosition // C0 == R2 - && R3_HorizontalSyncWidth > 0) // ACCC 14.6: When R3 == 0, CRTC 0 and 1 do not produce HSYNC + && R3_HorizontalSyncWidth > 0) // ACCC 14.6: When R3 == 0, CRTC 0 and 1 do not produce HSYNC { // HSYNC is enabled HSYNC = true; @@ -126,7 +126,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC HSC++; if (HSC == R3_HorizontalSyncWidth // C3l == R3l - || HSC == 0) // HSC counter wrap-around + || HSC == 0) // HSC counter wrap-around { // disable HSYNC HSYNC = false; @@ -282,7 +282,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } } - + public void Clocko() { CheckReset(); @@ -512,7 +512,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// - /// R3l: CRTC-type horizontal sync width independent helper function + /// R3l: CRTC-type horizontal sync width independent helper function /// protected override int R3_HorizontalSyncWidth { @@ -525,7 +525,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } /// - /// R3h: CRTC-type vertical sync width independent helper function + /// R3h: CRTC-type vertical sync width independent helper function /// protected override int R3_VerticalSyncWidth { @@ -672,7 +672,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { // ACCC1.8 - 21.3.1 // Only CRTC 1 has a status register present on the specific port &BE00. - // This port is a mirror of the read port for CRTC’s 3 and 4, which handle status differently + // This port is a mirror of the read port for CRTC’s 3 and 4, which handle status differently data = StatusRegister; return true; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type2.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type2.cs index 64191fe60d..97c3903db6 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type2.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type2.cs @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public override void Clock() => throw new InvalidOperationException("CRTC Type 2 not implemented yet"); /// - /// R3l: CRTC-type horizontal sync width independent helper function + /// R3l: CRTC-type horizontal sync width independent helper function /// protected override int R3_HorizontalSyncWidth { @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } /// - /// R3h: CRTC-type vertical sync width independent helper function + /// R3h: CRTC-type vertical sync width independent helper function /// protected override int R3_VerticalSyncWidth { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type3.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type3.cs index 7696588ece..c734cfdf40 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type3.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type3.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public override void Clock() => throw new InvalidOperationException("CRTC Type 3 not implemented yet"); /// - /// R3l: CRTC-type horizontal sync width independent helper function + /// R3l: CRTC-type horizontal sync width independent helper function /// protected override int R3_HorizontalSyncWidth { @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } /// - /// R3h: CRTC-type vertical sync width independent helper function + /// R3h: CRTC-type vertical sync width independent helper function /// protected override int R3_VerticalSyncWidth { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type4.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type4.cs index 66bbfcd4f5..10b1103114 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type4.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.Type4.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public override void Clock() => throw new InvalidOperationException("CRTC Type 4 not implemented yet"); /// - /// R3l: CRTC-type horizontal sync width independent helper function + /// R3l: CRTC-type horizontal sync width independent helper function /// protected override int R3_HorizontalSyncWidth { @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } /// - /// R3h: CRTC-type vertical sync width independent helper function + /// R3h: CRTC-type vertical sync width independent helper function /// protected override int R3_VerticalSyncWidth { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.cs index 283ff4b7f9..0ae99b080a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/CRTC.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// This implementation aims to emulate all the various CRTC chips that appear within /// the CPC, CPC+ and GX4000 ranges. The CPC community have assigned them type numbers. /// If different implementations share the same type number it indicates that they are functionally identical - /// + /// /// Part No. Manufacturer Type No. Info. /// ------------------------------------------------------------------------------------------------------ /// HD6845S Hitachi 0 @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public byte[] RegDefaults = { 63, 40, 46, 142, 38, 0, 25, 30, 0, 7, 0, 0, 48, 0, 192, 7, 0, 0 }; /// - /// The ClK isaTTUMOS-compatible input used to synchronize all CRT' functions except for the processor interface. + /// The ClK isaTTUMOS-compatible input used to synchronize all CRT' functions except for the processor interface. /// An external dot counter is used to derive this signal which is usually the character rate in an alphanumeric CRT. /// The active transition is high-to-low /// @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// This TTL compatible output is an active high signal which drives the monitor directly or is fed to Video Processing Logic for composite generation. - /// This signal determines the horizontal position of the displayed text. + /// This signal determines the horizontal position of the displayed text. /// public virtual bool HSYNC { @@ -114,7 +114,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// This TTL compatible output is an active high signal which indicates the CRTC is providing addressing in the active Display Area. - /// + /// public virtual bool DISPTMG { get => _DISPTMG; @@ -123,8 +123,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC private bool _DISPTMG; /// - /// This TTL compatible output indicates Cursor Display to external Video Processing Logic.Active high signal. - /// + /// This TTL compatible output indicates Cursor Display to external Video Processing Logic.Active high signal. + /// public virtual bool CUDISP { get => _CUDISP; @@ -158,7 +158,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// This 16-bit property emulates how the Amstrad CPC Gate Array is wired up to the CRTC /// Built from LA, RA and CLK - /// + /// /// Memory Address Signal Signal source Signal name /// A15 6845 MA13 /// A14 6845 MA12 @@ -176,7 +176,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// A2 6845 MA1 /// A1 6845 MA0 /// A0 Gate-Array CLK - /// + /// public ushort MA_Address { get @@ -246,7 +246,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC private byte _addressRegister; /// - /// This 8 bit write-only register determines the horizontal frequency of HS. + /// This 8 bit write-only register determines the horizontal frequency of HS. /// It is the total of displayed plus non-displayed character time units minus one. /// protected const int R0_H_TOTAL = 0; @@ -259,8 +259,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// protected const int R2_H_SYNC_POS = 2; /// - /// This 4 bit write-only register determines the width of the HS pulse. It may not be apparent why this width needs to be programmed.However, - /// consider that all timing widths must be programmed as multiples of the character clock period which varies.If HS width were fixed as an integral + /// This 4 bit write-only register determines the width of the HS pulse. It may not be apparent why this width needs to be programmed.However, + /// consider that all timing widths must be programmed as multiples of the character clock period which varies.If HS width were fixed as an integral /// number of character times, it would vary with character rate and be out of tolerance for certain monitors. /// The rate programmable feature allows compensating HS width. /// NOTE: Dependent on chiptype this also may include VSYNC width - check the UpdateWidths() method @@ -269,8 +269,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /* Vertical Timing Register Constants */ /// - /// The vertical frequency of VS is determined by both R4 and R5.The calculated number of character I ine times is usual I y an integer plus a fraction to - /// get exactly a 50 or 60Hz vertical refresh rate. The integer number of character line times minus one is programmed in the 7 bit write-only Vertical Total Register; + /// The vertical frequency of VS is determined by both R4 and R5.The calculated number of character I ine times is usual I y an integer plus a fraction to + /// get exactly a 50 or 60Hz vertical refresh rate. The integer number of character line times minus one is programmed in the 7 bit write-only Vertical Total Register; /// the fraction is programmed in the 5 bit write-only Vertical Scan Adjust Register as a number of scan line times. /// protected const int R4_V_TOTAL = 4; @@ -284,8 +284,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// protected const int R7_V_SYNC_POS = 7; /// - /// This 2 bit write-only register controls the raster scan mode(see Figure 11 ). When bit 0 and bit 1 are reset, or bit 0 is reset and bit 1 set, - /// the non· interlace raster scan mode is selected.Two interlace modes are available.Both are interlaced 2 fields per frame.When bit 0 is set and bit 1 is reset, + /// This 2 bit write-only register controls the raster scan mode(see Figure 11 ). When bit 0 and bit 1 are reset, or bit 0 is reset and bit 1 set, + /// the non· interlace raster scan mode is selected.Two interlace modes are available.Both are interlaced 2 fields per frame.When bit 0 is set and bit 1 is reset, /// the interlace sync raster scan mode is selected.Also when bit 0 and bit 1 are set, the interlace sync and video raster scan mode is selected. /// protected const int R8_INTERLACE_MODE = 8; @@ -295,9 +295,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// protected const int R9_MAX_SL_ADDRESS = 9; /// - /// This 7 bit write-only register controls the cursor format(see Figure 10). Bit 5 is the blink timing control.When bit 5 is low, the blink frequency is 1/16 of the + /// This 7 bit write-only register controls the cursor format(see Figure 10). Bit 5 is the blink timing control.When bit 5 is low, the blink frequency is 1/16 of the /// vertical field rate, and when bit 5 is high, the blink frequency is 1/32 of the vertical field rate.Bit 6 is used to enable a blink. - /// The cursor start scan line is set by the lower 5 bits. + /// The cursor start scan line is set by the lower 5 bits. /// protected const int R10_CURSOR_START = 10; /// @@ -323,8 +323,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC protected const int R17_LIGHT_PEN_L = 17; /// - /// Storage for main MPU registers - /// + /// Storage for main MPU registers + /// /// RegIdx Register Name Type /// 0 1 2 3 4 /// 0 Horizontal Total Write Only Write Only Write Only (note 2) (note 3) @@ -344,9 +344,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// 14 Cursor Address (High) Read/Write Read/Write Read/Write Read/Write (note 2) (note 3) /// 15 Cursor Address (Low) Read/Write Read/Write Read/Write Read/Write (note 2) (note 3) /// 16 Light Pen Address (High) Read Only Read Only Read Only Read Only (note 2) (note 3) - /// + /// /// 18-31 Not Used - /// + /// /// 1. On type 0 and 1, if a Write Only register is read from, "0" is returned. /// 2. See the document "Extra CPC Plus Hardware Information" for more details. /// 3. CRTC type 4 is the same as CRTC type 3. The registers also repeat as they do on the type 3. @@ -395,12 +395,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } /// - /// R3l: CRTC-type horizontal sync width independent helper function + /// R3l: CRTC-type horizontal sync width independent helper function /// protected virtual int R3_HorizontalSyncWidth { get; } /// - /// R3h: CRTC-type vertical sync width independent helper function + /// R3h: CRTC-type vertical sync width independent helper function /// protected virtual int R3_VerticalSyncWidth { get; } @@ -491,7 +491,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// C0: Horizontal Character Counter /// 8-bit - /// + /// protected virtual int HCC { get => _hcCTR & 0xFF; @@ -502,7 +502,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// C3l: Horizontal Sync Width Counter (HSYNC) /// 4-bit - /// + /// protected virtual int HSC { get => _hswCTR & 0x0F; @@ -628,7 +628,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// public virtual void Clock() { } - + public virtual void CheckReset() { if (_inReset > 0) @@ -791,7 +791,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC ser.Sync(nameof(latch_skew), ref latch_skew); ser.Sync(nameof(_field), ref _field); ser.Sync(nameof(adjusting), ref adjusting); - ser.Sync(nameof(_inReset), ref _inReset); + ser.Sync(nameof(_inReset), ref _inReset); ser.Sync(nameof(hend), ref hend); ser.Sync(nameof(hsend), ref hsend); ser.Sync(nameof(hclock), ref hclock); diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs index 8fa372eed9..696eca0e5a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs @@ -386,7 +386,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC while (cycles >= _waitEdge) { // decrement cycles - cycles -= _waitEdge; + cycles -= _waitEdge; if (_position == 0 && tapeMotor) { @@ -546,7 +546,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } _monitorTimeOut = 2000; - } + } break; */ default: @@ -628,7 +628,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { if (_tapeIsPlaying && _autoPlay) { - if (DataBlocks.Count > 1 || + if (DataBlocks.Count > 1 || (_dataBlocks[_currentDataBlockIndex].BlockDescription != BlockType.CSW_Recording && _dataBlocks[_currentDataBlockIndex].BlockDescription != BlockType.WAV_Recording)) { @@ -644,7 +644,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { AutoStopTape(); } - + return; } @@ -679,7 +679,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC ) { return; - } + } if (diff >= timeout * 2) { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.Definitions.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.Definitions.cs index 3738136928..7b915aef3a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.Definitions.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.Definitions.cs @@ -30,14 +30,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Command, /// - /// During this phase, the actual data is transferred (if any). Usually that are the data bytes for the read/written sector(s), except for the Format Track Command, + /// During this phase, the actual data is transferred (if any). Usually that are the data bytes for the read/written sector(s), except for the Format Track Command, /// in that case four bytes for each sector are transferred /// Execution, /// - /// Returns up to seven result bytes (depending on the command) that are containing status information. The Recalibrate and Seek Track commands do not return result bytes directly, - /// instead the program must wait until the Main Status Register signalizes that the command has been completed, and then it must (!) send a + /// Returns up to seven result bytes (depending on the command) that are containing status information. The Recalibrate and Seek Track commands do not return result bytes directly, + /// instead the program must wait until the Main Status Register signalizes that the command has been completed, and then it must (!) send a /// Sense Interrupt State command to 'terminate' the Seek/Recalibrate command. /// Result @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC PreExecution, /// - /// The start of instruction execution. This may end up with the FDC moving into result phase, + /// The start of instruction execution. This may end up with the FDC moving into result phase, /// but also may also prepare the way for further processing to occur later in execution phase /// StartExecute, @@ -413,7 +413,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public const int MSR_DIO = 6; /// /// Request For Master (1=ready for next byte) (see b6 for direction) - /// ndicates data register IS ready to send or receive data to or from the processor Both bits DIO and RQM should be + /// ndicates data register IS ready to send or receive data to or from the processor Both bits DIO and RQM should be /// used to perform the hand-shaking functions of “ready” and “directron” to the processor /// public const int MSR_RQM = 7; @@ -493,12 +493,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// No Data /// No Data (Sector_ID not found, CRC fail in ID_field) - /// + /// /// During execution of Read Data. Read Deleted Data Write Data.Write Deleted Data or Scan command, if the FDC cannot find /// the sector specified in the IDR(2)Register, this flag i s set. - /// + /// /// During execution of the Read ID command. if the FDC cannot read the ID field without an error, then this flag IS set - /// + /// /// During execution of the Read Diagnostic command. if the starting sector cannot be found, then this flag is set /// public const int SR1_ND = 2; @@ -526,7 +526,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Missing Address Mark in Data Field (DAM not found) - /// Missing address mark - When data IS read from the medium, i f the FDC cannot find a data address mark or deleted + /// Missing address mark - When data IS read from the medium, i f the FDC cannot find a data address mark or deleted /// data address mark, then this flag is set /// public const int SR2_MD = 0; @@ -540,7 +540,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Scan Not Satisfied (no fitting sector found) - /// Scan not satisfied - During execution of the Scan command, i f the F D cannot find a sector on the cylinder + /// Scan not satisfied - During execution of the Scan command, i f the F D cannot find a sector on the cylinder /// which meets the condition.then this flag i s set /// public const int SR2_SN = 2; @@ -553,7 +553,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Wrong Cylinder (read/programmed track-ID different) (see b1) - /// Wrong cylinder - This bit IS related to the ND bit, and when the contents of C(3) on the medium is different + /// Wrong cylinder - This bit IS related to the ND bit, and when the contents of C(3) on the medium is different /// from that stored i n the IDR.this flag is set /// public const int SR2_WC = 4; @@ -768,7 +768,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// public byte Gap3Length; /// - /// Data length (DTL) - When N is defined as 00, DTL stands for the data length + /// Data length (DTL) - When N is defined as 00, DTL stands for the data length /// which users are going to read out or write into the sector /// public byte DTL; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDC.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDC.cs index 208807bfd0..96245f1908 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDC.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDC.cs @@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Step Rate Time (supplied via the specify command) - /// SRT stands for the steooino rate for the FDD ( 1 to 16 ms in 1 ms increments). + /// SRT stands for the steooino rate for the FDD ( 1 to 16 ms in 1 ms increments). /// Stepping rate applies to all drives(FH= 1ms, EH= 2ms, etc.). /// private int SRT; @@ -83,7 +83,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Head Unload Time (supplied via the specify command) - /// HUT stands for the head unload time after a Read or Write operation has occurred + /// HUT stands for the head unload time after a Read or Write operation has occurred /// (16 to 240 ms in 16 ms Increments) /// private int HUT; @@ -343,9 +343,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // calculate requested size of data required if (ActiveCommandParams.SectorSize == 0) { - // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual - // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) - // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform + // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual + // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) + // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform // a Multi-Sector Read Operation. sectorSize = ActiveCommandParams.DTL; @@ -431,7 +431,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // we don't need EN UnSetBit(SR1_EN, ref Status1); - // If SK=1, the FDC skips the sector with the Deleted Data Address Mark and reads the next sector. + // If SK=1, the FDC skips the sector with the Deleted Data Address Mark and reads the next sector. // The CRC bits in the deleted data field are not checked when SK=1 if (CMD_FLAG_SK && Status2.Bit(SR2_CM)) { @@ -645,9 +645,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // calculate requested size of data required if (ActiveCommandParams.SectorSize == 0) { - // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual - // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) - // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform + // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual + // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) + // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform // a Multi-Sector Read Operation. sectorSize = ActiveCommandParams.DTL; @@ -958,9 +958,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // calculate requested size of data required if (ActiveCommandParams.SectorSize == 0) { - // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual - // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) - // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform + // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual + // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) + // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform // a Multi-Sector Read Operation. sectorSize = ActiveCommandParams.DTL; @@ -1842,7 +1842,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// COMMAND: 2 parameter bytes /// EXECUTION: NO execution phase /// RESULT: NO result phase - /// + /// /// Looks like specify command returns status 0x80 throughout its lifecycle /// so CB is NOT set /// @@ -2163,7 +2163,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// COMMAND: 1 parameter byte /// EXECUTION: NO execution phase /// RESULT: 1 result byte - /// + /// /// The ZX spectrum appears to only specify drive 1 as the parameter byte, NOT drive 0 /// After the final param byte is received main status changes to 0xd0 /// Data register (ST3) result is 0x51 if drive/disk not available @@ -2336,7 +2336,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC SetBit(MSR_EXM, ref StatusMain); SetBit(MSR_CB, ref StatusMain); - // overrun detection + // overrun detection OverrunCounter++; if (OverrunCounter >= 64) { @@ -2447,7 +2447,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC //// we are in command phase case Phase.Command: // attempt to process this parameter byte - //ProcessCommand(data); + //ProcessCommand(data); ActiveCommand.CommandDelegate(); break; //// we are in execution phase diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs index ead144fb44..1b53d97b74 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs @@ -157,7 +157,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Signs whether the current active drive has a disk inserted - /// + /// public bool FDD_IsDiskLoaded => DriveStates[DiskDriveIndex].FDD_IsDiskLoaded; /// @@ -404,7 +404,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC else return null; } - + /// /// Populates a result buffer @@ -650,7 +650,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // seek emulation processed immediately case SeekSubState.MoveImmediate: - + if (CurrentTrack < SeekingTrack) { // we are seeking forward @@ -704,10 +704,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { SetBit(SR0_EC, ref IntStatus); } - } + } // set seek end - SetBit(SR0_SE, ref IntStatus); + SetBit(SR0_SE, ref IntStatus); /* // head address if (CurrentSide > 0) @@ -790,7 +790,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Signs whether the current active drive has a disk inserted - /// + /// public bool FDD_IsDiskLoaded { get diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/GateArray.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/GateArray.cs index 60956ba41b..49219d5357 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/GateArray.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/GateArray.cs @@ -181,7 +181,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// private static readonly int[] CPCHardwarePalette = { - Colors.ARGB(0x80, 0x80, 0x80), // White + Colors.ARGB(0x80, 0x80, 0x80), // White Colors.ARGB(0x80, 0x80, 0x80), // White (duplicate) Colors.ARGB(0x00, 0xFF, 0x80), // Sea Green Colors.ARGB(0xFF, 0xFF, 0x80), // Pastel Yellow @@ -209,9 +209,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Colors.ARGB(0x80, 0xFF, 0x80), // Pastel Green Colors.ARGB(0x80, 0xFF, 0x00), // Lime Colors.ARGB(0x80, 0xFF, 0xFF), // Pastel Cyan - Colors.ARGB(0x80, 0x00, 0x00), // Red + Colors.ARGB(0x80, 0x00, 0x00), // Red Colors.ARGB(0x80, 0x00, 0xFF), // Mauve - Colors.ARGB(0x80, 0x80, 0x00), // Yellow + Colors.ARGB(0x80, 0x80, 0x00), // Yellow Colors.ARGB(0x80, 0x80, 0xFF), // Pastel Blue }; @@ -221,22 +221,22 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// - Mode 1, 320x200 resolution, 4 colours /// - Mode 2, 640x200 resolution, 2 colours /// - Mode 3, 160x200 resolution, 4 colours (undocumented) - /// + /// /// When screenmode is updated it will take effect after the next HSync /// private byte _screenMode; /// /// PENR (register 0) - Pen Selection - /// This register can be used to select one of the 17 color-registers (pen 0 to 15 or the border). + /// This register can be used to select one of the 17 color-registers (pen 0 to 15 or the border). /// It will remain selected until another PENR command is executed. - /// PENR Index + /// PENR Index /// 7 6 5 4 3 2 1 0 color register selected /// 0 0 0 0 n n n n pen n from 0 to 15 (4bits) /// 0 0 0 1 x x x x border - /// + /// /// x can be 0 or 1, it doesn't matter - /// + /// public byte PENR { get => _PENR; @@ -259,14 +259,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// INKR (register 1) - Colour Selection - /// This register takes a 5bits parameter which is a color-code. This color-code range from 0 to 31 but there's only 27 differents colors + /// This register takes a 5bits parameter which is a color-code. This color-code range from 0 to 31 but there's only 27 differents colors /// (because the Gate Array use a 3-states logic on the R,G and B signals, thus 3x3x3=27). - /// INKR Color - /// 7 6 5 4 3 2 1 0 + /// INKR Color + /// 7 6 5 4 3 2 1 0 /// 0 1 0 n n n n n where n is a color code (5 bits) - /// + /// /// The PEN affected by the INKR command is updated (almost) immediatly - /// + /// public byte INKR { get => _INKR; @@ -288,12 +288,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// RMR Commands /// 7 6 5 4 3 2 1 0 /// 1 0 0 I UR LR VM--> - /// + /// /// I : if set (1), this will reset the interrupt counter /// UR : Enable (0) or Disable (1) the upper ROM paging (&C000 to &FFFF). You can select which upper ROM with the I/O address &DF00 /// LR : Enable (0) or Disable (1) the lower ROM paging /// VM : Select the video mode 0,1,2 or 3 (it will take effect after the next HSync) - /// + /// public byte RMR { get => _RMR; @@ -336,7 +336,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// HSYNC signal that is generated by the GA and combined with C_VSYNC before being sent to the CRT /// private bool C_HSYNC; - + /// /// Gatearray is outputting black colour during vsync /// @@ -420,7 +420,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC LastGAFrameClocks = GAClockCounter; } - + } } private int _v26; @@ -490,7 +490,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // gate array hsync is enabled GA_HSYNC = true; // hsync black colour enabled - C_HSYNC_Black = true; + C_HSYNC_Black = true; } /// @@ -550,7 +550,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // reset the frame clock counter //FrameEnd = true; //GAClockCounter = -1; - + // interrupts should be syncronised with the start of the frame now (i.e. InterruptCounter = 0) // CRT beam position should be at the start of the display area @@ -578,7 +578,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// private byte[] _videoData = new byte[2]; - private ushort[] _videoAddr = new ushort[2]; + private ushort[] _videoAddr = new ushort[2]; private byte[] _videoDataBuffer = new byte[64]; @@ -594,19 +594,19 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC VideoDataPntr++; _videoDataBuffer[VideoDataPntr] = data; } - + /// /// Gate array is clocked at 16MHz (which is also the pixel clock) /// It implements a 4-phase clock that is in charge of clocking the following devices: - /// + /// /// * CPU: 4MHz (4 GA clocks per z80 PHI clock) /// * CRTC: 1MHz (16 GA clocks per CRTC clock) /// * PSG: 1MHz (16 GA clocks per PSG clock) - /// + /// /// Regardless of screen mode, the GA will output a single pixel every 1 GA clock (so a 16MHz pixel clock) /// It constantly reads video data at 2MHz (8 GA clocks per byte) - /// + /// /// So: /// - 16 GA clocks (1MHz) takes 1 microsecond, one CRTC character /// - 8 GA clocks (2MHz) takes 0.5 microseconds, a byte of video data is read and 8 pixels are output @@ -622,7 +622,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC GAClockCounterOriginVSYNC++; - // Based on timing oscilloscope traces from + // Based on timing oscilloscope traces from // https://bread80.com // and section 16.2.2 of ACCC1.8 switch (_xtal) @@ -711,7 +711,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC case 7: // /RAS LOW - // /CAS_ADDR LOW + // /CAS_ADDR LOW break; case 8: @@ -775,14 +775,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC break; } - + _xtal++; // enforce 4-bit wraparound _xtal &= 0x0F; - + /* if (GA_VSYNC) { @@ -945,9 +945,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC CRT.VideoClock(colour, -1, C_HSYNC, C_VSYNC); //CRT.VideoClock(vid, -1); } - } + } + - /// /// Device responds to an IN instruction @@ -967,7 +967,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } } - + public bool GateArrayUnlocked { get; set; } /// @@ -1072,14 +1072,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Maximum screen width in pixels /// - private const int MAX_SCREEN_WIDTH_PIXELS = PIXEL_WIDTH_PER_CHAR * MAX_SCR_CHA_WIDTH; // 1024 pixels + private const int MAX_SCREEN_WIDTH_PIXELS = PIXEL_WIDTH_PER_CHAR * MAX_SCR_CHA_WIDTH; // 1024 pixels /// /// Beam renders 2 scanlines at a time /// private const int TOTAL_DISPLAY_SCANLINES = MAX_SCREEN_SCANLINES * 2; - + public void SyncState(Serializer ser) { @@ -1127,7 +1127,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// CPC Hardware Palette Index (the INKR number) /// - public int IndexINKR { get; set; } + public int IndexINKR { get; set; } /// /// 12-bit ASIC index value diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/LibFz80.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/LibFz80.cs index f6f4e18390..0cef63d161 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/LibFz80.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/LibFz80.cs @@ -429,8 +429,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC ser.Sync(nameof(_pins), ref _pins); ser.Sync(nameof(TotalExecutedCycles), ref TotalExecutedCycles); - + ser.EndSection(); } - } + } } diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PAL16L8.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PAL16L8.cs index a20e5c1d0d..c7d78f49b0 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PAL16L8.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PAL16L8.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// PAL MMR Register /// This register exists only in CPCs with 128K RAM (like the CPC 6128, or CPCs with Standard Memory Expansions) /// Note: In the CPC 6128, the register is a separate PAL that assists the Gate Array chip - /// + /// /// Bit Value Function /// 7 1 MMR register enable /// 6 1 MMR register enable @@ -23,23 +23,23 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// 4 b /// 3 b /// 2 x RAM Config(0..7) - /// 1 x "" + /// 1 x "" /// 0 x "" - /// - /// The 3bit RAM Config value is used to access the second 64K of the total 128K RAM that is built into the CPC 6128 or the additional 64K-512K of standard memory expansions. - /// These contain up to eight 64K ram banks, which are selected with bit 3-5. A standard CPC 6128 only contains bank 0. Normally the register is set to 0, so that only the + /// + /// The 3bit RAM Config value is used to access the second 64K of the total 128K RAM that is built into the CPC 6128 or the additional 64K-512K of standard memory expansions. + /// These contain up to eight 64K ram banks, which are selected with bit 3-5. A standard CPC 6128 only contains bank 0. Normally the register is set to 0, so that only the /// first 64K RAM are used (identical to the CPC 464 and 664 models). The register can be used to select between the following eight predefined configurations only: - /// + /// /// -Address- 0 1 2 3 4 5 6 7 /// 0000-3FFF RAM_0 RAM_0 RAM_4 RAM_0 RAM_0 RAM_0 RAM_0 RAM_0 /// 4000-7FFF RAM_1 RAM_1 RAM_5 RAM_3 RAM_4 RAM_5 RAM_6 RAM_7 /// 8000-BFFF RAM_2 RAM_2 RAM_6 RAM_2 RAM_2 RAM_2 RAM_2 RAM_2 /// C000-FFFF RAM_3 RAM_7 RAM_7 RAM_7 RAM_3 RAM_3 RAM_3 RAM_3 - /// + /// /// The Video RAM is always located in the first 64K, VRAM is in no way affected by this register /// public byte MMR => _MMR; - private byte _MMR; + private byte _MMR; public PAL16L8(CPCBase machine) { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PPI_8255.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PPI_8255.cs index 5e03476f76..42dab20405 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PPI_8255.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/PPI_8255.cs @@ -310,7 +310,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // PSG (Sound/Keyboard/Joystick) result = INPortA(); - + break; // Port B Read diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Screen.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Screen.cs index 2d69348664..b4bf295bfa 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Screen.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Screen.cs @@ -5,10 +5,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC { /// /// Basic emulation of a PAL Amstrad CPC CRT screen - /// - /// Decoding of C-SYNC pulses are not emulated properly, + /// + /// Decoding of C-SYNC pulses are not emulated properly, /// we just assume that so long as the C-VSYNC and C-HSYNC periods are correct, the screen will display. - /// + /// /// References used: /// - https://www.cpcwiki.eu/index.php/GT64/GT65 /// - https://www.cpcwiki.eu/index.php/CTM640/CTM644 @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// /// Arbirary processing buffer width /// - private const int FRAMEBUFFER_MAX_WIDTH = 1024; + private const int FRAMEBUFFER_MAX_WIDTH = 1024; /// /// Total scanlines per frame @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC private int _timePosV; private int _verticalTiming; - private bool _isVsync; + private bool _isVsync; private bool _frameEndPending; /// @@ -111,7 +111,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public void VideoClock(int colour, int field, bool cHsync = false, bool cVsync = false) { // Beam moves continuously downwards at 50 Hz and left to right with a HSYNC pulse every 15625Hz - // Horizontal and vertical movement are independent. + // Horizontal and vertical movement are independent. // PAL Horizontal: // - Beam moves right at a rate of 16 pixels per usec @@ -123,11 +123,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // - Beam moves down at a rate of 1 line per 64 microseconds (although this movement covers two scanlines) // - As soon as a VSYNC signal is detected, the PLL capacitor discharges and the beam moves back to the top (at the same horizontal position that VSYNC started) // - If a VSYNC is not detected in time, the PLL will eventually move the beam back to the top - // - Unsure what the vertical screen time for this action is. + // - Unsure what the vertical screen time for this action is. int hHold = 118; // pixels - approx (71.43 - 64) * 16 int vHold = 3; // scanlines - + // * horizontal movement * // gun moves left to right at a rate of 16 pixels per usec @@ -199,7 +199,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // no vsync _isVsync = false; } - + void HackHPos() { // the field length is actually 312.5 scanlines, so HSYNC happens half way through a scanline diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC464/CPC464.Port.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC464/CPC464.Port.cs index 2486e18cda..265736c343 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC464/CPC464.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC464/CPC464.Port.cs @@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } } - return (byte)finalResult; + return (byte)finalResult; } /// diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC6128/CPC6128.Port.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC6128/CPC6128.Port.cs index 0cfe9dd62e..554657e36d 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC6128/CPC6128.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Machine/CPC6128/CPC6128.Port.cs @@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC if (!deviceResponse) finalResult |= result; */ - } + } if (d == PortDevice.ROMSelect && !deviceResponse) { @@ -114,7 +114,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } else if (d == PortDevice.PAL) { - PAL.WritePort(port, value); + PAL.WritePort(port, value); } else if (d == PortDevice.CRCT) { diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/CPCFloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/CPCFloppyDisk.cs index 901ea9a350..1e05f7658c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/CPCFloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/CPCFloppyDisk.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public override DiskType DiskFormatType => DiskType.CPC; /// - /// Attempts to parse incoming disk data + /// Attempts to parse incoming disk data /// /// /// TRUE: disk parsed diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/FloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/FloppyDisk.cs index bdfb1dc4d3..21331af31c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/FloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Disk/FloppyDisk.cs @@ -306,7 +306,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // TrackID is consistent between the sectors although is usually high (233, 237 etc) // SideID is fairly random looking but with all IDs being even // SectorID is also fairly random looking but contains both odd and even numbers - // + // // There doesnt appear to be any CRC errors in this track, but the sector size is always 1 (256 bytes) // Each sector contains different filler byte // Once track 0 is loaded the CPU completely reads all the sectors in this track one-by-one. @@ -394,7 +394,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // Hexagon Copy Protection Notes (-asni 2018-05-01) // --------------------------------------------------- // - // + // return false; } diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs index c941eb3b03..97b7e27af4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/CDT/CdtConverter.cs @@ -329,11 +329,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Offset Value Type Description 0x00 - WORD Pause after this block (ms.) {1000} 0x02 N WORD Length of data that follow - 0x04 - BYTE[N] Data as in .TAP files + 0x04 - BYTE[N] Data as in .TAP files - This block must be replayed with the standard Spectrum ROM timing values - see the values in - curly brackets in block ID 11. The pilot tone consists in 8063 pulses if the first data byte - (flag byte) is < 128, 3223 otherwise. This block can be used for the ROM loading routines AND + This block must be replayed with the standard Spectrum ROM timing values - see the values in + curly brackets in block ID 11. The pilot tone consists in 8063 pulses if the first data byte + (flag byte) is < 128, 3223 otherwise. This block can be used for the ROM loading routines AND for custom loading routines that use the same timings as ROM ones do. */ private void ProcessBlockID10(byte[] data) { @@ -378,14 +378,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x08 - WORD Length of ONE bit pulse {1710} 0x0A - WORD Length of PILOT tone (number of pulses) {8063 header (flag<128), 3223 data (flag>=128)} 0x0C - BYTE Used bits in the last byte (other bits should be 0) {8} - (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, + (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, where MSb is the leftmost bit, LSb is the rightmost bit) 0x0D - WORD Pause after this block (ms.) {1000} 0x0F N BYTE[3] Length of data that follow - 0x12 - BYTE[N] Data as in .TAP files + 0x12 - BYTE[N] Data as in .TAP files - This block is very similar to the normal TAP block but with some additional info on the timings and other important - differences. The same tape encoding is used as for the standard speed data block. If a block should use some non-standard + This block is very similar to the normal TAP block but with some additional info on the timings and other important + differences. The same tape encoding is used as for the standard speed data block. If a block should use some non-standard sync or pilot tones (i.e. all sorts of protection schemes) then use the next three blocks to describe it.*/ private void ProcessBlockID11(byte[] data) { @@ -432,9 +432,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /* length: 04 Offset Value Type Description 0x00 - WORD Length of one pulse in T-states - 0x02 - WORD Number of pulses + 0x02 - WORD Number of pulses - This will produce a tone which is basically the same as the pilot tone in the ID 10, ID 11 blocks. You can define how + This will produce a tone which is basically the same as the pilot tone in the ID 10, ID 11 blocks. You can define how long the pulse is and how many pulses are in the tone. */ private void ProcessBlockID12(byte[] data) { @@ -470,9 +470,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /* length: [00]*02+01 Offset Value Type Description 0x00 N BYTE Number of pulses - 0x01 - WORD[N] Pulses' lengths + 0x01 - WORD[N] Pulses' lengths - This will produce N pulses, each having its own timing. Up to 255 pulses can be stored in this block; this is useful for non-standard + This will produce N pulses, each having its own timing. Up to 255 pulses can be stored in this block; this is useful for non-standard sync tones used by some protection schemes. */ private void ProcessBlockID13(byte[] data) { @@ -507,11 +507,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x00 - WORD Length of ZERO bit pulse 0x02 - WORD Length of ONE bit pulse 0x04 - BYTE Used bits in last byte (other bits should be 0) - (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, + (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, where MSb is the leftmost bit, LSb is the rightmost bit) 0x05 - WORD Pause after this block (ms.) 0x07 N BYTE[3] Length of data that follow - 0x0A - BYTE[N] Data as in .TAP files + 0x0A - BYTE[N] Data as in .TAP files This is the same as in the turbo loading data block, except that it has no pilot or sync pulses. */ private void ProcessBlockID14(byte[] data) @@ -561,12 +561,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC (e.g. if this is 2, only first two samples of the last byte will be played) 0x05 N BYTE[3] Length of samples' data 0x08 - BYTE[N] Samples data. Each bit represents a state on the EAR port (i.e. one sample). - MSb is played first. + MSb is played first. - This block is used for tapes which have some parts in a format such that the turbo loader block cannot be used. - This is not like a VOC file, since the information is much more compact. Each sample value is represented by one bit only + This block is used for tapes which have some parts in a format such that the turbo loader block cannot be used. + This is not like a VOC file, since the information is much more compact. Each sample value is represented by one bit only (0 for low, 1 for high) which means that the block will be at most 1/8 the size of the equivalent VOC. - The preferred sampling frequencies are 22050 or 44100 Hz (158 or 79 T-states/sample). + The preferred sampling frequencies are 22050 or 44100 Hz (158 or 79 T-states/sample). Please, if you can, don't use other sampling frequencies. Please use this block only if you cannot use any other block. */ private void ProcessBlockID15(byte[] data) @@ -753,12 +753,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC (TOTP>0)*((2*NPP+1)*ASP)+ TOTP*3+ (2*NPD+1)*ASD - BYTE[DS] Data stream - This field is present only if TOTD>0 + This field is present only if TOTD>0 This block has been specifically developed to represent an extremely wide range of data encoding techniques. - The basic idea is that each loading component (pilot tone, sync pulses, data) is associated to a specific sequence - of pulses, where each sequence (wave) can contain a different number of pulses from the others. - In this way we can have a situation where bit 0 is represented with 4 pulses and bit 1 with 8 pulses. + The basic idea is that each loading component (pilot tone, sync pulses, data) is associated to a specific sequence + of pulses, where each sequence (wave) can contain a different number of pulses from the others. + In this way we can have a situation where bit 0 is represented with 4 pulses and bit 1 with 8 pulses. ---- SYMDEF structure format @@ -771,11 +771,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 11: force high level 0x01 - WORD[MAXP] Array of pulse lengths. - The alphabet is stored using a table where each symbol is a row of pulses. The number of columns (i.e. pulses) of the table is the - length of the longest sequence amongst all (MAXP=NPP or NPD, for pilot/sync or data blocks respectively); shorter waves are terminated by a + The alphabet is stored using a table where each symbol is a row of pulses. The number of columns (i.e. pulses) of the table is the + length of the longest sequence amongst all (MAXP=NPP or NPD, for pilot/sync or data blocks respectively); shorter waves are terminated by a zero-length pulse in the sequence. - Any number of data symbols is allowed, so we can have more than two distinct waves; for example, imagine a loader which writes two bits at a - time by encoding them with four distinct pulse lengths: this loader would have an alphabet of four symbols, each associated to a specific + Any number of data symbols is allowed, so we can have more than two distinct waves; for example, imagine a loader which writes two bits at a + time by encoding them with four distinct pulse lengths: this loader would have an alphabet of four symbols, each associated to a specific sequence of pulses (wave). ---- ---- @@ -784,10 +784,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x00 - BYTE Symbol to be represented 0x01 - WORD Number of repetitions - Most commonly, pilot and sync are repetitions of the same pulse, thus they are represented using a very simple RLE encoding structure which stores + Most commonly, pilot and sync are repetitions of the same pulse, thus they are represented using a very simple RLE encoding structure which stores the symbol and the number of times it must be repeated. - Each symbol in the data stream is represented by a string of NB bits of the block data, where NB = ceiling(Log2(ASD)). - Thus the length of the whole data stream in bits is NB*TOTD, or in bytes DS=ceil(NB*TOTD/8). + Each symbol in the data stream is represented by a string of NB bits of the block data, where NB = ceiling(Log2(ASD)). + Thus the length of the whole data stream in bits is NB*TOTD, or in bytes DS=ceil(NB*TOTD/8). ---- */ private void ProcessBlockID19(byte[] data) { @@ -830,7 +830,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Offset Value Type Description 0x00 - WORD Pause duration (ms.) - This will make a silence (low amplitude level (0)) for a given time in milliseconds. If the value is 0 then the + This will make a silence (low amplitude level (0)) for a given time in milliseconds. If the value is 0 then the emulator or utility should (in effect) STOP THE TAPE, i.e. should not continue loading until the user or emulator requests it. */ private void ProcessBlockID20(byte[] data) { @@ -886,10 +886,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /* length: [00]+01 Offset Value Type Description 0x00 L BYTE Length of the group name string - 0x01 - CHAR[L] Group name in ASCII format (please keep it under 30 characters long) + 0x01 - CHAR[L] Group name in ASCII format (please keep it under 30 characters long) - This block marks the start of a group of blocks which are to be treated as one single (composite) block. - This is very handy for tapes that use lots of subblocks like Bleepload (which may well have over 160 custom loading blocks). + This block marks the start of a group of blocks which are to be treated as one single (composite) block. + This is very handy for tapes that use lots of subblocks like Bleepload (which may well have over 160 custom loading blocks). You can also give the group a name (example 'Bleepload Block 1'). For each group start block, there must be a group end block. Nesting of groups is not allowed. */ private void ProcessBlockID21(byte[] data) @@ -913,11 +913,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += nameLength; } - /* length: 00 + /* length: 00 This indicates the end of a group. This block has no body. */ private void ProcessBlockID22(byte[] data) @@ -937,9 +937,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /* length: 02 Offset Value Type Description - 0x00 - WORD Relative jump value + 0x00 - WORD Relative jump value - This block will enable you to jump from one block to another within the file. The value is a signed short word + This block will enable you to jump from one block to another within the file. The value is a signed short word (usually 'signed short' in C); Some examples: Jump 0 = 'Loop Forever' - this should never happen Jump 1 = 'Go to the next block' - it is like NOP in assembler ;) @@ -982,15 +982,15 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 2; } /* length: 02 Offset Value Type Description - 0x00 - WORD Number of repetitions (greater than 1) + 0x00 - WORD Number of repetitions (greater than 1) - If you have a sequence of identical blocks, or of identical groups of blocks, you can use this block to tell how many times they should + If you have a sequence of identical blocks, or of identical groups of blocks, you can use this block to tell how many times they should be repeated. This block is the same as the FOR statement in BASIC. For simplicity reasons don't nest loop blocks! */ private void ProcessBlockID24(byte[] data) @@ -1021,13 +1021,13 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 2; } - /* length: 00 + /* length: 00 - This is the same as BASIC's NEXT statement. It means that the utility should jump back to the start of the loop if it hasn't + This is the same as BASIC's NEXT statement. It means that the utility should jump back to the start of the loop if it hasn't been run for the specified number of times. This block has no body. */ private void ProcessBlockID25(byte[] data) @@ -1075,12 +1075,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /* length: [00,01]*02+02 Offset Value Type Description 0x00 N WORD Number of calls to be made - 0x02 - WORD[N] Array of call block numbers (relative-signed offsets) + 0x02 - WORD[N] Array of call block numbers (relative-signed offsets) - This block is an analogue of the CALL Subroutine statement. It basically executes a sequence of blocks that are somewhere else and - then goes back to the next block. Because more than one call can be normally used you can include a list of sequences to be called. - The 'nesting' of call blocks is also not allowed for the simplicity reasons. You can, of course, use the CALL blocks in the LOOP - sequences and vice versa. The value is relative for the obvious reasons - so that you can add some blocks in the beginning of the + This block is an analogue of the CALL Subroutine statement. It basically executes a sequence of blocks that are somewhere else and + then goes back to the next block. Because more than one call can be normally used you can include a list of sequences to be called. + The 'nesting' of call blocks is also not allowed for the simplicity reasons. You can, of course, use the CALL blocks in the LOOP + sequences and vice versa. The value is relative for the obvious reasons - so that you can add some blocks in the beginning of the file without disturbing the call values. Please take a look at 'Jump To Block' for reference on the values. */ private void ProcessBlockID26(byte[] data) { @@ -1099,13 +1099,13 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockSize; } - /* length: 00 + /* length: 00 - This block indicates the end of the Called Sequence. The next block played will be the block after the last CALL block (or the next Call, + This block indicates the end of the Called Sequence. The next block played will be the block after the last CALL block (or the next Call, if the Call block had multiple calls). Again, this block has no body. */ private void ProcessBlockID27(byte[] data) @@ -1127,7 +1127,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Offset Value Type Description 0x00 - WORD Length of the whole block (without these two bytes) 0x02 N BYTE Number of selections - 0x03 - SELECT[N] List of selections + 0x03 - SELECT[N] List of selections ---- SELECT structure format @@ -1137,9 +1137,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x03 - CHAR[L] Description text (please use single line and max. 30 chars) ---- - This block is useful when the tape consists of two or more separately-loadable parts. With this block, you are able to select - one of the parts and the utility/emulator will start loading from that block. For example you can use it when the game has a - separate Trainer or when it is a multiload. Of course, to make some use of it the emulator/utility has to show a menu with the + This block is useful when the tape consists of two or more separately-loadable parts. With this block, you are able to select + one of the parts and the utility/emulator will start loading from that block. For example you can use it when the game has a + separate Trainer or when it is a multiload. Of course, to make some use of it the emulator/utility has to show a menu with the selections when it encounters such a block. All offsets are relative signed words. */ private void ProcessBlockID28(byte[] data) { @@ -1158,7 +1158,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockSize; } @@ -1166,7 +1166,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Offset Value Type Description 0x00 0 DWORD Length of the block without these four bytes (0) - When this block is encountered, the tape will stop ONLY if the machine is an 48K Spectrum. This block is to be used for + When this block is encountered, the tape will stop ONLY if the machine is an 48K Spectrum. This block is to be used for multiloading games that load one level at a time in 48K mode, but load the entire tape at once if in 128K mode. This block has no body of its own, but follows the extension rule. */ private void ProcessBlockID2A(byte[] data) @@ -1186,7 +1186,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockSize; } @@ -1195,7 +1195,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x00 1 DWORD Block length (without these four bytes) 0x04 - BYTE Signal level (0=low, 1=high) - This block sets the current signal level to the specified value (high or low). It should be used whenever it is necessary to avoid any + This block sets the current signal level to the specified value (high or low). It should be used whenever it is necessary to avoid any ambiguities, e.g. with custom loaders which are level-sensitive. */ private void ProcessBlockID2B(byte[] data) { @@ -1210,7 +1210,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 5; } @@ -1219,10 +1219,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x00 N BYTE Length of the text description 0x01 - CHAR[N] Text description in ASCII format - This is meant to identify parts of the tape, so you know where level 1 starts, where to rewind to when the game ends, etc. - This description is not guaranteed to be shown while the tape is playing, but can be read while browsing the tape or changing + This is meant to identify parts of the tape, so you know where level 1 starts, where to rewind to when the game ends, etc. + This description is not guaranteed to be shown while the tape is playing, but can be read while browsing the tape or changing the tape pointer. - The description can be up to 255 characters long but please keep it down to about 30 so the programs can show it in one line + The description can be up to 255 characters long but please keep it down to about 30 so the programs can show it in one line (where this is appropriate). Please use 'Archive Info' block for title, authors, publisher, etc. */ private void ProcessBlockID30(byte[] data) @@ -1246,7 +1246,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += textLen; } @@ -1256,7 +1256,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x01 N BYTE Length of the text message 0x02 - CHAR[N] Message that should be displayed in ASCII format - This will enable the emulators to display a message for a given time. This should not stop the tape and it should not make silence. + This will enable the emulators to display a message for a given time. This should not stop the tape and it should not make silence. If the time is 0 then the emulator should wait for the user to press a key. The text message should: stick to a maximum of 30 chars per line; @@ -1289,7 +1289,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += msgLen; } @@ -1317,10 +1317,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 0x02 - CHAR[L] Text string in ASCII format ---- - Use this block at the beginning of the tape to identify the title of the game, author, publisher, year of publication, price (including - the currency), type of software (arcade adventure, puzzle, word processor, ...), protection scheme it uses (Speedlock 1, Alkatraz, ...) - and its origin (Original, Budget re-release, ...), etc. This block is built in a way that allows easy future expansion. - The block consists of a series of text strings. Each text has its identification number (which tells us what the text means) and then + Use this block at the beginning of the tape to identify the title of the game, author, publisher, year of publication, price (including + the currency), type of software (arcade adventure, puzzle, word processor, ...), protection scheme it uses (Speedlock 1, Alkatraz, ...) + and its origin (Original, Budget re-release, ...), etc. This block is built in a way that allows easy future expansion. + The block consists of a series of text strings. Each text has its identification number (which tells us what the text means) and then the ASCII text. To make it possible to skip this block, if needed, the length of the whole block is at the beginning of it. If all texts on the tape are in English language then you don't have to supply the 'Language' field The information about what hardware the tape uses is in the 'Hardware Type' block, so no need for it here. */ @@ -1420,10 +1420,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 03 - The tape DOESN'T RUN on this machine or with this hardware. ---- - This blocks contains information about the hardware that the programs on this tape use. Please include only machines and hardware for - which you are 100% sure that it either runs (or doesn't run) on or with, or you know it uses (or doesn't use) the hardware or special + This blocks contains information about the hardware that the programs on this tape use. Please include only machines and hardware for + which you are 100% sure that it either runs (or doesn't run) on or with, or you know it uses (or doesn't use) the hardware or special features of that machine. - If the tape runs only on the ZX81 (and TS1000, etc.) then it clearly won't work on any Spectrum or Spectrum variant, so there's no + If the tape runs only on the ZX81 (and TS1000, etc.) then it clearly won't work on any Spectrum or Spectrum variant, so there's no need to list this information. If you are not sure or you haven't tested a tape on some particular machine/hardware combination then do not include it in the list. The list of hardware types and IDs is somewhat large, and may be found at the end of the format description. */ @@ -1458,9 +1458,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC Offset Value Type Description 0x00 - CHAR[10] Identification string (in ASCII) 0x10 L DWORD Length of the custom info - 0x14 - BYTE[L] Custom info + 0x14 - BYTE[L] Custom info - This block can be used to save any information you want. For example, it might contain some information written by a utility, + This block can be used to save any information you want. For example, it might contain some information written by a utility, extra settings required by a particular emulator, or even poke data. */ private void ProcessBlockID35(byte[] data) { @@ -1482,19 +1482,19 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockLen; } /* length: 09 Offset Value Type Description - 0x00 - BYTE[9] Value: { "XTape!",0x1A,MajR,MinR } - Just skip these 9 bytes and you will end up on the next ID. + 0x00 - BYTE[9] Value: { "XTape!",0x1A,MajR,MinR } + Just skip these 9 bytes and you will end up on the next ID. - This block is generated when you merge two ZX Tape files together. It is here so that you can easily copy the files together and use - them. Of course, this means that resulting file would be 10 bytes longer than if this block was not used. All you have to do + This block is generated when you merge two ZX Tape files together. It is here so that you can easily copy the files together and use + them. Of course, this means that resulting file would be 10 bytes longer than if this block was not used. All you have to do if you encounter this block ID is to skip next 9 bytes. - If you can avoid using this block for this purpose, then do so; it is preferable to use a utility to join the two files and + If you can avoid using this block for this purpose, then do so; it is preferable to use a utility to join the two files and ensure that they are both of the higher version number. */ private void ProcessBlockID5A(byte[] data) { @@ -1509,7 +1509,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 9; } @@ -1528,7 +1528,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 4; } @@ -1548,7 +1548,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block int blockLen = GetInt32(data, _position); _position += blockLen; } @@ -1567,7 +1567,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block int blockLen = GetInt32(data, _position); _position += blockLen; } @@ -1585,7 +1585,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 8; } @@ -1595,11 +1595,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC 00: .Z80 format 01: .SNA format 0x01 L BYTE[3] Snapshot length - 0x04 - BYTE[L] Snapshot itself + 0x04 - BYTE[L] Snapshot itself - This would enable one to snapshot the game at the start and still have all the tape blocks (level data, etc.) in the same file. + This would enable one to snapshot the game at the start and still have all the tape blocks (level data, etc.) in the same file. Only .Z80 and .SNA snapshots are supported for compatibility reasons! - The emulator should take care of that the snapshot is not taken while the actual Tape loading is taking place (which doesn't do much sense). + The emulator should take care of that the snapshot is not taken while the actual Tape loading is taking place (which doesn't do much sense). And when an emulator encounters the snapshot block it should load it and then continue with the next block. */ private void ProcessBlockID40(byte[] data) { @@ -1622,7 +1622,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockLen; } @@ -1649,10 +1649,10 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC string description = string.Empty; // process the type byte - /* (The type is 0,1,2 or 3 for a Program, Number array, Character array or Code file. - A SCREEN$ file is regarded as a Code file with start address 16384 and length 6912 decimal. - If the file is a Program file, parameter 1 holds the autostart line number (or a number >=32768 if no LINE parameter was given) - and parameter 2 holds the start of the variable area relative to the start of the program. If it's a Code file, parameter 1 holds + /* (The type is 0,1,2 or 3 for a Program, Number array, Character array or Code file. + A SCREEN$ file is regarded as a Code file with start address 16384 and length 6912 decimal. + If the file is a Program file, parameter 1 holds the autostart line number (or a number >=32768 if no LINE parameter was given) + and parameter 2 holds the start of the variable area relative to the start of the program. If it's a Code file, parameter 1 holds the start of the code block when saved, and parameter 2 holds 32768. For data files finally, the byte at position 14 decimal holds the variable name.) */ @@ -1751,7 +1751,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC description = $"#{blockdata[0]:X2} block, {blockSize} bytes"; //description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok"; block.AddMetaData(BlockDescriptorTitle.Undefined, description); - } + } */ } diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/TapeDataBlock.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/TapeDataBlock.cs index 5ba41f11da..f6ddea2793 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/TapeDataBlock.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Media/Tape/TapeDataBlock.cs @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC /// An array of bytearray encoded strings (stored in this format for easy Bizhawk serialization) /// Its basically tape information /// - private byte[][] _tapeDescriptionData; + private byte[][] _tapeDescriptionData; /// /// Returns the Tape Description Data in a human readable format diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs index 242c42db66..942cd311f3 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/SoundProviderMixer.cs @@ -173,7 +173,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC } else { - // just process what we have as-is + // just process what we have as-is } } diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs index 390a72d132..fb72e17c5e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII } } - public void Step(StepType type) + public void Step(StepType type) { switch (type) { diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs index b2547e6557..928703b2ad 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII _ => (romAssert.FileData, ".DSK") // no idea, let's assume it's just a .DSK? }; } - + _romSet = lp.Roms.Select(GetRomAndExt).ToList(); var ser = new BasicServiceProvider(this); ServiceProvider = ser; @@ -233,12 +233,12 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII private long _clockTime; private int _clockRemainder; private const int TicksInSecond = 10000000; // DateTime.Ticks uses 100-nanosecond intervals - + private DateTime GetFrontendTime() { if (_useRealTime && DeterministicEmulation) throw new InvalidOperationException(); - + return _useRealTime ? DateTime.Now : new DateTime(_clockTime * TicksInSecond + (_clockRemainder * TicksInSecond / VsyncNumerator)); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs index 2f0001e7e4..a2c5e3fa97 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs @@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 BasicRom = new Chip23128(); CharRom = new Chip23128(); KernalRom = new Chip23128(); - + if (Cpu != null) Cpu.DebuggerStep = Execute; if (DiskDrive != null) diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs index b6dea718c9..49bcdfa252 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 { ser.Register(cartSaveRam); } - + HardReset(); switch (SyncSettings.VicType) @@ -169,7 +169,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 private int _frame; private readonly ITraceable _tracer; - + // Power stuff private bool _powerPressed; private bool _resetPressed; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Am29F040B.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Am29F040B.cs index 59e118ffef..66470c2922 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Am29F040B.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Am29F040B.cs @@ -41,7 +41,7 @@ public class Am29F040B Complete, Command } - + private enum Mode { Read, @@ -90,12 +90,12 @@ public class Am29F040B public void Clock() { - if (_busyTimeRemaining <= 0) + if (_busyTimeRemaining <= 0) return; _busyTimeRemaining--; - if (_busyTimeRemaining != 0) + if (_busyTimeRemaining != 0) return; _status ^= PollingBit; @@ -174,7 +174,7 @@ public class Am29F040B _status ^= ToggleBit; return _status; } - + // Some commands allow one read of status before going back to read mode. // Areas being written or erased will always return status during modification. if (_returnStatus && addr >= _startAddress && addr <= _endAddress) @@ -277,7 +277,7 @@ public class Am29F040B if (_busyTimeRemaining > 0) break; - _busyTimeRemaining = EraseSectorLatency; // ~1sec + _busyTimeRemaining = EraseSectorLatency; // ~1sec _data.AsSpan(addr & ~SectorMask, SectorSize).Fill(0xFF); _dataDirty = true; _returnStatus = true; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs index 17e601d98c..8347073a53 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/CartridgeDevice.cs @@ -266,7 +266,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { } - public virtual IEnumerable CreateMemoryDomains() => + public virtual IEnumerable CreateMemoryDomains() => Array.Empty(); private bool _driveLightEnabled; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0007.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0007.cs index 69281d9a48..89595c34f2 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0007.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0007.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { internal sealed class Mapper0007 : CartridgeDevice { - private readonly int[,] _banks = new int[16, 0x2000]; + private readonly int[,] _banks = new int[16, 0x2000]; private int _bankNumber; private bool _disabled; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0008.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0008.cs index 299d73d5c3..79cfe4bd43 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0008.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0008.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { internal sealed class Mapper0008 : CartridgeDevice { - private readonly int[,] _banks = new int[4, 0x4000]; + private readonly int[,] _banks = new int[4, 0x4000]; private int _bankMask; private int _bankNumber; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs index 50f9324d20..f3c19877cf 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0013.cs @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { throw new Exception("Cartridge image has an invalid bank"); } - + // Addresses other than 0x8000 are not supported. if (chip.Address != 0x8000) { @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { _bankMask = unchecked((byte) ((_bankMask << 1) | 1)); } - + var bank = new byte[BankSize]; bank.AsSpan().Fill(DummyData); @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge UpdateState(); } - public override int Peek8000(int addr) => + public override int Peek8000(int addr) => _currentBank[addr]; public override void PokeDE00(int addr, int val) @@ -119,7 +119,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge } } - public override int Read8000(int addr) => + public override int Read8000(int addr) => _currentBank[addr]; private void UpdateState() diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs index 04cc2f1d76..57da9b0d11 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Cartridge/Mapper0020.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge private readonly Am29F040B _chipA = new(); private readonly Am29F040B _chipB = new(); - + private bool _saveRamDirty; private bool _boardLed; @@ -101,7 +101,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { if (_chipA.CheckDataDirty() || _deltaA == null) _deltaA = DeltaSerializer.GetDelta(_originalMediaA, _chipA.Data).ToArray(); - + if (_chipB.CheckDataDirty() || _deltaB == null) _deltaB = DeltaSerializer.GetDelta(_originalMediaB, _chipB.Data).ToArray(); @@ -133,21 +133,21 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { if (_deltaA != null) DeltaSerializer.ApplyDelta(_originalMediaA, _chipA.Data, _deltaA); - + if (_deltaB != null) DeltaSerializer.ApplyDelta(_originalMediaB, _chipB.Data, _deltaB); } - + DriveLightOn = _boardLed; } - private int CalculateBankOffset(int addr) => + private int CalculateBankOffset(int addr) => (addr & 0x1FFF) | (_bankNumber << 13); - - public override int Peek8000(int addr) => + + public override int Peek8000(int addr) => _chipA.Peek(CalculateBankOffset(addr)); - public override int PeekA000(int addr) => + public override int PeekA000(int addr) => _chipB.Peek(CalculateBankOffset(addr)); public override int PeekDE00(int addr) @@ -161,7 +161,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge public override void Poke8000(int addr, int val) => _chipA.Poke(addr, val); - + public override void PokeA000(int addr, int val) => _chipB.Poke(addr, val); @@ -190,7 +190,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge _ram[addr] = unchecked((byte)val); } - public override int Read8000(int addr) => + public override int Read8000(int addr) => _chipA.Read(CalculateBankOffset(addr)); public override int ReadA000(int addr) => @@ -298,7 +298,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge { using var stream = new MemoryStream(data); using var reader = new BinaryReader(stream); - + var deltaASize = reader.ReadInt32(); _deltaA = reader.ReadBytes(deltaASize); var deltaBSize = reader.ReadInt32(); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/FFT.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/FFT.cs index 403c7e6e02..c542bff127 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/FFT.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/FFT.cs @@ -38,7 +38,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 var wLength = length / 2; if (_w.Length < wLength) Array.Resize(ref _w, wLength); - + _ip.AsSpan().Clear(); _w.AsSpan().Clear(); } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs index 038aabcc10..efb83c245e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS _cpu = new MOS6502X(new CpuLink(this)) { // Required to pass the Lorenz test suite. - AneConstant = 0xEF, + AneConstant = 0xEF, LxaConstant = 0xFE }; @@ -133,7 +133,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS public int Read(int addr) { int ret = 0; - + switch (addr) { case 0x0000: @@ -168,7 +168,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS ser.BeginSection(nameof(_port)); _port.SyncState(ser); ser.EndSection(); - + ser.Sync(nameof(_irqDelay), ref _irqDelay); ser.Sync(nameof(_nmiDelay), ref _nmiDelay); } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs index 697cfbe7a5..e7916d977a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.Registers.cs @@ -154,7 +154,7 @@ break; case 0xC: WriteRegister(addr, val); - // TriggerInterrupt(8); + // TriggerInterrupt(8); break; case 0xD: if ((val & 0x80) != 0) diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs index eb90f6dd2c..fa2baa3ba3 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Cia.cs @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS public Func ReadFlag = () => true; public Func ReadCnt = () => true; - public Func ReadSp = () => true; + public Func ReadSp = () => true; public bool DelayedInterrupts = true; private int _pra; @@ -167,7 +167,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS _taIrqNextCycle = false; TriggerInterrupt(1); } - + if (_tbIrqNextCycle) { _tbIrqNextCycle = false; @@ -300,7 +300,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS _prbOut = (_prbOut & ~0x80) | _tbPrb7Out; _ddrbOut |= 0x80; } - + _lastCnt = _thisCnt; } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/LatchedPort.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/LatchedPort.cs index 13d2e9a387..19b0467a45 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/LatchedPort.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/LatchedPort.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } // data works like this in these types of systems: - // + // // directionA directionB result // 0 0 1 // 1 0 latchA diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Registers.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Registers.cs index 3140be4fef..ddd790b26b 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Registers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.Registers.cs @@ -151,7 +151,7 @@ } else if (addr == 0x18) { - + // note: we only want to flush the filter here if the filter components are changing bool temp1 = (val & 0x10) != 0; bool temp2 = (val & 0x20) != 0; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.SoundProvider.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.SoundProvider.cs index f39bc5b973..4124be80f1 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.SoundProvider.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.SoundProvider.cs @@ -63,7 +63,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS _outputBuffer[i * 2] = unchecked((short)_mixer); _outputBuffer[i * 2 + 1] = unchecked((short)_mixer); - + } samples = _outputBuffer; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs index 6d9e4dec0e..f2cc5823c0 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Sid.cs @@ -169,7 +169,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS int temp_filtered = 0; int temp_not_filtered = 0; - //note that voice 3 disable is relevent only if it is not going to the filter + //note that voice 3 disable is relevent only if it is not going to the filter // see block diargam http://archive.6502.org/datasheets/mos_6581_sid.pdf if (!_filterEnable[2] && _disableVoice3) temp_v2 = 0; @@ -234,7 +234,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS if (!(_filterEnable[0] | _filterEnable[1] | _filterEnable[2])) { _filterIndex = _outputBufferIndex; - } + } } @@ -315,7 +315,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS attenuation = 12 * attenuation; _fftBuffer[i] = _fftBuffer[i] * Math.Pow(2, -attenuation / 10); } - + // Band pass filter if (_filterSelectBandPass) { @@ -324,7 +324,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS attenuation = 6 * attenuation; _fftBuffer[i] = _fftBuffer[i] * Math.Pow(2, -Math.Abs(attenuation) / 10); } - + } // now transform back into time space and reassemble the attenuated frequency components @@ -344,7 +344,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS // the FFT is only an approximate model and fails at low sample rates // what we want to do is limit how much the output samples can deviate from previous output // thus smoothing out the FT samples - + if (i<16) _outputBufferFiltered[(int)i + _filterIndex] = (int)((_lastFilteredValue * Math.Pow(15 - i,1) + _outputBufferFiltered[(int)i + _filterIndex] * Math.Pow(i,1))/ Math.Pow(15,1)); } diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs index a40b86fd91..ef5044bb56 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Via.cs @@ -101,7 +101,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS public Func ReadCa2 = () => true; public Func ReadCb1 = () => true; public Func ReadCb2 = () => true; - + public Via() { _port = new DisconnectedPort(); @@ -123,16 +123,16 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS // can reflect the input level on the pin, in order to avoid // an endless loop, the most recently buffered pin values are used // instead of calling the Read functions. - + public bool Ca2 => Ca2IsOutput - ? _ca2Out + ? _ca2Out : (_ca2Hist & 1) != 0; public bool Cb1 => Cb1IsOutput ? _cb1Out : (_cb1Hist & 1) != 0; - public bool Cb2 => Cb2IsOutput + public bool Cb2 => Cb2IsOutput ? _cb2Out : (_cb2Hist & 1) != 0; @@ -211,7 +211,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { _irb = pbIn; } - + // CA1, CA2, CB1, and CB2 are all buffered for edge detection each clock. // The state of each pin is shifted in at bit 0 each clock. _ca1Hist = (_ca1Hist << 1) | (ReadCa1() ? 1 : 0); @@ -241,7 +241,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { _cb2Handshake = false; } - + // CB2 has one of four level sources. _cb2Out = (_pcr & PCR_CB2_MODE) switch { @@ -366,13 +366,13 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS { case 0: { - srPulse = !_shiftEnable + srPulse = !_shiftEnable ? (_acr & ACR_SR_OUT) == 0 && (_shiftHist & EDGE_MASK) == EDGE_POSITIVE : srT2; srClock = !_shiftEnable ? (_cb1Hist & EDGE_MASK) == EDGE_POSITIVE : (_shiftHist & EDGE_MASK) == EDGE_POSITIVE; - break; + break; } case ACR_SR_CLOCK_T2: { diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs index 29afc2ba8b..19815e0243 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Parse.cs @@ -195,7 +195,7 @@ _srColor3 |= ((_pixel >> 3) & 1) << (_parseSrShift + _parsePixelDataIndex); _srColorEnable |= (_parseSrColorEnable ? 1 : 0) << (_parseSrShift + _parsePixelDataIndex); } - + break; case FetchTypeNone: // fetch none diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Registers.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Registers.cs index d6de85ab6a..41d98b8e54 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Registers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Registers.cs @@ -181,7 +181,7 @@ return 0xFF; } } - + public void Write(int addr, int val) { addr &= 0x3F; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs index ee9173cf55..fe39a6d3f2 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.Render.cs @@ -218,7 +218,7 @@ if (!_rasterXHold) _rasterX++; - + _srColor0 <<= 1; _srColor1 <<= 1; _srColor2 <<= 1; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs index da5b50f405..c176789d98 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.State.cs @@ -240,7 +240,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS ser.Sync(nameof(_vmli), ref _vmli); ser.Sync(nameof(_xScroll), ref _xScroll); ser.Sync(nameof(_yScroll), ref _yScroll); - + if (ser.IsReader) { UpdateBorder(); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs index 0d4753f805..1fe8d010ea 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs @@ -95,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS switch (borderType) { - + case C64.BorderType.Full: newHblankStart = -1; newHblankEnd = -1; @@ -103,7 +103,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS newVblankStart = -1; newVblankEnd = -1; _vblank = false; - break; + break; case C64.BorderType.Normal: newHblankStart = hblankStart; newHblankEnd = hblankEnd; @@ -247,7 +247,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS } _spriteSpriteCollisionClearPending = false; } - + // start of rasterline if ((_cycle == RasterIrqLineXCycle && _rasterLine > 0) || (_cycle == RasterIrqLine0Cycle && _rasterLine == 0)) { @@ -314,7 +314,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS UpdatePins(); Render(); } - + private void UpdateBa() { if (_ba) diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs index e272689441..230711c2ac 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/G64.cs @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media return new Disk(84) {WriteProtected = false}; } - + public static byte[] Write(IList trackData, IList trackNumbers, IList trackDensities) { const byte version = 0; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs index 9ac79e9db5..a7f300c543 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/Serial/Drive1541.cs @@ -56,7 +56,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial _cpu = new MOS6502X(new CpuLink(this)) { NMI = false, - AneConstant = 0xEF, + AneConstant = 0xEF, LxaConstant = 0xFE }; @@ -90,7 +90,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial ser.BeginSection("Disk6502"); _cpu.SyncState(ser); ser.EndSection(); - + ser.Sync("RAM", ref _ram, useNull: false); ser.BeginSection("VIA0"); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/User/UserPortDevice.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/User/UserPortDevice.cs index 8e0b0c71af..83fcbe54c8 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/User/UserPortDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/User/UserPortDevice.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.User return true; } - public virtual bool ReadPa2() + public virtual bool ReadPa2() { return true; } diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs index 1bdd62673d..d2b25539c7 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Computers.DOS private int _floppyDiskCount = 0; private int _currentFloppyDisk = 0; private int _currentCDROM = 0; - + private string GetFullName(IRomAsset rom) => Path.GetFileName(rom.RomPath.SubstringAfter('|')); // CD Handling logic @@ -272,7 +272,7 @@ namespace BizHawk.Emulation.Cores.Computers.DOS UpdateFramerate(_syncSettings.forceFPSNumerator, _syncSettings.forceFPSDenominator); else UpdateFramerate(LibDOSBox.DEFAULT_FRAMERATE_NUMERATOR_DOS, LibDOSBox.DEFAULT_FRAMERATE_DENOMINATOR_DOS); - + PostInit(); diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs index 182273f51a..334e766a02 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IEmulator.cs @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom | Convert.ToInt32(_syncSettings.Player2Present) << 1 | Convert.ToInt32(_syncSettings.Player3Present) << 2 | Convert.ToInt32(_syncSettings.Player4Present) << 3; - + if (controller.IsPressed("Change Gamma")) commonButtons |= (1 << 0); if (controller.IsPressed("Automap Toggle")) commonButtons |= (1 << 1); if (controller.IsPressed("Automap +")) commonButtons |= (1 << 2); diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs index e07e235cfb..e3bd1babab 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.ISettable.cs @@ -149,76 +149,76 @@ namespace BizHawk.Emulation.Cores.Computers.Doom [DefaultValue(1)] [TypeConverter(typeof(ConstrainedIntConverter))] public int ScaleFactor { get; set; } - + [DisplayName("Sfx Volume")] [Description("Sound effects volume [0 - 15].")] [Range(0, 15)] [DefaultValue(8)] public int SfxVolume { get; set; } - + [DisplayName("Music Volume")] [Description("[0 - 15]")] [Range(0, 15)] [DefaultValue(8)] public int MusicVolume { get; set; } - + [DisplayName("Gamma Correction Level")] [Description("Increases brightness [0 - 4].\n\nDefault value in vanilla is \"OFF\" (0).")] [Range(0, 4)] [DefaultValue(0)] [TypeConverter(typeof(ConstrainedIntConverter))] public int Gamma { get; set; } - + [DisplayName("Show Messages")] [Description("Displays messages about items you pick up.\n\nDefault value in vanilla is \"ON\".")] [DefaultValue(true)] public bool ShowMessages { get; set; } - + [DisplayName("Report Revealed Secrets")] [Description("Shows an on-screen notification when revealing a secret.")] [DefaultValue(false)] public bool ReportSecrets { get; set; } - + [DisplayName("HUD Mode")] [Description("Sets heads-up display mode.")] [DefaultValue(HudMode.Vanilla)] public HudMode HeadsUpMode { get; set; } - + [DisplayName("Extended HUD")] [Description("Shows DSDA-Doom-specific information above vanilla heads-up-display.")] [DefaultValue(false)] public bool DsdaExHud { get; set; } - + [DisplayName("Display Coordinates")] [Description("Shows player position (X, Y, Z, angle), velocity (combined, X, Y), and distance travelled (combined, X, Y) per frame. Color indicates velocity/distance tiers: green - SR40 (15.11+/16.67+), blue - SR50 (19.35+/21.35+), red - turbo/wallrun (21.37+/23.58+).\n\nAvailable in vanilla via the IDMYPOS cheat code, however vanilla only displays angle, X, and Y - all in hexadecimal format.")] [DefaultValue(false)] public bool DisplayCoordinates { get; set; } - + [DisplayName("Display Commands")] [Description("Shows input history on the screen. History size is 10, empty commands are excluded.")] [DefaultValue(false)] public bool DisplayCommands { get; set; } - + [DisplayName("Automap Totals")] [Description("Shows counts for kills, items, and secrets on automap.")] [DefaultValue(false)] public bool MapTotals { get; set; } - + [DisplayName("Automap Time")] [Description("Shows elapsed time on automap.")] [DefaultValue(false)] public bool MapTime { get; set; } - + [DisplayName("Automap Coordinates")] [Description("Shows in-level coordinates on automap.")] [DefaultValue(false)] public bool MapCoordinates { get; set; } - + [DisplayName("Automap Overlay")] [Description("Shows automap on top of gameplay.")] [DefaultValue(MapOverlays.Disabled)] public MapOverlays MapOverlay { get; set; } - + [DisplayName("Automap Details")] [Description("Exposes all linedefs and things.\n\nAvailable in vanilla via the IDDT cheat code.")] [DefaultValue(MapDetail.Normal)] @@ -346,17 +346,17 @@ namespace BizHawk.Emulation.Cores.Computers.Doom [Description("Sets strict mode restrictions, preventing TAS-only inputs.")] [DefaultValue(true)] public bool StrictMode { get; set; } - + [DisplayName("Always Run")] [Description("Toggles whether the player is permanently in the running state, without the slower walking speed available. This emulates a bug in vanilla Doom: setting the joystick run button to an invalid high number causes the game to always have it enabled.")] [DefaultValue(true)] public bool AlwaysRun { get; set; } - + [DisplayName("Render Wipescreen")] [Description("Enables screen melt - an effect seen when Doom changes scene, for example, when starting or exiting a level.")] [DefaultValue(true)] public bool RenderWipescreen { get; set; } - + [DisplayName("Turning Resolution")] [Description("\"Shorttics\" refers to decreased turning resolution normally used for demos. \"Longtics\" refers to the regular turning resolution outside of a demo-recording environment. Newer demo formats support both.")] [DefaultValue(TurningResolution.Longtics)] diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs index 6162648344..6c80ae509c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/DSDA.IStatable.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom public void LoadStateBinary(BinaryReader reader) { _elf.LoadStateBinary(reader); - + _turnHeld[0] = reader.ReadInt32(); _turnHeld[1] = reader.ReadInt32(); _turnHeld[2] = reader.ReadInt32(); diff --git a/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs b/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs index b0638fe23c..a3d0729c33 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Doom/LibDSDA.cs @@ -92,7 +92,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom public delegate int load_archive_cb(string filename, IntPtr buffer, int maxsize); [BizImport(CallingConvention.Cdecl)] public abstract int dsda_add_wad_file(string fileName, int fileSize, load_archive_cb feload_archive_cb); - + [BizImport(CallingConvention.Cdecl)] public abstract byte dsda_read_memory_array(MemoryArrayType type, uint addr); diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs index f14cb7a2fe..52a37185e4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs @@ -28,8 +28,8 @@ namespace BizHawk.Emulation.Cores.Computers.MSX if (_controller.IsPressed("P2 B1")) ctrl2_byte -= 0x10; if (_controller.IsPressed("P2 B2")) ctrl2_byte -= 0x20; - if (current_controller == MSXControllerKB) { kb_rows_check(controller); } - + if (current_controller == MSXControllerKB) { kb_rows_check(controller); } + if (Tracer.IsEnabled()) { tracecb = MakeTrace; @@ -38,9 +38,9 @@ namespace BizHawk.Emulation.Cores.Computers.MSX { tracecb = null; } - + LibMSX.MSX_settracecallback(MSX_Pntr, tracecb); - + LibMSX.MSX_frame_advance(MSX_Pntr, ctrl1_byte, ctrl2_byte, kb_rows, true, true); LibMSX.MSX_get_video(MSX_Pntr, _vidbuffer); @@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX public void kb_rows_check(IController controller) { for(int i = 0; i < 9; i++) { kb_rows[i] = 0; } - + if (controller.IsPressed("7")) { kb_rows[0] |= 0x80; } if (controller.IsPressed("6")) { kb_rows[0] |= 0x40; } if (controller.IsPressed("5")) { kb_rows[0] |= 0x20; } diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs index 1d9d6e69ab..b448c6f4cb 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IMemoryDomains.cs @@ -16,11 +16,11 @@ namespace BizHawk.Emulation.Cores.Computers.MSX var domains = new List { new MemoryDomainDelegate( - "System Bus", - 0x10000, + "System Bus", + 0x10000, MemoryDomain.Endian.Little, (addr) => LibMSX.MSX_getsysbus(MSX_Pntr, (int)(addr & 0xFFFF)), - (addr, value) => { }, + (addr, value) => { }, 1), new MemoryDomainDelegate( "VRAM", diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs index 1356afa0fa..c140f77d86 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX mapper_1 = 2; Console.WriteLine("Using Konami Mapper with SCC"); } - } + } } // if the original was not 64 or 48 k, move it (may need to do this case by case) @@ -86,7 +86,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX } for (int i = 0; i < 0x4000; i++) { - RomData[i] = 0; + RomData[i] = 0; } } @@ -110,7 +110,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX { loc_bios = lp.Comm.CoreFileProvider.GetFirmwareOrThrow(new("MSX", "bios_basic_jpn")); } - + // look for individual files (not implemented yet) if (loc_bios == null) { @@ -133,7 +133,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX RomData2 = new byte[0x10000]; for (int i = 0; i < 0x10000; i++) { RomData2[i] = 0; } - + MSX_Pntr = LibMSX.MSX_create(); LibMSX.MSX_load_bios(MSX_Pntr, Bios, Basic); diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs index 2586d05d61..6e3f674521 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Signs whether the current active drive has a disk inserted - /// + /// bool FDD_IsDiskLoaded { get; } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs index 5c4d70faa5..e87b810eb6 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs @@ -440,7 +440,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum cycles -= _waitEdge; if (_position == 0 && _tapeIsPlaying) - { + { // notify about the current block var bl = _dataBlocks[_currentDataBlockIndex]; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs index 5f66138ee5..9cf4fcd7c6 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs @@ -30,14 +30,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum Command, /// - /// During this phase, the actual data is transferred (if any). Usually that are the data bytes for the read/written sector(s), except for the Format Track Command, + /// During this phase, the actual data is transferred (if any). Usually that are the data bytes for the read/written sector(s), except for the Format Track Command, /// in that case four bytes for each sector are transferred /// Execution, /// - /// Returns up to seven result bytes (depending on the command) that are containing status information. The Recalibrate and Seek Track commands do not return result bytes directly, - /// instead the program must wait until the Main Status Register signalizes that the command has been completed, and then it must (!) send a + /// Returns up to seven result bytes (depending on the command) that are containing status information. The Recalibrate and Seek Track commands do not return result bytes directly, + /// instead the program must wait until the Main Status Register signalizes that the command has been completed, and then it must (!) send a /// Sense Interrupt State command to 'terminate' the Seek/Recalibrate command. /// Result @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum PreExecution, /// - /// The start of instruction execution. This may end up with the FDC moving into result phase, + /// The start of instruction execution. This may end up with the FDC moving into result phase, /// but also may also prepare the way for further processing to occur later in execution phase /// StartExecute, @@ -100,7 +100,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// Final cleanup tasks when the instruction has fully completed /// Completed - + } /// @@ -413,7 +413,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public const int MSR_DIO = 6; /// /// Request For Master (1=ready for next byte) (see b6 for direction) - /// ndicates data register IS ready to send or receive data to or from the processor Both bits DIO and RQM should be + /// ndicates data register IS ready to send or receive data to or from the processor Both bits DIO and RQM should be /// used to perform the hand-shaking functions of “ready” and “directron” to the processor /// public const int MSR_RQM = 7; @@ -493,12 +493,12 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// No Data /// No Data (Sector_ID not found, CRC fail in ID_field) - /// + /// /// During execution of Read Data. Read Deleted Data Write Data.Write Deleted Data or Scan command, if the FDC cannot find /// the sector specified in the IDR(2)Register, this flag i s set. - /// + /// /// During execution of the Read ID command. if the FDC cannot read the ID field without an error, then this flag IS set - /// + /// /// During execution of the Read Diagnostic command. if the starting sector cannot be found, then this flag is set /// public const int SR1_ND = 2; @@ -526,7 +526,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Missing Address Mark in Data Field (DAM not found) - /// Missing address mark - When data IS read from the medium, i f the FDC cannot find a data address mark or deleted + /// Missing address mark - When data IS read from the medium, i f the FDC cannot find a data address mark or deleted /// data address mark, then this flag is set /// public const int SR2_MD = 0; @@ -540,7 +540,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Scan Not Satisfied (no fitting sector found) - /// Scan not satisfied - During execution of the Scan command, i f the F D cannot find a sector on the cylinder + /// Scan not satisfied - During execution of the Scan command, i f the F D cannot find a sector on the cylinder /// which meets the condition.then this flag i s set /// public const int SR2_SN = 2; @@ -553,7 +553,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Wrong Cylinder (read/programmed track-ID different) (see b1) - /// Wrong cylinder - This bit IS related to the ND bit, and when the contents of C(3) on the medium is different + /// Wrong cylinder - This bit IS related to the ND bit, and when the contents of C(3) on the medium is different /// from that stored i n the IDR.this flag is set /// public const int SR2_WC = 4; @@ -729,7 +729,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// public Action CommandDelegate { get; set; } } - + /// /// Storage for command parameters /// @@ -768,7 +768,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// public byte Gap3Length; /// - /// Data length (DTL) - When N is defined as 00, DTL stands for the data length + /// Data length (DTL) - When N is defined as 00, DTL stands for the data length /// which users are going to read out or write into the sector /// public byte DTL; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs index efe6b3e228..032d2fd9f4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs @@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Step Rate Time (supplied via the specify command) - /// SRT stands for the steooino rate for the FDD ( 1 to 16 ms in 1 ms increments). + /// SRT stands for the steooino rate for the FDD ( 1 to 16 ms in 1 ms increments). /// Stepping rate applies to all drives(FH= 1ms, EH= 2ms, etc.). /// private int SRT; @@ -83,7 +83,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Head Unload Time (supplied via the specify command) - /// HUT stands for the head unload time after a Read or Write operation has occurred + /// HUT stands for the head unload time after a Read or Write operation has occurred /// (16 to 240 ms in 16 ms Increments) /// private int HUT; @@ -345,9 +345,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // calculate requested size of data required if (ActiveCommandParams.SectorSize == 0) { - // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual - // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) - // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform + // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual + // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) + // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform // a Multi-Sector Read Operation. sectorSize = ActiveCommandParams.DTL; @@ -442,7 +442,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // we don't need EN UnSetBit(SR1_EN, ref Status1); - // If SK=1, the FDC skips the sector with the Deleted Data Address Mark and reads the next sector. + // If SK=1, the FDC skips the sector with the Deleted Data Address Mark and reads the next sector. // The CRC bits in the deleted data field are not checked when SK=1 if (CMD_FLAG_SK && Status2.Bit(SR2_CM)) { @@ -656,9 +656,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // calculate requested size of data required if (ActiveCommandParams.SectorSize == 0) { - // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual - // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) - // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform + // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual + // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) + // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform // a Multi-Sector Read Operation. sectorSize = ActiveCommandParams.DTL; @@ -971,9 +971,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // calculate requested size of data required if (ActiveCommandParams.SectorSize == 0) { - // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual - // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) - // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform + // When N=0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual + // data length in a sector, the data beyond DTL in the sector is not sent to the Data Bus. The FDC reads (internally) + // the complete sector performing the CRC check and, depending upon the manner of command termination, may perform // a Multi-Sector Read Operation. sectorSize = ActiveCommandParams.DTL; @@ -1864,7 +1864,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// COMMAND: 2 parameter bytes /// EXECUTION: NO execution phase /// RESULT: NO result phase - /// + /// /// Looks like specify command returns status 0x80 throughout its lifecycle /// so CB is NOT set /// @@ -2185,7 +2185,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// COMMAND: 1 parameter byte /// EXECUTION: NO execution phase /// RESULT: 1 result byte - /// + /// /// The ZX spectrum appears to only specify drive 1 as the parameter byte, NOT drive 0 /// After the final param byte is received main status changes to 0xd0 /// Data register (ST3) result is 0x51 if drive/disk not available @@ -2358,7 +2358,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum SetBit(MSR_EXM, ref StatusMain); SetBit(MSR_CB, ref StatusMain); - // overrun detection + // overrun detection OverrunCounter++; if (OverrunCounter >= 64) { @@ -2475,7 +2475,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum //// we are in command phase case Phase.Command: // attempt to process this parameter byte - //ProcessCommand(data); + //ProcessCommand(data); ActiveCommand.CommandDelegate(); break; //// we are in execution phase diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs index 5a57bfa0ff..a20e942019 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs @@ -397,7 +397,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum else return null; } - + /// /// Populates a result buffer @@ -643,7 +643,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // seek emulation processed immediately case SeekSubState.MoveImmediate: - + if (CurrentTrack < SeekingTrack) { // we are seeking forward @@ -697,10 +697,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { SetBit(SR0_EC, ref IntStatus); } - } + } // set seek end - SetBit(SR0_SE, ref IntStatus); + SetBit(SR0_SE, ref IntStatus); /* // head address if (CurrentSide > 0) @@ -791,7 +791,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Signs whether the current active drive has a disk inserted - /// + /// public bool FDD_IsDiskLoaded { get diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs index 468b0d9207..2cca36eb43 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs @@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum //outputString += ",," + data + "," + ActiveCommand.CommandCode + "\r\n"; BuildCSVLine(); } - + return true; } @@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum BuildCSVLine(); //System.IO.File.WriteAllText(outputfile, outputString); } - + return true; } @@ -123,7 +123,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum BuildCSVLine(); //System.IO.File.WriteAllText(outputfile, outputString); } - + return true; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/GateArrayType.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/GateArrayType.cs index 45af999c81..dff9887476 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/GateArrayType.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/GateArrayType.cs @@ -9,28 +9,28 @@ Amstrad40007, /// /// CPC 664 - /// Later, the CPC 664 came out fitted with the 40008 version (and at the same time, the CPC 464 was also upgraded with this version). - /// This version is pinout incompatible with the 40007 (that's why the upgraded 464 of this period have two Gate Array slots on the motherboard, + /// Later, the CPC 664 came out fitted with the 40008 version (and at the same time, the CPC 464 was also upgraded with this version). + /// This version is pinout incompatible with the 40007 (that's why the upgraded 464 of this period have two Gate Array slots on the motherboard, /// one for a 40007 and one for a 40008) /// Amstrad40008, /// /// CPC 6128 - /// The CPC 6128 was released with the 40010 version (and the CPC 464 and 664 manufactured at that time were also upgraded to this version). + /// The CPC 6128 was released with the 40010 version (and the CPC 464 and 664 manufactured at that time were also upgraded to this version). /// The 40010 is pinout compatible with the previous 40008 /// Amstrad40010, /// /// Costdown CPC - /// In the last serie of CPC 464 and 6128 produced by Amstrad in 1988, a small ASIC chip have been used to reduce the manufacturing costs. - /// This ASIC emulates the Gate Array, the PAL and the CRTC 6845. And no, there is no extra features like on the Amstrad Plus. + /// In the last serie of CPC 464 and 6128 produced by Amstrad in 1988, a small ASIC chip have been used to reduce the manufacturing costs. + /// This ASIC emulates the Gate Array, the PAL and the CRTC 6845. And no, there is no extra features like on the Amstrad Plus. /// The only noticeable difference seems to be about the RGB output levels which are not exactly the same than those produced with a real Gate Array /// Amstrad40226, /// /// Plus & GX-4000 - /// All the Plus range is built upon a bigger ASIC chip which is integrating many features of the classic CPC (FDC, CRTC, PPI, Gate Array/PAL) and all - /// the new Plus specific features. The Gate Array on the Plus have a new register, named RMR2, to expand the ROM mapping functionnalities of the machine. + /// All the Plus range is built upon a bigger ASIC chip which is integrating many features of the classic CPC (FDC, CRTC, PPI, Gate Array/PAL) and all + /// the new Plus specific features. The Gate Array on the Plus have a new register, named RMR2, to expand the ROM mapping functionnalities of the machine. /// This register requires to be unlocked first to be available. And finally, the RGB levels produced by the ASIC on the Plus are noticeably differents /// Amstrad40489, diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs index 6b89338aee..8ab4c87f8d 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs @@ -191,16 +191,16 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /* The high byte indicates which half-row of keys is being polled A zero on one of these lines selects a particular half-row of five keys: - + IN: Reads keys (bit 0 to bit 4 inclusive) 0xfefe SHIFT, Z, X, C, V 0xeffe 0, 9, 8, 7, 6 0xfdfe A, S, D, F, G 0xdffe P, O, I, U, Y 0xfbfe Q, W, E, R, T 0xbffe ENTER, L, K, J, H 0xf7fe 1, 2, 3, 4, 5 0x7ffe SPACE, SYM SHFT, M, N, B - A zero in one of the five lowest bits means that the corresponding key is pressed. If more than one address line - is made low, the result is the logical AND of all single inputs, so a zero in a bit means that at least one of the - appropriate keys is pressed. For example, only if each of the five lowest bits of the result from reading from Port 00FE + A zero in one of the five lowest bits means that the corresponding key is pressed. If more than one address line + is made low, the result is the logical AND of all single inputs, so a zero in a bit means that at least one of the + appropriate keys is pressed. For example, only if each of the five lowest bits of the result from reading from Port 00FE (for instance by XOR A/IN A,(FE)) is one, no key is pressed */ diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs index 0595545db8..2b78b80f0e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs @@ -8,10 +8,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// /// AY-3-8912 Emulated Device - /// + /// /// Based heavily on the YM-2149F / AY-3-8910 emulator used in Unreal Speccy /// (Originally created under Public Domain license by SMT jan.2006) - /// + /// /// https://github.com/mkoloberdin/unrealspeccy/blob/master/sndrender/sndchip.cpp /// https://github.com/mkoloberdin/unrealspeccy/blob/master/sndrender/sndchip.h /// @@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } /// - /// |11-- ---- ---- --0-| - IN - Read value of currently selected register + /// |11-- ---- ---- --0-| - IN - Read value of currently selected register /// public bool ReadPort(ushort port, ref int value) { @@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } // port read is not addressing this device - return false; + return false; } /// @@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum else if ((port >> 14) == 2) { // Update the audiobuffer based on the current CPU cycle - // (this process the previous data BEFORE writing to the currently selected register) + // (this process the previous data BEFORE writing to the currently selected register) int d = (int)(_machine.CurrentFrameCycle); BufferUpdate(d); @@ -379,15 +379,15 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 14 I/O port A 8-bit (0-255) 15 I/O port B 8-bit (0-255) (Not present on the AY-3-8912) - * The volume registers (8, 9 and 10) contain a 4-bit setting but if bit 5 is set then that channel uses the + * The volume registers (8, 9 and 10) contain a 4-bit setting but if bit 5 is set then that channel uses the envelope defined by register 13 and ignores its volume setting. * The mixer (register 7) is made up of the following bits (low=enabled): - + Bit: 7 6 5 4 3 2 1 0 Register: I/O I/O Noise Noise Noise Tone Tone Tone Channel: B A C B A C B A - The AY-3-8912 ignores bit 7 of this register. + The AY-3-8912 ignores bit 7 of this register. */ private int[] _registers = new int[16]; @@ -575,7 +575,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum _tStatesPerFrame = frameTactCount; _samplesPerFrame = 882; - _tStatesPerSample = 79; //(int)Math.Round(((double)_tStatesPerFrame * 50D) / + _tStatesPerSample = 79; //(int)Math.Round(((double)_tStatesPerFrame * 50D) / //(16D * (double)_sampleRate), //MidpointRounding.AwayFromZero); diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs index 97beed6d77..d6e4974b12 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs @@ -275,7 +275,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // high byte not 40-7f // low bit set - // N:4 + // N:4 } else { @@ -333,7 +333,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // high byte not 40-7f // low bit set - // N:4 + // N:4 } else { diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs index 327e90619b..762d7d3d84 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Memory.cs @@ -7,9 +7,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public partial class Pentagon128 : SpectrumBase { /* 128k paging controlled by writes to port 0x7ffd - * - * - + * + * + #7FFD (32765) - decoded as A15=0, A1=0 and /IORQ=0. Bits 0..5 are latched. Bits 0..2 select RAM bank in secton D. Bit 3 selects RAM bank to dispay screen (0 - RAM5, 1 - RAM7). Bit 4 selects ROM bank (0 - ROM0, 1 - ROM1). Bit 5, when set locks future writing to #7FFD port until reset. Reading #7FFD port is the same as writing #FF into it. #BFFD (49149) - write data byte into AY-3-8912 chip. #FFFD (65533) - select AY-3-8912 addres (D4..D7 ignored) and reading data byte. @@ -318,11 +318,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // shadow screen should be outputted // this lives in RAM7 - value = RAM7[addr & 0x3FFF]; + value = RAM7[addr & 0x3FFF]; } else { - // shadow screen is not set to display or paging is disabled (probably in 48k mode) + // shadow screen is not set to display or paging is disabled (probably in 48k mode) // (use screen0 at RAM5) value = RAM5[addr & 0x3FFF]; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Port.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Port.cs index 277e745471..22e764e8b0 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.Port.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // https://faqwiki.zxnet.co.uk/wiki/ZX_Spectrum_128 // HAL bugs - // Reads from port 0x7ffd cause a crash, as the 128's HAL10H8 chip does not distinguish between reads and writes to this port, + // Reads from port 0x7ffd cause a crash, as the 128's HAL10H8 chip does not distinguish between reads and writes to this port, // resulting in a floating data bus being used to set the paging registers. // -asni (2018-06-08) - need this to pass the final portread tests from fusetest.tap @@ -161,8 +161,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum TapeDevice.WritePort(port, value); // Tape - //TapeDevice.ProcessMicBit((value & MIC_BIT) != 0); - } + //TapeDevice.ProcessMicBit((value & MIC_BIT) != 0); + } } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs index 23a264d0c0..2ef759cfc9 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// /// ROM Banks - /// + /// public byte[] ROM0 = new byte[0x4000]; public byte[] ROM1 = new byte[0x4000]; public byte[] ROM2 = new byte[0x4000]; @@ -55,8 +55,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum set => ROMPaged = value; } - /* - * +3/+2A only + /* + * +3/+2A only */ /// @@ -189,7 +189,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // THE 'MASKABLE INTERRUPT' ROUTINE // This is sometimes used when the tape is to be stopped - // + // if (addr == 56) { //TapeDevice.MaskableInterruptCount++; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs index cc866473c7..6efeb25db1 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs @@ -182,7 +182,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // is this a lag frame? Spectrum.IsLagFrame = !InputRead; - // FDC debug + // FDC debug if (UPDDiskDevice != null && UPDDiskDevice.writeDebug) { // only write UPD log every second @@ -206,7 +206,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum PagingDisabled = false; RAMPaged = 0; CPU.RegPC = 0; - + Spectrum.SetCpuRegister("SP", 0xFFFF); Spectrum.SetCpuRegister("IY", 0); Spectrum.SetCpuRegister("IX", 0); @@ -226,7 +226,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum TapeDevice.Reset(); AYDevice?.Reset(); - byte[][] rams = + byte[][] rams = { RAM0, RAM1, diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs index 679392624d..f8323e3f43 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// /// Contention offset - /// + /// public int ContentionOffset; /// diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs index 8bb3a0b215..af85036498 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs @@ -7,9 +7,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public partial class ZX128 : SpectrumBase { /* 128k paging controlled by writes to port 0x7ffd - * - * - + * + * + #7FFD (32765) - decoded as A15=0, A1=0 and /IORQ=0. Bits 0..5 are latched. Bits 0..2 select RAM bank in secton D. Bit 3 selects RAM bank to dispay screen (0 - RAM5, 1 - RAM7). Bit 4 selects ROM bank (0 - ROM0, 1 - ROM1). Bit 5, when set locks future writing to #7FFD port until reset. Reading #7FFD port is the same as writing #FF into it. #BFFD (49149) - write data byte into AY-3-8912 chip. #FFFD (65533) - select AY-3-8912 addres (D4..D7 ignored) and reading data byte. @@ -318,11 +318,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // shadow screen should be outputted // this lives in RAM7 - value = RAM7[addr & 0x3FFF]; + value = RAM7[addr & 0x3FFF]; } else { - // shadow screen is not set to display or paging is disabled (probably in 48k mode) + // shadow screen is not set to display or paging is disabled (probably in 48k mode) // (use screen0 at RAM5) value = RAM5[addr & 0x3FFF]; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs index 573acd2370..79d714fbfd 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // https://faqwiki.zxnet.co.uk/wiki/ZX_Spectrum_128 // HAL bugs - // Reads from port 0x7ffd cause a crash, as the 128's HAL10H8 chip does not distinguish between reads and writes to this port, + // Reads from port 0x7ffd cause a crash, as the 128's HAL10H8 chip does not distinguish between reads and writes to this port, // resulting in a floating data bus being used to set the paging registers. // -asni (2018-06-08) - need this to pass the final portread tests from fusetest.tap @@ -155,8 +155,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum TapeDevice.WritePort(port, value); // Tape - //TapeDevice.ProcessMicBit((value & MIC_BIT) != 0); - } + //TapeDevice.ProcessMicBit((value & MIC_BIT) != 0); + } } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs index 243581e569..e130ab199e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public partial class ZX128Plus2a : SpectrumBase { /* http://www.worldofspectrum.org/faq/reference/128kreference.htm - * + * * Port 0x7ffd behaves in the almost exactly the same way as on the 128K/+2, with two exceptions: Bit 4 is now the low bit of the ROM selection. @@ -355,7 +355,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum LastContendedReadByte = data; CPUMon.NextMemReadContended = false; } - + return data; } @@ -596,7 +596,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } else { - // shadow screen is not set to display or paging is disabled (probably in 48k mode) + // shadow screen is not set to display or paging is disabled (probably in 48k mode) // (use screen0 at RAM5) value = RAM5[addr & 0x3FFF]; } @@ -621,7 +621,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum stream.Read(ROM1, 0, 16384); stream.Read(ROM2, 0, 16384); stream.Read(ROM3, 0, 16384); - stream.Dispose(); + stream.Dispose(); } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs index 98e4eb22ee..b295521b38 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum if (!deviceAddressed) { // If this is an unused port the floating memory bus should be returned - ULADevice.ReadFloatingBus((int)CurrentFrameCycle, ref result, port); + ULADevice.ReadFloatingBus((int)CurrentFrameCycle, ref result, port); } return (byte)result; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs index ca174ac903..4722f7ada5 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public partial class ZX128Plus3 : SpectrumBase { /* http://www.worldofspectrum.org/faq/reference/128kreference.htm - * + * * Port 0x7ffd behaves in the almost exactly the same way as on the 128K/+2, with two exceptions: Bit 4 is now the low bit of the ROM selection. @@ -87,7 +87,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum result = RAM1[addr % 0x4000]; break; case 1: - case 2: + case 2: result = RAM5[addr % 0x4000]; break; case 3: @@ -355,7 +355,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum LastContendedReadByte = data; CPUMon.NextMemReadContended = false; } - + return data; } @@ -530,7 +530,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } } */ - + WriteBus(addr, value); } @@ -597,7 +597,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } else { - // shadow screen is not set to display or paging is disabled (probably in 48k mode) + // shadow screen is not set to display or paging is disabled (probably in 48k mode) // (use screen0 at RAM5) value = RAM5[addr & 0x3FFF]; } @@ -622,7 +622,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum stream.Read(ROM1, 0, 16384); stream.Read(ROM2, 0, 16384); stream.Read(ROM3, 0, 16384); - stream.Dispose(); + stream.Dispose(); } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs index c883dd3048..a5b2a92403 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum if (!deviceAddressed) { // If this is an unused port the floating memory bus should be returned - ULADevice.ReadFloatingBus((int)CurrentFrameCycle, ref result, port); + ULADevice.ReadFloatingBus((int)CurrentFrameCycle, ref result, port); } return (byte)result; @@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // portbit 4 is the LOW BIT of the ROM selection ROMlow = bits[4]; - } + } } // port 0x1ffd - hardware should only respond when bits 1, 13, 14 & 15 are reset and bit 12 is set if (!portBits[1] && portBits[12] && !portBits[13] && !portBits[14] && !portBits[15]) @@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // bit 4 is the printer port strobe PrinterPortStrobe = bits[4]; } - + // Only even addresses address the ULA if (lowBitReset) { @@ -167,7 +167,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum //TapeDevice.ProcessMicBit((value & MIC_BIT) != 0); } - + LastULAOutByte = value; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs index 763cc5439f..8541219471 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs @@ -18,8 +18,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } /* 48K Spectrum has NO memory paging - * - * + * + * | Bank 0 | | | | | diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs index 279a9b3a08..d437f67d78 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs @@ -6,7 +6,7 @@ public partial class ZX48 : SpectrumBase { /* 48K Spectrum has NO memory paging - * + * * 0xffff +--------+ | Bank 2 | | | @@ -51,7 +51,7 @@ case 3: return RAM2[index]; default: return 0; } - } + } /// /// Simulates writing to the bus (no contention) @@ -74,7 +74,7 @@ RAM0[index] = value; break; case 2: - RAM1[index] = value; + RAM1[index] = value; break; case 3: RAM2[index] = value; @@ -119,7 +119,7 @@ /// (with memory contention if appropriate) /// public override void WriteMemory(ushort addr, byte value) - { + { WriteBus(addr, value); } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs index 702f829ccd..2166b34cf9 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // Technically the ULA should respond to every even I/O address bool lowBitReset = (port & 0x0001) == 0; byte lowByte = (byte)(port & 0xff); - + // Kempston joystick input takes priority over keyboard input // if this is detected just return the kempston byte if (lowByte == 0x1f) @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum KeyboardDevice.ReadPort(port, ref result); // not a lagframe - InputRead = true; + InputRead = true; // process tape INs TapeDevice.ReadPort(port, ref result); @@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // If this is an unused port the floating memory bus should be returned - ULADevice.ReadFloatingBus((int)CurrentFrameCycle, ref result, port); + ULADevice.ReadFloatingBus((int)CurrentFrameCycle, ref result, port); } return (byte)result; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFormat/CPCFloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFormat/CPCFloppyDisk.cs index 0f43d036dd..22cc3c7f6c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFormat/CPCFloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFormat/CPCFloppyDisk.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public override DiskType DiskFormatType => DiskType.CPC; /// - /// Attempts to parse incoming disk data + /// Attempts to parse incoming disk data /// /// /// TRUE: disk parsed diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs index d65c672063..fd108db3f2 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs @@ -306,7 +306,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // TrackID is consistent between the sectors although is usually high (233, 237 etc) // SideID is fairly random looking but with all IDs being even // SectorID is also fairly random looking but contains both odd and even numbers - // + // // There doesnt appear to be any CRC errors in this track, but the sector size is always 1 (256 bytes) // Each sector contains different filler byte // Once track 0 is loaded the CPU completely reads all the sectors in this track one-by-one. @@ -394,7 +394,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // Hexagon Copy Protection Notes (-asni 2018-05-01) // --------------------------------------------------- // - // + // return false; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/IPFFormat/IPFFloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/IPFFormat/IPFFloppyDisk.cs index 7d03647045..569e79f206 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/IPFFormat/IPFFloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/IPFFormat/IPFFloppyDisk.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public override DiskType DiskFormatType => DiskType.IPF; /// - /// Attempts to parse incoming disk data + /// Attempts to parse incoming disk data /// /// /// TRUE: disk parsed diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs index f3c73b7731..01bc86dfc5 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/UDIFormat/UDI1_0FloppyDisk.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public override DiskType DiskFormatType => DiskType.UDI; /// - /// Attempts to parse incoming disk data + /// Attempts to parse incoming disk data /// /// /// TRUE: disk parsed diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs index d4f0f5787f..d2c66cd1cd 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs @@ -137,7 +137,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// Takes a PauseInMilliseconds value and returns the value in T-States /// public static int TranslatePause(int pauseInMS) - { + { const double tspms = 69888.0 * 50.0 / 1000.0; int res = (int)(pauseInMS * tspms); diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs index 0cb015c78e..46e6e4d151 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Methods.cs @@ -179,7 +179,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum break; } /* - // ZXSTPLUS3 + // ZXSTPLUS3 if (s._machine.Spectrum.MachineType == MachineType.ZXSpectrum128Plus3) { var iStruct = s.GetZXSTPLUS3(); @@ -201,7 +201,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum buff = MediaConverter.SerializeRaw(jStruct); r.Write(buff); } - } + } // ZXSTTAPE if (s._machine.tapeImages.Count() > 0) diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Objects.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Objects.cs index 0d4eb15789..19606e606c 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Objects.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Snapshot/SZX/SZX.Objects.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } /// - /// If set, the emulated Spectrum uses alternate timings (one cycle later than normal timings). If reset, the emulated Spectrum uses standard timings. + /// If set, the emulated Spectrum uses alternate timings (one cycle later than normal timings). If reset, the emulated Spectrum uses standard timings. /// This flag is only applicable for the ZXSTMID_16K, ZXSTMID_48K and ZXSTMID_128K models. /// public const int ZXSTMF_ALTERNATETIMINGS = 1; @@ -76,7 +76,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// public const int ZXSTZF_EILAST = 1; /// - /// The last instruction executed was a HALT instruction. The CPU is currently executing NOPs and will continue to do so until the next interrupt occurs. + /// The last instruction executed was a HALT instruction. The CPU is currently executing NOPs and will continue to do so until the next interrupt occurs. /// This flag is mutually exclusive with ZXSTZF_EILAST. /// public const int ZXSTZF_HALTED = 2; @@ -116,13 +116,13 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// public const int ZXSTAYF_FULLERBOX = 1; /// - /// Melodik Soundbox emulation. + /// Melodik Soundbox emulation. /// This is essentially an AY chip for older Spectrums that uses the same ports as that found in 128k Spectrums /// public const int ZXSTAYF_128AY = 2; /// - /// The state of the AY chip found in all 128k Spectrums, Pentagons, Scorpions and Timex machines. + /// The state of the AY chip found in all 128k Spectrums, Pentagons, Scorpions and Timex machines. /// This block may also be present for 16k/48k Spectrums if Fuller Box or Melodik emulation is enabled. /// [StructLayout(LayoutKind.Sequential, Pack = 1)] @@ -214,7 +214,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } /// - /// The number of drives connected to the Spectrum +3 and whether their motors are turned on. + /// The number of drives connected to the Spectrum +3 and whether their motors are turned on. /// Any blocks specifying which disk files are in which drive will follow this one. /// [StructLayout(LayoutKind.Sequential, Pack = 1)] @@ -233,13 +233,13 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// public const int ZXSTDSKF_EMBEDDED = 2; /// - /// When a double-sided disk is inserted into a single-sided drive, specifies the side being read from/written to. + /// When a double-sided disk is inserted into a single-sided drive, specifies the side being read from/written to. /// If set, Side B is the active side, otherwise it is Side A. /// public const int ZXSTDSKF_SIDEB = 3; /// - /// Each +3 disk drive that has a disk inserted in it will have one of these blocks. + /// Each +3 disk drive that has a disk inserted in it will have one of these blocks. /// They follow the ZXSTPLUS3 block which identifies the number of drives. /// [StructLayout(LayoutKind.Sequential, Pack = 1)] diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/CSW/CswConverter.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/CSW/CswConverter.cs index 94a11dd721..e2cbedce03 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/CSW/CswConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/CSW/CswConverter.cs @@ -221,7 +221,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum t.DataPeriods.Add(length); currLevel = !currLevel; - t.DataLevels.Add(currLevel); + t.DataLevels.Add(currLevel); } // add closing period diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/PZX/PzxConverter.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/PZX/PzxConverter.cs index 27c3671124..ed41c487f5 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/PZX/PzxConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/PZX/PzxConverter.cs @@ -155,7 +155,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum bit 15 repeat count present: 0 not present 1 present 2 u16 duration1 bits 0-14 low/high (see bit 15) pulse duration bits bit 15 duration encoding: 0 duration1 1 ((duration1<<16)+duration2) - 4 u16 duration2 optional low bits of pulse duration (see bit 15 of duration1) + 4 u16 duration2 optional low bits of pulse duration (see bit 15 of duration1) 6 ... ... ditto repeated until the end of the block */ case "PULS": diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TAP/TapConverter.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TAP/TapConverter.cs index 0537028d00..31b164e0e7 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TAP/TapConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TAP/TapConverter.cs @@ -118,7 +118,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum MemoryStream stream = new MemoryStream(data); // the first 2 bytes of the TAP file designate the length of the first data block - // this (I think) should always be 17 bytes (as this is the tape header) + // this (I think) should always be 17 bytes (as this is the tape header) byte[] blockLengthData = new byte[2]; // we are now going to stream through the entire file processing a block at a time @@ -162,10 +162,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } // process the type byte - /* (The type is 0,1,2 or 3 for a Program, Number array, Character array or Code file. - A SCREEN$ file is regarded as a Code file with start address 16384 and length 6912 decimal. - If the file is a Program file, parameter 1 holds the autostart line number (or a number >=32768 if no LINE parameter was given) - and parameter 2 holds the start of the variable area relative to the start of the program. If it's a Code file, parameter 1 holds + /* (The type is 0,1,2 or 3 for a Program, Number array, Character array or Code file. + A SCREEN$ file is regarded as a Code file with start address 16384 and length 6912 decimal. + If the file is a Program file, parameter 1 holds the autostart line number (or a number >=32768 if no LINE parameter was given) + and parameter 2 holds the start of the variable area relative to the start of the program. If it's a Code file, parameter 1 holds the start of the code block when saved, and parameter 2 holds 32768. For data files finally, the byte at position 14 decimal holds the variable name.) */ @@ -312,28 +312,28 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum currLevel = !currLevel; dataLevels.Add(currLevel); } - + else { dataPeriods.Add(BIT_0_PL); currLevel = !currLevel; dataLevels.Add(currLevel); } - + if ((blockdata[i] & b) != 0) { dataPeriods.Add(BIT_1_PL); currLevel = !currLevel; dataLevels.Add(currLevel); } - + else { dataPeriods.Add(BIT_0_PL); currLevel = !currLevel; dataLevels.Add(currLevel); } - + } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TZX/TzxConverter.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TZX/TzxConverter.cs index a66973e032..192cf165d2 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TZX/TzxConverter.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TZX/TzxConverter.cs @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum double res = 0.98385608 * (double)tStates; return (int)res; } - */ + */ /// /// DeSerialization method @@ -207,7 +207,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum _position = 10; while (_position < data.Length) { - // block ID is the first byte in a new block + // block ID is the first byte in a new block blockId = data[_position++]; // process the data @@ -387,15 +387,15 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum private void ProcessBlockID10() { /* length: [02,03]+04 - + Offset Value Type Description 0x00 - WORD Pause after this block (ms.) {1000} 0x02 N WORD Length of data that follow - 0x04 - BYTE[N] Data as in .TAP files + 0x04 - BYTE[N] Data as in .TAP files - This block must be replayed with the standard Spectrum ROM timing values - see the values in - curly brackets in block ID 11. The pilot tone consists in 8063 pulses if the first data byte - (flag byte) is < 128, 3223 otherwise. This block can be used for the ROM loading routines AND + This block must be replayed with the standard Spectrum ROM timing values - see the values in + curly brackets in block ID 11. The pilot tone consists in 8063 pulses if the first data byte + (flag byte) is < 128, 3223 otherwise. This block can be used for the ROM loading routines AND for custom loading routines that use the same timings as ROM ones do. */ t = new TapeDataBlock @@ -491,7 +491,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum t.AddMetaData(BlockDescriptorTitle.Data_Length, blockLen + " Bytes"); t.AddMetaData(BlockDescriptorTitle.Bits_In_Last_Byte, bitsInLastByte + " Bits"); t.AddMetaData(BlockDescriptorTitle.Pause_After_Data, t.PauseInMS + " ms / " + t.PauseInTStates + "TStates"); - + // add the raw data t.BlockData = blockdata; @@ -520,14 +520,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x08 - WORD Length of ONE bit pulse {1710} 0x0A - WORD Length of PILOT tone (number of pulses) {8063 header (flag<128), 3223 data (flag>=128)} 0x0C - BYTE Used bits in the last byte (other bits should be 0) {8} - (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, + (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, where MSb is the leftmost bit, LSb is the rightmost bit) 0x0D - WORD Pause after this block (ms.) {1000} 0x0F N BYTE[3] Length of data that follow - 0x12 - BYTE[N] Data as in .TAP files + 0x12 - BYTE[N] Data as in .TAP files - This block is very similar to the normal TAP block but with some additional info on the timings and other important - differences. The same tape encoding is used as for the standard speed data block. If a block should use some non-standard + This block is very similar to the normal TAP block but with some additional info on the timings and other important + differences. The same tape encoding is used as for the standard speed data block. If a block should use some non-standard sync or pilot tones (i.e. all sorts of protection schemes) then use the next three blocks to describe it.*/ t = new TapeDataBlock @@ -614,7 +614,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum t.AddMetaData(BlockDescriptorTitle.One_Bit_Length, bit1PulseLength + " T-States"); t.AddMetaData(BlockDescriptorTitle.Data_Length, blockLen + " Bytes"); t.AddMetaData(BlockDescriptorTitle.Bits_In_Last_Byte, bitsInLastByte + " Bits"); - t.AddMetaData(BlockDescriptorTitle.Pause_After_Data, t.PauseInMS + " ms / " + t.PauseInTStates + "TStates"); + t.AddMetaData(BlockDescriptorTitle.Pause_After_Data, t.PauseInMS + " ms / " + t.PauseInTStates + "TStates"); // add the raw data t.BlockData = blockdata; @@ -638,9 +638,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum Offset Value Type Description 0x00 - WORD Length of one pulse in T-states - 0x02 - WORD Number of pulses + 0x02 - WORD Number of pulses - This will produce a tone which is basically the same as the pilot tone in the ID 10, ID 11 blocks. You can define how + This will produce a tone which is basically the same as the pilot tone in the ID 10, ID 11 blocks. You can define how long the pulse is and how many pulses are in the tone. */ int blockLen = 4; @@ -664,14 +664,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum while (pilotCount > 0) { ToggleSignal(); - t.DataPeriods.Add(pilotToneLength); + t.DataPeriods.Add(pilotToneLength); t.DataLevels.Add(signal); t.PulseDescription.Add("Pilot " + pilotCount); pilotCount--; } // add the block to the datacorder - _datacorder.DataBlocks.Add(t); + _datacorder.DataBlocks.Add(t); // advance the position to the next block _position += blockLen; @@ -686,12 +686,12 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum private void ProcessBlockID13() { /* length: [00]*02+01 - * + * Offset Value Type Description 0x00 N BYTE Number of pulses 0x01 - WORD[N] Pulses' lengths - This will produce N pulses, each having its own timing. Up to 255 pulses can be stored in this block; this is useful for non-standard + This will produce N pulses, each having its own timing. Up to 255 pulses can be stored in this block; this is useful for non-standard sync tones used by some protection schemes. */ t = new TapeDataBlock @@ -739,11 +739,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x00 - WORD Length of ZERO bit pulse 0x02 - WORD Length of ONE bit pulse 0x04 - BYTE Used bits in last byte (other bits should be 0) - (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, + (e.g. if this is 6, then the bits used (x) in the last byte are: xxxxxx00, where MSb is the leftmost bit, LSb is the rightmost bit) 0x05 - WORD Pause after this block (ms.) 0x07 N BYTE[3] Length of data that follow - 0x0A - BYTE[N] Data as in .TAP files + 0x0A - BYTE[N] Data as in .TAP files This is the same as in the turbo loading data block, except that it has no pilot or sync pulses. */ @@ -759,7 +759,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum pilotCount = 0; bit0PulseLength = GetWordValue(data, _position + 0); - bit1PulseLength = GetWordValue(data, _position + 2); + bit1PulseLength = GetWordValue(data, _position + 2); bitsInLastByte = data[_position + 4]; pauseLen = GetWordValue(data, _position + 5); blockLen = 0xFFFFFF & GetInt32(data, _position + 0x07); @@ -780,7 +780,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum t.AddMetaData(BlockDescriptorTitle.One_Bit_Length, bit1PulseLength + " T-States"); t.AddMetaData(BlockDescriptorTitle.Data_Length, blockLen + " Bytes"); t.AddMetaData(BlockDescriptorTitle.Bits_In_Last_Byte, bitsInLastByte + " Bits"); - t.AddMetaData(BlockDescriptorTitle.Pause_After_Data, t.PauseInMS + " ms / " + t.PauseInTStates + "TStates"); + t.AddMetaData(BlockDescriptorTitle.Pause_After_Data, t.PauseInMS + " ms / " + t.PauseInTStates + "TStates"); // add the raw data t.BlockData = blockdata; @@ -809,12 +809,12 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum (e.g. if this is 2, only first two samples of the last byte will be played) 0x05 N BYTE[3] Length of samples' data 0x08 - BYTE[N] Samples data. Each bit represents a state on the EAR port (i.e. one sample). - MSb is played first. + MSb is played first. - This block is used for tapes which have some parts in a format such that the turbo loader block cannot be used. - This is not like a VOC file, since the information is much more compact. Each sample value is represented by one bit only + This block is used for tapes which have some parts in a format such that the turbo loader block cannot be used. + This is not like a VOC file, since the information is much more compact. Each sample value is represented by one bit only (0 for low, 1 for high) which means that the block will be at most 1/8 the size of the equivalent VOC. - The preferred sampling frequencies are 22050 or 44100 Hz (158 or 79 T-states/sample). + The preferred sampling frequencies are 22050 or 44100 Hz (158 or 79 T-states/sample). Please, if you can, don't use other sampling frequencies. Please use this block only if you cannot use any other block. */ @@ -822,12 +822,12 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { BlockID = 0x15, BlockDescription = BlockType.Direct_Recording - }; + }; int tStatesPerSample = GetWordValue(data, _position); pauseLen = GetWordValue(data, _position + 2); bitsInLastByte = data[_position + 4]; - blockLen = 0xFFFFFF & GetInt32(data, _position + 0x05); + blockLen = 0xFFFFFF & GetInt32(data, _position + 0x05); t.PauseInMS = pauseLen; t.PauseInTStates = TranslatePause(pauseLen); @@ -891,7 +891,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum ZeroVars(); } - + /// /// 0x18 - CSW Recording Block /// @@ -907,7 +907,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x01: RLE 0x02: Z-RLE 0x0A - DWORD Number of stored pulses (after decompression, for validation purposes) - 0x0E - BYTE[N] CSW data, encoded according to the CSW file format specification. + 0x0E - BYTE[N] CSW data, encoded according to the CSW file format specification. This block contains a sequence of raw pulses encoded in CSW format v2 (Compressed Square Wave). */ @@ -969,18 +969,18 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // ready for next block ZeroVars(); } - + /// /// Pause Block /// private void ProcessBlockID20() { /* length: 02 - * + * Offset Value Type Description - 0x00 - WORD Pause duration (ms.) + 0x00 - WORD Pause duration (ms.) - This will make a silence (low amplitude level (0)) for a given time in milliseconds. If the value is 0 then the + This will make a silence (low amplitude level (0)) for a given time in milliseconds. If the value is 0 then the emulator or utility should (in effect) STOP THE TAPE, i.e. should not continue loading until the user or emulator requests it. */ t = new TapeDataBlock(); t.BlockID = 0x20; @@ -1011,20 +1011,20 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // ready for next block ZeroVars(); } - + /// /// 0x21 - Group Start /// private void ProcessBlockID21() { /* length: [00]+01 - * + * Offset Value Type Description 0x00 L BYTE Length of the group name string - 0x01 - CHAR[L] Group name in ASCII format (please keep it under 30 characters long) + 0x01 - CHAR[L] Group name in ASCII format (please keep it under 30 characters long) - This block marks the start of a group of blocks which are to be treated as one single (composite) block. - This is very handy for tapes that use lots of subblocks like Bleepload (which may well have over 160 custom loading blocks). + This block marks the start of a group of blocks which are to be treated as one single (composite) block. + This is very handy for tapes that use lots of subblocks like Bleepload (which may well have over 160 custom loading blocks). You can also give the group a name (example 'Bleepload Block 1'). For each group start block, there must be a group end block. Nesting of groups is not allowed. */ @@ -1046,19 +1046,19 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += nameLength; // ready for next block ZeroVars(); } - + /// /// 0x22 - Group End /// private void ProcessBlockID22() { - /* length: 00 + /* length: 00 This indicates the end of a group. This block has no body. */ @@ -1077,7 +1077,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // ready for next block ZeroVars(); } - + /// /// 0x24 - Loop Start /// @@ -1086,9 +1086,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /* length: 02 Offset Value Type Description - 0x00 - WORD Number of repetitions (greater than 1) + 0x00 - WORD Number of repetitions (greater than 1) - If you have a sequence of identical blocks, or of identical groups of blocks, you can use this block to tell how many times they should + If you have a sequence of identical blocks, or of identical groups of blocks, you can use this block to tell how many times they should be repeated. This block is the same as the FOR statement in BASIC. For simplicity reasons don't nest loop blocks! */ @@ -1116,21 +1116,21 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 2; // ready for next block ZeroVars(); } - + /// /// 0x25 - Loop End /// private void ProcessBlockID25() { - /* length: 00 + /* length: 00 - This is the same as BASIC's NEXT statement. It means that the utility should jump back to the start of the loop if it hasn't + This is the same as BASIC's NEXT statement. It means that the utility should jump back to the start of the loop if it hasn't been run for the specified number of times. This block has no body. */ @@ -1181,11 +1181,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum private void ProcessBlockID2A() { /* length: 04 - * + * Offset Value Type Description 0x00 0 DWORD Length of the block without these four bytes (0) - When this block is encountered, the tape will stop ONLY if the machine is an 48K Spectrum. This block is to be used for + When this block is encountered, the tape will stop ONLY if the machine is an 48K Spectrum. This block is to be used for multiloading games that load one level at a time in 48K mode, but load the entire tape at once if in 128K mode. This block has no body of its own, but follows the extension rule. */ @@ -1203,13 +1203,13 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockSize; // ready for next block ZeroVars(); } - + /// /// 0x2B - Set Signal Level /// @@ -1221,7 +1221,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x00 1 DWORD Block length (without these four bytes) 0x04 - BYTE Signal level (0=low, 1=high) - This block sets the current signal level to the specified value (high or low). It should be used whenever it is necessary to avoid any + This block sets the current signal level to the specified value (high or low). It should be used whenever it is necessary to avoid any ambiguities, e.g. with custom loaders which are level-sensitive. */ t = new TapeDataBlock(); @@ -1243,13 +1243,13 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 5; // ready for next block ZeroVars(); } - + /// /// Text Description /// @@ -1261,10 +1261,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x00 N BYTE Length of the text description 0x01 - CHAR[N] Text description in ASCII format - This is meant to identify parts of the tape, so you know where level 1 starts, where to rewind to when the game ends, etc. - This description is not guaranteed to be shown while the tape is playing, but can be read while browsing the tape or changing + This is meant to identify parts of the tape, so you know where level 1 starts, where to rewind to when the game ends, etc. + This description is not guaranteed to be shown while the tape is playing, but can be read while browsing the tape or changing the tape pointer. - The description can be up to 255 characters long but please keep it down to about 30 so the programs can show it in one line + The description can be up to 255 characters long but please keep it down to about 30 so the programs can show it in one line (where this is appropriate). Please use 'Archive Info' block for title, authors, publisher, etc. */ @@ -1286,13 +1286,13 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += textLen; // ready for next block ZeroVars(); } - + /// /// 0x32 - Archive Info /// @@ -1323,10 +1323,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x02 - CHAR[L] Text string in ASCII format ---- - Use this block at the beginning of the tape to identify the title of the game, author, publisher, year of publication, price (including - the currency), type of software (arcade adventure, puzzle, word processor, ...), protection scheme it uses (Speedlock 1, Alkatraz, ...) - and its origin (Original, Budget re-release, ...), etc. This block is built in a way that allows easy future expansion. - The block consists of a series of text strings. Each text has its identification number (which tells us what the text means) and then + Use this block at the beginning of the tape to identify the title of the game, author, publisher, year of publication, price (including + the currency), type of software (arcade adventure, puzzle, word processor, ...), protection scheme it uses (Speedlock 1, Alkatraz, ...) + and its origin (Original, Budget re-release, ...), etc. This block is built in a way that allows easy future expansion. + The block consists of a series of text strings. Each text has its identification number (which tells us what the text means) and then the ASCII text. To make it possible to skip this block, if needed, the length of the whole block is at the beginning of it. If all texts on the tape are in English language then you don't have to supply the 'Language' field The information about what hardware the tape uses is in the 'Hardware Type' block, so no need for it here. */ @@ -1395,7 +1395,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum t.PauseInTStates = 0; // advance to next string block - _position += strLen; + _position += strLen; } // add to tape @@ -1404,7 +1404,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // ready for next block ZeroVars(); } - + /// /// 0x35 - Custom Info Block /// @@ -1415,9 +1415,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum Offset Value Type Description 0x00 - CHAR[10] Identification string (in ASCII) 0x10 L DWORD Length of the custom info - 0x14 - BYTE[L] Custom info + 0x14 - BYTE[L] Custom info - This block can be used to save any information you want. For example, it might contain some information written by a utility, + This block can be used to save any information you want. For example, it might contain some information written by a utility, extra settings required by a particular emulator, or even poke data. */ t = new TapeDataBlock(); @@ -1437,7 +1437,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockLen; // ready for next block @@ -1452,14 +1452,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /* length: 09 Offset Value Type Description - 0x00 - BYTE[9] Value: { "XTape!",0x1A,MajR,MinR } - Just skip these 9 bytes and you will end up on the next ID. + 0x00 - BYTE[9] Value: { "XTape!",0x1A,MajR,MinR } + Just skip these 9 bytes and you will end up on the next ID. - This block is generated when you merge two ZX Tape files together. It is here so that you can easily copy the files together and use - them. Of course, this means that resulting file would be 10 bytes longer than if this block was not used. All you have to do + This block is generated when you merge two ZX Tape files together. It is here so that you can easily copy the files together and use + them. Of course, this means that resulting file would be 10 bytes longer than if this block was not used. All you have to do if you encounter this block ID is to skip next 9 bytes. - If you can avoid using this block for this purpose, then do so; it is preferable to use a utility to join the two files and - ensure that they are both of the higher version number. */ + If you can avoid using this block for this purpose, then do so; it is preferable to use a utility to join the two files and + ensure that they are both of the higher version number. */ t = new TapeDataBlock(); t.BlockID = 0x5A; @@ -1471,7 +1471,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 9; // ready for next block @@ -1494,7 +1494,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 4; } @@ -1526,10 +1526,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 03 - The tape DOESN'T RUN on this machine or with this hardware. ---- - This blocks contains information about the hardware that the programs on this tape use. Please include only machines and hardware for - which you are 100% sure that it either runs (or doesn't run) on or with, or you know it uses (or doesn't use) the hardware or special + This blocks contains information about the hardware that the programs on this tape use. Please include only machines and hardware for + which you are 100% sure that it either runs (or doesn't run) on or with, or you know it uses (or doesn't use) the hardware or special features of that machine. - If the tape runs only on the ZX81 (and TS1000, etc.) then it clearly won't work on any Spectrum or Spectrum variant, so there's no + If the tape runs only on the ZX81 (and TS1000, etc.) then it clearly won't work on any Spectrum or Spectrum variant, so there's no need to list this information. If you are not sure or you haven't tested a tape on some particular machine/hardware combination then do not include it in the list. The list of hardware types and IDs is somewhat large, and may be found at the end of the format description. */ @@ -1574,7 +1574,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x01 N BYTE Length of the text message 0x02 - CHAR[N] Message that should be displayed in ASCII format - This will enable the emulators to display a message for a given time. This should not stop the tape and it should not make silence. + This will enable the emulators to display a message for a given time. This should not stop the tape and it should not make silence. If the time is 0 then the emulator should wait for the user to press a key. The text message should: stick to a maximum of 30 chars per line; @@ -1603,7 +1603,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += msgLen; // ready for next block @@ -1619,12 +1619,12 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum Offset Value Type Description 0x00 N WORD Number of calls to be made - 0x02 - WORD[N] Array of call block numbers (relative-signed offsets) + 0x02 - WORD[N] Array of call block numbers (relative-signed offsets) - This block is an analogue of the CALL Subroutine statement. It basically executes a sequence of blocks that are somewhere else and - then goes back to the next block. Because more than one call can be normally used you can include a list of sequences to be called. - The 'nesting' of call blocks is also not allowed for the simplicity reasons. You can, of course, use the CALL blocks in the LOOP - sequences and vice versa. The value is relative for the obvious reasons - so that you can add some blocks in the beginning of the + This block is an analogue of the CALL Subroutine statement. It basically executes a sequence of blocks that are somewhere else and + then goes back to the next block. Because more than one call can be normally used you can include a list of sequences to be called. + The 'nesting' of call blocks is also not allowed for the simplicity reasons. You can, of course, use the CALL blocks in the LOOP + sequences and vice versa. The value is relative for the obvious reasons - so that you can add some blocks in the beginning of the file without disturbing the call values. Please take a look at 'Jump To Block' for reference on the values. */ // block processing not implemented for this - just gets added for informational purposes only @@ -1641,7 +1641,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockSize; // ready for next block @@ -1653,9 +1653,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// private void ProcessBlockID27() { - /* length: 00 + /* length: 00 - This block indicates the end of the Called Sequence. The next block played will be the block after the last CALL block (or the next Call, + This block indicates the end of the Called Sequence. The next block played will be the block after the last CALL block (or the next Call, if the Call block had multiple calls). Again, this block has no body. */ @@ -1683,7 +1683,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum Offset Value Type Description 0x00 - WORD Length of the whole block (without these two bytes) 0x02 N BYTE Number of selections - 0x03 - SELECT[N] List of selections + 0x03 - SELECT[N] List of selections ---- SELECT structure format @@ -1693,9 +1693,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x03 - CHAR[L] Description text (please use single line and max. 30 chars) ---- - This block is useful when the tape consists of two or more separately-loadable parts. With this block, you are able to select - one of the parts and the utility/emulator will start loading from that block. For example you can use it when the game has a - separate Trainer or when it is a multiload. Of course, to make some use of it the emulator/utility has to show a menu with the + This block is useful when the tape consists of two or more separately-loadable parts. With this block, you are able to select + one of the parts and the utility/emulator will start loading from that block. For example you can use it when the game has a + separate Trainer or when it is a multiload. Of course, to make some use of it the emulator/utility has to show a menu with the selections when it encounters such a block. All offsets are relative signed words. */ // block processing not implemented for this - just gets added for informational purposes only @@ -1712,7 +1712,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockSize; // ready for next block @@ -1725,11 +1725,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum private void ProcessBlockID23() { /* length: 02 - * + * Offset Value Type Description - 0x00 - WORD Relative jump value + 0x00 - WORD Relative jump value - This block will enable you to jump from one block to another within the file. The value is a signed short word + This block will enable you to jump from one block to another within the file. The value is a signed short word (usually 'signed short' in C); Some examples: Jump 0 = 'Loop Forever' - this should never happen Jump 1 = 'Go to the next block' - it is like NOP in assembler ;) @@ -1772,7 +1772,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 2; // ready for next block @@ -1785,7 +1785,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum private void ProcessBlockID19() { /* length: [00,01,02,03]+04 - * + * Offset Value Type Description 0x00 - DWORD Block length (without these four bytes) 0x04 - WORD Pause after this block (ms) @@ -1808,12 +1808,12 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum (TOTP>0)*((2*NPP+1)*ASP)+ TOTP*3+ (2*NPD+1)*ASD - BYTE[DS] Data stream - This field is present only if TOTD>0 + This field is present only if TOTD>0 This block has been specifically developed to represent an extremely wide range of data encoding techniques. - The basic idea is that each loading component (pilot tone, sync pulses, data) is associated to a specific sequence - of pulses, where each sequence (wave) can contain a different number of pulses from the others. - In this way we can have a situation where bit 0 is represented with 4 pulses and bit 1 with 8 pulses. + The basic idea is that each loading component (pilot tone, sync pulses, data) is associated to a specific sequence + of pulses, where each sequence (wave) can contain a different number of pulses from the others. + In this way we can have a situation where bit 0 is represented with 4 pulses and bit 1 with 8 pulses. ---- SYMDEF structure format @@ -1826,11 +1826,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 11: force high level 0x01 - WORD[MAXP] Array of pulse lengths. - The alphabet is stored using a table where each symbol is a row of pulses. The number of columns (i.e. pulses) of the table is the - length of the longest sequence amongst all (MAXP=NPP or NPD, for pilot/sync or data blocks respectively); shorter waves are terminated by a + The alphabet is stored using a table where each symbol is a row of pulses. The number of columns (i.e. pulses) of the table is the + length of the longest sequence amongst all (MAXP=NPP or NPD, for pilot/sync or data blocks respectively); shorter waves are terminated by a zero-length pulse in the sequence. - Any number of data symbols is allowed, so we can have more than two distinct waves; for example, imagine a loader which writes two bits at a - time by encoding them with four distinct pulse lengths: this loader would have an alphabet of four symbols, each associated to a specific + Any number of data symbols is allowed, so we can have more than two distinct waves; for example, imagine a loader which writes two bits at a + time by encoding them with four distinct pulse lengths: this loader would have an alphabet of four symbols, each associated to a specific sequence of pulses (wave). ---- ---- @@ -1839,10 +1839,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 0x00 - BYTE Symbol to be represented 0x01 - WORD Number of repetitions - Most commonly, pilot and sync are repetitions of the same pulse, thus they are represented using a very simple RLE encoding structure which stores + Most commonly, pilot and sync are repetitions of the same pulse, thus they are represented using a very simple RLE encoding structure which stores the symbol and the number of times it must be repeated. - Each symbol in the data stream is represented by a string of NB bits of the block data, where NB = ceiling(Log2(ASD)). - Thus the length of the whole data stream in bits is NB*TOTD, or in bytes DS=ceil(NB*TOTD/8). + Each symbol in the data stream is represented by a string of NB bits of the block data, where NB = ceiling(Log2(ASD)). + Thus the length of the whole data stream in bits is NB*TOTD, or in bytes DS=ceil(NB*TOTD/8). ---- */ // not currently implemented properly @@ -1898,7 +1898,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block int blockLen = GetInt32(data, _position); _position += blockLen; } @@ -1916,7 +1916,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block int blockLen = GetInt32(data, _position); _position += blockLen; } @@ -1933,7 +1933,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += 8; } @@ -1943,11 +1943,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum 00: .Z80 format 01: .SNA format 0x01 L BYTE[3] Snapshot length - 0x04 - BYTE[L] Snapshot itself + 0x04 - BYTE[L] Snapshot itself - This would enable one to snapshot the game at the start and still have all the tape blocks (level data, etc.) in the same file. + This would enable one to snapshot the game at the start and still have all the tape blocks (level data, etc.) in the same file. Only .Z80 and .SNA snapshots are supported for compatibility reasons! - The emulator should take care of that the snapshot is not taken while the actual Tape loading is taking place (which doesn't do much sense). + The emulator should take care of that the snapshot is not taken while the actual Tape loading is taking place (which doesn't do much sense). And when an emulator encounters the snapshot block it should load it and then continue with the next block. */ private void ProcessBlockID40() { @@ -1968,7 +1968,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // add to tape _datacorder.DataBlocks.Add(t); - // advance to next block + // advance to next block _position += blockLen; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs index a9453c2c2b..c23627b05e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs @@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/ZXSpectrum48k.jpg/1200px-ZXSpectrum48k.jpg // https://upload.wikimedia.org/wikipedia/commons/c/ca/ZX_Spectrum%2B.jpg - // Keyboard - row 1 + // Keyboard - row 1 "Key True Video", "Key Inv Video", "Key 1", "Key 2", "Key 3", "Key 4", "Key 5", "Key 6", "Key 7", "Key 8", "Key 9", "Key 0", "Key Break", // Keyboard - row 2 "Key Delete", "Key Graph", "Key Q", "Key W", "Key E", "Key R", "Key T", "Key Y", "Key U", "Key I", "Key O", "Key P", diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs index e413745296..ea810e5386 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs @@ -333,7 +333,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 internal byte ReadControls1(bool peek) { InputCallbacks.Call(); - + byte value = _controllerDeck.ReadPort1(_controller); if (!peek) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs index 59987a2ba4..8a9271153e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public IMemoryCallbackSystem MemoryCallbacks { get; } = new MemoryCallbackSystem(new[] { "System Bus" }); public bool CanStep(StepType type) => false; - + [FeatureNotImplemented] public void Step(StepType type) => throw new NotImplementedException(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs index 8c3459bab5..9d796fdfa0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IMemoryDomains.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 65536, MemoryDomain.Endian.Little, addr => _mapper.PeekMemory((ushort) addr), - (addr, value) => _mapper.PokeMemory((ushort) addr, value), 1) + (addr, value) => _mapper.PokeMemory((ushort) addr, value), 1) }; if (_mapper.CartRam.Length > 0) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.RomHeuristics.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.RomHeuristics.cs index 495e543a46..508e2e7700 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.RomHeuristics.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.RomHeuristics.cs @@ -14,12 +14,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return "AR"; } - + if (rom.Length < 2048) // Less than 2k, then no bank switching needed { return "2K"; } - + if (rom.Length is 2048 || (rom.Length is 4096 && rom.AsSpan(start: 0, length: 2048).SequenceEqual(rom.AsSpan(start: 2048, length: 2048)))) @@ -27,12 +27,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // If 2k or the same 2k twice...Why would a rom be that way? Overdump? return IsProablyCV(rom) ? "CV" : "2K"; } - + if (rom.Length == 4096) { return IsProablyCV(rom) ? "CV" : "4K"; } - + if (rom.Length == 8192) // Several 8K Options { if (IsProbablySC(rom)) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600Controllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600Controllers.cs index 358a709b24..24a0688d88 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600Controllers.cs @@ -148,7 +148,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public int Read_Pot(IController c, int pot) { int x = c.AxisValue(Definition.Axes[pot]); - + x = -x; x += 127; @@ -212,7 +212,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { is_pressed = c.IsPressed($"P{PortNum} Button 2"); } - + if (is_pressed) { return 10; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs index 9ac4131376..cfa01e76bb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { if ((addr & 0x0200) == 0) // If not register select, read Ram { - return _core.Ram[(ushort)(addr & 0x007f)]; + return _core.Ram[(ushort)(addr & 0x007f)]; } var registerAddr = (ushort)(addr & 0x0007); @@ -42,13 +42,13 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 temp = (byte)(temp + (_outputA & _ddRa)); return temp; } - + if (registerAddr == 0x01) { // Read DDRA return _ddRa; } - + if (registerAddr == 0x02) { // Read Output reg B @@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return _ddRb; } - + if ((registerAddr & 0x5) == 0x4) { // Bit 0x0080 contains interrupt enable/disable diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/Multicart8K.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/Multicart8K.cs index 7d3f5a0d60..0cfcdf1cdd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/Multicart8K.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/Multicart8K.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 internal sealed class Multicart8K : MapperBase { private int _bank4K; - + private int _gameTotal; private int _currentGame; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs index 73da4211bc..3b5f29d666 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 To select a particular 2K ROM bank, its number is poked into address 3F. Because there's 8 bits, there's enough for 256 2K banks, or a maximum of 512K of ROM. - Writing to 3E, however, is what's new. Writing here selects a 1K RAM bank into + Writing to 3E, however, is what's new. Writing here selects a 1K RAM bank into 1000-17FF. The example (BoulderDash) uses 16K of RAM, however there's theoretically enough space for 256K of RAM. When RAM is selected, 1000-13FF is the read port while 1400-17FF is the write port. diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3F.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3F.cs index ea08534a23..9b0636ac9d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3F.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3F.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 3F (TigerVision) ----- - Traditionally, this method was used on the TigerVision games. The ROMs were all 8K, and + Traditionally, this method was used on the TigerVision games. The ROMs were all 8K, and there's two 2K pages in the 4K of address space. The upper bank is fixed to the last 2K of the ROM. @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 register, and this has been done... however do not think 512K ROMs have been made just yet. */ - internal sealed class m3F : MapperBase + internal sealed class m3F : MapperBase { private int _lowBank2K; @@ -45,12 +45,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return base.ReadMemory(addr); } - + if (addr < 0x1800) // Low 2k Bank { return Core.Rom[(_lowBank2K << 11) + (addr & 0x07FF)]; } - + if (addr < 0x2000) // High bank fixed to last 2k of ROM { return Core.Rom[Core.Rom.Length - 2048 + (addr & 0x07FF)]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs index ef6b8f6ff0..529956ee39 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Bankswitching method as defined/created by John Payson (aka SuperCat), documented at http://www.casperkitty.com/stella/cartfmt.htm. - In this bankswitching scheme the 2600's 4K cartridge address space + In this bankswitching scheme the 2600's 4K cartridge address space is broken into four segments. The first 2K segment accesses any 2K region of RAM, or of the first 32K of ROM. The second 1.5K segment accesses the first 1.5K of any 2K region of RAM, or of the last 32K @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 bytes of ROM. */ - internal sealed class m4A50 : MapperBase + internal sealed class m4A50 : MapperBase { private byte[] _ram = new byte[32768]; @@ -70,7 +70,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Copy the ROM image into my buffer // Supported file sizes are 32/64/128K, which are duplicated if necessary _romImage = new byte[131072]; - + if (Core.Rom.Length < 65536) { for (int i = 0; i < 4; i++) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs index 594a90e987..b6d37d1490 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs @@ -4,12 +4,12 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Atari.Atari2600 { /* - This is the cartridge class for Arcadia (aka StarPath) Supercharger - games. Christopher Salomon provided most of the technical details + This is the cartridge class for Arcadia (aka StarPath) Supercharger + games. Christopher Salomon provided most of the technical details used in creating this class. A good description of the Supercharger is provided in the Cuttle Cart's manual. - The Supercharger has four 2K banks. There are three banks of RAM + The Supercharger has four 2K banks. There are three banks of RAM and one bank of ROM. All 6K of the RAM can be read and written. D7-D5 of this byte: Write Pulse Delay (n/a for emulator) @@ -141,12 +141,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _dataHoldRegister = 0; _numberOfLoadImages = 0; _loadedImages = null; - + _header = new byte[256]; _powerIndicator = false; _powerRomCycle = 0; _size = 0; - + _elapsedCycles = 0; InitializeSettings(); @@ -372,7 +372,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // 101wp 1 ROM // 110wp 2 1 as used in Killer Satellites // 111wp 1 2 as we use for 2k/4k ROM cloning - // + // // w = Write Enable (1 = enabled; accesses to $F000-$F0FF cause writes // to happen. 0 = disabled, and the cart acts like ROM.) // p = ROM Power (0 = enabled, 1 = off.) Only power the ROM if you're diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs index 71c2e36389..e07e2f7143 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCM.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 /* Spectra-video Compumate Add-on Kevtris Documentation - This is more than just a cartridge mapper- it's also a "computer" add-on. + This is more than just a cartridge mapper- it's also a "computer" add-on. There's two 8K EPROMs soldered on top of each other. There's two short wires with DB-9's on them which you plug into the two controller ports. A 42 or so key membrane keyboard with audio in and audio out, and 1K of RAM. @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 R - 4017 RST, and RAM direction. (high = write, low = read) E - RAM enable. 1 = disable RAM, 0 = enable RAM 3 - Row 3 of keyboard - 1 - Row 1 of keyboard + 1 - Row 1 of keyboard B - 2 bit ROM bank number All bits are outputs except for the 2 row inputs from the keyboard. @@ -75,24 +75,24 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 0 1 2 3 4 5 6 7 8 9 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | 7 | | 6 | | 8 | | 2 | | 3 | | 0 | | 9 | | 5 | | 1 | | 4 | 0 - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | U | | Y | | I | | W | | E | | P | | O | | T | | Q | | R | 1 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ Row +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | J | | H | | K | | S | | D | |ent| | L | | G | | A | | F | 2 - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | M | | N | | < | | X | | C | |spc| | > | | B | | Z | | V | 3 - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ Function and Shift are separate keys that are read by 2 of the paddle inputs. These two buttons pull the specific paddle input low when pressed. - Because the inputs are inverted, a low indicates a pressed button, and a high + Because the inputs are inverted, a low indicates a pressed button, and a high is an unpressed one. - The audio input/output are designed to drive a tape player. The audio output is + The audio input/output are designed to drive a tape player. The audio output is buffered through an inverter and 2 resistors and a capacitor to reduce the level to feed it into the tape player. @@ -105,7 +105,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 * SpectraVideo Compumate Add-on Stella Documentation Cartridge class used for SpectraVideo Compumate bankswitched games. - This is more than just a cartridge mapper - it's also a "computer" add-on. + This is more than just a cartridge mapper - it's also a "computer" add-on. There's two 8K EPROMs soldered on top of each other. There's two short wires with DB-9's on them which you plug into the two controller ports. A 42 or so key membrane keyboard with audio in and audio out, and 2K of RAM. @@ -150,24 +150,24 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 0 1 2 3 4 5 6 7 8 9 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | 7 | | 6 | | 8 | | 2 | | 3 | | 0 | | 9 | | 5 | | 1 | | 4 | 0 - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | U | | Y | | I | | W | | E | | P | | O | | T | | Q | | R | 1 +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ Row +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | J | | H | | K | | S | | D | |ent| | L | | G | | A | | F | 2 - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ | M | | N | | < | | X | | C | |spc| | > | | B | | Z | | V | 3 - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ + +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ Function and Shift are separate keys that are read by 2 of the paddle inputs. These two buttons pull the specific paddle input low when pressed. - Because the inputs are inverted, a low indicates a pressed button, and a high + Because the inputs are inverted, a low indicates a pressed button, and a high is an unpressed one. - The audio input/output are designed to drive a tape player. The audio output is + The audio input/output are designed to drive a tape player. The audio output is buffered through an inverter and 2 resistors and a capacitor to reduce the level to feed it into the tape player. @@ -217,8 +217,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } public override byte ReadMemory(ushort addr) - { - // A unique feature of the keyboard is that it changes the operation of inputs 0-3 + { + // 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 cumbersome // so instead we bypass these cases here @@ -320,7 +320,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { var bit5 = value.Bit(5); var bit4 = value.Bit(4); - + // D5 RAM direction. (high = write, low = read) // 0 -> enable RAM writing (if D4 = 1) // D4 = RAM enable: 1 = disable RAM, 0 = enable RAM diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs index 9ccd8d96e4..bfe8430d52 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 The read port is at 1000-13FF. The write port is at 1400-17FF. - + Example games: Magicard */ @@ -42,17 +42,17 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return base.ReadMemory(addr); } - + if (addr < 0x1400) { return _ram[(addr & 0x3FF)]; } - + if (addr >= 0x1800 && addr < 0x2000) { return Core.Rom[addr & 0x7FF]; } - + return base.ReadMemory(addr); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPC.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPC.cs index 33272a7ea5..cfa79a8ab7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPC.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPC.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 a custom chip in the cartridge. Fortunately for us, there's a patent that describes lots of the internal workings of the chip (number 4644495, "video memory system"). - Interestingly, the patent shows the DPC as a *separate* device. You plug a + Interestingly, the patent shows the DPC as a *separate* device. You plug a pass-through cartridge into your 2600, then plug the game cartridge into the pass-through. Apparently, Activision thought that people wouldn't like this, or there was some other reasoning behind it and they ditched that idea and went with @@ -33,18 +33,18 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 process variations of the DPC itself will control the frequency of the music produced by it. - If you touch the resistor on the cartridge board, the music pitch will drastically + If you touch the resistor on the cartridge board, the music pitch will drastically change, almost like you were playing it on a theremin! Lowering the resistance makes the music pitch increase, increasing the resistance makes the pitch lower. - It's extremely high impedance so body effects of you touching the pin makes it + It's extremely high impedance so body effects of you touching the pin makes it vary wildly. Thus, I say there's really no "one true" pitch for the music. The patent, however, says that the frequency of this oscillator is 42KHz in the "preferred embodiment". The patent says that it can range from 15KHz to 80KHz depending on the application and the particular design of the sound generator. I chose 21KHz (half their preferred - value) and it sounds fairly close to my actual cartridge. + value) and it sounds fairly close to my actual cartridge. Address map: @@ -53,8 +53,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 1004-1005 : sound value (and MOVAMT value ANDed with draw line carry, with draw line add) 1006-1007 : sound value (and MOVAMT value ANDed with draw line carry, no draw line add) 1008-100F : returned data value for fetcher 0-7 - 1010-1017 : returned data value for fetcher 0-7, masked - 1018-101F : returned data value for fetcher 0-7, nybble swapped, masked + 1010-1017 : returned data value for fetcher 0-7, masked + 1018-101F : returned data value for fetcher 0-7, nybble swapped, masked 1020-1027 : returned data value for fetcher 0-7, byte reversed, masked 1028-102F : returned data value for fetcher 0-7, rotated right one bit, masked 1030-1037 : returned data value for fetcher 0-7, rotated left one bit, masked @@ -79,8 +79,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 black, and nothing else. Failure to emulate this will result in the eel not flashing. It's an 8 bit LFSR which can be reset to the all 0's condition by accessing 1070-1077. - Unlike a regular LFSR, this one uses three XOR gates and an inverter, so the illegal - condition is the all 1's condition. + Unlike a regular LFSR, this one uses three XOR gates and an inverter, so the illegal + condition is the all 1's condition. There's 255 states and the following code emulates it: @@ -134,7 +134,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 12 bit address which can then be used to index the DPC's ROM. A few of the upper bits on 105C-105F are used for a few other purposes, which will be - described later. + described later. Masking the data: ----------------- @@ -161,7 +161,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Making Music: ------------- - The music is generated by repurposing three of the fetchers, the last three. + The music is generated by repurposing three of the fetchers, the last three. Each fetcher can be individually selected for music or fetching. 7 0 @@ -180,7 +180,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 but you can. Maybe they had some plans for externally clocking the chip via some logic to bump the pointers. - Normally you set both the M and P bits to make music. + Normally you set both the M and P bits to make music. When in music mode, the lower 8 bits of the fetcher pointer is used as an 8 bit down counter. Each time the lower 8 bits equals FFh, it is reloaded from the start count @@ -191,7 +191,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 This means that the duty cycle of the square waves produced can be varied by adjusting the end count register relative to the start count register. I suspect the game simply - right shifts the start count by one and stuffs it into the end count to produce a + right shifts the start count by one and stuffs it into the end count to produce a 50% duty cycle waveform. The three flag outputs for fetchers 5 to 7 are fed into a cool little circuit composed @@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 The output is as follows: fetcher result - 567 + 567 --------------------- 000 0h 001 4h @@ -487,7 +487,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 var bit = _randomInputBits[((_currentRandomVal >> 3) & 0x07) | ((_currentRandomVal & 0x80) > 0 ? 0x08 : 0x00)]; - // Update the shift register + // Update the shift register _currentRandomVal = (byte)((_currentRandomVal << 1) | bit); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPCPlus.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPCPlus.cs index 8bea89e269..6dac0541f3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPCPlus.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mDPCPlus.cs @@ -283,7 +283,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 var bit = _randomInputBits[((_currentRandomVal >> 3) & 0x07) | (((_currentRandomVal & 0x80) > 0) ? 0x08 : 0x00)]; - // Update the shift register + // Update the shift register _currentRandomVal = (byte)((_currentRandomVal << 1) | bit); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE0.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE0.cs index 8f4df248d5..98f54b40ea 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE0.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE0.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Example Games: Frogger II - Threedeep! (1983) (Parker Bros) */ - internal sealed class mE0 : MapperBase + internal sealed class mE0 : MapperBase { private int _toggle1; private int _toggle2; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE7.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE7.cs index 683ae5ed6d..5d491c2e01 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE7.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mE7.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 E7 (M-Network) ----- - M-network wanted something of their own too, so they came up with what they called + M-network wanted something of their own too, so they came up with what they called "Big Game" (this was printed on the prototype ASICs on the prototype carts). It can handle up to 16K of ROM and 2K of RAM. @@ -18,9 +18,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Accessing 1FE7 enables 1K of the 2K RAM, instead. When the RAM is enabled, this 1K appears at 1000-17FF. 1000-13FF is the write port, 1400-17FF - is the read port. + is the read port. - 1800-19FF also holds RAM. 1800-18FF is the write port, 1900-19FF is the read port. + 1800-19FF also holds RAM. 1800-18FF is the write port, 1900-19FF is the read port. Only 256 bytes of RAM is accessible at time, but there are four different 256 byte banks making a total of 1K accessible here. @@ -82,23 +82,23 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return _ram[addr & 0x3FF] = 0xFF; // Reading from 1k write port triggers an unwanted write } - + return _ram[addr & 0x3FF]; } - + return Core.Rom[(_romBank1K * 0x800) + (addr & 0x7FF)]; } - + if (addr < 0x1900) // Ram 1 Write port { return _ram[RamBank1Offset + (_ramBank1Toggle * 0x100) + (addr & 0xFF)] = 0xFF; // Reading from the 256b write port @1800 riggers an unwanted write } - + if (addr < 0x1A00) // Ram 1 Read port { return _ram[RamBank1Offset + (_ramBank1Toggle * 0x100) + (addr & 0xFF)]; } - + if (addr < 0x2000) { addr -= 0x1800; @@ -106,7 +106,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 int offset = Core.Rom.Length - 0x0800; return Core.Rom[offset + addr]; // Fixed to last 1.5K } - + return base.ReadMemory(addr); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEF.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEF.cs index 76adc92669..4e9cf3933e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEF.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEF.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 1FE0-1FEF. Accessing one of these will select the desired bank. 1FE0 = bank 0, 1FE1 = bank 1, etc. */ - internal sealed class mEF : MapperBase + internal sealed class mEF : MapperBase { private int _toggle; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF0.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF0.cs index a648897972..9b99e9b18f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF0.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF0.cs @@ -10,14 +10,14 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 64K of ROM making it the biggest single production game made during the original run of the 2600. - Bankswitching is very simple. There's 16 4K banks, and accessing 1FF0 causes the bank + Bankswitching is very simple. There's 16 4K banks, and accessing 1FF0 causes the bank number to increment. This means that you must keep accessing 1FF0 until the bank you want is selected. Each bank is numbered by means of one of the ROM locations, and the code simply keeps accessing 1FF0 until the bank it is looking for comes up. */ - internal sealed class mF0 : MapperBase + internal sealed class mF0 : MapperBase { private int _bank; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4.cs index acbd350207..4aa30415c1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Again, this works like F8 and F6 except now there's 8 4K banks. Selection is performed by accessing 1FF4 through 1FFB. */ - internal sealed class mF4 :MapperBase + internal sealed class mF4 :MapperBase { private int _toggle; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6.cs index 69b9ab83ef..685272d7c3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 select one of the 4 banks. i.e. 1FF6 selects bank 0, 1FF7 selects bank 1, etc. */ - internal sealed class mF6 : MapperBase + internal sealed class mF6 : MapperBase { private int _toggle; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA.cs index 279bfa76ec..b013e49af3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 accessing 1FF8, 1FF9, and 1FFA. There's also 256 bytes of RAM mapped into 1000-11FF. The write port is at 1000-10FF, and the read port is 1100-11FF. */ - internal sealed class mFA : MapperBase + internal sealed class mFA : MapperBase { private int _toggle; private byte[] _ram = new byte[256]; @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 => WriteMem(addr, value, false); public override void PokeMemory(ushort addr, byte value) - => WriteMem(addr, value, true); + => WriteMem(addr, value, true); private byte ReadMem(ushort addr, bool peek) { @@ -58,17 +58,17 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return base.ReadMemory(addr); } - + if (addr < 0x1100) { return 0xFF; } - + if (addr < 0x1200) { return _ram[addr & 0xFF]; } - + return Core.Rom[(_toggle << 12) + (addr & 0xFFF)]; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs index c2daaa571d..4c603df21a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 /* This is an extended version of the CBS RAM Plus bankswitching scheme supported by the Harmony cartridge. - + There are six (or seven) 4K banks and 256 bytes of RAM. */ internal sealed class mFA2 : MapperBase diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFE.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFE.cs index 968004a6d1..86b2c2cf23 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFE.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFE.cs @@ -6,7 +6,7 @@ Activision used this method on only three games: Decathlon, Robot Tank, and the prototype Thwocker. This mapper is one of the more interesting ones in that it uses - stack access to select banks. It is composed of two 4K banks, similar to F8. + stack access to select banks. It is composed of two 4K banks, similar to F8. Unlike F8, however, switching occurs when the stack is accessed. This mapper allows for "automatic" bankswitching to occur, using JSR and RTS. The @@ -54,7 +54,7 @@ Using emulators or similar there is a large cheat that can be used. A13 can be used to simply select which 8K bank to be in. */ - internal sealed class mFE : MapperBase + internal sealed class mFE : MapperBase { public mFE(Atari2600 core) : base(core) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mMC.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mMC.cs index e6d82ef30a..8c3bd61344 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mMC.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mMC.cs @@ -52,11 +52,11 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 The only way I can see it working is to disregard any access to addresses 3C-3F. - Emulators have it easier: they can simply watch the program counter, vs. the + Emulators have it easier: they can simply watch the program counter, vs. the address bus. An actual system doesn't have that luxury, unfortunately, so it must disregard accesses to 3C-3F instead. */ - internal sealed class mMC : MapperBase + internal sealed class mMC : MapperBase { public mMC(Atari2600 core) : base(core) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mUA.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mUA.cs index 9be82a33e7..bbcaea4bc7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mUA.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mUA.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Accessing 0220 will select the first bank, and accessing 0240 will select the second. */ - internal sealed class mUA : MapperBase + internal sealed class mUA : MapperBase { private int _toggle; @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { Address(addr); } - + if (addr < 0x1000) { return base.ReadMemory(addr); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mX07.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mX07.cs index 4e24601cdd..7fdbdb5717 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mX07.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mX07.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ----- Apparently, this was only used on one cart: Stella's Stocking. - Similar to EF, there are 16 4K banks, for a total of up to 64K of ROM. + Similar to EF, there are 16 4K banks, for a total of up to 64K of ROM. The addresses to select banks is below the ROM area, however. @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 last two banks are selected (banks 14 or 15). In that case, the new bank is: 111n i.e. accessing 0000 will select bank 14 (Eh, 1110b) while accessing 0040 - will select bank 15 (Fh, 1111b). This allows for bankswitching by accessing + will select bank 15 (Fh, 1111b). This allows for bankswitching by accessing TIA registers at 00-3F or 40-7F without incurring any overhead. */ @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { return base.ReadMemory(addr); } - + return Core.Rom[(_romBank2K << 12) + (addr & 0xFFF)]; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs index ae33a1c81a..21fd874d67 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs @@ -477,7 +477,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 if (_hsyncCnt >= (_hmove.LateHBlankReset ? 76 : 68)) { _doTicks = false; - + // TODO: Remove this magic number if ((_hsyncCnt / 4) >= 37) { @@ -875,7 +875,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _hmove.BallLatch = true; _hmove.BallCnt = 0; - if (_hsyncCnt < 67) { _hmove.LateHBlankReset = true; } + if (_hsyncCnt < 67) { _hmove.LateHBlankReset = true; } } } @@ -1185,7 +1185,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // some bits of the databus will be undriven when a read call is made. Our goal here is to sort out what // happens to the undriven pins. Most of the time, they will be in whatever state they were when previously - // assigned in some other bus access, so let's go with that. + // assigned in some other bus access, so let's go with that. coll += (byte)(mask & BusState); if (!peek) @@ -1576,7 +1576,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } else if (maskedAddr == 0x2B) // HMCLR { - _hmClrDelay = 1; + _hmClrDelay = 1; } else if (maskedAddr == 0x2C) // CXCLR { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs index ef4cfb364e..583bb29ec3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs @@ -141,14 +141,14 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 Run5_L(); One4_L(); // fastest pace is too fast to produce sound (ex Ms pac Man) - if (AUDF_L != 1) { on_L = Run1_L(); } + if (AUDF_L != 1) { on_L = Run1_L(); } break; case 0x05: One5_L(); Run4_L(); // fastest pace is too fast to produce sound (ex Ms pac Man) if (AUDF_L != 1) { on_L = Run1_L(); } - break; + break; case 0x06: case 0x0a: Run5_L(); @@ -164,7 +164,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 case 0x07: case 0x09: on_L = Run5_L(); - break; + break; case 0x08: on_L = Run9_L(); break; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs index 843e3b37f5..6b46a8bc67 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs @@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Increment the counter HPosCnt++; - // Counter loops at 160 + // Counter loops at 160 HPosCnt %= 160; if (_startSignal == 160) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs index 2c9234be7f..6ffaf12644 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Increment the counter HPosCnt++; - // Counter loops at 160 + // Counter loops at 160 HPosCnt %= 160; // our goal here is to send a start signal 4 clocks before drawing begins. The properly emulates diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs index 3d33f1426e..d61a32a351 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.PlayerData.cs @@ -1,7 +1,7 @@ using BizHawk.Common; // TODO: Some of the values that are being latched (like Nusiz) are being latched based on the internal player ticks, not the external hsync ticks. -// This can be seen for example in the player32_hblank test ROM. +// This can be seen for example in the player32_hblank test ROM. // Which values these are exactly needs to be more carefully studied. namespace BizHawk.Emulation.Cores.Atari.Atari2600 @@ -119,7 +119,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } } - // At counter position 0 we should initalize the scan counter. + // 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 (_startSignal == 160) { @@ -163,7 +163,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // Increment the counter HPosCnt++; - // Counter loops at 160 + // Counter loops at 160 HPosCnt %= 160; // our goal here is to send a start signal 4 clocks before drawing begins. This properly emulates diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs index 518236eee3..ba2d016c52 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 _hmove.SyncState(ser); ser.Sync("hsyncCnt", ref _hsyncCnt); - // add everything to the state + // add everything to the state ser.Sync("Bus_State", ref BusState); ser.Sync("_ctrlPFDelay", ref _ctrlPFDelay); @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.Sync("M0_stuff", ref _m0Stuff); ser.Sync("M1_stuf", ref _m1Stuff); ser.Sync("b_stuff", ref _bStuff); - + ser.Sync("_hmp0_no_tick", ref _hmp0_no_tick); ser.Sync("_hmp1_no_tick", ref _hmp1_no_tick); ser.Sync("_hmm0_no_tick", ref _hmm0_no_tick); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs index 1532f4e73f..232f3a60d6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs @@ -124,11 +124,11 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if ((maria.scanline - 20) == (p1_lightgun_y - 4)) { if (maria.cycle == (132 + p1_lightgun_x)) - { + { // return true 64 cycles into the future lg_1_counting_down = 64; lg_1_counting_down_2 = 9; - } + } } } @@ -157,7 +157,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk // return true 64 cycles into the future lg_2_counting_down = 64; lg_2_counting_down_2 = 9; - } + } } } @@ -198,7 +198,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk master_audio_clock++; temp = 0; } - + if (cpu_cycle <= (2 + (slow_access ? 1 : 0))) { @@ -388,7 +388,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk public void GetSamplesSync(out short[] samples, out int nsamp) { _blip.EndFrame(master_audio_clock); - + nsamp = _blip.SamplesAvailable(); samples = new short[nsamp * 2]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IStatable.cs index e8e932806c..ec9792b1cf 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IStatable.cs @@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk ser.Sync("Cart RAM", ref cart_RAM); ser.Sync(nameof(is_pokey), ref is_pokey); ser.Sync(nameof(is_pokey_450), ref is_pokey_450); - + ser.Sync(nameof(temp_s_tia), ref temp_s_tia); ser.Sync(nameof(temp_s_pokey), ref temp_s_pokey); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs index 7d116f32df..f6b7b8126d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs @@ -182,7 +182,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { s_mapper = "1"; } - + if (cart_2.Bit(2)) { cart_RAM = 8; @@ -224,7 +224,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk _rom = rom; Reset_Mapper(s_mapper); - + _hsbios = highscoreBios; _bios = _isPAL ? palBios : ntscBios; @@ -284,7 +284,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk maria.Reset(); m6532.Reset(); pokey.Reset(); - + Maria_regs = new byte[0x20]; RAM = new byte[0x1000]; @@ -349,8 +349,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk * PAL Table: Copyright © 2004 Mike Murphy * * NTSC Table Source: http://atariage.com/forums/topic/95498-7800-color-palette-in-mess/?p=1174461 - * - * + * + * */ public static readonly int[] NTSCPalette = diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs index d1d63cc1ba..7f8d967e01 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs @@ -278,7 +278,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk BoolButtons = BaseDefinition.Select(b => $"P{PortNum} {b}").ToList() }.AddXYPair($"P{PortNum} {{0}}", AxisPairOrientation.RightAndUp, 1.RangeTo(320), 160, 1.RangeTo(242), 121); //TODO verify direction against hardware } - + public int PortNum { get; } public byte Read(IController c) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/M6532.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/M6532.cs index 99aff809a2..e6fd0627aa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/M6532.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/M6532.cs @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if ((addr & 0x0200) == 0) // If not register select, read Ram { //return _core.Ram[(ushort)(addr & 0x007f)]; - return 0; + return 0; } var registerAddr = (ushort)(addr & 0x0007); @@ -43,13 +43,13 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk temp = (byte)(temp + (_outputA & _ddRa)); return temp; } - + if (registerAddr == 0x01) { // Read DDRA return _ddRa; } - + if (registerAddr == 0x02) { Core._isLag = false; @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { return _ddRb; } - + if ((registerAddr & 0x5) == 0x4) { // Bit 0x0080 contains interrupt enable/disable diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperDefault.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperDefault.cs index ff1a889765..07c85d8e83 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperDefault.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperDefault.cs @@ -78,7 +78,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk Core.pokey.WriteReg(addr & 0xF, value); } else - { + { // cartridge and other OPSYS } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperRampage.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperRampage.cs index 1d32848f81..d64c5ee9c9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperRampage.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperRampage.cs @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk $8000 -$9fff second 8kb of bank 7 $e000 -$ffff first 8kb of bank 7 - $a000-$dfff Banked + $a000-$dfff Banked */ int tempAddr; if (addr >= 0x4000 && addr < 0x6000) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperSG.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperSG.cs index 231dc9d5c1..df376b10de 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperSG.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Mappers/MapperSG.cs @@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (addr < 0x460) { Core.pokey.WriteReg(addr & 0xF, value); - } + } } else { @@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { RAM[addr - 0x6000] = value; } - else if (Core.cart_RAM==16) + else if (Core.cart_RAM==16) { RAM[addr - 0x4000] = value; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs index ea18fd9a2c..c7511a1b37 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs @@ -159,7 +159,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk // Now proceed with the remaining scanlines // the first one is a pre-render line, since we didn't actually put any data into the buffer yet while (scanline < Core._screen_height) - { + { if (cycle == 28 && Core.Maria_regs[0x1C].Bit(6) && !Core.Maria_regs[0x1C].Bit(5)) { Core.cpu_halt_pending = true; @@ -197,7 +197,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk DMA_phase_counter = 0; } - + Core.RunCPUCycle(); ////////////////////////////////////////////// @@ -225,7 +225,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { // there is a trick here to be aware of. // the renderer has no concept of objects, as it only has information on each pixel - // but objects are specified in groups of 8 pixels. + // but objects are specified in groups of 8 pixels. // however, since objects can only be placed in 160 resolution // we can pick bits based on whether the current pixel is even or odd temp_palette = color & 0x10; @@ -266,7 +266,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { scanline_buffer[pixel] = _palette[BG_latch_1]; } - + // send buffer to the video buffer Core._vidbuffer[(scanline - 21) * 320 + pixel] = scanline_buffer[pixel]; @@ -451,7 +451,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (graphics_read_time == 0) { - // We have read the graphics data, for this header, now return to the header list + // We have read the graphics data, for this header, now return to the header list // This loop will continue until a header indicates its time to stop DMA_phase = DMA_HEADER; DMA_phase_counter = 0; @@ -464,7 +464,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk bool skip = true; while (skip) - { + { if (GFX_Objects[header_counter].ind_mode) { addr_t = ReadMemory((ushort)(GFX_Objects[header_counter].addr + scan_index)); @@ -547,7 +547,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (scan_index == GFX_Objects[header_counter].width) { - // We have read the graphics data, for this header, now return to the header list + // We have read the graphics data, for this header, now return to the header list // This loop will continue until a header indicates its time to stop DMA_phase = DMA_HEADER; DMA_phase_counter = 0; @@ -675,7 +675,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk for (int i = 0; i < 128; i++) { GFX_Objects[i].obj = new byte[128]; - } + } } // Most of the Maria state is captured in Maria Regs in the core diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs index ce6a6cb15f..8dd7b302a3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk uint flags = (uint)Common.MemoryCallbackFlags.AccessRead; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); } - + if ((addr & 0xFCE0) == 0) { @@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk slow_access = true; return tia.ReadMemory((ushort)(addr & 0x1F), false); } - + if ((addr & 0xFCE0) == 0x20) { if ((A7800_control_register & 0x2) > 0) @@ -48,30 +48,30 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk return 0x80; // TODO: What if Maria is off? } } - + if ((addr & 0xFF80) == 0x280) { slow_access = true; return m6532.ReadMemory(addr, false); } - + if ((addr & 0xFE80) == 0x480) { slow_access = true; return RAM_6532[addr & 0x7F]; } - + if ((addr >= 0x1800) && (addr < 0x2800)) { return RAM[addr -0x1800]; } - + if ((addr >= 0x40) && (addr < 0x100)) { // RAM block 0 return RAM[addr - 0x40 + 0x840]; } - + if ((addr >= 0x140) && (addr < 0x200)) { // RAM block 1 @@ -140,7 +140,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (temp == 4) // WSYNC cpu.RDY = false; /* - for (int i = 0; i < 0x20; i++) + for (int i = 0; i < 0x20; i++) { Console.Write(Maria_regs[i]); Console.Write(" "); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Pokey.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Pokey.cs index c60fef40c0..90bf1675f6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Pokey.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Pokey.cs @@ -10,9 +10,9 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk * Regs 0,2,4,6: Frequency control (divider = value + 1) * Regs 1,3,5,7: Channel control (Bits 0-3 = volume) (bits 4 - 7 control clocking) * Reg 8: Control register - * + * * Reg A: Random number generator - * + * * The registers are write only, except for the RNG none of the things that would return reads are connected * for now return FF */ @@ -104,7 +104,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk } clock_ch[0] = clock_ch[1] = clock_ch[2] = clock_ch[3] = false; - + // now that we have the poly counters, check which channels to clock if (Regs[8].Bit(6)) { @@ -115,7 +115,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk inc_ch[0]++; if (Regs[8].Bit(0)) { - if (inc_ch[0] >= 114) { inc_ch[0] = 0; clock_ch[0] = true; } + if (inc_ch[0] >= 114) { inc_ch[0] = 0; clock_ch[0] = true; } } else { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/TIA.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/TIA.cs index 9fbd6aff07..4e1b3aa463 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/TIA.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/TIA.cs @@ -181,7 +181,7 @@ // some bits of the databus will be undriven when a read call is made. Our goal here is to sort out what // happens to the undriven pins. Most of the time, they will be in whatever state they were when previously - // assigned in some other bus access, so let's go with that. + // assigned in some other bus access, so let's go with that. /* coll += (byte)(mask & BusState); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.SyncState.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.SyncState.cs index 0f46521dad..c6ff834005 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.SyncState.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.SyncState.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk ser.Sync("hsyncCnt", ref _hsyncCnt); - // add everything to the state + // add everything to the state ser.Sync("Bus_State", ref BusState); ser.Sync("Ticks", ref _doTicks); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IEmulator.cs index 4797668292..58fad80681 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IEmulator.cs @@ -15,11 +15,11 @@ namespace BizHawk.Emulation.Cores.Atari.Stella { byte port1 = _controllerDeck.ReadPort1(controller); byte port2 = _controllerDeck.ReadPort2(controller); - + // Handle all the console switches here if (controller.IsPressed("Toggle Right Difficulty")) _rightDifficultyToggled = !_rightDifficultyToggled; if (controller.IsPressed("Toggle Left Difficulty")) _leftDifficultyToggled = !_leftDifficultyToggled; - + // select and reset switches default to an unpressed state // unknown whether TV color switch matters for TASing, so default to Color for now byte switchPort = 0b00001011; @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Atari.Stella if (_leftDifficultyToggled) switchPort |= 0b01000000; if (controller.IsPressed("Select")) switchPort &= 0b11111101; // 0 = Pressed if (controller.IsPressed("Reset")) switchPort &= 0b11111110; // 0 = Pressed - + bool powerPressed = false; if (controller.IsPressed("Power")) powerPressed = true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IMemoryDomains.cs index 4bcf42ce91..0cd5040a89 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/Stella.IMemoryDomains.cs @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Atari.Stella MemoryDomainIntPtrMonitor mainRAM = new("Main RAM", MemoryDomain.Endian.Little, mainRamAddress, 128, true, 1, _elf); domains.Add(mainRAM); - + MemoryDomains = new MemoryDomainList(domains) { MainMemory = mainRAM }; ((BasicServiceProvider)ServiceProvider).Register(MemoryDomains); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/StellaControllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/StellaControllers.cs index b28cad1eef..c34dce4b9a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/StellaControllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/Stella/StellaControllers.cs @@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Atari.Stella public int Read_Pot(IController c, int pot) { int x = c.AxisValue(Definition.Axes[pot]); - + x = -x; x += 127; @@ -190,7 +190,7 @@ namespace BizHawk.Emulation.Cores.Atari.Stella { is_pressed = c.IsPressed($"P{PortNum} Button 2"); } - + if (is_pressed) { return 10; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs index ea237f7033..e25351c537 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/jaguar/VirtualJaguar.cs @@ -247,7 +247,7 @@ namespace BizHawk.Emulation.Cores.Atari.Jaguar private readonly LibVirtualJaguar.CDTOCCallback _cdTocCallback; private readonly LibVirtualJaguar.CDReadCallback _cdReadCallback; - + private readonly Disc _cd; private readonly DiscSectorReader _cdReader; private readonly byte[] _buf2352 = new byte[2352]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/AY_3_8910_SGM.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/AY_3_8910_SGM.cs index 92bafc6595..e728222b64 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/AY_3_8910_SGM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/AY_3_8910_SGM.cs @@ -281,7 +281,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision { v = (short)(sound_out_A ? VolumeTable[env_E] : 0); } - + if (env_vol_B == 0) { v += (short)(sound_out_B ? VolumeTable[vol_B] : 0); @@ -300,7 +300,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision { v += (short)(sound_out_C ? VolumeTable[env_E] : 0); } - + current_sample = (short)v; } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoControllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoControllers.cs index 9547ee39c0..de9613577a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoControllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoControllers.cs @@ -138,14 +138,14 @@ namespace BizHawk.Emulation.Cores.ColecoVision if (leftMode) { byte retVal = 0x4F; - + if (c.IsPressed(Definition.BoolButtons[0])) retVal &= 0x3F; - + float x = c.AxisValue(Definition.Axes[0]); float y = c.AxisValue(Definition.Axes[1]); var angle = updateWheel ? wheelAngle : CalcDirection(x, y); - + byte temp2 = 0; int temp1 = (int)Math.Floor(angle / 1.25); @@ -172,7 +172,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision retVal |= temp2; - + return retVal; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs index 1343c650ce..1b96992349 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision _latchedSample = v; } - _sampleClock++; + _sampleClock++; } // starting from scanline 20, changes to the wheel are added once per scanline (up to 144) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index 7d4bb684b5..77767a4c8d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision { Console.WriteLine("Using the Super Game Module"); } - + LoadRom(rom, skipBios); SetupMemoryDomains(); @@ -286,7 +286,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision { MC_bank = (addr - 0xFFC0) & (_romData.Length / 0x4000 - 1); } - + // the first 16K of the map is always the last 16k of the ROM if (addr < 0xC000) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/SN76489col.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/SN76489col.cs index fa6238f0e8..1620739e07 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/SN76489col.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/SN76489col.cs @@ -162,7 +162,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision int bit = (noise & 1) ^ ((noise >> 1) & 1); noise >>= 1; noise |= bit << 14; - + } else { @@ -190,7 +190,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision noise_clock *= 2; } - + if (clock_A == 0) { A_up = !A_up; @@ -212,9 +212,9 @@ namespace BizHawk.Emulation.Cores.ColecoVision // now calculate the volume of each channel and add them together // the magic number 42 is to make the volume comparable to the MSG volume int v; - + v = (short)(A_up ? LogScale[Chan_vol[0]] * 42 : 0); - + v += (short)(B_up ? LogScale[Chan_vol[1]] * 42 : 0); v += (short)(C_up ? LogScale[Chan_vol[2]] * 42 : 0); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.ICodeDataLog.cs index 977dcd4081..5912cdbb86 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.ICodeDataLog.cs @@ -37,8 +37,8 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF public enum CDLType { None, - BIOS1, - BIOS2, + BIOS1, + BIOS2, CARTROM } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IVideoProvider.cs index ff4b35a00f..26347b4685 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IVideoProvider.cs @@ -125,7 +125,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF { _pixelClockCounter -= PixelClocksPerFrame; } - } + } private static int[] ClampBuffer(int[] buffer, int originalWidth, int originalHeight, int trimLeft, int trimTop, int trimRight, int trimBottom) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/Audio.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/Audio.cs index 1fe2d2d0dd..bffee43409 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/Audio.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/Audio.cs @@ -156,7 +156,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex // do not write to input ports, controller input is directly assigned seperately if (port_sel < 14) { Register[port_sel] = value; } - + sync_psg_state(); if (port_sel == 13) diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/HW_Registers.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/HW_Registers.cs index aa3e16db4a..7c2cf73a57 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/HW_Registers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/HW_Registers.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex /* Port B writes to both the PSG and the DAC simultaneously * The trick here is that bits 3 and 4 both zero represent PSG disabled * So it's easy to not interfere with the PSG - * However, the DAC will always receive some input, controlled by the multiplexer and selector bits + * However, the DAC will always receive some input, controlled by the multiplexer and selector bits * BIOS functions keep everything in order */ @@ -18,8 +18,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public byte portB_ret, portA_ret; - public byte t1_low, t1_high; - public int t1_counter, t1_ctrl; + public byte t1_low, t1_high; + public int t1_counter, t1_ctrl; public bool t1_shot_go; public byte t2_low, t2_high; @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex { PB7_undriven = false; ppu.skip = 14; - } + } } // writing to sound reg @@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex else { compare = true; } } else - { + { if ((byte)(portA_ret ^ 0x80) >= joy1_UD) { compare = false; } else { compare = true; } } @@ -283,7 +283,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex } else { - ppu.y_vel = (byte)(portA_ret ^ 0x80); + ppu.y_vel = (byte)(portA_ret ^ 0x80); } ppu.new_draw_line(); } @@ -393,7 +393,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex aux_ctrl = value; t1_ctrl = aux_ctrl; - + break; case 0xC: prt_ctrl = value; @@ -522,7 +522,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex if (t1_ctrl.Bit(7)) { PB7 = true; ppu.ramp_sig = false; ppu.new_draw_line(); } t1_shot_go = false; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/PPU.cs index dd9c7d585b..4fcec0644c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/PPU.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public void tick() { - //Console.WriteLine(ramp_sig + " " + zero_sig + " " + blank_sig + " " + Core.cpu.TotalExecutedCycles + " " + (x_vel - 128.0) + " " + x_pos + //Console.WriteLine(ramp_sig + " " + zero_sig + " " + blank_sig + " " + Core.cpu.TotalExecutedCycles + " " + (x_vel - 128.0) + " " + x_pos //+ " " + (y_vel - 128.0) + " " + y_pos + " " + Core.t1_counter + " " + vec_scale); if (ramp_sig && !zero_sig) @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex } off_screen = false; - + if (x_pos > 257) { off_screen = true; if (x_pos > (257 + 256)) { x_pos = (257 + 256); } } if (x_pos < 2) { off_screen = true; if (x_pos < (2 - 256)) { x_pos = (2 - 256); } } if (y_pos > 385) { off_screen = true; if (y_pos > (385 + 256)) { y_pos = (385 + 256); } } @@ -62,14 +62,14 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex /* if (!blank_sig && !off_screen) { - + Core._vidbuffer[(int)(Math.Round(x_pos) + 260 * Math.Round(y_pos))] |= (int)(br & bright_int_1); - + Core._vidbuffer[(int)(Math.Round(x_pos) + 1 + 260 * Math.Round(y_pos))] |= (int)(br & bright_int_2); Core._vidbuffer[(int)(Math.Round(x_pos) - 1 + 260 * Math.Round(y_pos))] |= (int)(br & bright_int_2); Core._vidbuffer[(int)(Math.Round(x_pos) + 260 * (Math.Round(y_pos) + 1))] |= (int)(br & bright_int_2); Core._vidbuffer[(int)(Math.Round(x_pos) + 260 * (Math.Round(y_pos) - 1))] |= (int)(br & bright_int_2); - + Core._vidbuffer[(int)(Math.Round(x_pos) + 2 + 260 * Math.Round(y_pos))] |= (int)(br & bright_int_3); Core._vidbuffer[(int)(Math.Round(x_pos) - 2 + 260 * Math.Round(y_pos))] |= (int)(br & bright_int_3); Core._vidbuffer[(int)(Math.Round(x_pos) + 260 * (Math.Round(y_pos) + 2))] |= (int)(br & bright_int_3); @@ -78,14 +78,14 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex Core._vidbuffer[(int)(Math.Round(x_pos) + 1 + 260 * (Math.Round(y_pos) - 1))] |= (int)(br & bright_int_3); Core._vidbuffer[(int)(Math.Round(x_pos) - 1 + 260 * (Math.Round(y_pos) + 1))] |= (int)(br & bright_int_3); Core._vidbuffer[(int)(Math.Round(x_pos) - 1 + 260 * (Math.Round(y_pos) - 1))] |= (int)(br & bright_int_3); - + } */ } public void draw_screen() { - // screen is 2 times the internal size of the image + // screen is 2 times the internal size of the image double start_x = 0; double end_x = 0; double start_y = 0; @@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex if ((end_y <= 385) && (start_y >= 385)) { max_y = 385 - end_y; start_y = 385; } // screen size is double internal size - + start_x *= 2; end_x *= 2; start_y *= 2; @@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex max_x *= 2; max_y *= 2; - + steps = Math.Max(max_x, max_y) + 1; double x_step = (end_x - start_x) / steps; @@ -189,7 +189,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public void draw_old_screen() { - // screen is 2 times the internal size of the image + // screen is 2 times the internal size of the image double start_x = 0; double end_x = 0; double start_y = 0; @@ -294,7 +294,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex zero_old = zero_sig; blank_old = blank_sig; - bright_int_1_old = bright_int_1; + bright_int_1_old = bright_int_1; } public void Reset() diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.ICodeDataLog.cs index bda6962df4..ed8ae4f81a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.ICodeDataLog.cs @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex { None, RAM, - ROM, + ROM, } [Flags] diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs index cd7936b0eb..0c6d5db85f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs @@ -120,19 +120,19 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public int[] GetVideoBuffer() { - return _framebuffer; + return _framebuffer; } public void get_video_frame() { ppu.draw_screen(); - + for (int i = 0; i < _vidbuffer.Length; i++) { _framebuffer[i] = _vidbuffer[i]; _vidbuffer[i] = 0; } - + } public int VirtualWidth => (256 + 4) * 2; diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IStatable.cs index 34c29eb1ba..12bd4458d6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IStatable.cs @@ -68,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex ser.Sync(nameof(joy2_LR), ref joy2_LR); ser.Sync(nameof(joy2_UD), ref joy2_UD); - // refresh the screen buffer + // refresh the screen buffer if (ser.IsReader) { for (int i = 0; i < _framebuffer.Length; i++) diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs index a2b1c29feb..262265e0e6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex [Core( name: CoreNames.VectrexHawk, author: "alyosha")] - public partial class VectrexHawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, + public partial class VectrexHawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, ISettable { internal static class RomChecksums @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public byte[] RAM = new byte[0x400]; public byte[] _bios, minestorm; - public readonly byte[] _rom; + public readonly byte[] _rom; private int _frame = 0; @@ -166,7 +166,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex { mapper = new MapperDefault(); } - + mapper.Core = this; mapper.Initialize(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index 9742ec37fb..69b379e031 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Intellivision GetControllerState(controller); // this timer tracks cycles stolen by the STIC during the visible part of the frame, quite a large number of them actually - int delayCycles = 700; + int delayCycles = 700; int delayTimer = -1; _cpu.PendingCycles = 14934 - 3791 + _cpu.GetPendingCycles(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs index 8668bca6f6..7a2cafc2b1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IMemoryDomains.cs @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Intellivision { long index = addr / 2; return (byte)(array[index] >> 8); - + } else { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs index fb85dae295..59830645d2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs @@ -48,8 +48,8 @@ namespace BizHawk.Emulation.Cores.Intellivision public int[] GetVideoBuffer() { - - return FrameBuffer; + + return FrameBuffer; } // gets called when a new border color is chosen @@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.Intellivision for (int i = 0; i < 64; i++) { - Register[i] = 0; + Register[i] = 0; write_reg(i, 0, false); } @@ -116,7 +116,7 @@ namespace BizHawk.Emulation.Cores.Intellivision // mask off appropriate STIC bits and write to register private void write_reg(int reg, ushort value, bool poke) { - + if (reg < 0x8) { value = (ushort)((value & 0x7FF) | 0x3800); @@ -516,7 +516,7 @@ namespace BizHawk.Emulation.Cores.Intellivision { FrameBuffer[(j * 2) * 176 + (i + 8) + BORDER_OFFSET] = ColorToRGBA(bg); FrameBuffer[(j * 2 + 1) * 176 + (i + 8) + BORDER_OFFSET] = ColorToRGBA(bg); - } + } } } } @@ -524,7 +524,7 @@ namespace BizHawk.Emulation.Cores.Intellivision // see for more details: http://spatula-city.org/~im14u2c/intv/jzintv-1.0-beta3/doc/programming/stic.txt /* The STIC provides 3 registers for controlling each MOB, and a 4th register - for reading its collision (or "interaction") status. The registers are + for reading its collision (or "interaction") status. The registers are laid out as follows: X Register: Address = $0000 + MOB # @@ -573,7 +573,7 @@ namespace BizHawk.Emulation.Cores.Intellivision int cur_x, cur_y; - // we go from 7 to zero because visibility of lower numbered MOBs have higher priority + // we go from 7 to zero because visibility of lower numbered MOBs have higher priority for (int i = 7; i >= 0 ; i--) { x = Register[i]; @@ -596,7 +596,7 @@ namespace BizHawk.Emulation.Cores.Intellivision bool vis = x.Bit(9); bool x_flip = y.Bit(10); bool y_flip = y.Bit(11); - ushort yres = y.Bit(7) ? (ushort)2 : (ushort)1; + ushort yres = y.Bit(7) ? (ushort)2 : (ushort)1; ushort ysiz2 = y.Bit(8) ? (ushort)2 : (ushort)1; ushort ysiz4 = y.Bit(9) ? (ushort)4 : (ushort)1; bool intr = x.Bit(8); @@ -611,7 +611,7 @@ namespace BizHawk.Emulation.Cores.Intellivision if (gram) card &= 0x3F; - //pull the data from the card into the mobs array + //pull the data from the card into the mobs array for (int j=0;j<8;j++) { if (gram) @@ -854,7 +854,7 @@ namespace BizHawk.Emulation.Cores.Intellivision } // the extra condition here is to ignore only border/BG collsion bit set - if (Collision[i, j] != 0 && Collision[i,j] != (1 << 9) && Collision[i,j] != (1 << 8)) + if (Collision[i, j] != 0 && Collision[i,j] != (1 << 9) && Collision[i,j] != (1 << 8)) { for (int k = 0; k < 8; k++) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_Default.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_Default.cs index af5b0599b4..3e3682805e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_Default.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_Default.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public class MapperDefault : MapperBase { public int ROM_mask; - + public override void Initialize() { // roms come in 3 sizes, but the last size is a degenerate case diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_XROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_XROM.cs index 512d03e65a..374d735894 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_XROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/Mappers/Mapper_XROM.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public class MapperXROM : MapperBase { public int ROM_mask; - + public override void Initialize() { // XROM has data instructions from 0x400-0xFFF diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/MemoryMap.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/MemoryMap.cs index 03db04b50c..031cdf0d16 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/MemoryMap.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/MemoryMap.cs @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk if (RAM_en) { - if (addr_latch < 0x80) + if (addr_latch < 0x80) { return RAM[addr_latch & 0x7F]; } @@ -179,7 +179,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk rom_bank = (ushort)(cart_b0 ? 1 : 0); rom_bank |= (ushort)(cart_b1 ? 2 : 0); //rom_bank = (ushort)(rom_bank << 12); - + // XROM uses cart_b1 for read enable, not bank switch if (is_XROM) { rom_bank = 0; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.ICodeDataLog.cs index 601b635aff..89122a42b3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.ICodeDataLog.cs @@ -53,6 +53,6 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk mapper.MapCDL(addr, flags); return; } - } + } } } \ No newline at end of file diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs index f21dae0389..b4941cedda 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs @@ -118,7 +118,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk ppu.tick(); ppu.Audio_tick(); cpu.ExecuteOne(); - + } public void GetControllerState(IController controller) @@ -221,7 +221,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public void SendVideoBuffer() { - for (int j = 0; j < pic_height; j++) + for (int j = 0; j < pic_height; j++) { for (int i = 0; i < 320; i++) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IStatable.cs index 78e9be2ea3..c7b57c0b28 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IStatable.cs @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk ser.Sync(nameof(controller_state_1), ref controller_state_1); ser.Sync(nameof(controller_state_2), ref controller_state_2); ser.Sync(nameof(in_vblank), ref in_vblank); - ser.Sync(nameof(in_vblank_old), ref in_vblank_old); + ser.Sync(nameof(in_vblank_old), ref in_vblank_old); ser.Sync(nameof(vblank_rise), ref vblank_rise); ser.Sync(nameof(ticker), ref ticker); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs index fabb091281..462d710a28 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs @@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk ticker = 0; - // some of these get overwritten, but + // some of these get overwritten, but addr_latch = 0; kb_state_row = kb_state_col = 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2HawkControllerDeck.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2HawkControllerDeck.cs index d2203df6c3..2567cbb36e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2HawkControllerDeck.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2HawkControllerDeck.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk "Q", "S", "D", "F", "G", "H", "J", "K", "A", "Z", "X", "C", "V", "B", "M", "PERIOD", "-", "*", "/", "=", "YES", "NO", "CLR", "ENT", - "Reset","Power", + "Reset","Power", "SHIFT", "LOCK", "CTNL", ":", "|", "]", "..", ",", "<", "ESC", "BREAK", "RET" }) .ToList() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs index 610c6a3c83..88224b51b3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs @@ -298,7 +298,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public virtual void tick() { Pixel_Stat = 0; - // drawing cycles + // drawing cycles // note: clipping might need to be handled differently between PAL and NTSC if (cycle < 182) { @@ -637,7 +637,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk { right_shift_even = (Sprites[i * 4 + 2].Bit(1) && ((((LY - OBJ_OFST) - Sprites[i * 4]) % 2) == 0)) ? 1 : 0; } - + x_base = Sprites[i * 4 + 1]; if ((right_shift + right_shift_even) == 0) @@ -1017,7 +1017,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk 0xFFFFFFFF, // white }; - // G7400 specific + // G7400 specific public static readonly byte[] VPP_Alpha_Numeric = { 0x00, 0x38, 0x44, 0x40, 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, // (reverse ?) 0x00 0x00, 0x10, 0x28, 0x00, 0x38, 0x44, 0x7C, 0x44, 0x00, 0x00, // (A hat) 0x01 0x00, 0x08, 0x10, 0x3C, 0x20, 0x30, 0x20, 0x3C, 0x00, 0x00, // (E accent /) 0x02 @@ -1530,7 +1530,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public override void tick() { Pixel_Stat = 0; - // drawing cycles + // drawing cycles // note: clipping might need to be handled differently between PAL and NTSC if (cycle < 182) { @@ -1613,7 +1613,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public override void tick() { Pixel_Stat = 0; - // drawing cycles + // drawing cycles // note: clipping might need to be handled differently between PAL and NTSC if (cycle < 182) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs index cf2f57d1c8..ea676662f7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE v.PaletteCache = p; callback(v); } - + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs index d624de3240..29250d2176 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs @@ -126,7 +126,7 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE v.PaletteCache = p; callback(v); } - + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.ISettable.cs index 63cbb9726e..6c10112605 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.ISettable.cs @@ -207,7 +207,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS [Description("Layout for the screen inside the render window.")] [DefaultValue(ELayoutOption.TopBottomScreen)] public ELayoutOption LayoutOption { get; set; } - + [DisplayName("Swap Screen")] [Description("Swaps the prominent screen with the other screen.")] [DefaultValue(false)] @@ -217,7 +217,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS [Description("Toggle upright orientation, for book style games.")] [DefaultValue(false)] public bool UprightScreen { get; set; } - + [DisplayName("Large Screen Proportion")] [Description("The proportion between the large and small screens when playing in Large Screen Small Screen layout.")] [DefaultValue(4.0f)] @@ -298,12 +298,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS [Description("Whether to use hardware shaders to emulate 3DS shaders")] [DefaultValue(true)] public bool UseHwShader { get; set; } - + [DisplayName("Shaders Accurate Mul")] [Description("Whether to use accurate multiplication in hardware shaders")] [DefaultValue(true)] public bool ShadersAccurateMul { get; set; } - + [DisplayName("Use Shader JIT")] [Description("Whether to use the Just-In-Time (JIT) compiler for shader emulation")] [DefaultValue(true)] @@ -320,7 +320,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS [Description("Whether to create a virtual SD card.")] [DefaultValue(true)] public bool UseVirtualSd { get; set; } - + [DisplayName("Is New 3DS")] [Description("The system model that Encore will try to emulate.")] [DefaultValue(true)] @@ -342,7 +342,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS Korea, Taiwan, } - + [DisplayName("Region Value")] [Description("The system region that Encore will use during emulation")] [DefaultValue(ERegionValue.Autodetect)] @@ -434,14 +434,14 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS [Description("The system language that Encore will use during emulation")] [DefaultValue(ECFGSystemLanguage.English)] public ECFGSystemLanguage CFGSystemLanguage { get; set; } - + public enum ECFGSoundOutputMode { Mono, Stereo, Surround } - + [DisplayName("CFG Sound Output Mode")] [Description("The system sound output mode that Encore will use during emulation")] [DefaultValue(ECFGSoundOutputMode.Stereo)] diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs index 1dfb1efe01..85aa5e92c7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS protected readonly LibEncore _core; protected readonly IntPtr _context; - + public EncoreVideoProvider(LibEncore core, IntPtr context) { _core = core; @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS return _vbuf; } } - + public class EncoreGLTextureProvider : EncoreVideoProvider, IGLTextureProvider { public EncoreGLTextureProvider(LibEncore core, IntPtr context) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/LibEncore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/LibEncore.cs index d6ab9fabbd..efff0f408a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/LibEncore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/LibEncore.cs @@ -10,13 +10,13 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS [UnmanagedFunctionPointer(cc)] public delegate bool GetBooleanSettingCallback(string label); - + [UnmanagedFunctionPointer(cc)] public delegate ulong GetIntegerSettingCallback(string label); - + [UnmanagedFunctionPointer(cc)] public delegate double GetFloatSettingCallback(string label); - + [UnmanagedFunctionPointer(cc)] public delegate void GetStringSettingCallback(string label, IntPtr buffer, int bufferSize); @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS public GetFloatSettingCallback GetFloat; public GetStringSettingCallback GetString; } - + [UnmanagedFunctionPointer(cc)] public delegate IntPtr RequestGLContextCallback(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs index 4e5b3f7801..7ab1523959 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs @@ -129,7 +129,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 gb1RomPtr = GetGBRomOrNull(0), gb2RomPtr = GetGBRomOrNull(1), gb3RomPtr = GetGBRomOrNull(2), - gb4RomPtr = GetGBRomOrNull(3)) + gb4RomPtr = GetGBRomOrNull(3)) { var loadData = new LibAres64.LoadData { @@ -257,7 +257,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 Time = GetRtcTime(!DeterministicEmulation), Reset = controller.IsPressed("Reset"), Power = controller.IsPressed("Power"), - + BobDeinterlacer = _settings.Deinterlacer == LibAres64.DeinterlacerType.Bob, FastVI = _settings.FastVI, SkipDraw = !render, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs index 88fb594587..3de167b165 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs @@ -113,7 +113,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 [BizImport(CC)] public abstract bool GetRumbleStatus(int num); - + [BizImport(CC)] public abstract void PostLoadState(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs index 75ca2c73a5..d605a037eb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs @@ -169,7 +169,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { ret = 0xFF; } } else { ret = Wave_RAM[addr & 0x0F]; } - + break; } @@ -288,7 +288,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk calculate_bias_gain_1(); SQ1_len_en = (value & 0x40) > 0; break; - case 0xFF16: // NR21 (sound length / wave pattern duty %) + case 0xFF16: // NR21 (sound length / wave pattern duty %) Audio_Regs[NR21] = value; SQ2_duty = (byte)((value & 0xC0) >> 6); SQ2_length = (ushort)(64 - (value & 0x3F)); @@ -302,9 +302,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // several glitchy effects happen when writing to NRx2 during audio playing if (((Audio_Regs[NR22] & 7) == 0) && !SQ2_vol_done) { SQ2_vol_state++; } else if ((Audio_Regs[NR22] & 8) == 0) { SQ2_vol_state += 2; } - + if (((Audio_Regs[NR22] ^ value) & 8) > 0) { SQ2_vol_state = (byte)(0x10 - SQ2_vol_state); } - + SQ2_vol_state &= 0xF; if ((value & 0xF8) == 0) { SQ2_enable = false; } Audio_Regs[NR22] = value; @@ -379,7 +379,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if ((sequencer_len & 1) == 0) { - + if (!WAVE_len_en && ((value & 0x40) > 0) && (WAVE_len_cntr > 0)) { WAVE_len_cntr--; @@ -509,7 +509,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk calculate_bias_gain_a(); break; - case 0xFF26: // NR52 (ctrl) + case 0xFF26: // NR52 (ctrl) // NOTE: Make sure to do the power off first since it will call the write_reg function again if ((value & 0x80) == 0) { power_off(); } AUD_CTRL_power = (value & 0x80) > 0; @@ -557,7 +557,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk SQ1_len_cntr = SQ1_length; } break; - case 0xFF16: // NR21 (sound length / wave pattern duty %) + case 0xFF16: // NR21 (sound length / wave pattern duty %) if (!Core.is_GBC) { SQ2_length = (ushort)(64 - (value & 0x3F)); @@ -739,7 +739,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // so if it's constantly written to, these values won't update if (Core.DIV_falling_edge && AUD_CTRL_power) - { + { sequencer_vol++; sequencer_vol &= 0x7; sequencer_len++; sequencer_len &= 0x7; sequencer_swp++; sequencer_swp &= 0x7; @@ -897,14 +897,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (sequencer_reset_cd > 0) { sequencer_reset_cd--; - + if (sequencer_reset_cd == 0) { // seems to be off by one issues here, hard to tell since the write takes place in the cpu loop - // but the effect takes place in the sound loop + // but the effect takes place in the sound loop if (Core.double_speed) { - + sequencer_len = (Core.timer.divider_reg - 1).Bit(13) ? 0 : 1; sequencer_vol = (Core.timer.divider_reg - 1).Bit(13) ? 0 : 1; sequencer_swp = (Core.timer.divider_reg - 1).Bit(13) ? 0 : 1; @@ -914,7 +914,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk sequencer_len = (Core.timer.divider_reg + 1).Bit(12) ? 0 : 1; sequencer_vol = (Core.timer.divider_reg + 1).Bit(12) ? 0 : 1; sequencer_swp = (Core.timer.divider_reg + 1).Bit(12) ? 0 : 1; - } + } } } @@ -974,7 +974,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // on GBC, lengths are also reset if (Core.is_GBC) - { + { SQ1_length = SQ2_length = WAVE_length = NOISE_length = 0; SQ1_len_cntr = SQ2_len_cntr = WAVE_len_cntr = NOISE_len_cntr = 0; } @@ -992,7 +992,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk Wave_RAM = new byte[] { 0x84, 0x40, 0x43, 0xAA, 0x2D, 0x78, 0x92, 0x3C, 0x60, 0x59, 0x59, 0xB0, 0x34, 0xB8, 0x2E, 0xDA }; } - + Audio_Regs = new byte[21]; for (int i = 0; i < 0x16; i++) @@ -1079,7 +1079,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { ser.Sync(nameof(Audio_Regs), ref Audio_Regs, false); ser.Sync(nameof(Wave_RAM), ref Wave_RAM, false); - + ser.Sync(nameof(SQ1_vol_done), ref SQ1_vol_done); ser.Sync(nameof(SQ1_calc_done), ref SQ1_calc_done); ser.Sync(nameof(SQ1_swp_enable), ref SQ1_swp_enable); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBA_Init_State.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBA_Init_State.cs index baafbf52ae..4ef8665a91 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBA_Init_State.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBA_Init_State.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { public partial class GBHawk { - static byte[] GBA_Init_RAM = + static byte[] GBA_Init_RAM = { 0xCA, 0x2F, 0x9B, 0xEE, 0x95, 0xCF, 0x1E, 0x5F, 0xE2, 0x7D, 0x59, 0xFE, 0xBE, 0x5D, 0xFA, 0x9D, 0x6A, 0x85, 0xA7, 0x33, 0x33, 0x5C, 0x4F, 0x7D, 0x7F, 0xEC, 0xBF, 0x6E, 0xFF, 0xE1, 0xC2, 0x7D, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs index 7f3be74edb..aa6a7221aa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_GB_PPU.cs @@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk case 0xFF43: ret = scroll_x; break; // SCX case 0xFF44: ret = LY_read; break; // LY case 0xFF45: ret = LYC; break; // LYC - case 0xFF46: ret = DMA_addr; break; // DMA + case 0xFF46: ret = DMA_addr; break; // DMA case 0xFF47: ret = BGP; break; // BGP case 0xFF48: ret = obj_pal_0; break; // OBP0 case 0xFF49: ret = obj_pal_1; break; // OBP1 @@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } LCDC = value; - break; + break; case 0xFF41: // STAT // note that their is no stat interrupt bug in GBC STAT = (byte)((value & 0xF8) | (STAT & 7) | 0x80); @@ -164,13 +164,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { LYC_INT = false; } } if (!STAT.Bit(6)) { LYC_INT = false; } - break; + break; case 0xFF42: // SCY scroll_y = value; - break; + break; case 0xFF43: // SCX scroll_x = value; - break; + break; case 0xFF44: // LY // writing to LY has no effect, confirmed by gambatte test roms break; @@ -180,19 +180,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk LYC_t = value; LYC_cd = 4; break; - case 0xFF46: // DMA + case 0xFF46: // DMA DMA_addr = value; DMA_start = true; if (!DMA_bus_control) { DMA_OAM_access = true; } DMA_clock = 0; DMA_inc = 0; - break; + break; case 0xFF47: // BGP BGP = value; - break; + break; case 0xFF48: // OBP0 obj_pal_0 = value; - break; + break; case 0xFF49: // OBP1 obj_pal_1 = value; break; @@ -331,7 +331,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (OBJ_bytes_inc) { OBJ_bytes_index++; OBJ_bytes_index &= 0x3F; } break; - } + } } public override void tick() @@ -530,7 +530,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (Core._scanlineCallback != null) { Core._scanlineCallback(LCDC); - } + } } cycle = 0; @@ -554,7 +554,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk window_y_latch = window_y; window_y_tile_inc = 0; window_started = false; - if (!LCDC.Bit(5)) { window_is_reset = true; } + if (!LCDC.Bit(5)) { window_is_reset = true; } } // Automatically restore access to VRAM at this time (force end drawing) @@ -579,7 +579,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk Core.in_vblank = false; LCD_was_off = false; - // we exit vblank into mode 0 for 4 cycles + // we exit vblank into mode 0 for 4 cycles // but no hblank interrupt, presumably this only happens transitioning from mode 3 to 0 STAT &= 0xFC; glitch_state = true; @@ -591,7 +591,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk cycle = 8; } - // NOTE: timing differences between when ios is one (GBC mode) and off do not occur in the bios code so are not + // NOTE: timing differences between when ios is one (GBC mode) and off do not occur in the bios code so are not // represented here, see the GBC PPU for more details. if (in_vbl) { @@ -880,7 +880,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } public override void render(int render_cycle) - { + { // we are now in STAT mode 3 // NOTE: presumably the first necessary sprite is fetched at sprite evaulation // i.e. just keeping track of the lowest x-value sprite @@ -952,7 +952,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk render_counter = 0; window_x_tile = (int)Math.Floor((float)(pixel_counter - (window_x_latch - 7)) / 8); - + window_tile_inc = 0; window_started = true; window_is_reset = false; @@ -1033,7 +1033,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk tile_byte -= 256; } bus_address = (VRAM_sel * 0x2000) + 0x1000 + tile_byte * 16 + y_scroll_offset * 2; - + if (!LCDC_Bit_4_glitch) { tile_data[0] = Core.VRAM[bus_address]; } else { tile_data[0] = (byte)tile_byte; } } @@ -1433,7 +1433,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk STAT |= 0x00; if (STAT.Bit(3)) { HBL_INT = true; } - + // TODO: If Window is turned on midscanline what happens? When is this check done exactly? if ((window_started && window_latch) || (window_is_reset && !window_latch && (LY > window_y_latch))) { @@ -1455,7 +1455,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } internal_cycle++; - + if (latch_new_data) { latch_new_data = false; @@ -1466,7 +1466,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk was_pre_render = pre_render; } - + // every in range sprite takes 6 cycles to process // sprites located at x=0 still take 6 cycles to process even though they don't appear on screen // sprites above x=168 do not take any cycles to process however @@ -1514,7 +1514,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { sprite_fetch_counter += 5; - } + } } } @@ -1531,9 +1531,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { fetch_sprite = false; } - } + } } - + } public override void DMA_tick() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs index be5fff9a22..5f90fc9b69 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs @@ -70,7 +70,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk case 0xFF43: ret = scroll_x; break; // SCX case 0xFF44: ret = LY_read; break; // LY case 0xFF45: ret = LYC; break; // LYC - case 0xFF46: ret = DMA_addr; break; // DMA + case 0xFF46: ret = DMA_addr; break; // DMA case 0xFF47: ret = BGP; break; // BGP case 0xFF48: ret = obj_pal_0; break; // OBP0 case 0xFF49: ret = obj_pal_1; break; // OBP1 @@ -151,7 +151,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } LCDC = value; - break; + break; case 0xFF41: // STAT // note that their is no stat interrupt bug in GBC //Console.WriteLine("stat " + " " + STAT + " " + value + " " + LY + " " + cycle + " " + Core.REG_FF0F); @@ -165,13 +165,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { LYC_INT = false; } } if (!STAT.Bit(6)) { LYC_INT = false; } - break; + break; case 0xFF42: // SCY scroll_y = value; - break; + break; case 0xFF43: // SCX scroll_x = value; - break; + break; case 0xFF44: // LY // writing to LY has no effect, confirmed by gambatte test roms break; @@ -181,19 +181,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk LYC_t = value; LYC_cd = 4; break; - case 0xFF46: // DMA + case 0xFF46: // DMA DMA_addr = value; DMA_start = true; if (!DMA_bus_control) { DMA_OAM_access = true; } DMA_clock = 0; DMA_inc = 0; - break; + break; case 0xFF47: // BGP BGP = value; - break; + break; case 0xFF48: // OBP0 obj_pal_0 = value; - break; + break; case 0xFF49: // OBP1 obj_pal_1 = value; break; @@ -294,7 +294,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { HDMA_active = false; - } + } } // always update length @@ -333,7 +333,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (OBJ_bytes_inc) { OBJ_bytes_index++; OBJ_bytes_index &= 0x3F; } break; - } + } } public override void tick() @@ -369,7 +369,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } } else - { + { // immediately transfer bytes, 2 bytes per cycles if ((HDMA_tick % 2) == 0) { @@ -496,7 +496,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } HDMA_tick++; - } + } } else { @@ -506,7 +506,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk VRAM_access_write_HDMA = true; VRAM_access_write = VRAM_access_write_PPU & VRAM_access_write_HDMA; } - } + } } else { @@ -517,8 +517,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk VRAM_access_write_HDMA = true; VRAM_access_write = VRAM_access_write_PPU & VRAM_access_write_HDMA; } - } - + } + // the ppu only does anything if it is turned on via bit 7 of LCDC if (LCDC.Bit(7)) { @@ -531,7 +531,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (Core._scanlineCallback != null) { Core._scanlineCallback(LCDC); - } + } } cycle = 0; @@ -555,7 +555,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk window_y_latch = window_y; window_y_tile_inc = 0; window_started = false; - if (!LCDC.Bit(5)) { window_is_reset = true; } + if (!LCDC.Bit(5)) { window_is_reset = true; } } // Automatically restore access to VRAM at this time (force end drawing) @@ -581,7 +581,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk Core.in_vblank = false; LCD_was_off = false; - // we exit vblank into mode 0 for 4 cycles + // we exit vblank into mode 0 for 4 cycles // but no hblank interrupt, presumably this only happens transitioning from mode 3 to 0 STAT &= 0xFC; glitch_state = true; @@ -621,8 +621,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (STAT.Bit(5)) { VBL_INT = true; } } - if (cycle >= 4) - { + if (cycle >= 4) + { if (STAT.Bit(4)) { VBL_INT = true; } else { VBL_INT = false; } } @@ -683,14 +683,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (STAT.Bit(6)) { LYC_INT = true; } } } - + if (cycle == 84) { OAM_access_read = false; rendering_complete = false; } - + } else if (!rendering_complete) { @@ -721,14 +721,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if ((cycle == 2) && (LY != 0)) { HBL_INT = false; - + if (STAT.Bit(5)) { OAM_INT = true; } } // the last few cycles of mode 1 still trigger mode 1 int if (cycle < 4) { - if (STAT.Bit(4) && ((STAT & 3) == 1)) { VBL_INT = true; } + if (STAT.Bit(4) && ((STAT & 3) == 1)) { VBL_INT = true; } else { VBL_INT = false; } } else @@ -749,14 +749,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { OAM_access_read = false; OAM_access_write = true; - + rendering_complete = false; } else if (cycle < 80) { // here OAM scanning is performed OAM_scan(cycle); - } + } } else if (!rendering_complete) { @@ -852,7 +852,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (stat_line && !stat_line_old) { if (Core.REG_FFFF.Bit(1)) { Core.cpu.FlagI = true; } - Core.REG_FF0F |= 0x02; + Core.REG_FF0F |= 0x02; } stat_line_old = stat_line; @@ -885,7 +885,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } public override void render(int render_cycle) - { + { // we are now in STAT mode 3 // NOTE: presumably the first necessary sprite is fetched at sprite evaulation // i.e. just keeping track of the lowest x-value sprite @@ -920,7 +920,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // before anything else, we have to check if windowing is in effect if (window_latch && !window_started && (LY >= window_y_latch) && (pixel_counter >= (window_x_latch - 7)) && (window_x_latch < 167)) - { + { /* Console.Write(LY); Console.Write(" "); @@ -934,7 +934,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk Console.Write(" "); Console.WriteLine(pixel_counter); */ - + if (window_x_latch == 0) { // if the window starts at zero, we still do the first access to the BG @@ -959,7 +959,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk render_counter = 0; window_x_tile = (int)Math.Floor((float)(pixel_counter - (window_x_latch - 7)) / 8); - + window_tile_inc = 0; window_started = true; window_is_reset = false; @@ -991,7 +991,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if ((internal_cycle % 2) == 1) { read_case_prev = 0; - + // calculate the row number of the tiles to be fetched y_tile = ((scroll_y + LY) >> 3) % 32; x_tile = scroll_x >> 3; @@ -1040,7 +1040,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } bus_address = (VRAM_sel * 0x2000) + 0x1000 + tile_byte * 16 + y_scroll_offset * 2; - + if (!LCDC_Bit_4_glitch) { tile_data[0] = Core.VRAM[bus_address]; } else { tile_data[0] = (byte)tile_byte; } } @@ -1081,7 +1081,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } bus_address = (VRAM_sel * 0x2000) + 0x1000 + tile_byte * 16 + y_scroll_offset * 2 + 1; - + if (!LCDC_Bit_4_glitch) { tile_data[1] = Core.VRAM[bus_address]; } else { tile_data[1] = (byte)tile_byte; } } @@ -1170,7 +1170,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } bus_address = (VRAM_sel * 0x2000) + 0x1000 + tile_byte * 16 + y_scroll_offset * 2; - + if (!LCDC_Bit_4_glitch) { tile_data[0] = Core.VRAM[bus_address]; } else { tile_data[0] = (byte)tile_byte; } } @@ -1286,7 +1286,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk VRAM_access_write = VRAM_access_write_PPU & VRAM_access_write_HDMA; if (Core.double_speed) { HDMA_can_start = true; } - + read_case = 18; break; @@ -1341,7 +1341,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // now we have the BG pixel, we next need the sprite pixel if (!no_sprites) { - bool have_sprite = false; + bool have_sprite = false; int sprite_attr = 0; if (sprite_present_list[pixel_counter] == 1) @@ -1378,11 +1378,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (use_sprite) { - pal_num = sprite_attr & 7; - } - } + pal_num = sprite_attr & 7; + } + } } - + // based on sprite priority and pixel values, pick a final pixel color if (use_sprite) { @@ -1392,7 +1392,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { Core.vid_buffer[LY * 160 + pixel_counter] = BG_palette[pal_num * 4 + pixel]; } - + pixel_counter++; if (pixel_counter == 160) @@ -1422,9 +1422,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } render_counter++; } - + internal_cycle++; - + if (latch_new_data) { latch_new_data = false; @@ -1435,7 +1435,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk was_pre_render = pre_render; } - + // every in range sprite takes 6 cycles to process // sprites located at x=0 still take 6 cycles to process even though they don't appear on screen // sprites above x=168 do not take any cycles to process however @@ -1500,8 +1500,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { fetch_sprite = false; } - } - } + } + } } public override void DMA_tick() @@ -1517,7 +1517,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // Gekkio reports that A14 being high on DMA transfers always represent WRAM accesses // So transfers nominally from higher memory areas are actually still from there (i.e. FF -> DF) byte DMA_actual = DMA_addr; - if (DMA_addr > 0xDF) { DMA_actual &= 0xDF; } + if (DMA_addr > 0xDF) { DMA_actual &= 0xDF; } DMA_byte = Core.ReadMemory((ushort)((DMA_actual << 8) + DMA_inc)); DMA_bus_control = true; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ICodeDataLog.cs index a037a14de5..cd88ec85ff 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ICodeDataLog.cs @@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk //NOTE: in principle a mapper could mount a useful resource here, but I doubt it) if ((flags & LR35902.eCDLogMemFlags.Write) != 0) return; } - + if (ppu.DMA_bus_control) { // some of gekkio's tests require these to be accessible during DMA @@ -85,9 +85,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { SetCDL(flags, "HRAM", addr - 0xFF80); } - + } - + if (addr < 0x900) { if (addr < 0x100) @@ -175,6 +175,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } - + } } \ No newline at end of file diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs index 8938eb7479..383afc7d0c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs @@ -282,7 +282,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { cpu.instr_pntr = cpu_state_hold; - } + } } public void process_delays() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs index 12dca3da96..5c723d65c5 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(Acc_X_state), ref Acc_X_state); ser.Sync(nameof(Acc_Y_state), ref Acc_Y_state); ser.Sync(nameof(in_vblank), ref in_vblank); - ser.Sync(nameof(in_vblank_old), ref in_vblank_old); + ser.Sync(nameof(in_vblank_old), ref in_vblank_old); ser.Sync(nameof(vblank_rise), ref vblank_rise); ser.Sync(nameof(controller_was_checked), ref controller_was_checked); ser.Sync(nameof(GB_bios_register), ref GB_bios_register); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs index cfa65df440..0d5d6e9047 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs @@ -65,8 +65,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // memory domains public byte[] RAM = new byte[0x8000]; // only 0x2000 available to GB public byte[] ZP_RAM = new byte[0x80]; - /* - * VRAM is arranged as: + /* + * VRAM is arranged as: * 0x1800 Tiles * 0x400 BG Map 1 * 0x400 BG Map 2 @@ -145,7 +145,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk GetIntRegs = GetIntRegs, SetIntRegs = SetIntRegs }; - + timer = new(); audio = new Audio(); serialport = new SerialPort(); @@ -367,7 +367,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk serialport.Reset(); mapper.Reset(); cpu.Reset(); - + vid_buffer = new uint[VirtualWidth * VirtualHeight]; frame_buffer = new int[VirtualWidth * VirtualHeight]; @@ -498,7 +498,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } } - // TODO: move callbacks to cpu to avoid having to make a non-inlinable + // TODO: move callbacks to cpu to avoid having to make a non-inlinable private void ExecFetch(ushort addr) { if (MemoryCallbacks.HasExecutes) @@ -573,7 +573,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk Console.WriteLine("Using Multi-Cart Mapper"); mapper = new MapperMBC1Multi(); } - + // Wisdom Tree does not identify their mapper, so use hash instead else if (romHashSHA1 is RomChecksums.WisdomTreeJoshua or RomChecksums.WisdomTreeSpiritualWarfare or RomChecksums.WisdomTreeExodus or RomChecksums.WisdomTreeKJVBible or RomChecksums.WisdomTreeNIVBible) { @@ -662,7 +662,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk cart_RAM[i] = 0xFF; } } - + // Extra RTC initialization for mbc3, HuC3, and TAMA5 if (mppr == "MBC3") { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawkControllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawkControllers.cs index b995d0cfc3..38351be2d8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawkControllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawkControllers.cs @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public int PortNum { get; } - public float theta, phi, theta_prev, phi_prev, phi_prev_2; + public float theta, phi, theta_prev, phi_prev, phi_prev_2; public ControllerDefinition Definition { get; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs index 7e926959c9..c24e0b6181 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GB_PPU.cs @@ -9,14 +9,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk byte ret = 0; switch (addr) - { + { case 0xFF40: ret = LCDC; break; // LCDC case 0xFF41: ret = STAT; break; // STAT case 0xFF42: ret = scroll_y; break; // SCY case 0xFF43: ret = scroll_x; break; // SCX case 0xFF44: ret = LY; break; // LY case 0xFF45: ret = LYC; break; // LYC - case 0xFF46: ret = DMA_addr; break; // DMA + case 0xFF46: ret = DMA_addr; break; // DMA case 0xFF47: ret = BGP; break; // BGP case 0xFF48: ret = obj_pal_0; break; // OBP0 case 0xFF49: ret = obj_pal_1; break; // OBP1 @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public override void WriteReg(int addr, byte value) { - //Console.WriteLine((addr - 0xFF40) + " " + value + " " + LY + " " + cycle + " " + LCDC.Bit(7)); + //Console.WriteLine((addr - 0xFF40) + " " + value + " " + LY + " " + cycle + " " + LCDC.Bit(7)); switch (addr) { case 0xFF40: // LCDC @@ -47,10 +47,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { // don't draw for one frame after turning on blank_frame = true; - } + } LCDC = value; //Console.WriteLine(LY + " " + cycle); - break; + break; case 0xFF41: // STAT // writing to STAT during mode 0 or 1 causes a STAT IRQ // this appears to be a glitchy LYC compare @@ -104,28 +104,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (153 != LYC) { STAT &= 0xFB; LYC_INT = false; } else { STAT |= 0x4; LYC_INT = true; } } - } + } break; - case 0xFF46: // DMA + case 0xFF46: // DMA DMA_addr = value; DMA_start = true; if (!DMA_bus_control) {DMA_OAM_access = true; } DMA_clock = 0; DMA_inc = 0; - break; + break; case 0xFF47: // BGP BGP = value; - break; + break; case 0xFF48: // OBP0 obj_pal_0 = value; - break; + break; case 0xFF49: // OBP1 obj_pal_1 = value; break; case 0xFF4A: // WY window_y = value; window_y_read = window_y; - if (!window_started && (!LCDC.Bit(7) || (value > LY))) + if (!window_started && (!LCDC.Bit(7) || (value > LY))) { window_y_latch = window_y; window_y_tile = 0; @@ -136,14 +136,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk window_x = value; window_x_read = window_x; break; - } + } } public override void tick() { // the ppu only does anything if it is turned on via bit 7 of LCDC if (LCDC.Bit(7)) - { + { // start the next scanline if (cycle == 456) { @@ -153,7 +153,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (Core._scanlineCallback != null) { Core._scanlineCallback(LCDC); - } + } } cycle = 0; @@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk Core.in_vblank = false; LCD_was_off = false; - // we exit vblank into mode 0 for 4 cycles + // we exit vblank into mode 0 for 4 cycles // but no hblank interrupt, presumably this only happens transitioning from mode 3 to 0 STAT &= 0xFC; glitch_state = true; @@ -212,7 +212,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk cycle = 8; } - // Timing note: LYC=143 does not by itself block mode1 stat int. But, the glitchy mode 2 stat check combined with + // Timing note: LYC=143 does not by itself block mode1 stat int. But, the glitchy mode 2 stat check combined with // LYC=143 does block it // the VBL stat is continuously asserted @@ -247,7 +247,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if ((cycle == 4) && (LY == 144)) { - HBL_INT = false; + HBL_INT = false; // set STAT mode to 1 (VBlank) and interrupt flag if it is enabled STAT &= 0xFC; @@ -370,7 +370,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { // here OAM scanning is performed OAM_scan(cycle); - } + } } else if (!rendering_complete) { @@ -384,9 +384,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } // render the screen and handle hblank - render(cycle - 83); + render(cycle - 83); } - } + } } if (LY_inc == 0) @@ -436,7 +436,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk VBL_INT = LYC_INT = HBL_INT = OAM_INT = false; in_vbl = true; - Core.in_vblank = true; + Core.in_vblank = true; LCD_was_off = true; @@ -464,7 +464,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // might be needed, not sure yet public override void latch_delay() { - + } public override void render(int render_cycle) @@ -540,7 +540,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk render_counter = 0; window_x_tile = (int)Math.Floor((float)(pixel_counter - (window_x_latch - 7)) / 8); - + window_tile_inc = 0; window_started = true; window_is_reset = false; @@ -1028,7 +1028,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { fetch_sprite = false; } - } + } } } @@ -1150,7 +1150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk int low_bound = 0; int high_bound = 0; int t_index = 0; - + for (int i = 0; i < 160; i++) { sprite_present_list[i] = 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs index 0fc0bd5d52..33daa099f0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs @@ -277,7 +277,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { input_register |= 0xF; } - + // check for interrupts // if an interrupt is triggered, it is delayed by 4 cycles if (((contr_prev & 0b1000) is not 0 && (input_register & 0b1000) is 0) @@ -287,7 +287,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { controller_delay_cd = 4; delays_to_process = true; } - + break; // Serial data port @@ -415,7 +415,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { GB_bios_register = value; if (!GBC_compat) { ppu.pal_change_blocked = true; RAM_Bank = 1; RAM_Bank_ret = 0; } - } + } break; // PPU Regs for GBC @@ -437,7 +437,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // send IR signal out if ((IR_reg & 0x1) == 0x1) { IR_signal = (byte)(0 | IR_mask); } else { IR_signal = 2; } - + // receive own signal if IR on and receive on if ((IR_reg & 0xC1) == 0xC1) { IR_self = (byte)(0 | IR_mask); } else { IR_self = 2; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_HuC3.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_HuC3.cs index de5d5d2132..2a9516dc87 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_HuC3.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_HuC3.cs @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk return Core.cart_RAM[(addr - 0xA000) + RAM_bank * 0x2000]; } else - { + { return 0xFF; } } @@ -172,7 +172,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk return; } - + if (control == 0xB) { switch (value & 0xF0) @@ -192,7 +192,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (!timer_read) { // write to timer - if (time_val_shift == 0) { time = 0; } + if (time_val_shift == 0) { time = 0; } if (time_val_shift < 28) { time |= (uint)((value & 0x0F) << time_val_shift); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs index 6c42583d68..72eeba65d7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // some games have sizes that result in a degenerate ROM, account for it here if (ROM_mask > 4) { ROM_mask |= 3; } - + RAM_mask = 0; if (Core.cart_RAM != null) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1_Multi.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1_Multi.cs index 3530095c70..2b00a90469 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1_Multi.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1_Multi.cs @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } else { - return Core._rom[(addr - 0x4000) + (((ROM_bank & 0x60) >> 1) | (ROM_bank & 0xF)) * 0x4000]; + return Core._rom[(addr - 0x4000) + (((ROM_bank & 0x60) >> 1) | (ROM_bank & 0xF)) * 0x4000]; } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC2.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC2.cs index 7d5649dd8a..2708b58049 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC2.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC2.cs @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { return Core._rom[(addr - 0x4000) + ROM_bank * 0x4000]; - } + } } public override byte ReadMemoryHigh(ushort addr) @@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (RAM_enable) { Core.cart_RAM[addr - 0xA000] = (byte)(value & 0xF); - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs index 75aaa68697..04684cf3fc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC3.cs @@ -171,7 +171,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (addr < 0x8000) { if (addr < 0x2000) - { + { RAM_enable = ((value & 0xF) == 0xA); } else if (addr < 0x4000) @@ -244,7 +244,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (index < 5) { RTC_regs[index] = (byte)value; - } + } else { RTC_offset = value; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC7.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC7.cs index 69204039f8..b10ed9ff74 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC7.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC7.cs @@ -149,7 +149,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } else if (addr < 0x6000) { - RAM_enable_2 = (value & 0xF0) == 0x40; + RAM_enable_2 = (value & 0xF0) == 0x40; } } else @@ -439,7 +439,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { instr_case = 7; countdown = 8; - } + } break; case 6: @@ -449,7 +449,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk break; case 7: - // completed operations take time, so countdown a bit here. + // completed operations take time, so countdown a bit here. // not cycle accurate for operations like writing to all of the EEPROM, but good enough break; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_RockMan8.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_RockMan8.cs index 2cd2a9c92d..0b369f8662 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_RockMan8.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_RockMan8.cs @@ -3,7 +3,7 @@ using BizHawk.Emulation.Cores.Components.LR35902; namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { - // RockMan 8, just some simple bankswitching + // RockMan 8, just some simple bankswitching public class MapperRM8 : MapperBase { public int ROM_bank; @@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { // lowest bank is fixed return Core._rom[addr]; - + } else { @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { // lowest bank is fixed SetCDLROM(flags, addr); - + } else if (addr < 0x8000) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_TAMA5.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_TAMA5.cs index 5566a5370c..52e2757307 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_TAMA5.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_TAMA5.cs @@ -137,7 +137,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // read from RTC registers if (RAM_addr_low == 3) { - Chip_return_high = RTC_regs[2]; + Chip_return_high = RTC_regs[2]; Chip_return_low = RTC_regs[1]; } else if (RAM_addr_low == 6) @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } else { - + } break; case 4: diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/MemoryMap.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/MemoryMap.cs index bcde748da1..fd313aae9b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/MemoryMap.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/MemoryMap.cs @@ -33,9 +33,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk uint flags = (uint)MemoryCallbackFlags.AccessRead; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); } - + addr_access = addr; - + if (ppu.DMA_bus_control) { // some of gekkio's tests require these to be accessible during DMA @@ -75,11 +75,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (ppu.DMA_OAM_access) { return OAM[addr - 0xFE00]; - } - else + } + else { return 0xFF; - } + } } if (addr >= 0xFF00 && addr < 0xFF80) // The game GOAL! Requires Hardware Regs to be accessible @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk return ppu.DMA_byte; } - + if (addr < 0x8000) { if (addr >= 0x900) @@ -180,7 +180,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk else { return 0xFF; - } + } } if (addr < 0xC000) @@ -265,7 +265,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk uint flags = (uint)MemoryCallbackFlags.AccessWrite; MemoryCallbacks.CallMemoryCallbacks(addr, value, flags, "System Bus"); } - + addr_access = addr; if (ppu.DMA_bus_control) @@ -291,7 +291,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } else if (addr >= 0xFE00 && addr < 0xFEA0 && ppu.DMA_OAM_access) { - OAM[addr - 0xFE00] = value; + OAM[addr - 0xFE00] = value; } else if (addr >= 0xFF00 && addr < 0xFF80) // The game GOAL! Requires Hardware Regs to be accessible { @@ -312,7 +312,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk return; } - + // Writes are more likely from the top down if (addr >= 0xFF00) { @@ -336,7 +336,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { if (ppu.OAM_access_write) { OAM[addr - 0xFE00] = value; } } - // unmapped memory writes depend on console + // unmapped memory writes depend on console else { if (is_GBC) @@ -370,9 +370,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } else if (addr >= 0x8000) { - if (ppu.VRAM_access_write) - { - VRAM[(VRAM_Bank * 0x2000) + (addr - 0x8000)] = value; + if (ppu.VRAM_access_write) + { + VRAM[(VRAM_Bank * 0x2000) + (addr - 0x8000)] = value; } } else diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs index 7a9b254ff5..1a74df37d2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs @@ -221,7 +221,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(stat_line), ref stat_line); ser.Sync(nameof(stat_line_old), ref stat_line_old); ser.Sync(nameof(LCD_was_off), ref LCD_was_off); - + ser.Sync(nameof(OAM_scan_index), ref OAM_scan_index); ser.Sync(nameof(SL_sprites_index), ref SL_sprites_index); ser.Sync(nameof(SL_sprites), ref SL_sprites, false); @@ -248,7 +248,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(sprite_fetch_counter), ref sprite_fetch_counter); ser.Sync(nameof(sprite_attr_list), ref sprite_attr_list, false); ser.Sync(nameof(sprite_pixel_list), ref sprite_pixel_list, false); - ser.Sync(nameof(sprite_present_list), ref sprite_present_list, false); + ser.Sync(nameof(sprite_present_list), ref sprite_present_list, false); ser.Sync(nameof(temp_fetch), ref temp_fetch); ser.Sync(nameof(tile_inc), ref tile_inc); ser.Sync(nameof(pre_render), ref pre_render); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs index d2cf7c0823..af228b3142 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs @@ -95,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { serial_control = (byte)(0x7E | (value & 0x81)); // middle six bits always 1 } - + break; } } @@ -105,8 +105,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { IRQ_block = false; - if (serial_clock > 0) - { + if (serial_clock > 0) + { serial_clock--; if (serial_clock == 0) @@ -144,7 +144,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk serial_bits = 8; clk_rate = -1; going_out = 0; - coming_in = 1; + coming_in = 1; can_pulse = false; IRQ_block = false; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Timer.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Timer.cs index e1b3136d97..33dcd8fd89 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Timer.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Timer.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { // Timer Emulation - // NOTES: + // NOTES: // // Currently, a starting value of 0xFFFE passes all tests. GBA is not explicitly tested but for now is set to 0xFFFE as well. // @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public bool state; public bool reload_block; public ulong next_free_cycle; - + public byte ReadReg(int addr) { byte ret = 0; @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { // DIV register case 0xFF04: - // NOTE: even though there is an automatic increment directly after the CPU loop, + // NOTE: even though there is an automatic increment directly after the CPU loop, // it is still expected that 0 is written here divider_reg = 0; break; @@ -85,7 +85,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // Console.WriteLine("tac: " + timer_control + " " + value + " " + timer + " " + divider_reg); timer_control = (byte)((timer_control & 0xf8) | (value & 0x7)); // only bottom 3 bits function - + if (!timer_control_old.Bit(2) && timer_control.Bit(2) && Core.is_GBC && Core._syncSettings.GBACGB) { bool temp_check_old = false; @@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } } } - + break; } } @@ -144,7 +144,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public void tick() { IRQ_block = false; - + // pick a bit to test based on the current value of timer control switch (timer_control & 3) { @@ -184,7 +184,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk { pending_reload = 3; reload_block = false; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.ICodeDataLog.cs index 3fd8cad8fe..977bfdcdda 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.ICodeDataLog.cs @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink //NOTE: in principle a mapper could mount a useful resource here, but I doubt it) if ((flags & LR35902.eCDLogMemFlags.Write) != 0) return; } - + if (L.ppu.DMA_bus_control) { // some of gekkio's tests require these to be accessible during DMA @@ -86,9 +86,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink { SetCDL(flags, "HRAM", addr - 0xFF80); } - + } - + if (addr < 0x900) { if (addr < 0x100) @@ -176,6 +176,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink } - + } } \ No newline at end of file diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs index 10de459fd8..dcd8b569f6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs @@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink } public void do_frame() - { + { // advance one full frame for (int i = 0; i < 70224; i++) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs index d027ee2910..fd77e0ba82 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs @@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink R = new GBHawk.GBHawk(lp.Comm, lp.Roms[1].Game, lp.Roms[1].RomData, temp_set_R, temp_sync_R); ser.Register(this); - ser.Register(this); + ser.Register(this); _tracer = new TraceBuffer(L.cpu.TraceHeader); ser.Register(_tracer); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.ICodeDataLog.cs index 1385166db9..4729eb8caa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.ICodeDataLog.cs @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x //NOTE: in principle a mapper could mount a useful resource here, but I doubt it) if ((flags & LR35902.eCDLogMemFlags.Write) != 0) return; } - + if (L.ppu.DMA_bus_control) { // some of gekkio's tests require these to be accessible during DMA @@ -86,9 +86,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x { SetCDL(flags, "HRAM", addr - 0xFF80); } - + } - + if (addr < 0x900) { if (addr < 0x100) @@ -176,6 +176,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x } - + } } \ No newline at end of file diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs index be6ec14481..6d5ddbff7d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x R = new GBHawk.GBHawk(lp.Comm, lp.Roms[2].Game, lp.Roms[2].RomData, tempSetR, tempSyncR); ser.Register(this); - ser.Register(this); + ser.Register(this); _tracer = new TraceBuffer(L.cpu.TraceHeader); ser.Register(_tracer); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.ICodeDataLog.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.ICodeDataLog.cs index 5ad7fd3773..72bd39222b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.ICodeDataLog.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.ICodeDataLog.cs @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x //NOTE: in principle a mapper could mount a useful resource here, but I doubt it) if ((flags & LR35902.eCDLogMemFlags.Write) != 0) return; } - + if (A.ppu.DMA_bus_control) { // some of gekkio's tests require these to be accessible during DMA @@ -86,9 +86,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x { SetCDL(flags, "HRAM", addr - 0xFF80); } - + } - + if (addr < 0x900) { if (addr < 0x100) @@ -176,6 +176,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x } - + } } \ No newline at end of file diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs index e1d72e184a..0825ed5aea 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs @@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x { do_frame_2x2(); } - + if (do_frame_fill) { FillVideoBuffer(); @@ -186,7 +186,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x if (x4_clock == 0) { if (is_transmitting) - { + { if (ready_to_transmit) { // fill the buffer on the second pass @@ -595,7 +595,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x } } } - + // if we hit a frame boundary, update video if (A.vblank_rise) { @@ -1021,7 +1021,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x public int[] GetVideoBuffer() { - return _vidbuffer; + return _vidbuffer; } public void FillVideoBuffer() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs index 4fbd9e343f..5df68b0521 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs @@ -103,7 +103,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x D = new GBHawk.GBHawk(lp.Comm, lp.Roms[3].Game, lp.Roms[3].RomData, tempSetD, tempSyncD); ser.Register(this); - ser.Register(this); + ser.Register(this); _tracer = new TraceBuffer(A.cpu.TraceHeader); ser.Register(_tracer); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBColors.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBColors.cs index 6812bbac55..651b27abfb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBColors.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GBColors.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy * The GBC uses a RGB555 color space, but it most definately does not resemble sRGB at all. * To make matters worse, because of the reflective screen, the visible colors depend greatly * on the viewing environment. - * + * * All of these algorithms convert from GBC RGB555 to sRGB RGB888 */ public struct Triple @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy this.g = g; this.b = b; } - + public Triple Bit5to8Bad() { Triple ret; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs index e80f937d92..7fe65ca55f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy /// true to mute all audio /// public bool Muted; - + /// /// true to use rgbds syntax /// diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index 4634a0f425..cea40cdc22 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -647,7 +647,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy Vram = _vram, Oam = _oam, Sppal = _sppal, - Bgpal = _bgpal, + Bgpal = _bgpal, }; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IVideoProvider.cs index 178f0f70f4..200f8253e8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IVideoProvider.cs @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public int[] GetVideoBuffer() => VideoBuffer; private readonly int[] VideoBuffer; - + private int[] CreateVideoBuffer() { var b = new int[BufferWidth * BufferHeight]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs index 58f42decdf..a696c9f8f2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs @@ -71,12 +71,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy /// /// Emulates until at least 'samples' stereo sound samples are produced in the supplied buffer, /// or until a video frame has been drawn. - /// + /// /// There are 35112 stereo sound samples in a video frame. /// May run for up to 2064 stereo samples too long. /// A stereo sample consists of two native endian 2s complement 16-bit PCM samples, /// with the left sample preceding the right one. - /// + /// /// Returns early when a new video frame has finished drawing in the video buffer, /// such that the caller may update the video output before the frame is overwritten. /// The return value indicates whether a new video frame has been drawn, and the @@ -254,7 +254,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy /// 0-153 inclusive [DllImport("libgambatte", CallingConvention = CallingConvention.Cdecl)] public static extern void gambatte_setscanlinecallback(IntPtr core, ScanlineCallback callback, int sl); - + /// /// type of the link data sent callback /// @@ -552,7 +552,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy /// length of at least 10, please [DllImport("libgambatte", CallingConvention = CallingConvention.Cdecl)] public static extern void gambatte_getregs(IntPtr core, int[] dest); - + /// /// set reg and flag values /// diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 4526635f54..ae7411aa2d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -137,7 +137,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 api.AsyncExecuteEmulator(); // 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 + // 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. api.frame_advance(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs index a0231513bd..006093ad40 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GLideN64.cs @@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 OverscanPalLeft = 0; OverscanPalRight = 0; } - + public enum BackgroundsRenderingMode { [Description("One Piece")] @@ -81,7 +81,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 [Description("Stripped")] Stripped = 1 } - + [DefaultValue(BackgroundsRenderingMode.Stripped)] [DisplayName("Background Rendering Mode")] [Description("Render backgrounds mode (HLE only). (0=One Piece (fast), 1=Stripped (precise))")] @@ -498,7 +498,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 [Description("Allow to use alpha channel of high-res texture fully.")] [Category("Texture Enhancement")] public bool txHiresFullAlphaChannel { get; set; } - + [DefaultValue(false)] [DisplayName("Texture Enhancement File Storage")] [Description("Use file storage instead of memory cache for enhanced textures.")] @@ -510,7 +510,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 [Description("Use file storage instead of memory cache for HD textures.")] [Category("Texture Enhancement")] public bool txHiresTextureFileStorage { get; set; } - + [DefaultValue(false)] [DisplayName("Texture Hres Alt CRC")] [Description("Use alternative method of paletted textures CRC calculation.")] diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs index fe8afe087f..3fb72dec53 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs @@ -148,7 +148,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 public int tex_filter { get; set; } [DefaultValue(false)] - [DisplayName("Framebuffer Render")] + [DisplayName("Framebuffer Render")] [Category("General")] public bool fb_render { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs index 7f8ec8793c..116d50b46c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64VideoProvider.cs @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 int width = 0; int height = 0; api.GetScreenDimensions(ref width, ref height); - + SetBufferSize( width > videosettings.Width ? width : videosettings.Width, height > videosettings.Height ? height : videosettings.Height diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs index d08c062bc5..949bf58dfe 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeApi/mupen64plusCoreApi.cs @@ -338,7 +338,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi //WARNING - RETURNS A STATIC BUFFER [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate IntPtr biz_r4300_decode_op(uint instr, uint counter); - public biz_r4300_decode_op m64p_decode_op; + public biz_r4300_decode_op m64p_decode_op; /// /// Reads from the "system bus" diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs index 16c6f553fc..fdeab530e8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs @@ -1,6 +1,6 @@ // TODO - so many integers in the square wave output keep us from exactly unbiasing the waveform. also other waves probably. consider improving the unbiasing. -// ALSO - consider whether we should even be doing it: the nonlinear-mixing behaviour probably depends on those biases being there. -// if we have a better high-pass filter somewhere then we might could cope with the weird biases +// ALSO - consider whether we should even be doing it: the nonlinear-mixing behaviour probably depends on those biases being there. +// if we have a better high-pass filter somewhere then we might could cope with the weird biases // (mix higher integer precision with the non-linear mixer and then highpass filter befoure outputting s16s) // http://wiki.nesdev.com/w/index.php/APU_Mixer_Emulation @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES this.nes = nes; dmc = new DMCUnit(this, pal); sequencer_lut = pal ? sequencer_lut_pal : sequencer_lut_ntsc; - + noise = new NoiseUnit(this, pal); triangle = new TriangleUnit(this); pulse[0] = new PulseUnit(this, 1); @@ -596,7 +596,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public void Run() { // when clocked by timer, seq steps forward - // except when linear counter or length counter is 0 + // except when linear counter or length counter is 0 bool en = len_cnt != 0 && linear_counter != 0; bool do_clock = false; @@ -745,11 +745,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES timer_just_reloaded = true; } - // Any time the sample buffer is in an empty state and bytes remaining is not zero, the following occur: + // Any time the sample buffer is in an empty state and bytes remaining is not zero, the following occur: // also note that the halt for DMC DMA occurs on APU cycles only (hence the timer check) if (!sample_buffer_filled && ((sample_length > 0) || fill_glitch_2) && (apu.dmc_dma_countdown == -1) && (delay == 0)) { - if (!fill_glitch) + if (!fill_glitch) { if (!apu.call_from_write) { @@ -781,7 +781,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { delay = 2; - } + } } } else @@ -810,8 +810,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private void Clock() { - // If the silence flag is clear, bit 0 of the shift register is applied to the counter as follows: - // if bit 0 is clear and the delta-counter is greater than 1, the counter is decremented by 2; + // If the silence flag is clear, bit 0 of the shift register is applied to the counter as follows: + // if bit 0 is clear and the delta-counter is greater than 1, the counter is decremented by 2; // otherwise, if bit 0 is set and the delta-counter is less than 126, the counter is incremented by 2 if (!out_silence) { @@ -830,13 +830,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES apu.recalculate = true; } - // The right shift register is clocked. + // The right shift register is clocked. out_shift >>= 1; - // The bits-remaining counter is decremented. If it becomes zero, a new cycle is started. + // The bits-remaining counter is decremented. If it becomes zero, a new cycle is started. if (out_bits_remaining == 0) { - // The bits-remaining counter is loaded with 8. + // The bits-remaining counter is loaded with 8. out_bits_remaining = 7; // If the sample buffer is empty then the silence flag is set if (!sample_buffer_filled) @@ -844,7 +844,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES out_silence = true; } else - // otherwise, the silence flag is cleared and the sample buffer is emptied into the shift register. + // otherwise, the silence flag is cleared and the sample buffer is emptied into the shift register. { out_silence = false; out_shift = sample_buffer; @@ -869,7 +869,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES apu.SyncIRQ(); return; } - + // in these cases the disable happens too late and the reload (andpotential IRQ) still happen if ((timer == 1) && (out_bits_remaining == 0) && (sample_length != 0)) { @@ -892,7 +892,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { sample_length = 0; } - + } else { @@ -902,7 +902,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { sample_address = user_address; sample_length = user_length; - + } if (!sample_buffer_filled) { @@ -963,7 +963,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES apu.dmc_reload_countdown = 3; } - + // Console.WriteLine("fetching dmc byte: {0:X2}", sample_buffer); } } @@ -1055,7 +1055,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (seq_tick==0) { sequencer_mode = (val >> 7) & 1; - + // Console.WriteLine("apu 4017 = {0:X2}", val); // check if we will be doing the extra frame ticks or not if (sequencer_mode==1) @@ -1092,7 +1092,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES sequencer_irq_assert = 2; sequencer_irq_flag = true; } - + HalfFrame(); } if (sequencer_mode == 0 && sequencer_counter == sequencer_lut[0][3] - 2 && sequencer_irq_inhibit == 0) @@ -1261,7 +1261,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { seq_tick = 4; } - + seq_val = val; } break; @@ -1275,7 +1275,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x4015: { //notice a missing bit here. should properly emulate with empty / Data bus - //if an interrupt flag was set at the same moment of the read, it will read back as 1 but it will not be cleared. + //if an interrupt flag was set at the same moment of the read, it will read back as 1 but it will not be cleared. int dmc_nonzero = dmc.IsLenCntNonZero() ? 1 : 0; int noise_nonzero = noise.IsLenCntNonZero() ? 1 : 0; int tri_nonzero = triangle.IsLenCntNonZero() ? 1 : 0; @@ -1329,7 +1329,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public void RunOneLast() { - // we need to predict if there will be a length clock here, because the sequencer ticks last, but the + // we need to predict if there will be a length clock here, because the sequencer ticks last, but the // timer reload shouldn't happen if length clock and write happen simultaneously // I'm not sure if we can avoid this by simply processing the sequencer first // but at the moment that would break everything, so this is good enough for now @@ -1355,7 +1355,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (dmc.irq_enabled && !dmc_irq_glitch) { dmc_irq = true; } } - + if (dmc.pending_disable) { dmc.sample_length = 0; @@ -1369,7 +1369,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // handle writes // notes: this set up is a bit convoluded at the moment, mainly because APU behaviour is not entirely understood // in partiuclar, there are several clock pulses affecting the APU, and when new written are latched is not known in detail - // the current code simply matches known behaviour + // the current code simply matches known behaviour if (pending_reg != -1) { if ( pending_reg == 0x4003 || pending_reg == 0x4007 || pending_reg == 0x4010 || pending_reg == 0x4015 || pending_reg == 0x4017) @@ -1399,7 +1399,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - + SyncIRQ(); nes._irq_apu = irq_pending; @@ -1461,12 +1461,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES float tnd_out = s_tri == 0 && s_noise == 0 && s_dmc == 0 ? 0 : 159.79f / (1 / ((s_tri / 8227.0f) + (s_noise / 12241.0f /* * NOISEADJUST*/) + (s_dmc / 22638.0f)) + 100); - + float output = pulse_out + tnd_out; // output = output * 2 - 1; - // this needs to leave enough headroom for straying DC bias due to the DMC unit getting stuck outputs. smb3 is bad about that. + // this needs to leave enough headroom for straying DC bias due to the DMC unit getting stuck outputs. smb3 is bad about that. oldmix = (int)(20000 * output * (1 + m_vol / 5)) + cart_sound; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs index 697555ec3a..c69521b1f0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs @@ -5,10 +5,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { /* I'm breaking FCG boards into 7 main types: - + [1] FCG-1, FCG-2: regs at 6000:7fff. FCG-3: regs at 8000:ffff. one of the following at 6000:7fff: - [2] nothing + [2] nothing [3] seeprom (1kbit) [4] seeprom (2kbit) [5] sram (8kbyte) (SEE SIZE NOTES BELOW) @@ -19,9 +19,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES iNES #153 refers to [5], theoretically. iNES #157 refers to [6], theoretically. iNES #159 refers to [3], theoretically. - + We try to emulate everything but [6] here. - + Size notes: chr regs are 8 bit wide and swap 1K at a time, for a max size of 256K chr, always rom. prg reg is 4 bit wide and swaps 16K at a time, for a max size of 256K prg. @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Every real instance of [1], [2], [3], [4] had 128K or 256K of each of chr and prg. */ - internal sealed class BANDAI_FCG_1 : NesBoardBase + internal sealed class BANDAI_FCG_1 : NesBoardBase { //configuration private int prg_bank_mask_16k, chr_bank_mask_1k; @@ -167,7 +167,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_bank_mask_16k = 256 / 16 - 1; chr_bank_mask_1k = Cart.ChrSize - 1; - + SetMirrorType(EMirrorType.Vertical); prg_reg_16k = 0; @@ -193,8 +193,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[0] &= 0x0f; prg_banks_16k[1] &= 0x0f; } - } - */ + } + */ } private void WriteReg(int reg, byte value) @@ -246,7 +246,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_counter &= 0xFF00; irq_counter |= value; } - + break; case 0xC: if (jump2) @@ -259,7 +259,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_counter &= 0x00FF; irq_counter |= (ushort)(value << 8); } - + break; case 0xD: eprom?.WriteByte(value); @@ -301,7 +301,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES WriteReg(addr, value); } } - + } } @@ -331,7 +331,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (irq_enabled) { - + if (irq_counter == 0x0000) { IrqSignal = true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs index eb061ad062..61c201a59b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs @@ -129,7 +129,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Console.WriteLine("chr disabled"); } } - + } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs index 974f910870..f7aee392c7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs @@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case "NES-CPROM": //videomation AssertPrg(32); AssertChr(0); AssertVram(16); AssertWram(0); break; - + default: return false; } @@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - + public override void WritePrg(int addr, byte value) { value = HandleNormalPRGConflict(addr,value); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs index 2ee64a4d0d..1fa0af477b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case "MAPPER071": break; case "CAMERICA-ALGN": //Linus Spacehead's Cosmic Crusade (U) - AssertPrg(128,256); AssertChr(0); AssertWram(0); + AssertPrg(128,256); AssertChr(0); AssertWram(0); AssertVram(8,16); //zero 22-mar-2012 - added 16 here as a hack to make micro machines (aladdin) load. should remove this after it is fixed in the DB break; case "CAMERICA-BF9093": //Big Nose Freaks Out (U) @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if(mirror_control_enabled) SetMirrorType(value.Bit(4) ? EMirrorType.OneScreenB : EMirrorType.OneScreenA); break; - + //$C000-FFFF: PRG Select (16k @ $8000) case 0x4000: case 0x5000: case 0x6000: case 0x7000: @@ -120,7 +120,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } prg_bank_mask_16k = Cart.PrgSize / 16 - 1; - + SetMirrorType(Cart.PadH, Cart.PadV); SyncPRG(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs index 5311673ceb..04f81470a4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs @@ -257,8 +257,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES switch (addr) { case 0x0000: is_2k_bank = true; bank = value; mode |= 0x40; break; - case 0x3000: - case 0x30FF: + case 0x3000: + case 0x30FF: case 0x31FF: bank = value; mode |= 0x40; @@ -283,7 +283,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x0317: chr_regs[7] = value; break; case 0x0200: - IRQCount &= 0xFF00; IRQCount |= value; + IRQCount &= 0xFF00; IRQCount |= value; IrqSignal = false; break; case 0x0201: @@ -319,7 +319,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank |= ((bank & 0x30) << 4); return Vrom[(bank << 10) + (addr & 0x3FF)]; } - + } return base.ReadPpu(addr); @@ -348,7 +348,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - + } public override void ClockCpu() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs index edc8c047d7..b7dee070ac 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs @@ -266,7 +266,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { bank_1k = _aBanks1K[bank_1k]; } - + bank_1k &= chr_bank_mask_1k; addr = (bank_1k<<10)|ofs; return addr; @@ -520,7 +520,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES nt_fill_attrib |= (byte)(nt_fill_attrib << 2); nt_fill_attrib |= (byte)(nt_fill_attrib << 4); break; - + case 0x1113: //$5113: [.... .PPP] (simplified, but technically inaccurate -- see below) wram_bank = value & (Cart.WramSize is 128 ? 0b1111 : 0b0111); @@ -534,7 +534,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; //$5120 - $5127 'A' Regs: - case 0x1120: case 0x1121: case 0x1122: case 0x1123: + case 0x1120: case 0x1121: case 0x1122: case 0x1123: case 0x1124: case 0x1125: case 0x1126: case 0x1127: ab_mode = 0; regs_a[addr - 0x1120] = value | (chr_reg_high<<8); @@ -601,7 +601,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; case 0x1205: //$5205: low 8 bits of product - ret = product_low; + ret = product_low; break; case 0x1206: //$5206: high 8 bits of product ret = product_high; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs index feb2cbfeb8..77911a4e63 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_mask_8k = Cart.PrgSize / 8 - 1; chr_mask_1k = Cart.ChrSize / 1 - 1; - //Initial State + //Initial State prg_regs_8k[0] = 0x00; prg_regs_8k[1] = 0x01; prg_regs_8k[2] = 0xFE; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs index ccd0f09b50..6f879207d2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // base class pre-configuration void Create(NES nes); - // one-time inherited classes configuration + // one-time inherited classes configuration bool Configure(EDetectionOrigin origin); // one-time base class configuration (which can take advantage of any information setup by the more-informed Configure() method) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs index 88f56bd004..20edaf7a9e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x8000) return Rom[addr + (prg * 0x8000)]; else - return base.ReadPrg(addr); + return base.ReadPrg(addr); } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs index 2488793a33..5ba76b9d3a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES CHR-ROM - 16kb Mirroring - Vertical ines Mapper 87 - + Example Games: -------------------------- City Connection (J) - JF_05 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs index e13cd18688..a7d03d1549 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //Mapper 86 - + //Example Games: //-------------------------- //Moero!! Pro Yakyuu (Black) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs index bbc58613a4..d9e0582477 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs @@ -37,12 +37,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES default: return false; } - + prg_bank_mask_16k = (Cart.PrgSize / 16) - 1; chr_bank_mask_8k = (Cart.ChrSize / 8) - 1; SetMirrorType(Cart.PadH, Cart.PadV); - + prg_banks_16k[1] = 0xFF; chr_banks_8k[0] = 0; SyncMap(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs index cf12a0956f..f2c863917c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs @@ -207,13 +207,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else irqcountwidth = 16; break; - + case 0xF003: // sound chip µPD7756C break; } - - + + } public override void ClockCpu() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs index 7ba05b63fe..cbf71b53af 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs @@ -15,7 +15,7 @@ Battery is not available Uses vertical mirroring No CIC present Other chips used: Sunsoft-1 - * + * * Games: * Mississippi Satsujin Jiken (J) * Bio Senshi Dan - Increaser Tono Tatakai [allegedly; but it does not work] diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs index 1b3d41c7eb..8c1e58800e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs @@ -117,16 +117,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { bank = (block_high << 1) | block_low; } - + byte value = Rom[((bank & prg_bank_mask_32k) * 0x8000) + (addr & 0x7FFF)]; if (addr >= 0x7F80) { WritePrg(addr, value); } - + return value; - + } public override byte ReadPpu(int addr) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs index 5483024b00..3a04b2e080 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs @@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES wram_h_enabled_write = wram_l_enabled_write = false; } break; - + case 0x2001: //$A001 //a whole host of wram configurations if (wram_enabled) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs index 214fb46aaa..b2651ec581 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs @@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public MMC3(NesBoardBase board, int num_prg_banks) { just_cleared = just_cleared_pending = false; - + MirrorMask = 1; this.board = board; if (board.Cart.Chips.Contains("MMC3A")) MMC3Type = EMMC3Type.MMC3A; @@ -201,7 +201,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; case 0x4001: //$C001 - IRQ Clear // does not take immediate effect (fixes Klax) - just_cleared_pending = true; + just_cleared_pending = true; break; case 0x6000: //$E000 - IRQ Acknowledge / Disable irq_enable = false; @@ -247,7 +247,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else IRQ_EQ_Pass(); } - + irq_reload_flag = false; } @@ -272,7 +272,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (oldIrqType) irq_reload_flag = true; } - + just_cleared = just_cleared_pending; just_cleared_pending = false; } @@ -315,7 +315,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } a12_old = a12; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3_Jncota.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3_Jncota.cs index bfb1e3d5b7..23b8845081 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3_Jncota.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3_Jncota.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // unclear if it is readable or has mirrors etc public byte prg_reg; - + public override bool Configure(EDetectionOrigin origin) { //analyze board type @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override void SyncState(Serializer ser) { ser.Sync(nameof(prg_reg), ref prg_reg); - + base.SyncState(ser); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs index d308f53515..f7c69c3e25 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //analyze board type switch (Cart.BoardType) { - case "MAPPER012": + case "MAPPER012": break; default: return false; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs index 3909a01fb1..0d909b2825 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //analyze board type switch (Cart.BoardType) { - case "MAPPER044": + case "MAPPER044": break; default: return false; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs index 0490302fc7..54f073d68b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs @@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES protected override int Get_PRGBank_8K(int addr) { - if (mode) + if (mode) return (mmc3.Get_PRGBank_8K(addr)&0xF) + block * (128 / 8); int block_offset = addr >> 13; return prg * 4 + block_offset; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs index b883a333f3..58a22484cb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Vram = new byte[2048]; - if (Cart.ChrSize == 0 && Cart.BoardType == "MAPPER074") + if (Cart.ChrSize == 0 && Cart.BoardType == "MAPPER074") throw new Exception("Mapper074 carts MUST have chr rom!"); BaseSetup(); return true; @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return Vram[addr & 0x03FF]; } - + if (bank == 0x09) { return Vram[(addr & 0x03FF) + 0x400]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs index 5ba203ef6d..3ebed033b7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.WritePrg(1, value); } break; - case 0x6000: //$E000 + case 0x6000: //$E000 if (value > 0) { base.WritePrg(0x6001, value); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs index 5c0261d96f..052b8551fa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs @@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return prg_page*4 + 3; } - + } protected override int Get_CHRBank_1K(int addr) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs index f9b6e4bcb3..53452f0737 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { bank_8k = exRegs[0] & prg_mask; } - else if (bank_8k == 3 && exRegs[1] > 0) + else if (bank_8k == 3 && exRegs[1] > 0) { bank_8k = exRegs[1] & prg_mask; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs index 57d0ba64e0..e9ecd1a161 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { base.WritePrg(addr, value); } - else + else base.WritePrg(addr, value); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs index 53463eac8a..b9689be2da 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs @@ -3,7 +3,7 @@ internal sealed class Mapper192 : MMC3Board_Base { //http://wiki.nesdev.com/w/index.php/INES_Mapper_192 - + public override bool Configure(EDetectionOrigin origin) { //analyze board type diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs index f11c2caff0..5321ce4dc8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs @@ -15,7 +15,7 @@ } vram_bank_mask_1k = Cart.VramSize / 1 - 1; - + BaseSetup(); return true; } @@ -36,7 +36,7 @@ { Wram[addr - 0x1000] = value; } - + base.WriteExp(addr, value); } @@ -87,7 +87,7 @@ // nothing to write to VROM } } - else + else base.WritePpu(addr, value); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs index e3231e9aa6..8e50b43619 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs @@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } vram_bank_mask_1k = Cart.VramSize / 1 - 1; - + BaseSetup(); mmc3.MirrorMask = 3; @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // nothing to write to VROM } } - else + else base.WritePpu(addr, value); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs index d8a7f6210b..ea727962be 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public Mapper197_MMC3(NesBoardBase board, int num_prg_banks) : base(board, num_prg_banks) { - + } public override void Sync() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs index 7322c61100..1f605cdec8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs @@ -187,7 +187,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { exRegs[mmc3.cmd & 3] = value; } - else + else base.WritePrg(addr, value); } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs index 8c5a24ea0b..5e25110124 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private int prg_mask_8k, chr_mask_1k; - private readonly byte[] regs_sec = { 0, 2, 5, 3, 6, 1, 7, 4 }; + private readonly byte[] regs_sec = { 0, 2, 5, 3, 6, 1, 7, 4 }; /* * I'm not sure where these matrices originated from, but they don't seem to be needed @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_regs_8k[2] = (byte)(0xFE & prg_mask_8k); prg_regs_8k[3] = (byte)(0xFF & prg_mask_8k); - + return true; } @@ -141,7 +141,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr == 0x0001) { exRegs[1] = value; } if (addr == 0x0007) { exRegs[2] = value; mmc3.reg_addr = 0; sync_prg_2(); } } - + base.WriteWram(addr, value); } @@ -203,7 +203,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { SetMirrorType(EMirrorType.Horizontal); - } + } } break; case 0xA001: diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs index 334bfb1b53..3fef34747a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs @@ -172,7 +172,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; } - if (addr>=0x4000) + if (addr>=0x4000) base.WritePrg(addr, value); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs index d5d9641ea8..ba005328ec 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs @@ -103,8 +103,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } break; } - } - else + } + else base.WritePrg(addr, value); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs index 9e9745c4b6..98609b99fb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs @@ -26,7 +26,7 @@ { Wram[addr + 0x4000 - (0x5000 - 0x2000)] = value; } - else + else base.WriteExp(addr, value); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs index 2024d02cae..571cd47fca 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private int prg_mask_8k, chr_mask_1k; - private readonly byte[] regs_sec = { 0, 2, 6, 1, 7, 3, 4, 5 }; + private readonly byte[] regs_sec = { 0, 2, 6, 1, 7, 3, 4, 5 }; public override bool Configure(EDetectionOrigin origin) { @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_regs_8k[2] = (byte)(0xFE & prg_mask_8k); prg_regs_8k[3] = (byte)(0xFF & prg_mask_8k); - + return true; } @@ -134,7 +134,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank &= prg_mask_8k; return Rom[(bank << 13) + (addr & 0x1FFF)]; } - + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs index ce3c5a09be..4d85d72b8a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs @@ -56,7 +56,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } //else // if this address is mapped to chrrom and not chrram, the write just does nothing - //base.WritePPU(addr, value); + //base.WritePPU(addr, value); } else base.WritePpu(addr, value); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs index 38ac62d03f..9af000e9a6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.WritePrg(addr, value); SetMirrorType(mmc3.MirrorType); //often redundant, but gets the job done } - + public override byte[] SaveRam { get @@ -68,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case "KONAMI-TLROM": //Super C case "HVC-TLROM": //8 eyes (J) case "ACCLAIM-TLROM": - + AssertPrg(128, 256, 512); AssertChr(64, 128, 256); AssertVram(0); AssertWram(0); AssertBattery(false); break; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs index a839120285..689f4d3fd1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs @@ -76,7 +76,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES R++; R &= 0x30; } - + break; case 0x102: diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs index c4dd86cd25..ae79c73498 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs @@ -121,7 +121,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { irqenable = false; IrqSignal = true; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs index 055d13ae12..d671fae785 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs @@ -88,11 +88,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private int CHR_AND() { - + if (regs[2]==0) { return 0xFF; - } + } return (0xFF >> ~((regs[2] & 0x0F)|0xF0)); } @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES protected override int MapCHR(int addr) { int bank_1k = Get_CHRBank_1K(addr); - + bank_1k &= CHR_AND(); bank_1k |= CHR_OR(); bank_1k &= chr_mask; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs index d08c7c2a87..3140e5c08e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs @@ -11,11 +11,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES $6000-7FFF: [CCCC PPPP] High CHR, PRG bits $8000-FFFF: [.CCC ...P] Low CHR, PRG bits - + 'C' selects 8k CHR @ $0000 'P' select 32k PRG @ $8000 */ - + //configuration private int prg_bank_mask_32k, chr_bank_mask_8k; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs index 3bcb874959..72a3f07627 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.Vertical); } } - + chr_reg &= ~0x07; chr_reg |= (chr_reg_low_0 | chr_reg_low_1); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs index e722f589cc..f50c3bc726 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { return Rom[addr + prg0 * 0x2000]; - } + } } else if (addr < 0x4000) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs index 63201010ef..60da1f1fc0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs @@ -4,7 +4,7 @@ using BizHawk.Emulation.Cores.Components; namespace BizHawk.Emulation.Cores.Nintendo.NES { - //Mapper 069 is FME7 + //Mapper 069 is FME7 //or, Sunsoft-5, which is FME7 with additional sound hardware internal sealed class Sunsoft_5 : Sunsoft_FME7 @@ -290,6 +290,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Wram[addr] = value; } } - + } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs index 076ffc8ecc..85e8730956 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - internal sealed class Mapper078 : NesBoardBase + internal sealed class Mapper078 : NesBoardBase { private bool holydiver; private int chr; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs index 34589eb75f..43ece4ca7b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs @@ -76,7 +76,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES nt_advanced_control = false; break; case "MAPPER209": - mapper_209 = true; + mapper_209 = true; break; case "MAPPER211": nt_advanced_control = true; @@ -249,7 +249,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetBank(prg_banks, 0, 4, ( bankmode | (prg_regs[3] & 0x3F) )); ram_bank = bankmode | (((prg_regs[3] << 2) + 3) & 0x3F); break; - case 5: + case 5: SetBank(prg_banks, 0, 2, ( bankmode | (prg_regs[1] & 0x1F) )); SetBank(prg_banks, 2, 2, ( bankmode | (prg_regs[3] & 0x1F) )); ram_bank = bankmode | (((prg_regs[3] << 1) + 1) & 0x3F); @@ -331,7 +331,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override void WritePrg(int addr, byte value) { - switch (addr & 0x7007) + switch (addr & 0x7007) { case 0x0000: //0x8000: PRG ROM select case 0x0001: @@ -379,7 +379,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES nt_regs[addr & 3] |= value; SyncNametables(); break; - + case 0x3004: case 0x3005: case 0x3006: @@ -387,7 +387,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES nt_regs[addr & 3] &= 0x00ff; nt_regs[addr & 3] |= (value << 8); SyncNametables(); - break; + break; case 0x4000: //0xC000 IRQ operation if (value.Bit(0)) @@ -396,7 +396,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - goto case 0x4002; + goto case 0x4002; } case 0x4001: //IRQ control irq_count_down = value.Bit(7); @@ -464,7 +464,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { SetMirrorType(EMirrorType.OneScreenA); - } + } break; case 3: if (mapper_035) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs index 111b09c93e..098686ad88 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_regs_8k[3] = 0xFF; prg_regs_8k[2] = 0xFE; - + mmc3 = new MMC3(this, 0x7FFFFFFF); SetMirrorType(Cart.PadH, Cart.PadV); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs index 9154d0d398..d368b4b9cb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs @@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES default: return false; } - + SetMirrorType(Cart.PadH, Cart.PadV); Cart.BoardType = "MAPPER116_HACKY"; @@ -107,7 +107,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES mode = 0; Sync(); - + return true; } @@ -205,7 +205,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if((addr & 0xF000) < 0xB000) addr &= 0xF000; //Garou Densetsu Special depends on this addr -= 0x8000; - vrc2.WritePrg(addr, value); + vrc2.WritePrg(addr, value); break; case 1: mmc3.WritePrg(addr, value); break; case 2: diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs index 1f2fbf6e08..2222520620 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs @@ -3,7 +3,7 @@ // sachen // NROM plus random copy protection circuit - // dancing blocks refuses to run; see comments below + // dancing blocks refuses to run; see comments below internal sealed class Mapper143 : NesBoardBase { public override bool Configure(EDetectionOrigin origin) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs index 3b1141ac41..1f7ab337c8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES DIS23C01 DAOU ROM CONTROLLER, Korea * Metal Force (K) * Buzz and Waldog (K) - * General's Son (K) + * General's Son (K) */ internal sealed class Mapper156 : NesBoardBase { @@ -100,7 +100,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.Vertical); else SetMirrorType(EMirrorType.Horizontal); - break; + break; } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs index edb795c64e..e6e24bfcbc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - internal sealed class Mapper164 : NesBoardBase + internal sealed class Mapper164 : NesBoardBase { // http://wiki.nesdev.com/w/index.php/INES_Mapper_164 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs index 964e7c9bbd..42b6b1f014 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs @@ -154,7 +154,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x2000) // 0x8000 { bank_8k = prg[0] & prg_bank_mask_8k; - + } else if (addr < 0x4000) // 0xA000 { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs index 2f35671312..9d9c408877 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return Vrom[addr]; } else - return base.ReadPpu(addr); + return base.ReadPpu(addr); } public override void WritePrg(int addr, byte value) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs index 6e318fb704..520fbeea01 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/INES_Mapper_193 - internal sealed class Mapper193 : NesBoardBase + internal sealed class Mapper193 : NesBoardBase { private int prg_bank_mask_8k; private byte[] prg_banks_8k = new byte[4]; @@ -55,13 +55,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { case 0: chr_banks_2k[0] = (byte)((value & ~3) >> 1); - chr_banks_2k[1] = (byte)(((value & ~3) >> 1) + 1); + chr_banks_2k[1] = (byte)(((value & ~3) >> 1) + 1); break; case 1: chr_banks_2k[2] = (byte)((value & ~1) >> 1); break; case 2: - chr_banks_2k[3] = (byte)((value & ~1) >> 1); + chr_banks_2k[3] = (byte)((value & ~1) >> 1); break; case 3: prg_banks_8k[0] = value; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs index 20354d2696..df7ce241a2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs @@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return Rom[((_reg >> 1) * 0x8000) + (addr & 0x7FFF)]; } - + return Rom[(_reg * 0x4000) + (addr & 0x3FFF)]; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs index 057673694e..df73230d8f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs @@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank &= prg_bank_mask_16k; ret = Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } - + if ((addr & 0xE010) == 0x6000) { ret |= 0x80; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs index 02a202013f..0ba665bfb4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } /* - if (addr >= 0x3000 && addr < 0x7000) + if (addr >= 0x3000 && addr < 0x7000) { int b = (addr >> 11) - 6; b |= addr >> 1 & 1; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs index d640636644..0c6867216e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs @@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_page |= ((value & 0x1) << 6); } } - + public override byte ReadPrg(int addr) { int baseAddr = resetSwitchMode && resetFlag ? 0x80000 : 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs index 3b1ed6409b..7befdd3706 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs @@ -106,7 +106,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x2000) { - if (_vramProtected) + if (_vramProtected) return; else base.WritePpu(addr, value); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs index b298ecd3b4..1159c119dd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs @@ -40,12 +40,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x4000) { bank = ((_reg & 0x300) >> 3) | ((_reg & 0x1F) << 1) | ((_reg >> 12) & 1); - + } else { bank = ((_reg & 0x300) >> 3) | ((_reg & 0x1F) << 1) | ((_reg >> 12) & 1); - + } return Rom[((bank & _prg16BankMask) * 0x4000) + (addr & 0x3FFF)]; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs index ddf0400bfe..2126df151c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { switch (Cart.BoardType) { - + case "UNIF_BMC-70in1": isLargeBanks = false; break; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs index cfb87140b4..6749d139f5 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs @@ -12,7 +12,7 @@ CHR-ROM: 16KB CHR-RAM: None Battery is not available mirroring - both - * + * * Games: * Wai Xing Zhan Shi (Ch) */ diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs index 5e75811306..a45acfa787 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs @@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return base.ReadPpu(addr); } - } + } } public override byte ReadPrg(int addr) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs index 845fc9ae34..7172140fc9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs @@ -148,7 +148,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return base.ReadPpu(addr); } - + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs index 68d9af674f..fc21338f0a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs @@ -156,7 +156,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x2000) { if (Vram != null) - { + { int x = (addr >> 10) & 7; var chr = chrlo[x] | (chrhi[x] << 8); int bank = (chr & _chrBankMask1k) << 10; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs index d67f8540d2..7effd04e99 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { private bool prg_mode = false; private int chr_reg; - private int prg_reg; + private int prg_reg; public override bool Configure(EDetectionOrigin origin) { @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES default: return false; } - + SetMirrorType(EMirrorType.Vertical); return true; @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } prg_reg = (addr & 0x40) | ((addr >> 8) & 0x3F); - chr_reg = ((addr & 0x1F) << 2) | (value & 0x03); + chr_reg = ((addr & 0x1F) << 2) | (value & 0x03); } public override byte ReadPrg(int addr) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs index 5f5ec24ded..86f23b8a18 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case "TENGEN-800003": // ms pac man, others case "UNIF_NES-NROM-128": // various case "UNIF_NES-NROM-256": // Locksmith - AssertPrg(8, 16, 32); + AssertPrg(8, 16, 32); AssertChr(8); AssertVram(0); AssertWram(0, 8); break; case "AVE-NINA-03": @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // and emulates as simple NROM if (Cart.Chips.Count != 0) return false; - AssertPrg(8, 16, 32); + AssertPrg(8, 16, 32); AssertChr(8); AssertVram(0); AssertWram(0); break; @@ -81,7 +81,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_byte_mask = (Cart.PrgSize*1024) - 1; SetMirrorType(Cart.PadH, Cart.PadV); - + return true; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs index ec8b388a41..a5131b1c9a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs @@ -4,7 +4,7 @@ using BizHawk.Common; //1. Have a hardcoded NSF driver rom loaded to 0x3800 //2. Have fake registers at $3FFx for the NSF driver to use //3. These addresses are chosen because no known NSF could possibly use them for anything. -//4. Patch the PRG with our own IRQ vectors when the NSF play and init routines aren't running. +//4. Patch the PRG with our own IRQ vectors when the NSF play and init routines aren't running. // That way we can use NMI for overall control and cause our code to be the NMI handler without breaking the NSF data by corrupting the last few bytes //NSF: @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //------------------------------ //configuration - + internal NSFFormat nsf; /// @@ -98,10 +98,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES for (int i = 0; i < 8; i++) { int bank = nsf.BankswitchInitValues[i]; - + //discard out of range bankswitches.. for example, Balloon Fight is 3120B but has initial bank settings set to 0,0,0,0,0,1,0 if (bank * 4096 > nsf.NSFData.Length - 0x80) - bank = 0; + bank = 0; InitBankSwitches[i] = (byte)bank; if (bank != 0) @@ -182,7 +182,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //kevtris's reset process seems not to work. dunno what all is going on in there - //our own innovation, should work OK.. + //our own innovation, should work OK.. NES.apu.NESSoftReset(); //mostly fceux's guidance @@ -244,7 +244,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Suspend vector patching //3800:LDA $3FF3 0xAD,0xF3,0x3F, - + //Initialize stack pointer //3803:LDX #$FF 0xA2,0xFF, @@ -258,35 +258,35 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES 0xF0,0x09, //Read the next song (resetting the player) and PAL flag into A and X and then call the INIT routine - //380B:LDA $3FF1 + //380B:LDA $3FF1 0xAD,0xF1,0x3F, //380E:LDX $3FF2 0xAE,0xF2,0x3F, //3811:JSR INIT - 0x20,0x00,0x00, + 0x20,0x00,0x00, //Fall through to: //@Play - call PLAY routine with X and Y cleared (this is not supposed to be required, but fceux did it) - //3814:LDA #$00 + //3814:LDA #$00 0xA9,0x00, //3816:TAX 0xAA, //3817:TAY 0xA8, //3818:JSR PLAY - 0x20,0x00,0x00, - + 0x20,0x00,0x00, + //Resume vector patching and infinite loop waiting for next NMI //381B:LDA $3FF4 0xAD,0xF4,0x3F, //381E:BCC $XX1E - 0x90,0xFE, + 0x90,0xFE, //@ResetVector - just set up an infinite loop waiting for the first NMI //3820:CLC 0x18, - //3821:BCC $XX24 - 0x90,0xFE, + //3821:BCC $XX24 + 0x90,0xFE, }; public override void AtVsyncNmi() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs index 7772852f52..819ea41cd8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs @@ -16,11 +16,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES * Mirroring varies by type: * 175: Hardwired mirroring (H/V) * 340: Simple mirroring control through $E000. - * + * * Nesdev mentions that the 340 has no WRAM, but that's because no games * on the 340 ever used it. (In fact, only 1 (?) 175 game has wram). * In any event, WRAM write protect is different than on 129/163. - * + * * This should be mapper 210, with mapper 19 being 129/163, but you know how * mapper numbers are. To complicate things, some 175/340 games run correctly * on a 163 because they make compatibility writes to both sets of mirroring regs. diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs index c2014895c6..9309d9802a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs @@ -6,7 +6,7 @@ Quinty (J) Namcot Mahjong 3 Dragon Spirit - Aratanaru Densetsu - + This is the same as Mapper206, with the following exception: CHR support is increased to 128KB by connecting PPU's A12 line to the CHR ROM's A16 line. For example, mask the CHR ROM 1K bank output from the mapper by $3F, and then OR it with $40 if the PPU address was >= $1000. diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs index dfe3f91da6..45f32843a8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs @@ -1,6 +1,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - //pretty much just one game. + //pretty much just one game. //wires the mapper outputs to control the nametables. check out the companion board TLSROM internal sealed class Mapper095 : Namcot108Board_Base { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs index 32a63a317b..198c3aa92b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override void WritePrg(int addr, byte value) { - + switch (addr & 0x6001) { case 0x0000: //$8000 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs index 6233c0e4a8..a20ba98e46 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (NES._isVS) { - // The game VS Castlevania apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values + // The game VS Castlevania apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values addr &= 0x2FFF; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs index d60d34165a..2050528601 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs @@ -5,12 +5,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // http://wiki.nesdev.com/w/index.php/INES_Mapper_163 internal sealed class NanJing : NesBoardBase { - /* + /* * China Pirate Stuff. Not very tested. - * + * * switches prg in 32K blocks, uses exp space for io ports * 8k wram, 8k vram, supports swapping 4k blocks of vram at scanline 128 - * + * * TODO: The mapper telepathically switches VRAM based on scanline. * For more accurate emulation, the actual method used to count scanlines * (MMC3?) must be implemented. @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return Rom[(prg << 15) | addr]; } - + /* public override void WritePRG(int addr, byte value) { @@ -140,7 +140,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x2000) { - + if ((reg1 & 0x80) != 0 && NES.ppu.ppur.status.rendering && NES.ppu.PPUON) { if (NES.ppu.ppur.status.sl <= 128) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs index 013ff63849..f4db551559 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs @@ -90,7 +90,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - // make sure you have bank-masked the map + // make sure you have bank-masked the map protected int ApplyMemoryMap(int blockSizeBits, byte[] map, int addr) { int bank = addr >> blockSizeBits; @@ -181,7 +181,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } public virtual byte ReadExp(int addr) - { + { return NES.DB; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs index 2db19a8527..21cdb1ad2a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case "NES-PEEOROM": AssertPrg(128); AssertChr(128); AssertWram(0); AssertVram(0); break; - + case "HVC-FKROM": //fire emblem mmc4 = true; AssertPrg(256); AssertChr(128); AssertWram(8); AssertVram(0); @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return false; } - + prg_bank_mask_8k = Cart.PrgSize / 8 - 1; chr_bank_mask_4k = Cart.ChrSize / 4 - 1; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SEEPROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SEEPROM.cs index f8b3babd1e..c7f273ee9b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SEEPROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SEEPROM.cs @@ -161,7 +161,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // master didn't acknowledge. what to do? } - Console.WriteLine("{1:x2} <= rom[{0:x2}]", Addr, Data); + Console.WriteLine("{1:x2} <= rom[{0:x2}]", Addr, Data); Addr++; Addr &= (byte)(rom.Length - 1); Data = rom[Addr]; @@ -185,7 +185,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES PullDown = false; } - + public void WriteByte(byte val) { OutEnable = val.Bit(7); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs index e034a97cfa..8dfed7e625 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs @@ -167,7 +167,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // similar in some ways to 8259ABC, but different // fceumm combines the code to implement them; i think that's too messy - + // this mapper is stupid and was most certainly made for 1 game. it has an awkward // chr mapping that can only support up to 32KiB chr rom, and it uses it to show // a few famous persons portraits while playing a stupid block game diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs index 9094750f55..9a4041a888 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs @@ -7,7 +7,7 @@ * a second set of compatibility writes to a different set of registers to * make it run on "Mapper 93" (they were perhaps anticipating putting the * mask roms on a different board?? - * + * * In any event, here is how it's actually emulated. */ diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs index 731f27057f..a92c01f9fe 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs @@ -153,7 +153,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(14, prg_banks_16k, addr); - return Rom[addr]; + return Rom[addr]; } public override byte ReadPpu(int addr) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs index c2bd7c0396..c541666c32 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES AssertPrg(128); AssertChr(256); AssertVram(0); AssertWram(0); break; case "SUNSOFT-4": - AssertPrg(128); AssertChr(128,256); AssertVram(0); AssertWram(0,8); + AssertPrg(128); AssertChr(128,256); AssertVram(0); AssertWram(0,8); break; case "UNIF_NES-NTBROM": AssertPrg(128 + 16); AssertChr(128); Cart.WramSize = 8; Cart.VramSize = 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs index 8e7638db50..e238f6d765 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs @@ -281,14 +281,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (_is_snrom) { if (!mmc1.wram_disable && chr_wram_enable) - return base.ReadWram(addr); + return base.ReadWram(addr); else - return NES.DB; + return NES.DB; } else { return base.ReadWram(addr); - } + } } public override byte ReadPrg(int addr) @@ -340,7 +340,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else return base.ReadPpu(addr); - + } } @@ -392,7 +392,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (NES._isVS) ser.Sync("VS_CIRAM", ref CIRAM_VS, false); } - + public override bool Configure(EDetectionOrigin origin) { switch (Cart.BoardType) @@ -426,7 +426,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(Cart.PadH, Cart.PadV); break; case "NES-SAROM": //dragon warrior - AssertPrg(64); AssertChr(16, 32, 64); AssertVram(0); AssertWram(8); + AssertPrg(64); AssertChr(16, 32, 64); AssertVram(0); AssertWram(8); break; case "NES-SBROM": //dance aerobics AssertPrg(64); AssertChr(16, 32, 64); AssertVram(0); AssertWram(0); @@ -490,7 +490,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case "HVC-SLRROM": AssertPrg(128); AssertChr(128); AssertVram(0); AssertWram(0); break; - case "HVC-SMROM": //Hokkaidou Rensa Satsujin: Okhotsu ni Shoyu + case "HVC-SMROM": //Hokkaidou Rensa Satsujin: Okhotsu ni Shoyu AssertPrg(256); AssertChr(0); AssertVram(8); AssertWram(0); break; case "HVC-SNROM": // Morita Kazuo no Shougi (J) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs index 344e85e50a..90ba987bdd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs @@ -13,12 +13,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // regenerable state private readonly int[] prg_banks_8k = new int[4]; private readonly int[] chr_banks_1k = new int[8]; - + // state private int[] regs = new int[16]; private int address; private bool chr_1k, chr_mode, prg_mode; - + // irq private int irq_countdown; private int a12_old; @@ -77,7 +77,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private void Sync() { SyncIRQ(); - + if (prg_mode) { prg_banks_8k[0] = regs[0xF] & prg_bank_mask_8k; @@ -226,9 +226,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_countdown_2 = 9; } } - + } - + irq_counter--; if (irq_counter==0) { @@ -236,7 +236,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { irq_countdown_2 = 9; } - + irq_counter = irq_reload + 1; } @@ -262,10 +262,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_counter--; if (irq_enable) { - + if (irq_counter==0) irq_countdown_2 = 9; - } + } } */ } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs index 08e9713e39..866d3eb919 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs @@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (delay > 0) { - + delay--; if(delay==0 && irq_pending) board.IrqSignal = true; @@ -156,7 +156,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_regs_1k[2] = (byte)(value * 2); chr_regs_1k[3] = (byte)(value * 2 + 1); break; - + case 0x2000: //$A000 [CCCC CCCC] CHR Reg 2 (1k @ $1000) chr_regs_1k[4] = value; break; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs index c0fb15f540..85f217d86d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /* * Registers should be masked with $ff7f. - * + * * $7e70: 2k chr @ PPU $0000 (lsb ignored) * $7e71: 2k chr @ PPU $0800 (lsb ignored) * $7e72: 1k chr @ PPU $1000 @@ -30,13 +30,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES * $7e7a,$7e7b: 8k prg @ cpu $8000 * $7e7c,$7e7d: 8k prg @ cpu $a000 * $7e7e,$7e7f: 8k prg @ cpu $c000 - * + * * $7f00:$7f7f: 128 bytes internal prg ram, mirrored on CPU A7 - * + * * 8k prg @ cpu $e000 is fixed to last 8k of rom. * in TLSROM-like mode (mapper 207), mirroring reg is ignored, * and top bit of CHR regs (normally CHRROM A17) is used as CIRAM A10 - * + * */ internal sealed class TAITO_X1_005 : NesBoardBase @@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.Vertical); chr_bank_mask = Cart.ChrSize / 1 - 1; prg_bank_mask = Cart.PrgSize / 8 - 1; - + // the chip has 128 bytes of WRAM built into it, which we have to instantiate ourselves Cart.WramSize = 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs index b23efb8e08..808d317ad7 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs @@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x4000) { bank = basebank | (regs[0] & 6) | 0; - + } else { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs index e3faf71399..553bcb62cd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs @@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - + if (addr < 0x4000) { int bank = (_prgReg & 0x30) >> 1 | _prgReg & 7; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs index 561dabed23..7590cc40d9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs @@ -20,10 +20,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return false; } - + _prgMask32k = (Cart.PrgSize - 8) / 32 - 1; - // Last 8k of Prg goes into 6000-7FFF + // Last 8k of Prg goes into 6000-7FFF _wramOffset = ((Cart.PrgSize - 8) / 32) * 0x8000; SetMirrorType(EMirrorType.Vertical); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs index 0a875596e0..ff16ebe278 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs @@ -78,7 +78,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int b = ((reg[0] >> 1) & 0x0F); return Rom[offset + (b << 15) + addr]; - } + } } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs index 736cc040f8..4578d6bdb4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs @@ -83,7 +83,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(dip_switch_setting), ref dip_switch_setting); } - private void UpdateChr() + private void UpdateChr() { for (int i = 0; i < 8; i++) { @@ -239,7 +239,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { int bank_1k = addr >> 10; bank_1k = _chrRegs1K[bank_1k]; - + if ((exRegs[0] & 0x40) > 0) addr = (bank_1k << 13) | (addr & 0x1FFF); else diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs index 7d909b8482..497ab8eb1c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else - Vram[addr] = value; + Vram[addr] = value; } protected override int Get_CHRBank_1K(int addr) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs index d29a792746..17be5101b9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES switch (addr) { case 0x4022: - if (Rom.Length > 0x10000) { prg = (value & 0x01) << 2; } + if (Rom.Length > 0x10000) { prg = (value & 0x01) << 2; } break; case 0x4122: @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { irqenable = false; IrqSignal = true; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs index 0a72456802..0704c26a4b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES switch (Cart.BoardType) { case "MAPPER0002-00": - //probably a mistake. + //probably a mistake. //but (for chrram): "Use of $00 with no CHR ROM implies that the game is wired to map nametable memory in CHR space. The value $00 MUST NOT be used if a mapper isn't defined to allow this. " //well, i'm not going to do that now. we'll save it for when it's needed //"it's only mapper 218 and no other mappers" @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; case "NES-UNROM": //mega man - case "HVC-UNROM": + case "HVC-UNROM": case "KONAMI-UNROM": case "NES-UNEPROM": // proto case "IREM-UNROM": @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES AssertPrg(128); AssertChr(0); AssertVram(8); //AssertWram(0); //JJ - Tobidase Daisakusen Part 2 (J) includes WRAM break; - + case "HVC-UN1ROM": AssertPrg(128); AssertChr(0); AssertWram(0); AssertVram(8); adjust_prg = (x) => ((x >> 2) & 7); @@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (NES._isVS) { - // The game VS Castlevania apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values + // The game VS Castlevania apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values addr &= 0x2FFF; @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (NES.IsVS) { ser.Sync("VS_CIRAM", ref CIRAM_VS, false); - } + } } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs index a251a0c48d..38b6d58599 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { ser.Sync("VS_CIRAM", ref CIRAM_VS, false); } - + for (int i = 0; i < 2; i++) ser.Sync("chr_regs_4k_" + i, ref chr_regs_4k[i]); if (ser.IsReader) @@ -107,16 +107,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return CIRAM_VS[addr - 0x800]; } - } + } else return base.ReadPpu(addr); } - + } public override void WritePpu(int addr, byte value) { - // The game VS Goonies apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values + // The game VS Goonies apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values addr &= 0x2FFF; if (NES._isVS) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs index 50b7bcb433..3a46c4e267 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs @@ -15,11 +15,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private static readonly byte[] Masks = new byte[16 * 16]; // what is the resulting 8 bit chr reg value ANDed with? private static readonly byte[] A10s = new byte[16 * 16]; // and then what is it ORed with? - private static readonly byte[] PTables = + private static readonly byte[] PTables = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x80,0xc0,0x81,0xc1,0x82,0xc2,0x83,0xc3, - 0x00,0x01,0x02,0x03,0x84,0xc4,0x85,0xc5, + 0x00,0x01,0x02,0x03,0x84,0xc4,0x85,0xc5, }; private static void GetBankByte(int b003, int banknum, out byte bank, out byte mask, out byte a10) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs index 331a050d3c..500ec2e3e3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs @@ -251,7 +251,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SyncIRQ(); break; - + case 0x7001: //(ack) irq_pending = false; irq_enabled = irq_autoen; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs index 85ac8a353b..752fd5b525 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return CIRAM_VS[addr-0x800]; } - + } } @@ -115,13 +115,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return Rom[(addr & 0x1FFF) + ((NES.VS_prg_reg*4) << 13)]; } else - return Rom[addr]; + return Rom[addr]; } else { return Rom[addr]; } - + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BootGodDB.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BootGodDB.cs index 10d759d04a..99daeca01d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BootGodDB.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BootGodDB.cs @@ -116,7 +116,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES currCart.WramBattery = true; break; } - } else + } else if (xmlReader.NodeType == XmlNodeType.EndElement && xmlReader.Name == "board") { state = 4; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs index 508e0fd061..529545b4ff 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ms.Close(); diskimage = ms.ToArray(); } - + this.diskimage = diskimage; diskdiffs = new byte[NumSides][]; } @@ -274,7 +274,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES timer_irq_active = false; } } - + break; case 0x0023: diskenable = (value & 1) != 0; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSAudio.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSAudio.cs index 2534cf1e01..3a3fcdf9d3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSAudio.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDSAudio.cs @@ -285,7 +285,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES volumeclock = 0; volumespd = value & 63; if (r4080_7) // envelope is off, so written value gets sent to gain directly - volumegain = value & 63; + volumegain = value & 63; break; case 0x4082: frequency &= 0xf00; @@ -344,7 +344,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES modtable[modtablepos] = (byte)(value & 7); modtablepos++; modtablepos &= 63; - } + } break; case 0x4089: switch (value & 3) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/RamAdapter.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/RamAdapter.cs index 4473a2e221..96f3b706e4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/RamAdapter.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/RamAdapter.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES crc = CCITT_8(crc, data[i]); } dest.WriteByte((byte)(crc & 0xff)); - dest.WriteByte((byte)(crc >> 8)); + dest.WriteByte((byte)(crc >> 8)); } private static byte[] FixFDSSide(byte[] inputdisk) @@ -327,12 +327,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /* "It's a spring which will pull the reading head next to the outer edge of * the disk (you can clearly hear a click when this happens), so it's hard to * know exactly, but it's almost instantaneous (compared to the 6-7 seconds - * required for moving in the other direction)."*/ + * required for moving in the other direction)."*/ cycleswaiting = 535000; break; } } - + /// /// data write reg /// @@ -372,7 +372,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { transferreset = false; } - + if ((cached4025 & 0x40) == 0 && (value & 0x40) != 0) { lookingforendofgap = true; @@ -594,7 +594,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((cached4025 & 0x10) != 0) { //Console.WriteLine("FDS: write clear CRC", readreg, diskpos); - + if (crc == 0) { cached4025 &= unchecked((byte)~0x10); // clear CRC reading diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 66fb4c88f1..f278913bb6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -40,13 +40,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private int sprdma_countdown; public bool _irq_apu; //various irq signals that get merged to the cpu irq pin - + /// /// Clock speed of the main cpu in hz. Used to time audio synthesis, which runs off the cpu clock. /// public int cpuclockrate { get; private set; } - //user configuration + //user configuration public int[] palette_compiled = new int[64 * 8]; //variable set when VS system games are running @@ -348,7 +348,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES while (ppu.ppudead > 0) { ppu.NewDeadPPU(); - } + } } else { @@ -370,7 +370,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ppu.TickPPU_preVBL(); } } - + if (lagged) { _lagcount++; @@ -396,7 +396,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public bool current_strobe; public bool new_strobe; - // this function will run one step of the ppu + // this function will run one step of the ppu // it will return whether the controller is read or not. public void do_single_step(IController controller, out bool cont_read, out bool frame_done) { @@ -468,7 +468,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES WriteMemory(0x2004, oam_dma_byte); } oam_dma_index++; - if (oam_dma_index == 512) + if (oam_dma_index == 512) { oam_dma_exec = false; } @@ -478,7 +478,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES cpu_deadcounter--; } } - + dmc_realign = false; ///////////////////////////// @@ -496,7 +496,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { dmc_realign = true; } - + // By this point the cpu should be frozen, if it is not, then we are in a multi-write opcode, add another cycle delay if (!cpu.RDY && !cpu.rdy_freeze && (apu.dmc_dma_countdown == apu.DMC_RDY_check)) { @@ -559,7 +559,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (apu.dmc.sample_length != 0) { apu.dmc.fill_glitch = true; - } + } } if ((apu.dmc.timer == 4) && (apu.dmc.out_bits_remaining == 0) && (apu.dmc.sample_length == 1)) @@ -610,7 +610,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES reread_opp_4016 = 0; reread_opp_4017 = 0; reread_trigger = false; - } + } if (!cpu.RDY && !dmc_dma_exec && !oam_dma_exec) { @@ -839,7 +839,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private void write_joyport(byte value) { //Console.WriteLine("cont " + value + " frame " + Frame); - + var si = new StrobeInfo(latched4016, value); ControllerDeck.Strobe(si, _controller); latched4016 = value; @@ -1011,14 +1011,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (cheat_addresses[i] == addr) { - if (cheat_compare_type[i] == 0) - { - ret = cheat_value[i]; + if (cheat_compare_type[i] == 0) + { + ret = cheat_value[i]; } else if ((cheat_compare_type[i] == 1) && (ret == cheat_compare_val[i])) { ret = cheat_value[i]; - } + } } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ICodeDataLogger.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ICodeDataLogger.cs index d3aa311e5d..deab05a98f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ICodeDataLogger.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ICodeDataLogger.cs @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private void RunCDL(ushort address, CDLog_Flags flags) { - + CDLog_MapResults results = Board.MapMemory(address, false); switch (results.Type) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index d1d4dc49bf..eef17e7d3b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -355,7 +355,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES LoadWriteLine("Loading as NSF"); var nsf = new NSFFormat(); nsf.WrapByteArray(file); - + cart = new CartInfo(); var nsfboard = new NSFBoard(); nsfboard.Create(this); @@ -526,7 +526,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (choice.WramSize == -1) choice.WramSize = 0; } } - + //if this is still null, we have to try it some other way. nescartdb perhaps? if (choice == null) { @@ -540,7 +540,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES origin = EDetectionOrigin.BootGodDB; } } - + } //if choice is still null, try UNIF and iNES @@ -787,4 +787,4 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //http://wiki.nesdev.com/w/index.php/Cartridge_connector //a mappers list -//http://tuxnes.sourceforge.net/nesmapper.txt +//http://tuxnes.sourceforge.net/nesmapper.txt diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs index bd4c8937f6..cae66ef08c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs @@ -950,7 +950,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int x = c.AxisValue("0Pen X"); int y = c.AxisValue("0Pen Y"); // http://forums.nesdev.com/viewtopic.php?p=19454#19454 - // it almost feels like the hardware guys got the request for + // it almost feels like the hardware guys got the request for // a tablet that returned x in [0, 255] and y in [0, 239] and then // accidentally flipped the whole thing sideways x = (x + 8) * 240 / 256; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs index e047175ea0..22cb107484 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NSFFormat.cs @@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public ushort SpeedPAL; public bool IsNTSC; - + public bool IsPAL; [Flags] @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES var ms = new MemoryStream(data); var br = new BinaryReader(ms); br.BaseStream.Position += 5; - + Version = br.ReadByte(); TotalSongs = br.ReadByte(); StartingSong = br.ReadByte(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs index 65acf18577..ea679148df 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs @@ -65,42 +65,42 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public static readonly int[] PaletteLuma2C03 = { - 27, 9, 3, 22, 9, 11, 16, 20, 18, 14, 19, 25, 14, 0, 0, 0, - 45, 23, 17, 12, 14, 16, 13, 30, 27, 27, 25, 34, 28, 0, 0, 0, - 63, 42, 37, 35, 18, 37, 39, 45, 50, 44, 45, 52, 49, 0, 0, 0, - 63, 52, 48, 50, 43, 48, 54, 59, 60, 55, 54, 52, 50, 0, 0, 0, + 27, 9, 3, 22, 9, 11, 16, 20, 18, 14, 19, 25, 14, 0, 0, 0, + 45, 23, 17, 12, 14, 16, 13, 30, 27, 27, 25, 34, 28, 0, 0, 0, + 63, 42, 37, 35, 18, 37, 39, 45, 50, 44, 45, 52, 49, 0, 0, 0, + 63, 52, 48, 50, 43, 48, 54, 59, 60, 55, 54, 52, 50, 0, 0, 0, }; public static readonly int[] PaletteLuma2C04_1 = { - 48, 35, 13, 37, 28, 14, 18, 16, 63, 27, 45, 11, 9, 50, 18, 63, - 42, 45, 12, 44, 50, 48, 54, 17, 52, 52, 0, 3, 54, 36, 18, 9, - 1, 52, 50, 45, 49, 14, 34, 14, 0, 20, 43, 16, 12, 3, 39, 0, - 0, 27, 45, 19, 55, 22, 58, 30, 12, 23, 25, 9, 60, 37, 27, 54, + 48, 35, 13, 37, 28, 14, 18, 16, 63, 27, 45, 11, 9, 50, 18, 63, + 42, 45, 12, 44, 50, 48, 54, 17, 52, 52, 0, 3, 54, 36, 18, 9, + 1, 52, 50, 45, 49, 14, 34, 14, 0, 20, 43, 16, 12, 3, 39, 0, + 0, 27, 45, 19, 55, 22, 58, 30, 12, 23, 25, 9, 60, 37, 27, 54, }; public static readonly int[] PaletteLuma2C04_2 = { - 0, 45, 27, 55, 54, 37, 28, 52, 13, 12, 60, 43, 63, 35, 50, 25, - 12, 42, 16, 54, 34, 44, 3, 37, 18, 18, 1, 52, 48, 18, 0, 22, - 9, 54, 39, 50, 23, 12, 45, 3, 14, 52, 27, 14, 17, 0, 50, 63, - 45, 9, 45, 30, 14, 9, 16, 27, 0, 49, 20, 58, 48, 11, 19, 36, + 0, 45, 27, 55, 54, 37, 28, 52, 13, 12, 60, 43, 63, 35, 50, 25, + 12, 42, 16, 54, 34, 44, 3, 37, 18, 18, 1, 52, 48, 18, 0, 22, + 9, 54, 39, 50, 23, 12, 45, 3, 14, 52, 27, 14, 17, 0, 50, 63, + 45, 9, 45, 30, 14, 9, 16, 27, 0, 49, 20, 58, 48, 11, 19, 36, }; public static readonly int[] PaletteLuma2C04_3 = { - 14, 37, 54, 45, 25, 63, 52, 14, 9, 0, 54, 18, 16, 54, 45, 50, - 37, 28, 11, 17, 27, 27, 30, 34, 27, 22, 0, 3, 13, 16, 43, 48, - 35, 12, 1, 58, 9, 45, 39, 63, 44, 9, 42, 18, 23, 36, 0, 12, - 49, 3, 55, 50, 20, 45, 50, 18, 19, 0, 48, 60, 12, 52, 52, 14, + 14, 37, 54, 45, 25, 63, 52, 14, 9, 0, 54, 18, 16, 54, 45, 50, + 37, 28, 11, 17, 27, 27, 30, 34, 27, 22, 0, 3, 13, 16, 43, 48, + 35, 12, 1, 58, 9, 45, 39, 63, 44, 9, 42, 18, 23, 36, 0, 12, + 49, 3, 55, 50, 20, 45, 50, 18, 19, 0, 48, 60, 12, 52, 52, 14, }; public static readonly int[] PaletteLuma2C04_4 = { - 27, 22, 28, 50, 0, 48, 9, 30, 45, 12, 45, 1, 54, 58, 25, 55, - 37, 3, 17, 43, 0, 18, 16, 39, 45, 34, 37, 27, 9, 0, 54, 42, - 11, 19, 20, 3, 12, 14, 27, 16, 14, 54, 23, 12, 9, 60, 36, 18, - 50, 63, 18, 13, 52, 52, 63, 50, 0, 45, 35, 52, 44, 48, 49, 14, + 27, 22, 28, 50, 0, 48, 9, 30, 45, 12, 45, 1, 54, 58, 25, 55, + 37, 3, 17, 43, 0, 18, 16, 39, 45, 34, 37, 27, 9, 0, 54, 42, + 11, 19, 20, 3, 12, 14, 27, 16, 14, 54, 23, 12, 9, 60, 36, 18, + 50, 63, 18, 13, 52, 52, 63, 50, 0, 45, 35, 52, 44, 48, 49, 14, }; private int[] _currentLuma = PaletteLumaNES; @@ -208,7 +208,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //power-up palette verified by blargg's power_up_palette test. //he speculates that these may differ depending on the system tested.. - //and I don't see why the ppu would waste any effort setting these.. + //and I don't see why the ppu would waste any effort setting these.. //but for the sake of uniformity, we'll do it. PALRAM = new byte[] { 0x09,0x01,0x00,0x01,0x00,0x02,0x02,0x0D,0x08,0x10,0x08,0x24,0x00,0x00,0x04,0x2C, @@ -368,7 +368,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private void runppu() { - //run one ppu cycle at a time so we can interact with the ppu and clockPPU at high granularity + //run one ppu cycle at a time so we can interact with the ppu and clockPPU at high granularity if (install_2006 > 0) { install_2006--; @@ -438,6 +438,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES nes.Board.ClockPpu(); } _totalCycles += 1; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs index 8c8fe4d50b..9b695877a3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs @@ -1,4 +1,4 @@ -//blargg: Reading from $2007 when the VRAM address is $3fxx will fill the internal read buffer with the contents at VRAM address $3fxx, in addition to reading the palette RAM. +//blargg: Reading from $2007 when the VRAM address is $3fxx will fill the internal read buffer with the contents at VRAM address $3fxx, in addition to reading the palette RAM. //static const byte powerUpPalette[] = //{ @@ -351,7 +351,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Console.WriteLine("reread 2002"); } */ - + // reading from $2002 resets the destination for $2005 and $2006 writes vtoggle = false; Reg2002_vblank_active = 0; @@ -384,7 +384,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { return (byte)((Reg2002_vblank_active << 7) | (Reg2002_objhit << 6) | (Reg2002_objoverflow << 5) | (0x1D)); } - + } if (nes._isVS2c05 == 3) { @@ -433,8 +433,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //some of the OAM bits are unwired so we mask them out here //otherwise we just write this value and move on to the next oam byte - value &= 0xE3; - } + value &= 0xE3; + } if (ppur.status.rendering) { // don't write to OAM if the screen is on and we are in the active display area @@ -448,13 +448,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { OAM[reg_2003] = value; reg_2003++; - } + } } else { OAM[reg_2003] = value; reg_2003++; - } + } } private byte read_2004() @@ -542,7 +542,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ppur._ht = value & 31; // testing indicates that this operation is delayed by 3 pixels - //ppur.install_latches(); + //ppur.install_latches(); install_2006 = 3; } @@ -593,13 +593,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //see comments in $2006 if (ppur.status.sl >= 241 || !PPUON) - nes.Board.AddressPpu(ppur.get_2007access()); + nes.Board.AddressPpu(ppur.get_2007access()); } private byte read_2007() { int addr = ppur.get_2007access() & 0x3FFF; - int bus_case = 0; + int bus_case = 0; //ordinarily we return the buffered values byte ret = VRAMBuffer; @@ -654,7 +654,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - + public byte ReadReg(int addr) { byte ret_spec; @@ -683,14 +683,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (nes.cpu.TotalExecutedCycles == double_2007_read) { - return ppu_open_bus; - } + return ppu_open_bus; + } else { ret_spec = read_2007(); double_2007_read = nes.cpu.TotalExecutedCycles + 1; } - + if (nes.do_the_reread_2007 > 0) { ret_spec = read_2007(); @@ -741,7 +741,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES default: throw new InvalidOperationException(); } } - + private enum DecayType { None = 0, // if there is no action, decrement the timer diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs index 5505ef1a7d..9f93dbd297 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public byte pt_0, pt_1; } - private BGDataRecord[] bgdata = new BGDataRecord[34]; + private BGDataRecord[] bgdata = new BGDataRecord[34]; public short[] xbuf = new short[256 * 240]; @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //tack on the deemph bits. THESE MAY BE ORDERED WRONG. PLEASE CHECK IN THE PALETTE CODE xbuf[target - 1] = (short)(pixelcolor_latch_1 | reg_2001.intensity_lsl_6); } - + pixelcolor_latch_1 = pixelcolor; } @@ -231,8 +231,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES yp = ppur.status.sl - 1; ppuphase = PPU_PHASE_BG; - // "If PPUADDR is not less then 8 when rendering starts, the first 8 bytes in OAM are written to from - // the current location of PPUADDR" + // "If PPUADDR is not less then 8 when rendering starts, the first 8 bytes in OAM are written to from + // the current location of PPUADDR" if (ppur.status.sl == 0 && PPUON && reg_2003 >= 8 && region == Region.NTSC) { for (int i = 0; i < 8; i++) @@ -266,10 +266,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ///////////////////////////////////////////// // Sprite Evaluation Start ///////////////////////////////////////////// - + if (sprite_eval_cycle < 64) { - // the first 64 cycles of each scanline are used to initialize sceondary OAM + // the first 64 cycles of each scanline are used to initialize sceondary OAM // the actual effect setting a flag that always returns 0xFF from a OAM read // this is a bit of a shortcut to save some instructions // data is read from OAM as normal but never used @@ -280,7 +280,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } // otherwise, scan through OAM and test if sprites are in range - // if they are, they get copied to the secondary OAM + // if they are, they get copied to the secondary OAM else { if (sprite_eval_cycle == 64) @@ -304,7 +304,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (sprite_eval_write) { - //look for sprites + //look for sprites if (spr_true_count == 0 && soam_index < 8) { soam[soam_index * 4] = read_value; @@ -316,7 +316,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //a flag gets set if sprite zero is in range if (oam_index == reg_2003) { sprite_zero_in_range = true; } - + spr_true_count++; soam_m_index++; } @@ -333,7 +333,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES soam_index++; if (soam_index == 8) { - // oam_index could be pathologically misaligned at this point, so we have to find the next + // oam_index could be pathologically misaligned at this point, so we have to find the next // nearest actual sprite to work on >8 sprites per scanline option oam_index_aux = (oam_index % 4) * 4; } @@ -383,7 +383,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - read_value = soam[0]; //writes change to reads + read_value = soam[0]; //writes change to reads } } else @@ -393,7 +393,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES oam_index += 4; } } - + ///////////////////////////////////////////// // Sprite Evaluation End ///////////////////////////////////////////// @@ -401,11 +401,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int pixel = 0, pixelcolor = PALRAM[pixel]; //process the current clock's worth of bg data fetching - //this needs to be split into 8 pieces or else exact sprite 0 hitting wont work + //this needs to be split into 8 pieces or else exact sprite 0 hitting wont work // due to the cpu not running while the sprite renders below if (PPUON) { Read_bgdata(xp, xt + 2); } //according to qeed's doc, use palette 0 or $2006's value if it is & 0x3Fxx - //at one point I commented this out to fix bottom-left garbage in DW4. but it's needed for full_nes_palette. + //at one point I commented this out to fix bottom-left garbage in DW4. but it's needed for full_nes_palette. //solution is to only run when PPU is actually OFF (left-suppression doesnt count) else { @@ -441,7 +441,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int s = sl_sprites[xt * 8 + xp]; int spixel = sl_sprites[256 + xt * 8 + xp]; int temp_attr = sl_sprites[512 + xt * 8 + xp]; - + //TODO - make sure we don't trigger spritehit if the edges are masked for either BG or OBJ //spritehit: //1. is it sprite#0? @@ -525,8 +525,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //check all the conditions that can cause things to render in these 8px renderspritenow = show_obj_new && (xt > 0 || reg_2001.show_obj_leftmost); - } - + } + if (ppur.status.cycle > 63) { if (ppu_was_on_spr && !PPUON) @@ -535,7 +535,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES reg_2003++; } } - + ppu_was_on_spr = PPUON; } else @@ -549,7 +549,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { ppu_was_on = true; if (ppur.status.cycle == 255) { race_2006 = true; } - + } if (xp == 7 && PPUON) @@ -609,7 +609,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { while (oam_index_aux < 64 && soam_index_aux < 64) { - //look for sprites + //look for sprites soam[soam_index_aux * 4] = OAM[oam_index_aux * 4]; if (yp >= OAM[oam_index_aux * 4] && yp < OAM[oam_index_aux * 4] + spriteHeight) { @@ -1029,7 +1029,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ppu_init_frame(); nes.frame_is_done = true; - } + } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/LibQuickNES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/LibQuickNES.cs index bb19e0ef59..2ba914f2c9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/LibQuickNES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/LibQuickNES.cs @@ -231,7 +231,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES if (s == "Unsupported mapper" || s == "Not an iNES file" // Not worth making a new exception for the iNES error, they ultimately are the same problem || s == " truncated file" // This is a garbage rom not worth anyone's time but at least NesHawk handles these better, and these occur before the core has a chance to assess an unsupported mapper - ) + ) { throw new Common.UnsupportedGameException(CoreNames.QuickNes + " unsupported mapper"); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs index 66cbdbb0df..b025cd9858 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs @@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES // Adding set of gamepad buttons (P1) AddButtons(GamepadButtons[0]); - + break; case Port1PeripheralOption.FourScore: @@ -173,8 +173,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES ("P1 Select", 0b0000_0000_0000_0000_0000_0000_0000_0100u), ("P1 B", 0b0000_0000_0000_0000_0000_0000_0000_0010u), ("P1 A", 0b0000_0000_0000_0000_0000_0000_0000_0001u), - }, - new[] { + }, + new[] { ("P2 Up", 0b0000_0000_0000_0000_0000_0000_0001_0000u), ("P2 Down", 0b0000_0000_0000_0000_0000_0000_0010_0000u), ("P2 Left", 0b0000_0000_0000_0000_0000_0000_0100_0000u), @@ -566,7 +566,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES "7A7BCA9A30A9F1B8AD3B45FA7DD7C8C180F53640", // Jetsons, The - Cogswell's Caper! (U) [t1] NES "123045D5E8CF038C2FD396BD266EEF96DAFF9BCD", // Jikuu Yuuden - Debias (J) [o1] "123045D5E8CF038C2FD396BD266EEF96DAFF9BCD", // Jikuu Yuuden - Debias (J) [!] - "76DB18B90FB2B76FA685D6462846ED3A92F5CBD4", // Joe and Mac (U) [!] + "76DB18B90FB2B76FA685D6462846ED3A92F5CBD4", // Joe and Mac (U) [!] "7E1C9F23BF9BECB7831459598339A4DC9A3CECFC", // Joe and Mac (E) [!] "A654DE12A59D07BAFF30DD6CB5E1AD05EB20B2D7", // Jumpy Demo by Rwin (PD) "DE42818873470458DF29F515A193F536A0642EA8", // Kamikaze Mario DX Plus V1 diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_Enums.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_Enums.cs index 6fa1dcd33c..0d35cea458 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_Enums.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_Enums.cs @@ -5,7 +5,7 @@ public enum eMessage : int { eMessage_NotSet, - + eMessage_Resume, eMessage_QUERY_FIRST, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs index fbd6d418c5..417600c7f9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES if (IsSGB) { - // NOTE: CGB has 32K of wram, and DMG has 8KB of wram. Not sure how to control this right now.. bsnes might not have any ready way of doign that? I couldnt spot it. + // NOTE: CGB has 32K of wram, and DMG has 8KB of wram. Not sure how to control this right now.. bsnes might not have any ready way of doign that? I couldnt spot it. // You wouldnt expect a DMG game to access excess wram, but what if it tried to? maybe an oversight in bsnes? MakeMemoryDomain("SGB WRAM", LibsnesApi.SNES_MEMORY.SGB_WRAM, MemoryDomain.Endian.Little); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs index 93b9ce2c4d..8b34fde9d0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.ISettable.cs @@ -185,7 +185,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Sameboy public SameboySettings Clone() => (SameboySettings)MemberwiseClone(); - public int[] GetCustomPalette() + public int[] GetCustomPalette() => (int[])_customPal.Clone(); public void SetCustomPalette(int[] pal) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs index fad2dd0fd3..f2fca09f79 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk bool ret = pass_a_frame; - if (pass_a_frame) + if (pass_a_frame) { // clear the screen as needed if (_GBCore.ppu.clear_screen) @@ -67,10 +67,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk } // reset the frame cycle counter - frame_cycle = 0; + frame_cycle = 0; } current_cycle = 0; - + _isLag = _GBCore._islag; if (_isLag) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs index 8efb2640d6..5dcb92f32d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk [CoreConstructor(VSystemID.Raw.GBC, Priority = CorePriority.SuperLow)] public SubGBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBHawk.GBHawk.GBSettings settings, GBHawk.GBHawk.GBSyncSettings syncSettings) { - + var subGBSettings = settings ?? new GBHawk.GBHawk.GBSettings(); var subGBSyncSettings = syncSettings ?? new GBHawk.GBHawk.GBSyncSettings(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs index ca97323400..a190ac9e8a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs @@ -86,7 +86,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk current_cycle = 0; _nesCore.cpu.ext_ppu_cycle = current_cycle; } - + _isLag = _nesCore.lagged; if (_isLag) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs index ee4eb3ac3c..78c848eaa8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk _tracer = new TraceBuffer(TRACE_HEADER); ser.Register(_tracer); - + var barCodeService = _nesCore.ServiceProvider.GetService(); if (barCodeService != null) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs index c7d2ffe1ed..9169e79603 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ADPCM.cs @@ -186,7 +186,7 @@ namespace BizHawk.Emulation.Cores.PCEngine private bool nibble; private int magnitude; - private static readonly int[] StepSize = + private static readonly int[] StepSize = { 0x0002, 0x0006, 0x000A, 0x000E, 0x0012, 0x0016, 0x001A, 0x001E, 0x0002, 0x0006, 0x000A, 0x000E, 0x0013, 0x0017, 0x001B, 0x001F, diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ISettable.cs index 65310a0b25..598c9ac0d5 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.ISettable.cs @@ -58,8 +58,8 @@ namespace BizHawk.Emulation.Cores.PCEngine // these three require core reboot to use public bool SpriteLimit { get; set; } - public bool EqualizeVolume { get; set; } - public bool ArcadeCardRewindHack{ get; set; } + public bool EqualizeVolume { get; set; } + public bool ArcadeCardRewindHack{ get; set; } public PCESettings Clone() => (PCESettings)MemberwiseClone(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 1f4bdeeb96..c24aaed34a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -297,7 +297,7 @@ namespace BizHawk.Emulation.Cores.PCEngine // 2) The games which have custom HBlankPeriods work without it, the override only // serves to clean up minor gfx anomalies. // 3) There's no point in haxing the timing with incorrect values in an attempt to avoid this. - // The proper fix is cycle-accurate/bus-accurate timing. That isn't coming to the C# + // The proper fix is cycle-accurate/bus-accurate timing. That isn't coming to the C# // version of this core. Let's just acknolwedge that the timing is imperfect and fix // it in the least intrusive and most honest way we can. if (game["HBlankPeriod"]) diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs index add4bab4af..69a64cbbff 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/ScsiCDBus.cs @@ -194,7 +194,7 @@ namespace BizHawk.Emulation.Cores.PCEngine // Idunno, maybe they do come in a sector at a time. // note to vecna: maybe not at the sector level, but at a level > 1 sample and <= 1 sector, samples come out in blocks - // due to the way they are jumbled up (seriously, like put into a blender) for error correction purposes. + // due to the way they are jumbled up (seriously, like put into a blender) for error correction purposes. // we may as well assume that the cd audio decoding magic works at the level of one sector, but it isnt one sample. if (SectorsLeftToRead == 0) @@ -412,7 +412,7 @@ namespace BizHawk.Emulation.Cores.PCEngine // to happen before reading is complete // 175000 fixes 4 in 1 CD, loading Gate of Thunder // which expects a certain number of timer interrupts to happen before loading is complete - DataReadWaitTimer = pce.Cpu.TotalExecutedCycles + 175000; + DataReadWaitTimer = pce.Cpu.TotalExecutedCycles + 175000; pce.CDAudio.Stop(); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs index a00973094f..80f5d0c27c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.PCEngine + ActiveLine is the current offset into the framebuffer. 0 is the first line of active display, and the last value will be BufferHeight-1. + BackgroundY is the current offset into the scroll plane. It is set with BYR - register at certain sync points and incremented every scanline. + register at certain sync points and incremented every scanline. Its values range from 0 - $1FF. + RCRCounter is set to $40 at the first line of active display, and incremented each scanline thereafter. diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs index d6a5f8fa5a..fada72efc0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs @@ -132,7 +132,7 @@ namespace BizHawk.Emulation.Cores.PCEngine { VDC1.ScanLine = ScanLine; VDC2.ScanLine = ScanLine; - + int VBlankLine = ActiveDisplayStartLine + VDC1.Registers[VDW] + 1; if (VBlankLine > 261) VBlankLine = 261; diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VecnaSynchronizer.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VecnaSynchronizer.cs index 262e53abec..7c50452b08 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VecnaSynchronizer.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VecnaSynchronizer.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Components // Like BufferedAsync, it tries to make most frames 100% correct and just suck it up // periodically and have a big bad-sounding mistake frame if it has to. - // It is significantly less ambitious and elaborate than the other methods. + // It is significantly less ambitious and elaborate than the other methods. // We'll see if it works better or not! // It has a min and maximum amount of excess buffer to deal with minor overflows. diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs index 27a5be3134..23511e75fb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs @@ -127,7 +127,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink R_NMI_CD = 256; //R.Cpu.NonMaskableInterrupt = true; } - } + } } if (L.p4_read) @@ -296,7 +296,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink public int[] GetVideoBuffer() { - return _vidbuffer; + return _vidbuffer; } public void FillVideoBuffer() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs index ba4f53afc4..2ca77759c6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink ser.Register(L); ser.Register(this); - ser.Register(this); + ser.Register(this); _tracer = new TraceBuffer(L.Cpu.TraceHeader); ser.Register(_tracer); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/EEPROM.93c46.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/EEPROM.93c46.cs index 7ccb69acb7..fa1ce065a4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/EEPROM.93c46.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/EEPROM.93c46.cs @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem private EEPROMWriteMode WriteMode = EEPROMWriteMode.Instruction; private EEPROMReadMode ReadMode = EEPROMReadMode.Hold; private EEPROMFlags Flags = 0; - + public byte Read(byte[] saveRAM) { switch (ReadMode) @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem // repeat old value byte bit = (byte)((saveRAM[Address % saveRAM.Length] >> (7 - BitsRead)) & 1); - + return (byte)((byte)(Flags | EEPROMFlags.Clock) | bit); default: // ready/busy flag is always ready in this emulation diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.CodeMasters.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.CodeMasters.cs index d6d69bc521..1755b9f582 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.CodeMasters.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.CodeMasters.cs @@ -54,7 +54,7 @@ private byte ReadMemoryCMRam(ushort address) { - if (address < 0x4000) + if (address < 0x4000) return RomData[(RomBank0 * BankSize) + address]; if (address < 0x8000) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_A.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_A.cs index 7cd44c6b4a..7538fde51c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_A.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_A.cs @@ -1,7 +1,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem { public partial class SMS - { + { private byte ReadMemorySG_EX_A(ushort address) { byte ret; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_B.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_B.cs index 28936fc499..65de90f582 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_B.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.SG_EX_B.cs @@ -1,7 +1,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem { public partial class SMS - { + { private byte ReadMemorySG_EX_B(ushort address) { byte ret; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.Sega.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.Sega.cs index 0ffd7ddd62..161a6d7303 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.Sega.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/MemoryMap.Sega.cs @@ -122,7 +122,7 @@ if (address >= 0xC000) SystemRam[address & RamSizeMask] = value; - else if (address >= 0x8000) + else if (address >= 0x8000) { if (SaveRAM != null) { @@ -157,7 +157,7 @@ else { RomBank2 = (byte)(value % RomBanks); - } + } } return; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ICodeDataLogger.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ICodeDataLogger.cs index 2bff47bd6c..78e0f15907 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ICodeDataLogger.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.ICodeDataLogger.cs @@ -32,8 +32,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem public enum CDLog_AddrType { None, - ROM, - MainRAM, + ROM, + MainRAM, SaveRAM, CartRAM, //"Cart (Volatile) RAM" aka ExtRam } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.Input.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.Input.cs index 0a476501e4..4cd9a8e33b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.Input.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.Input.cs @@ -33,7 +33,7 @@ value &= _controllerDeck.ReadPort1_c2(_controller); PostsetControllerState(1); - + if (!IsGameGear_C && SyncSettings.UseKeyboard) { // 7 represents ordinary controller reads @@ -50,7 +50,7 @@ value &= (byte)~(1 << bit); } } - } + } } return value; @@ -125,7 +125,7 @@ const int phaserRadius = 4; // specifically lightgun needs to do things on a per-line basis - if (!IsGameGear_C) + if (!IsGameGear_C) { if (SyncSettings.Port1 == SMSControllerTypes.Phaser) { @@ -242,4 +242,4 @@ } } } -} +} diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index 92ffbd94c1..2a1bc3e152 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -3,11 +3,11 @@ using BizHawk.Emulation.Cores.Components; using BizHawk.Emulation.Cores.Components.Z80A; /***************************************************** - TODO: + TODO: + HCounter (Manually set for light phaser emulation... should be only case it's polled) - + Try to clean up the organization of the source code. + + Try to clean up the organization of the source code. + Mode 1 not implemented in VDP TMS modes. (I don't have a test case in SG1000 or Coleco) - + **********************************************************/ namespace BizHawk.Emulation.Cores.Sega.MasterSystem @@ -165,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem { throw new MissingFirmwareException("No BIOS found"); } - + if (!game["RequireBios"] && !SyncSettings.UseBios) { // we are skipping the BIOS @@ -352,7 +352,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem port &= 0xFF; if (port < 0x40) // General IO ports { - + switch (port) { case 0x00: if (stand_alone) { return ReadPort0(); } else { _lagged = false; return cntr_rd_0; } @@ -380,7 +380,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem else return Vdp.ReadVdpStatus(); } - switch (port) + switch (port) { case 0xC0: case 0xDC: if (stand_alone) { return ReadControls1(); } else { _lagged = false; return cntr_rd_1; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMSControllerDeck.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMSControllerDeck.cs index 88fb1c6f3e..21d40c9107 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMSControllerDeck.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMSControllerDeck.cs @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem Port1 = ControllerCtors[controller1](1); Port2 = ControllerCtors[controller2](2); - if (!use_keyboard) + if (!use_keyboard) { Definition = new ControllerDefinition(Port1.Definition.Name) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.Mode4.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.Mode4.cs index d8c2b6c8a9..243f4d2e65 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.Mode4.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.Mode4.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem { if (ScanLine >= FrameHeight) return; - + if (!DisplayOn) { for (int x = 0; x < 256; x++) @@ -142,9 +142,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem x -= 8; int y = VRAM[SpriteBase + i] + 1; - if (y == 209 && FrameHeight == 192) + if (y == 209 && FrameHeight == 192) break; // 208 is special terminator sprite (in 192-line mode) - if (y >= (EnableLargeSprites ? 240 : 248)) + if (y >= (EnableLargeSprites ? 240 : 248)) y -= 256; if (y + SpriteHeight <= ScanLine || y > ScanLine) @@ -174,7 +174,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem if (SpriteCollisionBuffer[x + xs] != 0) { if (collisionHappens) - StatusByte |= 0x20; // Set Collision bit + StatusByte |= 0x20; // Set Collision bit } else if (renderHappens && ScanlinePriorityBuffer[x + xs] == 0) { @@ -221,9 +221,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem x -= 8; int y = VRAM[SpriteBase + i] + 1; - if (y == 209 && FrameHeight == 192) + if (y == 209 && FrameHeight == 192) break; // terminator sprite - if (y >= (EnableLargeSprites ? 240 : 248)) + if (y >= (EnableLargeSprites ? 240 : 248)) y -= 256; if (y + (SpriteHeight * 2) <= ScanLine || y > ScanLine) @@ -270,7 +270,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem // Renders left-blanking. Should be done per scanline, not per-frame. internal void RenderLineBlanking(bool render) { - if (!LeftBlanking || ScanLine >= FrameHeight || !render) + if (!LeftBlanking || ScanLine >= FrameHeight || !render) return; int ofs = ScanLine * 256; @@ -315,7 +315,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem for (int y=0; y public enum FileIDType { - None, + None, Multiple, //don't think this makes sense. shouldn't the multiple options be returned? Disc, //an unknown disc PSX, PSX_EXE, PSF, - PSP, + PSP, Saturn, MegaCD, PCE, SGX, TurboCD, @@ -35,10 +35,10 @@ namespace BizHawk.Emulation.Cores COL, SG, SMS, GG, S32X, SMD, //http://en.wikibooks.org/wiki/Genesis_Programming#ROM_header - + WS, WSC, NGC, - C64, + C64, ZXSpectrum, AmstradCPC, INT, @@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Cores //audio codec formats WAV, APE, MPC, FLAC, MP3, //can't be ID'd very readily.. - + //misc disc-related files: ECM, @@ -151,7 +151,7 @@ namespace BizHawk.Emulation.Cores /// public FileIDResults Identify(IdentifyParams p) { - IdentifyJob job = new IdentifyJob() { + IdentifyJob job = new IdentifyJob() { Stream = p.SeekableStream, Disc = p.Disc }; @@ -265,7 +265,7 @@ namespace BizHawk.Emulation.Cores { public static readonly SimpleMagicRecord INES = new SimpleMagicRecord { Offset = 0, Key = "NES" }; public static readonly SimpleMagicRecord UNIF = new SimpleMagicRecord { Offset = 0, Key = "UNIF" }; - public static SimpleMagicRecord NSF = new SimpleMagicRecord { Offset = 0, Key = "NESM\x1A" }; + public static SimpleMagicRecord NSF = new SimpleMagicRecord { Offset = 0, Key = "NESM\x1A" }; public static readonly SimpleMagicRecord FDS_HEADERLESS = new SimpleMagicRecord { Offset = 0, Key = "\x01*NINTENDO-HVC*" }; public static readonly SimpleMagicRecord FDS_HEADER = new SimpleMagicRecord { Offset = 0, Key = "FDS\x1A" }; @@ -381,7 +381,7 @@ namespace BizHawk.Emulation.Cores { "G64", new ExtensionInfo(FileIDType.C64, null ) }, { "CRT", new ExtensionInfo(FileIDType.C64, null ) }, { "NIB", new ExtensionInfo(FileIDType.C64, null ) }, //not supported yet - + // Doom IWad / PWad { "WAD", new ExtensionInfo(FileIDType.WAD, null ) }, @@ -569,7 +569,7 @@ namespace BizHawk.Emulation.Cores private static FileIDResult Test_A78(IdentifyJob job) { int len = (int)job.Stream.Length; - + //we may have a header to analyze if (len % 1024 == 128) { @@ -609,7 +609,7 @@ namespace BizHawk.Emulation.Cores //for PSX, we have a magic word to look for. //it's at 0x24E0 with a mode2 (2352 byte) track 1. - //what if its 2048 byte? + //what if its 2048 byte? //i found a ".iso" which was actually 2352 byte sectors.. //found a hilarious ".bin.iso" which was actually 2352 byte sectors //so, I think it's possible that every valid PSX disc is mode2 in the track 1 diff --git a/src/BizHawk.Emulation.Cores/Libretro/Libretro.ISaveRam.cs b/src/BizHawk.Emulation.Cores/Libretro/Libretro.ISaveRam.cs index f72e54b3b9..52e9a22125 100644 --- a/src/BizHawk.Emulation.Cores/Libretro/Libretro.ISaveRam.cs +++ b/src/BizHawk.Emulation.Cores/Libretro/Libretro.ISaveRam.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Libretro { private readonly List _saveramAreas = new(); private long _saveramSize = 0; - + public bool SaveRamModified => _saveramSize > 0; public byte[] CloneSaveRam() diff --git a/src/BizHawk.Emulation.Cores/Sound/CDAudio.cs b/src/BizHawk.Emulation.Cores/Sound/CDAudio.cs index 08cb480c18..7d8142012a 100644 --- a/src/BizHawk.Emulation.Cores/Sound/CDAudio.cs +++ b/src/BizHawk.Emulation.Cores/Sound/CDAudio.cs @@ -3,7 +3,7 @@ using BizHawk.Emulation.Common; using BizHawk.Emulation.DiscSystem; // The state of the cd player is quantized to the frame level. -// This isn't ideal. But life's too short. +// This isn't ideal. But life's too short. // I decided not to let the perfect be the enemy of the good. // It can always be refactored. It's at least deterministic. @@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Cores.Components return; StartLBA = Disc.Session1.Tracks[track].LBA; - + //play until the beginning of the next track (?) EndLBA = Disc.Session1.Tracks[track + 1].LBA; diff --git a/src/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs b/src/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs index 69144f9b3a..798a4de867 100644 --- a/src/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs +++ b/src/BizHawk.Emulation.Cores/Sound/DualSyncSound.cs @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Sound _right.GetSamplesSync(out var sampr, out var nsampr); int n = Math.Min(nsampl + _leftOverflowCount, nsampr + _rightOverflowCount); - + if (_samp.Length < n * 2) _samp = new short[n * 2]; diff --git a/src/BizHawk.Emulation.Cores/Sound/MMC5Audio.cs b/src/BizHawk.Emulation.Cores/Sound/MMC5Audio.cs index 9107858d48..c473ba93b0 100644 --- a/src/BizHawk.Emulation.Cores/Sound/MMC5Audio.cs +++ b/src/BizHawk.Emulation.Cores/Sound/MMC5Audio.cs @@ -163,7 +163,7 @@ namespace BizHawk.Emulation.Cores.Components } private readonly Pulse[] pulse = new Pulse[2]; - + /// 0x5000..0x5015 public void WriteExp(int addr, byte val) { diff --git a/src/BizHawk.Emulation.Cores/Sound/SN76489sms.cs b/src/BizHawk.Emulation.Cores/Sound/SN76489sms.cs index d751292594..5bafaf2c81 100644 --- a/src/BizHawk.Emulation.Cores/Sound/SN76489sms.cs +++ b/src/BizHawk.Emulation.Cores/Sound/SN76489sms.cs @@ -191,7 +191,7 @@ namespace BizHawk.Emulation.Cores.Components noise_bit = noise.Bit(0); if (noise_type) { - noise = (((noise & 1) ^ ((noise >> 3) & 1)) << 15) | (noise >> 1); + noise = (((noise & 1) ^ ((noise >> 3) & 1)) << 15) | (noise >> 1); } else { @@ -215,9 +215,9 @@ namespace BizHawk.Emulation.Cores.Components noise_clock = Chan_tone[2] + 1; } - noise_clock *= 2; + noise_clock *= 2; } - + if (clock_A == 0) { A_up = !A_up; diff --git a/src/BizHawk.Emulation.Cores/Sound/SyncSoundMixer.cs b/src/BizHawk.Emulation.Cores/Sound/SyncSoundMixer.cs index dbf53e2af1..d55d344ab4 100644 --- a/src/BizHawk.Emulation.Cores/Sound/SyncSoundMixer.cs +++ b/src/BizHawk.Emulation.Cores/Sound/SyncSoundMixer.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Components /// /// Bizhawk expects ISoundProviders to output at 44100KHz, so this is what SyncSoundMixer does. Therefore, try to make /// sure that your child ISoundProviders also do this I guess. - /// + /// /// This is currently used in the ZX Spectrum and CPC cores but others may find it useful in future /// public sealed class SyncSoundMixer : ISoundProvider diff --git a/src/BizHawk.Emulation.Cores/Sound/YM2413.cs b/src/BizHawk.Emulation.Cores/Sound/YM2413.cs index 7d13017f2a..919db6a435 100644 --- a/src/BizHawk.Emulation.Cores/Sound/YM2413.cs +++ b/src/BizHawk.Emulation.Cores/Sound/YM2413.cs @@ -1,4 +1,4 @@ -// Credits: +// Credits: // Original emulator written by Mitsutaka Okazaki 2001. // Original conversion to C# by Ben Ryves. @@ -89,18 +89,18 @@ namespace BizHawk.Emulation.Cores.Components 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, + 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 @@ -318,9 +318,9 @@ namespace BizHawk.Emulation.Cores.Components private static readonly uint[, ,] dphaseTable = new uint[512, 8, 16]; /*************************************************** - + Create tables - + ****************************************************/ private static int Min(int i, int j) { @@ -1275,8 +1275,8 @@ namespace BizHawk.Emulation.Cores.Components return DB2LIN_TABLE[(noise != 0 ? DB_NEG(0.0) : DB_NEG(15.0)) + slot.egout]; } - /* - TOP-CYM + /* + TOP-CYM */ private static int calc_slot_cym(OPLL_SLOT slot, uint pgout_hh) { @@ -1296,8 +1296,8 @@ namespace BizHawk.Emulation.Cores.Components return DB2LIN_TABLE[dbout + slot.egout]; } - /* - HI-HAT + /* + HI-HAT */ private static int calc_slot_hat(OPLL_SLOT slot, int pgout_cym, uint noise) { diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs index f8002171ca..e609a20e4b 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs @@ -109,7 +109,7 @@ namespace BizHawk.Emulation.Cores.Waterbox continue; var devices = portInfo.Devices; - + var device = devices.Find(a => a.ShortName == deviceName); if (device == null) { diff --git a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs index 2cc6c6093d..257f55e9e3 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs @@ -142,7 +142,7 @@ namespace BizHawk.Emulation.Cores.Waterbox int nread = stream.Read(buff, 0, 4096); if (nread == 0) break; - + int* p = (int*)bp; int* pend = p + nread / sizeof(int); while (p < pend) diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs index 8dbe94aed7..dcfddf124f 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores new ButtonSchema(286, 18, "-"), new ButtonSchema(307, 18, "="), new ButtonSchema(331, 18, "Delete"), - + /************************** Row 2 **************************/ new ButtonSchema(10, 42, "Tab") { DisplayName = " Tab " }, new ButtonSchema(52, 42, "Q"), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs index bf70d98592..f1b8ce9177 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs @@ -31,8 +31,8 @@ namespace BizHawk.Emulation.Cores new ButtonSchema(60, 35, controller, "Forward", "U"), new ButtonSchema(60, 57, controller, "Back", "D"), new ButtonSchema(38, 57, controller, "Left", "L"), - new ButtonSchema(85, 57, controller, "Right", "R"), - + new ButtonSchema(85, 57, controller, "Right", "R"), + new ButtonSchema(10, 80, controller, "Pull", "PULL"), new ButtonSchema(92, 80, controller, "Push", "PUSH") diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs index e370755b4e..a4449bfe97 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs @@ -69,9 +69,9 @@ namespace BizHawk.Emulation.Cores Buttons = new[] { ButtonSchema.Up(14, 12, controller), - ButtonSchema.Down(14, 56, controller), - ButtonSchema.Left(2, 34, controller), - ButtonSchema.Right(24, 34, controller), + ButtonSchema.Down(14, 56, controller), + ButtonSchema.Left(2, 34, controller), + ButtonSchema.Right(24, 34, controller), new ButtonSchema(122, 34, controller, "B"), new ButtonSchema(146, 34, controller, "A"), new ButtonSchema(52, 34, controller, "Select", "s"), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs index d47bb90c9f..6a7c91df51 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs @@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores new ButtonSchema(195, 104, "K"), new ButtonSchema(220, 104, "L"), - + new ButtonSchema(33, 134, "Z"), new ButtonSchema(58, 134, "X"), new ButtonSchema(83, 134, "C"), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs index 1d316ccbcc..279f62cb3e 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs @@ -227,7 +227,7 @@ namespace BizHawk.Emulation.Cores MinValue = AxisRange.Min, MaxValue = AxisRange.Max }, - + new ButtonSchema(400, 15, controller, "Start"), new ButtonSchema(360, 58, controller, "L"), new ButtonSchema(460, 58, controller, "R"), diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs index 1ce8fe013f..9cf3ac85d4 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs @@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores int txtLength = b.DisName.Length; int btnSize = System.Convert.ToInt32(stdButtonWidth * b.WidthFactor); - + string disp = b.DisName; if (txtLength == 1) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs b/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs index 5f2b6bebae..bc4f6fea69 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscExtensions.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.DiscSystem //--- load the disc in a context which will let us abort if it's going to take too long var discMountJob = new DiscMountJob(fromPath: path, slowLoadAbortThreshold: 8); discMountJob.Run(); - + if (discMountJob.OUT_SlowLoadAborted) { errorCallback("This disc would take too long to load. Run it through DiscoHawk first, or find a new rip because this one is probably junk"); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_RawFile.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_RawFile.cs index 8d56d051c3..a8b97f15c8 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_RawFile.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/Blob_RawFile.cs @@ -19,13 +19,13 @@ namespace BizHawk.Emulation.DiscSystem public readonly long Offset = 0; private BufferedStream fs; - + public void Dispose() { fs?.Dispose(); fs = null; } - + public int Read(long byte_pos, byte[] buffer, int offset, int count) { //use quite a large buffer, because normally we will be reading these sequentially but in small chunks. @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.DiscSystem fs.Position = target; return fs.Read(buffer, offset, count); } - + public long Length { get; private set; } } } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs index 388fa3525e..e8b6b7b00b 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CCD_format.cs @@ -68,7 +68,7 @@ namespace BizHawk.Emulation.DiscSystem { EntryNum = entryNum; } - + /// /// these should be 0-indexed /// @@ -282,7 +282,7 @@ namespace BizHawk.Emulation.DiscSystem var entryNum = int.Parse(section.Name.Split(' ')[1]); var entry = new CCDTocEntry(entryNum); ccdf.TOCEntries.Add(entry); - + entry.Session = section.FetchOrFail("SESSION"); entry.Point = section.FetchOrFail("POINT"); entry.ADR = section.FetchOrFail("ADR"); @@ -379,12 +379,12 @@ namespace BizHawk.Emulation.DiscSystem for (var i = 1; i < disc.Sessions.Count; i++) { var session = disc.Sessions[i]; - + sw.WriteLine("[Session {0}]", i); sw.WriteLine("PreGapMode=2"); sw.WriteLine("PreGapSubC=1"); sw.WriteLine(); - + for (var j = 0; j < session.RawTOCEntries.Count; j++) { var entry = session.RawTOCEntries[j]; @@ -412,7 +412,7 @@ namespace BizHawk.Emulation.DiscSystem sw.WriteLine("PLBA={0}", entry.QData.AP_Timestamp - 150); //remember to adapt the absolute MSF to an LBA (this field is redundant...) sw.WriteLine(); } - + //this is nonsense, really. the whole CCD track list shouldn't be needed. //but in order to make a high quality CCD which can be inspected by various other tools, we need it //now, regarding the indexes.. theyre truly useless. having indexes written out with the tracks is bad news. @@ -456,7 +456,7 @@ namespace BizHawk.Emulation.DiscSystem var imgBlob = (IBlob) job.Disc.DisposableResources[0]; var subBlob = (IBlob) job.Disc.DisposableResources[1]; //Read_2442(job.LBA, job.DestBuffer2448, job.DestOffset); - + //read the IMG data if needed if ((job.Parts & ESectorSynthPart.UserAny) != 0) { @@ -584,7 +584,7 @@ namespace BizHawk.Emulation.DiscSystem //analyze the RAWTocEntries to figure out what type of track track 1 is var tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job(disc.Session1.RawTOCEntries); tocSynth.Run(); - + //Add sectors for the mandatory track 1 pregap, which isn't stored in the CCD file //We reuse some CUE code for this. //If we load other formats later we might should abstract this even further (to a synthesizer job) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs index e4d5cbc2c9..6b73e0c8a5 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CDI_format.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.DiscSystem /// The track blocks /// public readonly List Tracks = [ ]; - + /// /// The disc info block /// @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.DiscSystem /// public byte NumTracks; } - + /// /// Represents a track/disc info block header from a CDI track /// @@ -152,7 +152,7 @@ namespace BizHawk.Emulation.DiscSystem /// public uint SessionType; } - + /// /// Represents a disc info block from a CDI file /// @@ -392,7 +392,7 @@ namespace BizHawk.Emulation.DiscSystem { throw new CDIParseException("Malformed CDI format: Total track number mismatch!"); } - + if (stream.Position != stream.Length - 4) { //throw new CDIParseException("Malformed CDI format: Did not reach end of footer after parsing!"); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs index 4d16e0ca22..4d780de3cf 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Compile.cs @@ -89,7 +89,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE public int BlobIndex; public int Number; public int Session; - + /// /// A track that's final in a file gets its length from the length of the file; other tracks lengths are determined from the succeeding track /// @@ -337,7 +337,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE { if (curr_track == null) return; - + //normalize: if an index 0 is missing, add it here if (curr_track.Indexes[0].Number != 0) { @@ -368,7 +368,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE //spill cdtext data into this track curr_cdtext = curr_track.CDTextData; - + curr_track.BlobIndex = curr_blobIndex; curr_track.Session = curr_session; curr_track.Number = trackCommand.Number; diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_File.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_File.cs index de22923b81..d17dec72ba 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_File.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_File.cs @@ -156,7 +156,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE public override string ToString() => $"TRACK {Number,2} ({Type})"; } - + // This doesn't exist officially, rather it is derived from special REM comments // Consider this an "extension" perhaps? public readonly struct SESSION : Command diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs index 568f35458b..ae12294a63 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs @@ -148,7 +148,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE //if (cct.IsFinalInFile) //{ // //length is determined from length of file - + //} } } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs index 0f5da9cb65..a75cc2a92e 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Parse.cs @@ -145,7 +145,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE var clp = new CueLineParser(line); var key = clp.ReadToken().ToUpperInvariant(); - + //remove nonsense at beginning if (!IN_Strict) { @@ -319,7 +319,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE OUT_CueFile.Commands.Add(new CUE_File.Command.SESSION(number)); break; } - + OUT_CueFile.Commands.Add(new CUE_File.Command.REM(comment)); break; } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs index a77d1e7bfc..bc876c80e1 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs @@ -115,7 +115,7 @@ namespace BizHawk.Emulation.DiscSystem public AHeader Parse(Stream stream) { var bc = EndianBitConverter.CreateForLittleEndian(); - + var header = new byte[88]; _ = stream.Read(header, offset: 0, count: header.Length); // stream size checked at callsite @@ -469,7 +469,7 @@ namespace BizHawk.Emulation.DiscSystem // looks like each filename string is 6 bytes with a trailing \0 fname = new byte[6]; } - + // read the filename var bytesRead2 = stream.Read(fname, offset: 0, count: fname.Length); @@ -520,7 +520,7 @@ namespace BizHawk.Emulation.DiscSystem } } - + // build custom session object aFile.ParsedSession = new(); foreach (var s in aSessions.Values) @@ -619,7 +619,7 @@ namespace BizHawk.Emulation.DiscSystem { public MDSParseException(string message) : base(message) { } } - + public class LoadResults { @@ -667,7 +667,7 @@ namespace BizHawk.Emulation.DiscSystem if (!File.Exists(file)) throw new MDSParseException($"Malformed MDS format: nonexistent image file: {file}"); - //mount the file + //mount the file var mdfBlob = new Blob_RawFile { PhysicalPath = file }; var dupe = false; @@ -741,7 +741,7 @@ namespace BizHawk.Emulation.DiscSystem var BlobIndex = MountBlobs(loadResults.ParsedMDSFile, disc); var mdsf = loadResults.ParsedMDSFile; - + //generate DiscTOCRaw items from the ones specified in the MDS file var curSession = 1; disc.Sessions.Add(new() { Number = curSession }); @@ -754,7 +754,7 @@ namespace BizHawk.Emulation.DiscSystem curSession = entry.Session; disc.Sessions.Add(new() { Number = curSession }); } - + disc.Sessions[curSession].RawTOCEntries.Add(EmitRawTOCEntry(entry)); } @@ -873,7 +873,7 @@ namespace BizHawk.Emulation.DiscSystem } // pregap processing completed } - + // create track sectors var currBlobOffset = track.TrackOffset; for (var sector = session.StartSector; sector <= session.EndSector; sector++) @@ -908,7 +908,7 @@ namespace BizHawk.Emulation.DiscSystem sBase.BlobOffset = currBlobOffset; currBlobOffset += track.SectorSize; - + // add subchannel data relMSF++; #if false diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs index d5d22e77ce..7b91ca69d9 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/NRG_format.cs @@ -1017,7 +1017,7 @@ namespace BizHawk.Emulation.DiscSystem var relMSF = -(track.TrackStartFileOffset - track.PregapFileOffset) / track.SectorSize; var trackNumBcd = BCD2.FromDecimal(startTrack + j); var cueIndexes = nrgf.Cues[i].TrackIndices.Where(t => t.Track == trackNumBcd).ToArray(); - + // do the pregap var pregapCueIndex = cueIndexes[0]; for (var k = track.PregapFileOffset; k < track.TrackStartFileOffset; k += track.SectorSize) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs b/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs index 0b7c7b450e..1ca61c08a5 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscIdentifier.cs @@ -107,7 +107,7 @@ namespace BizHawk.Emulation.DiscSystem /// Yes, that one /// SonyPS2, - + /// /// Atari Jaguar CD /// @@ -311,7 +311,7 @@ namespace BizHawk.Emulation.DiscSystem var toc = _disc.TOC; if (toc.FirstRecordedTrackNumber != 1) return false; if (!toc.TOCItems[1].IsData) return false; - + //some have a signature if (StringAt("HACKER CD ROM SYSTEM", 0x8, 0x10)) return true; @@ -443,7 +443,7 @@ namespace BizHawk.Emulation.DiscSystem return true; } } - + // special case, Caves of Fear has the header 27 sectors in _dsr.ReadLBA_2352(_disc.Sessions[2].Tracks[1].LBA + 27, data, 0); var ss = Encoding.ASCII.GetString(data); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs index b1f9f5e6de..b5c03e73e5 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.MednaDisc.cs @@ -8,7 +8,7 @@ { //mednafen is always synthesizing everything, no need to worry about flags.. mostly./ job.Params.MednaDisc.Read_2442(job.LBA, job.DestBuffer2448, job.DestOffset); - + //we may still need to deinterleave it if subcode was requested and it needs deinterleaving if ((job.Parts & (ESectorSynthPart.SubcodeDeinterleave | ESectorSynthPart.SubcodeAny)) != 0) { diff --git a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs index e6862bbadb..21c96c03a6 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscMountJob.cs @@ -90,7 +90,7 @@ namespace BizHawk.Emulation.DiscSystem var tracksSynth = new Synthesize_DiscTracks_From_DiscTOC_Job(OUT_Disc, session); tracksSynth.Run(); } - + //insert a synth provider to take care of the leadout track //currently, we let mednafen take care of its own leadout track (we'll make that controllable later) //TODO: This currently doesn't work well with multisessions (only the last session can have a leadout read with the current model) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscSectorReader.cs b/src/BizHawk.Emulation.DiscSystem/DiscSectorReader.cs index 6c06d21bba..c13d8fb5a4 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscSectorReader.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscSectorReader.cs @@ -113,7 +113,7 @@ namespace BizHawk.Emulation.DiscSystem public int ReadLBA_2448(int lba, byte[] buffer, int offset) { var sector = disc.SynthProvider.Get(lba); - + if (sector == null) return 0; PrepareBuffer(buffer, offset, 2352); diff --git a/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs b/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs index 703993411b..9ed370f837 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.DiscSystem /// /// normal track: BCD indication of the current index /// leadin track: 'POINT' field used to ID the TOC entry # - /// + /// public BCD2 q_index; /// @@ -134,5 +134,5 @@ namespace BizHawk.Emulation.DiscSystem /// public EControlQ CONTROL => (EControlQ)((q_status >> 4) & 0xF); } - + } diff --git a/src/BizHawk.Emulation.DiscSystem/DiscTrack.cs b/src/BizHawk.Emulation.DiscSystem/DiscTrack.cs index d7a578fb0d..47e1e90fd9 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscTrack.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscTrack.cs @@ -18,7 +18,7 @@ //These omissions could be handled by ReadStructure() policies which permit the scanning of the entire disc. //After that, they could be cached in here. - + /// /// The number of the track (1-indexed) /// @@ -57,7 +57,7 @@ /// The next track in the session. null for the leadout track of a session. /// public DiscTrack NextTrack; - + /// /// The Type of a track as specified in the TOC Q-Subchannel data from the control flags. /// Could also be 4-Channel Audio, but we'll handle that later if needed diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/Algorithms/ECM.cs b/src/BizHawk.Emulation.DiscSystem/Internal/Algorithms/ECM.cs index c47d0828c7..ed21423e31 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/Algorithms/ECM.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/Algorithms/ECM.cs @@ -194,7 +194,7 @@ namespace BizHawk.Emulation.DiscSystem return crc; } - + /// /// returns the address from a sector. useful for saving it before zeroing it for ECC calculations /// diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs index f4c0118e0d..334c2b21b5 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/Jobs/Synthesize_DiscTracks_From_DiscTOC_Job.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.DiscSystem private readonly Disc IN_Disc; private readonly DiscSession IN_Session; - + private DiscTOC TOCRaw => IN_Session.TOC; private IList Tracks => IN_Session.Tracks; diff --git a/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs b/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs index 9528ad1887..186b96bedb 100644 --- a/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs +++ b/src/BizHawk.Emulation.DiscSystem/Internal/SectorSynth.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.DiscSystem /// The data sector header is required. There's no header for audio tracks/sectors. /// Header16 = 1, - + /// /// The main 2048 user data bytes are required /// @@ -155,7 +155,7 @@ namespace BizHawk.Emulation.DiscSystem private Func Condition; private ISectorSynthJob2448 Patch; private ISectorSynthProvider Parent; - + public void Install(Disc disc, Func condition, ISectorSynthJob2448 patch) { Parent = disc.SynthProvider; @@ -163,7 +163,7 @@ namespace BizHawk.Emulation.DiscSystem Condition = condition; Patch = patch; } - + public ISectorSynthJob2448 Get(int lba) { return Condition(lba) ? Patch : Parent.Get(lba); @@ -197,7 +197,7 @@ namespace BizHawk.Emulation.DiscSystem { public ISectorSynthJob2448 Original; public readonly byte[] Buffer_SubQ = new byte[12]; - + public void Synth(SectorSynthJob job) { Original.Synth(job); @@ -240,7 +240,7 @@ namespace BizHawk.Emulation.DiscSystem // if(toc.tracks[toc.last_track].valid) control |= toc.tracks[toc.last_track].control & 0x4; // else if(toc.disc_type == DISC_TYPE_CD_I) control |= 0x4; control |= (EControlQ)(((int)ses.LastInformationTrack.Control) & 4); - + SubchannelQ sq = default; sq.SetStatus(ADR, control); sq.q_tno.BCDValue = 0xAA; diff --git a/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs b/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs index a9cfddae4e..d6a14241a1 100644 --- a/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs +++ b/src/BizHawk.Tests/Client.Common/Movie/ZwinderStateManagerTests.cs @@ -188,7 +188,7 @@ namespace BizHawk.Tests.Client.Common.Movie const int futureReservedFrame = 1000; var ss = CreateStateSource(); using var zw = CreateSmallZwinder(ss); - + zw.CaptureReserved(futureReservedFrame, ss); for (int i = 1; i < 20; i++) {