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

Method savCommit

3ds/source/script/scripthost.cpp:374–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372 }
373
374 int savCommit(int handle) override
375 {
376 if (!mSlots[handle].commitable) {
377 return 0; // extdata needs no commit
378 }
379
380 Result res = FSUSER_ControlArchive(mSlots[handle].arch.fs(), ARCHIVE_ACTION_COMMIT_SAVE_DATA, NULL, 0, NULL, 0);
381 if (R_SUCCEEDED(res) && mSlots[handle].uniqueId != 0) {
382 // Same epilogue as restore: drop the secure value so the game accepts
383 // the modified save instead of flagging a rollback. A system savedata
384 // archive belongs to no title, so there is no secure value to drop and
385 // the commit above is the whole job.
386 u8 out;
387 u64 secureValue = ((u64)SECUREVALUE_SLOT_SD << 32) | (mSlots[handle].uniqueId << 8);
388 res = FSUSER_ControlSecureSave(SECURESAVE_ACTION_DELETE, &secureValue, 8, &out, 1);
389 }
390 return (int)res;
391 }
392
393 void savClose(int handle) override
394 {

Callers 1

ckpt_sav_commitFunction · 0.45

Calls 1

fsMethod · 0.80

Tested by

no test coverage detected