FifoPlayer: Store early memory updates option in the config

Now, early memory updates is persisted across runs, and can be toggled before starting a fifolog.
This commit is contained in:
Pokechu22
2022-01-06 14:38:09 -08:00
parent 193ca92cb8
commit 575062a612
6 changed files with 45 additions and 15 deletions

View File

@ -165,10 +165,13 @@ bool IsPlayingBackFifologWithBrokenEFBCopies = false;
FifoPlayer::FifoPlayer() : m_Loop{Config::Get(Config::MAIN_FIFOPLAYER_LOOP_REPLAY)}
{
m_config_changed_callback_id = Config::AddConfigChangedCallback([this] { RefreshConfig(); });
RefreshConfig();
}
FifoPlayer::~FifoPlayer()
{
Config::RemoveConfigChangedCallback(m_config_changed_callback_id);
}
bool FifoPlayer::Open(const std::string& filename)
@ -298,6 +301,11 @@ std::unique_ptr<CPUCoreBase> FifoPlayer::GetCPUCore()
return std::make_unique<CPUCore>(this);
}
void FifoPlayer::RefreshConfig()
{
m_EarlyMemoryUpdates = Config::Get(Config::MAIN_FIFOPLAYER_EARLY_MEMORY_UPDATES);
}
void FifoPlayer::SetFileLoadedCallback(CallbackFunc callback)
{
m_FileLoadedCb = std::move(callback);