From d26da79c59d03c3d42dbbdb5c190760cc41f9444 Mon Sep 17 00:00:00 2001 From: Sanjay Govind Date: Mon, 20 Mar 2023 11:24:43 +1300 Subject: [PATCH] Swap Yellow and Blue in PS3 guitar report --- include/ds34common.h | 4 ++-- modules/pademu/ds34common.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/ds34common.h b/include/ds34common.h index 66b8e9d3c..e5daa3cc9 100644 --- a/include/ds34common.h +++ b/include/ds34common.h @@ -179,10 +179,10 @@ struct ds3guitarreport }; struct { - uint16_t Yellow : 1; + uint16_t Blue : 1; uint16_t Green : 1; uint16_t Red : 1; - uint16_t Blue : 1; + uint16_t Yellow : 1; uint16_t Orange : 1; uint16_t StarPower : 1; uint16_t : 1; diff --git a/modules/pademu/ds34common.c b/modules/pademu/ds34common.c index 87691dd85..2bbf9333b 100644 --- a/modules/pademu/ds34common.c +++ b/modules/pademu/ds34common.c @@ -31,12 +31,13 @@ void translate_pad_guitar(const struct ds3guitarreport *in, struct ds2report *ou if (guitar_hero_format) { // GH PS3 Guitars swap Yellow and Blue - out->nButtonStateH = ~(in->Green << 1 | in->Yellow << 4 | in->Red << 5 | in->Blue << 6 | in->Orange << 7); + // Interestingly, it is only GH PS3 Guitars that do this, all the other instruments including GH Drums don't have this swapped. + out->nButtonStateH = ~(in->Green << 1 | in->Blue << 4 | in->Red << 5 | in->Yellow << 6 | in->Orange << 7); if (in->AccelX > 512 || in->AccelX < 432) { out->nL2 = 0; } } else { - out->nButtonStateH = ~(in->StarPower | in->Green << 1 | in->Blue << 4 | in->Red << 5 | in->Yellow << 6 | in->Orange << 7); + out->nButtonStateH = ~(in->StarPower | in->Green << 1 | in->Yellow << 4 | in->Red << 5 | in->Blue << 6 | in->Orange << 7); } }