Slight changes.

This commit is contained in:
StackZ
2020-11-16 15:20:35 +01:00
parent f08bed5813
commit 0ac9d6f448
10 changed files with 44 additions and 39 deletions
+5 -3
View File
@@ -31,8 +31,10 @@
#include <3ds.h>
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType);
Result deletePrevious(u64 titleid, FS_MediaType media);
Result installCia(const char *ciaPath, bool updateSelf);
namespace Title {
Result Launch(u64 titleId, FS_MediaType mediaType);
Result DeletePrevious(u64 titleid, FS_MediaType media);
Result Install(const char *ciaPath, bool updateSelf);
};
#endif
+1
View File
@@ -39,6 +39,7 @@ std::string _3dsxPath = "";
static void InitForARG() {
gfxInitDefault();
romfsInit();
cfguInit();
Gui::init();
amInit();
acInit();
+1 -1
View File
@@ -39,7 +39,7 @@ void Overlays::ShowCredits() {
C2D_TargetClear(Bottom, TRANSPARENT);
GFX::DrawTop();
GFX::DrawSprite(sprites_universal_updater_idx, 220, 30);
GFX::DrawSprite(sprites_universal_updater_idx, 220, 26);
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, "Universal-Updater - " + Lang::get("CREDITS"), 395, 0, font);
Gui::DrawString(10, 30, 0.5f, TEXT_COLOR, "- Universal-Team", 0, 0, font);
+2 -4
View File
@@ -186,10 +186,8 @@ std::string Overlays::SelectDir(const std::string &oldDir, const std::string &ms
char path[PATH_MAX];
getcwd(path, PATH_MAX);
if (strcmp(path, "sdmc:/") == 0 || strcmp(path, "/") == 0) {
return "";
} else {
if (strcmp(path, "sdmc:/") == 0 || strcmp(path, "/") == 0) return "";
else {
chdir("..");
getcwd(path, PATH_MAX);
currentPath = path;
+6 -2
View File
@@ -156,18 +156,23 @@ void StoreUtils::SearchHandle(std::unique_ptr<Store> &store, std::vector<std::un
if (touching(touch, SearchMenu[5])) {
marks = marks ^ favoriteMarks::STAR;
didTouch = true;
} else if (touching(touch, SearchMenu[6])) {
marks = marks ^ favoriteMarks::HEART;
didTouch = true;
} else if (touching(touch, SearchMenu[7])) {
marks = marks ^ favoriteMarks::DIAMOND;
didTouch = true;
} else if (touching(touch, SearchMenu[8])) {
marks = marks ^ favoriteMarks::CLUBS;
didTouch = true;
} else if (touching(touch, SearchMenu[9])) {
marks = marks ^ favoriteMarks::SPADE;
didTouch = true;
} else if (touching(touch, SearchMenu[10])) {
updateFilter = !updateFilter;
didTouch = true;
@@ -191,8 +196,7 @@ void StoreUtils::SearchHandle(std::unique_ptr<Store> &store, std::vector<std::un
if (hDown & KEY_X) {
marks = 0;
updateFilter = false;
for(uint i = 0; i < searchIncludes.size(); i++)
searchIncludes[i] = false;
for(uint i = 0; i < searchIncludes.size(); i++) searchIncludes[i] = false;
searchResult = "";
if (store && store->GetValid()) {
+6 -6
View File
@@ -27,7 +27,7 @@
#include "cia.hpp"
#include "files.hpp"
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
Result Title::Launch(u64 titleId, FS_MediaType mediaType) {
Result ret = 0;
u8 param[0x300];
u8 hmac[0x20];
@@ -45,7 +45,7 @@ Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
return 0;
}
Result deletePrevious(u64 titleid, FS_MediaType media) {
Result Title::DeletePrevious(u64 titleid, FS_MediaType media) {
Result ret = 0;
u32 titles_amount = 0;
@@ -82,7 +82,7 @@ Result deletePrevious(u64 titleid, FS_MediaType media) {
return 0;
}
FS_MediaType getTitleDestination(u64 titleId) {
static FS_MediaType getTitleDestination(u64 titleId) {
u16 platform = (u16) ((titleId >> 48) & 0xFFFF);
u16 category = (u16) ((titleId >> 32) & 0xFFFF);
u8 variation = (u8) (titleId & 0xFF);
@@ -93,7 +93,7 @@ FS_MediaType getTitleDestination(u64 titleId) {
u32 installSize = 0, installOffset = 0;
Result installCia(const char *ciaPath, bool updatingSelf) {
Result Title::Install(const char *ciaPath, bool updatingSelf) {
u32 bytes_read = 0, bytes_written;
installSize = 0, installOffset = 0; u64 size = 0;
Handle ciaHandle, fileHandle;
@@ -116,7 +116,7 @@ Result installCia(const char *ciaPath, bool updatingSelf) {
media = getTitleDestination(info.titleID);
if (!updatingSelf) {
ret = deletePrevious(info.titleID, media);
ret = Title::DeletePrevious(info.titleID, media);
if (R_FAILED(ret)) return ret;
}
@@ -158,7 +158,7 @@ Result installCia(const char *ciaPath, bool updatingSelf) {
}
if (updatingSelf) {
if (R_FAILED(ret = CIA_LaunchTitle(info.titleID, MEDIATYPE_SD))) return ret;
if (R_FAILED(ret = Title::Launch(info.titleID, MEDIATYPE_SD))) return ret;
}
return 0;
+2 -2
View File
@@ -75,7 +75,7 @@ void ScriptUtils::bootTitle(const std::string &TitleID, bool isNAND, const std::
const u64 ID = std::stoull(TitleID, 0, 16);
if (Msg::promptMsg(MSG)) {
Msg::DisplayMsg(message);
CIA_LaunchTitle(ID, isNAND ? MEDIATYPE_NAND : MEDIATYPE_SD);
Title::Launch(ID, isNAND ? MEDIATYPE_NAND : MEDIATYPE_SD);
}
}
@@ -232,7 +232,7 @@ void ScriptUtils::installFile(const std::string &file, bool updatingSelf, const
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
thread = threadCreate((ThreadFunc)Animation::displayProgressBar, NULL, 64 * 1024, prio - 1, -2, false);
installCia(in.c_str(), updatingSelf);
Title::Install(in.c_str(), updatingSelf);
showProgressBar = false;
threadJoin(thread, U64_MAX);
threadFree(thread);