Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GCMemcard: Initialize the current/previous DIR BAT pointers when crea…
…ting a new memory card fixes issue 6288
  • Loading branch information
LPFaint99 committed May 1, 2013
1 parent 8bcd9a7 commit c80309e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Core/Core/Src/HW/GCMemcard.cpp
Expand Up @@ -215,7 +215,12 @@ GCMemcard::GCMemcard(const char *filename, bool forceCreation, bool sjis)
}

mcdFile.Close();

initDirBatPointers();
}

void GCMemcard::initDirBatPointers()
{
if (BE16(dir.UpdateCounter) > (BE16(dir_backup.UpdateCounter)))
{
CurrentDir = &dir;
Expand Down Expand Up @@ -1273,7 +1278,8 @@ bool GCMemcard::Format(bool sjis, u16 SizeMb)
GCMBlock b;
mc_data_blocks.push_back(b);
}


initDirBatPointers();
m_valid = true;

return Save();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Src/HW/GCMemcard.h
Expand Up @@ -171,6 +171,7 @@ class GCMemcard : NonCopyable

u32 ImportGciInternal(FILE* gcih, const char *inputFile, const std::string &outputFile);
static void FormatInternal(GCMC_Header &GCP);
void initDirBatPointers() ;
public:

GCMemcard(const char* fileName, bool forceCreation=false, bool sjis=false);
Expand Down

0 comments on commit c80309e

Please sign in to comment.