Add back support for PassMe

This is handled by PassMeLoader; it must be present in `/__rpg/`.
This commit is contained in:
lifehackerhansol 2024-10-13 22:55:18 -07:00
parent 8a5ec3e0b8
commit 12737bfbe2
No known key found for this signature in database
GPG Key ID: 80FB184AFC0B3B0E
3 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,25 @@
/*
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";
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;
}

View File

@ -0,0 +1,17 @@
/*
Copyright (C) 2024 lifehackerhansol
SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <string>
#include "ILauncher.h"
class PassMeLauncher : public ILauncher {
public:
bool launchRom(std::string romPath, std::string savePath, u32 flags, u32 cheatOffset,
u32 cheatSize) override;
};

View File

@ -34,6 +34,7 @@
#include "launcher/HomebrewLauncher.h" #include "launcher/HomebrewLauncher.h"
#include "launcher/NdsBootstrapLauncher.h" #include "launcher/NdsBootstrapLauncher.h"
#include "launcher/PassMeLauncher.h"
using namespace akui; using namespace akui;
@ -669,7 +670,7 @@ void cMainWnd::onFolderChanged() {
} }
} }
if (mode == cGlobalSettings::ESlot2Nds) { if (mode == cGlobalSettings::ESlot2Nds) {
// loadRom("slot2:/", "", 0, 0, 0); PassMeLauncher().launchRom("slot2:/", "", 0, 0, 0);
} else { } else {
CGbaLoader::StartGBA(); CGbaLoader::StartGBA();
} }