mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-06 16:49:11 +00:00
Slight changes.
This commit is contained in:
@@ -31,8 +31,10 @@
|
|||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
|
|
||||||
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType);
|
namespace Title {
|
||||||
Result deletePrevious(u64 titleid, FS_MediaType media);
|
Result Launch(u64 titleId, FS_MediaType mediaType);
|
||||||
Result installCia(const char *ciaPath, bool updateSelf);
|
Result DeletePrevious(u64 titleid, FS_MediaType media);
|
||||||
|
Result Install(const char *ciaPath, bool updateSelf);
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -39,6 +39,7 @@ std::string _3dsxPath = "";
|
|||||||
static void InitForARG() {
|
static void InitForARG() {
|
||||||
gfxInitDefault();
|
gfxInitDefault();
|
||||||
romfsInit();
|
romfsInit();
|
||||||
|
cfguInit();
|
||||||
Gui::init();
|
Gui::init();
|
||||||
amInit();
|
amInit();
|
||||||
acInit();
|
acInit();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ void Overlays::ShowCredits() {
|
|||||||
C2D_TargetClear(Bottom, TRANSPARENT);
|
C2D_TargetClear(Bottom, TRANSPARENT);
|
||||||
|
|
||||||
GFX::DrawTop();
|
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::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);
|
Gui::DrawString(10, 30, 0.5f, TEXT_COLOR, "- Universal-Team", 0, 0, font);
|
||||||
|
|||||||
@@ -186,10 +186,8 @@ std::string Overlays::SelectDir(const std::string &oldDir, const std::string &ms
|
|||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
getcwd(path, PATH_MAX);
|
getcwd(path, PATH_MAX);
|
||||||
|
|
||||||
if (strcmp(path, "sdmc:/") == 0 || strcmp(path, "/") == 0) {
|
if (strcmp(path, "sdmc:/") == 0 || strcmp(path, "/") == 0) return "";
|
||||||
return "";
|
else {
|
||||||
|
|
||||||
} else {
|
|
||||||
chdir("..");
|
chdir("..");
|
||||||
getcwd(path, PATH_MAX);
|
getcwd(path, PATH_MAX);
|
||||||
currentPath = path;
|
currentPath = path;
|
||||||
|
|||||||
+15
-15
@@ -28,23 +28,23 @@
|
|||||||
#include "structs.hpp"
|
#include "structs.hpp"
|
||||||
|
|
||||||
static const std::vector<Structs::ButtonPos> GridBoxes = {
|
static const std::vector<Structs::ButtonPos> GridBoxes = {
|
||||||
{25, 45, 50, 50},
|
{ 25, 45, 50, 50 },
|
||||||
{100, 45, 50, 50},
|
{ 100, 45, 50, 50 },
|
||||||
{175, 45, 50, 50},
|
{ 175, 45, 50, 50 },
|
||||||
{250, 45, 50, 50},
|
{ 250, 45, 50, 50 },
|
||||||
{325, 45, 50, 50},
|
{ 325, 45, 50, 50 },
|
||||||
|
|
||||||
{25, 105, 50, 50},
|
{ 25, 105, 50, 50 },
|
||||||
{100, 105, 50, 50},
|
{ 100, 105, 50, 50 },
|
||||||
{175, 105, 50, 50},
|
{ 175, 105, 50, 50 },
|
||||||
{250, 105, 50, 50},
|
{ 250, 105, 50, 50 },
|
||||||
{325, 105, 50, 50},
|
{ 325, 105, 50, 50 },
|
||||||
|
|
||||||
{25, 165, 50, 50},
|
{ 25, 165, 50, 50 },
|
||||||
{100, 165, 50, 50},
|
{ 100, 165, 50, 50 },
|
||||||
{175, 165, 50, 50},
|
{ 175, 165, 50, 50 },
|
||||||
{250, 165, 50, 50},
|
{ 250, 165, 50, 50 },
|
||||||
{325, 165, 50, 50}
|
{ 325, 165, 50, 50 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -29,11 +29,11 @@
|
|||||||
|
|
||||||
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||||
static const std::vector<Structs::ButtonPos> markBox = {
|
static const std::vector<Structs::ButtonPos> markBox = {
|
||||||
{10, 94, 52, 52},
|
{ 10, 94, 52, 52 },
|
||||||
{72, 94, 52, 52},
|
{ 72, 94, 52, 52 },
|
||||||
{134, 94, 52, 52},
|
{ 134, 94, 52, 52 },
|
||||||
{196, 94, 52, 52},
|
{ 196, 94, 52, 52 },
|
||||||
{258, 94, 52, 52},
|
{ 258, 94, 52, 52 },
|
||||||
|
|
||||||
{ 53, 215, 20, 20 }
|
{ 53, 215, 20, 20 }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -156,18 +156,23 @@ void StoreUtils::SearchHandle(std::unique_ptr<Store> &store, std::vector<std::un
|
|||||||
if (touching(touch, SearchMenu[5])) {
|
if (touching(touch, SearchMenu[5])) {
|
||||||
marks = marks ^ favoriteMarks::STAR;
|
marks = marks ^ favoriteMarks::STAR;
|
||||||
didTouch = true;
|
didTouch = true;
|
||||||
|
|
||||||
} else if (touching(touch, SearchMenu[6])) {
|
} else if (touching(touch, SearchMenu[6])) {
|
||||||
marks = marks ^ favoriteMarks::HEART;
|
marks = marks ^ favoriteMarks::HEART;
|
||||||
didTouch = true;
|
didTouch = true;
|
||||||
|
|
||||||
} else if (touching(touch, SearchMenu[7])) {
|
} else if (touching(touch, SearchMenu[7])) {
|
||||||
marks = marks ^ favoriteMarks::DIAMOND;
|
marks = marks ^ favoriteMarks::DIAMOND;
|
||||||
didTouch = true;
|
didTouch = true;
|
||||||
|
|
||||||
} else if (touching(touch, SearchMenu[8])) {
|
} else if (touching(touch, SearchMenu[8])) {
|
||||||
marks = marks ^ favoriteMarks::CLUBS;
|
marks = marks ^ favoriteMarks::CLUBS;
|
||||||
didTouch = true;
|
didTouch = true;
|
||||||
|
|
||||||
} else if (touching(touch, SearchMenu[9])) {
|
} else if (touching(touch, SearchMenu[9])) {
|
||||||
marks = marks ^ favoriteMarks::SPADE;
|
marks = marks ^ favoriteMarks::SPADE;
|
||||||
didTouch = true;
|
didTouch = true;
|
||||||
|
|
||||||
} else if (touching(touch, SearchMenu[10])) {
|
} else if (touching(touch, SearchMenu[10])) {
|
||||||
updateFilter = !updateFilter;
|
updateFilter = !updateFilter;
|
||||||
didTouch = true;
|
didTouch = true;
|
||||||
@@ -191,8 +196,7 @@ void StoreUtils::SearchHandle(std::unique_ptr<Store> &store, std::vector<std::un
|
|||||||
if (hDown & KEY_X) {
|
if (hDown & KEY_X) {
|
||||||
marks = 0;
|
marks = 0;
|
||||||
updateFilter = false;
|
updateFilter = false;
|
||||||
for(uint i = 0; i < searchIncludes.size(); i++)
|
for(uint i = 0; i < searchIncludes.size(); i++) searchIncludes[i] = false;
|
||||||
searchIncludes[i] = false;
|
|
||||||
searchResult = "";
|
searchResult = "";
|
||||||
|
|
||||||
if (store && store->GetValid()) {
|
if (store && store->GetValid()) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "cia.hpp"
|
#include "cia.hpp"
|
||||||
#include "files.hpp"
|
#include "files.hpp"
|
||||||
|
|
||||||
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
|
Result Title::Launch(u64 titleId, FS_MediaType mediaType) {
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u8 param[0x300];
|
u8 param[0x300];
|
||||||
u8 hmac[0x20];
|
u8 hmac[0x20];
|
||||||
@@ -45,7 +45,7 @@ Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result deletePrevious(u64 titleid, FS_MediaType media) {
|
Result Title::DeletePrevious(u64 titleid, FS_MediaType media) {
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 titles_amount = 0;
|
u32 titles_amount = 0;
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ Result deletePrevious(u64 titleid, FS_MediaType media) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FS_MediaType getTitleDestination(u64 titleId) {
|
static FS_MediaType getTitleDestination(u64 titleId) {
|
||||||
u16 platform = (u16) ((titleId >> 48) & 0xFFFF);
|
u16 platform = (u16) ((titleId >> 48) & 0xFFFF);
|
||||||
u16 category = (u16) ((titleId >> 32) & 0xFFFF);
|
u16 category = (u16) ((titleId >> 32) & 0xFFFF);
|
||||||
u8 variation = (u8) (titleId & 0xFF);
|
u8 variation = (u8) (titleId & 0xFF);
|
||||||
@@ -93,7 +93,7 @@ FS_MediaType getTitleDestination(u64 titleId) {
|
|||||||
|
|
||||||
u32 installSize = 0, installOffset = 0;
|
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;
|
u32 bytes_read = 0, bytes_written;
|
||||||
installSize = 0, installOffset = 0; u64 size = 0;
|
installSize = 0, installOffset = 0; u64 size = 0;
|
||||||
Handle ciaHandle, fileHandle;
|
Handle ciaHandle, fileHandle;
|
||||||
@@ -116,7 +116,7 @@ Result installCia(const char *ciaPath, bool updatingSelf) {
|
|||||||
media = getTitleDestination(info.titleID);
|
media = getTitleDestination(info.titleID);
|
||||||
|
|
||||||
if (!updatingSelf) {
|
if (!updatingSelf) {
|
||||||
ret = deletePrevious(info.titleID, media);
|
ret = Title::DeletePrevious(info.titleID, media);
|
||||||
if (R_FAILED(ret)) return ret;
|
if (R_FAILED(ret)) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ Result installCia(const char *ciaPath, bool updatingSelf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (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;
|
return 0;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ void getDirectoryContents(std::vector<DirEntry> &dirContents) {
|
|||||||
|
|
||||||
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList) {
|
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList) {
|
||||||
std::vector<std::string> dirContents;
|
std::vector<std::string> dirContents;
|
||||||
DIR* pdir = opendir(name.c_str());
|
DIR *pdir = opendir(name.c_str());
|
||||||
struct dirent *pent;
|
struct dirent *pent;
|
||||||
|
|
||||||
while ((pent = readdir(pdir)) != NULL) {
|
while ((pent = readdir(pdir)) != NULL) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ void ScriptUtils::bootTitle(const std::string &TitleID, bool isNAND, const std::
|
|||||||
const u64 ID = std::stoull(TitleID, 0, 16);
|
const u64 ID = std::stoull(TitleID, 0, 16);
|
||||||
if (Msg::promptMsg(MSG)) {
|
if (Msg::promptMsg(MSG)) {
|
||||||
Msg::DisplayMsg(message);
|
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);
|
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
|
||||||
thread = threadCreate((ThreadFunc)Animation::displayProgressBar, NULL, 64 * 1024, prio - 1, -2, false);
|
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;
|
showProgressBar = false;
|
||||||
threadJoin(thread, U64_MAX);
|
threadJoin(thread, U64_MAX);
|
||||||
threadFree(thread);
|
threadFree(thread);
|
||||||
|
|||||||
Reference in New Issue
Block a user