3DS: Use newlib fs functions unless told otherwise

This commit is contained in:
Jeffrey Pfau 2015-08-24 19:18:32 -07:00
parent 85298a0a54
commit fb82257d03
4 changed files with 11 additions and 1 deletions

View File

@ -176,6 +176,12 @@ elseif(3DS)
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR})
list(APPEND OS_LIB sf2d ctru) list(APPEND OS_LIB sf2d ctru)
file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/3ds/*.c ${CMAKE_BINARY_DIR}/font.c) 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}) source_group("3DS-specific code" FILES ${OS_SRC})
endif() endif()

View File

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "3ds-vfs.h" #include "3ds-vfs.h"
#ifdef USE_VFS_3DS
#include "util/memory.h" #include "util/memory.h"
#include "util/string.h" #include "util/string.h"
@ -244,3 +245,4 @@ static const char* _vd3deName(struct VDirEntry* vde) {
} }
return vd3de->utf8Name; return vd3de->utf8Name;
} }
#endif

View File

@ -64,6 +64,7 @@ int main() {
aptInit(); aptInit();
hidInit(0); hidInit(0);
fsInit(); fsInit();
sdmcInit();
sf2d_init(); sf2d_init();
sf2d_set_clear_color(0); sf2d_set_clear_color(0);
@ -139,6 +140,7 @@ cleanup:
sf2d_free_texture(tex); sf2d_free_texture(tex);
sf2d_fini(); sf2d_fini();
sdmcExit();
fsExit(); fsExit();
gfxExit(); gfxExit();
hidExit(); hidExit();

View File

@ -34,7 +34,7 @@ struct VFile* VFileOpen(const char* path, int flags) {
break; break;
} }
return VFileFOpen(path, chflags); return VFileFOpen(path, chflags);
#elif defined(_3DS) #elif defined(USE_VFS_3DS)
int ctrFlags = FS_OPEN_READ; int ctrFlags = FS_OPEN_READ;
switch (flags & O_ACCMODE) { switch (flags & O_ACCMODE) {
case O_WRONLY: case O_WRONLY: