Be consistent with `SignExtendAsNeeded` in `CompareSpecificValue`
not sure why it's applied to the pivot value here but not in `CompareDifference`, frankly I'm not sure what it actually does
This commit is contained in:
parent
46584cee10
commit
72a7df1227
|
@ -445,8 +445,12 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
||||||
return watchList.Where(w => SignExtendAsNeeded(GetValue(w.Address)) <= SignExtendAsNeeded(compareValue));
|
return watchList.Where(w => SignExtendAsNeeded(GetValue(w.Address)) <= SignExtendAsNeeded(compareValue));
|
||||||
case ComparisonOperator.DifferentBy:
|
case ComparisonOperator.DifferentBy:
|
||||||
if (DifferentBy is not int differentBy) throw new InvalidOperationException();
|
if (DifferentBy is not int differentBy) throw new InvalidOperationException();
|
||||||
return watchList.Where(w => SignExtendAsNeeded(GetValue(w.Address)) + differentBy == compareValue
|
return watchList.Where(w =>
|
||||||
|| SignExtendAsNeeded(GetValue(w.Address)) - differentBy == compareValue);
|
{
|
||||||
|
var val = SignExtendAsNeeded(GetValue(w.Address));
|
||||||
|
var pivot = SignExtendAsNeeded(compareValue);
|
||||||
|
return val + differentBy == pivot || val - differentBy == pivot;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var compareValueF = ReinterpretAsF32(compareValue);
|
var compareValueF = ReinterpretAsF32(compareValue);
|
||||||
|
|
Loading…
Reference in New Issue