--- /dev/null
+package FIXME_PACKAGE;
+
+import de.cweiske.ouya.romlauncher.LaunchSnesActivity;
+
+public class LaunchRomActivity extends LaunchSnesActivity
+{
+ protected String getAssetFilename()
+ {
+ return "FIXME_FILENAME";
+ }
+}
Generic OUYA SNES game launcher
*******************************
Based on this code you can pack up a SNES game and make it
-available in the OUYA launcher, just as a normal game.
+directly available in the OUYA launcher, just as a normal game.
When running it, the game file is extracted and
`Snes9x EX+`__ is started with it.
__ http://www.explusalpha.com/home/snes9x-ex
-Configuring
-===========
-Things to adjust:
+Packing a game
+==============
+Run ``prepare-game.sh``::
-- Put the game file into ``assets/game/``
-- Replace ``FIXME_ASSETFILENAME`` in
- ``src/de/cweiske/ouya/gamelauncher/LaunchGameActivity.java``
- with the game file name (name, not path).
-- Replace ``FIXME_GAMETITLE`` in ``AndroidManifest.xml`` with
- the game's name.
-- You should also adjust the package path, otherwise one game
- overwrites the other
+ $ ./prepare-game.sh "Super Pac-Man" superpacman ~/public-domain/superpacman.smc
+ Game title: Super Pac-Man
+ Full package path: romlauncher.superpacman
+ Game file: superpacman.smc
+ All prepared.
+ Put a 732x412 image into res/drawable-xhdpi/ouya_icon.png
+
+Now adjust the launcher image ``ouya_icon.png`` and build/run it
+with the Android Developer Tools Eclipse IDE.
+
+The generated ``.apkg`` file will be located in the ``bin/`` folder.
--- /dev/null
+#!/bin/sh
+set -e
+
+#clean up from last run
+./cleanup.sh
+
+if [ $# -lt 3 ]; then
+ echo "Usage: ./prepare-game.sh title java.package path-to-game.smc"
+ exit
+fi
+
+title=$1
+package=$2
+fullpackage="romlauncher.$package"
+filepath=$3
+filename=`basename "$filepath"`
+
+echo "Game title: $title"
+echo "Full package path: $fullpackage"
+echo "Game file: $filename"
+
+#prepare manifest
+sed -i\
+ -e "s/FIXME_PACKAGE/$fullpackage/" \
+ -e "s/FIXME_TITLE/$title/" \
+ AndroidManifest.xml
+
+#copy game
+cp "$filepath" assets/game/
+
+#prepare launcher
+mkdir -p "src/romlauncher/$package"
+sed -e "s/FIXME_PACKAGE/$fullpackage/"\
+ -e "s/FIXME_FILENAME/$filename/"\
+ LaunchRomActivity.java.tpl\
+ > src/romlauncher/$package/LaunchRomActivity.java
+
+echo "All prepared."
+echo "Put a 732x412 image into res/drawable-xhdpi/ouya_icon.png"