| 138 | } |
| 139 | |
| 140 | int savOpenShared(uint64_t id) override |
| 141 | { |
| 142 | // The id's low 32 bits are the extdata id, its high 32 the archive |
| 143 | // magic (0x00048000 for the Home Menu shared extdata that holds |
| 144 | // Play Coins). |
| 145 | const int slot = freeSlot(); |
| 146 | if (slot < 0) { |
| 147 | return -2; |
| 148 | } |
| 149 | |
| 150 | FS_Archive archive; |
| 151 | const u32 path[3] = {MEDIATYPE_NAND, (u32)id, (u32)(id >> 32)}; |
| 152 | Result res = FSUSER_OpenArchive(&archive, ARCHIVE_SHARED_EXTDATA, {PATH_BINARY, 0xC, path}); |
| 153 | if (R_FAILED(res)) { |
| 154 | return (int)res; |
| 155 | } |
| 156 | |
| 157 | // Shared extdata is a file-level archive like ordinary extdata: it needs |
| 158 | // no commit and no secure-value fix, so savCommit is a no-op on this |
| 159 | // handle. |
| 160 | mSlots[slot].arch = ArchiveHandle::fromFs(archive); |
| 161 | mSlots[slot].commitable = false; |
| 162 | mSlots[slot].uniqueId = 0; |
| 163 | return slot; |
| 164 | } |
| 165 | |
| 166 | bool savValid(int handle) override { return handle >= 0 && handle < MAX_SAV_HANDLES && mSlots[handle].arch; } |
| 167 |
no outgoing calls
no test coverage detected