2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 18:27:42 +00:00

Memory card bug fixes

This commit is contained in:
Jack Andersen
2017-02-03 17:46:12 -10:00
parent 6968d9f0d3
commit 9ea7cee23c
14 changed files with 133 additions and 88 deletions

View File

@@ -20,4 +20,30 @@ kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlo
return path;
}
kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot slot)
{
const char* home = getenv("HOME");
if (!home)
return {};
kabufuda::SystemString path = home;
path += "/Library/Application Support/Dolphin/GC";
if (hecl::RecursiveMakeDir(path.c_str()) < 0)
return {};
path += hecl::Format("/MemoryCard%c.USA.raw",
slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
FILE* fp = hecl::Fopen(path.c_str(), "wb");
if (!fp)
return {};
/*
const u32 fword = 0xffffffff;
for (int i=0 ; i<0x1000000/4 ; ++i)
fwrite(&fword, 1, 4, fp);
*/
fclose(fp);
return path;
}
}