=============================================================================== SSSS tt lll lll SS SS tt ll ll SS tttttt eeee ll ll aaaa SSSS tt ee ee ll ll aa SS tt eeeeee ll ll aaaaa SS SS tt ee ll ll aa aa SSSS ttt eeeee llll llll aaaaa A Multi-platform Atari 2600 VCS Emulator User Guide =============================================================================== A Bradford W. Mott production in association with Aaron Giles, Seunghee Lee, Jeff Miller, and Darrell Spice Jr. =============================================================================== This guide explains how to install and use Stella to play Atari 2600 VCS games on your computer. Please read this guide throughly before sending questions to anyone. If you don't find the answers to your questions in this guide please see the FAQ found on the Stella homepage. If you have any suggestions for improvements to this document or to Stella please send them to bwmott@eos.ncsu.edu. DO NOT SEND EMAIL ASKING FOR ROMS BECAUSE THEY ARE COPYRIGHTED. DO NOT SEND EMAIL ASKING FOR THE LOCATION OF ROMS ON THE INTERNET. ANY MAIL RECEIVED OF THIS NATURE WILL BE DELETED AND NO RESPONSE GIVEN. Stella License Information and Copyright Notice =============================================== Stella is Copyright(c) 1995, 1996, 1997 by Bradford W. Mott. Permission to use, copy, and distribute Stella in its entirety, for non-commercial purposes, is hereby granted without fee, provided that this license information and copyright notice appear in all copies. If you redistribute Stella, the entire contents of this distribution must be distributed. The software may be modified for your own purposes, but modified versions may NOT be distributed without prior consent from the author. This software is provided 'as-is', without any expressed or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. If you would like to do something with Stella that this copyright prohibits (such as distributing it with a commercial product, using portions of the source in some other program, etc.), please contact the author. The author can be contacted via: email: bwmott@eos.ncsu.edu mail: Bradford Mott Graduate Student Department of Computer Science North Carolina State University Raleigh, NC 27695-8206, U.S.A. TiaSound Library Copyright Notice ================================== (Stella uses the TiaSound library written by Ron Fries. It can be be downloaded from the Stella home page.) TiaSound is Copyright(c) 1996, 1997 by Ron Fries This library is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU Library General Public License as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. To obtain a copy of the GNU Library General Public License, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Any permitted reproduction of these routines, in whole or in part, must bear this legend. Table of Contents ================= 1.0 Introduction 2.0 Installation 2.1 Linux Binary Distribution 2.2 DOS Binary Distribution 2.3 Power Mac Binary Distribution 2.4 Windows 95 & NT Binary Distribution 2.5 Unix Source Code Distribution 3.0 ROM Images 3.1 General 3.2 Supercharger 4.0 Playing Games 4.1 Unix and DOS 4.2 Power Macs 4.3 Windows 95 & NT 5.0 Keyboard Layout 6.0 Mailing List 7.0 Known problems with Cartridges 8.0 Adding Properties 9.0 Property Autodetection 10.0 Acknowledgements 11.0 Revision History 1.0 Introduction ================ Stella is a portable emulator of the old Atari 2600 video-game console written in C++. You can play most Atari 2600 games with it. The latest news, code and binaries for Stella can be found at: http://www4.ncsu.edu/~bwmott/2600/ If you are having problems with Stella please visit the home page and make sure you're running the lastest release before sending mail. There are versions of Stella for Linux, DOS, OS/2, Power Macs, Unix/X, and Windows. The maintainers are: Aaron Giles (agiles@sirius.com) Power Macs Jeff Miller (milnak@msn.com) Windows 95 & NT Bradford W. Mott (bwmott@eos.ncsu.edu) Linux, Unix/X and DOS Darrell Spice Jr. (spice@ibm.net) OS/2 If you would like to port Stella to another platform or would like to help with something please take a look at the Todo.txt file for a list of things that need to be done. Please note that although the source code for Stella is freely distributed the code is NOT public domain. 2.0 Installation ================ Once you've downloaded a Stella distribution you should follow the directions for the distribution you have. 2.1 Linux Binary Distribution ----------------------------- This distribution contains the ELF binaries for Linux. The binaries were built on a machine running Red Hat Linux 4.1. If these binaries do not work on your system then download the Unix/X source code distribution and compile it yourself. To install the distribution do the following: 1) Untar the distribution: tar -zxvf stella-0.7-linux.tar.gz 2) Login as root (or su) and cd to the distribution directory 3) Copy the executables: cp stella xstella stella-sound /usr/local/bin 4) Fix permissions: chmod u+s /usr/local/bin/stella 5) You may also need to execute 'chmod a+rw /dev/ttyS0' to get the paddles to work under SVGALIB The binaries were built with joystick support so if you have a joystick module installed, such as joystick-0.8.0.tar.gz, you'll be able to use your joysticks. The stella-sound program must be in your PATH when you run Stella if you want sound to work. 2.2 DOS Binary Distribution --------------------------- This distribution contains the binaries for DOS. To install the distribution do the following: 1) Change directories to the root directory: CD \ 2) Execute the self-extracting archive: STELLA07.EXE 3) Copy the STELLA.EXE program to a directory in your path or add C:\STELLA to your path in the AUTOEXEC.BAT file This version of Stella supports sound using a Sound Blaster card. For it to work correctly you should set the BLASTER environment variable in your AUTOEXEC.BAT file. If your card is at port 220, IRQ 5 and DMA 1 then you shouldn't need to set the variable. Sound cards with an IRQ setting greater than 7 should be working now. If you have problems with the joysticks you may have to unplug them to use Stella. This version also includes a zip file, gamemenu.zip, containing Jim Pragit's "Game Menu". Game Menu provides a nice menu based interface to Stella for DOS. To use Game Menu you need to unzip it in the directory where you installed Stella. If you installed Stella in \Stella\ then: cd \Stella\ unzip gamemenu.zip Then read the file gamemenu.txt for more information about Game Menu. 2.3 Power Mac Binary Distribution --------------------------------- This distribution contains the binaries for Power Macs. To install the distribution do the following: 1) Decode the .hqx file (if it hasn't already been done) 2) Double-click the .sea file and extract the contents somewhere on your hard disk The Power Macintosh version of Stella should work with most joysticks that emulate the keyboard (i.e., most of them). No configuration files are provided, however. 2.4 Windows 95 & NT Binary Distribution --------------------------------------- This distribution contains the binaries for Windows 95 & NT. To install the distribution do the following: 1) Unzip the distribution stella-0.7-win32.zip 2) Execute the setup.exe program 3) Follow the on screen instructions to install Stella The Windows version of Stella includes joystick support, however, it does not support paddles. 2.5 Unix Source Code Distribution --------------------------------- This distribution contains the source code for Stella. The source code can be compiled under most Unix operating systems and DOS. The Unix code has been developed with GCC 2.7.2, however, it should compile with other C++ compilers. You'll need SVGALIB 1.2.10 or better to compile the SVGALIB version of Stella. The DOS port has been developed with Watcomm and DJGPP, however, it may compile with others. 1) Change directories to the .../stella-0.7/src directory 2) Edit the makefile to meet your needs 3) Type 'make' and follow the on screen instructions to build Stella 4) Install Stella in a directory that's in your path 5) Change directories to the .../stella-0.7/src/sound directory 6) Type 'make' and follow the on screen instructions to build stella-sound 7) Install stella-sound in a directory that's in your path At this time there is no support for sound under Unix except for Linux. If you have some free time please try to port the stella-sound program to your favorite Unix. 3.0 ROM Images ============== In order to play an Atari 2600 game you have to have a ROM image of the game. A ROM image is a file that contains the data off the game cartridge or cassette. 3.1 General ----------- Most games for the Atari 2600, like many game systems, were stored on cartridges. These cartridges usually contained a single ROM chip (Read Only Memory) which had the program for the game stored on it. When you plugged the cartridge into the 2600 it allowed the 2600's microprocessor, a 6507 which is very similar to a 6502, to execute the program stored on the cartridge. Just like a cartridge had to be plugged into the 2600 you also have to supply Stella with a copy of the cartridge you want to play. This is done by having a ROM image (.BIN file) of the cartridge. ROM images are files which contain the actual data off the cartridge (basically it contains 6507 machine code). There are several ways to get a ROM image: 1) It's possible to build a device that plugs into the printer port of a PC and reads the data off the cartridge (See the Stella home page for more information) 2) Purchase any of the Activision Atari 2600 Action Packs and use the ROM images (.BIN files) from it 3) Search around the net and find some ROM images (.BIN files) to download WARNING: It is illegal to have ROM images of games that you do not actually own (i.e. you don't own the cartridge and you didn't buy it from Activision) In addition to the ROM image you may need to supply some properties for the game. These properties inform Stella of the "best" settings for a game. When Stella doesn't have properties for a game it tries to guess the settings and uses defaults for settings it can't guess. For most games you will NOT need to add properties to Stella since it contains setting for a lot of games and can guess the settings for most of the others, however, for best results you may decide you want to specify the properties yourself. If you do you should read the "Adding Properties" section of this guide. 3.1 Supercharger ---------------- Supercharger games were not stored on cartridges instead they were stored on cassette tapes. The Supercharger, which plugged into the Atari 2600's cartridge slot, loaded games into it's 6K of RAM using a tape player. The Supercharger also supported multiloading which allowed games to be broken into several 6K pieces and loaded at different times. This was useful for long games that had distinct parts (i.e. role playing type games). Most Supercharger ROM images are stored as an 8448 byte file. However, ROM images of multiload games are stored as a set of 8448 byte files. The names of these files have a two character sequence number in them which indicate what load they are (the sequence always starts at zero but then skips a few numbers and then increments by one). Stella supports multiload games, however, the set of ROM image files has to be combined into a single large ROM image file. To create a multiload ROM image file for Stella under Unix do the following: % cat survivl0.bin survivl6.bin survivl7.bin > survivl.bin Then you can play the game with Stella using the survivl.bin file. Stella has properties builtin for most of the Supercharger games, however, if you're developing your own Supercharger game you might need to add some properties to Stella. See the "Adding Properties" section of this guide for more information. It is VERY important that the "M6507.Compatiblity" property be set to "High" for Supercharger games. If it isn't the game will not run correctly. Stella automatically sets this property if it sees a ROM image who's size is a multiple of 8448. 4.0 Playing Games ================= Once you've installed Stella and have some ROM images you can play a game by following the directions for your operating system. 4.1 Unix and DOS ---------------- The Unix and DOS versions of Stella expect you to pass the name the ROM image as a command line argument. For example: stella FILENAME.BIN (xstella FILENAME.BIN for the X windows version) For DOS you can also use Jim Pragit's "Game Menu" front end to run Stella for you. 4.2 Windows 95 & NT ------------------- After double-clicking on stella.exe a standard file dialog appears which allows you to select the ROM image to load. 4.3 Power Macs -------------- After double-clicking on Stella a standard file dialog appears which asks you to choose a ROM image to load. Or, if a ROM image has the proper creator type ('StLa'), you can simply double-click that file to run the game directly. 5.0 Keyboard Layout =================== The following keys are used: [q] Quit (Unix, DOS and Power Mac) [p] Pause (Unix, DOS and others maybe?) [s] Select Game [r] Game Reset [c] Color television [b] Black and white television [1] Left player difficulty B [2] Left player difficulty A [3] Right player difficulty B [4] Right player difficulty A [Up Arrow] Left joystick up [Down Arrow] Left joystick down [Left Arrow] Left joystick left [Right Arrow] Left joystick right [Space] Left joystick fire button [Enter] Left joystick fire button [y] Right joystick up [h] Right joystick down [g] Right joystick left [l] Right joystick right [z] Right joystick fire button [=] Change window size (X windows) 6.0 Mailing List ================ There is a mailing list for Stella. The mailing list is for discussions concerning Stella including bug reports, enhancements reports, and general usage tips. Anyone who uses Stella regularly should subscribe to the mailing list. To subscribe to the list send the following message to majordomo@csc.ncsu.edu: subscribe stella end Once you've subscribed you can send messages to everyone on the list by mailing them to stella@csc.ncsu.edu. Anything you mail to stella@csc.ncsu.edu goes to everyone on the mailing list. Make sure you really mean to send your message to stella@csc.ncsu.edu and NOT majordomo@csc.ncsu.edu (i.e. if it's a mailing list server command it should be sent to majordomo@csc.ncsu.edu not stella@csc.ncsu.edu). For more information on using the majordomo mailing list server send the following message to majordomo@csc.ncsu.edu: help end 7.0 Known problems with Cartridges ================================== This section contains information about problems I know about with some cartridges: * Defender II - This cartridge is really an F8SC cartridge, 8K with 128 bytes of RAM, not an F6SC cartridge. There is a 16K image of this cartridge floating around that has the right code in it, however, it's the second 8K that's needed. If you're running Unix you can fix it with the command: tail --bytes=8192 DEFENDR2.BIN > tmp mv tmp DEFENDR2.BIN If you're running DOS you can fix it by typing what's in <>s below: - CX 4000 : <2000> - Writing 02000 bytes - (provided by plord@mail.pacificnet.net) * Stargate - Same as Defender II above 8.0 Adding Properties ===================== Properties inform Stella of the "best" settings for a game. Stella has a set of builtin properties that supply default settings for all games as well as specific settings for many games. New properties can be added to Stella by creating a 'stella.vcs' file in the working directory where you run Stella. This file should contain a VCS-Script program which sets additional properties when Stella runs. For example suppose you wanted to add properties to Stella for Adventure then you would create a file called 'stella.vcs' with a text editor and place the following in it: --- Beginning of 'stella.vcs' --- VCS-Script (begin ;; ;; Properties for Adventure ;; (if (member Cartridge.Image '("ADVNTURE.BIN" "advnture.bin")) (begin (set! Cartridge.Name "Adventure") (set! Cartridge.Type "4K") (set! Display.YStart "37") (set! Display.Height "192") (set! Controller.Joystick1 "None"))) ) --- End of 'stella.vcs' --- A better way to do the same thing would be to use Cartridge.Id in the 'if' statement instead of Cartridge.Image, however, you would have to lookup the Cartridge.Id on the Stella home page to do that. --- Beginning of 'stella.vcs' --- VCS-Script (begin ;; ;; Properties for Adventure ;; (if (member Cartridge.Id '("7decb903")) (begin (set! Cartridge.Name "Adventure") (set! Cartridge.Type "4K") (set! Display.YStart "37") (set! Display.Height "192") (set! Controller.Joystick1 "None"))) ) --- End of 'stella.vcs' --- A VCS-Script program has the following form: * The first line of the program must contain "VCS-Script" which tells the interpreter that it is a VCS-Script program * The first statement following the "VCS-Script" line is executed * Comments can be between the "VCS-Script" line and the first statement * Everything after the first statement IS ignored * Statements have the following form: (set! property value) --------------------- Sets the specified property to the specified value. For example: (set! Cartridge.Type "4K") (begin s1 s2 .. sn) ------------------- Compound statement that sequentially executes the sub-statements s1 to sn. For example: (begin (set! Cartridge.Name "Hi") (set! Cartridge.Type "4K")) (member property list) ---------------------- Boolean expression that returns true if and only if the specified property's value is a member of the list. For example: (member Cartridge.Image '("ADVNTURE.BIN" "advnture.bin")) (if bool statement) ------------------- Evaluates the boolean expression and executes statement if it is true. For example: (if (member Cartridge.Image '("ADVNTURE.BIN" "advnture.bin")) (set! Cartridge.Name "Adventure")) That's basically it for the syntax of a VCS-Script file. The only thing left to do is to explain the various properties, their values and their initial values. Property Inital Value Purpose -------- ------------ ------- Cartridge.Name "UNKNOWN" Full name of the game Cartridge.Id Autodetected Checksum computed from the contents of the ROM image Cartridge.Image ROM image name Filename of the game's ROM image Cartridge.Type Autodetected Cartridge bankswitching method 2K, 3F, 4K, AR, E0, E7, F4SC, F6, F8, F8SC or FASC See bankswitching paper on Stella homepage for more info Display.FrameRate "60" Number of frames to be displayed per second 10, 15, 20, 30 or 60 Many games require 60 Display.YStart "38" Scanline to start displaying at 0 < YStart < 100 Display.Height "210" Number of scanlines to display 0 < Height < 220 Display.XStart "0" Pixel to start displaying scanline at 0 < XStart < 80, mod 4 = 0 Display.Width "160" Number of pixels to display on a scanline 0 < Width < 160, mod 4 = 0 Console.LeftDifficulty "B" Default value for left difficulty A or B Console.RightDifficulty "B" Default value for right difficulty A or B Console.TelevisionType "Color" Default television type Color or Mono Controller.Paddle0 "None" Physical paddle to use 0, 1, 2, 3, or None Controller.Paddle1 "None" Physical paddle to use 0, 1, 2, 3, or None Controller.Paddle2 "None" Physical paddle to use 0, 1, 2, 3, or None Controller.Paddle3 "None" Physical paddle to use 0, 1, 2, 3, or None Controller.Joystick0 "0" Physical joystick to use 0, 1, or None Controller.Joystick1 "1" Physical joystick to use 0, 1, or None M6507.Compatibility Autodetected Determines how close the 6507 emulation is to real thing High or Low 9.0 Property Autodetection ========================== When Stella loads a ROM image it does the following: 1) Uses the following default values: Display.FrameRate = 60 Display.YStart = 38 Display.Height = 210 Display.XStart = 0 Display.Width = 160 Console.LeftDifficulty = B Console.RightDifficulty = B Console.TelevisionType = Color Controller.Paddle0 = None Controller.Paddle1 = None Controller.Paddle2 = None Controller.Paddle3 = None Controller.Joystick0 = 0 Controller.Joystick1 = 1 2) Determines Cartridge.Type as follows: a) If the name of the file matches any of the known 8K Parker Brother games then set the type to E0 b) Use the "real" size of the ROM image to set the type to either 2K, 4K, AR, F8, F6 or F6SC NOTE: The type is set to F6SC if the size is 16K and the first 256 bytes are all the same value 3) Computes the Cartridge.Id from the ROM image data You can see that the guessing isn't all that smart and we can hopefully make it better in later releases. You should also noticed that it doesn't guess if the cartridge uses joysticks or paddles (it assumes joysticks). 10.0 Acknowledgements ===================== The following people have had a part in bringing Stella to you: Bob Colbert - Allowed "Okie Dokie" to be included in the Stella distribution (rcolbert@novia.net) Ron Fries - Author of the TiaSound library Aaron Giles - Maintained the Power Mac version Mark R. Hahn - Allowed "Elk Attack" to be included in the Stella distribution and described the TIA HMOVE blanks Kevin Horton - Author of the 2600 bankswitching method paper Daniel Marks - Provided code to improve the keyboard joystick support Jeff Miller - Maintained the Windows version Bradford Mott - Maintained the core code, Linux SVGA version and X version Jim Pragit - Creator of "Game Menu" Chris Salomon - Provided information and code to implement Supercharger support Jason Scott - Organizer of the property file archive (needed for versions before 0.7) Raul Silva - Helped with the the design and graphics on the home page Chris Snell - Maintained a mirror of the Stella FTP site Darrell Spice Jr. - Maintained the OS/2 version Eckhard Stolberg - Described TIA bug that produces stars in Cosmic Ark Keith Wilkins - Maintained the DOS version until version 0.7 Jeff Wisnia - Provided technical data sheet for the 6532 Thanks to all the 2600 fans who've kept encouraging us to continue. 11.0 Revision History ===================== The following is a list of changes to Stella: 0.6 to 0.7: (June 7, 1997) * Improved emulation speed of TIA and 6507 * Added Starpath Supercharger support * Added Tigervision bankswitching support (3F bankswitching) * Added pause game feature for Unix and DOS * VCS files combined into a single builtin property file * Added TIA HMOVE "feature" to support Cosmic Ark stars * Improved TIA VSYNC code so that it works more like the real thing (0.6 VSYNC code caused the graphics of some games to be off such as Alien and Battle Zone) * Added two 6507 emulators: one is designed to act more like the real thing, while the other is designed to be as fast as possible (required for Supercharger support) * Changed TIA peeking so lower nibble of byte read is the same as the TIA address being accessed (Warlords now works) 0.5 to 0.6: (January 18, 1997) * Fixed collision detection problem (Freeway works) * Changed PIA timing code to fix screen jitters * Added new bank switching methods: F4SC (Fatal Run), E7 (Burgertime) * Fixed some code in the TIA emulation that caused SEGFAULTS * Improved frame rate throttling code to work better on fast machines * Improved TIA emulation (missle graphics are fully emulated now) * Included Bob Colbert's "Okie Dokie" game * Uses version 1.1 of the TIA Sound library by Ron Fries 0.4 to 0.5: (November 17, 1996) * Added sound support * Added new bank switching methods: F8SC (Defender II), FASC (CBS RAM+) * Changed TIA so peeking $E and $F return $F not $0 for Haunted House * Changed PIA timing code to fix screen jitters in Frogger * Addressing scheme rewritten * Optimized 6507 memory accesses * Randomized memory in PIA upon startup * Removed auto-disabling of objects at the start of a frame so you can't walk through walls in Adventure * Changed the X windows terminal update method to make it faster and easier to understand 0.3 to 0.4 (August 28, 1996): * TIA code has been optimized some * Some games can be played with just a ROM image * New search method for ROM images (no more STELLA_PATH) * Delta screen update supported * Better error handling added to the "core" 0.2 to 0.3 (July 12, 1996): * Keyboard joystick support is much better (Daniel Marks) * Paddles are now supported via the mouse (Bradford Mott) * Many portability issues have been resolved (Keith Wilkins) * Fixed a problem with the 6507 ADC and SBC instructions that caused some games (Enduro) not to work correctly (Bradford Mott) * Power Macintosh port (Aaron Giles) * Windows 95 & NT port (Jeff Miller)