all repos — mgba @ f25486eca3b6e8d1e56c507e25f994e189f0848c

mGBA Game Boy Advance Emulator

3DS, Wii: Add config directories
Jeffrey Pfau jeffrey@endrift.com
Mon, 07 Sep 2015 21:45:19 -0700
commit

f25486eca3b6e8d1e56c507e25f994e189f0848c

parent

90ea4cbe33b098e274f229a754d30069d08bb810

1 files changed, 13 insertions(+), 2 deletions(-)

jump to
M src/gba/context/config.csrc/gba/context/config.c

@@ -22,6 +22,10 @@ #ifdef PSP2

#include <psp2/io/stat.h> #endif +#ifdef _3DS +#include "platform/3ds/3ds-vfs.h" +#endif + #define SECTION_NAME_MAX 128 static const char* _lookupValue(const struct GBAConfig* config, const char* key) {

@@ -151,7 +155,7 @@ PathRemoveFileSpecW(wpath);

WideCharToMultiByte(CP_UTF8, 0, wpath, -1, out, MAX_PATH, 0, 0); StringCchCatA(out, MAX_PATH, "\\portable.ini"); portable = VFileOpen(out, O_WRONLY | O_CREAT); -#elif defined(PSP2) +#elif defined(PSP2) || defined(_3DS) || defined(GEKKO) // Already portable #else char out[PATH_MAX];

@@ -189,8 +193,15 @@ }

WideCharToMultiByte(CP_UTF8, 0, wpath, -1, out, outLength, 0, 0); #elif defined(PSP2) UNUSED(portable); - snprintf(out, outLength, "cache0:/%s", binaryName); + snprintf(out, outLength, "cache0:/%s", projectName); sceIoMkdir(out, 0777); +#elif defined(GEKKO) + UNUSED(portable); + snprintf(out, outLength, "/%s", projectName); + mkdir(out, 0777); +#elif defined(_3DS) + snprintf(out, outLength, "/%s", projectName); + FSUSER_CreateDirectory(0, sdmcArchive, FS_makePath(PATH_CHAR, out)); #else getcwd(out, outLength); strncat(out, PATH_SEP "portable.ini", outLength - strlen(out));