From 681a40dd368e7e0c755e77250afc8be0ee7bf1a9 Mon Sep 17 00:00:00 2001 From: omegadox Date: Sat, 25 Oct 2008 13:43:46 +0000 Subject: [PATCH] revert git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@959 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/ActionReplay.cpp | 13 ++++--------- Source/Core/Core/Src/ActionReplay.h | 3 +-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp index b5736c90d8..77eb8d46b0 100644 --- a/Source/Core/Core/Src/ActionReplay.cpp +++ b/Source/Core/Core/Src/ActionReplay.cpp @@ -91,7 +91,6 @@ void LoadActionReplayCodes(IniFile &ini) currentCode.name = line; if (line[0] == '+') currentCode.active = true; else currentCode.active = false; - currentCode.failed = false; continue; } @@ -130,7 +129,7 @@ void LoadActionReplayCodes(IniFile &ini) void ActionReplayRunAllActive() { if (Core::GetStartupParameter().bEnableCheats && !fail) { - for (std::vector::iterator iter = arCodes.begin(); iter != arCodes.end(); ++iter) + for (std::vector::const_iterator iter = arCodes.begin(); iter != arCodes.end(); ++iter) if (iter->active) RunActionReplayCode(*iter, false); } @@ -141,12 +140,8 @@ void ActionReplayRunAllActive() // For example, some authors have created codes that add features to AR. Hacks for popular ones can be added here, // but the problem is not generally solvable. // TODO: what is "nowIsBootup" for? -void RunActionReplayCode(ARCode &arcode, bool nowIsBootup) { +void RunActionReplayCode(const ARCode &arcode, bool nowIsBootup) { code = arcode; - - if (arcode.failed) // If the code doesn't work, skip it - return; - for (iter = code.ops.begin(); iter != code.ops.end(); ++iter) { cmd = iter->cmd_addr >> 24; @@ -172,7 +167,7 @@ void RunActionReplayCode(ARCode &arcode, bool nowIsBootup) { // ActionReplay program self modification codes if (addr >= 0x00002000 && addr < 0x00003000) { PanicAlert("This action replay simulator does not support codes that modify Action Replay itself."); - arcode.failed = true; + fail = true; return; } @@ -207,7 +202,7 @@ void RunActionReplayCode(ARCode &arcode, bool nowIsBootup) { continue; default: PanicAlert("Zero code unknown to dolphin: %08x",zcode); - arcode.failed = true; + fail = true; return; } } diff --git a/Source/Core/Core/Src/ActionReplay.h b/Source/Core/Core/Src/ActionReplay.h index e1039da536..0747ef7072 100644 --- a/Source/Core/Core/Src/ActionReplay.h +++ b/Source/Core/Core/Src/ActionReplay.h @@ -24,10 +24,9 @@ struct ARCode { std::string name; std::vector ops; bool active; - bool failed; }; void ActionReplayRunAllActive(); -void RunActionReplayCode(ARCode &arcode, bool nowIsBootup); +void RunActionReplayCode(const ARCode &arcode, bool nowIsBootup); void LoadActionReplayCodes(IniFile &ini);