Play SNES Games On Your iPad Without Jailbreaking

May 23rd, 2011
Spencer Nielsen Follow snielsen42 on Twitter

Apple gets a lot of flack over its curated app distribution model. No matter what your opinion on the subject is there is no doubt that for Apple’s model to have any sort of success it needs to be the only commercially realistic distribution avenue on the platform. This leads many people to jailbreak their devices for a variety of different reasons. Lets examine just the motivation of wanting to personally use non-App Store approved apps. The argument is then almost always framed as a dichotomy. I can jailbreak and get access to apps that Apple cannot or will not approve but risk damaging the device, violating warranty/support expectation, losing the ability to directly update to the latest OS version and introducing instability. Or I could keep my device in a stock configuration that will ensure stability and a clean upgrade path but miss out on some truly awesome and useful jailbroken apps out there. People don’t often remember that there is actually a third way to load apps onto your iOS device that has its own set of unique pros and cons. Apple fully supports loading apps on stock devices outside of the App Store through its developer program.

Batteries Not Included, Some Assembly Required

Apple’s developer program allows you to create code that will execute on stock iOS devices by enrolling in their program, obtaining a signing certificate and building the app from source. The obvious upside to this method of loading apps is that you maintain the security and stability of your OS as a whole and still get to experience a subset of the jailbroken apps out there. The downsides are:

  • You need to pay $99 a year to generate signing certificates
  • You need to build the apps yourself from source (if it is even available)
  • The apps you build have to be OK with being sandboxed (although you still get to use private API)
  • You need to re-build/load every time your provisioning profile expires.

Obviously not a great solution for app producers but it is a decent one for technically inclined app consumers.

SNES-HD-

About a year ago a story about a SNES emulator on the iPad made the rounds on a lot of sites and caused a lot of excitement. I was pretty excited too until I found out that it required a jailbroken iPad. I forgot about it until the other day when I randomly ran into a page linking to the SNES-HD- source code. I grabbed the source and started poking around. Unfortunately it clearly stated in the documentation that the source would only build for jailbroken devices. However, I wondered just how much of the source was really jailbroken specific and how much work it would be to make changes so that it would build and run as if I were going to submit it to Apple’s App Store. It turns out that it’s not that much.

How To Get It Working Yourself

I have created a patch and script that will create everything for you automatically and set you up so that you can just build, run and go. You are going to need a current copy of Apple’s Developer Tools (tested with Xcode 3.2.6) and a copy of the iOS SDK (my changes assume the 4.3 SDK). You will need to be a paid iOS developer with Apple and have correctly configured your development machine and iOS device so that you can sign code and run said code on your device. You will also need a copy of git installed on your machine.

  • Download nonjailbrokensnes.zip
  • cd nonjailbrokensnes
  • ./makenonjailbroken.sh
  • Place all your awesome homebrew roms into the “SNES–HD-/ROMs” directory
  • Open “SNES4iPad.xcodeproj“, build for “Device” and run

You now have a working (has some crashes and other bugs, but is serviceable) SNES emulator on your non-jailbroken iPad. Don’t forget to also build and run the ControlPad app on an iPhone/iPod Touch so that you can actually play your games. Note that the patch applied here will change the project to build through the standard Apple Developer Tools process and it will no longer build as it did for jailbroken devices. It is really just a quick and dirty hack and so it isn’t perfect but it gets the job done.

UPDATE: Want to play arcade games on your iPad/iPhone without jailbreaking as well? Check out my new blog post on how to patch the imame4all project to run on non-jailbroken devices.

UPDATE: I should also clarify that there aren’t any significant modifications needed for the ControlPad app to get it to run on non-jailbroken devices. Thankfully getting that up and running is pretty easy 🙂

UPDATE: Riley Testut has forked the original SNES-HD- project into a new project called SNES4iOS which integrates the changes from my patch to enable it to build for non-jailbroken devices (even on Xcode 4) and also integrates some additional features.

