Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #16 from Steveice10/master
Browse files Browse the repository at this point in the history
Sort safe mode titles ahead of others.
  • Loading branch information
profi200 committed Jan 4, 2016
2 parents 7f4c3eb + b82c4c4 commit 85ccfc2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/main.cpp
Expand Up @@ -58,10 +58,22 @@ u32 getTitlePriority(u64 id) {
}

bool sortTitlesHighToLow(const TitleInstallInfo &a, const TitleInstallInfo &b) {
bool aSafe = (a.entry.titleID & 0xFF) == 0x03;
bool bSafe = (b.entry.titleID & 0xFF) == 0x03;
if(aSafe != bSafe) {
return aSafe;
}

return getTitlePriority(a.entry.titleID) < getTitlePriority(b.entry.titleID);
}

bool sortTitlesLowToHigh(const TitleInstallInfo &a, const TitleInstallInfo &b) {
bool aSafe = (a.entry.titleID & 0xFF) == 0x03;
bool bSafe = (b.entry.titleID & 0xFF) == 0x03;
if(aSafe != bSafe) {
return aSafe;
}

return getTitlePriority(a.entry.titleID) > getTitlePriority(b.entry.titleID);
}

Expand Down

0 comments on commit 85ccfc2

Please sign in to comment.