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

Method refreshExtras

3ds/source/script/scripthost.cpp:568–587  ·  view source on GitHub ↗

The extras: Checkpoint keeps two title lists, and a title whose save is not reachable but whose extdata is lives in the Extdata one alone — PKSM's archive, which loader.cpp probes for by id, is the case every user meets. The Save list on its own would hide those titles from every script while the app's own UI offers them, so the script index space is the Save list with them appended: existing indi

Source from the content-addressed store, hash-verified

566 // Rebuilt when the catalog's generation moves, because a script may be
567 // running while the loader thread finishes a refresh.
568 void refreshExtras(void)
569 {
570 TitleCatalog& catalog = TitleCatalog::get();
571 const u32 generation = catalog.generation();
572 if (mExtrasGeneration == generation) {
573 return;
574 }
575 mExtrasGeneration = generation;
576 mSaveCount = catalog.getTitleCount(BackupKind::Save);
577 mExtras.clear();
578
579 const int extdatas = catalog.getTitleCount(BackupKind::Extdata);
580 for (int i = 0; i < extdatas; i++) {
581 Title title;
582 catalog.getTitle(title, i, BackupKind::Extdata);
583 if (catalog.indexById(title.id(), BackupKind::Save) < 0) {
584 mExtras.push_back(Extra{i, title.id()});
585 }
586 }
587 }
588
589 // The title behind a script-space index, false when there is none.
590 bool catalogTitle(int idx, Title& out)

Callers

nothing calls this directly

Calls 8

getFunction · 0.85
generationMethod · 0.45
getTitleCountMethod · 0.45
clearMethod · 0.45
getTitleMethod · 0.45
indexByIdMethod · 0.45
idMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected