mirror of
https://github.com/coderkei/akmenu-next.git
synced 2025-06-19 01:15:32 -04:00
TopToyLauncher: simplify ifdefs for loader path, error if not found
This commit is contained in:
parent
fcdca80478
commit
179c309b19
@ -158,12 +158,18 @@ bool TopToyLauncher::prepareTTSYS(void) {
|
|||||||
|
|
||||||
bool TopToyLauncher::launchRom(std::string romPath, std::string savePath, u32 flags,
|
bool TopToyLauncher::launchRom(std::string romPath, std::string savePath, u32 flags,
|
||||||
u32 cheatOffset, u32 cheatSize) {
|
u32 cheatOffset, u32 cheatSize) {
|
||||||
|
std::string loaderPath =
|
||||||
#ifdef __TTLAUNCHER_M3__
|
#ifdef __TTLAUNCHER_M3__
|
||||||
if (access("fat:/TTMenu/m3patch.dat", F_OK) != 0)
|
"fat:/TTMenu/m3patch.dat"
|
||||||
#else
|
#else // __TTLAUNCHER_M3__
|
||||||
if (access("fat:/TTMenu/ttpatch.dat", F_OK) != 0)
|
"fat:/TTMenu/ttpatch.dat"
|
||||||
#endif
|
#endif // __TTLAUNCHER_M3__
|
||||||
|
;
|
||||||
|
|
||||||
|
if (access(loaderPath.c_str(), F_OK) != 0) {
|
||||||
|
printLoaderNotFound(loaderPath);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
mRomPath = romPath;
|
mRomPath = romPath;
|
||||||
mSavePath = savePath;
|
mSavePath = savePath;
|
||||||
@ -192,11 +198,7 @@ bool TopToyLauncher::launchRom(std::string romPath, std::string savePath, u32 fl
|
|||||||
// Setup TTMenu system parameters
|
// Setup TTMenu system parameters
|
||||||
if (!prepareTTSYS()) return false;
|
if (!prepareTTSYS()) return false;
|
||||||
|
|
||||||
#ifdef __TTLAUNCHER_M3__
|
FILE* loader = fopen(loaderPath.c_str(), "rb");
|
||||||
FILE* loader = fopen("fat:/TTMenu/m3patch.dat", "rb");
|
|
||||||
#else
|
|
||||||
FILE* loader = fopen("fat:/TTMenu/ttpatch.dat", "rb");
|
|
||||||
#endif
|
|
||||||
tNDSHeader* header = (tNDSHeader*)malloc(sizeof(tNDSHeader));
|
tNDSHeader* header = (tNDSHeader*)malloc(sizeof(tNDSHeader));
|
||||||
u8* loader_arm7 = NULL;
|
u8* loader_arm7 = NULL;
|
||||||
fseek(loader, 0, SEEK_SET);
|
fseek(loader, 0, SEEK_SET);
|
||||||
|
Loading…
Reference in New Issue
Block a user