Add LaunchHomebrewWrapperEx

Add library call to pass arguments between different homebrew apps, which
is something that RetroArch needs to pass the content path to cores.
This commit is contained in:
Ash Logan 2022-12-19 23:25:26 +11:00 committed by Maschell
parent 4d0585cdb4
commit 219b311e40
2 changed files with 22 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include <coreinit/filesystem.h> #include <coreinit/filesystem.h>
#include <coreinit/filesystem_fsa.h> #include <coreinit/filesystem_fsa.h>
#include <stdint.h> #include <stdint.h>
#include <sysapp/args.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -215,6 +216,20 @@ MochaUtilsStatus Mocha_PrepareRPXLaunch(MochaRPXLoadInfo *loadInfo);
*/ */
MochaUtilsStatus Mocha_LaunchHomebrewWrapper(); MochaUtilsStatus Mocha_LaunchHomebrewWrapper();
/**
* Launches the wrapper app for launching .rpx, with custom SYS args. <br>
* To launch a RPX call `Mocha_PrepareRPXLaunch` before this function. <br>
* <br>
* see: `Mocha_LaunchRPX` to prepare and launch a RPX in one command.
*
* @param args sysapp args to pass to the homebrew app.
* @return MOCHA_RESULT_SUCCESS: App is launching<br>
* MOCHA_RESULT_LIB_UNINITIALIZED: Library was not initialized. Call Mocha_InitLibrary() before using this function.<br>
* MOCHA_RESULT_UNSUPPORTED_COMMAND: Command not supported by the currently loaded mocha version.<br>
* MOCHA_RESULT_NOT_FOUND: Not application that can be used as homebrew wrapper found.
*/
MochaUtilsStatus Mocha_LaunchHomebrewWrapperEx(SYSStandardArgsIn *args);
/** /**
* Launches a given RPX by launching a wrapper application and replacing the RPX on the fly. <br> * Launches a given RPX by launching a wrapper application and replacing the RPX on the fly. <br>
* See Mocha_PrepareRPXLaunch for more information. <br> * See Mocha_PrepareRPXLaunch for more information. <br>

View File

@ -420,7 +420,7 @@ MochaUtilsStatus Mocha_LaunchRPX(MochaRPXLoadInfo *loadInfo) {
return res; return res;
} }
MochaUtilsStatus Mocha_LaunchHomebrewWrapper() { MochaUtilsStatus Mocha_LaunchHomebrewWrapperEx(SYSStandardArgsIn *args) {
if (!mochaInitDone) { if (!mochaInitDone) {
return MOCHA_RESULT_LIB_UNINITIALIZED; return MOCHA_RESULT_LIB_UNINITIALIZED;
} }
@ -435,11 +435,15 @@ MochaUtilsStatus Mocha_LaunchHomebrewWrapper() {
return MOCHA_RESULT_NOT_FOUND; return MOCHA_RESULT_NOT_FOUND;
} }
_SYSLaunchTitleWithStdArgsInNoSplash(titleID, nullptr); _SYSLaunchTitleWithStdArgsInNoSplash(titleID, args);
return MOCHA_RESULT_SUCCESS; return MOCHA_RESULT_SUCCESS;
} }
MochaUtilsStatus Mocha_LaunchHomebrewWrapper() {
return Mocha_LaunchHomebrewWrapperEx(nullptr);
}
MochaUtilsStatus Mocha_ODMGetDiscKey(WUDDiscKey *discKey) { MochaUtilsStatus Mocha_ODMGetDiscKey(WUDDiscKey *discKey) {
if (!mochaInitDone) { if (!mochaInitDone) {
return MOCHA_RESULT_LIB_UNINITIALIZED; return MOCHA_RESULT_LIB_UNINITIALIZED;