akmenu-next/arm9/source/launcher/PassMeLauncher.cpp
lifehackerhansol 95ff08bdc6
launcher: tell user when loader is missing
At the moment it will just do nothing and go back to menu; instead
print a hopefully helpful text that the file is missing.
2024-10-14 17:12:41 -07:00

31 lines
780 B
C++

/*
Copyright (C) 2024 lifehackerhansol
SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <nds/ndstypes.h>
#include <string>
#include <vector>
#include "ILauncher.h"
#include "PassMeLauncher.h"
#include "nds_loader_arm9.h"
bool PassMeLauncher::launchRom(std::string romPath, std::string savePath, u32 flags,
u32 cheatOffset, u32 cheatSize) {
const char passMeLoaderPath[] = "fat:/__rpg/PassMeLoader.nds";
if (access(passMeLoaderPath, F_OK) != 0) {
printLoaderNotFound(passMeLoaderPath);
return false;
}
std::vector<const char*> argv;
argv.push_back(passMeLoaderPath);
eRunNdsRetCode rc = runNdsFile(argv[0], argv.size(), &argv[0]);
if (rc == RUN_NDS_OK) return true;
return false;
}