| 238 | } |
| 239 | |
| 240 | int savCommit(int handle) override |
| 241 | { |
| 242 | if (!mSlots[handle].commitable) { |
| 243 | return 0; // extdata needs no commit |
| 244 | } |
| 245 | |
| 246 | Result res = FSUSER_ControlArchive(mSlots[handle].arch.fs(), ARCHIVE_ACTION_COMMIT_SAVE_DATA, NULL, 0, NULL, 0); |
| 247 | if (R_SUCCEEDED(res)) { |
| 248 | // Same epilogue as restore: drop the secure value so the game accepts |
| 249 | // the modified save instead of flagging a rollback. |
| 250 | u8 out; |
| 251 | u64 secureValue = ((u64)SECUREVALUE_SLOT_SD << 32) | (mSlots[handle].uniqueId << 8); |
| 252 | res = FSUSER_ControlSecureSave(SECURESAVE_ACTION_DELETE, &secureValue, 8, &out, 1); |
| 253 | } |
| 254 | return (int)res; |
| 255 | } |
| 256 | |
| 257 | void savClose(int handle) override |
| 258 | { |