Disable frame advance in hardcore mode

Frame advancing is easily exploitable for slowing down a game and artificially improving reaction times and is not allowed in RetroAchievements hardcore mode.
This commit is contained in:
LillyJadeKatrin 2023-06-07 21:46:49 -04:00
parent 2c40d6ba31
commit 45105822f3
2 changed files with 10 additions and 2 deletions

View File

@ -42,6 +42,7 @@
#include "Core/Boot/Boot.h"
#include "Core/BootManager.h"
#include "Core/CPUThreadConfigCallback.h"
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
#include "Core/CoreTiming.h"
@ -1081,6 +1082,13 @@ void HostDispatchJobs()
// NOTE: Host Thread
void DoFrameStep()
{
#ifdef USE_RETRO_ACHIEVEMENTS
if (AchievementManager::GetInstance()->IsHardcoreModeActive())
{
OSD::AddMessage("Frame stepping is disabled in RetroAchievements hardcore mode");
return;
}
#endif // USE_RETRO_ACHIEVEMENTS
if (GetState() == State::Paused)
{
// if already paused, frame advance for 1 frame

View File

@ -121,16 +121,16 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
m_stop_action->setVisible(running);
m_reset_action->setEnabled(running);
m_fullscreen_action->setEnabled(running);
m_frame_advance_action->setEnabled(running);
m_screenshot_action->setEnabled(running);
m_state_save_menu->setEnabled(running);
#ifdef USE_RETRO_ACHIEVEMENTS
bool hardcore = AchievementManager::GetInstance()->IsHardcoreModeActive();
m_state_load_menu->setEnabled(running && !hardcore);
m_frame_advance_action->setEnabled(running && !hardcore);
#else // USE_RETRO_ACHIEVEMENTS
m_state_load_menu->setEnabled(running);
m_frame_advance_action->setEnabled(running);
#endif // USE_RETRO_ACHIEVEMENTS
// Movie