Add progressbar to SMS

This commit is contained in:
sanni 2022-06-16 17:57:00 +02:00 committed by GitHub
parent dccc99c0ad
commit c9a9e5872e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 718 additions and 707 deletions

View File

@ -410,7 +410,6 @@ void mdCartMenu() {
resetArduino(); resetArduino();
break; break;
} }
println_Msg(F(""));
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
wait(); wait();
@ -1294,10 +1293,13 @@ void readROM_MD() {
//println_Msg(F("s")); //println_Msg(F("s"));
//display_Update(); //display_Update();
println_Msg(F("Calculating checksum..."));
display_Update();
// Calculate and compare CRC32 with no-intro // Calculate and compare CRC32 with no-intro
compareCRC("md.txt"); compareCRC("md.txt");
// print Checksum // Calculate internal checksum
if (chksum == calcCKS) { if (chksum == calcCKS) {
println_Msg(F("Internal checksum OK")); println_Msg(F("Internal checksum OK"));
display_Update(); display_Update();

View File

@ -557,6 +557,11 @@ void readROM_SMS() {
bankSize = cartSize; bankSize = cartSize;
} }
//Initialize progress bar
uint32_t processedProgressBar = 0;
uint32_t totalProgressBar = (uint32_t)(cartSize);
draw_progressbar(0, totalProgressBar);
for (byte currBank = 0x0; currBank < (cartSize / bankSize); currBank++) { for (byte currBank = 0x0; currBank < (cartSize / bankSize); currBank++) {
// Write current 16KB bank to slot 2 register 0xFFFF // Write current 16KB bank to slot 2 register 0xFFFF
if (!raphnet_mode_sg1000) { if (!raphnet_mode_sg1000) {
@ -588,6 +593,10 @@ void readROM_SMS() {
// } // }
myFile.write(sdBuffer, 512); myFile.write(sdBuffer, 512);
} }
// update progress bar
processedProgressBar += bankSize;
draw_progressbar(processedProgressBar, totalProgressBar);
} }
// Close the file: // Close the file:
myFile.close(); myFile.close();