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 #error DPAD isn't implemented yet
#endif #endif
#ifdef DEBUGY0 // Log sample rate to the second Y axis
// Log sample rate to the first Y axis buttonState.axis[3] = samples & 0xff;
buttonState.axis[1] = samples & 0xff;
#endif
// Send an update // Send an update
HID().SendReport(0, (uint8_t *)&buttonState, 27); HID().SendReport(0, (uint8_t *)&buttonState, 27);

View File

@ -10,9 +10,9 @@ hopefully at least my notes will still be around.
Sample Rate Sample Rate
----------- -----------
If `DEBUGY0' is defined, The number of samples taken since the last HID report
the number of samples taken since the last HID report is sent as the second Y axis,
is sent as Y axis on hat 0. which doesn't appear to be used by anything else.
You can use the You can use the
[included gamepad tester](gamepad.html), [included gamepad tester](gamepad.html),
to see the approximate number of samples as an integer. to see the approximate number of samples as an integer.
@ -70,33 +70,11 @@ Here's what each bit means:
* 0o13: Cymbal modifier * 0o13: Cymbal modifier
* 0o14: Select * 0o14: Select
Hats
----
I guess "hats" are what I would have called "joysticks and dpads". hatAndConstant
--------------
The HAT switch reports its position like a clock.
### 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:
7 0 1 7 0 1
@ -124,19 +102,20 @@ Sending these values does not seem to cause problems with my Wii games.
Product ID (PID) 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 But it fails in frustrating ways on
* 0x0004: Wii Guitar Wii Rock Band 3:
* 0x0005: Wii Drums - Rock Band 1 the yellow and blue pads don't navigate menus,
* 0x3110: Wii Drums - Rock Band 2 and cymbals aren't detected.
There are some quirks to note: The fix was setting the USB PID to 0x3110.
* 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.
Drum Velocity Drum Velocity
@ -144,8 +123,7 @@ Drum Velocity
I split the 12 "reserved" bytes from Nicholas's I split the 12 "reserved" bytes from Nicholas's
`struct InstrumentButtonState` `struct InstrumentButtonState`
into 4 bytes of I-Don't-Know, into 4 bytes of I-Don't-Know, 4 bytes of velocity,
4 bytes of velocity,
and 4 more bytes of I-Don't-Know. and 4 more bytes of I-Don't-Know.
Whenever a pad is hit, Whenever a pad is hit,
I send 127 on the corresponding velocity. 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 None of the Wii games I have
seem to care what these values are set to. seem to care what these values are set to.
Clone Hero also does not care.
Clone Hero Clone Hero
========== ==========
Clone Hero wants Hat 2 up on yellow cymbal hit, This controller doesn't have a dpad (currently),
and Hat 2 down on blue cymbal hit. 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, Clone Hero has two undocumented CymExt1 and CymExt2 mappings.
then hitting any color bad will trigger both drum and cymbal for that color. 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 References