diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index b6d5624..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-sudo: required
-
-services:
- - docker
-
-script:
-- docker run -it --rm -v ${PWD}:/project wiiulegacy/core:0.1 /bin/bash -c "(cd project && make clean && make)"
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 779a985..a14d6b8 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ TOPDIR ?= $(CURDIR)
include $(TOPDIR)/share/wups_rules
export WUT_MAJOR := 0
-export WUT_MINOR := 3
+export WUT_MINOR := 4
export WUT_PATCH := 0
VERSION := $(WUT_MAJOR).$(WUT_MINOR).$(WUT_PATCH)
@@ -16,7 +16,7 @@ VERSION := $(WUT_MAJOR).$(WUT_MINOR).$(WUT_PATCH)
#---------------------------------------------------------------------------------
TARGET := wups
#BUILD := build
-SOURCES := libraries/libwups/ libraries/libwups/config
+SOURCES := libraries/libwups/
DATA := data
INCLUDES := include
diff --git a/PLANS.MD b/PLANS.MD
deleted file mode 100644
index 2be319d..0000000
--- a/PLANS.MD
+++ /dev/null
@@ -1,129 +0,0 @@
-#Plans and ideas
-
-# Goal
-
-The goal is provide a mechanism to modifiy your Wii U experience in a modular way.
-Currently each features has it's own application (TCPGecko, SwapDRC, HIDtoVPAD, SDCafiine) and you can only start one applicationa the same time.
-This means, you can't mix any of these features. One way would be to create an own App for each feature combination (like geckiine) or create one app that has all features.
-Both approaches have the same disadvantage, it's nearly impossible (and time consuming) to support everthing requested/possible.
-
-The idea is now:
-- Each feature will be deployed as an individual module/plugin
-- These modules will be loaded with ONE generic loader
-- And can be mixed in any way
-- A GUI can (de)activate them without any new compiling
-- Everything can be handled easily on the console itself
-
-# Planned features
-
-## Short-term goals
-Possbile to create a plugin which:
-* can override existing system function
- * provide a hook function which will be called
- * on each start of an application
- * everytime a application will be closed
- * on each frame
-* can be combined with other plugins
-
-With an simple, generic loader which:
-* Loads the plugins from the SDCard
-* Combines them and use them ALL at the same time.
-
-General:
-* Port some currently available tools.
-
-## Mid-term goals
-General:
-- Port all common applications like TCPGecko etc.
-
-Loader:
-- Allow to patch the currently loaded RPX
- - This would lead game binaries
-
-More advanced plugin loader:
-- Create configuration system:
- - (de)activate certain plugin only in set applications.
- - (de)activate plugins completly without removing them from the SDCard.
-
-## Long-term goals
-Even more advanced plugin loader:
-- Downloading plugins directly on the console
-- Updatin existing plugins
-- Share configurations with other user
-- Allow the plugin to have an own configuration window.
-
-
-# Technical problems
-
-To achieve this, serveral "problems" need to be resolved (feature need to be implemented).
-This is just an short overview. Look at the issued for detailed information.
-
-### plugin
-- Create an stable interface the plugins will use.
- - with hooks for
- - application start
- - application end
- - each frame
- - functions
- - some way to configure them?
-- Prodivde the plugin as a .elf?
- - Keep the file ending?
- - Compress/zip it?
-- How to add meta information?
- - Compatibility with
- - Plugin loader
- - Wii U FW
- - Information about the plugin
- - Author(s)
- - Version
- - Description
-- Linking / building
- - How to link the files
- - Write a proper (base) makefile
- - Is position independent code possible?
- - Is it reliable?
- - If not, how does elf relocation work?
-
-## function patching
-- (elf relocation)
-- use the information from the plugin
- - parse it
- - HOW to store it?
-- save the patching order
-- add basic disable/enable mechanism
-
-## general
-- provided general hooking points
-- How to store the plugins
- - Where is enough, unused space
-- keep tracking of the plugins
-- simple gui?
-- provide functions?
- - like libfat, libiosu activated
- - kernel copy function
-- pass information into the plugins
- - Running on which FW
- - arguments?
- - ???
-
-# Similar projects
-
-## function-patcher-example
-Platform: Wii U
-Notes: TODO
-https://github.com/Maschell/function-patcher-example
-
-## COSSubstrate
-Platform: Wii U
-Notes: TODO
-https://github.com/QuarkTheAwesome/COSSubstrate
-
-## brainslug-wii
-Platform: Wii
-Notes: TODO
-https://github.com/Chadderz121/brainslug-wii
-
-## substitute
-Platform: IOS
-Notes: TODO
-https://github.com/comex/substitute
\ No newline at end of file
diff --git a/include/wups.h b/include/wups.h
index 87572ae..b4e8a34 100644
--- a/include/wups.h
+++ b/include/wups.h
@@ -27,8 +27,8 @@
#define WUPS_H_
#include "wups/common.h"
+#include "wups/meta.h"
#include "wups/function_patching.h"
#include "wups/hooks.h"
-#include "wups/utils.h"
#endif /* WUPS_WUPS_H_ */
\ No newline at end of file
diff --git a/include/wups/common.h b/include/wups/common.h
index 7bfc508..1614f49 100644
--- a/include/wups/common.h
+++ b/include/wups/common.h
@@ -45,14 +45,6 @@ extern "C" {
extern const char wups_meta_ ## id [] WUPS_SECTION("meta"); \
const char wups_meta_ ## id [] = #id "=" value
-#define WUPS_PLUGIN_NAME(x) WUPS_META(name, x); WUPS_META(wups, "0.2"); WUPS_META(buildtimestamp, __DATE__ " " __TIME__)
-#define WUPS_PLUGIN_AUTHOR(x) WUPS_META(author, x)
-#define WUPS_PLUGIN_VERSION(x) WUPS_META(version, x)
-#define WUPS_PLUGIN_LICENSE(x) WUPS_META(license, x)
-#define WUPS_PLUGIN_DESCRIPTION(x) WUPS_META(description, x)
-#define WUPS_PLUGIN_ID(x) WUPS_META(id, x)
-#define WUPS_PLUGIN_CONFIG_REVISION(x) WUPS_META(config_revision, #x)
-
#ifdef __cplusplus
}
#endif
diff --git a/include/wups/config.h b/include/wups/config.h
deleted file mode 100644
index 72eedb1..0000000
--- a/include/wups/config.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-
-#ifndef WUPS_CONFIG_HOOKS_DEF_H_
-#define WUPS_CONFIG_HOOKS_DEF_H_
-
-#include "hooks.h"
-#include "config/WUPSConfig.h"
-
-#define WUPS_GET_CONFIG() \
- WUPSConfig* get_config();\
- WUPS_HOOK_EX(WUPS_LOADER_HOOK_GET_CONFIG,get_config); \
- WUPSConfig* get_config()
-
-
-#endif /* WUPS_CONFIG_HOOKS_DEF_H_ */
diff --git a/include/wups/config/WUPSConfig.h b/include/wups/config/WUPSConfig.h
deleted file mode 100644
index 1c9538b..0000000
--- a/include/wups/config/WUPSConfig.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-
-#ifndef _WUPS_CONFIG_H_
-#define _WUPS_CONFIG_H_
-
-#include
-#include
-#include
-
-class WUPSConfig {
-public:
- WUPSConfig(std::string name) {
- this->name = name;
- }
-
- ~WUPSConfig() {
- for (auto & element : categories) {
- delete element;
- }
- }
-
- /**
- \return Returns the name of this WUPSConfig
- **/
- std::string getName(){
- return this->name;
- }
-
- /**
- \brief Creates a new WUPSCategory add its to this WUPSConfig.
- The category will be added to the end of the list.
- This class holds responsibility for deleting the created instance.
-
- \param categoryName: The name of the category that will be created.
-
- \return On success, the created and inserted category will be returned.
- **/
- WUPSConfigCategory * addCategory(std::string categoryName){
- WUPSConfigCategory * curCat = new WUPSConfigCategory(categoryName);
- categories.push_back(curCat);
- return curCat;
- }
-
- /**
- \brief Adds a given WUPSConfigCategory to this WUPSConfig.
- The category will be added to the end of the list.
- This class holds responsibility for deleting the created instance.
-
- \param category: The category that will be added to this config.
-
- \return On success, the inserted category will be returned.
- On error NULL will be returned. In this case the caller still has the responsibility
- for deleting the WUPSConfigCategory instance.
- **/
- WUPSConfigCategory * addCategory(WUPSConfigCategory * category){
- categories.push_back(category);
- return category;
- }
-
- /**
- \return Returns a vector with all categories.
- **/
- std::vector getCategories(){
- return this->categories;
- }
-
-private:
- std::string name;
- std::vector categories;
-};
-
-#endif
diff --git a/include/wups/config/WUPSConfigCategory.h b/include/wups/config/WUPSConfigCategory.h
deleted file mode 100644
index 9e84337..0000000
--- a/include/wups/config/WUPSConfigCategory.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-
-#ifndef _WUPS_CONFIG_CATEGORY_H_
-#define _WUPS_CONFIG_CATEGORY_H_
-
-#include
-#include
-#include
-
-class WUPSConfigCategory {
-public:
- WUPSConfigCategory(std::string name) {
- this->name = name;
- }
-
- ~WUPSConfigCategory() {
- for (auto & element : items) {
- delete element;
- }
- }
-
- /**
- \return Returns the name of this WUPSConfigCategory
- **/
- std::string getName(){
- return this->name;
- }
-
- /**
- \brief Adds a given WUPSConfigItem to this WUPSConfigCategory.
- The item will be added to the end of the list.
- This class holds responsibility for deleting the created instance.
-
- \param item: The item that will be added to this config.
-
- \return On success, the inserted item will be returned.
- On error NULL will be returned. In this case the caller still has the responsibility
- for deleting the WUPSConfigItem instance.
- **/
- WUPSConfigItem * addItem(WUPSConfigItem * item){
- items.push_back(item);
- return item;
- }
-
- /**
- \return Returns a vector with all items.
- **/
- std::vector getItems(){
- return this->items;
- }
-
-private:
- std::string name;
- std::vector items;
-};
-
-#endif
diff --git a/include/wups/config/WUPSConfigItem.h b/include/wups/config/WUPSConfigItem.h
deleted file mode 100644
index b71ae5a..0000000
--- a/include/wups/config/WUPSConfigItem.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-
-#ifndef _WUPS_CONFIG_ITEM_H_
-#define _WUPS_CONFIG_ITEM_H_
-
-#include
-#include
-#include "../utils.h"
-
-#define WUPS_CONFIG_BUTTON_NONE 0
-#define WUPS_CONFIG_BUTTON_LEFT (1<<0)
-#define WUPS_CONFIG_BUTTON_RIGHT (1<<1)
-#define WUPS_CONFIG_BUTTON_UP (1<<2)
-#define WUPS_CONFIG_BUTTON_DOWN (1<<3)
-#define WUPS_CONFIG_BUTTON_A (1<<4)
-#define WUPS_CONFIG_BUTTON_B (1<<5)
-#define WUPS_CONFIG_BUTTON_ZL (1<<6)
-#define WUPS_CONFIG_BUTTON_ZR (1<<7)
-#define WUPS_CONFIG_BUTTON_L (1<<8)
-#define WUPS_CONFIG_BUTTON_R (1<<9)
-typedef int32_t WUPSConfigButtons;
-
-class WUPSConfigItem {
-public:
- /**
- Sets the display name of this WUPSConfigItem
- This is the value which will be shown in the configuration menu.
- **/
- virtual void setDisplayName(std::string displayName) {
- this->displayName = displayName;
- }
-
- /**
- \return Returns the display name of this WUPSConfigItem
- **/
- virtual std::string getDisplayName() {
- return this->displayName;
- }
-
- /**
- Sets the config ID name of this WUPSConfigItem.
- This config ID is used to persist the configuration values and needs
- to be unique in the context of this WUPSConfig.
- Items in different categories are NOT allowed to have the config ID.
- **/
- virtual void setConfigID(std::string configID) {
- this->configID = configID;
- }
-
- /**
- \return Returns the configID of this WUPSConfigItem.
- **/
- virtual std::string getConfigID() {
- return this->configID;
- }
-
- /**
- Returns a string that displays the current value.
- This string is shown next to the display name when the cursor is NOT on this item
- **/
- virtual std::string getCurrentValueDisplay() = 0;
-
- /**
- Returns a string that displays the current value when selected.
- This string is shown next to the display name when the cursor IS on this item
- **/
- virtual std::string getCurrentValueSelectedDisplay() = 0;
-
- /**
- Is called when the cursor enters or leaves the item.
- When the cursor enters the item, "isSelected" will be true.
- When the cursor leaves the item, "isSelected" will be false.
- **/
- virtual void onSelected(bool isSelected) = 0;
-
- /**
- Is called when a button is pressed while the cursor on this item.
- See the WUPSConfigButtons enum for possible values.
- **/
- virtual void onButtonPressed(WUPSConfigButtons buttons) = 0;
-
- /**
- When the cursor is on this item, the configuration menu asks this item
- if it's allowed to leave it.
- If it returns true, the item can be leaved.
- It it returns false, leaves is not allowed.
- **/
- virtual bool isMovementAllowed() = 0;
-
- /**
- Returns a string that represents the value of this item.
- **/
- virtual std::string persistValue() = 0;
-
- /**
- Loads a value for a given string that contains the persisted value.
- \param persistedValue A valued that the result of the persistValue function
- **/
- virtual void loadValue(std::string persistedValue) = 0;
-
- /**
- Restores the default value
- **/
- virtual void restoreDefault() = 0;
-
- /**
- Call callback with with current value.
- This function will be called whenever this item should call it's (optional) given
- callback with the current value.
- Returns true if a valid callback could be called
- Returns false if no callback was called (e.g. callback was NULL)
- **/
- virtual bool callCallback() = 0;
-
- /**
- Will be called by the "config menu manager" if this configitem is currently displayed on the screen.
- If this config item decides to draw onto the screen, it can use "lastVisibleOnScreen()" function to
- get information about which screen(s) are available.
- Check the Overlay API for more information on drawing on the screen.
- **/
- virtual void visibleOnScreen(wups_overlay_options_type_t screen){
- this->displayScreen = screen;
- }
-
- WUPSConfigItem(std::string configID, std::string displayName){
- this->configID = configID;
- this->displayName = displayName;
- }
-
- virtual ~WUPSConfigItem(){
- }
-
-protected:
- /**
- If this config item decides to draw onto the screen, this function can be used
- get information about which screen(s) are available for OS drawing.
- Check the Overlay API for more information on drawing on the screen.
- **/
- wups_overlay_options_type_t lastVisibleOnScreen(){
- return displayScreen;
- }
-private:
- std::string displayName;
-
- std::string configID;
-
- wups_overlay_options_type_t displayScreen = WUPS_OVERLAY_NONE;
-};
-
-#endif
diff --git a/include/wups/config/WUPSConfigItemBoolean.h b/include/wups/config/WUPSConfigItemBoolean.h
deleted file mode 100644
index dd36df1..0000000
--- a/include/wups/config/WUPSConfigItemBoolean.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-
-#ifndef _WUPS_CONFIG_ITEM_BOOLEAN_H_
-#define _WUPS_CONFIG_ITEM_BOOLEAN_H_
-
-#include
-#include
-#include
-
-class WUPSConfigItemBoolean;
-
-typedef void (*BooleanValueChangedCallback)(WUPSConfigItemBoolean *, bool);
-
-class WUPSConfigItemBoolean : public WUPSConfigItem {
-public:
- WUPSConfigItemBoolean(std::string configID, std::string displayName, bool defaultValue, BooleanValueChangedCallback callback);
-
- virtual ~WUPSConfigItemBoolean();
-
- /**
- Sets the name with will be displayed as "true" value
- \param name of the "true" value
- **/
- void setTrueValueName(std::string trueValName);
-
- /**
- Sets the name with will be displayed as "false" value
- \param name of the "false" value
- **/
- void setFalseValueName(std::string falseValName);
-
- /**
- Toggles the value. When it was true, it now false, when it was false, it's now true.
- Call the callback with the new value.
- **/
- virtual void toggleValue();
-
- virtual std::string getCurrentValueDisplay();
-
- virtual std::string getCurrentValueSelectedDisplay();
-
- virtual void onSelected(bool isSelected);
-
- virtual void onButtonPressed(WUPSConfigButtons buttons);
-
- virtual bool isMovementAllowed();
-
- virtual std::string persistValue();
-
- virtual void loadValue(std::string persistedValue);
-
- virtual void restoreDefault();
-
- virtual bool callCallback();
-
-private:
- BooleanValueChangedCallback callback = NULL;
- bool value;
- bool defaultValue;
- std::string trueValName = "on";
- std::string falseValName = "off";
-};
-
-#endif
diff --git a/include/wups/config/WUPSConfigItemIntegerRange.h b/include/wups/config/WUPSConfigItemIntegerRange.h
deleted file mode 100644
index 08b9b6b..0000000
--- a/include/wups/config/WUPSConfigItemIntegerRange.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018-2019 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-
-#ifndef _WUPS_CONFIG_ITEM_INTEGER_RANGE_H_
-#define _WUPS_CONFIG_ITEM_INTEGER_RANGE_H_
-
-#include
-#include
-#include
-
-class WUPSConfigItemIntegerRange;
-
-typedef void (*IntegerRangeValueChangedCallback)(WUPSConfigItemIntegerRange *, int32_t);
-
-class WUPSConfigItemIntegerRange : public WUPSConfigItem {
-public:
- WUPSConfigItemIntegerRange(std::string configID, std::string displayName, int32_t defaultValue, int32_t minValue, int32_t maxValue, IntegerRangeValueChangedCallback callback);
-
- virtual ~WUPSConfigItemIntegerRange();
-
- virtual std::string getCurrentValueDisplay();
-
- virtual std::string getCurrentValueSelectedDisplay();
-
- virtual void onSelected(bool isSelected);
-
- virtual void onButtonPressed(WUPSConfigButtons buttons);
-
- virtual bool isMovementAllowed();
-
- virtual std::string persistValue();
-
- virtual void loadValue(std::string persistedValue);
-
- virtual void restoreDefault();
-
- virtual bool callCallback();
-
-private:
- IntegerRangeValueChangedCallback callback = NULL;
- int32_t value;
- int32_t defaultValue;
- int32_t minValue;
- int32_t maxValue;
-};
-
-#endif
diff --git a/include/wups/config/WUPSConfigItemMultipleValues.h b/include/wups/config/WUPSConfigItemMultipleValues.h
deleted file mode 100644
index 46fc339..0000000
--- a/include/wups/config/WUPSConfigItemMultipleValues.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2018 Maschell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- ****************************************************************************/
-#ifndef _WUPS_CONFIG_ITEM_MULTIPLE_VALUES_H_
-#define _WUPS_CONFIG_ITEM_MULTIPLE_VALUES_H_
-
-#include
-#include
-#include