Archive for March, 2008

Now that the MSI Star Key 2.0 and BlueSoleil are working, getting the Wii remote to connect to the PC should be a snap. Double-click your fancy new “Bluetooth Places” icon and you will see an icon for “Search Devices”. Before double-clicking this icon, push the 1 & 2 buttons on your Wii remote(s) and the 4 LEDs on the remotes will start to blink – this puts the Wii remote in to bluetooth discovery mode. Now click the “Search Devices” icon and your Wii remote(s) should come up right away as a blue joystick icon. This means your devices were found but they are not yet connected. Now right-click the joystick icon, click connect and the joystick should turn green meaning your Wii remote is now connected. Please note that you have to connect the device while the remote still has the LEDs blinking. If the LEDs stop blinking before the device is connecting, simply press 1 & 2 again. You can poke around on the device status to view signal strength which can be handy if your PC will be out of sight, much like it is for my Mediaportal setup.

So now how to make the PC accept input from the Wii remote? The answer to that is GlovePIE. In essence, GlovePIE (Glove Programmable Interface Emulator) acts as a bridge between various non-standard controllers and virtual reality devices and translates those actions to keyboard, mouse or joystick actions on the computer. GlovePIE is pretty magical based on two aspects:

1) It can send and receive data to the Wii remote and many other controllers. In a basic form, it can read the button states from the controls, i.e.: up, down, button 1, button 2. In a more advanced form, it can also read the more advanced sensors from the Wii remote, i.e.; tilt sensor, accelerometer. Since it can also send commands back to the remote, it can enable the rumble or change the LEDs to on or off. It also works with the Wii classic controller, nunchuk and even guitar.

2) It can emulate mouse, keyboard or joystick input to the PC. The PC will do what GlovePIE tells it to do.

Hopefully you see the magic now… GlovePIE will send commands to the PC based on what input it receives from the Wii remote. So if you hold left on the control pad, GlovePIE will emulate the left arrow key being held down on the keyboard…and so on and so forth. If you want to take it a step further, you can perform other commands based on the motion sensors of the Wii remote. Let’s say you are playing Punch-Out for NES. You could map swinging the nunchuck to a left-hook button and swinging the wii remote to a right-hook. Neat, huh?

On top of all this, GlovePIE is fully scriptable so you can extend it and make it suit whatever your needs are. In my case, I want to map all the MAME controls to my Wii remotes. This is done via a script. I won’t get in to the dirty details of the script but it is fairly straight forward. You can read more about the scripting syntax and the Wii specific features over at

All you need to do at this point is make sure your Wii remote is connected to BlueSoleil, start GlovePIE, load a script and click Run. GlovePIE comes with a couple of good test scripts: WiimoteScripts/Wiimote3d.pie and OldScriptsTestWiimote.pie. Wiimote3d.pie will display a 3d representation of your Wii remote and adjust it depending on the remote’s tilt….very cool. TestWiimote.pie will give text representations of your sensors and also let you test some input. Run the TestWiimote.pie and then start notepad, give notepad focus and by pressing 1, 2, A or B on the Wii remote, you should see those characters appear in notepad. If everything works, you are good to go.

At this point you have your Wii remote connected to the PC and you have GlovePIE translating remote commands to PC input. Now all we need to do is map the remote buttons to the commands MAME is expecting. I will include a script that I wrote for this purpose at the bottom of this post. The script will work with four wii remotes connected and map the directional pad and buttons to the default keys MAME is expecting. These controls are consistent across all four remotes:
D-Pad: Directional controls
Button 1 & 2: Primary and secondary action button
+ button: Insert coin
A button: Start game
Home button: Pause MAME
- button: Enter on keyboard (useful if navigating MAME with the remote)
+ & – together: Soft reset the ROM
B & A together: Quit MAME

You might find that the remote lights continue to blink after connecting them to your PC. Once the GlovePIE script below is loaded, you can press the + button on the remote to stop the blinking and the corresponding light on the Wii remote will light up to indicate which player remote it is – just like on a Wii itself. I’ll try to make this more automated in the future but it is still a work in progress.

Now your remote(s) should be mapped to all the default MAME keys. Fire up MAME with your favourite ROM and give it a test. Please note that I’ve have the most success with MAME32 v.117. Versions above this (tested through to .123) give an error about the Wii controller and the input doesn’t work. Not sure why this happens but I’ll figure it out later.

One last sidenote, the main reason I am using the BlueSoleil software is because GlovePIE can automatically connect your Wii remotes through BlueSoleil without any manual intervention. It’s actually quite easy, make sure BlueSoleil is setup and working correctly first with your remotes. Make sure GlovePIE is running. Now pressing 1 & 2 on your Wii remote(s) and GlovePIE will automatically sync the remotes. I’m finding that this often takes three or four tries to actually get each remote synced. However since this is an automatic process, it is good for a home theatre PC setup. Remember to press the + button to make sure the remote is synced and have the player number LED light up. For full automation, I will start GlovePIE and my script when the computer boots.

