From a302ad3bea456317469cf60d968c49cfea82791c Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sat, 20 Aug 2016 18:45:56 +0200 Subject: [PATCH 1/2] R.I.P boot speed boost (for now) --- injector/source/patcher.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/injector/source/patcher.c b/injector/source/patcher.c index 4242cd2..a2e63c3 100644 --- a/injector/source/patcher.c +++ b/injector/source/patcher.c @@ -19,18 +19,6 @@ typedef struct __attribute__((packed)) CFWInfo info = {0}; -int __attribute__((naked)) svcGetCFWInfo(CFWInfo __attribute__((unused)) *out) -{ - __asm__ volatile("svc 0x2E; bx lr"); -} - -static void loadCFWInfo(void) -{ - static bool infoLoaded = false; - if(!infoLoaded) svcGetCFWInfo(&info); - infoLoaded = true; -} - #ifndef PATH_MAX #define PATH_MAX 255 #define CONFIG(a) (((info.config >> (a + 16)) & 1) != 0) @@ -118,6 +106,26 @@ static int fileOpen(IFile *file, FS_ArchiveID archiveId, const char *path, int f return IFile_Open(file, archiveId, archivePath, filePath, flags); } +int __attribute__((naked)) svcGetCFWInfo(CFWInfo __attribute__((unused)) *out) +{ + __asm__ volatile("svc 0x2E; bx lr"); +} + +static void loadCFWInfo(void) +{ + static bool infoLoaded = false; + if(!infoLoaded) + { + svcGetCFWInfo(&info); + IFile file; + if(R_SUCCEEDED(fileOpen(&file, ARCHIVE_SDMC, "/", FS_OPEN_READ))) //init SD card for firmlaunch patches + { + IFile_Close(&file); + } + } + infoLoaded = true; +} + static bool secureInfoExists(void) { static bool exists = false; @@ -584,4 +592,4 @@ void patchCode(u64 progId, u8 *code, u32 size) break; } -} \ No newline at end of file +} From ef1ecf859c4d7af3eee5d323c3b079cfc256aaa2 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sat, 20 Aug 2016 19:59:25 +0200 Subject: [PATCH 2/2] Update draw.c --- source/draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/draw.c b/source/draw.c index b23bc09..e715554 100644 --- a/source/draw.c +++ b/source/draw.c @@ -43,7 +43,7 @@ static inline int strlen(const char *string) bool loadSplash(void) { //Don't delay boot nor init the screens if no splash image is on the SD - if(getFileSize("/luma/splash.bin") + getFileSize("/luma/splash.bin") == 0) + if(getFileSize("/luma/splash.bin") + getFileSize("/luma/splashbottom.bin") == 0) return false; initScreens(); @@ -98,4 +98,4 @@ int drawString(const char *string, int posX, int posY, u32 color) } return posY; -} \ No newline at end of file +}