17 Responses to “Play SNES Games On Your iPad Without Jailbreaking”

  1. El'Pingo Says:

    It doesn’t seem to work for me. If I decompose the “makenonjailbroken” file, the “git apply ../nonjailbroken.patch” return me a bunch of text (included after the break) and the make command doesn’t make anything (make: command not found).

    Did I do something wrong ?

    —–

    ../nonjailbroken.patch:96: trailing whitespace.

    ../nonjailbroken.patch:336: trailing whitespace.
    VERSION=4.3
    ../nonjailbroken.patch:337: trailing whitespace.
    COPT = -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/Frameworks -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/PrivateFrameworks -I../../ -I../../Classes/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/gcc/arm-apple-darwin9/4.2.1/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/lib -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/include/
    ../nonjailbroken.patch:338: trailing whitespace.
    COPT += -march=armv7-a -miphoneos-version-min=${VERSION} -I. -O3 -D__IPHONE__ -D_SNESPPC -DASM_SPC700 -DZLIB -DUNZIP_SUPPORT -DOLD_COLOUR_BLENDING -DUSE_SA1 -DSUPER_FX -DLSB_FIRST -DCPU_SHUTDOWN -DVAR_CYCLES
    ../nonjailbroken.patch:346: trailing whitespace.
    main.o:
    warning: squelched 2182 whitespace errors
    warning: 2187 lines add whitespace errors.

    —–

  2. snielsen Says:

    That output is the expected output after you apply the git patch and so that part is correct.

    So it can’t find the make command right? Do you have a full install of Apple’s developer tools? What happens if you try to run the “make” command all by itself?

  3. Tim Says:

    Compiles fine with XCode 4 for those interested. Does the ControlPad app compile on normal dev (or have you created a patch)?

  4. Tim Says:

    Answering my own question ControlPad does compile fine (though you have to delete reference to a missing coordinates plist file)

  5. snielsen Says:

    I should probably mention that the ControlPad does not require significant modification to run correctly 🙂 Thanks! (Updated Post)

  6. UuUu Says:

    Using the latest version of Xcode and I cannot get this to work. make cannot find the compiler. When I change the compilers to the following, make fails with horrible errors.
    arm-apple-darwin10-llvm-gcc-4.2
    arm-apple-darwin10-llvm-g++-4.2

  7. snielsen Says:

    The source needs to be compiled with gcc 4.2 which might have been removed from the latest version of Xcode 4 (Apple has mentioned that they are moving away from supporting it). For the time being you can still download Xcode 3.2.6 and the iOS 4.3 SDK from developer.apple.com. To get the source to work with toolsets moving forward someone might just need to look at it and make patches to the source to get it to compile with the more modern compilers.

  8. UuUu Says:

    A patch for modern compilers would be fantastic. Would it make sense for someone to set up a “developer’s version” project for this software? I’m using the latest tools on a box that is running out of space, so I’d rather not have two Xcode installs.

  9. Thomas Says:

    Just out of curiousity, will this work on iPod Touch or iPhone?

  10. Gareth Says:

    I have this building under Xcode 3.2.6 against iOS 4.3 Base SDK running against on an iPad 2 running iOS 5.0.1, it works but drawing frames seems to have artefacts, for instance if Mario runs across the screen in Mario World for each frame seems to leave a series of artefacts from the previous frame as though its not clearing the frame correctly as it flips. Have been trying to understand what might be going on, so will let you know if I find anything.. Have you encountered anything similar with this hardware?

    Apart from that its great! And thank you for making the code available

  11. César Says:

    I built this and made it work for iOS 5.0.1 swell, and as Gareth says there are artifacts when the frame is updated… 🙁

    Anyone got an idea how to fix this?

  12. uurf Says:

    I can’t get it to build- lots of warnings, one fatal:

    ld: warning: directory not found for option ‘-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/PrivateFrameworks’
    ld: warning: directory not found for option ‘-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/PrivateFrameworks’
    ld: library not found for -lpocketsnes
    Command /Developer/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

    any thoughts?

  13. snielsen Says:

    @Thomas The source only supports iPad at the moment.

    @Gareth, @Cesar I have only tested on iOS 4.3 and I did not notice any frame artifacts. I will try to find some time to test on 5.0.1. One thing you might want to look into is a fork of the original project that incorporates some of my jailbreak workarounds (https://github.com/iSkythe/SNES4iOS). The author seems to be pretty active in adding new features and making things work smoother.

    @uurf It looks like you are using Xcode 4. The patch has only been tested with Xcode 3.2.6 (although I have heard of varying levels of success on Xcode 4 after hacking around a bit).

  14. Ben Says:

    Xcode 4.3+ has removed GCC and will only install Clang directly (their version of GCC) if you go to XCode > Preferences > Download Tab > Install “Command Line Tools”

    This sounds pretty neat, will have to check it out so I can rub it in my Droid-having-SNES-emulator-downloaded-off-the-app-marketplace-having-friends noses

  15. Big Al Says:

    I have the same errors as uurf, is there by any chance a workaround for 4.3 yet?

  16. David Says:

    Does someone have a working ipa, so others would only need to ReSign it (via iReSign f.ex.) ?

  17. landers Says:

    please release .ipa with dist .mobileprovision so non-ios developers can benefit from this awsomeness

Leave a Reply

Entries (RSS) and Comments (RSS).