From 4e007504fc4d70456857dd386ddfe3a764c24f31 Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Sun, 23 Feb 2025 20:54:47 -0700 Subject: [PATCH] Hide card read DMA on flashcards --- romsel_aktheme/arm9/source/perGameSettings.cpp | 5 +++-- romsel_dsimenutheme/arm9/source/perGameSettings.cpp | 7 ++++--- romsel_r4theme/arm9/source/perGameSettings.cpp | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/romsel_aktheme/arm9/source/perGameSettings.cpp b/romsel_aktheme/arm9/source/perGameSettings.cpp index 5b2e55c57e..e010aceb41 100644 --- a/romsel_aktheme/arm9/source/perGameSettings.cpp +++ b/romsel_aktheme/arm9/source/perGameSettings.cpp @@ -478,6 +478,7 @@ void perGameSettings (std::string filename) { u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BE0000 : 0xBE0000) + ((sys().dsiWramAccess() && !sys().dsiWramMirrored()) ? (sharedWramEnabled ? 0x88000 : 0x80000) : (sharedWramEnabled ? 0x8000 : 0)); romSizeLimit -= 0x400000; // Account for DSi mode setting const u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0); + const bool romLoadableInRam = (romSize <= (romUnitCode[cursorPosOnScreen] > 0 ? romSizeLimitTwl : romSizeLimit)); extern bool dsiWareCompatibleB4DS(void); bool showPerGameSettings = (bnrRomType[cursorPosOnScreen] == 0 && !isDSiWare[cursorPosOnScreen]); @@ -561,7 +562,7 @@ void perGameSettings (std::string filename) { perGameOp[perGameOps] = 13; // DSiWare booter } if ((perGameSettings_dsiwareBooter == -1 ? ms().dsiWareBooter : perGameSettings_dsiwareBooter) || !dsiFeatures() || (ms().secondaryDevice && bs().b4dsMode) || !ms().dsiWareToSD || sys().arm7SCFGLocked() || ms().consoleModel > 0) { - if (ms().secondaryDevice && (!isDSiMode() || !sys().scfgSdmmcEnabled() || bs().b4dsMode) && !blacklisted_cardReadDma) { + if (ms().secondaryDevice && (!isDSiMode() || !sys().scfgSdmmcEnabled() || bs().b4dsMode) && dsiFeatures() && romLoadableInRam && !blacklisted_cardReadDma) { perGameOps++; perGameOp[perGameOps] = 5; // Card Read DMA } @@ -607,7 +608,7 @@ void perGameSettings (std::string filename) { perGameOps++; perGameOp[perGameOps] = 4; // VRAM Boost } - if (bootstrapEnabled && !blacklisted_cardReadDma) { + if (bootstrapEnabled && (!ms().secondaryDevice || (dsiFeatures() && romLoadableInRam)) && !blacklisted_cardReadDma) { perGameOps++; perGameOp[perGameOps] = 5; // Card Read DMA } diff --git a/romsel_dsimenutheme/arm9/source/perGameSettings.cpp b/romsel_dsimenutheme/arm9/source/perGameSettings.cpp index 9d77e270dc..247ba3a25f 100644 --- a/romsel_dsimenutheme/arm9/source/perGameSettings.cpp +++ b/romsel_dsimenutheme/arm9/source/perGameSettings.cpp @@ -523,6 +523,7 @@ void perGameSettings (std::string filename, bool* dsiBinariesFound, bool* dsiBin u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BE0000 : 0xBE0000) + ((sys().dsiWramAccess() && !sys().dsiWramMirrored()) ? (sharedWramEnabled ? 0x88000 : 0x80000) : (sharedWramEnabled ? 0x8000 : 0)); romSizeLimit -= 0x400000; // Account for DSi mode setting const u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0); + const bool romLoadableInRam = (romSize <= (unitCode[CURPOS] > 0 ? romSizeLimitTwl : romSizeLimit)); extern bool dsiWareCompatibleB4DS(void); bool showPerGameSettings = (bnrRomType[CURPOS] == 0 && !isDSiWare[CURPOS]); @@ -606,7 +607,7 @@ void perGameSettings (std::string filename, bool* dsiBinariesFound, bool* dsiBin perGameOp[perGameOps] = 13; // DSiWare booter } if ((perGameSettings_dsiwareBooter == -1 ? ms().dsiWareBooter : perGameSettings_dsiwareBooter) || !dsiFeatures() || (ms().secondaryDevice && bs().b4dsMode) || !ms().dsiWareToSD || sys().arm7SCFGLocked() || ms().consoleModel > 0) { - if (ms().secondaryDevice && (!isDSiMode() || !sys().scfgSdmmcEnabled() || bs().b4dsMode) && !blacklisted_cardReadDma) { + if (ms().secondaryDevice && (!isDSiMode() || !sys().scfgSdmmcEnabled() || bs().b4dsMode) && dsiFeatures() && romLoadableInRam && !blacklisted_cardReadDma) { perGameOps++; perGameOp[perGameOps] = 5; // Card Read DMA } @@ -659,7 +660,7 @@ void perGameSettings (std::string filename, bool* dsiBinariesFound, bool* dsiBin perGameOps++; perGameOp[perGameOps] = 4; // VRAM Boost } - if (bootstrapEnabled && !blacklisted_cardReadDma) { + if (bootstrapEnabled && (!ms().secondaryDevice || (dsiFeatures() && romLoadableInRam)) && !blacklisted_cardReadDma) { perGameOps++; perGameOp[perGameOps] = 5; // Card Read DMA } @@ -668,7 +669,7 @@ void perGameSettings (std::string filename, bool* dsiBinariesFound, bool* dsiBin perGameOp[perGameOps] = 14; // Game Loader } if (bootstrapEnabled) { - if (!ms().secondaryDevice && (romSize > (unitCode[CURPOS] > 0 ? romSizeLimitTwl : romSizeLimit)) && !blacklisted_asyncCardRead) { + if (!ms().secondaryDevice && !romLoadableInRam && !blacklisted_asyncCardRead) { perGameOps++; perGameOp[perGameOps] = 12; // Async Card Read } diff --git a/romsel_r4theme/arm9/source/perGameSettings.cpp b/romsel_r4theme/arm9/source/perGameSettings.cpp index 11dc2b41da..90474b9cbf 100644 --- a/romsel_r4theme/arm9/source/perGameSettings.cpp +++ b/romsel_r4theme/arm9/source/perGameSettings.cpp @@ -481,6 +481,7 @@ void perGameSettings (std::string filename) { u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BE0000 : 0xBE0000) + ((sys().dsiWramAccess() && !sys().dsiWramMirrored()) ? (sharedWramEnabled ? 0x88000 : 0x80000) : (sharedWramEnabled ? 0x8000 : 0)); romSizeLimit -= 0x400000; // Account for DSi mode setting const u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0); + const bool romLoadableInRam = (romSize <= (romUnitCode > 0 ? romSizeLimitTwl : romSizeLimit)); extern bool dsiWareCompatibleB4DS(void); bool showPerGameSettings = (bnrRomType == 0 && !isDSiWare); @@ -564,7 +565,7 @@ void perGameSettings (std::string filename) { perGameOp[perGameOps] = 13; // DSiWare booter } if ((perGameSettings_dsiwareBooter == -1 ? ms().dsiWareBooter : perGameSettings_dsiwareBooter) || !dsiFeatures() || (ms().secondaryDevice && bs().b4dsMode) || !ms().dsiWareToSD || sys().arm7SCFGLocked() || ms().consoleModel > 0) { - if (ms().secondaryDevice && (!isDSiMode() || !sys().scfgSdmmcEnabled() || bs().b4dsMode) && !blacklisted_cardReadDma) { + if (ms().secondaryDevice && (!isDSiMode() || !sys().scfgSdmmcEnabled() || bs().b4dsMode) && dsiFeatures() && romLoadableInRam && !blacklisted_cardReadDma) { perGameOps++; perGameOp[perGameOps] = 5; // Card Read DMA } @@ -610,7 +611,7 @@ void perGameSettings (std::string filename) { perGameOps++; perGameOp[perGameOps] = 4; // VRAM Boost } - if (bootstrapEnabled && !blacklisted_cardReadDma) { + if (bootstrapEnabled && (!ms().secondaryDevice || (dsiFeatures() && romLoadableInRam)) && !blacklisted_cardReadDma) { perGameOps++; perGameOp[perGameOps] = 5; // Card Read DMA }