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/wiiumodulesystem:20220127 /artifacts $DEVKITPRO
COPY --from=wiiuenv/wiiupluginsystem:20220123 /artifacts $DEVKITPRO COPY --from=wiiuenv/wiiupluginsystem:20220123 /artifacts $DEVKITPRO

View File

@ -24,7 +24,7 @@
#include <wums/defines/relocation_defines.h> #include <wums/defines/relocation_defines.h>
#include <function_patcher/function_patching.h> #include <function_patcher/function_patching.h>
#include <wups.h> #include <wups/hooks.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { 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; module_information_t *gModuleData __attribute__((section(".data"))) = nullptr;
relocation_trampoline_entry_t *gTrampolineData __attribute__((section(".data"))) = nullptr; relocation_trampoline_entry_t *gTrampolineData __attribute__((section(".data"))) = nullptr;
uint32_t gPluginDataHeapSize = 0; uint32_t gPluginDataHeapSize __attribute__((section(".data"))) = 0;
uint32_t gPluginInformationHeapSize = 0; uint32_t gPluginInformationHeapSize __attribute__((section(".data"))) = 0;
uint32_t gTrampolineDataSize = 0; uint32_t gTrampolineDataSize __attribute__((section(".data"))) = 0;
StoredBuffer storedTVBuffer{}; StoredBuffer storedTVBuffer __attribute__((section(".data"))) = {};
StoredBuffer storedDRCBuffer{}; 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_CONFIG_CLOSED ||
hook_type == WUPS_LOADER_HOOK_RELEASE_FOREGROUND || hook_type == WUPS_LOADER_HOOK_RELEASE_FOREGROUND ||
hook_type == WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND) { hook_type == WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND) {
((void (*)())((uint32_t *) func_ptr))(); // clang-format off
((void(*)())((uint32_t *) func_ptr))();
// clang-format on
} else if (hook_type == WUPS_LOADER_HOOK_INIT_STORAGE) { } else if (hook_type == WUPS_LOADER_HOOK_INIT_STORAGE) {
wups_loader_init_storage_args_t args; wups_loader_init_storage_args_t args;
args.open_storage_ptr = &StorageUtils::OpenStorage; args.open_storage_ptr = &StorageUtils::OpenStorage;
args.close_storage_ptr = &StorageUtils::CloseStorage; args.close_storage_ptr = &StorageUtils::CloseStorage;
args.plugin_id = plugin_data->meta.storageId; args.plugin_id = plugin_data->meta.storageId;
((void (*)(wups_loader_init_storage_args_t))((uint32_t *) func_ptr))(args); // clang-format off
((void(*)(wups_loader_init_storage_args_t))((uint32_t *) func_ptr))(args);
// clang-format on
} else { } else {
DEBUG_FUNCTION_LINE("######################################"); DEBUG_FUNCTION_LINE("######################################");
DEBUG_FUNCTION_LINE("Hook is not implemented %s [%d]", hook_names[hook_type], hook_type); DEBUG_FUNCTION_LINE("Hook is not implemented %s [%d]", hook_names[hook_type], hook_type);

View File

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

View File

@ -3,7 +3,6 @@
#include <coreinit/messagequeue.h> #include <coreinit/messagequeue.h>
#include <padscore/wpad.h> #include <padscore/wpad.h>
#include <vpad/input.h> #include <vpad/input.h>
#include <wups.h>
#include "../globals.h" #include "../globals.h"
#include "../hooks.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) #define KiReport ((void(*)(const char *, ...)) 0xfff0ad0c)
// clang-format on
#pragma GCC push_options #pragma GCC push_options
#pragma GCC optimize("O0") #pragma GCC optimize("O0")

View File

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

View File

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

View File

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

View File

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

View File

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