|
| 1 | +diff --git a/source/romfs.c b/source/romfs.c |
| 2 | +index 02d6bd5..a3c2c2a 100644 |
| 3 | +--- a/source/romfs.c |
| 4 | ++++ b/source/romfs.c |
| 5 | +@@ -15,7 +15,18 @@ |
| 6 | + #include <sys/param.h> |
| 7 | + #include <stdint.h> |
| 8 | + #include <unistd.h> |
| 9 | ++ |
| 10 | ++#if defined(__WII__) |
| 11 | ++#include <gccore.h> |
| 12 | ++ |
| 13 | ++#define OSBlockMove(dest, src, size, flush) memmove((dest), (src), (size)) |
| 14 | ++ |
| 15 | ++#elif defined(__WIIU__) |
| 16 | + #include <coreinit/memory.h> |
| 17 | ++#else |
| 18 | ++#error "Unsupported platform" |
| 19 | ++#endif |
| 20 | ++ |
| 21 | + |
| 22 | + |
| 23 | + /* include the implementation files (needed for static functions) */ |
| 24 | +@@ -34,41 +45,41 @@ static int32_t romfs_initialised = 0; |
| 25 | + /* romfsInit: intialize romfs */ |
| 26 | + int32_t romfsInit(void) |
| 27 | + { |
| 28 | +- /* already initialized */ |
| 29 | +- if (romfs_initialised) |
| 30 | +- return 0; |
| 31 | ++ /* already initialized */ |
| 32 | ++ if (romfs_initialised) |
| 33 | ++ return 0; |
| 34 | + |
| 35 | +- /* create romfs file entries */ |
| 36 | +- tar_create_entries(_binary_romfs_tar_start, _binary_romfs_tar_end); |
| 37 | ++ /* create romfs file entries */ |
| 38 | ++ tar_create_entries(_binary_romfs_tar_start, _binary_romfs_tar_end); |
| 39 | + |
| 40 | +- /* add the romfs devoptab to devices list */ |
| 41 | +- if (AddDevice(&romfs_devoptab) == -1) |
| 42 | +- { |
| 43 | +- node_destroytree(NULL, 0); |
| 44 | +- return -1; |
| 45 | +- } |
| 46 | ++ /* add the romfs devoptab to devices list */ |
| 47 | ++ if (AddDevice(&romfs_devoptab) == -1) |
| 48 | ++ { |
| 49 | ++ node_destroytree(NULL, 0); |
| 50 | ++ return -1; |
| 51 | ++ } |
| 52 | + |
| 53 | +- /* set the intialized flag */ |
| 54 | +- romfs_initialised = 1; |
| 55 | ++ /* set the intialized flag */ |
| 56 | ++ romfs_initialised = 1; |
| 57 | + |
| 58 | +- return 0; |
| 59 | ++ return 0; |
| 60 | + } |
| 61 | + |
| 62 | + /* romfsExit: exit romfs */ |
| 63 | + int32_t romfsExit(void) |
| 64 | + { |
| 65 | +- /* never initialized */ |
| 66 | +- if (!romfs_initialised) |
| 67 | +- return -1; |
| 68 | ++ /* never initialized */ |
| 69 | ++ if (!romfs_initialised) |
| 70 | ++ return -1; |
| 71 | + |
| 72 | +- /* remove the romfs devoptab from devices list */ |
| 73 | +- RemoveDevice("romfs:"); |
| 74 | ++ /* remove the romfs devoptab from devices list */ |
| 75 | ++ RemoveDevice("romfs:"); |
| 76 | + |
| 77 | +- /* deallocate the file tree */ |
| 78 | +- node_destroytree(NULL, 0); |
| 79 | ++ /* deallocate the file tree */ |
| 80 | ++ node_destroytree(NULL, 0); |
| 81 | + |
| 82 | +- /* clear the initialized flag */ |
| 83 | +- romfs_initialised = 0; |
| 84 | ++ /* clear the initialized flag */ |
| 85 | ++ romfs_initialised = 0; |
| 86 | + |
| 87 | +- return 0; |
| 88 | ++ return 0; |
| 89 | + } |
0 commit comments