18#define MODNAME "freepad"
19#define M_PRINTF(format, args...) printf(MODNAME ": " format, ## args)
20#define M_KPRINTF(format, args...) Kprintf(MODNAME ": " format, ## args)
23#define D_PRINTF(format, args...) printf(MODNAME ": " format, ## args)
25#define D_PRINTF(a...) (void)0
28#define PADMAN_THPRI_LO 46
29#define PADMAN_THPRI_HI 20
31#define SB_STAT *((volatile unsigned int*)0xBD000040)
36#define PAD_STATE_DISCONN 0x00
37#define PAD_STATE_FINDPAD 0x01
38#define PAD_STATE_FINDCTP1 0x02
39#define PAD_STATE_EXECCMD 0x05
40#define PAD_STATE_STABLE 0x06
41#define PAD_STATE_ERROR 0x07
46#define PAD_RSTAT_COMPLETE 0x00
47#define PAD_RSTAT_FAILED 0x01
48#define PAD_RSTAT_BUSY 0x02
53#define PAD_TYPE_NEJICON 0x2
54#define PAD_TYPE_KONAMIGUN 0x3
55#define PAD_TYPE_DIGITAL 0x4
56#define PAD_TYPE_ANALOG 0x5
57#define PAD_TYPE_NAMCOGUN 0x6
58#define PAD_TYPE_DUALSHOCK 0x7
60#define PAD_MODEL_DUALSHOCK 0x1
61#define PAD_MODEL_DUALSHOCK2 0x3
63#define MODE_CONFIG_NO_PAD 0x0
64#define MODE_CONFIG_QUERY_PAD 0x1
65#define MODE_CONFIG_READY 0x2
69#define TASK_UPDATE_PAD 1
70#define TASK_QUERY_PAD 2
71#define TASK_PORT_CLOSE 3
72#define TASK_SET_MAIN_MODE 4
73#define TASK_SET_ACT_ALIGN 5
74#define TASK_SET_BUTTON_INFO 6
75#define TASK_SET_VREF_PARAM 7
78#define EF_UPDATE_PAD 0x0001
79#define EF_QUERY_PAD 0x0002
81#define EF_SET_MAIN_MODE 0x0008
82#define EF_SET_ACT_ALIGN 0x0010
83#define EF_SET_SET_BUTTON_INFO 0x0020
84#define EF_SET_VREF_PARAM 0x0040
85#define EF_PAD_TRANSFER_START 0x0080
86#define EF_PAD_TRANSFER_DONE 0x0100
87#define EF_TASK_DONE 0x0200
88#define EF_PORT_CLOSE 0x0400
89#define EF_EXIT_THREAD 0x1000
92#define EF_VB_TRANSFER 0x0001
93#define EF_VB_TRANSFER_DONE 0x0004
94#define EF_VB_WAIT_THREAD_EXIT 0x0008
195 u32 data32[8 /
sizeof(u32)];
197 s16 ee_actDirectSize;
200 u32 data32[8 /
sizeof(u32)];
212 s32 setbuttoninfoTid;
225void WaitClearEvent(
int eventflag, u32 bits,
int mode, u32 *resbits_out);
226int VblankStart(
void *arg);
227int VblankEnd(
void *arg);
233s32
padPortOpen(s32 port, s32 slot, s32 pad_area_ee_addr, u32 *buf);
237u32 padGetButtonMask(u32 port, u32 slot);
238u32 padSetButtonInfo(u32 port, u32 slot, u32
info);
239u32 padSetVrefParam(u32 port, u32 slot,
const u8 *vparam);
240s32
padInfoAct(u32 port, u32 slot, s32 act, u32 val);
241s32 padInfoComb(u32 port, u32 slot, s32 listno, u32 offs);
242s32
padInfoMode(u32 port, u32 slot, s32 term, u32 offs);
u32 padGetModVersion(void)
int padPortOpen(int port, int slot, void *padArea)
int padSetActAlign(int port, int slot, const char act_align[6])
int padInfoMode(int port, int slot, int infoMode, int index)
int padSetActDirect(int port, int slot, char act_align[6])
int padPortClose(int port, int slot)
unsigned char padInfoAct(int port, int slot, int word, int byte)
int padSetMainMode(int port, int slot, int mode, int lock)
int padGetSlotMax(int port)