From e0a47c11f5653ecffb79adfac29c19a163baab8f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 10 Aug 2015 16:35:23 +0200 Subject: [PATCH] Fix reading Wii FST size (for real this time) 04fcb72 fixed an issue with reading the Wii FST size, but I found a second issue when working on PR #2820 - the size must be shifted left by 2. DiscScrubber and Boot already do this correctly using separate code. --- Source/Core/DiscIO/Volume.h | 2 +- Source/Core/DiscIO/VolumeDirectory.cpp | 2 +- Source/Core/DiscIO/VolumeDirectory.h | 2 +- Source/Core/DiscIO/VolumeGC.cpp | 2 +- Source/Core/DiscIO/VolumeGC.h | 2 +- Source/Core/DiscIO/VolumeWad.h | 2 +- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 4 ++-- Source/Core/DiscIO/VolumeWiiCrypted.h | 2 +- Source/Core/DolphinWX/ISOProperties.cpp | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h index 294cf94c01..fc27c3bc68 100644 --- a/Source/Core/DiscIO/Volume.h +++ b/Source/Core/DiscIO/Volume.h @@ -89,7 +89,7 @@ public: virtual std::map GetDescriptions() const { return std::map(); } virtual std::string GetCompany() const { return std::string(); } virtual std::vector GetBanner(int* width, int* height) const; - virtual u32 GetFSTSize() const = 0; + virtual u64 GetFSTSize() const = 0; virtual std::string GetApploaderDate() const = 0; // 0 is the first disc, 1 is the second disc virtual u8 GetDiscNumber() const { return 0; } diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index 905403e14b..eadb198eeb 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -210,7 +210,7 @@ void CVolumeDirectory::SetName(const std::string& name) m_diskHeader[length + 0x20] = 0; } -u32 CVolumeDirectory::GetFSTSize() const +u64 CVolumeDirectory::GetFSTSize() const { return 0; } diff --git a/Source/Core/DiscIO/VolumeDirectory.h b/Source/Core/DiscIO/VolumeDirectory.h index 8053d209d2..4dc7fa1a9a 100644 --- a/Source/Core/DiscIO/VolumeDirectory.h +++ b/Source/Core/DiscIO/VolumeDirectory.h @@ -44,7 +44,7 @@ public: std::map GetNames(bool prefer_long) const override; void SetName(const std::string&); - u32 GetFSTSize() const override; + u64 GetFSTSize() const override; std::string GetApploaderDate() const override; EPlatform GetVolumeType() const override; diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index f2e54bdde8..b73159b083 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -143,7 +143,7 @@ std::vector CVolumeGC::GetBanner(int* width, int* height) const return image_buffer; } -u32 CVolumeGC::GetFSTSize() const +u64 CVolumeGC::GetFSTSize() const { if (m_pReader == nullptr) return 0; diff --git a/Source/Core/DiscIO/VolumeGC.h b/Source/Core/DiscIO/VolumeGC.h index c1abcb28d2..c65b447d27 100644 --- a/Source/Core/DiscIO/VolumeGC.h +++ b/Source/Core/DiscIO/VolumeGC.h @@ -33,7 +33,7 @@ public: std::map GetDescriptions() const override; std::string GetCompany() const override; std::vector GetBanner(int* width, int* height) const override; - u32 GetFSTSize() const override; + u64 GetFSTSize() const override; std::string GetApploaderDate() const override; u8 GetDiscNumber() const override; diff --git a/Source/Core/DiscIO/VolumeWad.h b/Source/Core/DiscIO/VolumeWad.h index 16168aefad..b89de9776e 100644 --- a/Source/Core/DiscIO/VolumeWad.h +++ b/Source/Core/DiscIO/VolumeWad.h @@ -33,7 +33,7 @@ public: u16 GetRevision() const override; std::string GetInternalName() const override { return ""; } std::map GetNames(bool prefer_long) const override; - u32 GetFSTSize() const override { return 0; } + u64 GetFSTSize() const override { return 0; } std::string GetApploaderDate() const override { return ""; } EPlatform GetVolumeType() const override; diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 5701dab1cc..aabbeed2c6 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -206,7 +206,7 @@ std::map CVolumeWiiCrypted::GetNames(bool prefe return ReadWiiNames(opening_bnr); } -u32 CVolumeWiiCrypted::GetFSTSize() const +u64 CVolumeWiiCrypted::GetFSTSize() const { if (m_pReader == nullptr) return 0; @@ -216,7 +216,7 @@ u32 CVolumeWiiCrypted::GetFSTSize() const if (!Read(0x428, 0x4, (u8*)&size, true)) return 0; - return Common::swap32(size); + return (u64)Common::swap32(size) << 2; } std::string CVolumeWiiCrypted::GetApploaderDate() const diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.h b/Source/Core/DiscIO/VolumeWiiCrypted.h index 88773af68b..026ba19629 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.h +++ b/Source/Core/DiscIO/VolumeWiiCrypted.h @@ -33,7 +33,7 @@ public: u16 GetRevision() const override; std::string GetInternalName() const override; std::map GetNames(bool prefer_long) const override; - u32 GetFSTSize() const override; + u64 GetFSTSize() const override; std::string GetApploaderDate() const override; u8 GetDiscNumber() const override; diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp index 0bb25ffe87..00a518af9f 100644 --- a/Source/Core/DolphinWX/ISOProperties.cpp +++ b/Source/Core/DolphinWX/ISOProperties.cpp @@ -183,9 +183,9 @@ CISOProperties::CISOProperties(const std::string& fileName, wxWindow* parent, wx wxString temp = "0x" + StrToWxStr(OpenISO->GetMakerID()); m_MakerID->SetValue(temp); - m_Revision->SetValue(wxString::Format("%u", OpenISO->GetRevision())); + m_Revision->SetValue(StrToWxStr(std::to_string(OpenISO->GetRevision()))); m_Date->SetValue(StrToWxStr(OpenISO->GetApploaderDate())); - m_FST->SetValue(wxString::Format("%u", OpenISO->GetFSTSize())); + m_FST->SetValue(StrToWxStr(std::to_string(OpenISO->GetFSTSize()))); // Here we set all the info to be shown + we set the window title bool wii = OpenISO->GetVolumeType() != DiscIO::IVolume::GAMECUBE_DISC;