EMU7800: A .NET Atari 7800 Emulator

Mike Murphy, mimurphy@users.sourceforge.net
v0.50, February 9, 2004

EMU7800 releases can be downloaded from SourceForge here.

Contents

1.0 Introduction
  1.1 Copyright Notice, Disclaimer, License
  1.2 Release Notes
  1.3 Acknowledgements
  1.4 Known Issues/TODO List
2.0 Installation
  2.1 Prerequisites
  2.2 Unpacking
  2.3 Rebuilding from Source
    2.3.1 ROMProperties
3.0 Running the Emulator
  3.1 Keyboard Mappings
  3.2 Game Controller/Joysticks
  3.3 Paddle and Lightgun Emulation via Mouse (SDL host only)
  3.4 User Interface
    3.4.1 Game Select Tab
    3.4.2 Settings Tab
    3.4.3 Console Tab

1.0 Introduction

This is a release of EMU7800, an Atari 7800 emulator implemented using Microsoft's .NET platform. Most 2600 and 7800 titles work well, with 2600 support featuring authentic HMOVE emulation, per Andrew Tower's paper "A Small Opus on the TIA." The stars in Cosmic Ark appear, but without emulation cheats.

You are probably asking, "Why would you want to implement an emulator in .NET for?" This was an academic graduate capstone project, for the Institute of Technology at UW Tacoma, where I needed to find a project that had lots of technical risk. Emulator writing is fun too, so that was a helpful bonus. Before I started this project, I had no experience in .NET or Win32 programming, no real object-oriented programming experience, or emulator writing for that matter. So, there was plenty of risk indeed.

Regardless, send me a note if you have questions or feedback. Enjoy!

1.1 Copyright Notice, Disclaimer, License

EMU7800 is Copyright © 2003, 2004 Mike Murphy.

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. PLEASE SEE THE ENCLOSED "LICENSE.TXT" FILE FOR THE COMPLETE LICENSING TERMS.

THE "msvcr70.dll" FILE IS REDISTRIBUTED PER THE FOLLOWING MICROSOFT KNOWLEDGE BASE ARTICLE:

Microsoft Knowledge Base Article - 326922
Redistribution of the Shared C Runtime Component in Visual C++ .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;326922

THE LICENSING TERMS OUTLINED IN "LICENSE.TXT" DO *NOT* APPLY TO THIS "msvcr70.dll" FILE!

1.2 Release Notes

0.50:

0.41:

0.33:

Further refined the HMOVE emulation, added a few illegal opcodes to enable some of the homebrew titles to work, and fixed several emulation bugs. This cleaned up Pitfall2, and other Activision titles that had visual artifacts.

0.32:

0.31:

Probably the most notable item in this release is an attempt at a general algorithm for handling "ill-advised" HMOVEs. That is, when the HMregisters are fiddled with within 24 CPU cycles of an HMOVE register strobe. Andrew Towers' excellent paper, A Small Opus on the TIA, provided invaluable insight for accomplishing this. So, give Cosmic Ark a try. You will see the starry background, but with no special hacks.

1.3 Acknowledgements

EMU7800 is a derived work of many people. Please let me know if I need to include someone else in this list.

For all things Atari, including game manuals, tips, and community, be sure to visit AtariAge!

1.4 Known Issues/TODO List

ROM Problems:

TODO:

2.0 Installation

2.1 Prerequisites

To run EMU7800, you will need to have the .NET runtime installed onto your computer. Currently, this means that you will also need to be running Microsoft Windows. (Hopefully this will change in the near future.) In any case, it is a free download from Microsoft's website. To have the capability to build from the included source code, be sure to install the SDK (software development kit) as opposed to just the redistributable runtime. EMU7800 was developed on a machine with a Pentium 4 Celeron 1.7 GHZ processor. This appears more than adequate for emulator performance. Your mileage may vary, and I would be interested in hearing how well it works (or doesn't) on other machines.

2.2 Unpacking

Find an appropriate folder on your system, and unzip the downloaded archive. Inside, you should find a single executable target:

EMU7800.exe

Simply double-click to execute it. Also in this directory, there are three .dll files: All are in the same directory as EMU7800.exe, as it must for things to work.

2.3 Rebuilding from Source

In true GNU spirit, the source code for the emulator is included in the distribution. To rebuild from source, simply start a command prompt (CMD.EXE), and change directories to the src/ subdirectory of the EMU7800 distribution. Then to rebuild, enter the command:

csc @build.rsp

The EMU7800.exe executable should appear within the directory within a few moments. Be sure to remember to move it into the same directory as the .dlls discussed above to have it work.

2.3.1 ROMProperties

As in other emulators, there are properties that are associated with recognized roms. In EMU7800, these are stored in ROMProperties.txt in the source directory. This file is embedded into the executable, so to make changes, the executable will need to be rebuilt. Since the text file is a bit terse, there is an associated MS Access database that is also included that makes updating the file a bit easier. After the Access database is updated, export to ROMProperties.txt, then move this file into the top-level src/ directory before rebuilding.

3.0 Running the Emulator

Some testing has shown that SDL may occasionally stop with a "DirectDraw is still drawing" error message to the console on some platforms. Simply hitting the Resume button will continue running the machine where it left off last. This will also happen if the Windows key is pressed during gameplay. If the sound pops or buzzes, then the sound queue is underflowing due to the emulator not being able to generate the sound frames quick enough. This is more likely to happen with the GDI host, versus the SDL host. The framerate can be adjusted to slow the emulator enough to prevent this (see Settings Tab for more information). The sound playback rate will also be slowed, causing the overall pitch to lower as well.

3.1 Keyboard Mappings

Key Function
ESCEscape (quit) from the currently running machine/game
TABBring up the Control Panel GUI (only available on GDI Host)
PPause the emulator, any other key resumes
M Sound mute toggle
F Show framerate
J Show next joystick event (SDL host only, useful for assigning joystick buttons)
R Game Reset Console Switch
S Game Select Console Switch
C Toggle between Color and B/W Console Switch settings
1 Toggle between A/B difficulty for left player
2 Toggle between A/B difficulty for right player
F1 Set keyboard to player 1 control
F2 Set keyboard to player 2 control
F3 Set keyboard to player 3 control
F4 Set keyboard to player 4 control
F5 Pan display left
F6 Pan display right
F7 Pan display up
F8 Pan display down
F11 Save machine state to outdir/ (only available on SDL Host)
F12 Save Screenshot to outdir/ (only available on SDL Host)
Up Arrow Move up: joystick, booster grip
Left Arrow Move left: joystick, booster grip, paddles, driving
Right Arrow Move right: joystick, booster grip, paddles, driving
Down Arrow Move down: joystick, booster grip
CTRL Trigger
ALT Booster
NUMPAD7 Keypad 7
NUMPAD8 Keypad 8
NUMPAD9 Keypad 9
NUMPAD4 Keypad 4
NUMPAD5 Keypad 5
NUMPAD6 Keypad 6
NUMPAD1 Keypad 1
NUMPAD2 Keypad 2
NUMPAD3 Keypad 3
NUMPAD* Keypad *
NUMPAD0 Keypad 0
NUMPAD/ Keypad #

3.2 Game Controller/Joysticks

Up to four game controllers can be used, where the first four in the device list will be used. Controllers 3 and 4 are only usable for paddle games that support that many players (e.g. Warlords). Only axis 0 and 1 are used for directional input. Controller button bindings can be set through the Console interface. To help this process, pressing "J" during gameplay will display the next joystick event (SDL host only). This is helpful when trying to figure out what the number is for a particular button out of, say, a possible 11. Game select, reset, and player 1 and 2 joystick swapping functions can also be assigned to controller buttons, but they will only work on the first controller in the device list. To avoid assigning any button to these functions, use an unusually high number:

joybuttons 0 1 99 99 99

This will assign "99" to the select, reset, and swap functions. Since your joystick probably does not have 99 buttons, they will never be triggered. Entering "h" on the console will print a helplist that includes documentation on what each joybuttons parameter represents.

3.3 Paddle and Lightgun Emulation via Mouse (SDL host only)

On paddle games, the mouse can be used as the paddle controller. Sensitivity is currently not configurable, but may be in the future. The mouse will also be used for lightgun games. Look for a small white dot that indicates where on the screen the "lightgun" is pointed at.

3.4 User Interface

3.4.1 Game Select Tab

The number of ROMs recognized in the roms/ directory is displayed in the lower left corner. To select a new directory, click the Select ROM File button, and navigate to the ROM directory of your choice. When a ROM file is selected, the rest of the directory contents will be scanned and will be presented for subsequent selection.

By default, .bin files will be displayed in the Open File dialog. To show .a78 files, use the File Type drop-down.

3.4.2 Settings Tab

There are five settings that can be adjusted on this tab. Settings will saved, so they will not need to be set manually every time the program is run.

3.4.3 Console Tab

This is a commandline interface to EMU7800. To see what commands are available, enter "h" for help. Saving game state can be done through this interface (as well as hitting F11 on the SDL host), and restoring game state can only be done through this interface.