FileMonitor redesign

Advantages:

* Simpler code in general
* No extra volume objects created
* Now actually notices if the disc or partition gets
  changed while the core is running
* No longer picks up on disc access done by the GUI
  (it used to do so as long as the core was running)
* Gets rid of a Core dependency in DiscIO

There are two performance disadvantages:

* FileMonitor is now a bit slower when used with VolumeDirectory
  because FileMonitor now always uses the FileSystemGCWii code
  for finding filenames instead of VolumeDirectory finding the
  filename on its own and directly hooking into FileMonitor.
  But this isn't such a big deal, because it's happening on the
  DVD thread, and my currently unmerged file system PR will make
  FileSystemGCWii's file finding code about as fast as
  VolumeDirectory's.
* FileMonitor's creation of the file system object is now
  done on the CPU thread instead of the DVD thread, and
  it will be done even if FileMonitor logging is disabled.
  This will be fixed in the next commit.
This commit is contained in:
JosJuice
2017-02-12 13:02:57 +01:00
parent 8035270aa8
commit b470fa5454
17 changed files with 153 additions and 191 deletions

View File

@ -19,7 +19,6 @@
#include "Common/Logging/Log.h"
#include "DiscIO/Blob.h"
#include "DiscIO/Enums.h"
#include "DiscIO/FileMonitor.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeDirectory.h"
@ -130,8 +129,6 @@ bool CVolumeDirectory::Read(u64 offset, u64 length, u8* buffer, bool decrypt) co
u64 fileSize = file.GetSize();
FileMon::CheckFile(fileName, fileSize);
if (fileOffset < fileSize)
{
u64 fileBytes = std::min(fileSize - fileOffset, length);