diff --git a/.global.editorconfig.ini b/.global.editorconfig.ini index 0d8abd0d6b..0f2232c6ab 100644 --- a/.global.editorconfig.ini +++ b/.global.editorconfig.ini @@ -456,6 +456,8 @@ dotnet_diagnostic.RCS1160.severity = error dotnet_diagnostic.RCS1191.severity = warning # Implement exception constructors dotnet_diagnostic.RCS1194.severity = silent +# Use ^ operator +dotnet_diagnostic.RCS1195.severity = warning # Do not pass non-read-only struct by read-only reference dotnet_diagnostic.RCS1242.severity = silent diff --git a/src/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs b/src/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs index 690975ab63..d264f9487b 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/InputCallbackSystem.cs @@ -52,10 +52,7 @@ namespace BizHawk.Emulation.Common private void Changes(bool hadAny, bool hasAny) { - if ((hadAny && !hasAny) || (!hadAny && hasAny)) - { - ActiveChanged?.Invoke(); - } + if (hadAny ^ hasAny) ActiveChanged?.Invoke(); } } } diff --git a/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/ProgramFlow.cs b/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/ProgramFlow.cs index f23ed72c82..d11e91fd42 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/ProgramFlow.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/68000/Instructions/ProgramFlow.cs @@ -18,10 +18,10 @@ namespace BizHawk.Emulation.Cores.Components.M68000 case 0x09: return V; // Overflow Set case 0x0A: return !N; // Plus (Positive) case 0x0B: return N; // Minus (Negative) - case 0x0C: return N && V || !N && !V; // Greater or Equal - case 0x0D: return N && !V || !N && V; // Less Than - case 0x0E: return N && V && !Z || !N && !V && !Z; // Greater Than - case 0x0F: return Z || N && !V || !N && V; // Less or Equal + case 0x0C: return /*N && V || !N && !V*/N == V; // Greater or Equal + case 0x0D: return /*N && !V || !N && V*/N ^ V; // Less Than + case 0x0E: return (/*N && V || !N && !V*/N == V) && !Z; // Greater Than + case 0x0F: return Z || (/*N && !V || !N && V*/N ^ V); // Less or Equal default: throw new Exception("Invalid condition " + condition); }