From cdb2b85d6cc12953fe9bd03185fb3bc3c4a4c9e7 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Sun, 16 Oct 2022 21:54:53 +0200 Subject: [PATCH] Stub `ngword` and `ngword2` Co-Authored-By: Timotej Leginus <35149140+timleg002@users.noreply.github.com> --- app/src/main/assets/romfs/0100000000000806 | Bin 0 -> 2184 bytes app/src/main/assets/romfs/0100000000000823 | Bin 0 -> 7224 bytes .../skyline/services/fssrv/IFileSystemProxy.cpp | 11 +++++++++++ .../skyline/services/fssrv/IFileSystemProxy.h | 16 ++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 app/src/main/assets/romfs/0100000000000806 create mode 100644 app/src/main/assets/romfs/0100000000000823 diff --git a/app/src/main/assets/romfs/0100000000000806 b/app/src/main/assets/romfs/0100000000000806 new file mode 100644 index 0000000000000000000000000000000000000000..69b91fb940de7bc3a7438f885e8413d2c6a42451 GIT binary patch literal 2184 zcmeH{Jx;?w5QT?dp+G^IG6e;qKo0+OK0peWsSpT95J6%TTM)V&AxH25C{j{VQc_ZK z1WrJBZ#~hjR`vl9UTHo1X212$&W;^P(ZaRDZmI65ZmNz|cT~?*e=e(IVO7@VZ)D(S zE*Fx@ojl9E^kpbL^c#7SL`D)z2A$%$BaPxbHDBlFKi31kf|mbf&$ZF-kLi2CzwvcR zq^tkP4Ons^d}CcR#W+y^1hxsii@8YWZ=tyc()elF_6lR>_)8A~a7 zBHa<`Uy=Tp^pB-~BK=@U22M%qoBt{T*Ix_{ei|QI?pM{-wdynVeZTKKF5rFs=j*oz z1I&iQg-hz%fyybh(791OS}G2I-2Z&Hc$|NCw6u?vjs@tC1Ii2k1?>-vErSULlq#Vg4$7Q(cJ%G6QVoo6gDHS1;oNgDV`z7Aj&qLU z{44ym<$W(Po&&#$|8t0OGPg0;D4t0*h2hwCUwn?Q@6bt}Rnbo$i}HfZIlQi}mJ8*T ziE?ctKEd~ugmJTz2}_@rgXM#jXx>_Vy}Xj(>J7%b4t_Z1CrptLV*##*hv{LkiAWCI zmV>>3_re47W<_p+4IR9md%_6F18@b2qss$q;=%Yg9jx|1lrsVO0KVhkwa294(FL1F zzVL8)fK5F3xi>79G149YGak&PJ&R|4XpbqwV*@O6@lPIL6OSFR6$h(5rYw(R@NEaL zJ&J~hqA%8s=@Fu1u!%>s&McPKr#*_62iI=P!RxuF4UbK*-QH~C!P*jFE%R86n`kX- zk7>(;b!N-K%epnwH2O?Ji)D;bHqlV5Sq0P)9@>MsDC^cvQ}qaZ)8ZLFncGa$sIGM^ zmN81%)PuD&kNRbLaJ`8Kz)YG(b+uvfhKHG^Q9a)4$)+Bx(K&g(uj9d76c0O1qk3Jj zc*7%;rrbx`J=xTQdq)%~G}?pfO+4&0RsHz9OAM^R8y;qwssh+nPd4?afbCi=>yLQY zX{xwC1za3%j~QdRM0?y;Pd4@7UKu)A@tCpmgZpMde%R6RGvYC8dIVsbJ=xTQ`*p{` zipQ+&!M!`rlSVxFS;-ohGd;MUH!PO>Q_7|uCt&w1me(g9bG8TXDRL|>h6mTO%sp>< z@IItsvD~jyHuc~=N84hVGvYCCd+hjwVU^<>*_a0Xr0sm literal 0 HcmV?d00001 diff --git a/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.cpp b/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.cpp index 3c44d444..c3c3fba7 100644 --- a/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.cpp +++ b/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.cpp @@ -69,6 +69,17 @@ namespace skyline::service::fssrv { return {}; } + Result IFileSystemProxy::OpenDataStorageByDataId(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + auto storageId{request.Pop()}; + request.Skip>(); // 7-bytes padding + auto titleId{request.Pop()}; + + auto romFs{std::make_shared(state.os->assetFileSystem->OpenFile(fmt::format("romfs/{:016X}", titleId)), state, manager)}; + + manager.RegisterService(romFs, session, response); + return {}; + } + Result IFileSystemProxy::GetGlobalAccessLogMode(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { response.Push(0); return {}; diff --git a/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.h b/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.h index 09279ce6..1a65cc2c 100644 --- a/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.h +++ b/app/src/main/cpp/skyline/services/fssrv/IFileSystemProxy.h @@ -42,6 +42,15 @@ namespace skyline::service::fssrv { }; static_assert(sizeof(SaveDataAttribute) == 0x40); + enum class StorageId : u8 { + None = 0, + Host = 1, + GameCard = 2, + NandSystem = 3, + NandUser = 4, + SdCard = 5, + }; + /** * @brief IFileSystemProxy or fsp-srv is responsible for providing handles to file systems * @url https://switchbrew.org/wiki/Filesystem_services#fsp-srv @@ -77,6 +86,12 @@ namespace skyline::service::fssrv { */ Result OpenDataStorageByCurrentProcess(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Returns a handle to an instance of #IStorage + * @url https://switchbrew.org/wiki/Filesystem_services#OpenDataStorageByDataId + */ + Result OpenDataStorageByDataId(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Returns the filesystem log access mode * @url https://switchbrew.org/wiki/Filesystem_services#GetGlobalAccessLogMode @@ -88,6 +103,7 @@ namespace skyline::service::fssrv { SFUNC(0x12, IFileSystemProxy, OpenSdCardFileSystem), SFUNC(0x33, IFileSystemProxy, OpenSaveDataFileSystem), SFUNC(0xC8, IFileSystemProxy, OpenDataStorageByCurrentProcess), + SFUNC(0xCA, IFileSystemProxy, OpenDataStorageByDataId), SFUNC(0x3ED, IFileSystemProxy, GetGlobalAccessLogMode) ) };