Skip to content

Commit

Permalink
Update loading bar when erasing EZ-Flash NOR flash
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Dec 25, 2020
1 parent 5f7b483 commit 9625221
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
13 changes: 10 additions & 3 deletions quickmenu/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2561,9 +2561,9 @@ int main(int argc, char **argv) {
if (showGba == 1) {
clearText();
ClearBrightness();
printSmallCentered(false, 20, "If the bar stopped, close and open");
printSmallCentered(false, 34, "the console's lid.");
printSmallCentered(false, 88, "Now Loading...");
if (*(u16*)(0x020000C0) == 0x5A45) {
printSmallCentered(false, 88, "Please wait...");
}

showProgressBar = true;
progressBarLength = 0;
Expand All @@ -2582,12 +2582,19 @@ int main(int argc, char **argv) {
for(u32 address=0;address<romSize&&address<0x2000000;address+=0x40000)
{
expansion().Block_Erase(address);
progressBarLength = (address+0x40000)/(romSize/192);
if (progressBarLength > 192) progressBarLength = 192;
}
nor = true;
} else if (*(u16*)(0x020000C0) == 0x4353 && romSize > 0x1FFFFFE) {
romSize = 0x1FFFFFE;
}

clearText();
printSmallCentered(false, 20, "If the bar stopped, close and open");
printSmallCentered(false, 34, "the console's lid.");
printSmallCentered(false, 88, "Now Loading...");

FILE* gbaFile = fopen(filename[secondaryDevice].c_str(), "rb");
for (u32 len = romSize; len > 0; len -= 0x8000) {
if (fread(&copyBuf, 1, (len>0x8000 ? 0x8000 : len), gbaFile) > 0) {
Expand Down
14 changes: 11 additions & 3 deletions romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,9 +1636,10 @@ int main(int argc, char **argv) {

if (ms().showGba == 1) {
if (ms().theme == 5) displayGameIcons = false;
printSmall(false, 0, 20, STR_BARSTOPPED_CLOSELID, Alignment::center);
printLarge(false, 0, (ms().theme == 4 ? 80 : 88), STR_NOW_LOADING, Alignment::center);
updateText(false);
if (*(u16*)(0x020000C0) == 0x5A45) {
printLarge(false, 0, (ms().theme == 4 ? 80 : 88), STR_PLEASE_WAIT, Alignment::center);
updateText(false);
}

if (ms().theme != 4 && ms().theme != 5) {
fadeSpeed = true; // Fast fading
Expand All @@ -1662,12 +1663,19 @@ int main(int argc, char **argv) {
for(u32 address=0;address<romSize&&address<0x2000000;address+=0x40000)
{
expansion().Block_Erase(address);
progressBarLength = (address+0x40000)/(romSize/192);
if (progressBarLength > 192) progressBarLength = 192;
}
nor = true;
} else if (*(u16*)(0x020000C0) == 0x4353 && romSize > 0x1FFFFFE) {
romSize = 0x1FFFFFE;
}

clearText();
printSmall(false, 0, 20, STR_BARSTOPPED_CLOSELID, Alignment::center);
printLarge(false, 0, (ms().theme == 4 ? 80 : 88), STR_NOW_LOADING, Alignment::center);
updateText(false);

FILE* gbaFile = fopen(filename.c_str(), "rb");
for (u32 len = romSize; len > 0; len -= 0x8000) {
if (fread(&copyBuf, 1, (len>0x8000 ? 0x8000 : len), gbaFile) > 0) {
Expand Down

0 comments on commit 9625221

Please sign in to comment.