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
This commit is contained in:
omegadox 2008-10-13 18:25:09 +00:00
parent dec94518e7
commit 744efe72e5
4 changed files with 10 additions and 3 deletions

View File

@ -528,6 +528,7 @@ void Callback_VideoCopiedToXFB()
Timer.Update();
}
PatchEngine_ApplyFramePatches();
PatchEngine_ApplyARPatches();
}
// __________________________________________________________________________________________________

View File

@ -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);

View File

@ -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.

View File

@ -24,5 +24,5 @@
void PatchEngine_LoadPatches(const char *gameID);
void PatchEngine_ApplyLoadPatches();
void PatchEngine_ApplyFramePatches();
void PatchEngine_ApplyARPatches();
#endif