Emulate some of the most popular gaming consoles of yore.
So, the emulation bug has bitten you harder than you imagined, and you’re not satisfied with merely running the arcade machine emulator MAME [Hack #22] or the Nintendo Entertainment System [Hack #40] ? Then read on to find out about emulators for many different retro consoles that will run on your Linux box, including the Super NES, Atari 2600, Sega Genesis, and more.
The venerable Super NES was one of the most popular console systems to ever hit the United States. But even the huge number of games that were available here pales in comparison to the number of games published in the motherland: Japan. With an emulator, and maybe a Japanese dictionary—or see “Play Japanese Games Without Speaking Japanese” in Gaming Hacks (O’Reilly), you may be able to explore a vast new sampling of SNES games! So let’s get down to it.
ZSNES (http://www.zsnes.com) is widely considered to be the best Super NES emulator available on the Linux platform. To install it, follow the steps listed next for your distribution.
Visit the ZSNES home page (http://www.zsnes.com) and click on the Files link in the menu at the top of the page. Save the Linux source file for the latest version to your /tmp directory. Then:
Once you have obtained some ROMs, starting ZSNES is as easy as typing zsnes
at the command line. ZSNES’s nifty little GUI will be displayed automatically when you start it. The first thing you will want to do is configure things for your particular setup. Start by clicking on the CONFIG menu and then INPUT #1. This will bring up the INPUT DEVICE configuration screen. In the DEVICE box, select KEYB/JOYSTICK, then click on the SET KEYS button. (You did read
[Hack #52]
, and maybe
[Hack #51]
as well, right?) ZSNES will now prompt you to hit the key or joystick button that will be used for each button on the SNES controller that is being emulated. Follow the steps as prompted, then click on the X in the title bar of the INPUT DEVICE window (shown in Figure 4-29) to close it.
You will probably also want to change the video settings, so click on the CONFIG menu again and select VIDEO. Take a look at all of the resolutions listed in the VIDEO MODES box. The left column, as you probably guessed, is the resolution. The middle column is the rendering engine (“R” means the default engine, “DR” is the direct rendering system, and “OGL” is OpenGL). The right column indicates whether ZSNES will run in a window or in full-screen mode. You will probably want to select the highest resolution that your video card can handle, and most people prefer fullscreen mode to get that sprawled-in-front-of-the-television-at-3-AM-trying-to-beat-that-damned-Bowser feel. To change video modes, click on the mode of your choosing, then click on the SET button. You will be prompted to press any key, the video mode will be switched, and then you will be prompted to press any key again to make the change permanent.
Don’t worry if your screen goes all crazy due to an unsupported resolution—just don’t touch the keyboard for ten seconds, and your previous resolution should be restored. Note that running the X Window System (i.e., XFree86 or X.org) at color depths greater than 16-bit forces ZSNES to scale back to 16-bit color in software, thus degrading performance. If you know that you are running at a higher color depth, and know how to change it, you should probably do so. When you are satisfied with the video mode, click on the “X” in the title bar of the VIDEO CONFIG window to close it.
Now, click on the CONFIG menu again and select SOUND. You will probably want to select both ENABLE SOUND and STEREO SOUND by clicking on the checkbox to the left of each option. When you are satisfied with the sound settings, click on the “X” in the title bar of the SOUND CONFIG window to close it.
Feel free to poke about in the CONFIG and MISC menus for a bit. When you are done, load a ROM and play it!
Click on the GAME menu, then the LOAD option. You will be presented with a file browser window. Use it to browse into your SNES ROMs directory, select the ROM that you want to play, and then click the LOAD button.
If everything is groovy, the game should start. Congratulations, you now have yourself a working SNES emulator!
Tip
If you don’t want to log out of your current desktop, you could also start up a separate X11 instance at the desired color depth. Switch to another virtual console (for example, to switch to the first virtual console, use Ctrl-Alt-F1), log in if necessary, and use startx to launch a new X11 session):
startx -- :1 -depth 16
The -- option passes all the subsequent commands to the X server itself (:1 specifies the second display, -depth 16
specifies 16-bit color depth. After you’ve started the second server, you will be able to switch back to your first X11 session with Ctrl-Alt-F7, and to your second one with Ctrl-Alt-F8.
If for some strange reason you do not like ZSNES, here are some other SNES emulators worth trying:
- Snes9X
- GooSNES
(http://bard.sytes.net/goosnes/), a GTK+ front-end for Snes9X
For more Nintendo emulation on the Unix platform, take a look at:
- BoyCott Advance
(http://boycottadvance.emuunlim.com/), a Game Boy Advance emulator
- Virtual Game Boy Advance (VGBA)
(http://fms.komkon.org/VGBA/), a Game Boy Advance emulator
- Gcube
(http://gcube.exemu.net/), a Gamecube emulator
- Mupen64
(http://mupen64.emulation64.com/), an N64 emulator
With all this talk of Nintendo emulation, did you think I had forgotten about the original Game Boy? Not bloody likely, as this old-school classic is also the best-selling video game system of all time! And it ain’t even close, people: the latest figures that I have seen (which are from March 2004) estimate that the Game Boy series has sold 160 million units (with the GBA only accounting for around of 20 million of those)!
So, without further ado, let’s build and install VisualBoyAdvance (http://vba.ngemu.com/), the most popular GBA emulator for the Unix platform.
If you’re using another distribution of Linux (or other Unix variant), check your installation media or online package repositories to see if there is a binary build of VisualBoyAdvance available. Otherwise, visit the VisualBoyAdvance project’s Sourceforge files page (http://sourceforge.net/project/showfiles.php?group_id=63889) and download the latest source tarball (VisualBoyAdvance-src-1.7.2.tar.gz, as of this writing).
Proceed as for ZSNES (i.e., uncompress the tarball, change into the resulting directory, and do the ./configure && make && make install
dance).
Once VisualBoyAdvance is installed, open a terminal as a normal user, change to your Game Boy ROMs directory, and type (replace TETRIS.GBC with the name of a Game Boy or Game Boy advance ROM that you have):
VisualBoyAdvance -3 TETRIS.GBC
Figure 4-30 shows VisualBoyAdvance in action.
Make sure to check out PD ROMS (http://pdroms.de/), as there are public domain, freeware, and/or open-source clones of most of the Game Boy classics that you grew up with!
As a full-featured emulator, the command-line options to VisualBoyAdvance are myriad. Thus, you may wish to employ a graphical frontend. Here are three that exist for Unix:
- GnomeBoyAdvance
- KvisualBoyAdvance
(http://www.gentoo-portage.com/games-emulation/kvisualboyadvance)
- QTVBA
Frontend for VisualBoyAdvance (http://www.apex.net.au/~twalker/qtvba/).
- Gngb
(http://m.peponas.free.fr/gngb/), a Game Boy Color emulator
- gnuboy
(http://gnuboy.unix-fu.org/), a Game Boy Color emulator
- KiGB
(http://kigb.emuunlim.com/), a Game Boy / Game Boy Color emulator
- BoyCott-Advance-SDL
(http://sdlemu.ngemu.com/basdl.php), an SDL port of the BoyCott-Advance (http://boycottadvance.emuunlim.com/) Game Boy Advance emulator
And if you like Game Boy emulators, you might also enjoy emulating other hand-held systems:
- NeoPocott
(http://neopocott.emuunlim.com/), a Neo Geo Pocket emulator
- Handy
(http://homepage.ntlworld.com/dystopia/), an Atari Lynx emulator
- MEKA
(http://www.smspower.org/meka/), an emulator for, amongst other things, Sega Game Gear (more on MEKA in the Sega Genesis section of this hack)
Ah, the Atari 2600. Whenever talk turns to classic consoles, this lovely beast is bound to come up. Luckily, there is a wonderful emulator for the Unix platform, called Stella, that will allow us all to relive our glory days. To install it, follow the steps listed for your distribution.
If you’re using another distribution of Linux (or other Unix variant), check your installation media or online package repositories to see if there is a binary build of Stella available. Otherwise, visit the Stella project’s home page (http://stella.sourceforge.net) and click on the “Stable Releases” link under the “Downloads” heading on the left side of the page. Then:
Save the source .tar.gz file for the latest version to your /tmp directory.
Extract and compile Stella:
$
cd /tmp
$tar xvzf stella-*-src.tar.gz
$cd stella-*/src/build/
$make linux
(or, to build the OpenGL version: use
make linux-gl
)Next, become the root user with su (or prefix each command with sudo), and install Stella and its associated files:
#
cp stella /usr/bin/
#cp ../emucore/stella.pro /etc/
#mkdir -p /usr/share/docs/stella
#cp -r ../../docs/ ../../*.txt /usr/share/docs/stella/
After you have built and installed Stella, open a terminal as a normal user, change to your Atari 2600 ROMs directory [Hack #26] , and fire up the emulator:
stella -video soft -sound 1 -zoom 2 -grabmouse 0 seantsc.bin
Iam using the -grabmouse 0
option to turn off mouse grabbing, because I use the keyboard to control Stella—it works about how you would expect: the arrow keys emulate the joystick, and the space bar emulates the fire button. The -video soft
option instructs Stella to use software video rendering. If you built Stella with OpenGL support, try -video gl
to use your graphics hardware to its utmost (which is very important when emulating that graphical powerhouse, the Atari 2600!). Figure 4-31 shows Stella in action.
If Stella cannot quench your thirst for Atari emulation, check out some of the following projects:
- Atari 800
(http://atari800.sourceforge.net/), an Atari 800, 800XL, 130XE, and 5200 emulator for Unix, Amiga, MS-DOS, Atari TT/Falcon, SDL, and WinCE
- Hatari
(http://hatari.sourceforge.net/) and STonX (http://stonx.sourceforge.net/), Atari ST emulators for the various flavors of Unix (Mac OS X being one of them!)
- Atari Running on Any Machine (ARAnyM)
(http://aranym.sourceforge.net/), a virtual machine for running Atari ST/ TT/Falcon operating systems and TOS/GEM applications
- EmuTOS
(http://emutos.sourceforge.net/en/index.htm), a singleuser singletasking operating system for 32-bit Atari computer emulators, like ARAnyM, STonX, or Hatari
- Handy
(http://handy.sourceforge.net/), an Atari Lynx emulator
- Virtual Jaguar
(http://www.icculus.org/virtualjaguar/), an Atari Jaguar emulator
Get Retro Gaming Hacks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.