SoftVCS

 

"computer techniques and methods"

 

 

SoftVCS

 

SoftVCS: Atari 2600 VCS Emulator

Although there are several excellent Atari 2600 emulators available, SoftVCS has some unique features which might recommend it to a small class of enthusiasts. A brief summary of those features follows. Please take the time to read all items before attempting to run any of the applications.

I. Platform dependencies

SoftVCS is not a portable, cross-platform emulator. It was written as a high performance Windows specific engine in Intel Pentium assembler language. The emulator architecture is intended to support extensive debugging capabilities for game developers and forward compatibility with future version of Windows. This forward compatibility is assured by drawing all video frames to an off-screen bitmap which can be analyzed, modified or blitted to the video system using low-level GDI or DirectDraw calls. The sound system is easily managed by DirectSound and high performance input devices can be accessed by DirectInput.

The loss of portability implied by an operating system and processor specific implementation is not quite as serious as it seems. In terms of numbers of potential users, it is practically insignificant. The forward compatibility with future versions of Windows largely makes up for the loss of compatibility with legacy systems or alternative platforms. Time, as they say, marches on.

Furthermore, note that there has been a running difficulty with some existing emulators in dealing with advanced video and sound cards. Laptops, which have LCD screens and non-standard sound systems, often fail to run them properly. Furthermore, since DOS is no longer supported by Microsoft, legacy sound systems may not work at all under Windows XP or the next generation of Windows. Hence, a game engine which is designed to work through standard Windows devices can avoid all present and future problems associated with video mode switching, SoundBlaster compatibility, etc.

II. Licensing requirements

The source code for SoftVCS is entirely in the public domain. No license agreements, copyrights, copylefts, nag screens, restrictive covenants, or obligatory acknowledgments of any kind are imposed on its use.  (Source code will be posted at the time of the first beta release.)

By designing the low level engine for DirectX compatibility, the need for 3rd party cross-platform video libraries with their usage restrictions, however lenient, has been completely eliminated. Moreover, the inclusion of a complete sound emulator eliminates the need for 3rd part sound libraries. Applications using the emulator can be written without negotiating agreements with any other party or packaging the result in any obligatory manner.

III. SoftVCS emulator architecture

Low level structure

The software engine make extensive use of jump tables for emulating the CPU (6507), the TIA and the RIOT chip. While jump tables are not particularly elegant, they can replace convoluted decoding algorithms, simplifying tracing and debugging. For example, each of the possible CPU opcodes is handled by indexing into a 256-address jump table with one entry for each opcode. Hence, it is easy to trap any CPU instruction or add code for undocumented instructions. While this approach can take more code than other methods, the execution trace history is clearer and the amount of code required is of no consequence in modern systems (about 25kbytes instead of 10kbytes)

The TIA register accesses are also managed by jump tables, as are the RIOT registers. Hence, there is one unique code block for each register.

High level organization

Each frame is drawn to a Windows bitmap. The bitmap is then blitted or stretch-blitted to a suitable display using GDI or DirectDraw, eliminating the need for changing video modes or screen resolution. In fact, the game player application shown below allows the user to resize the game to any size or aspect ratio desired.

Sound is managed by filling a suitable external buffer with 8-bit stereo sound from TIA channel 0 and channel 1. A simple DirectSound interface supports continuous sound through any available Windows device, eliminating the requirement of SoundBlaster compatibility or any other sound card constraint.

IV. Documentation

Complete documentation covering the architecture of the emulator, interface requirements, etc. will be made available with the first release.

V. Bugs and limitations

There are too many bugs in the current software to release the code for general use at this time. This web page should be regarded as little more than a notification of a work-in-progress. Limitations currently include: single player support only, no difficulty switches, no external input devices, no latching ports or paddles. Bank switching is not supported yet, so only 2k or 4k games can be played.

VI. Development status

This software does not yet rise to the level of an alpha version. It is currently at a proof-of-concept and will stay at this level until all functionality has been included. The specific limitations are listed above.

APPLICATIONS

Atari 2600 VCS Game Player

Screen Shot of SoftVCS Game Player


