Skip to content
Permalink
Browse files

GCMemcard: 'Broken File000' commented out code can't work anymore, bu…

…t leave a comment about it.
  • Loading branch information...
AdmiralCurtiss committed Jan 6, 2019
1 parent 41767da commit e6acbf7cbe71a013e4227405e36d9662bc44e452
Showing with 5 additions and 21 deletions.
  1. +5 −21 Source/Core/Core/HW/GCMemcard/GCMemcard.cpp
@@ -759,27 +759,11 @@ u32 GCMemcard::RemoveFile(u8 index) // index in the directory array
UpdateBat(UpdatedBat);

Directory UpdatedDir = GetActiveDirectory();
/*
// TODO: determine when this is used, even on the same memory card I have seen
// both update to broken file, and not updated
*(u32*)&UpdatedDir.m_dir_entries[index].m_gamecode = 0;
*(u16*)&UpdatedDir.m_dir_entries[index].m_makercode = 0;
memset(UpdatedDir.m_dir_entries[index].m_filename, 0, 0x20);
strcpy((char*)UpdatedDir.m_dir_entries[index].m_filename, "Broken File000");
*(u16*)&UpdatedDir.m_update_counter = BE16(BE16(UpdatedDir.m_update_counter) + 1);
*PreviousDir = UpdatedDir;
if (PreviousDir == &dir )
{
CurrentDir = &dir;
PreviousDir = &dir_backup;
}
else
{
CurrentDir = &dir_backup;
PreviousDir = &dir;
}
*/

// TODO: Deleting a file via the GC BIOS sometimes leaves behind an extra updated directory block
// here that has an empty file with the filename "Broken File000" where the actual deleted file
// was. Determine when exactly this happens and if this is neccessary for anything.

memset(&(UpdatedDir.m_dir_entries[index]), 0xFF, DENTRY_SIZE);
UpdatedDir.m_update_counter = UpdatedDir.m_update_counter + 1;
UpdateDirectory(UpdatedDir);

0 comments on commit e6acbf7

Please sign in to comment.
You can’t perform that action at this time.