mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-02 16:49:05 +00:00
Slight changes.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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> dirContents;
|
||||
DIR* pdir = opendir(name.c_str());
|
||||
DIR *pdir = opendir(name.c_str());
|
||||
struct dirent *pent;
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user