Only setup homebrew bootstub when launcherPath is set

This commit is contained in:
Gericom
2026-01-10 16:35:00 +01:00
parent a17194dc67
commit 0ba88b55b7
4 changed files with 31 additions and 32 deletions

View File

@@ -436,17 +436,21 @@ void NdsLoader::InsertArgv()
void NdsLoader::HandleHomebrewPatching()
{
sendToArm9(IPC_COMMAND_ARM9_APPLY_HOMEBREW_PATCHES);
sendToArm9(16 * 1024); // required dldi space
void* dldiSpace = (void*)receiveFromArm9();
char* launcherPath = (char*)receiveFromArm9();
if (dldiSpace != nullptr)
if (_launcherPath != nullptr && _launcherPath[0] != 0)
{
dldi_copyTo(dldiSpace);
}
if (launcherPath != nullptr)
{
strncpy(launcherPath, _launcherPath, 256);
sendToArm9(IPC_COMMAND_ARM9_SETUP_HOMEBREW_BOOTSTUB);
sendToArm9(16 * 1024); // required dldi space
void* dldiSpace = (void*)receiveFromArm9();
char* launcherPath = (char*)receiveFromArm9();
if (dldiSpace != nullptr)
{
dldi_copyTo(dldiSpace);
}
if (launcherPath != nullptr)
{
strncpy(launcherPath, _launcherPath, 256);
launcherPath[255] = 0;
}
}
}