System: Implement CPU overclocking [SAVEVERSION+]

Partial credit to @CookiePLMonster as well.
This commit is contained in:
Connor McLaughlin
2020-09-29 23:29:28 +10:00
parent 8f9f039665
commit 27697d0508
19 changed files with 249 additions and 36 deletions

View File

@ -13,9 +13,8 @@ MemoryCard::MemoryCard()
{
m_FLAG.no_write_yet = true;
m_save_event =
TimingEvents::CreateTimingEvent("Memory Card Host Flush", SAVE_DELAY_IN_SYSCLK_TICKS, SAVE_DELAY_IN_SYSCLK_TICKS,
std::bind(&MemoryCard::SaveIfChanged, this, true), false);
m_save_event = TimingEvents::CreateTimingEvent("Memory Card Host Flush", GetSaveDelayInTicks(), GetSaveDelayInTicks(),
std::bind(&MemoryCard::SaveIfChanged, this, true), false);
}
MemoryCard::~MemoryCard()
@ -23,6 +22,11 @@ MemoryCard::~MemoryCard()
SaveIfChanged(false);
}
TickCount MemoryCard::GetSaveDelayInTicks()
{
return System::GetTicksPerSecond() * SAVE_DELAY_IN_SECONDS;
}
void MemoryCard::Reset()
{
ResetTransferState();
@ -309,5 +313,5 @@ void MemoryCard::QueueFileSave()
return;
// save in one second, that should be long enough for everything to finish writing
m_save_event->Schedule(SAVE_DELAY_IN_SYSCLK_TICKS);
m_save_event->Schedule(GetSaveDelayInTicks());
}