[Wii U] Adding missing includes and defines

This commit is contained in:
Maschell 2017-05-08 12:18:28 +02:00
parent 4f4d288253
commit da0f3620bc
9 changed files with 225 additions and 22 deletions

View File

@ -164,6 +164,7 @@ void FSInit();
void FSShutdown();
FSStatus FSAddClient(FSClient *client, uint32_t flags);
FSStatus FSAddClientEx(FSClient *pClient, s32 unk_zero_param, uint32_t errHandling);
FSStatus FSDelClient(FSClient *client, uint32_t flags);
uint32_t FSGetClientNum();
void FSInitCmdBlock(FSCmdBlock *block);

View File

@ -22,7 +22,7 @@ typedef struct _KPADData
u8 device_type;
u8 wpad_error;
u8 pos_valid;
u8 unused_4[1];
u8 format;
union
{
@ -45,6 +45,19 @@ typedef struct _KPADData
f32 rtrigger;
} classic;
struct
{
u32 hold;
u32 trigger;
u32 release;
f32 lstick_x;
f32 lstick_y;
f32 rstick_x;
f32 rstick_y;
s32 charging;
s32 wired;
} pro;
u32 unused_6[20];
};
u32 unused_7[16];
@ -53,6 +66,7 @@ typedef struct _KPADData
void KPADInit (void);
s32 KPADRead(s32 chan, void * data, u32 size);
s32 KPADReadEx(s32 chan, KPADData * data, u32 size, s32 *error);
#ifdef __cplusplus
}

View File

@ -8,6 +8,7 @@
#include <wiiu/os/coroutine.h>
#include <wiiu/os/debug.h>
#include <wiiu/os/dynload.h>
#include <wiiu/os/energy.h>
#include <wiiu/os/event.h>
#include <wiiu/os/exception.h>
#include <wiiu/os/fastcondition.h>

View File

@ -0,0 +1,18 @@
#pragma once
#include <wiiu/types.h>
#ifdef __cplusplus
extern "C" {
#endif
s32 IMEnableDim(void);
s32 IMDisableDim(void);
s32 IMIsDimEnabled(s32 * result);
s32 IMEnableAPD(void);
s32 IMDisableAPD(void);
s32 IMIsAPDEnabled(s32 * result);
s32 IMIsAPDEnabledBySysSettings(s32 * result);
#ifdef __cplusplus
}
#endif

View File

@ -15,6 +15,7 @@ typedef struct
}OSSystemInfo;
OSSystemInfo *OSGetSystemInfo();
s32 * __gh_errno_ptr(void);
#ifdef __cplusplus
}

View File

