mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Volume: Use DecodeString more
DecodeString handles the case where there is no trailing null byte, so using it lets the code be a bit simpler.
This commit is contained in:
@ -70,29 +70,25 @@ IVolume::ECountry CVolumeWAD::GetCountry() const
|
||||
|
||||
std::string CVolumeWAD::GetUniqueID() const
|
||||
{
|
||||
std::string temp = GetMakerID();
|
||||
|
||||
char GameCode[8];
|
||||
char GameCode[6];
|
||||
if (!Read(m_offset + 0x01E0, 4, (u8*)GameCode))
|
||||
return "0";
|
||||
|
||||
std::string temp = GetMakerID();
|
||||
GameCode[4] = temp.at(0);
|
||||
GameCode[5] = temp.at(1);
|
||||
GameCode[6] = 0;
|
||||
|
||||
return GameCode;
|
||||
return DecodeString(GameCode);
|
||||
}
|
||||
|
||||
std::string CVolumeWAD::GetMakerID() const
|
||||
{
|
||||
char temp[3] = {1};
|
||||
char temp[2] = {1};
|
||||
// Some weird channels use 0x0000 in place of the MakerID, so we need a check there
|
||||
if (!Read(0x198 + m_tmd_offset, 2, (u8*)temp) || temp[0] == 0 || temp[1] == 0)
|
||||
return "00";
|
||||
|
||||
temp[2] = 0;
|
||||
|
||||
return temp;
|
||||
return DecodeString(temp);
|
||||
}
|
||||
|
||||
bool CVolumeWAD::GetTitleID(u8* _pBuffer) const
|
||||
|
Reference in New Issue
Block a user