Welcome! Log In Create A New Profile

Advanced

Drum

Posted by scognito 
Drum
October 27, 2008 09:51AM
Hi,
since I have (half) idea of making an homebrew using the Rockband drums, I want to add support for this "controller" in libogc, as people did with the guitar hero controller.
The question is: HOW? :P
I'm using the latest stable libogc, but I don't know how to "connect" the drums and how to map buttons.
If it is doable, I may consider to buy the kit.
Thank you in advance.
Re: Drum
October 27, 2008 11:40AM
I don't have access to libogc at the minute. However, in the Wiiuse includes there will be a few bits you need to add/edit

Firstly, each controller "extension" will have a unique number such as
#define WII_EXTENSION_NUNCHUK  1

The easiest way to find this out is to write a simple homebrew app which lists the extension numbers then just plug in the drums after it's running, and you can create your new #define for it

As for the actual detail. Under the getStatus function (whatever it might be called), you'll find a struct which "union"'s (I think that's the word) several other structures together, one for classic, one for nunchuk etc. You'll need to discover the data structure for the drums, create the new structure and union it into the master status structure.

Hope that makes sense.

Edit: A link to Wiiuse site about Expansion structure -- [www.wiiuse.net]



Edited 1 time(s). Last edit at 10/27/2008 11:51AM by whodares.
Re: Drum
October 28, 2008 11:28AM
Thank you for answering!
I'm a bit confused though :P
You mean that the number on the define isn't arbitrary and I have to discover which one is writing my own application?
Re: Drum
October 28, 2008 01:44PM
No, if it was arbitrary then no application/game would ever actually know which extension is connected.

Writing the extension check is not as difficult as you might imagine. Something like this should work...
WPAD_Init();
While( (WPAD_ButtonsDown(WPAD_CHAN_0) & WPAD_BUTTON_HOME) == 0 )
{
  WPAD_ScanPads();
  printf("extension: %d", WPAD_Data(WPAD_CHAN_0)->exp.type);
}

It's not been tested, so you might need to correct some bits, but should be fine



Edited 2 time(s). Last edit at 10/28/2008 01:57PM by whodares.
Re: Drum
October 29, 2008 09:35AM
Ok thanks, I'll start with that :)
Now I to convince myself to buy that expensive music kit + game (sold separately) for "just" 180 euros ;)
Re: Drum
October 29, 2008 09:54AM
As you figure out how it works, might be worth just informing Michael at Wiiuse, as it might be useful for others, and it can get distributed with the standard Wiiuse library. That way many people can benefit from your effort.

[www.wiiuse.net]
Re: Drum
December 09, 2008 01:25PM
Ok, I bought Guitar Hero World Tour!
Damn 200€ (recession, what? :))
I'll do some coding soon, and post progress here.
Re: Drum
December 09, 2008 08:30PM
The drums seem not recognized, neither attaching it during dol execution, neither before loading it: the extension value remains 0.
I tried then the old guitar hero controller, and attaching it before dol loadin it gets detected (number 3 iirc).
Drums and new guitar controller are not recognized, but the home button (for resetting to the hbc) works.
I noticed when going back to the hbc with the new guitar or drum connected everything seems "slow" as framerate...
I'll dig on the sources but I'm not so skilled so any help is appreciated.

Code is very simple: [pastebin.com]

Edit: re-pasted file since rafb deleted it

Cheers,
Scognito.



Edited 2 time(s). Last edit at 12/11/2008 12:16PM by scognito.
Sorry, only registered users may post in this forum.

Click here to login