Skip to content
Permalink
Browse files

GCMemcard/GCIFile: Implement LoadHeader().

  • Loading branch information...
AdmiralCurtiss committed May 17, 2019
1 parent 884af05 commit 5af05f671446e65f2e10bad09d2ca94bf633fcf3
Showing with 20 additions and 0 deletions.
  1. +19 −0 Source/Core/Core/HW/GCMemcard/GCIFile.cpp
  2. +1 −0 Source/Core/Core/HW/GCMemcard/GCIFile.h
@@ -10,6 +10,25 @@
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"

bool GCIFile::LoadHeader()
{
if (m_filename.empty())
return false;

File::IOFile save_file(m_filename, "rb");
if (!save_file)
return false;

INFO_LOG(EXPANSIONINTERFACE, "Reading header from disk for %s", m_filename.c_str());
if (!save_file.ReadBytes(&m_gci_header, sizeof(m_gci_header)))
{
ERROR_LOG(EXPANSIONINTERFACE, "Failed to read header for %s", m_filename.c_str());
return false;
}

return true;
}

bool GCIFile::LoadSaveBlocks()
{
if (m_save_data.empty())
@@ -15,6 +15,7 @@ class PointerWrap;
class GCIFile
{
public:
bool LoadHeader();
bool LoadSaveBlocks();
bool HasCopyProtection() const;
void DoState(PointerWrap& p);

0 comments on commit 5af05f6

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