Skip to content

Commit

Permalink
GCMemcard: Rename Directory variables to match our naming conventions.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Dec 9, 2018
1 parent 15f89d3 commit 17208f4
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 72 deletions.
108 changes: 54 additions & 54 deletions Source/Core/Core/HW/GCMemcard/GCMemcard.cpp
Expand Up @@ -173,7 +173,7 @@ GCMemcard::GCMemcard(const std::string& filename, bool forceCreation, bool shift
// the backup should be copied? // the backup should be copied?
// } // }
// //
// if (BE16(dir_backup.UpdateCounter) > BE16(dir.UpdateCounter)) //check if the backup is newer // if (BE16(dir_backup.m_update_counter) > BE16(dir.m_update_counter)) //check if the backup is newer
// { // {
// dir = dir_backup; // dir = dir_backup;
// bat = bat_backup; // needed? // bat = bat_backup; // needed?
Expand Down Expand Up @@ -209,7 +209,7 @@ GCMemcard::GCMemcard(const std::string& filename, bool forceCreation, bool shift


void GCMemcard::InitDirBatPointers() void GCMemcard::InitDirBatPointers()
{ {
if (BE16(dir.UpdateCounter) > (BE16(dir_backup.UpdateCounter))) if (BE16(dir.m_update_counter) > (BE16(dir_backup.m_update_counter)))
{ {
CurrentDir = &dir; CurrentDir = &dir;
PreviousDir = &dir_backup; PreviousDir = &dir_backup;
Expand Down Expand Up @@ -287,11 +287,11 @@ u32 GCMemcard::TestChecksums() const
results |= 1; results |= 1;


calc_checksumsBE((u16*)&dir, 0xFFE, &csum, &csum_inv); calc_checksumsBE((u16*)&dir, 0xFFE, &csum, &csum_inv);
if ((dir.Checksum != csum) || (dir.Checksum_Inv != csum_inv)) if ((dir.m_checksum != csum) || (dir.m_checksum_inv != csum_inv))
results |= 2; results |= 2;


calc_checksumsBE((u16*)&dir_backup, 0xFFE, &csum, &csum_inv); calc_checksumsBE((u16*)&dir_backup, 0xFFE, &csum, &csum_inv);
if ((dir_backup.Checksum != csum) || (dir_backup.Checksum_Inv != csum_inv)) if ((dir_backup.m_checksum != csum) || (dir_backup.m_checksum_inv != csum_inv))
results |= 4; results |= 4;


calc_checksumsBE((u16*)(((u8*)&bat) + 4), 0xFFE, &csum, &csum_inv); calc_checksumsBE((u16*)(((u8*)&bat) + 4), 0xFFE, &csum, &csum_inv);
Expand All @@ -311,8 +311,8 @@ bool GCMemcard::FixChecksums()
return false; return false;


calc_checksumsBE((u16*)&hdr, 0xFE, &hdr.m_checksum, &hdr.m_checksum_inv); calc_checksumsBE((u16*)&hdr, 0xFE, &hdr.m_checksum, &hdr.m_checksum_inv);
calc_checksumsBE((u16*)&dir, 0xFFE, &dir.Checksum, &dir.Checksum_Inv); calc_checksumsBE((u16*)&dir, 0xFFE, &dir.m_checksum, &dir.m_checksum_inv);
calc_checksumsBE((u16*)&dir_backup, 0xFFE, &dir_backup.Checksum, &dir_backup.Checksum_Inv); calc_checksumsBE((u16*)&dir_backup, 0xFFE, &dir_backup.m_checksum, &dir_backup.m_checksum_inv);
calc_checksumsBE((u16*)&bat + 2, 0xFFE, &bat.Checksum, &bat.Checksum_Inv); calc_checksumsBE((u16*)&bat + 2, 0xFFE, &bat.Checksum, &bat.Checksum_Inv);
calc_checksumsBE((u16*)&bat_backup + 2, 0xFFE, &bat_backup.Checksum, &bat_backup.Checksum_Inv); calc_checksumsBE((u16*)&bat_backup + 2, 0xFFE, &bat_backup.Checksum, &bat_backup.Checksum_Inv);


Expand All @@ -327,7 +327,7 @@ u8 GCMemcard::GetNumFiles() const
u8 j = 0; u8 j = 0;
for (int i = 0; i < DIRLEN; i++) for (int i = 0; i < DIRLEN; i++)
{ {
if (BE32(CurrentDir->Dir[i].m_gamecode) != 0xFFFFFFFF) if (BE32(CurrentDir->m_dir_entries[i].m_gamecode) != 0xFFFFFFFF)
j++; j++;
} }
return j; return j;
Expand All @@ -340,7 +340,7 @@ u8 GCMemcard::GetFileIndex(u8 fileNumber) const
u8 j = 0; u8 j = 0;
for (u8 i = 0; i < DIRLEN; i++) for (u8 i = 0; i < DIRLEN; i++)
{ {
if (BE32(CurrentDir->Dir[i].m_gamecode) != 0xFFFFFFFF) if (BE32(CurrentDir->m_dir_entries[i].m_gamecode) != 0xFFFFFFFF)
{ {
if (j == fileNumber) if (j == fileNumber)
{ {
Expand Down Expand Up @@ -369,8 +369,8 @@ u8 GCMemcard::TitlePresent(const DEntry& d) const
u8 i = 0; u8 i = 0;
while (i < DIRLEN) while (i < DIRLEN)
{ {
if ((BE32(CurrentDir->Dir[i].m_gamecode) == BE32(d.m_gamecode)) && if ((BE32(CurrentDir->m_dir_entries[i].m_gamecode) == BE32(d.m_gamecode)) &&
(!memcmp(CurrentDir->Dir[i].m_filename, d.m_filename, 32))) (!memcmp(CurrentDir->m_dir_entries[i].m_filename, d.m_filename, 32)))
{ {
break; break;
} }
Expand All @@ -381,10 +381,10 @@ u8 GCMemcard::TitlePresent(const DEntry& d) const


bool GCMemcard::GCI_FileName(u8 index, std::string& filename) const bool GCMemcard::GCI_FileName(u8 index, std::string& filename) const
{ {
if (!m_valid || index >= DIRLEN || (BE32(CurrentDir->Dir[index].m_gamecode) == 0xFFFFFFFF)) if (!m_valid || index >= DIRLEN || (BE32(CurrentDir->m_dir_entries[index].m_gamecode) == 0xFFFFFFFF))
return false; return false;


filename = CurrentDir->Dir[index].GCI_FileName(); filename = CurrentDir->m_dir_entries[index].GCI_FileName();
return true; return true;
} }


Expand All @@ -396,15 +396,15 @@ std::string GCMemcard::DEntry_GameCode(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


return std::string((const char*)CurrentDir->Dir[index].m_gamecode, 4); return std::string((const char*)CurrentDir->m_dir_entries[index].m_gamecode, 4);
} }


std::string GCMemcard::DEntry_Makercode(u8 index) const std::string GCMemcard::DEntry_Makercode(u8 index) const
{ {
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


return std::string((const char*)CurrentDir->Dir[index].m_makercode, 2); return std::string((const char*)CurrentDir->m_dir_entries[index].m_makercode, 2);
} }


std::string GCMemcard::DEntry_BIFlags(u8 index) const std::string GCMemcard::DEntry_BIFlags(u8 index) const
Expand All @@ -413,7 +413,7 @@ std::string GCMemcard::DEntry_BIFlags(u8 index) const
return ""; return "";


std::string flags; std::string flags;
int x = CurrentDir->Dir[index].m_banner_and_icon_flags; int x = CurrentDir->m_dir_entries[index].m_banner_and_icon_flags;
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
flags.push_back((x & 0x80) ? '1' : '0'); flags.push_back((x & 0x80) ? '1' : '0');
Expand All @@ -427,36 +427,36 @@ std::string GCMemcard::DEntry_FileName(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


return std::string((const char*)CurrentDir->Dir[index].m_filename, DENTRY_STRLEN); return std::string((const char*)CurrentDir->m_dir_entries[index].m_filename, DENTRY_STRLEN);
} }


u32 GCMemcard::DEntry_ModTime(u8 index) const u32 GCMemcard::DEntry_ModTime(u8 index) const
{ {
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return 0xFFFFFFFF; return 0xFFFFFFFF;


return BE32(CurrentDir->Dir[index].m_modification_time); return BE32(CurrentDir->m_dir_entries[index].m_modification_time);
} }


u32 GCMemcard::DEntry_ImageOffset(u8 index) const u32 GCMemcard::DEntry_ImageOffset(u8 index) const
{ {
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return 0xFFFFFFFF; return 0xFFFFFFFF;


return BE32(CurrentDir->Dir[index].m_image_offset); return BE32(CurrentDir->m_dir_entries[index].m_image_offset);
} }


std::string GCMemcard::DEntry_IconFmt(u8 index) const std::string GCMemcard::DEntry_IconFmt(u8 index) const
{ {
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


int x = CurrentDir->Dir[index].m_icon_format[0]; int x = CurrentDir->m_dir_entries[index].m_icon_format[0];
std::string format; std::string format;
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
if (i == 8) if (i == 8)
x = CurrentDir->Dir[index].m_icon_format[1]; x = CurrentDir->m_dir_entries[index].m_icon_format[1];
format.push_back((x & 0x80) ? '1' : '0'); format.push_back((x & 0x80) ? '1' : '0');
x = x << 1; x = x << 1;
} }
Expand All @@ -468,12 +468,12 @@ std::string GCMemcard::DEntry_AnimSpeed(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


int x = CurrentDir->Dir[index].m_animation_speed[0]; int x = CurrentDir->m_dir_entries[index].m_animation_speed[0];
std::string speed; std::string speed;
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
if (i == 8) if (i == 8)
x = CurrentDir->Dir[index].m_animation_speed[1]; x = CurrentDir->m_dir_entries[index].m_animation_speed[1];
speed.push_back((x & 0x80) ? '1' : '0'); speed.push_back((x & 0x80) ? '1' : '0');
x = x << 1; x = x << 1;
} }
Expand All @@ -485,7 +485,7 @@ std::string GCMemcard::DEntry_Permissions(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


u8 Permissions = CurrentDir->Dir[index].m_file_permissions; u8 Permissions = CurrentDir->m_dir_entries[index].m_file_permissions;
std::string permissionsString; std::string permissionsString;
permissionsString.push_back((Permissions & 16) ? 'x' : 'M'); permissionsString.push_back((Permissions & 16) ? 'x' : 'M');
permissionsString.push_back((Permissions & 8) ? 'x' : 'C'); permissionsString.push_back((Permissions & 8) ? 'x' : 'C');
Expand All @@ -498,15 +498,15 @@ u8 GCMemcard::DEntry_CopyCounter(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return 0xFF; return 0xFF;


return CurrentDir->Dir[index].m_copy_counter; return CurrentDir->m_dir_entries[index].m_copy_counter;
} }


u16 GCMemcard::DEntry_FirstBlock(u8 index) const u16 GCMemcard::DEntry_FirstBlock(u8 index) const
{ {
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return 0xFFFF; return 0xFFFF;


u16 block = BE16(CurrentDir->Dir[index].m_first_block); u16 block = BE16(CurrentDir->m_dir_entries[index].m_first_block);
if (block > (u16)maxBlock) if (block > (u16)maxBlock)
return 0xFFFF; return 0xFFFF;
return block; return block;
Expand All @@ -517,7 +517,7 @@ u16 GCMemcard::DEntry_BlockCount(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return 0xFFFF; return 0xFFFF;


u16 blocks = BE16(CurrentDir->Dir[index].m_block_count); u16 blocks = BE16(CurrentDir->m_dir_entries[index].m_block_count);
if (blocks > (u16)maxBlock) if (blocks > (u16)maxBlock)
return 0xFFFF; return 0xFFFF;
return blocks; return blocks;
Expand All @@ -528,16 +528,16 @@ u32 GCMemcard::DEntry_CommentsAddress(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return 0xFFFF; return 0xFFFF;


return BE32(CurrentDir->Dir[index].m_comments_address); return BE32(CurrentDir->m_dir_entries[index].m_comments_address);
} }


std::string GCMemcard::GetSaveComment1(u8 index) const std::string GCMemcard::GetSaveComment1(u8 index) const
{ {
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


u32 Comment1 = BE32(CurrentDir->Dir[index].m_comments_address); u32 Comment1 = BE32(CurrentDir->m_dir_entries[index].m_comments_address);
u32 DataBlock = BE16(CurrentDir->Dir[index].m_first_block) - MC_FST_BLOCKS; u32 DataBlock = BE16(CurrentDir->m_dir_entries[index].m_first_block) - MC_FST_BLOCKS;
if ((DataBlock > maxBlock) || (Comment1 == 0xFFFFFFFF)) if ((DataBlock > maxBlock) || (Comment1 == 0xFFFFFFFF))
{ {
return ""; return "";
Expand All @@ -550,9 +550,9 @@ std::string GCMemcard::GetSaveComment2(u8 index) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return ""; return "";


u32 Comment1 = BE32(CurrentDir->Dir[index].m_comments_address); u32 Comment1 = BE32(CurrentDir->m_dir_entries[index].m_comments_address);
u32 Comment2 = Comment1 + DENTRY_STRLEN; u32 Comment2 = Comment1 + DENTRY_STRLEN;
u32 DataBlock = BE16(CurrentDir->Dir[index].m_first_block) - MC_FST_BLOCKS; u32 DataBlock = BE16(CurrentDir->m_dir_entries[index].m_first_block) - MC_FST_BLOCKS;
if ((DataBlock > maxBlock) || (Comment1 == 0xFFFFFFFF)) if ((DataBlock > maxBlock) || (Comment1 == 0xFFFFFFFF))
{ {
return ""; return "";
Expand All @@ -565,7 +565,7 @@ bool GCMemcard::GetDEntry(u8 index, DEntry& dest) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return false; return false;


dest = CurrentDir->Dir[index]; dest = CurrentDir->m_dir_entries[index];
return true; return true;
} }


Expand Down Expand Up @@ -673,15 +673,15 @@ u32 GCMemcard::ImportFile(const DEntry& direntry, std::vector<GCMBlock>& saveBlo
// find first free dir entry // find first free dir entry
for (int i = 0; i < DIRLEN; i++) for (int i = 0; i < DIRLEN; i++)
{ {
if (BE32(UpdatedDir.Dir[i].m_gamecode) == 0xFFFFFFFF) if (BE32(UpdatedDir.m_dir_entries[i].m_gamecode) == 0xFFFFFFFF)
{ {
UpdatedDir.Dir[i] = direntry; UpdatedDir.m_dir_entries[i] = direntry;
*(u16*)&UpdatedDir.Dir[i].m_first_block = BE16(firstBlock); *(u16*)&UpdatedDir.m_dir_entries[i].m_first_block = BE16(firstBlock);
UpdatedDir.Dir[i].m_copy_counter = UpdatedDir.Dir[i].m_copy_counter + 1; UpdatedDir.m_dir_entries[i].m_copy_counter = UpdatedDir.m_dir_entries[i].m_copy_counter + 1;
break; break;
} }
} }
UpdatedDir.UpdateCounter = BE16(BE16(UpdatedDir.UpdateCounter) + 1); UpdatedDir.m_update_counter = BE16(BE16(UpdatedDir.m_update_counter) + 1);
*PreviousDir = UpdatedDir; *PreviousDir = UpdatedDir;
if (PreviousDir == &dir) if (PreviousDir == &dir)
{ {
Expand Down Expand Up @@ -742,8 +742,8 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array
if (index >= DIRLEN) if (index >= DIRLEN)
return DELETE_FAIL; return DELETE_FAIL;


u16 startingblock = BE16(CurrentDir->Dir[index].m_first_block); u16 startingblock = BE16(CurrentDir->m_dir_entries[index].m_first_block);
u16 numberofblocks = BE16(CurrentDir->Dir[index].m_block_count); u16 numberofblocks = BE16(CurrentDir->m_dir_entries[index].m_block_count);


BlockAlloc UpdatedBat = *CurrentBat; BlockAlloc UpdatedBat = *CurrentBat;
if (!UpdatedBat.ClearBlocks(startingblock, numberofblocks)) if (!UpdatedBat.ClearBlocks(startingblock, numberofblocks))
Expand All @@ -765,11 +765,11 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array
/* /*
// TODO: determine when this is used, even on the same memory card I have seen // TODO: determine when this is used, even on the same memory card I have seen
// both update to broken file, and not updated // both update to broken file, and not updated
*(u32*)&UpdatedDir.Dir[index].m_gamecode = 0; *(u32*)&UpdatedDir.m_dir_entries[index].m_gamecode = 0;
*(u16*)&UpdatedDir.Dir[index].m_makercode = 0; *(u16*)&UpdatedDir.m_dir_entries[index].m_makercode = 0;
memset(UpdatedDir.Dir[index].m_filename, 0, 0x20); memset(UpdatedDir.m_dir_entries[index].m_filename, 0, 0x20);
strcpy((char*)UpdatedDir.Dir[index].m_filename, "Broken File000"); strcpy((char*)UpdatedDir.m_dir_entries[index].m_filename, "Broken File000");
*(u16*)&UpdatedDir.UpdateCounter = BE16(BE16(UpdatedDir.UpdateCounter) + 1); *(u16*)&UpdatedDir.m_update_counter = BE16(BE16(UpdatedDir.m_update_counter) + 1);
*PreviousDir = UpdatedDir; *PreviousDir = UpdatedDir;
if (PreviousDir == &dir ) if (PreviousDir == &dir )
Expand All @@ -783,8 +783,8 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array
PreviousDir = &dir; PreviousDir = &dir;
} }
*/ */
memset(&(UpdatedDir.Dir[index]), 0xFF, DENTRY_SIZE); memset(&(UpdatedDir.m_dir_entries[index]), 0xFF, DENTRY_SIZE);
UpdatedDir.UpdateCounter = BE16(BE16(UpdatedDir.UpdateCounter) + 1); UpdatedDir.m_update_counter = BE16(BE16(UpdatedDir.m_update_counter) + 1);
*PreviousDir = UpdatedDir; *PreviousDir = UpdatedDir;
if (PreviousDir == &dir) if (PreviousDir == &dir)
{ {
Expand Down Expand Up @@ -1059,7 +1059,7 @@ bool GCMemcard::ReadBannerRGBA8(u8 index, u32* buffer) const
if (!m_valid || index >= DIRLEN) if (!m_valid || index >= DIRLEN)
return false; return false;


int flags = CurrentDir->Dir[index].m_banner_and_icon_flags; int flags = CurrentDir->m_dir_entries[index].m_banner_and_icon_flags;
// Timesplitters 2 is the only game that I see this in // Timesplitters 2 is the only game that I see this in
// May be a hack // May be a hack
if (flags == 0xFB) if (flags == 0xFB)
Expand All @@ -1070,8 +1070,8 @@ bool GCMemcard::ReadBannerRGBA8(u8 index, u32* buffer) const
if (bnrFormat == 0) if (bnrFormat == 0)
return false; return false;


u32 DataOffset = BE32(CurrentDir->Dir[index].m_image_offset); u32 DataOffset = BE32(CurrentDir->m_dir_entries[index].m_image_offset);
u32 DataBlock = BE16(CurrentDir->Dir[index].m_first_block) - MC_FST_BLOCKS; u32 DataBlock = BE16(CurrentDir->m_dir_entries[index].m_first_block) - MC_FST_BLOCKS;


if ((DataBlock > maxBlock) || (DataOffset == 0xFFFFFFFF)) if ((DataBlock > maxBlock) || (DataOffset == 0xFFFFFFFF))
{ {
Expand Down Expand Up @@ -1105,10 +1105,10 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
// Sonic Heroes it the only game I have seen that tries to use a CI8 and RGB5A3 icon // Sonic Heroes it the only game I have seen that tries to use a CI8 and RGB5A3 icon
// int fmtCheck = 0; // int fmtCheck = 0;


int formats = BE16(CurrentDir->Dir[index].m_icon_format); int formats = BE16(CurrentDir->m_dir_entries[index].m_icon_format);
int fdelays = BE16(CurrentDir->Dir[index].m_animation_speed); int fdelays = BE16(CurrentDir->m_dir_entries[index].m_animation_speed);


int flags = CurrentDir->Dir[index].m_banner_and_icon_flags; int flags = CurrentDir->m_dir_entries[index].m_banner_and_icon_flags;
// Timesplitters 2 and 3 is the only game that I see this in // Timesplitters 2 and 3 is the only game that I see this in
// May be a hack // May be a hack
// if (flags == 0xFB) flags = ~flags; // if (flags == 0xFB) flags = ~flags;
Expand All @@ -1117,8 +1117,8 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const


int bnrFormat = (flags & 3); int bnrFormat = (flags & 3);


u32 DataOffset = BE32(CurrentDir->Dir[index].m_image_offset); u32 DataOffset = BE32(CurrentDir->m_dir_entries[index].m_image_offset);
u32 DataBlock = BE16(CurrentDir->Dir[index].m_first_block) - MC_FST_BLOCKS; u32 DataBlock = BE16(CurrentDir->m_dir_entries[index].m_first_block) - MC_FST_BLOCKS;


if ((DataBlock > maxBlock) || (DataOffset == 0xFFFFFFFF)) if ((DataBlock > maxBlock) || (DataOffset == 0xFFFFFFFF))
{ {
Expand Down
20 changes: 10 additions & 10 deletions Source/Core/Core/HW/GCMemcard/GCMemcard.h
Expand Up @@ -218,24 +218,24 @@ static_assert(sizeof(DEntry) == DENTRY_SIZE);


struct Directory struct Directory
{ {
DEntry Dir[DIRLEN]; // 0x0000 Directory Entries (max 127) DEntry m_dir_entries[DIRLEN]; // 0x0000 Directory Entries (max 127)
u8 Padding[0x3a]; u8 m_padding[0x3a];
u16 UpdateCounter; // 0x1ffa 2 Update Counter u16 m_update_counter; // 0x1ffa 2 Update Counter
u16 Checksum; // 0x1ffc 2 Additive Checksum u16 m_checksum; // 0x1ffc 2 Additive Checksum
u16 Checksum_Inv; // 0x1ffe 2 Inverse Checksum u16 m_checksum_inv; // 0x1ffe 2 Inverse Checksum
Directory() Directory()
{ {
memset(this, 0xFF, BLOCK_SIZE); memset(this, 0xFF, BLOCK_SIZE);
UpdateCounter = 0; m_update_counter = 0;
Checksum = BE16(0xF003); m_checksum = BE16(0xF003);
Checksum_Inv = 0; m_checksum_inv = 0;
} }
void Replace(DEntry d, int idx) void Replace(DEntry d, int idx)
{ {
Dir[idx] = d; m_dir_entries[idx] = d;
fixChecksums(); fixChecksums();
} }
void fixChecksums() { calc_checksumsBE((u16*)this, 0xFFE, &Checksum, &Checksum_Inv); } void fixChecksums() { calc_checksumsBE((u16*)this, 0xFFE, &m_checksum, &m_checksum_inv); }
}; };
static_assert(sizeof(Directory) == BLOCK_SIZE); static_assert(sizeof(Directory) == BLOCK_SIZE);


Expand Down

0 comments on commit 17208f4

Please sign in to comment.