I’ve been into emulation again lately, and I started with my first favorite system of all time, the Atari 8-bit computer. When I was growing up, I had 2 different 8-bit machines:
The Atari 400:

and later the Atari 130XE:

I did a lot of things on these machines, including learn BASIC, type in programs from magazines, and of course… play games! In order to play these games, I had a great joystick –
the Wico Command Control joystick:

My goal is to have as close as an experience as possible to the real thing with modern hardware, through emulation. To purists, this is considered sacrilege — they want the physical hardware, and emulation for them just doesn’t cut it. I guess I’m not a purist — I just like being able to play the old games! Since I’m now running Linux, the goal will be to get a working emulator going and everything working properly. Here’s what I mean by a proper emulator setup:
- Emulator should run in fullscreen mode, with no window elements showing
- 2 joysticks should work
- Everything should be able to be specified via the command line
- It should handle multiple disk programs as painless as possible
- It should have a standard method for exiting the emulator
The emulator I’ll be using for the Atari 8-Bit computers is atari800. In my opinion, it is the best emulator for the 8-bits, and will work for us just fine, with a few modifications. As a part of this project, I am also going to use the original joysticks that were used for the system.
Controllers:
For this project, I’m using the Wico Command Control joystick (see photo above). I used to use the Logitech gamepads that look like PS2 controllers, but after switching to the right controller, there’s no going back! The issue is, I need a way to convert them to USB to be able to use them on modern machines. After doing some searching, I found just the adapter, from a company called RetroZone. I bought the joystick and adapter off of eBay, and I couldn’t wait to plug it in and try it out! It seemed to work, but I noticed something odd – the fire button was being pressed every time I moved the joystick. I thought that it might be a linux thing, so I plugged it into my Windows laptop, and sure enough, it presses a different button every time I move the joystick. This wouldn’t be a problem normally, if the emulator I’m using didn’t allow you to use any button as the fire button. I have a fix for this issue though, which I’ll get to later.
Installation:
To install the standard version of the emulator (atari800), simply run the following (in Ubuntu):
% sudo apt-get install atari800
Then before you can actually run it, you’ll need a couple of things:
- ROM files
- Disk / Cartridge Images
The ROM files are dumps from the actual ROM chips found in the original hardware. There’s a few of them out there on the internet, and one place I’ve found that has them is TheOldComputer.com. All you really need are the following ROMs:
- Atari Rev B (400/800) NTSC
- Atari XL or XE NTSC
You’ll also need disk images or cartridge images. One cool site that I use frequently is called AtariMania.com. They have images and also artwork scans from the boxes/disks/manuals etc.
Now would be a good time to talk about how you’re planning on organizing your emulator directories. I personally use the following directory structure, but you’re welcome to use whatever you like:
/data/Software/Retro/Atari 8-Bit/roms /data/Software/Retro/Atari 8-Bit/disks /data/Software/Retro/Atari 8-Bit/carts /data/Software/Retro/Atari 8-Bit/art_front /data/Software/Retro/Atari 8-Bit/art_back /data/Software/Retro/Atari 8-Bit/snap /data/Software/Retro/Atari 8-Bit/titles
The last 4 directories are useful when running the emulator from a front-end, which I highly recommend. I’ll talk more about front-ends in a future blog posting.
To run the emulator, simply run the following:
% atari800
This will probably give you an error saying that it can’t find the ROM files. You will need to set up the configuration so that it can find your ROMs. To do this from within the emulator, hit F1, and go to “Emulator Configuration”. From there you can select the different ROMs and configure things how you like. To exit the emulator, press F9.
After it can find your roms, you’ll need to load a disk image. To do this from the command line, simply run:
% atari800 <name of the disk image>
(If there are spaces in the diskname, be sure to either put double quotes around the filename or use backslashes in front of the spaces or other special characters)
A couple of keys to get you started:
- F1 – Configuration Mode
- F2 – Option
- F3 – Select
- F4 – Start
- F5 – Reset
- F9 – Quit the Emulator
With any luck, you’re now able to play some games! A couple of issues you might be having: It’s windowed and small, and you want it to be fullscreen and big! It took a little bit of effort to get this going for me, but here’s how I achieved this. If you are running with more than one monitor, please see my guide on how to set up MetaModes to fix fullscreen issues.
First off, you will want to turn on NTSC mode. To do this, either do it in the emulator itself (hit F1, etc.) or by editing the config file. If you’re editing the config file, just set this line in ~/.atari800.cfg:
DEFAULT_TV_MODE=NTSC
If you’re like me, you want your gaming to be in fullscreen mode, not a window. One way of doing this is to create an alias that sets the resolution:
alias atari800='atari800 -width 1280 -height 1024'
Add this line to your .bashrc, and you’ll be in fullscreen gaming heaven! (Be sure to change the height and width as necessary for your monitor)
Customization:
At first, I just used the standard distribution version of atari800 – this worked well, but I had a couple of issues. First, the emulator treats every joystick button as the fire button. This was an issue with the joystick adapter I’m using, which sends a different button press for each direction (by design). Another issue I had was the fact that there needed to be an easy way to swap disks in a multi-disk set — I would like to be able to hit a function key for this.
I figured the easiest way to get these things fixed would be to compile from source. I started by downloading the source from CVS, and started working on compiling. (For my examples, I used version 2.1.0. To compile it, you’ll also need to get the SDL development libraries, which can easily by installed via Synaptic Package Manager (search for SDL). There’s lots of guides on compiling from source out there, but the simple method is:
cd <source dir> ./configure make
Before I do any source code hacking, I always make sure that the source compiles first, that way I know it works before I start breaking stuff! Another thing to do is to always keep a backup copy of the source file you are editing. You want to be able to back out of any changes you make. On that note, let the hacking begin!
To fix the trigger issue, edit atari_sdl.c:
In the get_platform_TRIG() function, change the following lines:
int trig0, trig1, i;
to:
int trig0, trig1;
and:
for (i = 0; i < joystick0_nbuttons; i++) {
if (SDL_JoystickGetButton(joystick0, i)) {
trig0 = 0;
break;
}
}
to simply:
if (SDL_JoystickGetButton(joystick0, 0))
trig0 = 0;
And do the same for joystick1 -- convert:
for (i = 0; i < joystick1_nbuttons; i++) {
if (SDL_JoystickGetButton(joystick1, i)) {
trig1 = 0;
break;
}
}
to:
if (SDL_JoystickGetButton(joystick1, 0))
trig1 = 0;
To map the Rotate Disk function to F11, edit atari_sdl.c:
Add the following into the #include section:
#include "sio.h"
Then do a search for "F10", and add the following after the SDLK_F10 case:
case SDLK_F11:
key_pressed = 0;
SIO_RotateDisks();
return AKEY_NONE;
After making either or both of these changes, run make again, and test. There's still one more change I'd like to make, but it will have to be at another time. I like to have the Escape key exit from all of my emulators. The idea is, any one should be able to run these, and having to remember which function key does what is a pain. I'll be sure to update this post when I make my change so that you can see how I did it.
Conclusion:
Hopefully this guide has been helpful to people interested in RetroGaming on Linux. Please feel free to share your experiences or issues -- I'm always interested to hear other people's thoughts and ideas. Have a system you'd like me to cover? Let me know and I'll do my best to accommodate you. I enjoy working with all gaming and computer platforms, albeit some of them are not quite as easy to set up.
Related posts:


