Skip to content

Commit

Permalink
DSi-based themes: Check for AP-fix while idle
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Nov 14, 2024
1 parent d2448f3 commit 0d0d579
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions romsel_dsimenutheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3106,6 +3106,8 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
controlTopBright = false;
fadeSpeed = true; // Fast fade speed
bool gameTapped = false;
bool apChecked = false;
bool hasAP = false;

while (1) {
if (!stopSoundPlayed) {
Expand Down Expand Up @@ -3144,6 +3146,17 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
logPrint("\n");
}
updateBoxArt();
if (!apChecked && (bnrRomType[CURPOS] == 0) && !isDSiWare[CURPOS]) {
static int timer = 0;
if (timer == 30) {
if (checkIfShowAPMsg(dirContents[scrn].at(CURPOS + PAGENUM * 40).name)) {
hasAP = checkRomAP(dirContents[scrn].at(CURPOS + PAGENUM * 40).name.c_str(), CURPOS);
}
apChecked = true;
timer = 0;
}
timer++;
}
if (ms().theme < 4) {
while (dboxInFrame) {
bgOperations(true);
Expand Down Expand Up @@ -3196,8 +3209,10 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {

if ((held & KEY_LEFT) || ((held & KEY_TOUCH) && touch.py > 171 && touch.px < 19 && ms().theme == TWLSettings::EThemeDSi)) { // Left or button arrow (DSi theme)
moveCursor(false, dirContents[scrn]);
apChecked = false;
} else if ((held & KEY_RIGHT) || ((held & KEY_TOUCH) && touch.py > 171 && touch.px > 236 && ms().theme == TWLSettings::EThemeDSi)) { // Right or button arrow (DSi theme)
moveCursor(true, dirContents[scrn]);
apChecked = false;
} else if ((pressed & KEY_UP) && (PAGENUM > 0 || CURPOS > 0 || !backFound) && (ms().theme != TWLSettings::EThemeSaturn && ms().theme != TWLSettings::EThemeHBL) && !dirInfoIniFound && (ms().sortMethod == 4) && (CURPOS + PAGENUM * 40 < ((int)dirContents[scrn].size()))) { // Move apps (DSi & 3DS themes)
bannerTextShown = false; // Redraw the title when done
showSTARTborder = false;
Expand Down Expand Up @@ -3725,7 +3740,6 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
if (isValid[CURPOS] && !isTwlm[CURPOS]) {
loadPerGameSettings(dirContents[scrn].at(CURPOS + PAGENUM * 40).name);
}
int hasAP = 0;
bool proceedToLaunch = true;
if (!isValid[CURPOS] || isTwlm[CURPOS] || (isUnlaunch[CURPOS] && ms().theme == TWLSettings::ETheme3DS) || (!isDSiWare[CURPOS] && (!dsiFeatures() || bs().b4dsMode) && ms().secondaryDevice && bnrRomType[CURPOS] == 0 && gameTid[CURPOS][0] == 'D' && unitCode[CURPOS] == 3 && requiresDonorRom[CURPOS] != 51)
|| (isDSiWare[CURPOS] && ((((!dsiFeatures() && (!sdFound() || !ms().dsiWareToSD)) || bs().b4dsMode) && ms().secondaryDevice && !dsiWareCompatibleB4DS())
Expand Down Expand Up @@ -3795,7 +3809,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
proceedToLaunch = donorRomMsg(dirContents[scrn].at(CURPOS + PAGENUM * 40).name.c_str());
}
}
if (proceedToLaunch && !isDSiWare[CURPOS] && checkIfShowAPMsg(dirContents[scrn].at(CURPOS + PAGENUM * 40).name)) {
if (proceedToLaunch && !apChecked && !isDSiWare[CURPOS] && checkIfShowAPMsg(dirContents[scrn].at(CURPOS + PAGENUM * 40).name)) {
hasAP = checkRomAP(dirContents[scrn].at(CURPOS + PAGENUM * 40).name.c_str(), CURPOS);
}
if (proceedToLaunch && isDSiWare[CURPOS] && (!dsiFeatures() || bs().b4dsMode) && ms().secondaryDevice) {
Expand Down Expand Up @@ -3823,7 +3837,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
&& isDSiMode() && memcmp(io_dldi_data->friendlyName, "CycloDS iEvolution", 18) != 0 && sys().arm7SCFGLocked()) {
proceedToLaunch = cannotLaunchMsg(dirContents[scrn].at(CURPOS + PAGENUM * 40).name.c_str());
}
if (hasAP > 0) {
if (hasAP) {
if (ms().theme == TWLSettings::EThemeSaturn) {
snd().playStartup();
fadeType = false; // Fade to black
Expand Down

0 comments on commit 0d0d579

Please sign in to comment.