mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2026-09-07 09:35:47 -05:00
- Remove plugins from the repository (Will be re-uploaded to different reposistories)
- Updated the codeblocks template
This commit is contained in:
@@ -12,9 +12,6 @@ endif
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
|
||||
endif
|
||||
ifeq ($(strip $(WUT_ROOT)),)
|
||||
$(error "Please set WUT_ROOT in your environment. export WUT_ROOT=<path to>wut)
|
||||
endif
|
||||
|
||||
export PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH)
|
||||
export PORTLIBS := $(DEVKITPRO)/portlibs/ppc
|
||||
@@ -56,8 +53,7 @@ include $(WUPSDIR)/plugin_makefile.mk
|
||||
# -Os: optimise size
|
||||
# -Wall: generate lots of warnings
|
||||
# -DGEKKO_U: define the symbol GEKKO (used in some headers)
|
||||
# -D__wiiu__: define the symbol __wii__ (used in some headers)
|
||||
# -mrvl: enable wii/gamecube compilation
|
||||
# -D__wiiu__: define the symbol __wiiu__ (used in some headers)
|
||||
# -mcpu=750: enable processor specific compilation
|
||||
# -meabi: enable eabi specific compilation
|
||||
# -mhard-float: enable hardware floating point instructions
|
||||
@@ -66,7 +62,7 @@ include $(WUPSDIR)/plugin_makefile.mk
|
||||
# -memb: enable embedded application specific compilation
|
||||
# -ffunction-sections: split up functions so linker can garbage collect
|
||||
# -fdata-sections: split up data so linker can garbage collect
|
||||
COMMON_CFLAGS += -Os -Wall -DGEKKO_U -D__wiiu__ -mrvl -mcpu=750 -meabi -mhard-float -fno-common -msdata=none -memb -ffunction-sections -fdata-sections
|
||||
COMMON_CFLAGS += -Os -Wall -DGEKKO_U -D__wiiu__ -D__WIIU__ -mrvl -mcpu=750 -meabi -mhard-float -fno-common -msdata=none -memb -ffunction-sections -fdata-sections
|
||||
|
||||
|
||||
# -x c: compile as c code
|
||||
@@ -81,6 +77,40 @@ ifeq ($(DO_LOGGING), 1)
|
||||
CFLAGS += -D__LOGGING__
|
||||
CXXFLAGS += -D__LOGGING__
|
||||
endif
|
||||
|
||||
ADD_NO_WHOLE_ARCHIVE := 0
|
||||
|
||||
ifeq ($(WUT_ENABLE_CPP), 1)
|
||||
WUT_ENABLE_NEWLIB := 1
|
||||
|
||||
LD_FLAGS_ELF += -whole-archive -lwutstdc++
|
||||
ADD_NO_WHOLE_ARCHIVE := 1
|
||||
NEEDS_WUT := 1
|
||||
endif
|
||||
|
||||
ifeq ($(WUT_ENABLE_NEWLIB), 1)
|
||||
LD_FLAGS_ELF += -whole-archive -lwutnewlib
|
||||
ADD_NO_WHOLE_ARCHIVE := 1
|
||||
NEEDS_WUT := 1
|
||||
endif
|
||||
|
||||
ifeq ($(WUT_DEFAULT_MALLOC), 1)
|
||||
LD_FLAGS_ELF += -whole-archive -lwutmalloc
|
||||
ADD_NO_WHOLE_ARCHIVE := 1
|
||||
NEEDS_WUT := 1
|
||||
endif
|
||||
|
||||
ifeq ($(ADD_NO_WHOLE_ARCHIVE), 1)
|
||||
LD_FLAGS_ELF += -no-whole-archive
|
||||
endif
|
||||
|
||||
ifeq ($(NEEDS_WUT), 1)
|
||||
ifeq ($(strip $(WUT_ROOT)),)
|
||||
$(error "Please set WUT_ROOT in your environment. export WUT_ROOT=<path to>wut)
|
||||
endif
|
||||
CFLAGS += -D__WUT__
|
||||
CXXFLAGS += -D__WUT__
|
||||
endif
|
||||
|
||||
ASFLAGS +=
|
||||
|
||||
@@ -106,7 +136,7 @@ ALL_LIBS := $(LIBS)
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
# include and lib
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBDIRS += $(WUT_ROOT)
|
||||
LIBDIRS +=
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# no real need to edit anything past this point unless you need to add additional
|
||||
|
||||
@@ -2,7 +2,24 @@
|
||||
DO_LOGGING := 1
|
||||
|
||||
# Non WUT plugins need to wrap the malloc functions.
|
||||
WRAP_MALLOC := 1
|
||||
WRAP_MALLOC := 0
|
||||
|
||||
# Sets the "-D__WUT__" compiling flag
|
||||
USE_WUT := 0
|
||||
|
||||
# Links against the wut implementation of newlib, this is useful for using any function
|
||||
# from the C standard library
|
||||
WUT_ENABLE_NEWLIB := 0
|
||||
|
||||
# Links against the wut implementation of stdcpp, this is useful for using any function
|
||||
# from the C++ standard library. This will enable WUT_ENABLE_NEWLIB if you have not already done so.
|
||||
WUT_ENABLE_CPP := 0
|
||||
|
||||
# By default newlib will allocate 90% of the default heap for use with sbrk & malloc,
|
||||
# if this is unacceptable to you then you should use this as it replaces the newlib
|
||||
# malloc functions which ones which redirect to the CafeOS default heap functions
|
||||
# such as MEMAllocFromDefaultHeap.
|
||||
WUT_DEFAULT_MALLOC := 0
|
||||
|
||||
# Target filename
|
||||
TARGET := $(notdir $(CURDIR)).mod
|
||||
@@ -39,7 +56,7 @@ LIBDIRS := $(WUPSDIR) $(PORTLIBS)
|
||||
#---------------------------------------------------------------------------------
|
||||
# any extra libraries we wish to link with the project
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBS := -lwups -lutils -ldynamiclibs
|
||||
LIBS := -lwups
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Will be added to the final lib paths
|
||||
@@ -52,4 +69,4 @@ EXTERNAL_LIBPATHS :=
|
||||
# Will be added to the final include paths
|
||||
# -IC:/library1/include
|
||||
#---------------------------------------------------------------------------------
|
||||
EXTERNAL_INCLUDE := -I$(PORTLIBS)/include/libutils
|
||||
EXTERNAL_INCLUDE :=
|
||||
|
||||
@@ -1,54 +1,65 @@
|
||||
#include <wups.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <dynamic_libs/os_functions.h>
|
||||
#include <dynamic_libs/socket_functions.h>
|
||||
#include <dynamic_libs/fs_functions.h>
|
||||
#include <utils/logger.h>
|
||||
|
||||
/**
|
||||
https://github.com/Maschell/WiiUPluginSystem/wiki/How-to-develope-a-new-plugin#meta-information
|
||||
**/
|
||||
|
||||
// Mandatory plugin information.
|
||||
WUPS_PLUGIN_NAME("Plugin template");
|
||||
WUPS_PLUGIN_DESCRIPTION("Description");
|
||||
WUPS_PLUGIN_VERSION("v1.0");
|
||||
WUPS_PLUGIN_AUTHOR("USERNAME");
|
||||
WUPS_PLUGIN_AUTHOR("(USER)NAME");
|
||||
WUPS_PLUGIN_LICENSE("BSD");
|
||||
|
||||
// FS Access
|
||||
/**
|
||||
Hooks:
|
||||
https://github.com/Maschell/WiiUPluginSystem/wiki/Using-hooks
|
||||
**/
|
||||
|
||||
// FS Access (replaces open/close/write/read etc. functions)
|
||||
WUPS_FS_ACCESS()
|
||||
// Overlay access
|
||||
WUPS_ALLOW_OVERLAY()
|
||||
//WUPS_ALLOW_OVERLAY()
|
||||
|
||||
// Gets called once the loader exists.
|
||||
// Gets called once when the loader exits.
|
||||
INITIALIZE_PLUGIN(){
|
||||
InitOSFunctionPointers();
|
||||
InitSocketFunctionPointers();
|
||||
|
||||
log_init();
|
||||
DEBUG_FUNCTION_LINE("INITIALIZE_PLUGIN\n");
|
||||
}
|
||||
|
||||
// Called whenever an application was started.
|
||||
ON_APPLICATION_START(){
|
||||
InitOSFunctionPointers();
|
||||
InitSocketFunctionPointers();
|
||||
}
|
||||
|
||||
log_init();
|
||||
// Called whenever functions where patched by the loader
|
||||
ON_FUNCTIONS_PATCHED(){
|
||||
}
|
||||
|
||||
DEBUG_FUNCTION_LINE("ON_APPLICATION_START\n");
|
||||
// Get called when ever GX2_VSYNC() was called (on each frame)
|
||||
ON_VYSNC(){
|
||||
}
|
||||
|
||||
// Gets called whenever the status of the running application changes.
|
||||
ON_APP_STATUS_CHANGED(status){
|
||||
}
|
||||
|
||||
// Called whenever an application is ending
|
||||
ON_APPLICATION_ENDING(){
|
||||
DEBUG_FUNCTION_LINE("ON_APPLICATION_ENDING\n");
|
||||
}
|
||||
|
||||
// Lets replace FSOpenFile
|
||||
DECL_FUNCTION(int, FSOpenFile, FSClient *pClient, FSCmdBlock *pCmd, const char *path, const char *mode, int *handle, int error) {
|
||||
int result = real_FSOpenFile(pClient, pCmd, path, mode, handle, error);
|
||||
// Gets called once when the loader is loaded again at the plugins will be unloaded
|
||||
DEINITIALIZE_PLUGIN(){
|
||||
}
|
||||
|
||||
log_printf("FSOpenFile called for folder %s! Result %d\n",path,result);
|
||||
return result;
|
||||
/**
|
||||
Function replacing.
|
||||
https://github.com/Maschell/WiiUPluginSystem/wiki/Function-replacing
|
||||
**/
|
||||
|
||||
// Lets replace OSIsHomeButtonMenuEnabled to allows the home button anywhere. (Not a great idea.)
|
||||
DECL_FUNCTION(bool, OSIsHomeButtonMenuEnabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Replace it.
|
||||
WUPS_MUST_REPLACE(FSOpenFile, WUPS_LOADER_LIBRARY_COREINIT, FSOpenFile);
|
||||
WUPS_MUST_REPLACE(OSIsHomeButtonMenuEnabled, WUPS_LOADER_LIBRARY_COREINIT, OSIsHomeButtonMenuEnabled);
|
||||
|
||||
Reference in New Issue
Block a user