Watch classes - remove "LIAR logic"

This commit is contained in:
adelikat 2020-05-17 13:35:49 -05:00
parent b2d482ea66
commit b140143791
6 changed files with 9 additions and 58 deletions

View File

@ -173,42 +173,42 @@ namespace BizHawk.Client.Common
default:
case CompareType.None: // This should never happen, but it's here just in case. adelikat: And yet it does! Cheat Code converter doesn't do this. Changing this to default to equal since 99.9999% of all cheats are going to be equals
case CompareType.Equal:
if (_compare.Value == _watch.ValueNoFreeze)
if (_compare.Value == _watch.Value)
{
_watch.Poke(GetStringForPulse(_val));
}
break;
case CompareType.GreaterThan:
if (_compare.Value > _watch.ValueNoFreeze)
if (_compare.Value > _watch.Value)
{
_watch.Poke(GetStringForPulse(_val));
}
break;
case CompareType.GreaterThanOrEqual:
if (_compare.Value >= _watch.ValueNoFreeze)
if (_compare.Value >= _watch.Value)
{
_watch.Poke(GetStringForPulse(_val));
}
break;
case CompareType.LessThan:
if (_compare.Value < _watch.ValueNoFreeze)
if (_compare.Value < _watch.Value)
{
_watch.Poke(GetStringForPulse(_val));
}
break;
case CompareType.LessThanOrEqual:
if (_compare.Value <= _watch.ValueNoFreeze)
if (_compare.Value <= _watch.Value)
{
_watch.Poke(GetStringForPulse(_val));
}
break;
case CompareType.NotEqual:
if (_compare.Value != _watch.ValueNoFreeze)
if (_compare.Value != _watch.Value)
{
_watch.Poke(GetStringForPulse(_val));
}

View File

@ -207,13 +207,6 @@ namespace BizHawk.Client.Common
/// </summary>
public override int Value => GetByte();
/// <summary>
/// Gets the current value
/// but with stuff I don't understand
/// </summary>
/// <remarks>zero 15-nov-2015 - bypass LIAR LOGIC, see fdc9ea2aa922876d20ba897fb76909bf75fa6c92 https://github.com/TASVideos/BizHawk/issues/326 </remarks>
public override int ValueNoFreeze => GetByte(true);
/// <summary>
/// Get a string representation of the current value
/// </summary>

View File

@ -242,12 +242,6 @@ namespace BizHawk.Client.Common
/// </summary>
public override int Value => (int)GetDWord();
/// <summary>
/// Gets the current value
/// but with stuff I don't understand
/// </summary>
public override int ValueNoFreeze => (int)GetDWord(true);
/// <summary>
/// Get a string representation of the current value
/// </summary>

View File

@ -43,11 +43,6 @@ namespace BizHawk.Client.Common
/// </summary>
public override int Value => 0;
/// <summary>
/// Ignore that stuff
/// </summary>
public override int ValueNoFreeze => 0;
/// <summary>
/// Ignore that stuff
/// </summary>

View File

@ -265,14 +265,8 @@ namespace BizHawk.Client.Common
/// </summary>
public abstract void Update();
protected byte GetByte(bool bypassFreeze = false)
protected byte GetByte()
{
if (!bypassFreeze && Global.CheatList.IsActive(_domain, Address))
{
// LIAR logic
return Global.CheatList.GetByteValue(_domain, Address) ?? 0;
}
if (_domain.Size == 0)
{
return _domain.PeekByte(Address);
@ -281,14 +275,8 @@ namespace BizHawk.Client.Common
return _domain.PeekByte(Address % _domain.Size);
}
protected ushort GetWord(bool bypassFreeze = false)
protected ushort GetWord()
{
if (!bypassFreeze && Global.CheatList.IsActive(_domain, Address))
{
// LIAR logic
return (ushort)(Global.CheatList.GetCheatValue(_domain, Address, WatchSize.Word) ?? 0);
}
if (_domain.Size == 0)
{
return _domain.PeekUshort(Address, BigEndian);
@ -297,14 +285,8 @@ namespace BizHawk.Client.Common
return _domain.PeekUshort(Address % _domain.Size, BigEndian); // TODO: % size still isn't correct since it could be the last byte of the domain
}
protected uint GetDWord(bool bypassFreeze = false)
protected uint GetDWord()
{
if (!bypassFreeze && Global.CheatList.IsActive(_domain, Address))
{
// LIAR logic
return (uint)(Global.CheatList.GetCheatValue(_domain, Address, WatchSize.DWord) ?? 0);
}
if (_domain.Size == 0)
{
return _domain.PeekUint(Address, BigEndian); // TODO: % size still isn't correct since it could be the last byte of the domain
@ -485,13 +467,6 @@ namespace BizHawk.Client.Common
/// </summary>
public abstract int Value { get; }
/// <summary>
/// Gets the current value
/// but with stuff I don't understand
/// </summary>
/// <remarks>zero 15-nov-2015 - bypass LIAR LOGIC, see fdc9ea2aa922876d20ba897fb76909bf75fa6c92 https://github.com/TASVideos/BizHawk/issues/326 </remarks>
public abstract int ValueNoFreeze { get; }
/// <summary>
/// Gets a string representation of the current value
/// </summary>

View File

@ -221,12 +221,6 @@ namespace BizHawk.Client.Common
/// </summary>
public override int Value => GetWord();
/// <summary>
/// Gets the current value
/// but with stuff I don't understand
/// </summary>
public override int ValueNoFreeze => GetWord(true);
/// <summary>
/// Get a string representation of the current value
/// </summary>