diff options
| author | omegadox <omegadox@gmail.com> | 2008-10-25 13:35:01 +0000 |
|---|---|---|
| committer | omegadox <omegadox@gmail.com> | 2008-10-25 13:35:01 +0000 |
| commit | 92f991dd2bad4e6e598edd5550b5aabaf4ae2d7a (patch) | |
| tree | a9bb9e015f7e34e81c689424ce0f0e3087716535 /Source/Core | |
| parent | 2f6d41e413ef2197ee25d1a9ea1790c9d64e548b (diff) | |
AR will ignore the codes it doesn't like and keep executing the working ones.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@958 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/ActionReplay.cpp | 13 | ||||
| -rw-r--r-- | Source/Core/Core/Src/ActionReplay.h | 3 |
2 files changed, 11 insertions, 5 deletions
diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp index 77eb8d46b0..b5736c90d8 100644 --- a/Source/Core/Core/Src/ActionReplay.cpp +++ b/Source/Core/Core/Src/ActionReplay.cpp @@ -91,6 +91,7 @@ void LoadActionReplayCodes(IniFile &ini) currentCode.name = line;
if (line[0] == '+') currentCode.active = true;
else currentCode.active = false;
+ currentCode.failed = false;
continue;
}
@@ -129,7 +130,7 @@ void LoadActionReplayCodes(IniFile &ini) void ActionReplayRunAllActive()
{
if (Core::GetStartupParameter().bEnableCheats && !fail) {
- for (std::vector<ARCode>::const_iterator iter = arCodes.begin(); iter != arCodes.end(); ++iter)
+ for (std::vector<ARCode>::iterator iter = arCodes.begin(); iter != arCodes.end(); ++iter)
if (iter->active)
RunActionReplayCode(*iter, false);
}
@@ -140,8 +141,12 @@ 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(const ARCode &arcode, bool nowIsBootup) {
+void RunActionReplayCode(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;
@@ -167,7 +172,7 @@ void RunActionReplayCode(const 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.");
- fail = true;
+ arcode.failed = true;
return;
}
@@ -202,7 +207,7 @@ void RunActionReplayCode(const ARCode &arcode, bool nowIsBootup) { continue;
default:
PanicAlert("Zero code unknown to dolphin: %08x",zcode);
- fail = true;
+ arcode.failed = true;
return;
}
}
diff --git a/Source/Core/Core/Src/ActionReplay.h b/Source/Core/Core/Src/ActionReplay.h index 0747ef7072..e1039da536 100644 --- a/Source/Core/Core/Src/ActionReplay.h +++ b/Source/Core/Core/Src/ActionReplay.h @@ -24,9 +24,10 @@ struct ARCode { std::string name;
std::vector<AREntry> ops;
bool active;
+ bool failed;
};
void ActionReplayRunAllActive();
-void RunActionReplayCode(const ARCode &arcode, bool nowIsBootup);
+void RunActionReplayCode(ARCode &arcode, bool nowIsBootup);
void LoadActionReplayCodes(IniFile &ini);
|
