Include cleanup, fix compiling with latest wut,

This commit is contained in:
Maschell 2022-02-11 22:18:15 +01:00
parent 2547c7edca
commit 6df6d871aa
11 changed files with 24 additions and 23 deletions

View File

@ -1,4 +1,4 @@
FROM wiiuenv/devkitppc:20211229
FROM wiiuenv/devkitppc:20220211
COPY --from=wiiuenv/wiiumodulesystem:20220127 /artifacts $DEVKITPRO
COPY --from=wiiuenv/wiiupluginsystem:20220123 /artifacts $DEVKITPRO

View File

@ -24,7 +24,7 @@
#include <wums/defines/relocation_defines.h>
#include <function_patcher/function_patching.h>
#include <wups.h>
#include <wups/hooks.h>
#ifdef __cplusplus
extern "C" {

View File

@ -7,9 +7,9 @@ plugin_information_on_reload_t gLinkOnReload __attribute__((section(".data")));
module_information_t *gModuleData __attribute__((section(".data"))) = nullptr;
relocation_trampoline_entry_t *gTrampolineData __attribute__((section(".data"))) = nullptr;
uint32_t gPluginDataHeapSize = 0;
uint32_t gPluginInformationHeapSize = 0;
uint32_t gTrampolineDataSize = 0;
uint32_t gPluginDataHeapSize __attribute__((section(".data"))) = 0;
uint32_t gPluginInformationHeapSize __attribute__((section(".data"))) = 0;
uint32_t gTrampolineDataSize __attribute__((section(".data"))) = 0;
StoredBuffer storedTVBuffer{};
StoredBuffer storedDRCBuffer{};
StoredBuffer storedTVBuffer __attribute__((section(".data"))) = {};
StoredBuffer storedDRCBuffer __attribute__((section(".data"))) = {};

View File

@ -88,13 +88,17 @@ void CallHookEx(plugin_information_t *pluginInformation, wups_loader_hook_type_t
hook_type == WUPS_LOADER_HOOK_CONFIG_CLOSED ||
hook_type == WUPS_LOADER_HOOK_RELEASE_FOREGROUND ||
hook_type == WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND) {
// clang-format off
((void(*)())((uint32_t *) func_ptr))();
// clang-format on
} else if (hook_type == WUPS_LOADER_HOOK_INIT_STORAGE) {
wups_loader_init_storage_args_t args;
args.open_storage_ptr = &StorageUtils::OpenStorage;
args.close_storage_ptr = &StorageUtils::CloseStorage;
args.plugin_id = plugin_data->meta.storageId;
// clang-format off
((void(*)(wups_loader_init_storage_args_t))((uint32_t *) func_ptr))(args);
// clang-format on
} else {
DEBUG_FUNCTION_LINE("######################################");
DEBUG_FUNCTION_LINE("Hook is not implemented %s [%d]", hook_names[hook_type], hook_type);

View File

@ -1,7 +1,7 @@
#pragma once
#include "common/plugin_defines.h"
#include <wups.h>
#include <wups/hooks.h>
void CallHook(plugin_information_t *pluginInformation, wups_loader_hook_type_t hook_type);

View File

@ -3,7 +3,6 @@
#include <coreinit/messagequeue.h>
#include <padscore/wpad.h>
#include <vpad/input.h>
#include <wups.h>
#include "../globals.h"
#include "../hooks.h"
@ -102,9 +101,9 @@ DECL_FUNCTION(void, WPADRead, WPADChan chan, WPADStatusProController *data) {
}
}
// clang-format off
#define KiReport ((void(*)(const char *, ...)) 0xfff0ad0c)
// clang-format on
#pragma GCC push_options
#pragma GCC optimize("O0")

View File

@ -18,7 +18,6 @@
#include <function_patcher/fpatching_defines.h>
#include <string>
#include <wups.h>
class FunctionData {

View File

@ -18,8 +18,7 @@
#pragma once
#include <string>
#include <wups.h>
#include <wups/hooks.h>
class HookData {
public:

View File

@ -18,14 +18,12 @@
#include "PluginInformationFactory.h"
#include "../utils/ElfUtils.h"
#include "../utils/utils.h"
#include "PluginData.h"
#include <coreinit/cache.h>
#include <coreinit/memexpheap.h>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <wups.h>
#include <wups/function_patching.h>
using namespace ELFIO;

View File

@ -167,7 +167,7 @@ void ConfigUtils::displayMenu() {
VPADStatus vpad_data{};
VPADReadError vpad_error;
KPADStatus kpad_data{};
int32_t kpad_error;
KPADError kpad_error;
while (true) {
buttonsTriggered = 0;
@ -565,7 +565,9 @@ void ConfigUtils::displayMenu() {
if (hook_data->func_pointer == nullptr) {
break;
}
// clang-format off
((void(*)())((uint32_t *) hook_data->func_pointer))();
// clang-format on
break;
}
}

View File

@ -1,6 +1,6 @@
#pragma once
#include <wups.h>
#include <wups/storage.h>
class StorageUtils {
public: