btdrv-mitm: handle home button according to reported data format

This commit is contained in:
ndeadly 2020-09-07 10:09:00 +02:00
parent db59fa7bec
commit 60284e9c01
2 changed files with 12 additions and 3 deletions

View file

@ -51,6 +51,9 @@ namespace ams::controller {
void GemboxController::HandleInputReport0x02(const GemboxReportData *src, SwitchReportData *dst) {
dst->input0x30.buttons.minus = src->input0x02.back;
dst->input0x30.buttons.home = src->input0x02.buttons == 0;
this->PackStickData(&dst->input0x30.left_stick, STICK_ZERO, STICK_ZERO);
this->PackStickData(&dst->input0x30.right_stick, STICK_ZERO, STICK_ZERO);
}

View file

@ -55,9 +55,15 @@ namespace ams::controller {
} __attribute__ ((__packed__));
struct GemboxInputReport0x02 {
uint8_t : 2;
uint8_t back : 1;
uint8_t : 0;
union {
struct {
uint8_t : 6;
uint8_t back : 1;
uint8_t : 0;
};
uint8_t buttons;
};
} __attribute__((packed));
struct GemboxInputReport0x07 {