From 4c726266f79f9a1365ba62b70498117a2157bd31 Mon Sep 17 00:00:00 2001 From: urmum-69 Date: Thu, 25 Mar 2021 00:02:54 +0000 Subject: [PATCH] don't run b4ds anymore, as it is obsolete (#87) * don't run b4ds anymore, as it is obsolete * fix off by one error when printing SHA1 hash --- arm9/source/fileOperations.cpp | 2 +- arm9/source/file_browse.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arm9/source/fileOperations.cpp b/arm9/source/fileOperations.cpp index 5c1b33e..c8777bb 100644 --- a/arm9/source/fileOperations.cpp +++ b/arm9/source/fileOperations.cpp @@ -95,7 +95,7 @@ bool calculateSHA1(const char *fileName, u8 *sha1) int keys = keysHeld(); if (keys & KEY_START) return false; iprintf("\x1b[1;A"); - iprintf("%ld/%lld bytes\n", ftell(fp), fsize); + iprintf("%ld/%lld bytes processed\n", ftell(fp), fsize); } swiSHA1Final(sha1, &ctx); free(buf); diff --git a/arm9/source/file_browse.cpp b/arm9/source/file_browse.cpp index fc73e01..0d83931 100644 --- a/arm9/source/file_browse.cpp +++ b/arm9/source/file_browse.cpp @@ -242,12 +242,13 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { assignedOp[++maxCursors] = FileOperation::copyFatOut; printf(" Copy to fat:/gm9i/out\n"); } - // The bios SHA1 functions are only availible on the DSi + // The bios SHA1 functions are only available on the DSi // https://problemkaputt.de/gbatek.htm#biossha1functionsdsionly if (isDSiMode()) { assignedOp[++maxCursors] = FileOperation::calculateSHA1; printf(" Calculate SHA1 hash\n"); } + printf("\n( select, cancel)"); consoleSelect(&bottomConsole); printf ("\x1B[47m"); // Print foreground white color while (true) { @@ -307,7 +308,7 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { // TODO Something less hacky lol chdir(isDSiMode()&&sdMounted ? "sd:/_nds" : "fat:/_nds"); // TODO Read header and check for homebrew flag, based on that runNdsFile nds-bootstrap(-hb)-release - entry->name = isDSiMode() ? "nds-bootstrap-release.nds" : "b4ds-release.nds"; + entry->name = "nds-bootstrap-release.nds"; applaunch = true; return FileOperation::bootFile; break; @@ -386,8 +387,8 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { u8 sha1[20] = {0}; bool ret = calculateSHA1(strcat(getcwd(path, PATH_MAX), entry->name.c_str()), sha1); if (!ret) break; - iprintf("SHA1 hash is: "); - for (int i = 0; i < 19; ++i) iprintf("%02X", sha1[i]); + iprintf("SHA1 hash is: \n"); + for (int i = 0; i < 20; ++i) iprintf("%02X", sha1[i]); consoleSelect(&topConsole); iprintf ("\x1B[30m"); // Print black color // Power saving loop. Only poll the keys once per frame and sleep the CPU if there is nothing else to do