Showing progress bar when reading ROM

This commit is contained in:
splash5 2022-02-26 22:14:03 +08:00
parent 4a0cb10900
commit 92bca32a48

View File

@ -494,6 +494,9 @@ void readROM_WS(char *outPathBuf, size_t bufferSize)
// get correct starting rom bank // get correct starting rom bank
uint16_t bank = (256 - (cartSize >> 16)); uint16_t bank = (256 - (cartSize >> 16));
uint32_t progress = 0;
draw_progressbar(0, cartSize);
// start reading rom // start reading rom
for (; bank <= 0xff; bank++) 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); * ((uint16_t*)(sdBuffer + w)) = readWord_WS(0x20000 + addr + w);
myFile.write(sdBuffer, 512); myFile.write(sdBuffer, 512);
progress += 512;
} }
draw_progressbar(progress, cartSize);
} }
// turn off LEDs (only for BANC33) // turn off LEDs (only for BANC33)