Skip to content

Commit

Permalink
Merge pull request #2 from Jamiras/restore_patched_rom
Browse files Browse the repository at this point in the history
reset any ROM that was patched by cheats when switching to hardcore
  • Loading branch information
Jamiras authored Oct 4, 2020
2 parents cc1e228 + e2a83b4 commit ab4037f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/wx/retroachievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,23 @@ static void ResetEmulator()
// stop movie playback
systemStopGamePlayback();

// disable cheats
// disabling the menu option prevents cheats from being evaluated each frame
if (cheatsEnabled)
{
cheatsEnabled = false;
mf->SetMenuOption("CheatsEnable", 0);
}

// pretend there aren't any cheats and call cheatsCheckKeys to reset any ROM
// that was patched by the previous call to cheatsCheckKeys.
if (cheatsNumber)
{
int oldCheatsNumber = cheatsNumber;
cheatsNumber = 0;
cheatsCheckKeys(0, 0);
cheatsNumber = oldCheatsNumber;
}

// reset frame rate
throttle = 100;
if (mf->GetPanel()->game_type() != IMAGE_UNKNOWN)
Expand Down

0 comments on commit ab4037f

Please sign in to comment.