Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. bool Filesystem::Initialize()
  2. {
  3.     Result ROMFS_INIT = romfsInit();
  4.  
  5.     //Get base device path
  6.     //Can change if it's on USB for whatever reason
  7.     //In that case it'll be {DEVICE}:/LovePotion/
  8.     //{IDENTITY} is appended for unique ID
  9.     char cwd[256];
  10.     getcwd(cwd, 256);
  11.     SAVE_DIR = cwd;
  12.  
  13.     if (ROMFS_INIT != 0)
  14.         return false;
  15.     else
  16.     {
  17.         if (chdir("game") != 0)
  18.             chdir("romfs:/"); //load nogame!
  19.     }
  20.  
  21.     mkdir(SAVE_DIR.c_str(), 0777);
  22.  
  23.     return true;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement