Add an INI option to not loop FIFO playback and stop emulation when it's done

This commit is contained in:
Pierre Bourdon
2013-08-18 21:25:16 +02:00
parent 205ebbebbb
commit 5c3dcc50bc
5 changed files with 29 additions and 4 deletions

View File

@ -276,6 +276,9 @@ void SConfig::SaveSettings()
ini.Set("DSP", "Backend", sBackend); ini.Set("DSP", "Backend", sBackend);
ini.Set("DSP", "Volume", m_Volume); ini.Set("DSP", "Volume", m_Volume);
// Fifo Player
ini.Set("FifoPlayer", "LoopReplay", m_LocalCoreStartupParameter.bLoopFifoReplay);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX)); ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
m_SYSCONF->Save(); m_SYSCONF->Save();
} }
@ -448,6 +451,8 @@ void SConfig::LoadSettings()
ini.Get("DSP", "Backend", &sBackend, BACKEND_NULLSOUND); ini.Get("DSP", "Backend", &sBackend, BACKEND_NULLSOUND);
#endif #endif
ini.Get("DSP", "Volume", &m_Volume, 100); ini.Get("DSP", "Volume", &m_Volume, 100);
ini.Get("FifoPlayer", "LoopReplay", &m_LocalCoreStartupParameter.bLoopFifoReplay, true);
} }
m_SYSCONF = new SysConf(); m_SYSCONF = new SysConf();

View File

@ -47,7 +47,8 @@ SCoreStartupParameter::SCoreStartupParameter()
bRenderWindowAutoSize(false), bKeepWindowOnTop(false), bRenderWindowAutoSize(false), bKeepWindowOnTop(false),
bFullscreen(false), bRenderToMain(false), bFullscreen(false), bRenderToMain(false),
bProgressive(false), bDisableScreenSaver(false), bProgressive(false), bDisableScreenSaver(false),
iPosX(100), iPosY(100), iWidth(800), iHeight(600) iPosX(100), iPosY(100), iWidth(800), iHeight(600),
bLoopFifoReplay(true)
{ {
LoadDefaults(); LoadDefaults();
} }
@ -84,6 +85,8 @@ void SCoreStartupParameter::LoadDefaults()
iWidth = 800; iWidth = 800;
iHeight = 600; iHeight = 600;
bLoopFifoReplay = true;
bJITOff = false; // debugger only settings bJITOff = false; // debugger only settings
bJITLoadStoreOff = false; bJITLoadStoreOff = false;
bJITLoadStoreFloatingOff = false; bJITLoadStoreFloatingOff = false;

View File

@ -162,6 +162,9 @@ struct SCoreStartupParameter
int iPosX, iPosY, iWidth, iHeight; int iPosX, iPosY, iWidth, iHeight;
// Fifo Player related settings
bool bLoopFifoReplay;
enum EBootBS2 enum EBootBS2
{ {
BOOT_DEFAULT, BOOT_DEFAULT,

View File

@ -6,7 +6,10 @@
#include "FifoPlayer.h" #include "FifoPlayer.h"
#include "Common.h" #include "Common.h"
#include "ConfigManager.h"
#include "Core.h"
#include "CoreTiming.h" #include "CoreTiming.h"
#include "Host.h"
#include "HW/GPFifo.h" #include "HW/GPFifo.h"
#include "HW/Memmap.h" #include "HW/Memmap.h"
@ -68,10 +71,18 @@ bool FifoPlayer::Play()
{ {
if (m_CurrentFrame >= m_FrameRangeEnd) if (m_CurrentFrame >= m_FrameRangeEnd)
{ {
m_CurrentFrame = m_FrameRangeStart; if (m_Loop)
{
m_CurrentFrame = m_FrameRangeStart;
CoreTiming::downcount = 0; CoreTiming::downcount = 0;
CoreTiming::Advance(); CoreTiming::Advance();
}
else
{
PowerPC::Stop();
Host_Message(WM_USER_STOP);
}
} }
else else
{ {
@ -150,6 +161,7 @@ FifoPlayer::FifoPlayer() :
m_FrameWrittenCb(NULL), m_FrameWrittenCb(NULL),
m_File(NULL) m_File(NULL)
{ {
m_Loop = SConfig::GetInstance().m_LocalCoreStartupParameter.bLoopFifoReplay;
} }
void FifoPlayer::WriteFrame(const FifoFrameInfo &frame, const AnalyzedFrameInfo &info) void FifoPlayer::WriteFrame(const FifoFrameInfo &frame, const AnalyzedFrameInfo &info)

View File

@ -86,6 +86,8 @@ private:
bool ShouldLoadBP(u8 address); bool ShouldLoadBP(u8 address);
bool m_Loop;
u32 m_CurrentFrame; u32 m_CurrentFrame;
u32 m_FrameRangeStart; u32 m_FrameRangeStart;
u32 m_FrameRangeEnd; u32 m_FrameRangeEnd;