Ram Tools - support poking frozen values, fixes issue 266

This commit is contained in:
adelikat 2014-09-27 21:52:15 +00:00
parent 72e29286c8
commit 1dc789eb02
2 changed files with 39 additions and 0 deletions

View File

@ -292,6 +292,14 @@ namespace BizHawk.Client.Common
}
}
public void PokeValue(int val)
{
if (!IsSeparator)
{
_val = val;
}
}
public void Increment()
{
if (!IsSeparator)

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using BizHawk.Common;
using BizHawk.Common.NumberExtensions;
@ -581,6 +582,16 @@ namespace BizHawk.Client.Common
break;
}
if (Global.CheatList.Contains(Domain, _address))
{
var cheat = Global.CheatList.FirstOrDefault(c => c.Address == _address && c.Domain == Domain);
if (cheat != (Cheat)null)
{
cheat.PokeValue(val);
return true;
}
}
PokeByte(val);
return true;
}
@ -802,6 +813,16 @@ namespace BizHawk.Client.Common
break;
}
if (Global.CheatList.Contains(Domain, _address))
{
var cheat = Global.CheatList.FirstOrDefault(c => c.Address == _address && c.Domain == Domain);
if (cheat != (Cheat)null)
{
cheat.PokeValue(val);
return true;
}
}
PokeWord(val);
return true;
}
@ -1016,6 +1037,16 @@ namespace BizHawk.Client.Common
break;
}
if (Global.CheatList.Contains(Domain, _address))
{
var cheat = Global.CheatList.FirstOrDefault(c => c.Address == _address && c.Domain == Domain);
if (cheat != (Cheat)null)
{
cheat.PokeValue((int)val);
return true;
}
}
PokeDWord(val);
return true;
}