3DS: Use newlib fs functions unless told otherwise
Jeffrey Pfau jeffrey@endrift.com
Mon, 24 Aug 2015 19:18:32 -0700
4 files changed,
11 insertions(+),
1 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -176,6 +176,12 @@ execute_process(COMMAND ${RAW2C} ${CMAKE_SOURCE_DIR}/src/platform/3ds/font.raw)
include_directories(${CMAKE_BINARY_DIR}) list(APPEND OS_LIB sf2d ctru) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/3ds/*.c ${CMAKE_BINARY_DIR}/font.c) + if(USE_VFS_3DS) + add_definitions(-DUSE_VFS_3DS) + else() + add_definitions(-DUSE_VFS_FILE) + list(APPEND VFS_SRC ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-file.c ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-dirent.c) + endif() source_group("3DS-specific code" FILES ${OS_SRC}) endif()
M
src/platform/3ds/3ds-vfs.c
→
src/platform/3ds/3ds-vfs.c
@@ -5,6 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "3ds-vfs.h" +#ifdef USE_VFS_3DS #include "util/memory.h" #include "util/string.h"@@ -244,3 +245,4 @@ vd3de->utf8Name = utf16to8(vd3de->ent.name, sizeof(vd3de->ent.name) / 2);
} return vd3de->utf8Name; } +#endif
M
src/platform/3ds/main.c
→
src/platform/3ds/main.c
@@ -64,6 +64,7 @@ srvInit();
aptInit(); hidInit(0); fsInit(); + sdmcInit(); sf2d_init(); sf2d_set_clear_color(0);@@ -139,6 +140,7 @@
sf2d_free_texture(tex); sf2d_fini(); + sdmcExit(); fsExit(); gfxExit(); hidExit();
M
src/util/vfs.c
→
src/util/vfs.c
@@ -34,7 +34,7 @@ chflags = "rb";
break; } return VFileFOpen(path, chflags); -#elif defined(_3DS) +#elif defined(USE_VFS_3DS) int ctrFlags = FS_OPEN_READ; switch (flags & O_ACCMODE) { case O_WRONLY: