]> Chaos Git - corbenik/ctrulib.git/commitdiff
FIX DERP.
authormtheall <pigman46@gmail.com>
Tue, 26 Aug 2014 22:43:34 +0000 (17:43 -0500)
committermtheall <pigman46@gmail.com>
Tue, 26 Aug 2014 22:43:34 +0000 (17:43 -0500)
libctru/include/3ds/services/fs.h
libctru/source/services/fs.c

index d26920f419e85543ea7052bcf93dab7ff5f20612..28628aa3d1f95b6a95c12121eda945a6d08c6ce9 100644 (file)
@@ -139,8 +139,8 @@ Result FSUSER_CloseArchive(Handle* handle, FS_archive* archive);
 Result FSUSER_CreateDirectory(Handle* handle, FS_archive archive, FS_path dirLowPath);
 Result FSUSER_DeleteFile(Handle *handle, FS_archive archive, FS_path fileLowPath);
 Result FSUSER_DeleteDirectory(Handle *handle, FS_archive archive, FS_path dirLowPath);
-Result FSUSER_IsSdmcDetected(Handle *handle);
-Result FSUSER_IsSdmcWritable(Handle *handle);
+Result FSUSER_IsSdmcDetected(Handle *handle, u32 *detected);
+Result FSUSER_IsSdmcWritable(Handle *handle, u32 *writable);
 
 Result FSFILE_Close(Handle handle);
 Result FSFILE_Read(Handle handle, u32 *bytesRead, u64 offset, void *buffer, u32 size);
index 4216e8525e0aee412877c93f84d54e935542ba74..99fcec43dd16c58082d72498675eab07ab6779b7 100644 (file)
@@ -608,7 +608,8 @@ FSUSER_CloseArchive(Handle     *handle,
 
 /*! Check if SD card is detected
  *
- *  @param[in] handle fs:USER handle
+ *  @param[in]  handle   fs:USER handle
+ *  @param[out] detected Output detected state
  *
  *  @returns error
  *
@@ -628,7 +629,8 @@ FSUSER_CloseArchive(Handle     *handle,
  *  1          | Result code
  */
 Result
-FSUSER_IsSdmcDetected(Handle *handle)
+FSUSER_IsSdmcDetected(Handle *handle,
+                      u32    *detected)
 {
        if(!handle)
                handle = &fsuHandle;
@@ -641,12 +643,16 @@ FSUSER_IsSdmcDetected(Handle *handle)
        if((ret = svcSendSyncRequest(*handle)))
                return ret;
 
+       if(detected)
+               *detected = cmdbuf[2];
+
        return cmdbuf[1];
 }
 
 /*! Check if SD card is writable
  *
- *  @param[in] handle fs:USER handle
+ *  @param[in]  handle   fs:USER handle
+ *  @param[out] writable Output writable state
  *
  *  @returns error
  *
@@ -666,7 +672,8 @@ FSUSER_IsSdmcDetected(Handle *handle)
  *  1          | Result code
  */
 Result
-FSUSER_IsSdmcWritable(Handle *handle)
+FSUSER_IsSdmcWritable(Handle *handle,
+                      u32    *writable)
 {
        if(!handle)
                handle = &fsuHandle;
@@ -679,6 +686,9 @@ FSUSER_IsSdmcWritable(Handle *handle)
        if((ret = svcSendSyncRequest(*handle)))
                return ret;
 
+       if(writable)
+               *writable = cmdbuf[2];
+
        return cmdbuf[1];
 }