Skip to content

Commit

Permalink
Force-enable sleep patch in nds-bootstrap, if R4iDSN card is used on …
Browse files Browse the repository at this point in the history
…DSi/3DS
  • Loading branch information
RocketRobz committed Jan 2, 2019
1 parent de2d525 commit 716047a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mainmenu/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion romsel_aktheme/arm9/source/common/bootstrapconfig.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "systemdetails.h"
#include "bootstrapconfig.h"
#include "dsimenusettings.h"
#include "filecopy.h"
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions romsel_aktheme/arm9/source/common/bootstrapconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class BootstrapConfig

BootstrapConfig& donorSdk();
BootstrapConfig& mpuSettings();
BootstrapConfig& forceSleepPatch();
BootstrapConfig& saveSize();
BootstrapConfig& softReset();

Expand Down Expand Up @@ -63,6 +64,7 @@ class BootstrapConfig
int _donorSdk;
int _mpuSize;
int _mpuRegion;
int _forceSleepPatch;
bool _isHomebrew;
int _saveSize;
int _dsiMode;
Expand Down
1 change: 1 addition & 0 deletions romsel_aktheme/arm9/source/common/systemdetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <stdio.h>
#include "nitrofs.h"
#include <nds.h>
#include <nds/arm9/dldi.h>

class SystemDetails
{
Expand Down
5 changes: 5 additions & 0 deletions romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions romsel_r4theme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 716047a

Please sign in to comment.