diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp index 77f73a1224..c5a0a8c465 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp @@ -1470,6 +1470,20 @@ void Header::CalculateSerial(u32* serial1, u32* serial2) const *serial2 = serial[1] ^ serial[3] ^ serial[5] ^ serial[7]; } +DEntry::DEntry() +{ + memset(this, 0xFF, DENTRY_SIZE); +} + +std::string DEntry::GCI_FileName() const +{ + std::string filename = + std::string(reinterpret_cast(m_makercode.data()), m_makercode.size()) + '-' + + std::string(reinterpret_cast(m_gamecode.data()), m_gamecode.size()) + '-' + + reinterpret_cast(m_filename.data()) + ".gci"; + return Common::EscapeFileName(filename); +} + Directory::Directory() { memset(this, 0xFF, BLOCK_SIZE); diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.h b/Source/Core/Core/HW/GCMemcard/GCMemcard.h index bc32974e3e..b3ecd41798 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.h +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.h @@ -154,15 +154,10 @@ static_assert(sizeof(Header) == BLOCK_SIZE); struct DEntry { - DEntry() { memset(this, 0xFF, DENTRY_SIZE); } - std::string GCI_FileName() const - { - std::string filename = - std::string(reinterpret_cast(m_makercode.data()), m_makercode.size()) + '-' + - std::string(reinterpret_cast(m_gamecode.data()), m_gamecode.size()) + '-' + - reinterpret_cast(m_filename.data()) + ".gci"; - return Common::EscapeFileName(filename); - } + DEntry(); + + // TODO: This probably shouldn't be here at all? + std::string GCI_FileName() const; static constexpr std::array UNINITIALIZED_GAMECODE{{0xFF, 0xFF, 0xFF, 0xFF}};