2012-12-31, 04:29
How to get NES games to run in XBMC with Advanced Launcher
Many thanks to Anglescry and all the other's who have posted useful information in this forum. I wanted to give back, by sharing how I got my NES games to run under XBMC using advanced launcher. Also, you might need to check out my earlier post on - toshiba bluetooth - reconnectiong script for XBMC, too.
Overview:
To run NES games, it took several things to make it work. I used Nestopia emulator. Installed it an made sure I could run NES ROM files correctly using my keyboard. Then I made sure my wiimotes were properly connected with bluetooth to my XBMC PC. Next, I used Glovepie to configure the keystrokes that I would be sending from the 2 wiimotes I use to play NES gamess. Then I had to configure Nestopia inputs for gamepad1 and gamepad2 so it matches the keystrokes I was sending via glovepie. Then I used Autoit to activate and deactivate all the above in a script and then create a compiled EXE. That all went pretty well but when I tried to run the compiled exe with glovepie and nestopia stuff inside, I ran into the windows 7 UAC dialog window, that would only allow my exe to run if I clicked OK. I did not want to bypass security. I found a very complex routine that I could follow to manually set up a scheduled task with admin privs so I could click a shortcut to run the EXE. I was dreading that work, and then I found the UAC PASS utility program that did all the shortcut creation work for me. Lastly, I needed to set up a Advanced Launcher launcher for a shortcut! Angelscry saved the day again with a wonderful YouTUbe tutorial that showed me how to do it.
Hopefully, you can leverage my process to make your NES run in XBMC
Software used:
windows 7 professional 64 bit
Nestopia - 1.40
Download here.
GlovePIE - I used 0.43 without Emotiv support - click the "I already have 100% Green power, I'm ready to download GlovePIE." link to get to the download page
Auto it scripting tool - select the AutoIt Full Installation version, the first one, on the download page
Auto it editor - full version - the installer above contains a stripped down editor (missing help files and some helpful plug ins). Download and install the 2nd item on the download page, the AutoIt Script Editor.(Customised version of SciTE with lots of additional coding tools for AutoIt)
UAC PASS - Ver 1.7a - Download from here.
How to Do it:
Glovepie configuration:
With glovepie downloaded and unzipped, the package included a glovepie configuration file in the WiimoteScripts folder called 4PlayerNESClassic.PIE. Somehow for me, it did not work correctly so I cut it down and simplified it to handle 2 wiimotes without nunchuks (I may write a separate config file in the future so I can play Pac-man with a nunchuk as a joystick). Below is the config file I use. I called it 2PlayerNESClassic-RTW.PIE
2PlayerNESClassic-RTW.PIE
// 2 PLayer (since most games are two player) NES Script for Wiimote Only
//Player 1
// NES | Left | Up | Right | Down | Select | Start | B | A | B Turbo | A Turbo |
// WII | Up | Right | Down | Left | - | + | wii 1 | wii 2 | wii B | wii A | press wii-home to exit game
Wiimote1.Led1 = true
// Change orientation since Wiimote is on it's side
Key.Left = Wiimote.Up
Key.Up = Wiimote.Right
Key.Right = Wiimote.Down
Key.Down = Wiimote.Left
Key.Space = Wiimote.Minus // NES Select
Key.Enter = Wiimote.Plus // NES Start
Key.B = Wiimote.One // NES B
Key.A = Wiimote.Two // NES A
Key.Q = Wiimote.B // NES Turbo B
Key.W = Wiimote.A // NES Turbo A
Key.Alt+Key.X = Wiimote.Home // Have changed the nestopia.xml file so that Alt-X has replaced ESC to exit nestopia. Map to Wii home key, so we can exit
//Player 2
// NES | Left | Up | Right | Down | Select | Start | B | A | B Turbo | A Turbo |
// WII | Up | Right | Down | Left | - | + | wii 1 | wii 2 | wii B | wii A |
Wiimote2.Led2 = true
// Change key mapping and do not overlap between remotes
Key.L = Wiimote2.Up
Key.U = Wiimote2.Right
Key.R = Wiimote2.Down
Key.D = Wiimote2.Left
Key.1 = Wiimote2.Minus // NES Select
Key.2 = Wiimote2.Plus // NES Start
Key.3 = Wiimote2.One // NES B
Key.4 = Wiimote2.Two // NES A
Key.5 = Wiimote2.B // NES Turbo B
Key.6 = Wiimote2.A // NES Turbo A
Key.Alt+Key.X = Wiimote.Home // Have changed the nestopia.xml file so that Alt-X has replaced ESC to exit nestopia. Map to Wii home key, so we can exit
// End of PIE file
Nestopia configuration:
After installing Nestopia, there are some great instructions on Nestopia setup on this page - scroll about 2/3rds down on the page
Under Nestopia preferences, Be sure to click Switch to full screen on start and unclick Confirm Exit.
Then you need to set up how Nestopia responds to your wiimote keys. These will be Nestopia Gamepad1 and Gamepad2. When I set this up, I ran the glovepie config PIE file above and then used my two wiimotes to set up Nestopia.
The Hyperspin webpage shows how to do this. "From the Nestopia window, select Options>Input. ... You can change the input device and specific key mappings ... Select the key you want to change in the Mapping menu and click Set (highlighted in yellow) to set. Nestopia will wait 5 seconds for you to enter a new key. You can also click on Set All (next to Set) to set the entire mapping for that player's controls."
But, perhaps a better way to set up Nestopia is just to edit the nestopia.xml file directly. That file should be found in the same folder and nestopia.exe. Angelscry talks about this stuff here. (Note tho' we'll link up the games using shortcuts at the end). If you open the nestopia.xlm file in notepad, I first changed the Nestopia exit function to be triggered by Alt-X vs the escape key. I wanted to preserve the escape key to be what would exit everything and get me back to XBMC, if needed.
To do this, scan the nestopia.xml for this setting. Pick you own keystroke and again, I chose Alt X for mine.
<file>
<exit>Alt+X</exit>
<launcher>Alt+L</launcher>
Can edit file like this to automatically go to full screen
<run-background>no</run-background>
<start-fullscreen>yes</start-fullscreen>
<suppress-warnings>no</suppress-warnings>
You can manually set the gamepad1 and gamepad2 keystrokes by changing the nestopia.xml file like this, so it maps to what glovepie will be sending.
<pad-1>
<a>A</a>
<auto-fire-a>W</auto-fire-a>
<auto-fire-b>Q</auto-fire-b>
<b>B</b>
<down>Down</down>
<left>Left</left>
<mic>...</mic>
<right>Right</right>
<select>Space</select>
<start>Enter</start>
<up>Up</up>
</pad-1>
<pad-2>
<a>4</a>
<auto-fire-a>6</auto-fire-a>
<auto-fire-b>5</auto-fire-b>
<b>3</b>
<down>D</down>
<left>L</left>
<mic>...</mic>
<right>R</right>
<select>1</select>
<start>2</start>
<up>U</up>
</pad-2>
<pad-3>
Darn - too many words again. I will paste the 2nd part of this in my next post. Wish there was a way to get the limit temporarily raised.
How to get NES games to run in XBMC with Advanced Launcher - Part 2
See my post above for the 1st part of the steps needed to get this working.
Autoit Scripting:
The tricky part here is that you'll need to write an autoit script for each game you want to play. You'll create a compiled exe version of the game playing script. I put my autoit exe files in a NES games folder and then use UAC PASS to make a shortcut that does not need UAC ok to run. You can cut/paste that shortcut into your NES games folder that has the autoit compiled exe game files. Here's an example of one of my autoit game scripts. For your other ROMS, just edit the
Run('"E:\NES\NEStopia\nestopia.exe" "E:\NES\NEStopia\Games\Galaxian.zip"', "") line to your other ROMS' game file. Of course, change the paths to reflect your folder structure.
Galaxian.au3 starts below...
; Remember to copy the compiled executable exe file to the nestopia directory then use advanced launcher to link to the exe.
; this autoit script should launch glovepie and remap the 2 wiimotes to send new keypresses.
#requireadmin
Run('"E:\NES\GlovePIE\GlovePIE.exe" -"E:\NES\GlovePIE\WiimoteScripts\2PlayerNESClassic-RTW.PIE"',"")
;this is tricky. need to be able to pass ROM as arguement. Also, will use UAC PASS application, to create shortcut that bypasses UAC dialog
; then will add shortcut to this autoit compiled exe to advanced launcher.
Run('"E:\NES\NEStopia\nestopia.exe" "E:\NES\NEStopia\Games\Galaxian.zip"', "")
ProcessWaitClose("nestopia.exe")
ProcessClose("glovepie.exe")
; it seems like remotes go dead if glovepie closes, but running Dolphin wakes them up
Run("E:\Dolphin3.0-835\Dolphin.exe", "", @SW_MAXIMIZE) ;run dolphin for my current version - need to make path generic for the future
WinWaitActive("Dolphin 3.0-845-dirty") ;wait for 1st window to appear
; note: need to change the dolphin hotkey for pause from F10 to something else. in Dolphin - Options, Hotkey Settings, click on pause F10 Cell, then hit spacebar, then have 3 seconds to kepress the replacement you want. I chose control-p.
Send("{F10}") ;click on menu bar
Send("{RIGHT 2}") ;move to options
Send("{DOWN 5}") ; move to wiimote settings
Send("{ENTER}") ; click to open wiimote settings
Sleep(1000)
Send("{ENTER}") ; click to click OK and close wiimote settings
Send("!{F4}") ;close Dolphin app
Exit ; to exit the script
Using UAC PASS:
This software is cool and simple to use. Download and install it. This link explains how to use it.
I just dragged each of my autoit EXE game launching files and dropped it on the bottom window in UAC PASS. I used the option to have UAC PASS create the UAC free shortcut on my desktop. I then cut and pasted each of the shortcuts from the desktop and put it into the same GAMES folder where I stored each of my NES game's Autoit scripts and exe's, so had all three (the .au3, .exe and .lnk) files all in the same folder
Adding NES games to Advanced Launcher:
Lastly, Angelscry has this great youtube showing how to add a set of shortcuts as an advanced launcher. In his example, he has shortcuts to various browsers/URLs in the same folder. He uses advanced launcher to add shortcuts as items under a files launcher. I followed that same process. Also, that's why you need to put all the UAC PASS NES game shortcuts in the same folder. Once you follow Angelscry's procedure to set up the launcher, you just add each shortcut as a file and then scan / manually add the thumbnail and fan art, and you're good to go.
Many thanks to Anglescry and all the other's who have posted useful information in this forum. I wanted to give back, by sharing how I got my NES games to run under XBMC using advanced launcher. Also, you might need to check out my earlier post on - toshiba bluetooth - reconnectiong script for XBMC, too.
Overview:
To run NES games, it took several things to make it work. I used Nestopia emulator. Installed it an made sure I could run NES ROM files correctly using my keyboard. Then I made sure my wiimotes were properly connected with bluetooth to my XBMC PC. Next, I used Glovepie to configure the keystrokes that I would be sending from the 2 wiimotes I use to play NES gamess. Then I had to configure Nestopia inputs for gamepad1 and gamepad2 so it matches the keystrokes I was sending via glovepie. Then I used Autoit to activate and deactivate all the above in a script and then create a compiled EXE. That all went pretty well but when I tried to run the compiled exe with glovepie and nestopia stuff inside, I ran into the windows 7 UAC dialog window, that would only allow my exe to run if I clicked OK. I did not want to bypass security. I found a very complex routine that I could follow to manually set up a scheduled task with admin privs so I could click a shortcut to run the EXE. I was dreading that work, and then I found the UAC PASS utility program that did all the shortcut creation work for me. Lastly, I needed to set up a Advanced Launcher launcher for a shortcut! Angelscry saved the day again with a wonderful YouTUbe tutorial that showed me how to do it.
Hopefully, you can leverage my process to make your NES run in XBMC
Software used:
windows 7 professional 64 bit
Nestopia - 1.40
Download here.
GlovePIE - I used 0.43 without Emotiv support - click the "I already have 100% Green power, I'm ready to download GlovePIE." link to get to the download page
Auto it scripting tool - select the AutoIt Full Installation version, the first one, on the download page
Auto it editor - full version - the installer above contains a stripped down editor (missing help files and some helpful plug ins). Download and install the 2nd item on the download page, the AutoIt Script Editor.(Customised version of SciTE with lots of additional coding tools for AutoIt)
UAC PASS - Ver 1.7a - Download from here.
How to Do it:
Glovepie configuration:
With glovepie downloaded and unzipped, the package included a glovepie configuration file in the WiimoteScripts folder called 4PlayerNESClassic.PIE. Somehow for me, it did not work correctly so I cut it down and simplified it to handle 2 wiimotes without nunchuks (I may write a separate config file in the future so I can play Pac-man with a nunchuk as a joystick). Below is the config file I use. I called it 2PlayerNESClassic-RTW.PIE
2PlayerNESClassic-RTW.PIE
// 2 PLayer (since most games are two player) NES Script for Wiimote Only
//Player 1
// NES | Left | Up | Right | Down | Select | Start | B | A | B Turbo | A Turbo |
// WII | Up | Right | Down | Left | - | + | wii 1 | wii 2 | wii B | wii A | press wii-home to exit game
Wiimote1.Led1 = true
// Change orientation since Wiimote is on it's side
Key.Left = Wiimote.Up
Key.Up = Wiimote.Right
Key.Right = Wiimote.Down
Key.Down = Wiimote.Left
Key.Space = Wiimote.Minus // NES Select
Key.Enter = Wiimote.Plus // NES Start
Key.B = Wiimote.One // NES B
Key.A = Wiimote.Two // NES A
Key.Q = Wiimote.B // NES Turbo B
Key.W = Wiimote.A // NES Turbo A
Key.Alt+Key.X = Wiimote.Home // Have changed the nestopia.xml file so that Alt-X has replaced ESC to exit nestopia. Map to Wii home key, so we can exit
//Player 2
// NES | Left | Up | Right | Down | Select | Start | B | A | B Turbo | A Turbo |
// WII | Up | Right | Down | Left | - | + | wii 1 | wii 2 | wii B | wii A |
Wiimote2.Led2 = true
// Change key mapping and do not overlap between remotes
Key.L = Wiimote2.Up
Key.U = Wiimote2.Right
Key.R = Wiimote2.Down
Key.D = Wiimote2.Left
Key.1 = Wiimote2.Minus // NES Select
Key.2 = Wiimote2.Plus // NES Start
Key.3 = Wiimote2.One // NES B
Key.4 = Wiimote2.Two // NES A
Key.5 = Wiimote2.B // NES Turbo B
Key.6 = Wiimote2.A // NES Turbo A
Key.Alt+Key.X = Wiimote.Home // Have changed the nestopia.xml file so that Alt-X has replaced ESC to exit nestopia. Map to Wii home key, so we can exit
// End of PIE file
Nestopia configuration:
After installing Nestopia, there are some great instructions on Nestopia setup on this page - scroll about 2/3rds down on the page
Under Nestopia preferences, Be sure to click Switch to full screen on start and unclick Confirm Exit.
Then you need to set up how Nestopia responds to your wiimote keys. These will be Nestopia Gamepad1 and Gamepad2. When I set this up, I ran the glovepie config PIE file above and then used my two wiimotes to set up Nestopia.
The Hyperspin webpage shows how to do this. "From the Nestopia window, select Options>Input. ... You can change the input device and specific key mappings ... Select the key you want to change in the Mapping menu and click Set (highlighted in yellow) to set. Nestopia will wait 5 seconds for you to enter a new key. You can also click on Set All (next to Set) to set the entire mapping for that player's controls."
But, perhaps a better way to set up Nestopia is just to edit the nestopia.xml file directly. That file should be found in the same folder and nestopia.exe. Angelscry talks about this stuff here. (Note tho' we'll link up the games using shortcuts at the end). If you open the nestopia.xlm file in notepad, I first changed the Nestopia exit function to be triggered by Alt-X vs the escape key. I wanted to preserve the escape key to be what would exit everything and get me back to XBMC, if needed.
To do this, scan the nestopia.xml for this setting. Pick you own keystroke and again, I chose Alt X for mine.
<file>
<exit>Alt+X</exit>
<launcher>Alt+L</launcher>
Can edit file like this to automatically go to full screen
<run-background>no</run-background>
<start-fullscreen>yes</start-fullscreen>
<suppress-warnings>no</suppress-warnings>
You can manually set the gamepad1 and gamepad2 keystrokes by changing the nestopia.xml file like this, so it maps to what glovepie will be sending.
<pad-1>
<a>A</a>
<auto-fire-a>W</auto-fire-a>
<auto-fire-b>Q</auto-fire-b>
<b>B</b>
<down>Down</down>
<left>Left</left>
<mic>...</mic>
<right>Right</right>
<select>Space</select>
<start>Enter</start>
<up>Up</up>
</pad-1>
<pad-2>
<a>4</a>
<auto-fire-a>6</auto-fire-a>
<auto-fire-b>5</auto-fire-b>
<b>3</b>
<down>D</down>
<left>L</left>
<mic>...</mic>
<right>R</right>
<select>1</select>
<start>2</start>
<up>U</up>
</pad-2>
<pad-3>
Darn - too many words again. I will paste the 2nd part of this in my next post. Wish there was a way to get the limit temporarily raised.
How to get NES games to run in XBMC with Advanced Launcher - Part 2
See my post above for the 1st part of the steps needed to get this working.
Autoit Scripting:
The tricky part here is that you'll need to write an autoit script for each game you want to play. You'll create a compiled exe version of the game playing script. I put my autoit exe files in a NES games folder and then use UAC PASS to make a shortcut that does not need UAC ok to run. You can cut/paste that shortcut into your NES games folder that has the autoit compiled exe game files. Here's an example of one of my autoit game scripts. For your other ROMS, just edit the
Run('"E:\NES\NEStopia\nestopia.exe" "E:\NES\NEStopia\Games\Galaxian.zip"', "") line to your other ROMS' game file. Of course, change the paths to reflect your folder structure.
Galaxian.au3 starts below...
; Remember to copy the compiled executable exe file to the nestopia directory then use advanced launcher to link to the exe.
; this autoit script should launch glovepie and remap the 2 wiimotes to send new keypresses.
#requireadmin
Run('"E:\NES\GlovePIE\GlovePIE.exe" -"E:\NES\GlovePIE\WiimoteScripts\2PlayerNESClassic-RTW.PIE"',"")
;this is tricky. need to be able to pass ROM as arguement. Also, will use UAC PASS application, to create shortcut that bypasses UAC dialog
; then will add shortcut to this autoit compiled exe to advanced launcher.
Run('"E:\NES\NEStopia\nestopia.exe" "E:\NES\NEStopia\Games\Galaxian.zip"', "")
ProcessWaitClose("nestopia.exe")
ProcessClose("glovepie.exe")
; it seems like remotes go dead if glovepie closes, but running Dolphin wakes them up
Run("E:\Dolphin3.0-835\Dolphin.exe", "", @SW_MAXIMIZE) ;run dolphin for my current version - need to make path generic for the future
WinWaitActive("Dolphin 3.0-845-dirty") ;wait for 1st window to appear
; note: need to change the dolphin hotkey for pause from F10 to something else. in Dolphin - Options, Hotkey Settings, click on pause F10 Cell, then hit spacebar, then have 3 seconds to kepress the replacement you want. I chose control-p.
Send("{F10}") ;click on menu bar
Send("{RIGHT 2}") ;move to options
Send("{DOWN 5}") ; move to wiimote settings
Send("{ENTER}") ; click to open wiimote settings
Sleep(1000)
Send("{ENTER}") ; click to click OK and close wiimote settings
Send("!{F4}") ;close Dolphin app
Exit ; to exit the script
Using UAC PASS:
This software is cool and simple to use. Download and install it. This link explains how to use it.
I just dragged each of my autoit EXE game launching files and dropped it on the bottom window in UAC PASS. I used the option to have UAC PASS create the UAC free shortcut on my desktop. I then cut and pasted each of the shortcuts from the desktop and put it into the same GAMES folder where I stored each of my NES game's Autoit scripts and exe's, so had all three (the .au3, .exe and .lnk) files all in the same folder
Adding NES games to Advanced Launcher:
Lastly, Angelscry has this great youtube showing how to add a set of shortcuts as an advanced launcher. In his example, he has shortcuts to various browsers/URLs in the same folder. He uses advanced launcher to add shortcuts as items under a files launcher. I followed that same process. Also, that's why you need to put all the UAC PASS NES game shortcuts in the same folder. Once you follow Angelscry's procedure to set up the launcher, you just add each shortcut as a file and then scan / manually add the thumbnail and fan art, and you're good to go.