Emulation on Mac

Emulating classic video game consoles on Mac OS X

PSP emulation using PPSSPP 0.9.9.1 on Mac OS X 10.10.1 (with MacPorts instead of HomeBrew)

This fantastic open-source emulator of PSP runs on basically everything, but it’s a little harder to get working on Mac OS X. At least the main site now hosts compiled binaries for OS X, which is an improvement from not too long ago when the only binaries available were on a third party build site. We no longer have to run the Windows version under a Wine wrapper. Things have come a long way.

But you still have to download and install a dependency first: the SDL runtime (Simple DirectMedia Layer), because the developer follows the Linux philosophy of no statically linked libraries (“make it the user’s problem to try to recreate the exact dynamic library setup that the developer used through trial-and-error!”).

There are directions for installing SDL if you use Homebrew as your package manager. I don’t, though. I use MacPorts. The two are mutually exclusive, and would interfere with each other if you were to try using them together. So this post is about how to get PPSSPP working if you are a MacPorts user.

First, I assume you’ve gotten XCode from the App Store, opened it to download the XCode command line tools, and then installed MacPorts. If you run the following commands, you can correctly set up the LibSDL dependency.

sudo port install libsdl
sudo ln /opt/local/lib/libSDL-1.2.0.dylib /usr/local/lib/libSDL-1.2.0.dylib
sudo ln /opt/local/lib/libSDL.a /usr/local/lib/libSDL.a
sudo ln /opt/local/lib/libSDL.dylib /usr/local/lib/libSDL.dylib
sudo ln /opt/local/lib/libSDLmain.a /usr/local/lib/libSDLmain.a

Do you get an OS X CrashWrangler bug report dialog, saying it crashed because it couldn’t find “/usr/local/lib/libSDL-1.2.0.dylib”? You might have not created the aliases correctly in /usr/local/lib. Do you get a “Segmentation fault: 11” with a thread that crashes in the pthread library, while the main thread is trying to call SDL_SetVideoMode() from its own SDL_Main()? Then you probably aliased libSDL-1.2.0.dylib correctly, but messed up the others. I did that once. Woops.

Why is PPSSPP not statically linked to its dependencies? Why does it not save user data in the right place (it will save your games in a hidden folder, very non-Mac like: you’ll have to open up “/Users/your_name/.config/PPSSPP/” to find your save files, the ini files where you enter per-game cheats, etc.)?

Building from source:

If you would rather build PPSSPP from source yourself, try these steps (using MacPorts):

sudo port install cmake    # because the build process needs cmake
git clone https://github.com/hrydgard/ppsspp.git ppsspp_dev
cd ppsspp_dev
git submodule update –init   # their wiki instructed to do this (?)
git submodule update             # seemed to do nothing (?)
mkdir build-osx-fat
cd build-osx-fat
cmake /path/to/ppsspp_dev
make
./PPSSPPSDL

If you did want to put MacPorts aside and try HomeBrew just for a minute, and only to install SDL:

sudo rm /usr/local/lib/libSDL*  # delete the hard links to the MacPort version of SDL
ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)”   #ugh, it chowns /usr/local to non-root! stupid!
brew doctor   # sure enough, it warns me that I will have a ton of problems because I use MacPorts
sudo mv /opt/local ~/Desktop/macports     # move all my MacPorts-installed packages somewhere safe, temporarily
export PATH=/usr/local/sbin:$PATH          # temporarily add this to the PATH because HomeBrew wanted me to.
brew install sdl

And then to get rid of HomeBrew again and go back to using MacPorts, you would do this:

brew remove sdl
cd `brew –prefix`    # puts me in /usr/local
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
sudo mv ~/Desktop/macports /opt/local   # restore MacPorts
sudo chown -R root:wheel /usr/local     # undo the security damage to the permissions that HomeBrew’s installer did.

Advertisements

4 responses to “PSP emulation using PPSSPP 0.9.9.1 on Mac OS X 10.10.1 (with MacPorts instead of HomeBrew)

  1. Brandon September 1, 2014 at 10:27 am

    Thanks for this guide. I got it built and it works great except when I try to resize or make the window full screen…any ideas?

  2. robocalypse September 2, 2014 at 7:02 am

    You’re welcome, but, I don’t have any solutions for those bugs, sorry. I don’t work on the project; I just wanted to help people with my specific environment get it to build and run.

  3. PG November 19, 2014 at 5:45 am

    I appreciate this post. I wanted to let you know and share I have MacPorts installed on Yosemite and I followed your directions and it worked well. Except for some reason my target path needed to have ‘/local/’ removed. Thanks a lot.

  4. yan li October 4, 2016 at 10:44 pm

    This solved my problem. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: