mirror of
https://github.com/raphnet/gc_n64_usb-v3
synced 2024-12-21 06:48:52 -05:00
Add gamecube rumble support
This commit is contained in:
parent
ca574cc71f
commit
8b9789c055
@ -38,6 +38,7 @@ static gamepad_data last_built_report;
|
||||
/* What was most recently sent to the host */
|
||||
static gamepad_data last_sent_report;
|
||||
|
||||
static char gc_rumbling = 0;
|
||||
static char origins_set = 0;
|
||||
static unsigned char orig_x, orig_y, orig_cx, orig_cy;
|
||||
|
||||
@ -150,7 +151,7 @@ static char gamecubeUpdate()
|
||||
|
||||
tmpdata[0] = GC_GETSTATUS1;
|
||||
tmpdata[1] = GC_GETSTATUS2;
|
||||
tmpdata[2] = GC_GETSTATUS3(0);
|
||||
tmpdata[2] = GC_GETSTATUS3(gc_rumbling);
|
||||
|
||||
count = gcn64_transaction(tmpdata, 3);
|
||||
if (count != GC_GETSTATUS_REPLY_LENGTH) {
|
||||
@ -185,12 +186,18 @@ static void gamecubeGetReport(gamepad_data *dst)
|
||||
memcpy(dst, &last_built_report, sizeof(gamepad_data));
|
||||
}
|
||||
|
||||
static void gamecubeVibration(char enable)
|
||||
{
|
||||
gc_rumbling = enable;
|
||||
}
|
||||
|
||||
Gamepad GamecubeGamepad = {
|
||||
.init = gamecubeInit,
|
||||
.update = gamecubeUpdate,
|
||||
.changed = gamecubeChanged,
|
||||
.getReport = gamecubeGetReport,
|
||||
.probe = gamecubeProbe,
|
||||
.setVibration = gamecubeVibration,
|
||||
};
|
||||
|
||||
Gamepad *gamecubeGetGamepad(void)
|
||||
|
Loading…
Reference in New Issue
Block a user