This commit is contained in:
Arisotura 2020-08-15 01:11:18 +02:00
parent f8d1d08e9c
commit e27d55505f
1 changed files with 10 additions and 3 deletions

View File

@ -224,9 +224,16 @@ void LoadCheats()
}
char filename[1024];
strncpy(filename, ROMPath[ROMSlot_NDS], 1023);
filename[1023] = '\0';
strncpy(filename + strlen(ROMPath[ROMSlot_NDS]) - 3, "mch", 3);
if (ROMPath[ROMSlot_NDS][0] != '\0')
{
strncpy(filename, ROMPath[ROMSlot_NDS], 1023);
filename[1023] = '\0';
strncpy(filename + strlen(ROMPath[ROMSlot_NDS]) - 3, "mch", 3);
}
else
{
strncpy(filename, "firmware.mch", 1023);
}
// TODO: check for error (malformed cheat file, ...)
CheatFile = new ARCodeFile(filename);