2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 05:07:43 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -1,44 +1,40 @@
#include "CMemoryCardSys.hpp"
namespace urde
{
namespace urde {
kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot)
{
const char* home = getenv("HOME");
if (!home)
return {};
kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot) {
const char* home = getenv("HOME");
if (!home)
return {};
kabufuda::SystemString path = home;
path += hecl::Format("/Library/Application Support/Dolphin/GC/MemoryCard%c.USA.raw",
slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
kabufuda::SystemString path = home;
path += hecl::Format("/Library/Application Support/Dolphin/GC/MemoryCard%c.USA.raw",
slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
hecl::Sstat theStat;
if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode))
return {};
hecl::Sstat theStat;
if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode))
return {};
return path;
return path;
}
kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot slot)
{
const char* home = getenv("HOME");
if (!home)
return {};
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 {};
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 {};
fclose(fp);
path += hecl::Format("/MemoryCard%c.USA.raw", slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
FILE* fp = hecl::Fopen(path.c_str(), "wb");
if (!fp)
return {};
fclose(fp);
return path;
return path;
}
}
} // namespace urde