mirror of
https://github.com/coderkei/akmenu-next.git
synced 2025-06-18 17:05:48 -04:00
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.
This commit is contained in:
parent
5020802b1a
commit
95ff08bdc6
@ -46,6 +46,11 @@ bool AcekardLauncher::launchRom(std::string romPath, std::string savePath, u32 f
|
|||||||
|
|
||||||
dbg_printf("load %s\n", romPath.c_str());
|
dbg_printf("load %s\n", romPath.c_str());
|
||||||
|
|
||||||
|
if (access("fat:/__rpg/akloader.nds", F_OK) != 0) {
|
||||||
|
printLoaderNotFound("fat:/__rpg/akloader.nds");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// akloaders are very old and expect the old-style libfat mount points
|
// akloaders are very old and expect the old-style libfat mount points
|
||||||
romPath.replace(0, 3, "fat0");
|
romPath.replace(0, 3, "fat0");
|
||||||
savePath.replace(0, 3, "fat0");
|
savePath.replace(0, 3, "fat0");
|
||||||
|
@ -7,6 +7,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <nds/ndstypes.h>
|
#include <nds/ndstypes.h>
|
||||||
|
#include "../language.h"
|
||||||
|
#include "../ui/msgbox.h"
|
||||||
|
|
||||||
|
static inline void printLoaderNotFound(std::string loaderPath) {
|
||||||
|
akui::messageBox(NULL, LANG("loader", "not found"), loaderPath, MB_OK);
|
||||||
|
}
|
||||||
|
|
||||||
class ILauncher {
|
class ILauncher {
|
||||||
public:
|
public:
|
||||||
|
@ -73,6 +73,12 @@ bool NdsBootstrapLauncher::prepareIni() {
|
|||||||
bool NdsBootstrapLauncher::launchRom(std::string romPath, std::string savePath, u32 flags,
|
bool NdsBootstrapLauncher::launchRom(std::string romPath, std::string savePath, u32 flags,
|
||||||
u32 cheatOffset, u32 cheatSize) {
|
u32 cheatOffset, u32 cheatSize) {
|
||||||
const char ndsBootstrapPath[] = SD_ROOT_0 "/_nds/nds-bootstrap-release.nds";
|
const char ndsBootstrapPath[] = SD_ROOT_0 "/_nds/nds-bootstrap-release.nds";
|
||||||
|
|
||||||
|
if (access(ndsBootstrapPath, F_OK) != 0) {
|
||||||
|
printLoaderNotFound(ndsBootstrapPath);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<const char*> argv;
|
std::vector<const char*> argv;
|
||||||
|
|
||||||
mRomPath = romPath;
|
mRomPath = romPath;
|
||||||
|
@ -16,6 +16,11 @@ bool PassMeLauncher::launchRom(std::string romPath, std::string savePath, u32 fl
|
|||||||
u32 cheatOffset, u32 cheatSize) {
|
u32 cheatOffset, u32 cheatSize) {
|
||||||
const char passMeLoaderPath[] = "fat:/__rpg/PassMeLoader.nds";
|
const char passMeLoaderPath[] = "fat:/__rpg/PassMeLoader.nds";
|
||||||
|
|
||||||
|
if (access(passMeLoaderPath, F_OK) != 0) {
|
||||||
|
printLoaderNotFound(passMeLoaderPath);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<const char*> argv;
|
std::vector<const char*> argv;
|
||||||
argv.push_back(passMeLoaderPath);
|
argv.push_back(passMeLoaderPath);
|
||||||
eRunNdsRetCode rc = runNdsFile(argv[0], argv.size(), &argv[0]);
|
eRunNdsRetCode rc = runNdsFile(argv[0], argv.size(), &argv[0]);
|
||||||
|
@ -275,5 +275,6 @@ favorites = Favorites
|
|||||||
|
|
||||||
[loader]
|
[loader]
|
||||||
text = Use ROM loader
|
text = Use ROM loader
|
||||||
|
not found = Loader not found
|
||||||
|
|
||||||
[end]
|
[end]
|
||||||
|
Loading…
Reference in New Issue
Block a user