@ -0,0 +1,61 @@
#pragma once
#include <wiiu/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
u32 handle;
u32 physical_device_inst;
u16 vid;
u16 pid;
u8 interface_index;
u8 sub_class;
u8 protocol;
u16 max_packet_size_rx;
u16 max_packet_size_tx;
} HIDDevice;
#define HID_DEVICE_DETACH 0
#define HID_DEVICE_ATTACH 1
typedef struct _HIDClient HIDClient;
typedef s32 (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,u32 attach);
struct _HIDClient
{
HIDClient *next;
HIDAttachCallback attach_cb;
};
typedef void HIDCallback(u32 handle,s32 error,u8 *p_buffer,u32 bytes_transferred,void *p_user);
s32 HIDSetup(void);
s32 HIDTeardown(void);
s32 HIDAddClient(HIDClient *p_client, HIDAttachCallback attach_callback);
s32 HIDDelClient(HIDClient *p_client);
s32 HIDGetDescriptor(u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
s32 HIDSetDescriptor(u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
s32 HIDGetReport(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
s32 HIDSetReport(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
s32 HIDSetIdle(u32 handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user);
s32 HIDSetProtocol(u32 handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user);
s32 HIDGetProtocol(u32 handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user);
s32 HIDRead(u32 handle, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
s32 HIDWrite(u32 handle, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
#ifdef __cplusplus
}
#endif

View File

@ -7,27 +7,41 @@ extern "C" {
typedef enum VPADButtons
{
VPAD_BUTTON_SYNC = 0x00000001,
VPAD_BUTTON_HOME = 0x00000002,
VPAD_BUTTON_MINUS = 0x00000004,
VPAD_BUTTON_PLUS = 0x00000008,
VPAD_BUTTON_R = 0x00000010,
VPAD_BUTTON_L = 0x00000020,
VPAD_BUTTON_ZR = 0x00000040,
VPAD_BUTTON_ZL = 0x00000080,
VPAD_BUTTON_DOWN = 0x00000100,
VPAD_BUTTON_UP = 0x00000200,
VPAD_BUTTON_RIGHT = 0x00000400,
VPAD_BUTTON_LEFT = 0x00000800,
VPAD_BUTTON_Y = 0x00001000,
VPAD_BUTTON_X = 0x00002000,
VPAD_BUTTON_B = 0x00004000,
VPAD_BUTTON_A = 0x00008000,
VPAD_BUTTON_TV = 0x00010000,
VPAD_BUTTON_STICK_R = 0x00020000,
VPAD_BUTTON_STICK_L = 0x00040000,
VPAD_BUTTON_SYNC = 0x00000001,
VPAD_BUTTON_HOME = 0x00000002,
VPAD_BUTTON_MINUS = 0x00000004,
VPAD_BUTTON_PLUS = 0x00000008,
VPAD_BUTTON_R = 0x00000010,
VPAD_BUTTON_L = 0x00000020,
VPAD_BUTTON_ZR = 0x00000040,
VPAD_BUTTON_ZL = 0x00000080,
VPAD_BUTTON_DOWN = 0x00000100,
VPAD_BUTTON_UP = 0x00000200,
VPAD_BUTTON_RIGHT = 0x00000400,
VPAD_BUTTON_LEFT = 0x00000800,
VPAD_BUTTON_Y = 0x00001000,
VPAD_BUTTON_X = 0x00002000,
VPAD_BUTTON_B = 0x00004000,
VPAD_BUTTON_A = 0x00008000,
VPAD_BUTTON_TV = 0x00010000,
VPAD_BUTTON_STICK_R = 0x00020000,
VPAD_BUTTON_STICK_L = 0x00040000,
VPAD_STICK_R_EMULATION_LEFT = 0x04000000,
VPAD_STICK_R_EMULATION_RIGHT = 0x02000000,
VPAD_STICK_R_EMULATION_UP = 0x01000000,
VPAD_STICK_R_EMULATION_DOWN = 0x00800000,
VPAD_STICK_L_EMULATION_LEFT = 0x40000000,
VPAD_STICK_L_EMULATION_RIGHT = 0x20000000,
VPAD_STICK_L_EMULATION_UP = 0x10000000,
VPAD_STICK_L_EMULATION_DOWN = 0x08000000,
} VPADButtons;
#define VPAD_BUTTON_TOUCH 0x00080000
#define VPAD_MASK_EMULATED_STICKS 0x7F800000
#define VPAD_MASK_BUTTONS ~VPAD_MASK_EMULATED_STICKS
typedef enum VPADTouchPadValidity
{
//! Both X and Y touchpad positions are accurate

View File

@ -6,6 +6,16 @@ extern "C" {
#include <wiiu/types.h>
#define WPAD_EXT_CORE 0
#define WPAD_EXT_NUNCHUK 1
#define WPAD_EXT_CLASSIC 2
#define WPAD_EXT_MPLUS 5
#define WPAD_EXT_MPLUS_NUNCHUK 6
#define WPAD_EXT_MPLUS_CLASSIC 7
#define WPAD_EXT_PRO_CONTROLLER 31
#define WPAD_FMT_PRO_CONTROLLER 22
#define WPAD_BUTTON_LEFT 0x0001
#define WPAD_BUTTON_RIGHT 0x0002
#define WPAD_BUTTON_DOWN 0x0004
@ -36,9 +46,51 @@ extern "C" {
#define WPAD_CLASSIC_BUTTON_DOWN 0x4000
#define WPAD_CLASSIC_BUTTON_RIGHT 0x8000
#define WPAD_PRO_BUTTON_STICK_R 0x10000
#define WPAD_PRO_BUTTON_STICK_L 0x20000
#define WPAD_PRO_BUTTON_UP 0x00000001
#define WPAD_PRO_BUTTON_LEFT 0x00000002
#define WPAD_PRO_TRIGGER_ZR 0x00000004
#define WPAD_PRO_BUTTON_X 0x00000008
#define WPAD_PRO_BUTTON_A 0x00000010
#define WPAD_PRO_BUTTON_Y 0x00000020
#define WPAD_PRO_BUTTON_B 0x00000040
#define WPAD_PRO_TRIGGER_ZL 0x00000080
#define WPAD_PRO_RESERVED 0x00000100
#define WPAD_PRO_TRIGGER_R 0x00000200
#define WPAD_PRO_BUTTON_PLUS 0x00000400
#define WPAD_PRO_BUTTON_HOME 0x00000800
#define WPAD_PRO_BUTTON_MINUS 0x00001000
#define WPAD_PRO_TRIGGER_L 0x00002000
#define WPAD_PRO_BUTTON_DOWN 0x00004000
#define WPAD_PRO_BUTTON_RIGHT 0x00008000
#define WPAD_PRO_BUTTON_STICK_R 0x00010000
#define WPAD_PRO_BUTTON_STICK_L 0x00020000
#define WPAD_PRO_STICK_L_EMULATION_UP 0x00200000
#define WPAD_PRO_STICK_L_EMULATION_DOWN 0x00100000
#define WPAD_PRO_STICK_L_EMULATION_LEFT 0x00040000
#define WPAD_PRO_STICK_L_EMULATION_RIGHT 0x00080000
#define WPAD_PRO_STICK_R_EMULATION_UP 0x02000000
#define WPAD_PRO_STICK_R_EMULATION_DOWN 0x01000000
#define WPAD_PRO_STICK_R_EMULATION_LEFT 0x00400000
#define WPAD_PRO_STICK_R_EMULATION_RIGHT 0x00800000
typedef struct WPADReadData_ {
u8 unknown[40];
u8 dev;
u8 err;
u8 unknown1[2];
u32 buttons;
s16 l_stick_x;
s16 l_stick_y;
s16 r_stick_x;
s16 r_stick_y;
u8 unknown2[8];
u8 fmt;
}WPADReadData;
typedef void (* wpad_sampling_callback_t)(s32 chan);
typedef void (* wpad_extension_callback_t)(s32 chan, s32 status);
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
s32 WPADProbe (s32 chan, u32 * pad_type);

View File

@ -17,8 +17,13 @@ IMPORT(OSInitSpinLock);
IMPORT(OSUninterruptibleSpinLock_Acquire);
IMPORT(OSUninterruptibleSpinLock_Release);
IMPORT(OSSleepTicks);
IMPORT(OSGetTitleID);
IMPORT(OSIsThreadTerminated);
IMPORT(OSSetThreadPriority);
IMPORT(OSCreateThread);
IMPORT(OSResumeThread);
IMPORT(OSIsThreadSuspended);
IMPORT(OSSuspendThread);
IMPORT(OSJoinThread);
IMPORT(OSYieldThread);
IMPORT(OSGetSystemTime);
@ -31,10 +36,13 @@ IMPORT(_Exit);
IMPORT(__os_snprintf);
IMPORT(DisassemblePPCRange);
IMPORT(DCInvalidateRange);
IMPORT(DCFlushRange);
IMPORT(DCStoreRange);
IMPORT(DCStoreRangeNoSync);
IMPORT(__gh_errno_ptr);
IMPORT(MEMGetBaseHeapHandle);
IMPORT(MEMCreateExpHeapEx);
IMPORT(MEMDestroyExpHeap);
@ -48,6 +56,7 @@ IMPORT(MEMGetAllocatableSizeForFrmHeapEx);
IMPORT(FSInit);
IMPORT(FSShutdown);
IMPORT(FSAddClient);
IMPORT(FSAddClientEx);
IMPORT(FSDelClient);
IMPORT(FSInitCmdBlock);
IMPORT(FSChangeDir);
@ -77,6 +86,13 @@ IMPORT(IOS_Close);
IMPORT(IOS_Ioctl);
IMPORT(IOS_IoctlAsync);
IMPORT(IMIsAPDEnabled);
IMPORT(IMIsDimEnabled);
IMPORT(IMEnableAPD);
IMPORT(IMEnableDim);
IMPORT(IMDisableAPD);
IMPORT(IMDisableDim);
IMPORT_END();
/* nsysnet */
@ -84,6 +100,11 @@ IMPORT_BEGIN(nsysnet);
IMPORT(socket_lib_init);
IMPORT(socket);
IMPORT(setsockopt);
IMPORT(bind);
IMPORT(listen);
IMPORT(accept);
IMPORT(recv);
IMPORT(socketclose);
IMPORT(connect);
IMPORT(send);
@ -191,6 +212,7 @@ IMPORT(WPADEnableURCC);
IMPORT(WPADEnableWiiRemote);
IMPORT(WPADRead);
IMPORT(KPADRead);
IMPORT(KPADReadEx);
IMPORT_END();
@ -201,3 +223,22 @@ IMPORT(KBDSetup);
IMPORT(KBDTeardown);
IMPORT_END();
/* syshid */
IMPORT_BEGIN(nsyshid);
IMPORT(HIDSetup);
IMPORT(HIDTeardown);
IMPORT(HIDAddClient);
IMPORT(HIDDelClient);
IMPORT(HIDGetDescriptor);
IMPORT(HIDSetDescriptor);
IMPORT(HIDGetReport);
IMPORT(HIDSetReport);
IMPORT(HIDSetIdle);
IMPORT(HIDSetProtocol);
IMPORT(HIDGetProtocol);
IMPORT(HIDRead);
IMPORT(HIDWrite);
IMPORT_END();