Skip to content

Commit

Permalink
Support for WUPS 0.5, compile with latest wut version
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Apr 17, 2021
1 parent 51e1c4c commit 5247775
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM wiiuenv/devkitppc:20210101
FROM wiiuenv/devkitppc:20210414

COPY --from=wiiuenv/wiiumodulesystem:20210313 /artifacts $DEVKITPRO
COPY --from=wiiuenv/wiiupluginsystem:20210316 /artifacts $DEVKITPRO
COPY --from=wiiuenv/wiiumodulesystem:20210414 /artifacts $DEVKITPRO
COPY --from=wiiuenv/wiiupluginsystem:20210417 /artifacts $DEVKITPRO
COPY --from=wiiuenv/libfunctionpatcher:20210109 /artifacts $DEVKITPRO

WORKDIR project
2 changes: 2 additions & 0 deletions source/PluginManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ void PluginManagement::unloadPlugins(plugin_information_t *gPluginInformation, M
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_NEWLIB);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_STDCPP);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_DEVOPTAB);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_SOCKETS);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_DEINIT_PLUGIN);
// CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_SOCKETS); To keep network alive we skip this.
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_STDCPP);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_NEWLIB);
Expand Down
6 changes: 6 additions & 0 deletions source/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static const char **hook_names = (const char *[]) {
"WUPS_LOADER_HOOK_FINI_WUT_STDCPP",
"WUPS_LOADER_HOOK_INIT_WUT_DEVOPTAB",
"WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB",
"WUPS_LOADER_HOOK_INIT_WUT_SOCKETS",
"WUPS_LOADER_HOOK_FINI_WUT_SOCKETS",

"WUPS_LOADER_HOOK_INIT_PLUGIN",
"WUPS_LOADER_HOOK_DEINIT_PLUGIN",
Expand Down Expand Up @@ -88,6 +90,10 @@ void CallHookEx(plugin_information_t *pluginInformation, wups_loader_hook_type_t
((void (*)()) ((uint32_t *) func_ptr))();
} else if (hook_type == WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB) {
((void (*)()) ((uint32_t *) func_ptr))();
} else if (hook_type == WUPS_LOADER_HOOK_INIT_WUT_SOCKETS) {
((void (*)()) ((uint32_t *) func_ptr))();
} else if (hook_type == WUPS_LOADER_HOOK_FINI_WUT_SOCKETS) {
((void (*)()) ((uint32_t *) func_ptr))();
} else if (hook_type == WUPS_LOADER_HOOK_RELEASE_FOREGROUND) {
((void (*)()) ((uint32_t *) func_ptr))();
} else if (hook_type == WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND) {
Expand Down
2 changes: 2 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ WUMS_APPLICATION_REQUESTS_EXIT() {

WUMS_APPLICATION_ENDS() {
CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_ENDS);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_SOCKETS);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_STDCPP);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_NEWLIB);
Expand Down Expand Up @@ -192,6 +193,7 @@ WUMS_APPLICATION_STARTS() {
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_NEWLIB);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_STDCPP);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_DEVOPTAB);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_SOCKETS);

if (initNeeded) {
PluginManagement::callInitHooks(gPluginInformation);
Expand Down
2 changes: 1 addition & 1 deletion source/plugin/PluginMetaInformationFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ std::optional<PluginMetaInformation> PluginMetaInformationFactory::loadPlugin(co
} else if (key.compare("description") == 0) {
pluginInfo.setDescription(value);
} else if (key.compare("wups") == 0) {
if (value.compare("0.4") != 0) {
if (value.compare("0.5") != 0) {
DEBUG_FUNCTION_LINE("Warning: Ignoring plugin - Unsupported WUPS version: %s.", value.c_str());
return std::nullopt;
}
Expand Down

0 comments on commit 5247775

Please sign in to comment.