mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Don't read from volume when reloading Wii banners
Should make loading cached Wii games that lack banners slightly faster.
This commit is contained in:
@ -90,7 +90,7 @@ public:
|
||||
virtual std::map<ELanguage, std::string> GetNames(bool prefer_long) const = 0;
|
||||
virtual std::map<ELanguage, std::string> GetDescriptions() const { return std::map<ELanguage, std::string>(); }
|
||||
virtual std::string GetCompany() const { return std::string(); }
|
||||
virtual std::vector<u32> GetBanner(int* width, int* height) const;
|
||||
virtual std::vector<u32> GetBanner(int* width, int* height) const = 0;
|
||||
virtual u64 GetFSTSize() const = 0;
|
||||
virtual std::string GetApploaderDate() const = 0;
|
||||
// 0 is the first disc, 1 is the second disc
|
||||
@ -108,6 +108,8 @@ public:
|
||||
// Size on disc (compressed size)
|
||||
virtual u64 GetRawSize() const = 0;
|
||||
|
||||
static std::vector<u32> GetWiiBanner(int* width, int* height, u64 title_id);
|
||||
|
||||
protected:
|
||||
template <u32 N>
|
||||
std::string DecodeString(const char(&data)[N]) const
|
||||
|
@ -24,14 +24,11 @@ static const unsigned int WII_BANNER_HEIGHT = 64;
|
||||
static const unsigned int WII_BANNER_SIZE = WII_BANNER_WIDTH * WII_BANNER_HEIGHT * 2;
|
||||
static const unsigned int WII_BANNER_OFFSET = 0xA0;
|
||||
|
||||
std::vector<u32> IVolume::GetBanner(int* width, int* height) const
|
||||
std::vector<u32> IVolume::GetWiiBanner(int* width, int* height, u64 title_id)
|
||||
{
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
u64 title_id = 0;
|
||||
GetTitleID(&title_id);
|
||||
|
||||
std::string file_name = StringFromFormat("%s/title/%08x/%08x/data/banner.bin",
|
||||
File::GetUserPath(D_WIIROOT_IDX).c_str(), (u32)(title_id >> 32), (u32)title_id);
|
||||
if (!File::Exists(file_name))
|
||||
|
@ -183,7 +183,8 @@ IVolume::ECountry CVolumeDirectory::GetCountry() const
|
||||
|
||||
std::string CVolumeDirectory::GetMakerID() const
|
||||
{
|
||||
return "VOID";
|
||||
// Not implemented
|
||||
return "00";
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetInternalName() const
|
||||
@ -204,6 +205,14 @@ std::map<IVolume::ELanguage, std::string> CVolumeDirectory::GetNames(bool prefer
|
||||
return names;
|
||||
}
|
||||
|
||||
std::vector<u32> CVolumeDirectory::GetBanner(int* width, int* height) const
|
||||
{
|
||||
// Not implemented
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
return std::vector<u32>();
|
||||
}
|
||||
|
||||
void CVolumeDirectory::SetName(const std::string& name)
|
||||
{
|
||||
size_t length = name.length();
|
||||
@ -216,11 +225,13 @@ void CVolumeDirectory::SetName(const std::string& name)
|
||||
|
||||
u64 CVolumeDirectory::GetFSTSize() const
|
||||
{
|
||||
// Not implemented
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetApploaderDate() const
|
||||
{
|
||||
// Not implemented
|
||||
return "VOID";
|
||||
}
|
||||
|
||||
@ -239,12 +250,14 @@ BlobType CVolumeDirectory::GetBlobType() const
|
||||
|
||||
u64 CVolumeDirectory::GetSize() const
|
||||
{
|
||||
// Not implemented
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 CVolumeDirectory::GetRawSize() const
|
||||
{
|
||||
return GetSize();
|
||||
// Not implemented
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::ExtractDirectoryName(const std::string& _rDirectory)
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
u16 GetRevision() const override { return 0; }
|
||||
std::string GetInternalName() const override;
|
||||
std::map<IVolume::ELanguage, std::string> GetNames(bool prefer_long) const override;
|
||||
std::vector<u32> GetBanner(int* width, int* height) const override;
|
||||
void SetName(const std::string&);
|
||||
|
||||
u64 GetFSTSize() const override;
|
||||
|
@ -127,6 +127,18 @@ std::map<IVolume::ELanguage, std::string> CVolumeWAD::GetNames(bool prefer_long)
|
||||
return ReadWiiNames(name_data);
|
||||
}
|
||||
|
||||
std::vector<u32> CVolumeWAD::GetBanner(int* width, int* height) const
|
||||
{
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
u64 title_id;
|
||||
if (!GetTitleID(&title_id))
|
||||
return std::vector<u32>();
|
||||
|
||||
return GetWiiBanner(width, height, title_id);
|
||||
}
|
||||
|
||||
BlobType CVolumeWAD::GetBlobType() const
|
||||
{
|
||||
return m_pReader ? m_pReader->GetBlobType() : BlobType::PLAIN;
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
u16 GetRevision() const override;
|
||||
std::string GetInternalName() const override { return ""; }
|
||||
std::map<IVolume::ELanguage, std::string> GetNames(bool prefer_long) const override;
|
||||
std::vector<u32> GetBanner(int* width, int* height) const override;
|
||||
u64 GetFSTSize() const override { return 0; }
|
||||
std::string GetApploaderDate() const override { return ""; }
|
||||
|
||||
|
@ -212,6 +212,18 @@ std::map<IVolume::ELanguage, std::string> CVolumeWiiCrypted::GetNames(bool prefe
|
||||
return ReadWiiNames(opening_bnr);
|
||||
}
|
||||
|
||||
std::vector<u32> CVolumeWiiCrypted::GetBanner(int* width, int* height) const
|
||||
{
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
u64 title_id;
|
||||
if (!GetTitleID(&title_id))
|
||||
return std::vector<u32>();
|
||||
|
||||
return GetWiiBanner(width, height, title_id);
|
||||
}
|
||||
|
||||
u64 CVolumeWiiCrypted::GetFSTSize() const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
u16 GetRevision() const override;
|
||||
std::string GetInternalName() const override;
|
||||
std::map<IVolume::ELanguage, std::string> GetNames(bool prefer_long) const override;
|
||||
std::vector<u32> GetBanner(int* width, int* height) const override;
|
||||
u64 GetFSTSize() const override;
|
||||
std::string GetApploaderDate() const override;
|
||||
u8 GetDiscNumber() const override;
|
||||
|
Reference in New Issue
Block a user