RSS LJ

April 14, 2009

How to build FCEUX for Mac OS X (, )

by fluffy at 9:52 PM
I wanted to play Neill's Metroid hack but there's no binaries available of FCEUX for Mac OS X. So I had to build it myself. It wasn't too difficult, but there's definitely some barriers for people who don't know their way around the OS X toolchain very much.

These instructions are based on Fink (and obviously you need XCode installed). For Darwinports/Macports/whatever it's probably similar. Whatever you do, I really don't recommend trying to hand-manage the dependencies.

For build-dependencies, it's just fink install scons sdl zenity lua51-dev, and to build fceux it's just CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib scons; sudo cp bin/* /usr/local/bin

gfceux doesn't seem to work (even after getting PYTHONPATH set up, pygtk doesn't appear to be available), but I'm fine with the commandline (to play Neill's hack it's just fceux --loadlua metroid.lua metroid.nes, assuming fceux is in your $PATH and metroid.nes/metroid.lua are in the current directory). At least, I assume this works - I still need to acquire the ROM (I'm sure I have it on a hard drive somewhere but I'm lazy). I tried a couple of homebrew demo ROMs and fceux worked just fine, aside from the usual SDL-on-OSX gimpiness anyway. (UPDATE: the Lua stuff doesn't seem to work. So I'm just using the Windows build under VMWare anyway. Meh.)

Also, I highly recommend running fceux with the following command line options at least once: --inputcfg gamepad1 --xscale 4 --yscale 4 --opengl 1. Fortunately it saves the last command line options in ~/.fceux/fceux.cfg so you don't have to do that every time.

Comments

#12398 Anonymous 09/18/2009 01:32 pm comments
also, you need to change the src/lua-engine.cpp file

replace the include for malloc.h with

#include "sys/malloc.h" // mac os x
#13615 12/05/2010 10:48 pm
Well this is annoying. I went searching for an OSX build of FCEUX and my own blog entry was the top search result for it. Since writing this I've switched to MacPorts.

On the plus side, FCEUX provides their own set of instructions now. (Although hilariously it links back to this page...)