mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2026-12-05 08:45:09 -06:00
- Remove plugins from the repository (Will be re-uploaded to different reposistories)
- Updated the codeblocks template
This commit is contained in:
@@ -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