Remove built-in runahead stuff - we already have this in retroarch

This commit is contained in:
twinaphex 2022-04-03 21:47:48 +02:00
parent 9561ead950
commit 8ddedbb5b8
2 changed files with 6 additions and 45 deletions

View File

@ -628,16 +628,6 @@ void Console::RunSlaveCpu()
}
}
void Console::RunFrame()
{
uint32_t frameCount = _ppu->GetFrameCount();
while(_ppu->GetFrameCount() == frameCount) {
_cpu->Exec();
if(_slave)
RunSlaveCpu();
}
}
void Console::Run()
{
Timer clockTimer;
@ -656,12 +646,12 @@ void Console::Run()
try {
while(true) {
stringstream runAheadState;
bool useRunAhead = _settings->GetRunAheadFrames() > 0 && !IsNsf() && !_rewindManager->IsRewinding() && _settings->GetEmulationSpeed() > 0 && _settings->GetEmulationSpeed() <= 100;
if(useRunAhead) {
RunFrameWithRunAhead(runAheadState);
} else {
RunFrame();
uint32_t frameCount = _ppu->GetFrameCount();
while(_ppu->GetFrameCount() == frameCount)
{
_cpu->Exec();
if(_slave)
RunSlaveCpu();
}
if(_historyViewer) {
@ -702,12 +692,6 @@ void Console::Run()
//Sleep until we're ready to start the next frame
clockTimer.WaitUntil(targetTime);
if(useRunAhead) {
_settings->SetRunAheadFrameFlag(true);
LoadState(runAheadState);
_settings->SetRunAheadFrameFlag(false);
}
if(_pauseCounter > 0) {
//Need to temporarely pause the emu (to save/load a state, etc.)
_runLock.Release();
@ -788,26 +772,6 @@ void Console::Run()
_notificationManager->SendNotification(ConsoleNotificationType::EmulationStopped);
}
void Console::RunFrameWithRunAhead(std::stringstream& runAheadState)
{
uint32_t runAheadFrames = _settings->GetRunAheadFrames();
_settings->SetRunAheadFrameFlag(true);
//Run a single frame and save the state (no audio/video)
RunFrame();
SaveState(runAheadState);
while(runAheadFrames > 1) {
//Run extra frames if the requested run ahead frame count is higher than 1
runAheadFrames--;
RunFrame();
}
_apu->EndFrame();
_settings->SetRunAheadFrameFlag(false);
//Run one frame normally (with audio/video output)
RunFrame();
_apu->EndFrame();
}
void Console::ResetRunTimers()
{
_resetRunTimers = true;

View File

@ -94,8 +94,6 @@ private:
bool _initialized = false;
void RunFrameWithRunAhead(std::stringstream& runAheadState);
void LoadHdPack(VirtualFile &romFile, VirtualFile &patchFile);
void UpdateNesModel(bool sendNotification);
@ -151,7 +149,6 @@ public:
void RunSingleFrame();
void RunSlaveCpu();
void RunFrame();
bool UpdateHdPackMode();
shared_ptr<SystemActionManager> GetSystemActionManager();