One last last sidenote, You can turn off the remote by holding down the power button for a couple seconds too. As always, resync by pressing 1 & 2 together.

Here is the script I am currently using – you can copy and paste this to a local file for your own use. One Classic controller is supported at this point:

// Len's Wii Remote script for MAME32
// Supports 1 - 4 players

// Basic directional control and button assignments.
// Player 1
key.Up = Wiimote1.Right          // Up
key.Down = Wiimote1.Left         // Down
key.Left = Wiimote1.Up           // Left
key.Right = Wiimote1.Down        // Right
key.LeftCtrl = Wiimote1.One      // Button 1
key.LeftAlt = Wiimote1.Two       // Button 2
key.5 = Wiimote1.Plus            // Insert Coin
key.1 = Wiimote1.A               // Player 1 Start
key.Enter = Wiimote1.Minus       // Enter
key.P = Wiimote1.Home            // Pause
key.1 = Wiimote1.A               // Player 1 Start
Wiimote1.Led1 = 1                // Light the Remote 1 LED
key.F3 = Wiimote1.Plus + Wiimote1.Minus // Soft Reset
ESC = Wiimote1.B + Wiimote1.A    // Exit MAME

// Player 2
key.R = Wiimote2.Right           // Up
key.F = Wiimote2.Left            // Down
key.D = Wiimote2.Up              // Left
key.G = Wiimote2.Down            // Right
key.A = Wiimote2.One             // Button 1
key.S = Wiimote2.Two             // Button 2
key.6 = Wiimote2.Plus            // Insert Coin
key.2 = Wiimote2.A               // Player 2 Start
key.Enter = Wiimote2.Minus       // Enter
key.P = Wiimote2.Home            // Pause
Wiimote2.Led2 = 1                // Light the Remote 2 LED
key.F3 = Wiimote2.Plus + Wiimote2.Minus // Soft Reset
ESC = Wiimote2.B + Wiimote2.A    // Exit MAME

// Player 3
key.I = Wiimote3.Right           // Up
key.K = Wiimote3.Left            // Down
key.J = Wiimote3.Up              // Left
key.L = Wiimote3.Down            // Right
key.RightControl = Wiimote3.One  // Button 1
key.RightShift = Wiimote3.Two    // Button 2
key.7 = Wiimote3.Plus            // Insert Coin
key.3 = Wiimote3.A               // Player 3 Start
key.Enter = Wiimote3.Minus       // Enter
key.P = Wiimote3.Home            // Pause
Wiimote3.Led3 = 1                // Light the Remote 2 LED
key.F3 = Wiimote3.Plus + Wiimote3.Minus // Soft Reset
ESC = Wiimote3.B + Wiimote3.A    // Exit MAME

// Player 4
key.NUMPAD8 = Wiimote4.Right     // Up
key.NUMPAD2 = Wiimote4.Left      // Down
key.NUMPAD6 = Wiimote4.Up        // Left
key.NUMPAD4 = Wiimote4.Down      // Right
key.NUMPAD0 = Wiimote4.One       // Button 1
key.NumPadDot = Wiimote4.Two     // Button 2
key.8 = Wiimote4.Plus            // Insert Coin
key.4 = Wiimote4.A               // Player 4 Start
key.Enter = Wiimote4.Minus       // Enter
key.P = Wiimote4.Home            // Pause
Wiimote4.Led4 = 1                // Light the Remote 2 LED
key.F3 = Wiimote4.Plus + Wiimote4.Minus // Soft Reset
ESC = Wiimote4.B + Wiimote4.A    // Exit MAME

// Vibrate when inserting a coin
if (Wiimote1.Plus) then
   Wiimote1.Rumble = 1
   wait 100ms
   Wiimote1.Rumble = 0
   wait 500ms
end if

if (Wiimote2.Plus) then
   Wiimote2.Rumble = 1
   wait 100ms
   Wiimote2.Rumble = 0
   wait 500ms
end if

if (Wiimote3.Plus) then
   Wiimote3.Rumble = 1
   wait 100ms
   Wiimote3.Rumble = 0
   wait 500ms
end if

if (Wiimote4.Plus) then
   Wiimote4.Rumble = 1
   wait 100ms
   Wiimote4.Rumble = 0
   wait 500ms
end if

