Athena: Wiimote and Mac OS X

Wiimote USB DrivesSince solving the problem of the rumbling on the XBox 360 pad, I’ve grown bored of it, and decided to branch out trying to get more controllers working in my engine.

So a few days ago I started with the Wiimote, I had planned to try to the PS3 controller but I didn’t have one, so borrowing one of my housemates Wiimotes I set to work.

There is quite a lot of documentation on the Wiimote at the moment, whether it is the correct way to do things is questionable, since there are cases like “1? – it is set to 1 by the Wii” and “set this to 0x55 at memory address X and set to 0x00 at memory address Y to enable it”.

I started with website called The Wiimote Project, but as their documentation grew scarce I found a better site (which it seemed to copy it all from anyways) called WiiBrew. The WiiBrew wiki is quite comprehensive and within a few minutes I already had the LEDs flashing.

I won’t go into a lot of detail, I’ll just show the basics that I’ve got to grips with from the documentation on WiiBrew – LEDs + Motor, Buttons, and Battery.

Connecting the Wiimote

Connecting the Wiimote to a Mac is far simpler than it is for XBox 360, for a start its a Bluetooth device that operates using the normal protocols and it doesn’t require a key to activate. To connect, first turn on Bluetooth on your Mac, and then select “Set up Bluetooth Device…“.

Follow on the onscreen instructions, and when it gets to the point where it is searching for nearby Bluetooth devices, press 1 + 2 to soft synchronize if the Wiimote isn’t bound to another device, or the sync button to hard synchronize (unbinds the Wiimote from anything it remembers).

When it appears, select it and click the “Passkey Options…” button. Select the “Do not use a passkey with this device” option and then OK. Continue on and the device will be setup and connected. You can’t actually tell since the LEDs are still blinking, but if you have done it correctly, the Bluetooth icon should be different, or the menu will have a disconnect option for the device just setup.

Athena: XBox 360 Pad and Mac OS X (cont further)

Steampunk LincolnThe past couple of week’s I’ve really gotten into writing code that communicates with gaming devices (the Mac is limited in this part of itself).

One annoyance I had was with getting rumbling working on the XBox 360 pad, eventually after essentially pinging all messages, I found and worked out the format for the rumble message, which was annoyingly nothing like the others listed.

Well after that I got kinda bored with the 360 and decided to turn towards another console controller, the Wiimote. And I thought I’d write my own driver.

Long story short, when I was having trouble getting my driver working, I looked at the code for the driver for Tattiebogle’s XBox 360 pad driver, only to find out that it has redefined the rumble message to it’s own format, namely the 4 byte one, only to forward on the settings to the 360 pad.

Well I’m glad I figured out why the message was different, kinda annoying that wasn’t in his FAQ. Hopefully others will find this post and go “ohhhhhhhh” like I did when seeing the code.

As for the Wiimote, writing a driver for a Bluetooth device I’ve decided doesn’t make sense, the device is already designed to communicate with another bluetooth device, so I made a class instead, using a Bluetooth API and documentation I found on WiiBrew.

I’ll hopefully post my Xcode project for testing the 360 pad in a few days. And I’ll probably write up my Wiimote stuff once I get it working the way I want. I’m really tempted to buy lots of cheap USB and Bluetooth devices on eBay now just to see if I can write drivers for them.

Metroid: Project M

Motherbrain!It has been a fantastic E3 this year, so many reasons to buy a PS3, loads of lovely games coming out on it next year – but got was the first half of that keynote boring. And lets not forget the XBox 360s titles.

Out of everything though, Nintendo has won my heart again with a new Metroid due 2010 on the Nintendo Wii (damn it! need to buy one again).


I think PennyArcade summed it up best for me. And finally here is the YouTube video from the E3 keynote session with Nintendo showing the new Metroid…

YouTube Preview Image

Samson and Delilah

Brighton Snow Well we didn’t get a white Christmas, but at least it snowed in January. Seen lots of awful and some great films recently. I discovered an app on the iPhone yesterday that apparently turns it into a flash drive. Its about 2.50 and called Flash Drive.

Haven’t gotten it yet, but judging by its descripting and star rating, I’m optimistic, I’ve been hoping for something like this for a while now. Downside is that it requires WiFi to work, though I’m not sure if that is required or just a bonus.

OTree Cutting WTFn the way to work the other day I came by a sign that I thought was hilarious. Tree Cutting but with a man digging symbol. Maybe its only me who find it funny, I think the falling rocks symbol may have been more useful there, if not like you have to watch out of holes in the ground, they were not digging them up, they were literally cutting them.

I was tempted to sell my limited edition Phantom Hourglass Nintendo DS (there is only 1000 in the entire world), its already tripled in price. Taking into account damage and loss, there probably closer to 900 by now. But I decided against it, I still haven’t completed the most recent Pokemon Ranger, and Chrono Trigger comes out next month.

PLimited Edition DSlus once I have the feather stylus, I will have all 3 limited edition phantom hourglass items from around the world (I found one of the Australian box thing in a shop in Brighton).

I’ve started to do some iPhone development again, working on one of my game ideas, thanks to my friend Dave I have some awesome music now, so currently I’m working on getting my 3d geometry export from Milkshape3D to render quickly. I wish there were shaders on the iPhone, they’ll probably add them in the next generation.

Speaking of shaders, I’ve been playing around the Geometry Shader in OpenGL. Its really annoying me since there is very little documentation compared with DirectX. DirectX seems to be moving forward, yet OpenGL is moving backwards with 3.0, maintaining it C structure.

Blite: Nintendo DS


After programming for Win32 for most of the time I’ve been programming, and Playstation 2 for a little bit when I first came to university. I decided for a bit of change, and began to learn to make games on the Nintendo DS through homebrew.

Using a basic 3D engine I had wrote for the PC a long time ago when I first started making 3D programming, I ported it over. It was a little confusing at first, since I had no experience with fixed point numbers.

After a while, I discovered how to make Cel Shading working, there was very little documentation on how these things work on the Nintendo DS unless you were an actual developer. My initial attempts were to change the table to be filled with three shades of a colour, then switch it over when another colour material needed to be rendered. However this didn’t work, everything was the same colour.

In the end, I figured it out, what you needed was to fill the shading table with a few shades of white to black, then using a texture for a table of colours to use. When combined together, the texture with colours would colour things the correct colour, while the shading table would multiply against these and give a cel shaded effect.

One other annoying problem I had was with the FIFO, it was hard to debug the ARM7 since it kept breaking. Eventually it turned out you needed to clear the error flags if an error occurred.