Fix more of what I broke.

This commit is contained in:
Jordan Woyak
2013-03-03 16:51:26 -06:00
parent b1a2915304
commit c07b8a6e37
8 changed files with 97 additions and 61 deletions

View File

@ -94,10 +94,12 @@ std::string CVolumeGC::GetMakerID() const
std::vector<std::string> CVolumeGC::GetNames() const
{
std::vector<std::string> names;
auto const string_decoder = GetStringDecoder(GetCountry());
char name[128] = {};
if (m_pReader != NULL && Read(0x20, 0x60, (u8*)&name))
names.push_back(name);
char name[0x60 + 1] = {};
if (m_pReader != NULL && Read(0x20, 0x60, (u8*)name))
names.push_back(string_decoder(name));
return names;
}
@ -143,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