// Player 1 Classic Controller
Key.Up = Wiimote1.Classic.Up;          // Down
Key.Down = Wiimote1.Classic.Down;      // Up
Key.Left = Wiimote1.Classic.Left;      // Left
Key.Right = Wiimote1.Classic.Right;    // Right
Key.Up = Wiimote1.Classic.Joy1Y <= -25%
Key.Down = Wiimote1.Classic.Joy1Y >= 25%
Key.Left = Wiimote1.Classic.Joy1X <= -25%
Key.Right = Wiimote1.Classic.Joy1X >= 25%
Key.LeftControl = Wiimote1.Classic.y;  // Button 1
Key.LeftAlt = Wiimote1.Classic.b;      // Button 2
Key.Space = Wiimote1.Classic.x;        // Button 3
Key.LeftShift = Wiimote1.Classic.a;    // Button 4
Key.Z = Wiimote1.Classic.L;            // Button 5
Key.X = Wiimote1.Classic.R;            // Button 6
key.5 = Wiimote1.Classic.Plus          // Insert Coin
key.1 = Wiimote1.Classic.Minus         // Player 1 Start
key.P = Wiimote1.Classic.Home          // Pause

Comments 10 Comments »

The Widcomm drivers that come with the MSI Star Key work fine but it seems the drivers available from BlueSoleil work even better, especially with GlovePIE. The unfortunate part is that BlueSoleil 5.0.5 doesn’t work with the MSI Star Key…at least not without a little fiddling. This is a summary of information originally from this forum thread.

First, install BlueSoleil 5.05.

Next, plug-in the Star Key. You will need to get the USB Device ID from Windows Device Manager -> Bluetooth -> Devicename > Properties -> Details Tab -> Hardware IDs Dropdown.

For the MSI Star Key 2.0 version 222-BW, the device ID is: USBVID_0A5C&PID_2101

Now edit the following file:
C:Program FilesIVT CorporationBlueSoleildriverusbbtcusb.inf

At the bottom of the [ControlFlags] section, add the following line:
ExcludeFromSelect = USBVID_0A5C&PID_2101

At the bottom of the [Manufacturer] section, add the following line:
%MSI.DeviceDesc%=BTusb_DDI, USBVID_0A5C&PID_2101

Save this file and now edit:
C:Program FilesIVT CorporationBlueSoleilbttl.ini

Right near the top of the file, change NUM=111 to:

Near the bottom of the file, after ther [HW111] block, add the following:
Type=Bluetooth USB Dongle

Now when Windows prompts you for the device driver location for the MSI Star Key, select the C:Program FilesIVT CorporationBlueSoleildriverusbbtcusb.inf file and Windows will happily install the Bluesoleil driver.

Once the driver is installed, please reboot the computer before attempting to connect your bluetooth device.

As a side-note, I have had problems first installing BlueSoleil, uninstalling BlueSoleil, installing the Widcomm drivers, uninstalling Widcomm, re-installing BlueSoleil. Now I can’t seem to get my test system to recognize the MSI Star Key without having the Widcomm drivers installed. In practice though, changing drivers like this isn’t usually a good idea. Windows is pretty finicky that way. In general for this type of setup, I would recommend avoiding the Widcomm drivers all together and staying solely with BlueSoleil.

Update: I managed to get BlueSoleil working again on my test system.  After re-installing Widcomm and having the MSI Star Key working, I re-installed BlueSoleil and re-did the above steps.  Then in Device Manager, I manually changed the Star Key driver from the Widcomm to the BlueSoleil one and BlueSoleil was happy again.  I was then able to un-install Widcomm and BlueSoleil continues to work.

Comments Comments Off

This is a list of requirements for getting MAME going:
MAME. The current version of MAMEUI for Windows is being a bit problematic with the Wii remote. I’ve had to go back and use a slightly older version of MAME32 for proper functionality. MAME32 changed its named to MAMEUI since they were now making 64-bit versions and the MAME32 name was becoming mis-leading. I found MAME32 v.117 is the most recent version to work with the Wii controller. MAME is a free open-source project.

Two Wii Controllers. Being a slight Wii-nerd, this wasn’t a problem – I already have four. The Classic controller attachment can also be used for more complicated games like Mortal Kombat that use 6 buttons. I have one classic controller already but will probably end up getting a second one. FINISH HIM! Since so many arcades were built for two player simultaneous play, MAME is a great platform for two player games. Wii controllers cost $45 and a classic controller is $25.

Bluetooth PC adapter. Unless you already have bluetooth built-in to your computer, you will need a Bluetooth adapter. Bluetooth is a wireless communications standard that the Wii remote uses to talk both ways to the Wii. Fortunately with a little bluetooth magic, the Wii remotes can talk to a PC as well. I ended up buying an MSI Star Key 2.0 Bluetooth USB dongle due to the favourable reviews and compatibility with the Wii remote. I ordered it from Canada Computers since they had they best product and shipping prices. It was ordered on a Saturday and arrived on a Thursday – I’d say that is pretty good service. Cost including shipping: $37.25

