Posts Tagged “mame”

Been running in to a few set backs with the ing of MediaPortal project.

Set back 1: Wii remote disconnects during game play.  Very frustrating.  Since the MediaPortal PC itself is in another room, I figured Bluetooth signal was getting interrupted.  I bought a 15ft USB extension cable and connected the Bluetooth dongle closer to the entertainment center and the disconnect problem went away.

Set back 2: Poor MAME support out of the box for MediaPortal.  The irony here is that MediaPortal actually has quite good MAME support out of the box.  The unfortunate part is that the “MyPrograms” plug-in that provides the MAME support has not been updated for a while, no longer has development and no longer works correctly with the recent versions of MediaPortal.  A bit of searching turned up a new plug-in called “MyProgramsAlt” which is another team’s effort at corrected and extending the now defunct MyPrograms.  I’ll try this our and see how it works.  Otherwise, I will use the “MyEmulators” plug-in which appears to be simple, functional but not quite as full-featured as MyProgramsAlt.

Set back 3: Pentium 3-1000 computers just aren’t as impressive as they used to be.  It does the trick for video playback but unfortunately it’s a bit too slow for many MAME games.  The true “classic” games like Mario Bros. run fine but more colourful games show a significant slow down.

Set back 4: Been taking a bit of a break from the hardcore nerd stuff to actually enjoying using MediaPortal rather than adding features.  I’ll get back in to it soon enough and I had the idea of trying to add the Daphne emulator to play laserdisc games like Dragon’s Lair with the Harmony remote.

I’m seeing a lot of hits to these articles coming from search engine queries.  If you have any questions about MediaPortal, MAME and Wii remote functionality, please leave a comment to help share the knowledge.

Comments Comments Off

So far my research has found that MAME versions greater than .117 (.118 and up) are not compatible with GlovePIE at all.  This seems to have something to do with GlovePIE’s support of multiple keyboards and how multiple keyboards were implemented after MAME .117.  I have yet to figure out any fixes or workarounds on my own nor have I found any solutions from other web pages or forums.

Fortunately JoyMonkey.com has an excellent archive of MAME versions.  If you want to GlovePIE to work, go download MAME .117 and you shouldn’t have any problems.

Comments 6 Comments »

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 WiiLi.org.

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:
NUM=112

Near the bottom of the file, after ther [HW111] block, add the following:
[HW112]
ID=USBVID_0A5C&PID_2101
Type=Bluetooth USB Dongle
DLL=DriverUSBbtcusb.dll
DLLD=DriverUSBbtcusbd.dll
Inffile=DriverUSBbtcusb.inf
Manufacture=MSI

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