2014-01-16, 06:01
This thread is a WIP and will be updated as I have time to include and write more info
.With this guide you will be able to launch games and emulated games much more "seemlessly".
Requirements:
- Keyboard ( although you could manually add everything to the launchers.xml config )
- ADB
- A rooted android device
( NOTE: Technically most arg's being passed could be done without root... )
- XBMC installed ( official or spmc... I haven't tried with a gotham build )
- Advanced Launcher plugin for XBMC http://forum.xbmc.org/showthread.php?tid=85724
OR
- Rom Collection Browser
- A reasonable text editor ( If on windows - Notepad++ )
ADVANCED LAUNCHER
1.) Install Advanced Launcher
Copy over the Advanced Launcher plugin to the OUYA and install it ( You can install it by going to Settings -> Add-Ons -> Install From Zip File )
2.) Create a new category
Load the addon and with a keyboard press "c", which will open a popup. Choose "Create New Category" and call it "Emulation".
3.) Create a "launcher"
Open the newly created category which should prompt you to create a new launcher. Select "Files Launcher" and go through the menus ( select the launcher application [ su or am... ], select files path [ where the games are stored ] and set file extensions [ look at the example it gives ] )
At "Application Arguments" leave it as default ( due to a scroll limit you can't see what to type... we will modify this later )
Continue with the setup ( Set title of launcher [ typically label of system ], select platform [ which system you are emulating ], set thumbnails path and set fanart path )
4.) Adding the correct arguments
Pull launchers.xml from:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/userdata/addon_data/plugin.program.advanced.launcher/launchers.xml
Open launchers.xml and under "launchers" look for the emulator you added ( this would be the name you chose when you set the title of the launcher ) and you should see the following line:
Code:
<args>"%rom%"</args>
Change it to represent one of the arguments found in the 3rd post. for example purposes here's what the line would look like if I were setting up the Reicast:
Code:
<args>start -n com.reicast.emulator/.GL2JNIActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"</args>
Save it and push it back to the location it was pulled from.
5.) Reload XBMC ( or just the script )
Once you reload you should be able to add games... to add games hit the "c" key on your keyboard with the emulator highlighted and select "Add items". Select any game(s) you wish to add.
Afterwards you should be able to launch the games from Advanced Launcher
ROM COLLECTION BROWSER
Install RCB like you would any addon.
In order to get RCB to work there's a few changes that have to be made... 2 files to be specific.
1.) applaunch.sh
located at:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/userdata/addon_data/script.games.rom.collection.browser/scriptfiles/applaunch.sh
Code:
/sdcard/Android/data/org.xbmc.xbmc/files/.xbmc/addons/script.games.rom.collection.browser/resources/scriptfiles/applaunch.sh
You'll need to comment out the following lines:
Code:
case "$(uname -s)" in
Darwin)
XBMC_PID=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $1}')
XBMC_BIN=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $5}')
;;
Linux)
XBMC_PID=$(pidof xbmc.bin)
XBMC_BIN="xbmc"
;;
*)
echo "I don't support this OS!"
exit 1
;;
esac
Save it and push it back to the same location we pulled it from.
2.) launcher.py
located at:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/addons/script.games.rom.collection.browser/resources/lib/launcher.py
Comment out:
Code:
if(isFullScreen):
Logutil.log("Toggle to Windowed mode", util.LOG_LEVEL_INFO)
#this minimizes xbmc some apps seems to need it
try:
xbmc.executehttpapi("Action(199)")
except:
xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"togglefullscreen"},"id":"1"}')
toggledScreenMode = True
Code:
pre launch command
if(precmd.strip() != '' and precmd.strip() != 'call'):
Logutil.log("Got to PRE", util.LOG_LEVEL_INFO)
os.system(precmd.encode(sys.getfilesystemencoding()))
preDelay = settings.getSetting(SETTING_RCB_PRELAUNCHDELAY)
if(preDelay != ''):
preDelay = int(float(preDelay))
xbmc.sleep(preDelay)
Modify:
Code:
if(romCollection.usePopen):
import subprocess
subprocess.Popen(cmd.encode(sys.getfilesystemencoding()), shell=True)
else:
os.system(cmd.encode(sys.getfilesystemencoding()))
Code:
if(romCollection.usePopen):
import subprocess
subprocess.Popen(cmd.encode('utf-8'), shell=True)
else:
os.system(cmd.encode('utf-8'))
Comment out:
Code:
postDelay = settings.getSetting(SETTING_RCB_POSTLAUNCHDELAY)
if(postDelay != ''):
postDelay = int(float(postDelay))
xbmc.sleep(postDelay)
post launch command
if(postcmd.strip() != '' and postcmd.strip() != 'call'):
Logutil.log("Got to POST: " + postcmd.strip(), util.LOG_LEVEL_INFO)
os.system(postcmd.encode(sys.getfilesystemencoding()))
Save it and push it back to the same location we pulled it from.
3.) Create a "Rom Collection"
Hit the "U" button ( or "C" key on a keyboard ) on your OUYA controller, this will open a menu... select "Add Rom Collection".
Fill out all the info ( how you want to select info/artwork, what console, location of emulator ( su or am... )
On the "Emulator params" just select the default for now... we will modify this afterward.
Continue on in the setup... ( path to the roms, what file mask [ in otherwords which extensions to look for... look at the example it gives ] and lastly select a location for the artwork )
4.) Adding the correct emulator arguments
Pull config.xml from:
Code:
/sdcard/Android/data/com.semperpax.spmc/files/.xbmc/userdata/addon_data/script.games.rom.collection.browser/config.xml
Open config.xml and under the rom collection you created... look for the following line:
Code:
<emulatorParams>"%ROM%"</emulatorParams>
Change it to represent one of the arguments found in the 3rd post. for example purposes here's what the line would look like if I were setting up the SNES:
Code:
<emulatorParams>start -n com.explusalpha.Snes9xPlus/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%ROM%"</emulatorParams>
Save it and push it back to the same location we pulled it from.
5.) Reload XBMC ( or just the script )
After you reload you should be able to launch the games without a problem.
There are some arguments that will require root and others that do NOT require root... If theres a root/nonroot option I will list both.
If the argument is non-root required, for the "application" use /system/bin/am
If the argument is root required, use /system/xbin/su for the "application"
-=Emulator Arguments=-
2600.EMU:
non-root:
start -n com.explusalpha.A2600Emu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Ataroid:
non-root:
start -n com.androidemu.atari/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
C64.EMU:
non-root:
start -n com.explusalpha.C64Emu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
DraStic:
non-root:
start -n com.dsemu.drastic/.DraSticActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e GAMEPATH "%rom%"
ePSXe:
non-root:
start -n com.epsxe.ePSXe/.ePSXe -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e com.epsxe.ePSXe.isoName "%rom%"
FPSE: ( NOTE: can be rather....buggy... also will only work in nobios mode )
non-root:
start -n com.emulator.fpse/.Main -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e path "%rom%"
GameBoid:
non-root:
start -n com.androidemu.gba/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
GBA.EMU:
non-root:
start -n com.explusalpha.GbaEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
GBC.EMU:
non-root:
start -n com.explusalpha.GbcEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
GBCoid:
non-root:
start -n com.androidemu.gbc/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Gearoid:
non-root:
start -n com.androidemu.gg/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Gensoid:
non-root:
start -n com.androidemu.gens/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
MD.EMU:
non-root:
start -n com.explusalpha.MdEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
MSX.EMU:
non-root:
start -n com.explusalpha.MsxEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
Mupen64Plus AE Free 2.4.4: ( playstore )
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plus.free/paulscode.android.mupen64plusae.PlayMenuActivity'
Mupen64Plus AE: ( ouya discovery )
non-root: ( will load the emulator menu with the correct rom selected )
start -n paulscode.android.mupen64plusae/.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
root: ( will first load the emulator with the correct rom and then reload to the play menu to either resume where you last left off on your game or restart the emu so the game is at first boot )
-c 'am start -n paulscode.android.mupen64plusae/.MainActivity -a android.intent.action.VIEW -eu Uri "file://%rom%" && am start -S -n paulscode.android.mupen64plusae/.PlayMenuActivity'
N64oid:
non-root:
start -n com.androidemu.n64/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NEO.EMU:
non-root:
start -n com.explusalpha.NeoEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NES.EMU:
non-root:
start -n com.explusalpha.NesEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NESoid:
non-root:
start -n com.androidemu.nes/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
NGP.EMU:
non-root:
start -n com.explusalpha.NgpEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
PCE.EMU:
non-root:
start -n com.PceEmu/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
PPSSPP:
non-root:
start -n org.ppsspp.ppsspp/.PpssppActivity -e org.ppsspp.ppsspp.Shortcuts "%rom%"
Reicast:
non-root:
start -n com.reicast.emulator/.GL2JNIActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
RetroArch: ( example using PS1 )
non-root:
start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "%rom%" -e LIBRETRO /data/data/com.retroarch/cores/pcsx_rearmed_libretro_neon_android.so -e CONFIGFILE /data/data/com.retroarch/retroarch.cfg -e IME tv.ouya.console.ime.keyboard/.OUYAKeyboard -n com.retroarch/.browser.retroactivity.RetroActivityFuture
( for the other emulator cores just point to the appropriate libretro*.so )
Snes9x EX+:
non-root:
start -n com.explusalpha.Snes9xPlus/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
SNesoid:
non-root:
start -n com.androidemu.snes/.EmulatorActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
SuperGNES lite:
non-root:
start -n com.bubblezapgames.supergnes_lite/.SuperGNES -a android.intent.action.VIEW -eu Uri "file://%rom%"
-=Game Arguments=-
coming soon...