From 21cd754a7d847b496c9535de3c2bdebd1538a2c2 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 1 Sep 2012 14:35:12 +0000 Subject: [PATCH] Cheats - implement removing of cheats for the NES core --- BizHawk.MultiClient/tools/Cheat.cs | 16 ++++++++++++++-- BizHawk.MultiClient/tools/CheatList.cs | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/BizHawk.MultiClient/tools/Cheat.cs b/BizHawk.MultiClient/tools/Cheat.cs index 05b0ebb118..6030b867fc 100644 --- a/BizHawk.MultiClient/tools/Cheat.cs +++ b/BizHawk.MultiClient/tools/Cheat.cs @@ -65,7 +65,19 @@ namespace BizHawk.MultiClient public void Disable() { enabled = false; - MemoryPulse.Remove(domain, address); + DisposeOfCheat(); + } + + public void DisposeOfCheat() + { + if (Global.Emulator is NES) + { + (Global.Emulator as NES).RemoveGameGenie(address); + } + else + { + MemoryPulse.Remove(domain, address); + } } public bool IsEnabled() @@ -75,7 +87,7 @@ namespace BizHawk.MultiClient ~Cheat() { - MemoryPulse.Remove(domain, address); + DisposeOfCheat(); } } } diff --git a/BizHawk.MultiClient/tools/CheatList.cs b/BizHawk.MultiClient/tools/CheatList.cs index 8146b117c4..a9429b1f4a 100644 --- a/BizHawk.MultiClient/tools/CheatList.cs +++ b/BizHawk.MultiClient/tools/CheatList.cs @@ -279,7 +279,7 @@ namespace BizHawk.MultiClient public void Remove(Cheat c) { - MemoryPulse.Remove(c.domain, c.address); + c.DisposeOfCheat(); cheatList.Remove(c); Global.MainForm.UpdateCheatStatus(); }