summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-08-17 01:41:13 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-08-22 23:13:59 +0200
commite004709b695c1947c4f5bf595b97bb0325ddbc35 (patch)
tree5911f55c4b4dc2936e3b274b97dcf9acb4d676b8 /Source
parent15f25783a8b9e2ca1aa6821beb842a4e22764387 (diff)
WFSI: Implement CHECK_HAS_SPACE.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/IOS/WFS/WFSI.cpp17
-rw-r--r--Source/Core/Core/IOS/WFS/WFSI.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/Source/Core/Core/IOS/WFS/WFSI.cpp b/Source/Core/Core/IOS/WFS/WFSI.cpp
index 274850451d..9f3344d971 100644
--- a/Source/Core/Core/IOS/WFS/WFSI.cpp
+++ b/Source/Core/Core/IOS/WFS/WFSI.cpp
@@ -373,6 +373,23 @@ IPCCommandResult WFSI::IOCtl(const IOCtlRequest& request)
break;
}
+ case IOCTL_WFSI_CHECK_HAS_SPACE:
+ WARN_LOG(IOS, "IOCTL_WFSI_CHECK_HAS_SPACE: returning true");
+
+ // TODO(wfs): implement this properly.
+ // 1 is returned if there is free space, 0 otherwise.
+ //
+ // WFSI builds a path depending on the import state
+ // /vol/VOLUME_ID/title/GROUP_ID/GAME_ID
+ // /vol/VOLUME_ID/_install/GAME_ID
+ // then removes everything after the last path separator ('/')
+ // it then calls WFSISrvGetFreeBlkNum (ioctl 0x5a, aliased to 0x5b) with that path.
+ // If the ioctl fails, WFSI returns 0.
+ // If the ioctl succeeds, WFSI returns 0 or 1 depending on the three u32s in the input buffer
+ // and the three u32s returned by WFSSRV (TODO: figure out what it does)
+ return_error_code = 1;
+ break;
+
default:
// TODO(wfs): Should be returning an error. However until we have
// everything properly stubbed it's easier to simulate the methods
diff --git a/Source/Core/Core/IOS/WFS/WFSI.h b/Source/Core/Core/IOS/WFS/WFSI.h
index b7a7747218..d0ab4094d7 100644
--- a/Source/Core/Core/IOS/WFS/WFSI.h
+++ b/Source/Core/Core/IOS/WFS/WFSI.h
@@ -92,6 +92,8 @@ private:
IOCTL_WFSI_SET_FST_BUFFER = 0x8e,
IOCTL_WFSI_LOAD_DOL = 0x90,
+
+ IOCTL_WFSI_CHECK_HAS_SPACE = 0x95,
};
};
} // namespace Device