mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 15:40:02 +00:00
GCMemcard/GCIFile: Implement LoadHeader().
This commit is contained in:
parent
884af05589
commit
5af05f6714
@ -10,6 +10,25 @@
|
|||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
#include "Common/MsgHandler.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()
|
bool GCIFile::LoadSaveBlocks()
|
||||||
{
|
{
|
||||||
if (m_save_data.empty())
|
if (m_save_data.empty())
|
||||||
|
@ -15,6 +15,7 @@ class PointerWrap;
|
|||||||
class GCIFile
|
class GCIFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
bool LoadHeader();
|
||||||
bool LoadSaveBlocks();
|
bool LoadSaveBlocks();
|
||||||
bool HasCopyProtection() const;
|
bool HasCopyProtection() const;
|
||||||
void DoState(PointerWrap& p);
|
void DoState(PointerWrap& p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user