Wii “driver” software. Software is needed to read the state of the Wii controller and send that back to the PC/MAME as commands. The best software for this seems to be GlovePIE – The Glove Programmable Input Emulator. Basically, GlovePIE works with various non-standard controllers or virtual reality devices and maps their states (ie: button 1 pressed) to keyboard commands. MAME maps these key presses to input in the game so pressing button 1 on the Wii remote pushes the fire button in the MAME game. Just the same, pressing left or right on the controller tells MAME to move your game character left or right. GlovePIE is a free project.

MAME Roms. Since MAME itself only emulates the hardware of the arcade, it requires the original arcade software to run. The arcade games of yester-year usually stored data on read-only memory chips. Thanks to some smart people, these chips have had their contents dumped to regular files that MAME can work with. Since the contents of these ROMS are under copyright, you will need to do some Google searching to find them.

Total cost of requirements: $37.25 (until I get another Classic controller).

Comments 1 Comment »

Since Carlos thinks I already spend too much time in the basement, I am preparing to add even more entertainment to Mediaportal. This time, the fun will be provided by MAME. MAME stands for Multiple Arcade Machine Emulator. In english, it means that it is a piece of software that lets you play “classic” arcade games on your computer. Mostly everything from the late 1970’s to the early 2000’s can be played. I used to spend a lot of time and a lot of quarters playing coin-op arcade games. Now with MAME, I will be able to play them on my TV in the basement.

Some people have gone out of their way to build authentic looking arcade cabinets for the classic arcade look and feel powered by MAME. Costco even sells an Ultimate Arcade 2 for a whopping $2400. I love the product but it’s quite a ways out of my price range. If I had the talent, I would build my own MAME arcade cabinet as the Ultimate Arcade 2 is basically a MAME system given a very fancy presentation.

However I do have some talents and Mediaportal has some MAME integration built-in. After some quick testing, I was playing Mario Bros. on the TV with the Harmony remote. The harmony is a wonderful device but it is certainly lacking as a game controller.

I spent some time looking at Logitech gamepads to power use as MAME controllers. They would work fine but the downside would be having to buy a couple of them plus USB extensions. I considered some wireless gamepads but again the problem of a lot of stuff to buy plus extensions. Then I had the most amazing thought…

I already have Nintendo Wii remotes – Could these be used to control MAME?? After some research and testing, the answer is YES! I read about similar setups where people were connecting the Wii remote to their PC via Bluetooth and the remote would work perfectly for MAME. I verified this by borrowing a bluetooth adapter from work and that weekend I was happily testing out MAME with the Wii Remote. It didn’t take me long before deciding to order my own Bluetooth PC adapter which arrived today!

This is going to be a tricky system to build and certainly won’t be “perfect”. However, it will be a lot of fun! Stay tuned for lots of tips and tricks on how I will be turning this project from an idea to reality.

Comments Comments Off

With all my talk about setting up Mediaportal and how awesome it is, I don’t think I ever went in to detail about what it actually does. Plus I’ve been a bit lazy with blog postings lately…

What the heck is Mediaportal? It’s a Windows application for managing all of your digital movies, tv shows, music and other forms of digital media.

Oh a Windows program, what’s the big deal then? The big deal is doing something a little out of the ordinary… Hooking the computer’s audio/video output in to my home theater’s input. Now things get interesting…

What about controlling the thing? The Logitech Harmony 880 remote to the rescue! That and a relatively cheap USB Infrared receiver for the computer and all the control is in my hand still using only a single remote for the entire home theater system.

Now the fun part – watching TV! Mediaportal gives a nice menu-driven interface to everything. A button push here and all my movies are ready to watch. Right now, I have about 90 movies online and ready for watching. Mediaportal lets you pick the movie by it’s covert art, title and you can can view the movie outline and rating with another button push. Get the popcorn ready and hit play…

Along with the movies, Mediaportal keeps a nice fancy interface to all the TV shows available. The episodes are broken down in to season categories and series/episode summaries are provided with nice shiny images as well. It even tracks what you’ve already watched.

Music, Internet radio, movies trailers, games, pictures & even more are available too. It’s quite an impressive system and the possibilities continue to grow. As for the cost… I was able to re-use Eva’s old PC – Despite being about 7 years old, it runs MediaPortal perfectly. The only new equipment I had to purchase was the IR receiver for $25 and then only needed a couple of really long audio/video cables – cost: $35. $60 in total – you can’t beat that!

Comments 3 Comments »

Haven’t updated the blog lately because Mediaportal is just too cool!  I’ll post some more details soon but this is the way home entertainment should be!

Comments Comments Off