summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authoromegadox <omegadox@gmail.com>2008-10-13 18:25:09 +0000
committeromegadox <omegadox@gmail.com>2008-10-13 18:25:09 +0000
commit744efe72e5a46375835e2bd06cf9a5e77476b764 (patch)
tree1b43811abc493d221dcb42d488956de235a5945d /Source/Core
parentdec94518e7461d19510a9025ad2c8503abaf8fe7 (diff)
Fixed bug in cheats system and a bit of code cleanup. The cheat code activation works properly now. Enjoy your cheating :P.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@850 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/Core.cpp1
-rw-r--r--Source/Core/Core/Src/HW/SystemTimers.cpp2
-rw-r--r--Source/Core/Core/Src/PatchEngine.cpp8
-rw-r--r--Source/Core/Core/Src/PatchEngine.h2
4 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index aa2e9616f9..9df8d51bfa 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -528,6 +528,7 @@ void Callback_VideoCopiedToXFB()
Timer.Update();
}
PatchEngine_ApplyFramePatches();
+ PatchEngine_ApplyARPatches();
}
// __________________________________________________________________________________________________
diff --git a/Source/Core/Core/Src/HW/SystemTimers.cpp b/Source/Core/Core/Src/HW/SystemTimers.cpp
index 0a561e8988..819537f3b8 100644
--- a/Source/Core/Core/Src/HW/SystemTimers.cpp
+++ b/Source/Core/Core/Src/HW/SystemTimers.cpp
@@ -127,6 +127,8 @@ void SICallback(u64 userdata, int cyclesLate)
{
// This is once per frame - good candidate for patching stuff
PatchEngine_ApplyFramePatches();
+ // Apply AR cheats
+ PatchEngine_ApplyARPatches();
// OK, do what we are here to do.
SerialInterface::UpdateDevices();
CoreTiming::ScheduleEvent(SI_PERIOD-cyclesLate, et_SI);
diff --git a/Source/Core/Core/Src/PatchEngine.cpp b/Source/Core/Core/Src/PatchEngine.cpp
index d325f14f0e..64544d67c3 100644
--- a/Source/Core/Core/Src/PatchEngine.cpp
+++ b/Source/Core/Core/Src/PatchEngine.cpp
@@ -155,6 +155,9 @@ void PatchEngine_ApplyLoadPatches()
void PatchEngine_ApplyFramePatches()
{
ApplyPatches(onFrame);
+}
+void PatchEngine_ApplyARPatches()
+{
for (std::vector<ARCode>::const_iterator iter = arCodes.begin(); iter != arCodes.end(); ++iter) {
if (iter->active)
RunActionReplayCode(*iter, false);
@@ -166,6 +169,7 @@ void LoadActionReplayCodes(IniFile &ini)
std::vector<std::string> lines;
ARCode currentCode;
arCodes.clear();
+
if (!ini.GetLines("ActionReplay", lines))
return;
@@ -197,7 +201,7 @@ void LoadActionReplayCodes(IniFile &ini)
currentCode.name = line;
currentCode.active = true;
}
- else {
+ else if (line[0] != '+') {
currentCode.name = line;
currentCode.active = false;
}
@@ -208,8 +212,8 @@ void LoadActionReplayCodes(IniFile &ini)
currentCode.ops.clear();
}
}
+ arCodes.push_back(currentCode);
}
- arCodes.push_back(currentCode);
}
// The mechanism is slightly different than what the real AR uses, so there may be compatibility problems.
diff --git a/Source/Core/Core/Src/PatchEngine.h b/Source/Core/Core/Src/PatchEngine.h
index cb446f9d61..b128e95651 100644
--- a/Source/Core/Core/Src/PatchEngine.h
+++ b/Source/Core/Core/Src/PatchEngine.h
@@ -24,5 +24,5 @@
void PatchEngine_LoadPatches(const char *gameID);
void PatchEngine_ApplyLoadPatches();
void PatchEngine_ApplyFramePatches();
-
+void PatchEngine_ApplyARPatches();
#endif