mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #242 from LPFaint99/GCMemcard
MemcardManager: Fix "export all saves"
This commit is contained in:
commit
bedb386560
@ -904,9 +904,17 @@ u32 GCMemcard::ExportGci(u8 index, const std::string& fileName, const std::strin
|
|||||||
File::IOFile gci;
|
File::IOFile gci;
|
||||||
int offset = GCI;
|
int offset = GCI;
|
||||||
|
|
||||||
gci.Open(fileName, "wb");
|
if (!fileName.length())
|
||||||
|
{
|
||||||
|
std::string gciFilename;
|
||||||
|
// GCI_FileName should only fail if the gamecode is 0xFFFFFFFF
|
||||||
|
if (!GCI_FileName(index, gciFilename)) return SUCCESS;
|
||||||
|
gci.Open(directory + DIR_SEP + gciFilename, "wb");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
std::string fileType;
|
std::string fileType;
|
||||||
|
gci.Open(fileName, "wb");
|
||||||
SplitPath(fileName, nullptr, nullptr, &fileType);
|
SplitPath(fileName, nullptr, nullptr, &fileType);
|
||||||
if (!strcasecmp(fileType.c_str(), ".gcs"))
|
if (!strcasecmp(fileType.c_str(), ".gcs"))
|
||||||
{
|
{
|
||||||
@ -916,6 +924,7 @@ u32 GCMemcard::ExportGci(u8 index, const std::string& fileName, const std::strin
|
|||||||
{
|
{
|
||||||
offset = SAV;
|
offset = SAV;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!gci)
|
if (!gci)
|
||||||
return OPENFAIL;
|
return OPENFAIL;
|
||||||
|
@ -605,7 +605,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
|||||||
"%s\nand have the same name as a file on your memcard\nContinue?", path1.c_str()))
|
"%s\nand have the same name as a file on your memcard\nContinue?", path1.c_str()))
|
||||||
for (int i = 0; i < DIRLEN; i++)
|
for (int i = 0; i < DIRLEN; i++)
|
||||||
{
|
{
|
||||||
CopyDeleteSwitch(memoryCard[slot]->ExportGci(i, nullptr, path1), -1);
|
CopyDeleteSwitch(memoryCard[slot]->ExportGci(i, "", path1), -1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user