From 3cf150a2680f6b64a2f0b78c5d3fd539a4f3732b Mon Sep 17 00:00:00 2001 From: d0k3 Date: Sun, 21 May 2017 20:56:57 +0200 Subject: [PATCH] Add test mode flags --- source/common/common.h | 4 ++++ source/installer.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/source/common/common.h b/source/common/common.h index 3f1be8e..5807308 100644 --- a/source/common/common.h +++ b/source/common/common.h @@ -43,6 +43,10 @@ // SafeB9SInstaller version #define VERSION "0.0.5" +// testfing flags, only useful to devs +// #define NO_WRITE // disables all NAND writes, just for testing +// #define FAIL_TEST // to test the emergency screen, only works with NO_TRANSFER defined + // input / output paths #define INPUT_PATH "0:/boot9strap" diff --git a/source/installer.c b/source/installer.c index 15a11d6..ac5fc74 100644 --- a/source/installer.c +++ b/source/installer.c @@ -248,6 +248,7 @@ u32 SafeB9SInstaller(void) { snprintf(msgInstall, 64, "FIRM install..."); statusInstall = STATUS_YELLOW; ShowInstallerStatus(); + #ifndef NO_WRITE ShowProgress(0, 0, "FIRM install"); do { ret = SafeWriteNand(FIRM_BUFFER, FIRM0_NAND_OFFSET, firm_size, 0x06); @@ -280,6 +281,16 @@ u32 SafeB9SInstaller(void) { } ShowInstallerStatus(); } + #elif !defined FAIL_TEST + snprintf(msgInstall, 64, "test mode, not done"); + statusInstall = STATUS_YELLOW; + return 0; + #else + snprintf(msgInstall, 64, "fail test mode..."); + statusInstall = STATUS_YELLOW; + ShowInstallerStatus(); + #endif + // if we end up here: uhoh ShowPrompt(false, "SafeB9SInstaller failed!\nThis really should not have happened :/.");