Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add an INI option to not loop FIFO playback and stop emulation when i…
…t's done
  • Loading branch information
delroth committed Aug 18, 2013
1 parent 205ebbe commit 5c3dcc5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Source/Core/Core/Src/ConfigManager.cpp
Expand Up @@ -276,6 +276,9 @@ void SConfig::SaveSettings()
ini.Set("DSP", "Backend", sBackend);
ini.Set("DSP", "Volume", m_Volume);

// Fifo Player
ini.Set("FifoPlayer", "LoopReplay", m_LocalCoreStartupParameter.bLoopFifoReplay);

ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
m_SYSCONF->Save();
}
Expand Down Expand Up @@ -448,6 +451,8 @@ void SConfig::LoadSettings()
ini.Get("DSP", "Backend", &sBackend, BACKEND_NULLSOUND);
#endif
ini.Get("DSP", "Volume", &m_Volume, 100);

ini.Get("FifoPlayer", "LoopReplay", &m_LocalCoreStartupParameter.bLoopFifoReplay, true);
}

m_SYSCONF = new SysConf();
Expand Down
5 changes: 4 additions & 1 deletion Source/Core/Core/Src/CoreParameter.cpp
Expand Up @@ -47,7 +47,8 @@ SCoreStartupParameter::SCoreStartupParameter()
bRenderWindowAutoSize(false), bKeepWindowOnTop(false),
bFullscreen(false), bRenderToMain(false),
bProgressive(false), bDisableScreenSaver(false),
iPosX(100), iPosY(100), iWidth(800), iHeight(600)
iPosX(100), iPosY(100), iWidth(800), iHeight(600),
bLoopFifoReplay(true)
{
LoadDefaults();
}
Expand Down Expand Up @@ -84,6 +85,8 @@ void SCoreStartupParameter::LoadDefaults()
iWidth = 800;
iHeight = 600;

bLoopFifoReplay = true;

bJITOff = false; // debugger only settings
bJITLoadStoreOff = false;
bJITLoadStoreFloatingOff = false;
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/Core/Src/CoreParameter.h
Expand Up @@ -162,6 +162,9 @@ struct SCoreStartupParameter

int iPosX, iPosY, iWidth, iHeight;

// Fifo Player related settings
bool bLoopFifoReplay;

enum EBootBS2
{
BOOT_DEFAULT,
Expand Down
20 changes: 16 additions & 4 deletions Source/Core/Core/Src/FifoPlayer/FifoPlayer.cpp
Expand Up @@ -6,7 +6,10 @@
#include "FifoPlayer.h"

#include "Common.h"
#include "ConfigManager.h"
#include "Core.h"
#include "CoreTiming.h"
#include "Host.h"

#include "HW/GPFifo.h"
#include "HW/Memmap.h"
Expand Down Expand Up @@ -68,10 +71,18 @@ bool FifoPlayer::Play()
{
if (m_CurrentFrame >= m_FrameRangeEnd)
{
m_CurrentFrame = m_FrameRangeStart;

CoreTiming::downcount = 0;
CoreTiming::Advance();
if (m_Loop)
{
m_CurrentFrame = m_FrameRangeStart;

CoreTiming::downcount = 0;
CoreTiming::Advance();
}
else
{
PowerPC::Stop();
Host_Message(WM_USER_STOP);
}
}
else
{
Expand Down Expand Up @@ -150,6 +161,7 @@ FifoPlayer::FifoPlayer() :
m_FrameWrittenCb(NULL),
m_File(NULL)
{
m_Loop = SConfig::GetInstance().m_LocalCoreStartupParameter.bLoopFifoReplay;
}

void FifoPlayer::WriteFrame(const FifoFrameInfo &frame, const AnalyzedFrameInfo &info)
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/Src/FifoPlayer/FifoPlayer.h
Expand Up @@ -86,6 +86,8 @@ class FifoPlayer

bool ShouldLoadBP(u8 address);

bool m_Loop;

u32 m_CurrentFrame;
u32 m_FrameRangeStart;
u32 m_FrameRangeEnd;
Expand Down

0 comments on commit 5c3dcc5

Please sign in to comment.