Skip to content
Permalink
Browse files

GCMemcard: DEntry: Move code out of header.

  • Loading branch information...
AdmiralCurtiss committed Apr 21, 2019
1 parent 17da22a commit 6e04e4dd6afdfc0f3218377ed7a48763bf51f0fb
Showing with 18 additions and 9 deletions.
  1. +14 −0 Source/Core/Core/HW/GCMemcard/GCMemcard.cpp
  2. +4 −9 Source/Core/Core/HW/GCMemcard/GCMemcard.h
@@ -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<const char*>(m_makercode.data()), m_makercode.size()) + '-' +
std::string(reinterpret_cast<const char*>(m_gamecode.data()), m_gamecode.size()) + '-' +
reinterpret_cast<const char*>(m_filename.data()) + ".gci";
return Common::EscapeFileName(filename);
}

Directory::Directory()
{
memset(this, 0xFF, BLOCK_SIZE);
@@ -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<const char*>(m_makercode.data()), m_makercode.size()) + '-' +
std::string(reinterpret_cast<const char*>(m_gamecode.data()), m_gamecode.size()) + '-' +
reinterpret_cast<const char*>(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<u8, 4> UNINITIALIZED_GAMECODE{{0xFF, 0xFF, 0xFF, 0xFF}};

0 comments on commit 6e04e4d

Please sign in to comment.
You can’t perform that action at this time.