summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/VolumeGC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DiscIO/Src/VolumeGC.cpp')
-rw-r--r--Source/Core/DiscIO/Src/VolumeGC.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp
index 09e2c5eaa9..6210172790 100644
--- a/Source/Core/DiscIO/Src/VolumeGC.cpp
+++ b/Source/Core/DiscIO/Src/VolumeGC.cpp
@@ -91,16 +91,17 @@ std::string CVolumeGC::GetMakerID() const
return makerID;
}
-std::string CVolumeGC::GetName() const
+std::vector<std::string> CVolumeGC::GetNames() const
{
- if (m_pReader == NULL)
- return "";
+ std::vector<std::string> names;
+
+ auto const string_decoder = GetStringDecoder(GetCountry());
- char name[128];
- if (!Read(0x20, 0x60, (u8*)&name))
- return "";
+ char name[0x60 + 1] = {};
+ if (m_pReader != NULL && Read(0x20, 0x60, (u8*)name))
+ names.push_back(string_decoder(name));
- return name;
+ return names;
}
u32 CVolumeGC::GetFSTSize() const
@@ -144,4 +145,10 @@ bool CVolumeGC::IsDiscTwo() const
return discTwo;
}
+auto CVolumeGC::GetStringDecoder(ECountry country) -> StringDecoder
+{
+ return (COUNTRY_JAPAN == country || COUNTRY_TAIWAN == country) ?
+ SHIFTJISToUTF8 : CP1252ToUTF8;
+}
+
} // namespace