From 24e6cc14f01d42d56f0c6f1e22e891ca95f1b3da Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 25 Jan 2020 19:35:45 +1000 Subject: [PATCH] Enable SA1206 and fix noncompliance "Declaration keywords should follow order" --- .../CPUs/Z80A/NewDisassembler.cs | 14 +++++++------- .../Fairchild/ChannelF/F8/F3850.Disassembler.cs | 2 +- .../Consoles/Nintendo/Gameboy/LibGambatte.cs | 4 ++-- .../Consoles/Nintendo/Gameboy/Sameboy.cs | 2 +- .../NES/Boards/MMC3_family/RexSoftSL1632.cs | 2 +- .../Consoles/Sega/Saturn/Saturnus.cs | 2 +- .../Consoles/Sega/gpgx64/GenDbgHlp.cs | 2 +- .../Consoles/Sony/PSX/OctoshockDll.cs | 2 +- .../Internal/SynthUtils.cs | 4 ++-- Common.ruleset | 3 --- 10 files changed, 17 insertions(+), 20 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs b/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs index f7cf452467..0bb629cbee 100644 --- a/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs +++ b/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs @@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A return format; } - readonly static string[] mnemonics = new string[] + static readonly string[] mnemonics = new string[] { "NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04 "INC B", "DEC B", "LD B, n", "RLCA", //0x08 @@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "CALL M, nn", "[FD]", "CP n", "RST $38", //0x100 }; - readonly static string[] mnemonicsDD = new string[] + static readonly string[] mnemonicsDD = new string[] { "NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04 "INC B", "DEC B", "LD B, n", "RLCA", //0x08 @@ -162,7 +162,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "CALL M, nn", "[!!DD FD!!]", "CP n", "RST $38", //0x100 }; - readonly static string[] mnemonicsFD = new string[] + static readonly string[] mnemonicsFD = new string[] { "NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04 "INC B", "DEC B", "LD B, n", "RLCA", //0x08 @@ -230,7 +230,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "CALL M, nn", "[!FD FD!]", "CP n", "RST $38", //0x100 }; - readonly static string[] mnemonicsDDCB = new string[] + static readonly string[] mnemonicsDDCB = new string[] { "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", @@ -266,7 +266,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "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", }; - readonly static string[] mnemonicsFDCB = new string[] + static readonly string[] mnemonicsFDCB = new string[] { "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", @@ -302,7 +302,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "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", }; - readonly static string[] mnemonicsCB = new string[] + static readonly string[] mnemonicsCB = new string[] { "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", @@ -338,7 +338,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A "SET 7, B", "SET 7, C", "SET 7, D", "SET 7, E", "SET 7, H", "SET 7, L", "SET 7, (HL)", "SET 7, A", }; - readonly static string[] mnemonicsED = new string[] + static readonly string[] mnemonicsED = new string[] { "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", diff --git a/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/F8/F3850.Disassembler.cs b/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/F8/F3850.Disassembler.cs index 6ec5625b06..86a4722a55 100644 --- a/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/F8/F3850.Disassembler.cs +++ b/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/F8/F3850.Disassembler.cs @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF } - readonly static string[] mnemonics = new string[] + static readonly string[] mnemonics = new string[] { "LR A, KU", // 0x00 "LR A, KL", // 0x01 diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs index 27f7cd990a..c331f13eb7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs @@ -83,7 +83,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy [DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int gambatte_runfor(IntPtr core, short[] soundbuf, ref uint samples); [DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)] - unsafe public static extern int gambatte_runfor(IntPtr core, short* soundbuf, ref uint samples); + public static extern unsafe int gambatte_runfor(IntPtr core, short* soundbuf, ref uint samples); /// /// blit from internal framebuffer to provided framebuffer @@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy /// opaque state pointer /// in pixels [DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)] - unsafe public static extern void gambatte_blitto(IntPtr core, int* videobuf, int pitch); + public static extern unsafe void gambatte_blitto(IntPtr core, int* videobuf, int pitch); /// /// blit from internal framebuffer to provided framebuffer /// diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Sameboy.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Sameboy.cs index b8ed05b9de..51fe316278 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Sameboy.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Sameboy.cs @@ -270,7 +270,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy }; } - protected unsafe override void FrameAdvancePost() + protected override unsafe void FrameAdvancePost() { if (_scanlineCallback != null && _scanlineCallbackLine == -1) _scanlineCallback(_core.GetIoReg(0x40)); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs index e40334ff5b..4dc315a931 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(!exnmt.Bit(0) ? EMirrorType.Vertical : EMirrorType.Horizontal); } - readonly static byte[] modes = { 5, 5, 3, 1 }; + static readonly byte[] modes = { 5, 5, 3, 1 }; public override byte ReadPPU(int addr) { if (addr < 0x2000) diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs index e379ec8b11..e6f964818b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs @@ -631,7 +631,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn _resizedBuffer = new int[width * height]; } - protected unsafe override void FrameAdvancePost() + protected override unsafe void FrameAdvancePost() { //TODO: can we force the videoprovider to add a prescale instead of having to do it in software here? //TODO: if not, actually do it in software, instead of relying on the virtual sizes diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GenDbgHlp.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GenDbgHlp.cs index 7ad5c01bd6..b3d278cb25 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GenDbgHlp.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GenDbgHlp.cs @@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx } - unsafe public void Cmp(int statex, int statey) + public unsafe void Cmp(int statex, int statey) { if (disposed) throw new ObjectDisposedException(this.GetType().ToString()); List> bads = new List>(); diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockDll.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockDll.cs index 51bae8ff2d..2733dec501 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockDll.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/OctoshockDll.cs @@ -7,7 +7,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Sony.PSX { - public unsafe static class OctoshockDll + public static unsafe class OctoshockDll { const CallingConvention cc = CallingConvention.Cdecl; const string dd = "octoshock.dll"; diff --git a/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs b/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs index 1f486db75a..22891d260f 100644 --- a/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs +++ b/BizHawk.Emulation.DiscSystem/Internal/SynthUtils.cs @@ -153,7 +153,7 @@ namespace BizHawk.Emulation.DiscSystem /// /// Converts the useful (but unrealistic) deinterleaved data into the useless (but realistic) interleaved subchannel format. /// - public unsafe static void InterleaveSubcodeInplace(byte[] buf, int buf_index) + public static unsafe void InterleaveSubcodeInplace(byte[] buf, int buf_index) { byte* out_buf = stackalloc byte[96]; @@ -181,7 +181,7 @@ namespace BizHawk.Emulation.DiscSystem /// /// Converts the useless (but realistic) interleaved subchannel data into a useful (but unrealistic) deinterleaved format. /// - public unsafe static void DeinterleaveSubcodeInplace(byte[] buf, int buf_index) + public static unsafe void DeinterleaveSubcodeInplace(byte[] buf, int buf_index) { byte* out_buf = stackalloc byte[96]; diff --git a/Common.ruleset b/Common.ruleset index cfa5cc9354..f8680f2a1b 100644 --- a/Common.ruleset +++ b/Common.ruleset @@ -163,9 +163,6 @@ - - -