Support for WUPS 0.5, compile with latest wut version

This commit is contained in:
Maschell 2021-04-17 14:05:39 +02:00
parent 51e1c4c1f2
commit 5247775b03
5 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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);

View File

@ -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",
@ -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) {

View File

@ -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);
@ -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);

View File

@ -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;
}