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