From 92bca32a48c15d0ace2a52780af2c0e5b2be4b05 Mon Sep 17 00:00:00 2001 From: splash5 <2173030+splash5@users.noreply.github.com> Date: Sat, 26 Feb 2022 22:14:03 +0800 Subject: [PATCH] Showing progress bar when reading ROM --- Cart_Reader/WS.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cart_Reader/WS.ino b/Cart_Reader/WS.ino index cf7fe956..c4716de0 100644 --- a/Cart_Reader/WS.ino +++ b/Cart_Reader/WS.ino @@ -494,6 +494,9 @@ void readROM_WS(char *outPathBuf, size_t bufferSize) // get correct starting rom bank uint16_t bank = (256 - (cartSize >> 16)); + uint32_t progress = 0; + + draw_progressbar(0, cartSize); // start reading rom for (; bank <= 0xff; bank++) @@ -517,7 +520,10 @@ void readROM_WS(char *outPathBuf, size_t bufferSize) * ((uint16_t*)(sdBuffer + w)) = readWord_WS(0x20000 + addr + w); myFile.write(sdBuffer, 512); + progress += 512; } + + draw_progressbar(progress, cartSize); } // turn off LEDs (only for BANC33)