From 593f58be6cfe96d07c0e43f7004b2fee0f4a73d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 22 May 2018 19:05:45 +0200 Subject: [PATCH] Move Wii FS content init to happen after Boot Initialising Wii filesystem contents should be done after Boot and not in HW to ensure that we operate with the correct title context and to make sure required title directories exist (so that Movie and Netplay code can copy data from and to the temporary NAND). --- Source/Core/Core/Core.cpp | 6 ++++++ Source/Core/Core/HW/HW.cpp | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index b27c243fee..03f1fd4fad 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -517,6 +517,12 @@ static void EmuThread(std::unique_ptr boot) if (!CBoot::BootUp(std::move(boot))) return; + // Initialise Wii filesystem contents. + // This is done here after Boot and not in HW to ensure that we operate + // with the correct title context since save copying requires title directories to exist. + Common::ScopeGuard wiifs_guard{Core::CleanUpWiiFileSystemContents}; + Core::InitializeWiiFileSystemContents(); + // This adds the SyncGPU handler to CoreTiming, so now CoreTiming::Advance might block. Fifo::Prepare(); diff --git a/Source/Core/Core/HW/HW.cpp b/Source/Core/Core/HW/HW.cpp index a60102bf7e..5cf808ee3f 100644 --- a/Source/Core/Core/HW/HW.cpp +++ b/Source/Core/Core/HW/HW.cpp @@ -54,13 +54,11 @@ void Init() Core::InitializeWiiRoot(Core::WantsDeterminism()); IOS::Init(); IOS::HLE::Init(); // Depends on Memory - Core::InitializeWiiFileSystemContents(); } } void Shutdown() { - Core::CleanUpWiiFileSystemContents(); // IOS should always be shut down regardless of bWii because it can be running in GC mode (MIOS). IOS::HLE::Shutdown(); // Depends on Memory IOS::Shutdown();