Skip to content

Commit

Permalink
Detect more motionplus modes
Browse files Browse the repository at this point in the history
  • Loading branch information
capitalistspz committed Dec 12, 2023
1 parent 00d0378 commit 5729a4f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
25 changes: 17 additions & 8 deletions src/input/api/Wiimote/WiimoteControllerProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,28 +1030,37 @@ bool WiimoteControllerProvider::identify_extension(WiimoteState& state, size_t c
state.m_extension = NunchuckData{};
return true;
case kExtensionClassic:
wiimote_log( "Extension Type Received: Classic");
wiimote_log("Extension Type Received: Classic");
state.m_extension = ClassicData{};
return true;
case kExtensionClassicPro:
wiimote_log( "Extension Type Received: Classic Pro");
wiimote_log("Extension Type Received: Classic Pro");
return true;
case kExtensionGuitar:
wiimote_log( "Extension Type Received: Guitar");
wiimote_log("Extension Type Received: Guitar");
return true;
case kExtensionDrums:
wiimote_log( "Extension Type Received: Drums");
wiimote_log("Extension Type Received: Drums");
return true;
case kExtensionBalanceBoard:
wiimote_log( "Extension Type Received: Balance Board");
wiimote_log("Extension Type Received: Balance Board");
return true;
case kExtensionMotionPlusBuiltin:
case kExtensionMotionPlus:
wiimote_log( "Extension Type Received: MotionPlus");
wiimote_log("Extension Type Received: MotionPlus");
set_motion_plus(controllerIndex, true);
state.m_motion_plus = MotionPlusData{};
return true;
case kExtensionPartialyInserted:
wiimote_log( "Extension only partially inserted");
case kExtensionMotionPlusDeactivated:
wiimote_log("Extension Type Received: MotionPlus deactivated by other extension");
return true;
case kExtensionMotionPlusActivated:
wiimote_log("Extension Type Received: Activated MotionPlus");
if (!state.m_motion_plus)
state.m_motion_plus = MotionPlusData{};
return true;
case kExtensionPartiallyInserted:
wiimote_log("Extension only partially inserted");
state.m_extension = {};
request_status(controllerIndex);
return true;
Expand Down
7 changes: 5 additions & 2 deletions src/input/api/Wiimote/WiimoteMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ enum ExtensionType : uint64
kExtensionGuitar = 0x0000A4200103,
kExtensionDrums = 0x0100A4200103,
kExtensionBalanceBoard = 0x2A2C,
kExtensionMotionPlusBuiltin = 0xA4200005,
kExtensionMotionPlusActivated = 0xA4200405,

kExtensionMotionPlus = 0xa6200005,
kExtensionMotionPlus = 0xA6200005,
kExtensionMotionPlusDeactivated = 0xA6200405,

kExtensionPartialyInserted = 0xffffffffffff,
kExtensionPartiallyInserted = 0xFFFFFFFFFFFF
};

enum MemoryType : uint8
Expand Down

0 comments on commit 5729a4f

Please sign in to comment.