Compare commits

..

No commits in common. "8beb164475a9a5abf4473e3d4a72fde099caa5fa" and "a43acf4604ca802f29047f260bb01eb66c97fe18" have entirely different histories.

2 changed files with 38 additions and 50 deletions

View File

@ -176,10 +176,8 @@ void loop() {
#error DPAD isn't implemented yet
#endif
#ifdef DEBUGY0
// Log sample rate to the first Y axis
buttonState.axis[1] = samples & 0xff;
#endif
// Log sample rate to the second Y axis
buttonState.axis[3] = samples & 0xff;
// Send an update
HID().SendReport(0, (uint8_t *)&buttonState, 27);

View File

@ -10,9 +10,9 @@ hopefully at least my notes will still be around.
Sample Rate
-----------
If `DEBUGY0' is defined,
the number of samples taken since the last HID report
is sent as Y axis on hat 0.
The number of samples taken since the last HID report
is sent as the second Y axis,
which doesn't appear to be used by anything else.
You can use the
[included gamepad tester](gamepad.html),
to see the approximate number of samples as an integer.
@ -70,33 +70,11 @@ Here's what each bit means:
* 0o13: Cymbal modifier
* 0o14: Select
Hats
----
I guess "hats" are what I would have called "joysticks and dpads".
hatAndConstant
--------------
### Hat 0: unknown
This doesn't appear to be sent or used.
### Hat 1: guitar analog controls
The X axis is the position of the wammy bar.
The Y axis is the pickup selector.
I believe this was a 5-position switch on some guitars.
Only Rock Band 1 seems to use this.
### Hat 2: navigation
Sent by the dpad on the controller,
as `hatAndConstant`.
Guitars send up/down for the up/down strum buttons.
Drums send up/down on the blue/yellow cymbal pads.
The position of this digital input is reported in only 3 bits:
The HAT switch reports its position like a clock.
7 0 1
@ -124,19 +102,20 @@ Sending these values does not seem to cause problems with my Wii games.
Product ID (PID)
----------------
The following USB PIDs are recognized by various things:
Nicholas,
who did the initial work on the guitar,
suggested that PID 0x0005 would get the sketch working as drums.
And that was correct:
this works great on
Wii Rock Band 1 and
Wii LEGO Rock Band.
* 0x0003: XBox Drum
* 0x0004: Wii Guitar
* 0x0005: Wii Drums - Rock Band 1
* 0x3110: Wii Drums - Rock Band 2
But it fails in frustrating ways on
Wii Rock Band 3:
the yellow and blue pads don't navigate menus,
and cymbals aren't detected.
There are some quirks to note:
* Rock Band 3 won't recognize cymbal hits on PID=0x0005,
but the same program with PID=0x3110 works fine.
* Wii games don't appear to recognized PID=0x0003.
Maybe Rock Band 3 does: I didn't test that one.
The fix was setting the USB PID to 0x3110.
Drum Velocity
@ -144,8 +123,7 @@ Drum Velocity
I split the 12 "reserved" bytes from Nicholas's
`struct InstrumentButtonState`
into 4 bytes of I-Don't-Know,
4 bytes of velocity,
into 4 bytes of I-Don't-Know, 4 bytes of velocity,
and 4 more bytes of I-Don't-Know.
Whenever a pad is hit,
I send 127 on the corresponding velocity.
@ -156,17 +134,29 @@ and looks only at the velocity values.
None of the Wii games I have
seem to care what these values are set to.
Clone Hero also does not care.
Clone Hero
==========
Clone Hero wants Hat 2 up on yellow cymbal hit,
and Hat 2 down on blue cymbal hit.
This controller doesn't have a dpad (currently),
so we're using 12 buttons to represent the state of 9 inputs.
Sometimes software is just weird!
If it doesn't see these while mapping drum pads,
then hitting any color bad will trigger both drum and cymbal for that color.
Clone Hero has two undocumented CymExt1 and CymExt2 mappings.
It talks about what they should be set to (on Windows) in the wiki,
but doesn't explain what they're used for.
It seems that Clone Hero expects the Yellow and Blue cymbals
to send dpad inputs, in addition to the pad color and cymbal modifier.
If the controller doesn't send these,
then every drum pad hit plays that color's drum and cymbal at the same time,
and every cymbal pad hit does the same thing.
I'm not exactly sure why Clone Hero does this,
but in any case,
Mockband sends the right things now,
so the drum controller should work correctly after you map everything.
References