@@ -3106,8 +3106,10 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
3106
3106
controlTopBright = false ;
3107
3107
fadeSpeed = true ; // Fast fade speed
3108
3108
bool gameTapped = false ;
3109
+ bool dsiBinariesChecked = false ;
3110
+ bool hasDsiBinaries = true ;
3109
3111
bool apChecked = false ;
3110
- int apCheckTimer = 0 ;
3112
+ int infoCheckTimer = 0 ;
3111
3113
bool hasAP = false ;
3112
3114
3113
3115
while (1 ) {
@@ -3147,14 +3149,18 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
3147
3149
logPrint (" \n " );
3148
3150
}
3149
3151
updateBoxArt ();
3150
- if (!apChecked && (bnrRomType[CURPOS] == 0 ) && !isDSiWare[CURPOS]) {
3151
- if (apCheckTimer == 30 ) {
3152
- if (checkIfShowAPMsg (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name )) {
3152
+ if ((infoCheckTimer < 30 ) && (bnrRomType[CURPOS] == 0 ) && (isHomebrew[CURPOS] == 0 ) && !isDSiWare[CURPOS]) {
3153
+ infoCheckTimer++;
3154
+ if (infoCheckTimer == 30 ) {
3155
+ if (!dsiBinariesChecked) {
3156
+ hasDsiBinaries = checkDsiBinaries (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name .c_str ());
3157
+ }
3158
+ dsiBinariesChecked = true ;
3159
+ if (!apChecked && checkIfShowAPMsg (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name )) {
3153
3160
hasAP = checkRomAP (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name .c_str (), CURPOS);
3154
3161
}
3155
3162
apChecked = true ;
3156
3163
}
3157
- apCheckTimer++;
3158
3164
}
3159
3165
if (ms ().theme < 4 ) {
3160
3166
while (dboxInFrame) {
@@ -3208,12 +3214,14 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
3208
3214
3209
3215
if ((held & KEY_LEFT) || ((held & KEY_TOUCH) && touch.py > 171 && touch.px < 19 && ms ().theme == TWLSettings::EThemeDSi)) { // Left or button arrow (DSi theme)
3210
3216
moveCursor (false , dirContents[scrn]);
3217
+ dsiBinariesChecked = false ;
3211
3218
apChecked = false ;
3212
- apCheckTimer = 0 ;
3219
+ infoCheckTimer = 0 ;
3213
3220
} else if ((held & KEY_RIGHT) || ((held & KEY_TOUCH) && touch.py > 171 && touch.px > 236 && ms ().theme == TWLSettings::EThemeDSi)) { // Right or button arrow (DSi theme)
3214
3221
moveCursor (true , dirContents[scrn]);
3222
+ dsiBinariesChecked = false ;
3215
3223
apChecked = false ;
3216
- apCheckTimer = 0 ;
3224
+ infoCheckTimer = 0 ;
3217
3225
} 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)
3218
3226
bannerTextShown = false ; // Redraw the title when done
3219
3227
showSTARTborder = false ;
@@ -3752,12 +3760,9 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
3752
3760
if (proceedToLaunch && useBootstrapAnyway && bnrRomType[CURPOS] == 0 && !isDSiWare[CURPOS]
3753
3761
&& isHomebrew[CURPOS] == 0
3754
3762
&& checkIfDSiMode (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name )) {
3755
- bool hasDsiBinaries = true ;
3756
- if (dsiFeatures () && (!ms ().secondaryDevice || !bs ().b4dsMode )) {
3757
- FILE *f_nds_file = fopen (
3758
- dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name .c_str (), " rb" );
3759
- hasDsiBinaries = checkDsiBinaries (f_nds_file);
3760
- fclose (f_nds_file);
3763
+ if (!dsiBinariesChecked && dsiFeatures () && (!ms ().secondaryDevice || !bs ().b4dsMode )) {
3764
+ hasDsiBinaries = checkDsiBinaries (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name .c_str ());
3765
+ dsiBinariesChecked = true ;
3761
3766
}
3762
3767
3763
3768
if (!hasDsiBinaries) {
@@ -4403,7 +4408,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
4403
4408
}
4404
4409
4405
4410
if ((pressed & KEY_Y) && !ms ().kioskMode && isValid[CURPOS] && !isTwlm[CURPOS] && !isDirectory[CURPOS] && bannerTextShown && showSTARTborder) {
4406
- perGameSettings (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name );
4411
+ perGameSettings (dirContents[scrn].at (CURPOS + PAGENUM * 40 ).name , hasDsiBinaries, &dsiBinariesChecked );
4407
4412
bannerTextShown = false ;
4408
4413
}
4409
4414
0 commit comments