EmulatorsPlugIn
From AwkwardTV
Contents |
[edit] Author
bgan1982@mac.com (Ben)
--Bgan1982 08:57, 28 June 2008 (CEST)
[edit] Purpose
I set out to create a plugin that would give me a clean front end for launching emulators from appletv 2.0's interface. It works similarly to the way the AppLauncher plugin worked for the 1.0 interface.
Other than the name of the plugin and the current way of hard coding its category list, there is nothing to prevent this from being modified to serve as a more general purpose application launcher for appletv 2.0.
[edit] Download Links
[edit] Installation Instructions
- Install the latest versions of the following emulators in the following places on your appletv:
- /Applications/Boycott Advance.app
- /Applications/Genesis Plus.app
- /Applications/Mugrat.app
- /Applications/Nestopia.app
- /Applications/sixtyforce.app
- /Applications/zsnes.app
For additional features with some of these emulators, also install:- /Users/frontrow/Application Support/EmulatorEnhancer.bundle
- /Applications/Boycott Advance.app
- (Optional) In step 3, you will need to run these emulators a first time before getting them to work with the plugin. To this end, I have created a shell script to toggle the Finder on/off [1]. Make sure it is executable, and install this somewhere in your
$PATH. For instance,- /usr/bin/toggleFinder
In addition, add the following to your /etc/rc.local file, so that the Finder will always run when your appletv is rebooted:
# Make sure Finder.app is active upon startup
/usr/bin/toggleFinder -t
if [ $? -ne 0 ]; then /usr/bin/toggleFinder; fi
Note: The toggleFinder script also requires killall to be installed somewhere in your path.
- Using VNC, MouseLocator, and ssh, launch and configure each of the emulators to have the proper settings. For instance, using my optional script from step 2,
[frontrow@AppleTV:~] $ toggleFinder
Password:
toggleFinder: Switching Finder ON -> OFF
toggleFinder: Killing Finder
[frontrow@AppleTV:~] $ open -a Nestopia
<Use VNC to setup the correct preferences, then choose Quit>
[frontrow@AppleTV:~] $ toggleFinder
toggleFinder: Switching Finder OFF -> ON
toggleFinder: Launching Finder
For the emulators' settings, make them appear full screen when ROMs are loaded, but make sure you DO NOT check change resolution because this causes problems. If you have a USB controller, configure it now. Make sure they exit cleanly using "Quit", so their preferences are retained. If watchdog reboots your appletv, that means you took too long.
Note: If you'd like, follow the directions to disableAppleTCOWatchdog.kextto prevent unwanted automatic reboots, but I'd recommend re-enabling this after step 3 is complete.
- Copy the ROMs you wish to install into the following directory structure on your appletv:
- /Users/frontrow/ROMs/Coleco
- /Users/frontrow/ROMs/GBA
- /Users/frontrow/ROMs/Genesis
- /Users/frontrow/ROMs/N64
- /Users/frontrow/ROMs/NES
- /Users/frontrow/ROMs/SNES
- /Users/frontrow/ROMs/Coleco
- Install the Emulators.frappliance to your appletv PlugIns folder:
- /System/Library/CoreServices/Finder.app/Contents/PlugIns/Emulators.frappliance
- Restart the Finder.
[edit] Usage
This plugin is pretty self-explanitory. Just select the Emulator you wish to run and it will bring up a ROM list. Select the ROM and it will launch the emulator. Press the play button while the emulator is running in order to quit. This brings you back to the main menu.
[edit] Configuration
If you would like to add or remove emulators from this plugin, here is how modify the category list:
Open up Emulators.frappliance/Contents/Info.plist in a text editor, which is the XML file that populates the category list. If you are new to XML and write modify this file incorrectly, it will probably break the plugin, so you may want to work with a backup. You can add a new category by adding a new <dict></dict> tag inside the FRApplianceCategoryDescriptors <array>. Here are what the different keys mean:
- identifier: The executable name of the emulator, which at the moment cannot contain any spaces (I have a work around hard coded into the rungame.sh script for Boycott Advance and Genesis Plus).
- name: The system name that appears in the category list and at the top of the ROM listing.
- path: The full path to ROMs folder for the current system.
- preferred-order: A real number which gives the order of the categories; make sure these are unique.
[edit] Known Bugs
If you can hear the emulator but not see it, then unfortunately you need to try launching it again. When this happens, just fondly think back to all the time you spent getting your 8-bit nintendo cartridges to work without producing a similar blinking screen.
I've also put in a hook to the RIGHT remote button which reloads the screen while the emulator is running, but alas this usually doesn't get it to appear on top.
[edit] Future Work
- Stop the dreaded "blink back to menu" behavior. There is some kind of race condition which prevents the emulators from appearing on top of the appletv menu, depending on the timing of the BRDisplayManagerStopRenderingNotification notification.
- Filter out hidden files from ROM list
- Populate category list from external plist file for user customizable configurations
- Eliminate the rungame.sh script and use NSWorkSpace to access LaunchServices instead
[edit] Version History
- 1.0 6/27/08 Initial Release
[edit] License
This plugin and its source code are free to all. You may modify it to your liking, but I would still like to maintain any "official" releases. This software comes with no implied warranty, and I am not responsible for any damages.
[edit] Acknowledgements
I was only able to write this plugin by being able to view and tinker with publicly available source codes of many other appletv plugin projects. Many thanks go out to the developers of the following projects:
- AppLauncher
- atvfiles
- FRAppliance200
- iscripts
- sapphire
