MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / savOpenShared

Method savOpenShared

3ds/source/script/scripthost.cpp:191–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 }
190
191 int savOpenShared(uint64_t id) override
192 {
193 // The id's low 32 bits are the extdata id, its high 32 the archive
194 // magic (0x00048000 for the Home Menu shared extdata that holds
195 // Play Coins).
196 const int slot = freeSlot();
197 if (slot < 0) {
198 return -2;
199 }
200
201 FS_Archive archive;
202 const u32 path[3] = {MEDIATYPE_NAND, (u32)id, (u32)(id >> 32)};
203 Result res = FSUSER_OpenArchive(&archive, ARCHIVE_SHARED_EXTDATA, {PATH_BINARY, 0xC, path});
204 if (R_FAILED(res)) {
205 return (int)res;
206 }
207
208 // Shared extdata is a file-level archive like ordinary extdata: it needs
209 // no commit and no secure-value fix, so savCommit is a no-op on this
210 // handle.
211 mSlots[slot].arch = ArchiveHandle::fromFs(archive);
212 mSlots[slot].commitable = false;
213 mSlots[slot].uniqueId = 0;
214 return slot;
215 }
216
217 int savOpenExtdata(u32 extdataId) override
218 {

Callers 1

ckpt_sav_open_sharedFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected