Postings tagged with games

A dirt-simple fceu NES emulator front-end

zenity makes a great fceu front-end.

So – I’ve got a number of 8-bit nintendo NES ROMs out there I’ve recently started obsessing over again, and I wanted a way to make choosing a game to play easier. So I wrote a simple zenity-based front-end to the fceu emulator. Here’s a quick run-through, in the context of my Debian Etch workstation.

Stuff to install

aptitude install zenity fceu

zenity

zenity is a dirt-simple way to create GTK dialog boxes that return values to shell scripts. It’s a pretty neat little tool, though not particularly useful in my capacity as a sysadmin. But it’s perfect for this. :-)

One of the dialog choices is the “file selection box”, which pops-up a standard GTK file selector and returns the path to the chosen file.

fceu

fceu is a fabulous 8-bit NES emulator that works beautifully on my debian box. Once I configured the input device via

fceu -inputcfg gamepad1 path/to/a/Rom_file.zip

I figured out the other options I wanted – fullscreen and opengl, giving us a command line of:

fceu -fs 1 -opengl path/to/Rom.zip

ROMs

All my ROMs live in ~/nes/.

The shell script

Here’s the shell script:

#!/bin/sh

# Dan Collis-Puro, 2007.
DIR="$HOME/nes/"
FILE=`zenity --file-selection --title='Choose an NES game' --filename=$DIR`
if [ "$FILE" != $DIR ]
then
        echo $FILE
        fceu -fs 1 -opengl "$FILE"
fi

Put it somewhere ( ~/bin/ makes sense ) and make it executable. Test it out. It’s Magic! (not so much).

The icing

Right click on your gnome panel. Add a “custom application launcher” and browse to the script you just created.

Assuming it’s executable, the paths are correct and you’ve got some ROMs in there, you’ve now got a gnome panel launcher that’ll let you choose NES roms to play.

Bonus Points

Nerd humor, served cold.

zenity —list —checklist —column ‘’ —column ’’ TRUE Collaborate TRUE Listen —title ‘All right.’ —text ‘Stop.’
Recommend me on Working With Rails

Add to Technorati Favorites

Add to Google