Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emulated Shinkansen controller #11052

Merged
merged 1 commit into from Sep 29, 2022
Merged

Conversation

Tilka
Copy link
Member

@Tilka Tilka commented Sep 11, 2022

This Wiimote extension is only compatible with Densha de Go! Shinkansen EX. I don't actually have access to the physical controller and the game doesn't have symbols, so this is all based on guesswork but it seems to work pretty well. We don't support LED outputs yet. All you can do with the door lockout light is map it to a rumble effect^^

@Tilka Tilka force-pushed the shinkansen branch 2 times, most recently from b04f7ea to 3d56566 Compare September 11, 2022 07:00
m_levers->GetState(&digital, lever_bitmasks, analog);
// The game requires these specific values, all other values are treated like 0/255 (which are
// guesses).
const u8 brake_values[] = {0, 53, 79, 105, 132, 159, 187, 217, 250};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values make me think some of the bits in brake and power are actually unused or for something else. My guess is that similar packing to one of the other extensions is being used (e.g. classic controller). FYI, Nintendo has established some pseudo-standards for data layouts (so M+ pass-through can work) e.g. buttons are always the last two bytes and analog values have significant bits in certain places.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the button layout is identical to the classic controller with some buttons missing.

Regarding brake and power values, I can't see any pattern in binary:

 53: 00110101
 79: 01001111
105: 01101001
132: 10000100
159: 10011111
187: 10111011
217: 11011001
250: 11111010

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's the same layout as Classic Controller's LT/RT and the unused bits are random to confuse us?
https://wiibrew.org/wiki/Wiimote/Extension_Controllers/Classic_Controller

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe the extension actually uses the "1st-party" encryption so things are all wonky with "3rd-party"? The instruments use "1st party" fwiw.

Copy link
Member

@lioncash lioncash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Densha de Merge!

@lioncash lioncash merged commit 1f2ec9a into dolphin-emu:master Sep 29, 2022
11 checks passed
@Tilka Tilka deleted the shinkansen branch September 30, 2022 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants