diff --git a/include/arm9/ui.h b/include/arm9/ui.h index 2289498..28662dc 100644 --- a/include/arm9/ui.h +++ b/include/arm9/ui.h @@ -20,6 +20,7 @@ PrintConsole con_top, con_bottom; void uiInit(); +void uiDrawSplashScreen(); void uiClearConsoles(); void clearConsole(int which); bool uiDialogYesNo(const char *text, const char *textYes, const char *textNo); diff --git a/source/arm9/main.c b/source/arm9/main.c index 0db1b42..4e50960 100644 --- a/source/arm9/main.c +++ b/source/arm9/main.c @@ -15,8 +15,6 @@ #include "arm9/menu.h" #include "arm9/main.h" - - static bool devs_init(); static bool fs_early_init(); static bool mount_fs(); @@ -34,6 +32,10 @@ hashCodeRoData(); // TODO: remove after debugging + screen_init(); + + uiDrawSplashScreen(); + uiInit(); consoleSelect(&con_top); diff --git a/source/arm9/menu_nand.c b/source/arm9/menu_nand.c index 31287a8..3204cdd 100644 --- a/source/arm9/menu_nand.c +++ b/source/arm9/menu_nand.c @@ -40,11 +40,17 @@ if(!buf) panic(); // this should never happen. + uiPrintCentered("NAND Backup"); + + uiPrintTextAt(0, 2, "Checking free space on SD card...\n"); + if(getFreeSpace("sdmc:") < sectorCount<<9) { uiPrintError("Not enough space on the SD card!\n"); goto fail; } + + uiPrintTextAt(0, 3, "Creating image file...\n"); if((fres = f_open(&file, filePath, FA_CREATE_ALWAYS | FA_WRITE)) != FR_OK) { @@ -60,6 +66,8 @@ f_close(&file); goto fail; } + + uiPrintTextAt(0, 4, "Dumping NAND...\n"); /* Main loop */ @@ -94,11 +102,11 @@ curSector += curSectorBlkSize; // print current progress information - uiPrintInfo("\r%"PRId32"/%"PRId32" MB (Sector 0x%"PRIX32"/0x%"PRIX32")", curSector>>11, sectorCount>>11, + uiPrintTextAt(1, 20, "\r%"PRId32"/%"PRId32" MB (Sector 0x%"PRIX32"/0x%"PRIX32")", curSector>>11, sectorCount>>11, curSector, sectorCount); - uiPrintProgressBar(10, 10, 200, 20, 100 * (float) curSector/sectorCount); + uiPrintProgressBar(10, 200, 20, 150, 100 * (float) curSector/sectorCount); switch(menuUpdateGlobalState()) { diff --git a/source/arm9/ui.c b/source/arm9/ui.c index d014b2f..a0ff4b9 100644 --- a/source/arm9/ui.c +++ b/source/arm9/ui.c @@ -13,6 +13,8 @@ static u8 randomColor; +static const void *bannerData = banner_ppm_bin; + static void uiDrawPPM(unsigned start_x, unsigned start_y, const u8 *data); static void consoleMainInit() @@ -30,11 +32,15 @@ consoleSelect(&con_top); } +void uiDrawSplashScreen() +{ + uiDrawPPM(30,30, bannerData); + wait(0x6000000); // test +} + void uiInit() { consoleMainInit(); - uiDrawPPM(30,30, banner_ppm_bin); // test - wait(0x6000000); } static void clearConsoles()