From c9ece3040de92787fc84eb4e71e459acf2b3e377 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 16 Jan 2021 23:06:14 +0100 Subject: [PATCH] Directly use librpxloader --- Dockerfile | 1 + Makefile | 7 ++++--- README.md | 2 ++ src/utils/TcpReceiver.cpp | 18 +++--------------- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7abad45..d5332eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM wiiuenv/devkitppc:20210101 COPY --from=wiiuenv/libwupsbackend:202101101720554d1bfe /artifacts $DEVKITPRO +COPY --from=wiiuenv/librpxloader:20210116 /artifacts $DEVKITPRO COPY --from=wiiuenv/wiiupluginsystem:20210109 /artifacts $DEVKITPRO WORKDIR project \ No newline at end of file diff --git a/Makefile b/Makefile index 5084494..186a696 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/wups/share/wups_rules WUT_ROOT := $(DEVKITPRO)/wut +WUMS_ROOT := $(DEVKITPRO)/wums #------------------------------------------------------------------------------- # TARGET is the name of the output @@ -38,15 +39,15 @@ CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -D__WUPS__ CXXFLAGS := $(CFLAGS) -std=gnu++17 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -T$(WUPS_ROOT)/share/libwupsbackend.ld $(WUPSSPECS) +LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -T$(WUPS_ROOT)/share/libwupsbackend.ld -T$(WUMS_ROOT)/share/librpxloader.ld $(WUPSSPECS) -LIBS := -lwups -lwut -lwupsbackend -lz +LIBS := -lwups -lwut -lwupsbackend -lz -lrpxloader #------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level # containing include and lib #------------------------------------------------------------------------------- -LIBDIRS := $(PORTLIBS) $(WUPS_ROOT) $(WUT_ROOT) +LIBDIRS := $(PORTLIBS) $(WUPS_ROOT) $(WUT_ROOT) $(WUMS_ROOT) #------------------------------------------------------------------------------- # no real need to edit anything past this point unless you need to add additional diff --git a/README.md b/README.md index 3f7ae36..656b636 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +Requires the [RPXLoadingModule](https://github.com/wiiu-env/RPXLoadingModule) to be loaded. + ## Building using the Dockerfile It's possible to use a docker image for building. This way you don't need anything installed on your host system. diff --git a/src/utils/TcpReceiver.cpp b/src/utils/TcpReceiver.cpp index ec0f918..99cafaa 100644 --- a/src/utils/TcpReceiver.cpp +++ b/src/utils/TcpReceiver.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #define RPX_TEMP_PATH "fs:/vol/external01/wiiu/apps/" #define RPX_TEMP_FILE "fs:/vol/external01/wiiu/apps/temp.rpx" @@ -314,21 +315,8 @@ int32_t TcpReceiver::loadToMemory(int32_t clientSocket, uint32_t ipAddress) { } if (loadedRPX) { - DEBUG_FUNCTION_LINE("Starting a homebrew title"); - OSDynLoad_Module module; - - OSDynLoad_Error dyn_res = OSDynLoad_Acquire("homebrew_rpx_loader", &module); - if (dyn_res != OS_DYNLOAD_OK) { - OSFatal("Missing RPXLoader module"); - } - - bool (*loadRPXFromSDOnNextLaunch)(const std::string &path); - dyn_res = OSDynLoad_FindExport(module, false, "loadRPXFromSDOnNextLaunch", reinterpret_cast(&loadRPXFromSDOnNextLaunch)); - if (dyn_res != OS_DYNLOAD_OK) { - OSFatal("Failed to find export loadRPXFromSDOnNextLaunch"); - } - - loadRPXFromSDOnNextLaunch(file_path); + DEBUG_FUNCTION_LINE("Starting a homebrew title!"); + RL_LoadFromSDOnNextLaunch(file_path); uint64_t titleID = _SYSGetSystemApplicationTitleId(8); _SYSLaunchTitleWithStdArgsInNoSplash(titleID, 0);