GCMemcard: Initialize the current/previous DIR BAT pointers when creating a new memory card fixes issue 6288
This commit is contained in:
parent
8bcd9a74c8
commit
c80309ee1a
|
@ -216,6 +216,11 @@ 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;
|
||||
|
@ -1274,6 +1279,7 @@ bool GCMemcard::Format(bool sjis, u16 SizeMb)
|
|||
mc_data_blocks.push_back(b);
|
||||
}
|
||||
|
||||
initDirBatPointers();
|
||||
m_valid = true;
|
||||
|
||||
return Save();
|
||||
|
|
|
@ -171,6 +171,7 @@ private:
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue