mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-23 13:09:17 +01:00
Add progressbar to SMS
This commit is contained in:
parent
dccc99c0ad
commit
c9a9e5872e
@ -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();
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user