mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-11-16 23:59:24 +01:00
46358ce67a
Now the plugins inherit the SD/USB access from the loader. Check (args != NULL && (args->device_mounted & WUPS_SD_MOUNTED) > 0) in your INITIALZE method if you have SD access, and (args != NULL && (args->device_mounted & WUPS_USB_MOUNTED) > 0) for usb access. You can simply use open, read etc. then with "sd:/" and "usb:". No (un)mounting required. NTFS support is NOT implemented yet. So: HID to VPAD plugin can now read configurations SDCafiine now has support for libfat (other games than SSBU + FAT32 USB)
43 lines
1.1 KiB
C
43 lines
1.1 KiB
C
#include <wups.h>
|
|
#include <string.h>
|
|
#include "dynamic_libs/os_functions.h"
|
|
#include "dynamic_libs/vpad_functions.h"
|
|
#include "dynamic_libs/socket_functions.h"
|
|
#include "utils/logger.h"
|
|
|
|
WUPS_MODULE_NAME("Padcon");
|
|
WUPS_MODULE_VERSION("v1.0");
|
|
WUPS_MODULE_AUTHOR("Maschell");
|
|
WUPS_MODULE_LICENSE("GPL");
|
|
|
|
|
|
INITIALIZE(args){
|
|
InitOSFunctionPointers();
|
|
InitSocketFunctionPointers();
|
|
InitVPadFunctionPointers();
|
|
|
|
log_init();
|
|
|
|
log_print("Init of padcon!\n");
|
|
}
|
|
|
|
// Both would be possible.
|
|
//WUPS_HOOK_INIT(init);
|
|
|
|
DECL_FUNCTION(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error) {
|
|
int result = real_VPADRead(chan, buffer, buffer_size, error);
|
|
if(buffer->btns_r&VPAD_BUTTON_STICK_R) {
|
|
int mode;
|
|
VPADGetLcdMode(0, (s32*)&mode); // Get current display mode
|
|
if(mode != 1) {
|
|
VPADSetLcdMode(0, 1); // Turn it off
|
|
}
|
|
else {
|
|
VPADSetLcdMode(0, 0xFF); // Turn it on
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
WUPS_MUST_REPLACE(VPADRead ,WUPS_LOADER_LIBRARY_VPAD, VPADRead);
|