small fix to writing memorycards, open as r+b so the file is not cleared when opening. should eliminate the 0byte memory card files reported http://forums.dolphin-emulator.com/showthread.php?tid=21964 http://forums.dolphin-emulator.com/showthread.php?tid=22631 http://forums.dolphin-emulator.com/showthread.php?tid=22098
This commit is contained in:
parent
5c27e27a4a
commit
6bfb8c9597
|
@ -103,14 +103,14 @@ CEXIMemoryCard::CEXIMemoryCard(const int index)
|
||||||
|
|
||||||
void innerFlush(FlushData* data)
|
void innerFlush(FlushData* data)
|
||||||
{
|
{
|
||||||
File::IOFile pFile(data->filename, "wb");
|
File::IOFile pFile(data->filename, "r+b");
|
||||||
if (!pFile)
|
if (!pFile)
|
||||||
{
|
{
|
||||||
std::string dir;
|
std::string dir;
|
||||||
SplitPath(data->filename, &dir, 0, 0);
|
SplitPath(data->filename, &dir, 0, 0);
|
||||||
if (!File::IsDirectory(dir))
|
if (!File::IsDirectory(dir))
|
||||||
File::CreateFullPath(dir);
|
File::CreateFullPath(dir);
|
||||||
pFile.Open(data->filename, "wb");
|
pFile.Open(data->filename, "r+b");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pFile) // Note - pFile changed inside above if
|
if (!pFile) // Note - pFile changed inside above if
|
||||||
|
|
Loading…
Reference in New Issue