CAUTION: The game player above, which can be downloaded from this link, must be run on a Windows system with at least a 2GHz clock rate. The reason for such an extraordinary requirement is that this application allows the user to resize and reposition the game display at will. No longer is there any need for video mode switching and video card incompatibility problems. Simply set the size and shape of the display the way you want it, even in the middle of a game. The price paid for using the GDI is that Windows has HUGE overhead. SoftVCS only requires about 2msec to complete a screen, the rest of the frame time is used by Windows. Using DirectDraw for the video would alleviate the performance bottleneck considerably, but this particular application was written to illustrate a point -- namely, that with the current generation of Windows systems a game emulator can exhibit acceptable performance while retaining the benefits provided by Windows graphics management capabilities. Since my focus is on forward compatibility, the 2GHz threshold is not serious. By 2005, over 50% of the installed base of personal computers will meet that requirement.  (Maybe the code will be debugged by then!)


About SoftVCS Game Player

This application is a simple game player which allows the user to play any of the built-in games by simply clicking its image. Four tabs allow selection of different groups of games for a total of 48 games. Although there are many bugs in the current software, most VCS games are playable. Some exhibit problems with garbled or missing score digits, vertical jitter or excessive flickering. In this game player, the games in Group 1 and Group 2 seem to be OK. The games in Group 3 and Group 4 exhibit minor display problems. Please don't forget that this application requires a Windows system with at least 2GHz clock rate. The next game application I post will use DirectDraw and DirectInput, so these requirements should relax considerably.

Control Keys

The game player uses the arrow keys to emulate joystick direction control and the <CTRL> key to emulate the fire button. The keyboard F1 key is used for RESET, F2 for SELECT and F3 for COLOR/BW. The <ESC> key can be used to return from the game to the game Group screen. Only one player is supported.

A typical play sequence would consist of the following steps:

At this point the startup screen of the chosen game will appear in a resizable window. If desired, change the display size, shape and location to suit yourself, then:

Now game play can begin. Use the arrow keys and the <CTRL> key to play. When done, click the upper right form close box, or just press the <ESC> key. Either one will return you to the main application screen.

NOTE: The software available from this web page is experimental and contains very little bulletproofing. If your system does not support DirectX 7.0 or above, the application will simply crash. If you try to run it on a system which is too slow, you will become very angry. I cannot apologize for the deficiencies and weaknesses in the current revision, because it is simply not ready for release at this time.

Atari 2600 Game Analyzer

Screen Shot of SoftVCS Analyzer<

This application is intended as an aid to game developers. It does not rise to the level of debugger, but it does have several features which might be useful. Among these are the ability to RUN or STEP through a game, to control frame rate, to examine the contents of Zero Page and to determine all objects present at any pixel location. An archive containing the Analyzer and a VCS game can be downloaded here. Since this application is intended for display analysis, the sound has been disabled.

Platform Dependencies

The SoftVCS Analyzer must be run under a recent version of Windows with a Pentium processor running at 2GHz or higher. The decision to forgo platform independence and backward compatibility with legacy systems was a difficult, but conscious choice. The emphasis is on forward compatibility with future versions of Windows and independence from licensing requirements, however slight. All code has been written by me, and will be offered into the public domain with each release.

Game Play

Games are loaded from the file menu. At the present time, SoftVCS only supports 2k or 4k games because bank switching has not been implemented. Furthermore, not all games will play properly for a variety of soon-to-be-corrected reasons. Nevertheless, for those games that do play, the Analyzer can reveal much useful information.

After the game has been loaded, simply click 'Run' to begin play. Only one player is currently supported. The usable keys are:

Run/Step

At any time during game play, the Analyzer can be switched to Step mode by clicking the Step key. In this mode, the game will advance one screen per click. Clicking the Run key returns to Run mode.

Frame Controls

A frame counter is provided that keeps track of the number of frames completed since the start of the game. It also operates correctly in Step mode. The frame rate can be controlled by the slider below the game window. 

Special Display Analysis Features

The heart of the analyzer is a screen oriented probe capability. Moving the Windows cursor onto the game Window activates the probe. A special 'crosshair' cursor appears which allows the user to pinpoint any pixel in the game display. As you move the cursor around the display, you will see a magnifier locating the target pixel clearly. The cursor (X,Y) position is also indicated.

Clicking on the mouse button will update the 'objects' panel revealing the presence of any and all objects at the target pixel under the cursor. If any objects overlap at that point, all of them are correctly identified. A dump of page zero is also done at the exact pixel location chosen. The contents of page zero can be browsed in the adjacent box.


CAUTION: SoftVCS is not a completed package, and does not yet rise to the level of an alpha version. At this time it is best regarded as a proof-of-concept or a work in process. Input flexibility is limited. Bank switching is not supported. Bugs abound.