all repos — mgba @ d9d299fb88efba1b15d11e0c0b42beb27564193f

mGBA Game Boy Advance Emulator

Core: Add portable.ini check for Haiku
Crestwave crest.wave@yahoo.com
Sun, 01 Mar 2020 10:09:34 +0800
commit

d9d299fb88efba1b15d11e0c0b42beb27564193f

parent

3b0ff3ea561ba7166c63c498e7a28d893310fa38

1 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/core/config.csrc/core/config.c

@@ -232,7 +232,15 @@ UNUSED(portable);

snprintf(out, outLength, "/%s", projectName); FSUSER_CreateDirectory(sdmcArchive, fsMakePath(PATH_ASCII, out), 0); #elif defined(__HAIKU__) - UNUSED(portable); + getcwd(out, outLength); + strncat(out, PATH_SEP "portable.ini", outLength - strlen(out)); + portable = VFileOpen(out, O_RDONLY); + if (portable) { + getcwd(out, outLength); + portable->close(portable); + return; + } + char path[B_PATH_NAME_LENGTH]; find_directory(B_USER_SETTINGS_DIRECTORY, 0, false, path, B_PATH_NAME_LENGTH); snprintf(out, outLength, "%s/%s", path, binaryName);