diff --git a/source/main.cpp b/source/main.cpp index e7e9b06..d09b92c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -9,6 +9,7 @@ #include #include <3ds.h> +#include typedef enum { INSTALL_CIA, @@ -101,8 +102,13 @@ int main(int argc, char **argv) { return breakLoop; }; - auto onProgress = [&](int progress) { - uiDisplayProgress(TOP_SCREEN, "Installing", "Press B to cancel.", true, progress); + auto onProgress = [&](u64 pos, u64 totalSize) { + std::stringstream details; + details << "(" << std::fixed << std::setprecision(2) << ((double) pos / 1024.0 / 1024.0) << "MB / " << std::fixed << std::setprecision(2) << ((double) totalSize / 1024.0 / 1024.0) << "MB)" << "\n"; + details << "Press B to cancel."; + + u32 progress = (u32) (((double) pos / (double) totalSize) * 100); + uiDisplayProgress(TOP_SCREEN, "Installing", details.str(), true, progress); inputPoll(); return !inputIsPressed(BUTTON_B); };