Add support for quick starting into homebrew titles

This commit is contained in:
Maschell 2024-04-25 17:19:53 +02:00
parent f57668d839
commit 8d895cf359
4 changed files with 27 additions and 2 deletions

View File

@ -1,5 +1,6 @@
FROM ghcr.io/wiiu-env/devkitppc:20230621 FROM ghcr.io/wiiu-env/devkitppc:20230621
COPY --from=ghcr.io/wiiu-env/libmocha:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/librpxloader:20240425 /artifacts $DEVKITPRO
WORKDIR project WORKDIR project

View File

@ -10,6 +10,8 @@ TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/wut/share/wut_rules include $(DEVKITPRO)/wut/share/wut_rules
WUMS_ROOT := $(DEVKITPRO)/wums
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# TARGET is the name of the output # TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed # BUILD is the directory where object files & intermediate files will be placed
@ -36,7 +38,7 @@ CXXFLAGS := $(CFLAGS) -std=c++20 -fno-rtti
ASFLAGS := -g $(ARCH) ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) $(RPXSPECS) --entry=_start -Wl,-Map,$(notdir $*.map) LDFLAGS = -g $(ARCH) $(RPXSPECS) --entry=_start -Wl,-Map,$(notdir $*.map)
LIBS := -lpng -lmocha -lwut -lz LIBS := -lrpxloader -lpng -lmocha -lwut -lz
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CXXFLAGS += -DDEBUG -g CXXFLAGS += -DDEBUG -g
@ -52,7 +54,7 @@ endif
# list of directories containing libraries, this must be the top level # list of directories containing libraries, this must be the top level
# containing include and lib # containing include and lib
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(WUT_ROOT) $(WUT_ROOT)/usr LIBDIRS := $(PORTLIBS) $(WUMS_ROOT) $(WUT_ROOT) $(WUT_ROOT)/usr
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional # no real need to edit anything past this point unless you need to add additional

View File

@ -14,11 +14,15 @@
#include <nn/ccr/sys_caffeine.h> #include <nn/ccr/sys_caffeine.h>
#include <nn/sl.h> #include <nn/sl.h>
#include <proc_ui/procui.h> #include <proc_ui/procui.h>
#include <rpxloader/rpxloader.h>
#include <sysapp/launch.h> #include <sysapp/launch.h>
#include <sysapp/title.h> #include <sysapp/title.h>
extern "C" void __fini_wut(); extern "C" void __fini_wut();
#define UPPER_TITLE_ID_HOMEBREW 0x0005000F
#define TITLE_ID_HOMEBREW_MASK (((uint64_t) UPPER_TITLE_ID_HOMEBREW) << 32)
static void StartAppletAndExit() { static void StartAppletAndExit() {
DEBUG_FUNCTION_LINE("Wait for applet"); DEBUG_FUNCTION_LINE("Wait for applet");
ProcUIInit(OSSavesDone_ReadyToRelease); ProcUIInit(OSSavesDone_ReadyToRelease);
@ -125,6 +129,17 @@ bool getQuickBoot() {
return false; return false;
} }
if ((info.titleId & TITLE_ID_HOMEBREW_MASK) == TITLE_ID_HOMEBREW_MASK) {
std::string homebrewPath = info.parameter;
DEBUG_FUNCTION_LINE("Trying to launch homebrew title: \"%s\"", homebrewPath.c_str());
if (auto err = RPXLoader_LaunchHomebrew(homebrewPath.c_str()); err != RPX_LOADER_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_WARN("Failed to launch homebrew title: %s (%d)", RPXLoader_GetStatusStr(err), err);
return false;
}
return true;
}
if (info.titleId == 0x0005001010040000L || if (info.titleId == 0x0005001010040000L ||
info.titleId == 0x0005001010040100L || info.titleId == 0x0005001010040100L ||
info.titleId == 0x0005001010040200L) { info.titleId == 0x0005001010040200L) {

View File

@ -10,6 +10,7 @@
#include <gx2/state.h> #include <gx2/state.h>
#include <malloc.h> #include <malloc.h>
#include <mocha/mocha.h> #include <mocha/mocha.h>
#include <rpxloader/rpxloader.h>
#include <sndcore2/core.h> #include <sndcore2/core.h>
#include <string> #include <string>
#include <sys/stat.h> #include <sys/stat.h>
@ -50,6 +51,12 @@ int32_t main(int32_t argc, char **argv) {
OSFatal("AutobootModule: Mocha_InitLibrary failed"); OSFatal("AutobootModule: Mocha_InitLibrary failed");
} }
// Use librpxloader.
RPXLoaderStatus error3;
if ((error3 = RPXLoader_InitLibrary()) != RPX_LOADER_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE("AutobootModule: Failed to init RPXLoader. This can be ignored when not running Aroma. Error %s [%d]", RPXLoader_GetStatusStr(error3), error3);
}
InputUtils::InputData buttons = InputUtils::getControllerInput(); InputUtils::InputData buttons = InputUtils::getControllerInput();
FSAInit(); FSAInit();