mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Core/Movie: Refactor to class, move to System.
A bit of global state remains (the `header` in `BeginRecordingInput()`) due to unclear lifetime requirements.
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
#include "Core/Movie.h"
|
||||
#include "Core/NetPlayClient.h"
|
||||
#include "Core/SysConf.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
@ -127,24 +128,25 @@ static bool CopyNandFile(FS::FileSystem* source_fs, const std::string& source_fi
|
||||
static void InitializeDeterministicWiiSaves(FS::FileSystem* session_fs,
|
||||
const BootSessionData& boot_session_data)
|
||||
{
|
||||
auto& movie = Core::System::GetInstance().GetMovie();
|
||||
const u64 title_id = SConfig::GetInstance().GetTitleID();
|
||||
const auto configured_fs = FS::MakeFileSystem(FS::Location::Configured);
|
||||
if (Movie::IsRecordingInput())
|
||||
if (movie.IsRecordingInput())
|
||||
{
|
||||
if (NetPlay::IsNetPlayRunning() && !SConfig::GetInstance().bCopyWiiSaveNetplay)
|
||||
{
|
||||
Movie::SetClearSave(true);
|
||||
movie.SetClearSave(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Check for the actual save data
|
||||
const std::string path = Common::GetTitleDataPath(title_id) + "/banner.bin";
|
||||
Movie::SetClearSave(!configured_fs->GetMetadata(IOS::PID_KERNEL, IOS::PID_KERNEL, path));
|
||||
movie.SetClearSave(!configured_fs->GetMetadata(IOS::PID_KERNEL, IOS::PID_KERNEL, path));
|
||||
}
|
||||
}
|
||||
|
||||
if ((NetPlay::IsNetPlayRunning() && SConfig::GetInstance().bCopyWiiSaveNetplay) ||
|
||||
(Movie::IsMovieActive() && !Movie::IsStartingFromClearSave()))
|
||||
(movie.IsMovieActive() && !movie.IsStartingFromClearSave()))
|
||||
{
|
||||
auto* sync_fs = boot_session_data.GetWiiSyncFS();
|
||||
auto& sync_titles = boot_session_data.GetWiiSyncTitles();
|
||||
@ -154,7 +156,7 @@ static void InitializeDeterministicWiiSaves(FS::FileSystem* session_fs,
|
||||
sync_fs ? "sync_fs" : "configured_fs");
|
||||
|
||||
// Copy the current user's save to the Blank NAND
|
||||
if (Movie::IsMovieActive() && !NetPlay::IsNetPlayRunning())
|
||||
if (movie.IsMovieActive() && !NetPlay::IsNetPlayRunning())
|
||||
{
|
||||
INFO_LOG_FMT(CORE, "Wii Save Init: Copying {0:016x}.", title_id);
|
||||
CopySave(source_fs, session_fs, title_id);
|
||||
|
Reference in New Issue
Block a user