Cheats - address issue 148, instead of throwing an exception when attempting to add an out of range address, present an error message. One odd side effect is that it will add a separator instead, but I think that's acceptable for now.
This commit is contained in:
parent
1e9374e4e4
commit
b378cd13e4
|
@ -270,6 +270,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public Cheat Cheat
|
public Cheat Cheat
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
{
|
||||||
|
var domain = Global.Emulator.MemoryDomains[DomainDropDown.SelectedItem.ToString()];
|
||||||
|
var address = AddressBox.ToRawInt().Value;
|
||||||
|
if (address < domain.Size)
|
||||||
{
|
{
|
||||||
var watch = Watch.GenerateWatch(
|
var watch = Watch.GenerateWatch(
|
||||||
Global.Emulator.MemoryDomains[DomainDropDown.SelectedItem.ToString()],
|
Global.Emulator.MemoryDomains[DomainDropDown.SelectedItem.ToString()],
|
||||||
|
@ -285,6 +289,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CompareBox.ToRawInt()
|
CompareBox.ToRawInt()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show(address.ToString() + " is not a valid address for the domain " + domain.Name, "Index out of range", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
return Cheat.Separator;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetAddEvent(Action addCallback)
|
public void SetAddEvent(Action addCallback)
|
||||||
|
|
Loading…
Reference in New Issue