GCMemcard/GCIFile: Implement LoadHeader().

This commit is contained in:
Admiral H. Curtiss 2019-05-17 21:08:21 +02:00
parent 884af05589
commit 5af05f6714
2 changed files with 20 additions and 0 deletions

View File

@ -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())

View File

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