diff --git a/mainmenu/arm9/source/main.cpp b/mainmenu/arm9/source/main.cpp index 99d5e24146..6ef5c51145 100644 --- a/mainmenu/arm9/source/main.cpp +++ b/mainmenu/arm9/source/main.cpp @@ -2036,6 +2036,11 @@ int main(int argc, char **argv) { bootstrapini.SetInt( "NDS-BOOTSTRAP", "GAME_SOFT_RESET", gameSoftReset); bootstrapini.SetInt( "NDS-BOOTSTRAP", "PATCH_MPU_REGION", mpuregion); bootstrapini.SetInt( "NDS-BOOTSTRAP", "PATCH_MPU_SIZE", mpusize); + if (memcmp(io_dldi_data->friendlyName, "R4iDSN", 6) == 0 && !isRegularDS) { + bootstrapini.SetInt( "NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", 1); + } else { + bootstrapini.SetInt( "NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", 0); + } // Read cheats std::string cheatpath = "/_nds/cheats.xml"; int c; diff --git a/romsel_aktheme/arm9/source/common/bootstrapconfig.cpp b/romsel_aktheme/arm9/source/common/bootstrapconfig.cpp index de6b7121a7..09fe45956f 100644 --- a/romsel_aktheme/arm9/source/common/bootstrapconfig.cpp +++ b/romsel_aktheme/arm9/source/common/bootstrapconfig.cpp @@ -1,3 +1,4 @@ +#include "systemdetails.h" #include "bootstrapconfig.h" #include "dsimenusettings.h" #include "filecopy.h" @@ -12,6 +13,7 @@ BootstrapConfig::BootstrapConfig(const std::string &fileName, const std::string _donorSdk = 0; _mpuSize = 0; _mpuRegion = 0; + _forceSleepPatch = (memcmp(io_dldi_data->friendlyName, "R4iDSN", 6) == 0 && !sys().isRegularDS()) ? true : false; _isHomebrew = _gametid.empty() || _sdkVersion == 0; _saveSize = 0x80000; _dsiMode = 0; @@ -387,7 +389,8 @@ int BootstrapConfig::launch() .option("NDS-BOOTSTRAP", "DONOR_SDK_VER", _donorSdk) .option("NDS-BOOTSTRAP", "GAME_SOFT_RESET", _softReset) .option("NDS-BOOTSTRAP", "PATCH_MPU_REGION", _mpuRegion) - .option("NDS-BOOTSTRAP", "PATCH_MPU_SIZE", _mpuSize); + .option("NDS-BOOTSTRAP", "PATCH_MPU_SIZE", _mpuSize) + .option("NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", _forceSleepPatch); if (_configSavedHandler) _configSavedHandler(); diff --git a/romsel_aktheme/arm9/source/common/bootstrapconfig.h b/romsel_aktheme/arm9/source/common/bootstrapconfig.h index b6eba3f925..6b8a7b9640 100644 --- a/romsel_aktheme/arm9/source/common/bootstrapconfig.h +++ b/romsel_aktheme/arm9/source/common/bootstrapconfig.h @@ -25,6 +25,7 @@ class BootstrapConfig BootstrapConfig& donorSdk(); BootstrapConfig& mpuSettings(); + BootstrapConfig& forceSleepPatch(); BootstrapConfig& saveSize(); BootstrapConfig& softReset(); @@ -63,6 +64,7 @@ class BootstrapConfig int _donorSdk; int _mpuSize; int _mpuRegion; + int _forceSleepPatch; bool _isHomebrew; int _saveSize; int _dsiMode; diff --git a/romsel_aktheme/arm9/source/common/systemdetails.h b/romsel_aktheme/arm9/source/common/systemdetails.h index fd5c662df6..f957f41365 100644 --- a/romsel_aktheme/arm9/source/common/systemdetails.h +++ b/romsel_aktheme/arm9/source/common/systemdetails.h @@ -6,6 +6,7 @@ #include #include "nitrofs.h" #include +#include class SystemDetails { diff --git a/romsel_dsimenutheme/arm9/source/main.cpp b/romsel_dsimenutheme/arm9/source/main.cpp index fcb0ec1bf0..7c5d35e2e4 100644 --- a/romsel_dsimenutheme/arm9/source/main.cpp +++ b/romsel_dsimenutheme/arm9/source/main.cpp @@ -1353,6 +1353,11 @@ int main(int argc, char **argv) { bootstrapini.SetInt( "NDS-BOOTSTRAP", "GAME_SOFT_RESET", gameSoftReset); bootstrapini.SetInt( "NDS-BOOTSTRAP", "PATCH_MPU_REGION", mpuregion); bootstrapini.SetInt( "NDS-BOOTSTRAP", "PATCH_MPU_SIZE", mpusize); + if (memcmp(io_dldi_data->friendlyName, "R4iDSN", 6) == 0 && !isRegularDS) { + bootstrapini.SetInt( "NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", 1); + } else { + bootstrapini.SetInt( "NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", 0); + } // Read cheats std::string cheatpath = "/_nds/cheats.xml"; int c; diff --git a/romsel_r4theme/arm9/source/main.cpp b/romsel_r4theme/arm9/source/main.cpp index fc010b29f2..1de0c9cc18 100644 --- a/romsel_r4theme/arm9/source/main.cpp +++ b/romsel_r4theme/arm9/source/main.cpp @@ -1565,6 +1565,11 @@ int main(int argc, char **argv) { bootstrapini.SetInt( "NDS-BOOTSTRAP", "GAME_SOFT_RESET", gameSoftReset); bootstrapini.SetInt( "NDS-BOOTSTRAP", "PATCH_MPU_REGION", mpuregion); bootstrapini.SetInt( "NDS-BOOTSTRAP", "PATCH_MPU_SIZE", mpusize); + if (memcmp(io_dldi_data->friendlyName, "R4iDSN", 6) == 0 && !isRegularDS) { + bootstrapini.SetInt( "NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", 1); + } else { + bootstrapini.SetInt( "NDS-BOOTSTRAP", "FORCE_SLEEP_PATCH", 0); + } // Read cheats std::string cheatpath = "/_nds/cheats.xml"; int c;