summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Volume.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-03-16 11:03:36 +0100
committerGitHub <noreply@github.com>2021-03-16 11:03:36 +0100
commitc8d8f9ef8506e8ca30b134b307b77a95c7b91623 (patch)
treeea39d6f9c2bd07120d3edaf38d7b10a16b1264a8 /Source/Core/DiscIO/Volume.cpp
parent3fcc018fa7173e80b52758ca81b5d00eef018ac6 (diff)
parente47c9764de5c2e8f273c9dcf52b3730914f05521 (diff)
Merge pull request #9577 from JosJuice/di-unknown-size-hack
DVDInterface: Make the WBFS/CISO hack only affect WBFS/CISO
Diffstat (limited to 'Source/Core/DiscIO/Volume.cpp')
-rw-r--r--Source/Core/DiscIO/Volume.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/Volume.cpp b/Source/Core/DiscIO/Volume.cpp
index ab4b0e562b..911a486a4e 100644
--- a/Source/Core/DiscIO/Volume.cpp
+++ b/Source/Core/DiscIO/Volume.cpp
@@ -20,6 +20,7 @@
#include "Core/IOS/ES/Formats.h"
#include "DiscIO/Blob.h"
+#include "DiscIO/DiscUtils.h"
#include "DiscIO/Enums.h"
#include "DiscIO/VolumeDisc.h"
#include "DiscIO/VolumeGC.h"
@@ -87,14 +88,10 @@ std::map<Language, std::string> Volume::ReadWiiNames(const std::vector<char16_t>
static std::unique_ptr<VolumeDisc> CreateDisc(std::unique_ptr<BlobReader>& reader)
{
- // Check for Wii
- const std::optional<u32> wii_magic = reader->ReadSwapped<u32>(0x18);
- if (wii_magic == u32(0x5D1C9EA3))
+ if (reader->ReadSwapped<u32>(0x18) == WII_DISC_MAGIC)
return std::make_unique<VolumeWii>(std::move(reader));
- // Check for GC
- const std::optional<u32> gc_magic = reader->ReadSwapped<u32>(0x1C);
- if (gc_magic == u32(0xC2339F3D))
+ if (reader->ReadSwapped<u32>(0x1C) == GAMECUBE_DISC_MAGIC)
return std::make_unique<VolumeGC>(std::move(reader));
// No known magic words found