diff --git a/source/gc/gc.c b/source/gc/gc.c index decc9949..4352b501 100644 --- a/source/gc/gc.c +++ b/source/gc/gc.c @@ -117,7 +117,7 @@ void GC_SetLanguage(u8 lang) while(!__SYS_SyncSram()); } -bool GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir) +int GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir) { char folder[50]; char source[300]; @@ -129,7 +129,7 @@ bool GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgame { gprintf("Found on %s: %s\n", partition, source); fclose(f); - return true; + return 1; } else { @@ -139,10 +139,10 @@ bool GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgame { gprintf("Found on %s: %s\n", partition, source); fclose(f); - return true; + return 2; } } - return false; + return 0; } void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc) //, u8 DMLvideoMode) @@ -162,7 +162,10 @@ void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, boo if(GamePath != NULL) { - snprintf(DMLCfg->GamePath, sizeof(DMLCfg->GamePath), "/games/%s/game.iso", GamePath); + if(GC_GameIsInstalled(GamePath, "sd", "%s:/games") == 2) + snprintf(DMLCfg->GamePath, sizeof(DMLCfg->GamePath), "/games/%s/", GamePath); + else + snprintf(DMLCfg->GamePath, sizeof(DMLCfg->GamePath), "/games/%s/game.iso", GamePath); DMLCfg->Config |= DML_CFG_GAME_PATH; } @@ -204,6 +207,10 @@ void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, boo //Write options into memory memcpy((void *)0xC0001700, DMLCfg, sizeof(DML_CFG)); + + //DML v1.2+ + memcpy((void *)0xC1200000, DMLCfg, sizeof(DML_CFG)); + MEM2_free(DMLCfg); } diff --git a/source/gc/gc.h b/source/gc/gc.h index 426e0645..9f0ab67a 100644 --- a/source/gc/gc.h +++ b/source/gc/gc.h @@ -28,6 +28,8 @@ enum dmlconfig DML_CFG_ACTIVITY_LED= (1<<7), DML_CFG_PADHOOK = (1<<8), DML_CFG_NODISC = (1<<9), + DML_CFG_BOOT_DISC = (1<<10), + DML_CFG_BOOT_DOL = (1<<11), }; enum dmlvideomode @@ -40,11 +42,12 @@ enum dmlvideomode DML_VID_FORCE_PAL60 = (1<<1), DML_VID_FORCE_NTSC = (1<<2), DML_VID_FORCE_PROG = (1<<3), + DML_VID_PROG_PATCH = (1<<4), }; void GC_SetVideoMode(u8 videomode); void GC_SetLanguage(u8 lang); -bool GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir); +int GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir); void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc); //, u8 DMLvideoMode); void DML_Old_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats); #endif //GC_H_