diff options
| author | JosJuice <josjuice@gmail.com> | 2015-07-31 13:56:29 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-06-13 22:44:11 +0200 |
| commit | 1262f08ac119e5d12ec48688f66e8b12e52b6d29 (patch) | |
| tree | 1888cca63006e92f7e1e98d1eca8039f76a8f182 /Source/Core/DiscIO/FileSystemGCWii.cpp | |
| parent | afe2bc60f634cf1d417680cefc51b3caeb3cfbf2 (diff) | |
Filesystem: Better validity checking
Now that the FST in read in the constructor, m_Valid
can be set to false when there are errors in the FST.
Diffstat (limited to 'Source/Core/DiscIO/FileSystemGCWii.cpp')
| -rw-r--r-- | Source/Core/DiscIO/FileSystemGCWii.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/FileSystemGCWii.cpp b/Source/Core/DiscIO/FileSystemGCWii.cpp index 813201b7a0..8e8254e21c 100644 --- a/Source/Core/DiscIO/FileSystemGCWii.cpp +++ b/Source/Core/DiscIO/FileSystemGCWii.cpp @@ -64,17 +64,10 @@ FileSystemGCWii::FileSystemGCWii(const Volume* _rVolume, const Partition& partit { // Check if this is a GameCube or Wii disc if (m_rVolume->ReadSwapped<u32>(0x18, m_partition) == u32(0x5D1C9EA3)) - { m_offset_shift = 2; // Wii file system - m_Valid = true; - } else if (m_rVolume->ReadSwapped<u32>(0x1c, m_partition) == u32(0xC2339F3D)) - { m_offset_shift = 0; // GameCube file system - m_Valid = true; - } - - if (!m_Valid) + else return; const std::optional<u32> fst_offset_unshifted = m_rVolume->ReadSwapped<u32>(0x424, m_partition); @@ -112,6 +105,9 @@ FileSystemGCWii::FileSystemGCWii(const Volume* _rVolume, const Partition& partit return; for (u32 i = 0; i < number_of_file_infos; i++) m_FileInfoVector.emplace_back(m_offset_shift, fst_start + (i * 0xC), name_table_start); + + // If we haven't returned yet, everything succeeded + m_Valid = true; } FileSystemGCWii::~FileSystemGCWii() |
