From 49689be1ce9d48faafe21d17d65ab5921353e32e Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 6 Jul 2010 04:05:24 +0000 Subject: [PATCH] don't auto-patch DLDI unless game code is #### --- desmume/src/NDSSystem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index a2ecf79c9..e1e7356e3 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -464,9 +464,6 @@ int NDS_LoadROM(const char *filename, const char *logicalFilename) return -1; } - //try auto-patching DLDI. should be benign if there is no DLDI or if it fails - DLDI::tryPatch((void*)gameInfo.romdata, gameInfo.romsize); - //decrypt if necessary.. //but this is untested and suspected to fail on big endian, so lets not support this on big endian @@ -508,6 +505,10 @@ int NDS_LoadROM(const char *filename, const char *logicalFilename) INFO("ROM serial: %s\n", gameInfo.ROMserial); INFO("ROM internal name: %s\n\n", gameInfo.ROMname); + //for homebrew, try auto-patching DLDI. should be benign if there is no DLDI or if it fails + if(!memcmp(gameInfo.header.gameCode,"####",4)) + DLDI::tryPatch((void*)gameInfo.romdata, gameInfo.romsize); + return 1; } #else