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

View File

@ -557,6 +557,11 @@ void readROM_SMS() {
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++) {
// Write current 16KB bank to slot 2 register 0xFFFF
if (!raphnet_mode_sg1000) {
@ -588,6 +593,10 @@ void readROM_SMS() {
// }
myFile.write(sdBuffer, 512);
}
// update progress bar
processedProgressBar += bankSize;
draw_progressbar(processedProgressBar, totalProgressBar);
}
// Close the file:
myFile.close();