Yoyofr's stuff
« Wiimote »

Welcome Guest. Please Login or Register.
Sept 3, 2010, 10:19am




Yoyofr's stuff :: Opensourced Projects :: Little John PalmOS :: Wiimote
Page 1 of 7 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Wiimote (Read 17,183 times)
laddspencer
New Member
*
member is offline





Joined: Jun 2008
Gender: Male
Posts: 12
 Wiimote
« Thread Started on Jun 5, 2008, 1:04pm »

Hey everyone. I stumbled upon this forum yesterday and I'm glad to see that there are a few people interested in using a Wiimote with LJP (or other Palm apps in general). I'd previously scoured the web to see if anyone has even attempted this but couldn't even find a page containing the words "Wii" and "Palm" together! A few months ago I picked up a Wiimote and downloaded the Garnet Developer Suite; I was determined to make this happen.

I don't know how far along anyone else is with this, but I can't find anything indicating that "hey, it works, here's the source"...so if it's been done, ignore this:

Two nights ago, I got it working. Right now it's primitive and I have to refactor it into a nice interface, but my 755p connects to the Wiimote, sets some of the blue LEDs on or off (they just keep blinking otherwise), and begins reporting button presses. It should be trivial to add accelerometer and IR camera support soon as well.

Note: I did see a post by metaview alluding to the fact that LJP won't work with a general bluetooth input driver, so I'm guessing I can't just generate fake keyboard events when a Wii button is pressed (I'm guessing LJP polls the hardware directly?). Regardless, this is a step closer!
Link to Post - Back to Top  IP: Logged
_Em
God
*****
member is offline

[avatar]

emulation.net Admin

[icq] [yim] [msn] [aim]
[homepage]

Joined: Jan 2006
Posts: 932
 Re: Wiimote
« Reply #1 on Jun 5, 2008, 4:58pm »

Good job! I'd suggest coordinating with Metaview as he's the resident input device guru (IIRC, that's what originally got him working on LJP). If you have all the details, he should be able to integrate the device into LJP without too much difficulty based on your data -- he added my IR keyboard anyway, as well as the BT gamepad.
Link to Post - Back to Top  IP: Logged

Site admin of emulation.net.
metaview
God
*****
member is offline

[avatar]

VoxelRacer: Pathfinder


[homepage]

Joined: Mar 2005
Gender: Male
Posts: 1,042
Location: Berlin, Germany, Europe
 Re: Wiimote
« Reply #2 on Jun 5, 2008, 7:55pm »

Wiimote: is it using serial BT? I guess we could then just poll the buttons? That's the way it works with the BT gamepad: in each frame check the gamepad for any button pressed.
Link to Post - Back to Top  IP: Logged

---
Palm OS (c) certified developer

PalmPDF, Multiplayer modifications, Duke3D, MyUAE
Want to donate? PayPal: metaview (at) web.de
laddspencer
New Member
*
member is offline





Joined: Jun 2008
Gender: Male
Posts: 12
 Re: Wiimote
« Reply #3 on Jun 5, 2008, 8:11pm »

I'm using the btLibSocket*() functions:

http://www.access-company.com/developers....ef_Sockets.html

...it's pretty simple actually. You make an ACL connection first and get the bt address for the device. Then you create two sockets, one for each HID channel (control and interrupt channels) and connect to them in the proper order. After that, data starts flowing in (i.e. events are generated) when you press the Wiimote buttons.

I'll be glad to provide you with anything else to help get it incorporated into LJP.
« Last Edit: Jun 5, 2008, 8:11pm by laddspencer »Link to Post - Back to Top  IP: Logged
metaview
God
*****
member is offline

[avatar]

VoxelRacer: Pathfinder


[homepage]

Joined: Mar 2005
Gender: Male
Posts: 1,042
Location: Berlin, Germany, Europe
 Re: Wiimote
« Reply #4 on Jun 5, 2008, 8:28pm »

Cool, where do you know about this HID-stuff? Do you have some example code? You get your BtLibSocketCallback called when ever something comes in? If this still works with the LJP-event loop running, we could define a shared memory block and set flags according to the pressed buttons.
Link to Post - Back to Top  IP: Logged

---
Palm OS (c) certified developer

PalmPDF, Multiplayer modifications, Duke3D, MyUAE
Want to donate? PayPal: metaview (at) web.de
_Em
God
*****
member is offline

[avatar]

emulation.net Admin

[icq] [yim] [msn] [aim]
[homepage]

Joined: Jan 2006
Posts: 932
 Re: Wiimote
« Reply #5 on Jun 5, 2008, 8:54pm »

We could also possibly do the holy grail of supporting HID-generic in LJP :D
Link to Post - Back to Top  IP: Logged

Site admin of emulation.net.
samphex
Senior Member
****
member is offline

[avatar]

[yim] [aim]

Joined: Dec 2007
Gender: Male
Posts: 401
Location: Ga
 Re: Wiimote
« Reply #6 on Jun 5, 2008, 10:01pm »

Oh my GAWD. My dream has come true! Now I just gotta get a wiimote!
Link to Post - Back to Top  IP: Logged

Centro user

countbuggula
God
*****
member is offline

[avatar]



Joined: Sept 2005
Gender: Male
Posts: 514
Location: Iowa, USA
 Re: Wiimote
« Reply #7 on Jun 5, 2008, 10:13pm »

I happen to actually own my own Wii!

<does a little happy dance>

This has been the best introductory thread I've ever seen here. To be honest, when I first started reading I thought it was another person showing up and asking if we could get wiimote support for LJP without actually searching and finding how often it's been asked before. laddspencer, I salute you. And welcome to the forums.
Link to Post - Back to Top  IP: Logged

Visor Edge + Visorphone -> Samsung i300 -> Treo 300 -> Treo 600 -> Treo 700p -> Treo 755
samphex
Senior Member
****
member is offline

[avatar]

[yim] [aim]

Joined: Dec 2007
Gender: Male
Posts: 401
Location: Ga
 Re: Wiimote
« Reply #8 on Jun 5, 2008, 11:38pm »


Jun 5, 2008, 10:13pm, countbuggula wrote:
laddspencer, I salute you. And welcome to the forums.


I too. ;D ;)
Link to Post - Back to Top  IP: Logged

Centro user

laddspencer
New Member
*
member is offline





Joined: Jun 2008
Gender: Male
Posts: 12
 Re: Wiimote
« Reply #9 on Jun 6, 2008, 12:26am »

Glad I'm getting such a good response to this, thanks everyone ;D


Quote:
...where do you know about this HID-stuff? Do you have some example code?


These have been my two main sources of information:


I can give you my demo source. It's probably best if I clean it up first though; it's based on the Garnet example source (BtLibTest) and has about 2000 lines of junk code that should be stripped away.



Quote:

You get your BtLibSocketCallback called when ever something comes in? If this still works with the LJP-event loop running, we could define a shared memory block and set flags according to the pressed buttons.


That's correct, the callback gives you a buffer containing the HID packet. It's fairly simple to parse. I was hoping LJP relied on keypress events, then I assumed I could just generate keypress events and the system would propagate them to you (LJP wouldn't need any modification). I'd rather do that than have tight coupling between our code (but if we need to use shared mem, so be it).


Quote:
We could also possibly do the holy grail of supporting HID-generic in LJP :D

I'm all for that, but I will add that Wiimotes apparently don't follow the HID spec to the letter, so I imagine we'd have one HID driver for conforming devices, and some special code on the side for handling Wiimotes.

I just made a video to demo this for you guys; let me know what you think:

http://www.youtube.com/watch?v=98xa2EuDknw
« Last Edit: Jun 6, 2008, 12:42am by laddspencer »Link to Post - Back to Top  IP: Logged
samphex
Senior Member
****
member is offline

[avatar]

[yim] [aim]

Joined: Dec 2007
Gender: Male
Posts: 401
Location: Ga
 Re: Wiimote
« Reply #10 on Jun 6, 2008, 1:58am »

Wow. The video itself is making me excited.

I commented on it.

Here it is if you want to see it.


sjsamphex (48 seconds ago)

My god. You rock. You know this does not only have to be for ljp? It could even be for other games, like BOD or PALM MAME, or DOS Box....etc. etc.
Link to Post - Back to Top  IP: Logged

Centro user

icefire
Senior Member
****
member is offline

[avatar]

Go Penguins?


[homepage]

Joined: Feb 2008
Gender: Male
Posts: 472
Location: Inside a cow?
 Re: Wiimote
« Reply #11 on Jun 6, 2008, 2:31am »

Now THIS is cool! I come back and my dreams are coming true!
Link to Post - Back to Top  IP: Logged

icefire

Currently: Playing Bike or Die and LJP.
Palms: Treo 650, Tapwave Zodiac (x2)
Favorite apps: Bike or Die, LJP, Resco Explorer
Waiting for: LJX, psx4palm, gba4palm, LJP4D, and wii4palm.
coder12
God
*****
member is offline

[avatar]

a.k.a. Commander Keen



Joined: Mar 2007
Gender: Male
Posts: 582
Location: On My computer... In MN...
 Re: Wiimote
« Reply #12 on Jun 6, 2008, 2:36am »

That's really cool (it sure makes what I did look like toast compared to what you did from a technical point of view)
Congratulations!
Link to Post - Back to Top  IP: Logged

Developer of Commander Genius.
Working on: Commander Genius Music, and Commander Keen in Sonic.
Please research before you post something. :)
natepless
Junior Member
**
member is offline

[avatar]

SHAQ-FU BABY!!!!!!!!!!!!!!!!!!!!!!



Joined: Apr 2008
Gender: Male
Posts: 74
Location: Miltown,WI
 Re: Wiimote
« Reply #13 on Jun 6, 2008, 5:14am »

Wow awesome, this is the most interesting thing ive heard all year, if you get this working yoru a god!!!
Link to Post - Back to Top  IP: Logged

Centro, unmemfrag, dbcache
vilmos
Full Member
***
member is offline





Joined: Apr 2006
Gender: Male
Posts: 115
Location: Canada
 Re: Wiimote
« Reply #14 on Jun 6, 2008, 10:17pm »

You ba$tard! I'm going to have to go back and do more PalmMame coding! ;D

Palm games generally don't use events at all for control as they arer mind bogglingly slow.

SharedMem is likely the way to go, just fill a struct and then flip to ARM and read it.
Link to Post - Back to Top  IP: Logged
icefire
Senior Member
****
member is offline

[avatar]

Go Penguins?


[homepage]

Joined: Feb 2008
Gender: Male
Posts: 472
Location: Inside a cow?
 Re: Wiimote
« Reply #15 on Jun 7, 2008, 12:38am »

You could also possibly write a YAHM hack and when you enter an app, it maps the wiimote buttons to hardware buttons (by patching KeyCurrentState?). Then Vilmos doesn't have to code :D; but it would take a LOT more work if it is possible, and you would need a per-app config screen and such.
Link to Post - Back to Top  IP: Logged

icefire

Currently: Playing Bike or Die and LJP.
Palms: Treo 650, Tapwave Zodiac (x2)
Favorite apps: Bike or Die, LJP, Resco Explorer
Waiting for: LJX, psx4palm, gba4palm, LJP4D, and wii4palm.
metaview
God
*****
member is offline

[avatar]

VoxelRacer: Pathfinder


[homepage]

Joined: Mar 2005
Gender: Male
Posts: 1,042
Location: Berlin, Germany, Europe
 Re: Wiimote
« Reply #16 on Jun 7, 2008, 8:07am »

Patching KeyCurrentstate would be a good idea. Who is goind to do it?
Link to Post - Back to Top  IP: Logged

---
Palm OS (c) certified developer

PalmPDF, Multiplayer modifications, Duke3D, MyUAE
Want to donate? PayPal: metaview (at) web.de
samphex
Senior Member
****
member is offline

[avatar]

[yim] [aim]

Joined: Dec 2007
Gender: Male
Posts: 401
Location: Ga
 Re: Wiimote
« Reply #17 on Jun 7, 2008, 1:08pm »


Jun 7, 2008, 8:07am, metaview wrote:
Patching KeyCurrentstate would be a good idea. Who is goind to do it?


Hmmm... If only we had ome certified pam software developers on this forums... :(....(HINT!)
Link to Post - Back to Top  IP: Logged

Centro user

coder12
God
*****
member is offline

[avatar]

a.k.a. Commander Keen



Joined: Mar 2007
Gender: Male
Posts: 582
Location: On My computer... In MN...
 Re: Wiimote
« Reply #18 on Jun 7, 2008, 3:22pm »


Jun 7, 2008, 1:08pm, samphex wrote:

Jun 7, 2008, 8:07am, metaview wrote:
Patching KeyCurrentstate would be a good idea. Who is goind to do it?


Hmmm... If only we had ome certified pam software developers on this forums... :(....(HINT!)

Didn't we used to have more than one? And then the other devs except for metaview got "stolen by aliens"? Luckily tinnus got released though.
Link to Post - Back to Top  IP: Logged

Developer of Commander Genius.
Working on: Commander Genius Music, and Commander Keen in Sonic.
Please research before you post something. :)
Tinnus
Moderator
*****
member is offline

[avatar]

LJP Hacker



Joined: Jan 2005
Gender: Male
Posts: 2,611
Location: Brazil
 Re: Wiimote
« Reply #19 on Jun 7, 2008, 3:38pm »

I don't think patching KeyCurrentState is that good of an idea since it only returns a 32bit mask that has most of its bits reserved for something already... unless we don't care about "A" and "Home" trigerring the same bit for instance, which is a possibility since it's not very normal to play with the Wiimote PLUS device buttons ;D
Link to Post - Back to Top  IP: Logged

Be happy -- play LJP!

If you want to donate via PayPal...

yoyofr: ymagnien 4t hotmail D0T com / Tinnus: tinnus 4t gmail d0t com
icefire
Senior Member
****
member is offline

[avatar]

Go Penguins?


[homepage]

Joined: Feb 2008
Gender: Male
Posts: 472
Location: Inside a cow?
 Re: Wiimote
« Reply #20 on Jun 7, 2008, 4:30pm »

@coder12: If I finished compiling my first YAHM hack, you'd see quite a few coming out of me...
@Tinnus: I meant for other apps (not LJP), where the dev doesn't want to add in wiimote code (such as Vilmos ::)).
« Last Edit: Jun 7, 2008, 5:14pm by icefire »Link to Post - Back to Top  IP: Logged

icefire

Currently: Playing Bike or Die and LJP.
Palms: Treo 650, Tapwave Zodiac (x2)
Favorite apps: Bike or Die, LJP, Resco Explorer
Waiting for: LJX, psx4palm, gba4palm, LJP4D, and wii4palm.
laddspencer
New Member
*
member is offline





Joined: Jun 2008
Gender: Male
Posts: 12
 Re: Wiimote
« Reply #21 on Jun 8, 2008, 10:08pm »

For those of you with Wiimotes who would like to try the test app, I posted the latest version here:

http://www.mediafire.com/?hmziaj1jyzg

As soon as it starts, push 1 & 2 on the Wiimote (or the red button next to the batteries) and select it from the list of devices on your Palm. It should connect and you should be able to see button events.
« Last Edit: Jun 9, 2008, 12:40pm by laddspencer »Link to Post - Back to Top  IP: Logged
icefire
Senior Member
****
member is offline

[avatar]

Go Penguins?


[homepage]

Joined: Feb 2008
Gender: Male
Posts: 472
Location: Inside a cow?
 Re: Wiimote
« Reply #22 on Jun 8, 2008, 10:14pm »

Source?
Link to Post - Back to Top  IP: Logged

icefire

Currently: Playing Bike or Die and LJP.
Palms: Treo 650, Tapwave Zodiac (x2)
Favorite apps: Bike or Die, LJP, Resco Explorer
Waiting for: LJX, psx4palm, gba4palm, LJP4D, and wii4palm.
coder12
God
*****
member is offline

[avatar]

a.k.a. Commander Keen



Joined: Mar 2007
Gender: Male
Posts: 582
Location: On My computer... In MN...
 Re: Wiimote
« Reply #23 on Jun 9, 2008, 4:40am »

Maybe he doesn't want to release it yet.

@laddspencer: Is this for a generic HID profile, so maybe a PS3 controller would work? Or is it wii specific? (haha the code is a wii bit specific. . . lol. . .)
Link to Post - Back to Top  IP: Logged

Developer of Commander Genius.
Working on: Commander Genius Music, and Commander Keen in Sonic.
Please research before you post something. :)
laddspencer
New Member
*
member is offline





Joined: Jun 2008
Gender: Male
Posts: 12
 Re: Wiimote
« Reply #24 on Jun 9, 2008, 12:29pm »

It is Wii specific, so it won't work with any other HID device right now. As I mentioned in a previous post, Nintendo has taken liberties with their implementation of HID. From WiiBrew:
...the Wiimote does not make use of the standard data types and HID descriptor, and only describes its report format length, leaving the actual contents undefined, which makes it useless with standard HID drivers.


Metaview has the source; I assume he will patch it into the next LJP release.
Link to Post - Back to Top  IP: Logged
coder12
God
*****
member is offline

[avatar]

a.k.a. Commander Keen



Joined: Mar 2007
Gender: Male
Posts: 582
Location: On My computer... In MN...
 Re: Wiimote
« Reply #25 on Jun 9, 2008, 1:25pm »

Wow, if the new version of LJP gets the Wiimote code + my Hi-res graphics + icefire's new beltbar skin this is going to be BIG!!!

[edit]: I think that I know what I want for my birthday now! ;D
« Last Edit: Jun 9, 2008, 3:41pm by coder12 »Link to Post - Back to Top  IP: Logged

Developer of Commander Genius.
Working on: Commander Genius Music, and Commander Keen in Sonic.
Please research before you post something. :)
vilmos
Full Member
***
member is offline





Joined: Apr 2006
Gender: Male
Posts: 115
Location: Canada
 Re: Wiimote
« Reply #26 on Jun 9, 2008, 3:26pm »

I would like to see the source as well since PalmMAME goes about keyhandling in a completely opposite way from LJP so using the LJP code is usually painful.

Can you post a link, or email it to support at pocketdimension dot com


BTW: This looks like an excellent excuse to buy a Wii... ;D
Link to Post - Back to Top  IP: Logged
_Em
God
*****
member is offline

[avatar]

emulation.net Admin

[icq] [yim] [msn] [aim]
[homepage]

Joined: Jan 2006
Posts: 932
 Re: Wiimote
« Reply #27 on Jun 9, 2008, 3:51pm »

You could probably just pick up a wiimote on eBay ;)
Link to Post - Back to Top  IP: Logged

Site admin of emulation.net.
icefire
Senior Member
****
member is offline

[avatar]

Go Penguins?


[homepage]

Joined: Feb 2008
Gender: Male
Posts: 472
Location: Inside a cow?
 Re: Wiimote
« Reply #28 on Jun 9, 2008, 4:34pm »

Could you also email it to [email removed b/c i sent him a PM]
I have a few projects that would be cool to implement in!
« Last Edit: Jun 10, 2008, 1:06am by icefire »Link to Post - Back to Top  IP: Logged

icefire

Currently: Playing Bike or Die and LJP.
Palms: Treo 650, Tapwave Zodiac (x2)
Favorite apps: Bike or Die, LJP, Resco Explorer
Waiting for: LJX, psx4palm, gba4palm, LJP4D, and wii4palm.
samphex
Senior Member
****
member is offline

[avatar]

[yim] [aim]

Joined: Dec 2007
Gender: Male
Posts: 401
Location: Ga
 Re: Wiimote
« Reply #29 on Jun 9, 2008, 5:04pm »


Jun 9, 2008, 1:25pm, coder12 wrote:
Wow, if the new version of LJP gets the Wiimote code + my Hi-res graphics + icefire's new beltbar skin this is going to be BIG!!!

[edit]: I think that I know what I want for my birthday now! ;D


It truly is going to be huge lmao...

This stuff should also be in ljx.
Link to Post - Back to Top  IP: Logged

Centro user

Page 1 of 7 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]

Google
Webyoyofr.proboards.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile