Implement support for WUMS 0.3.3

This commit is contained in:
Maschell 2025-01-30 18:34:52 +01:00
parent 75e6a6af10
commit 9840f06aac
5 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,5 @@
FROM ghcr.io/wiiu-env/devkitppc:20240704
FROM ghcr.io/wiiu-env/devkitppc:20241128
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:0.3.3-dev-20250130-474ef70 /artifacts $DEVKITPRO
WORKDIR project

View File

@ -220,6 +220,7 @@ void doStart(int argc, char **argv) {
DEBUG_FUNCTION_LINE_VERBOSE("Call Relocations done hook");
CallHook(gLoadedModules, WUMS_HOOK_RELOCATIONS_DONE);
CallHook(gLoadedModules, WUMS_HOOK_RELOCATIONS_DONE);
for (auto &curModule : gLoadedModules) {
if (!curModule->isInitBeforeRelocationDoneHook()) {
@ -237,6 +238,7 @@ void doStart(int argc, char **argv) {
CallHook(gLoadedModules, WUMS_HOOK_INIT_WUT_DEVOPTAB);
CallHook(gLoadedModules, WUMS_HOOK_INIT_WUT_SOCKETS);
CallHook(gLoadedModules, WUMS_HOOK_APPLICATION_STARTS);
CallHook(gLoadedModules, WUMS_HOOK_ALL_APPLICATION_STARTS_DONE);
deinitLogging();
fini_wut();

View File

@ -95,7 +95,7 @@ std::optional<std::shared_ptr<ModuleData>> ModuleDataFactory::load(const std::st
}
} else if (key == "wums" || key == "wum") {
checkedVersion = true;
if (value != "0.3.1" && value != "0.3.2") {
if (value != "0.3.1" && value != "0.3.2" && value != "0.3.3") {
DEBUG_FUNCTION_LINE_WARN("Ignoring module - Unsupported WUMS version: %s.", value.c_str());
return std::nullopt;
}

View File

@ -27,7 +27,11 @@ static const char **hook_names = (const char *[]){
"WUMS_HOOK_APPLICATION_ENDS",
"WUMS_HOOK_RELOCATIONS_DONE",
"WUMS_HOOK_APPLICATION_REQUESTS_EXIT",
"WUMS_HOOK_DEINIT"};
"WUMS_HOOK_DEINIT",
"WUMS_HOOK_ALL_APPLICATION_STARTS_DONE",
"WUMS_HOOK_ALL_APPLICATION_ENDS_DONE",
"WUMS_HOOK_ALL_APPLICATION_REQUESTS_EXIT_DONE",
};
#endif
void CallHook(const std::vector<std::shared_ptr<ModuleData>> &modules, wums_hook_type_t type, bool condition) {
@ -75,7 +79,10 @@ void CallHook(const std::shared_ptr<ModuleData> &module, wums_hook_type_t type)
type == WUMS_HOOK_FINI_WUT_SOCKETS ||
type == WUMS_HOOK_INIT_WRAPPER ||
type == WUMS_HOOK_FINI_WRAPPER ||
type == WUMS_HOOK_DEINIT)) {
type == WUMS_HOOK_DEINIT ||
type == WUMS_HOOK_ALL_APPLICATION_STARTS_DONE ||
type == WUMS_HOOK_ALL_APPLICATION_ENDS_DONE ||
type == WUMS_HOOK_ALL_APPLICATION_REQUESTS_EXIT_DONE)) {
DEBUG_FUNCTION_LINE("Calling hook of type %s [%d] %d for %s: %08X", hook_names[type], type, curHook->getType(), module->getExportName().c_str(), curHook->getTarget());
((void (*)())((uint32_t *) func_ptr))();
break;

View File

@ -3,7 +3,7 @@
#include "module/ModuleData.h"
#include <memory>
#include <vector>
#include <wums.h>
#include <wums/hooks.h>
void CallHook(const std::vector<std::shared_ptr<ModuleData>> &modules, wums_hook_type_t type, bool condition);