GCMemcard: GCMBlock: Move code out of header.

This commit is contained in:
Admiral H. Curtiss 2019-04-21 17:37:03 +02:00
parent e4094d9d2d
commit 17da22a84f
2 changed files with 12 additions and 2 deletions

View File

@ -1420,6 +1420,16 @@ s32 GCMemcard::PSO_MakeSaveGameValid(const Header& cardheader, const DEntry& dir
return 1; return 1;
} }
GCMBlock::GCMBlock()
{
Erase();
}
void GCMBlock::Erase()
{
memset(m_block.data(), 0xFF, m_block.size());
}
Header::Header(int slot, u16 size_mbits, bool shift_jis) Header::Header(int slot, u16 size_mbits, bool shift_jis)
{ {
// Nintendo format algorithm. // Nintendo format algorithm.

View File

@ -92,8 +92,8 @@ protected:
struct GCMBlock struct GCMBlock
{ {
GCMBlock() { Erase(); } GCMBlock();
void Erase() { memset(m_block.data(), 0xFF, m_block.size()); } void Erase();
std::array<u8, BLOCK_SIZE> m_block; std::array<u8, BLOCK_SIZE> m_block;
}; };