From 8624461315c5baaf23b3d13a0365de69a95266e6 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 25 Dec 2014 11:01:18 +0100 Subject: [PATCH 1/2] Re-add FileMonitor support for Wii discs This in done in the same way as GC discs, unlike the previous implementation. --- Source/Core/DiscIO/FileMonitor.cpp | 2 +- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp index 770716d2ca..6cb8c410ef 100644 --- a/Source/Core/DiscIO/FileMonitor.cpp +++ b/Source/Core/DiscIO/FileMonitor.cpp @@ -79,7 +79,7 @@ void ReadGC(const std::string& filename) if (!OpenISO) return; - if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO)) + if (!DiscIO::IsVolumeWadFile(OpenISO)) { pFileSystem = DiscIO::CreateFileSystem(OpenISO); diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index e769a1cae8..0f44230476 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -14,6 +14,7 @@ #include "Common/MsgHandler.h" #include "Common/Logging/Log.h" #include "DiscIO/Blob.h" +#include "DiscIO/FileMonitor.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeCreator.h" #include "DiscIO/VolumeGC.h" @@ -69,6 +70,8 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const if (m_pReader == nullptr) return(false); + FileMon::FindFilename(_ReadOffset); + while (_Length > 0) { static unsigned char IV[16]; From 1618d315237a88b7ebce4866cacf590c6fccbf07 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 25 Dec 2014 11:12:04 +0100 Subject: [PATCH 2/2] FileMonitor: Get rid of "GC" from names and comments --- Source/Core/DiscIO/FileMonitor.cpp | 21 +++++++++++---------- Source/Core/DiscIO/FileMonitor.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp index 6cb8c410ef..16c110716e 100644 --- a/Source/Core/DiscIO/FileMonitor.cpp +++ b/Source/Core/DiscIO/FileMonitor.cpp @@ -27,7 +27,7 @@ namespace FileMon static DiscIO::IVolume *OpenISO = nullptr; static DiscIO::IFileSystem *pFileSystem = nullptr; -static std::vector GCFiles; +static std::vector DiscFiles; static std::string ISOFile = "", CurrentFile = ""; static bool FileAccess = true; @@ -58,8 +58,8 @@ bool IsSoundFile(const std::string& filename) } -// Read the GC file system -void ReadGC(const std::string& filename) +// Read the file system +void ReadFileSystem(const std::string& filename) { // Should have an actual Shutdown procedure or something if (OpenISO != nullptr) @@ -73,8 +73,8 @@ void ReadGC(const std::string& filename) pFileSystem = nullptr; } - // GCFiles' pointers are no longer valid after pFileSystem is cleared - GCFiles.clear(); + // DiscFiles' pointers are no longer valid after pFileSystem is cleared + DiscFiles.clear(); OpenISO = DiscIO::CreateVolumeFromFilename(filename); if (!OpenISO) return; @@ -86,8 +86,9 @@ void ReadGC(const std::string& filename) if (!pFileSystem) return; - pFileSystem->GetFileList(GCFiles); + pFileSystem->GetFileList(DiscFiles); } + FileAccess = true; } @@ -119,7 +120,7 @@ void CheckFile(const std::string& file, u64 size) } -// Find the GC filename +// Find the filename void FindFilename(u64 offset) { // Don't do anything if a game is not running @@ -137,7 +138,7 @@ void FindFilename(u64 offset) if (!pFileSystem || ISOFile != SConfig::GetInstance().m_LastFilename) { FileAccess = false; - ReadGC(SConfig::GetInstance().m_LastFilename); + ReadFileSystem(SConfig::GetInstance().m_LastFilename); ISOFile = SConfig::GetInstance().m_LastFilename; INFO_LOG(FILEMON, "Opening '%s'", ISOFile.c_str()); return; @@ -165,8 +166,8 @@ void Close() pFileSystem = nullptr; } - // GCFiles' pointers are no longer valid after pFileSystem is cleared - GCFiles.clear(); + // DiscFiles' pointers are no longer valid after pFileSystem is cleared + DiscFiles.clear(); ISOFile = ""; CurrentFile = ""; diff --git a/Source/Core/DiscIO/FileMonitor.h b/Source/Core/DiscIO/FileMonitor.h index 6ca49b1673..4c6a3ab4ff 100644 --- a/Source/Core/DiscIO/FileMonitor.h +++ b/Source/Core/DiscIO/FileMonitor.h @@ -12,7 +12,7 @@ namespace FileMon { bool IsSoundFile(const std::string& filename); -void ReadGC(const std::string& file); +void ReadFileSystem(const std::string& file); void CheckFile(const std::string& file, u64 size); void FindFilename(u64 offset); void Close();