From d0b094622936031a813df460d3bb43d72dc9ccc2 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sun, 8 Jan 2017 13:44:07 -0500 Subject: [PATCH] NES Fix Cheats Now turn off when cheat is turned off / removed Fixes #770 Note: This is a bit clumsy, but I don't know a way to directly call a removal method from the cheat tool. Effective enough for now though. --- .../Consoles/Nintendo/NES/NES.Core.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 43b8835e8c..07baffad05 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -49,6 +49,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public byte VS_coin_inserted=0; public byte VS_ROM_control; + // cheat addr index tracker + // disables all cheats each frame + public int[] cheat_indexes = new int[500]; + public int num_cheats; + // new input system NESControlSettings ControllerSettings; // this is stored internally so that a new change of settings won't replace IControllerDeck ControllerDeck; @@ -295,6 +300,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bool hardResetSignal; public void FrameAdvance(bool render, bool rendersound) { + + if (Tracer.Enabled) cpu.TraceCallback = (s) => Tracer.Put(s); else @@ -358,6 +365,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES islag = false; videoProvider.FillFrameBuffer(); + + //turn off all cheats + for (int d=0;d