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