diff --git a/include/utils/cia.hpp b/include/utils/cia.hpp index a78a995..a4eece9 100644 --- a/include/utils/cia.hpp +++ b/include/utils/cia.hpp @@ -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 \ No newline at end of file diff --git a/source/main.cpp b/source/main.cpp index be81717..399013b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -39,6 +39,7 @@ std::string _3dsxPath = ""; static void InitForARG() { gfxInitDefault(); romfsInit(); + cfguInit(); Gui::init(); amInit(); acInit(); diff --git a/source/overlays/credits.cpp b/source/overlays/credits.cpp index 5265625..208f506 100644 --- a/source/overlays/credits.cpp +++ b/source/overlays/credits.cpp @@ -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); diff --git a/source/overlays/dirSelect.cpp b/source/overlays/dirSelect.cpp index e5f55bb..248b5fe 100644 --- a/source/overlays/dirSelect.cpp +++ b/source/overlays/dirSelect.cpp @@ -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; diff --git a/source/store/grid.cpp b/source/store/grid.cpp index 6ebbfac..b80757b 100644 --- a/source/store/grid.cpp +++ b/source/store/grid.cpp @@ -28,23 +28,23 @@ #include "structs.hpp" static const std::vector GridBoxes = { - {25, 45, 50, 50}, - {100, 45, 50, 50}, - {175, 45, 50, 50}, - {250, 45, 50, 50}, - {325, 45, 50, 50}, + { 25, 45, 50, 50 }, + { 100, 45, 50, 50 }, + { 175, 45, 50, 50 }, + { 250, 45, 50, 50 }, + { 325, 45, 50, 50 }, - {25, 105, 50, 50}, - {100, 105, 50, 50}, - {175, 105, 50, 50}, - {250, 105, 50, 50}, - {325, 105, 50, 50}, + { 25, 105, 50, 50 }, + { 100, 105, 50, 50 }, + { 175, 105, 50, 50 }, + { 250, 105, 50, 50 }, + { 325, 105, 50, 50 }, - {25, 165, 50, 50}, - {100, 165, 50, 50}, - {175, 165, 50, 50}, - {250, 165, 50, 50}, - {325, 165, 50, 50} + { 25, 165, 50, 50 }, + { 100, 165, 50, 50 }, + { 175, 165, 50, 50 }, + { 250, 165, 50, 50 }, + { 325, 165, 50, 50 } }; /* diff --git a/source/store/markMenu.cpp b/source/store/markMenu.cpp index 6b5f8f4..c1a8e6d 100644 --- a/source/store/markMenu.cpp +++ b/source/store/markMenu.cpp @@ -29,11 +29,11 @@ extern bool touching(touchPosition touch, Structs::ButtonPos button); static const std::vector markBox = { - {10, 94, 52, 52}, - {72, 94, 52, 52}, - {134, 94, 52, 52}, - {196, 94, 52, 52}, - {258, 94, 52, 52}, + { 10, 94, 52, 52 }, + { 72, 94, 52, 52 }, + { 134, 94, 52, 52 }, + { 196, 94, 52, 52 }, + { 258, 94, 52, 52 }, { 53, 215, 20, 20 } }; diff --git a/source/store/searchMenu.cpp b/source/store/searchMenu.cpp index 5e2f056..2acb96f 100644 --- a/source/store/searchMenu.cpp +++ b/source/store/searchMenu.cpp @@ -156,18 +156,23 @@ void StoreUtils::SearchHandle(std::unique_ptr &store, std::vector &store, std::vectorGetValid()) { diff --git a/source/utils/cia.cpp b/source/utils/cia.cpp index cfe196d..cb3f7b9 100644 --- a/source/utils/cia.cpp +++ b/source/utils/cia.cpp @@ -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; diff --git a/source/utils/fileBrowse.cpp b/source/utils/fileBrowse.cpp index 6485b57..9dfe398 100644 --- a/source/utils/fileBrowse.cpp +++ b/source/utils/fileBrowse.cpp @@ -89,7 +89,7 @@ void getDirectoryContents(std::vector &dirContents) { std::vector getContents(const std::string &name, const std::vector &extensionList) { std::vector dirContents; - DIR* pdir = opendir(name.c_str()); + DIR *pdir = opendir(name.c_str()); struct dirent *pent; while ((pent = readdir(pdir)) != NULL) { diff --git a/source/utils/scriptUtils.cpp b/source/utils/scriptUtils.cpp index 219da31..3eb3047 100644 --- a/source/utils/scriptUtils.cpp +++ b/source/utils/scriptUtils.cpp @@ -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);