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
This commit is contained in:
urmum-69 2021-03-25 00:02:54 +00:00 committed by GitHub
parent 9e00e5394e
commit 4c726266f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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(<A> select, <B> 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