mirror of
https://github.com/raphnet/gc_n64_usb-v3
synced 2024-12-21 14:58:51 -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 */
|
/* What was most recently sent to the host */
|
||||||
static gamepad_data last_sent_report;
|
static gamepad_data last_sent_report;
|
||||||
|
|
||||||
|
static char gc_rumbling = 0;
|
||||||
static char origins_set = 0;
|
static char origins_set = 0;
|
||||||
static unsigned char orig_x, orig_y, orig_cx, orig_cy;
|
static unsigned char orig_x, orig_y, orig_cx, orig_cy;
|
||||||
|
|
||||||
@ -150,7 +151,7 @@ static char gamecubeUpdate()
|
|||||||
|
|
||||||
tmpdata[0] = GC_GETSTATUS1;
|
tmpdata[0] = GC_GETSTATUS1;
|
||||||
tmpdata[1] = GC_GETSTATUS2;
|
tmpdata[1] = GC_GETSTATUS2;
|
||||||
tmpdata[2] = GC_GETSTATUS3(0);
|
tmpdata[2] = GC_GETSTATUS3(gc_rumbling);
|
||||||
|
|
||||||
count = gcn64_transaction(tmpdata, 3);
|
count = gcn64_transaction(tmpdata, 3);
|
||||||
if (count != GC_GETSTATUS_REPLY_LENGTH) {
|
if (count != GC_GETSTATUS_REPLY_LENGTH) {
|
||||||
@ -185,12 +186,18 @@ static void gamecubeGetReport(gamepad_data *dst)
|
|||||||
memcpy(dst, &last_built_report, sizeof(gamepad_data));
|
memcpy(dst, &last_built_report, sizeof(gamepad_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gamecubeVibration(char enable)
|
||||||
|
{
|
||||||
|
gc_rumbling = enable;
|
||||||
|
}
|
||||||
|
|
||||||
Gamepad GamecubeGamepad = {
|
Gamepad GamecubeGamepad = {
|
||||||
.init = gamecubeInit,
|
.init = gamecubeInit,
|
||||||
.update = gamecubeUpdate,
|
.update = gamecubeUpdate,
|
||||||
.changed = gamecubeChanged,
|
.changed = gamecubeChanged,
|
||||||
.getReport = gamecubeGetReport,
|
.getReport = gamecubeGetReport,
|
||||||
.probe = gamecubeProbe,
|
.probe = gamecubeProbe,
|
||||||
|
.setVibration = gamecubeVibration,
|
||||||
};
|
};
|
||||||
|
|
||||||
Gamepad *gamecubeGetGamepad(void)
|
Gamepad *gamecubeGetGamepad(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user