From 311744f1bc7ec90069dba858337548f10640da7a Mon Sep 17 00:00:00 2001 From: RogueMaster Date: Wed, 23 Nov 2022 15:34:15 -0500 Subject: [PATCH] wii ec upd --- .../plugins/wii_ec_anal/wii_anal_ec.c | 10 ++++++++- applications/plugins/wii_ec_anal/wii_ec.c | 22 +++++++++++++++++++ applications/plugins/wii_ec_anal/wii_ec.h | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/applications/plugins/wii_ec_anal/wii_anal_ec.c b/applications/plugins/wii_ec_anal/wii_anal_ec.c index e93df5366..bd2598476 100644 --- a/applications/plugins/wii_ec_anal/wii_anal_ec.c +++ b/applications/plugins/wii_ec_anal/wii_anal_ec.c @@ -57,6 +57,14 @@ bool evWiiEC(const eventMsg_t* const msg, state_t* const state) { state->calib = CAL_TRACK; sceneSet(state, ecId[msg->wiiEc.val].scene); redraw = true; + +#if 1 // Workaround for Classic Controller Pro, which shows 00's for Factory Calibration Data!? + if(state->ec.pidx == PID_CLASSIC_PRO) { + // Simulate a Long-OK keypress, to start Software Calibration mode + eventMsg_t msg = {input.type = InputTypeLong, input.key = InputKeyOk}; + key_calib(&msg, state); + } +#endif break; case WIIEC_DISCONN: @@ -79,7 +87,7 @@ bool evWiiEC(const eventMsg_t* const msg, state_t* const state) { } #if 1 //! factory calibration method not known for classic triggers - this will set the digital switch point - if(state->ec.pidx == PID_CLASSIC) { + if((state->ec.pidx == PID_CLASSIC) || (state->ec.pidx == PID_CLASSIC_PRO)) { if(msg->wiiEc.in == 'l') state->ec.calS.classic[2].trgZL = msg->wiiEc.val; if(msg->wiiEc.in == 'r') state->ec.calS.classic[2].trgZR = msg->wiiEc.val; } diff --git a/applications/plugins/wii_ec_anal/wii_ec.c b/applications/plugins/wii_ec_anal/wii_ec.c index 7a8aabeb5..00dcbf922 100644 --- a/applications/plugins/wii_ec_anal/wii_ec.c +++ b/applications/plugins/wii_ec_anal/wii_ec.c @@ -39,6 +39,17 @@ const ecId_t ecId[PID_CNT] = { nunchuck_show, nunchuck_key}, + [PID_NUNCHUCK_R2] = + {{0xFF, 0x00, 0xA4, 0x20, 0x00, 0x00}, + "Nunchuck (rev2)", + SCENE_NUNCHUCK, + NULL, + nunchuck_decode, + nunchuck_msg, + nunchuck_calib, + nunchuck_show, + nunchuck_key}, + [PID_CLASSIC] = {{0x00, 0x00, 0xA4, 0x20, 0x01, 0x01}, "Classic Controller", @@ -50,6 +61,17 @@ const ecId_t ecId[PID_CNT] = { classic_show, classic_key}, + [PID_CLASSIC_PRO] = + {{0x01, 0x00, 0xA4, 0x20, 0x01, 0x01}, + "Classic Controller Pro", + SCENE_CLASSIC, + NULL, + classic_decode, + classic_msg, + classic_calib, + classic_show, + classic_key}, + [PID_BALANCE] = {{0x00, 0x00, 0xA4, 0x20, 0x04, 0x02}, "Balance Board", diff --git a/applications/plugins/wii_ec_anal/wii_ec.h b/applications/plugins/wii_ec_anal/wii_ec.h index 048c0af70..a28453740 100644 --- a/applications/plugins/wii_ec_anal/wii_ec.h +++ b/applications/plugins/wii_ec_anal/wii_ec.h @@ -66,7 +66,9 @@ typedef enum ecPid { PID_NUNCHUCK = PID_FIRST, // If you're wise, ONLY edit this section + PID_NUNCHUCK_R2, PID_CLASSIC, + PID_CLASSIC_PRO, PID_BALANCE, PID_GH_GUITAR, PID_GH_DRUMS,