Enable RCS1195 and fix noncompliance

This commit is contained in:
YoshiRulz 2025-06-22 18:40:24 +10:00
parent c4eb5f98da
commit ea710e8387
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 7 additions and 8 deletions

View File

@ -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

View File

@ -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();
}
}
}

View File

@ -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);
}