                                v7800 V0.12
                            (Virtual Atari 7800)

             Copyright 1999 by Daniel Boris (dboris@erols.com)

---------------------------------------------------------------------------
Copyright:
v7800 is copyright 1999 by Daniel Boris.

Multi-6502 32 Bit emulator
Copyright 1996, 1997, 1998, Neil Bradley, All rights reserved
Distribution: ftp://ftp.synthcom.com/pub/emulators/cpu/make6502.zip (latest)

TIA sound emulation was done with TIA Sound V1.0 by Ron Fries.

v7800 was written using DJGPP a free 32bit C/C++ development system:

        http://www.delorie.com/djgpp/ 

v7800 uses Allegro, an excellent game programming library for djgpp by Shawn
Hargreaves:

	http://www.talula.demon.co.uk/allegro/

v7800 uses the SEAL sound library. SEAL Synthetic Audio Library API
Interface Copyright (C) 1995, 1996 Carlos Hasan. All Rights Reserved:
http://www.egerter.com/

-------------------------------------------------------------------------
Licence:

v7800 is free as long as it is not used in a commercial matter and not
altered in any way. The contents of this archive should not be
added to or changed in any way. 

I maintain the right to forbid the use of the emulator  at
any time. I am not responsible for any damage caused by the use
of this program. This program is distributed "as-is". I make no
guarantees as to it's accuracy, performance, or compatibility with
the users hardware.

v7800 may be distributed freely as long as NO MONEY is charged for the
distribution.

---------------------------------------------------------------------------    

Introduction
        
v7800 is an Atari 7800 video game emulator for MSDOS. I originally
wrote this code to be part of the MESS multi-system emulator but also decided
to release it as a standalone emulator while the next version of MESS is still
in development. This emulator is a pretty quick and dirty hack of my code so
it's not perfect and a little slow, but it's playable.

The current version of v7800 can be found at:

    http://www.atarihq.com/danb

If you find any bugs please e-mail me at: dboris@erols.com.

----------------------------------------------------------------------------

Setup:

        Before you can run v7800 you need a copy of the 7800 BIOS ROM. For
copyright reasons I am not including this ROM image in this archive, but
it can be found at:

        http://www.emuviews.com/

Once you get the image be sure it's named 7800.rom and put it in the same
directory as the emulator.

If you are running under plain MSDOS you must copy the file CWSDPMI.EXE to
your root directory.

You will also need cartridge images, but again for copyright reasons I cannot
provide these. PLEASE DO NOT E-mail me asking for ROM images! All messages
asking for ROM images, or asking where to get ROM images will be promptly
deleted. The carts must have a 128 byte header to work properly with v7800,
see details on this below. ROMS with the extension .A78 will probably
already have the header attached.

The following games run almost perfectly:
Pole Position II, Ms Pac Man, Galaga, Dig Dug, among others.

------------------------------------------------------------------------------------

Basic Usage:

Unzip v7800 into it's own directory (c:\v7800 for example) and put the bios
rom and game ROM images in the same directory. To start the emulator goto a
DOS command prompt, change to the directory you unzipped v7800 into, then
type v7800 followed by the name of the ROM file you want to load. For example
to load a file called poleii.a78 you would type:

V7800 POLEII.A78

-----------------------------------------------------------------------------
Config file:

v7800 supports a default configuration file. This file (v7800.cfg) will be
automatically created the first time you run the emulator. The config file
specifies all the default configurations that are to be used by the emulator.
The options in the [config] section of the file correspond to the command line
options. For example "fr = 1" in the config file means to use a frame skip rate
of 1. Any command line options you use when running the emulator will override
the setting in the config file. So, for example, if you start the emulator with:

v7800 poleii.a78 -frame=3

the emulator will use a frame skip rate of 3 instead of 1. If there is not a config
file entry for an option and you don't specify a command line option for it, then
the emulator will use and internal default.

The only config option that does not correspond to a command line option is
the 'path' option. Path sets the directory to use when loading roms. So if
you have 'path = c:/v7800/roms/' in the config file, and you type:

v7800 poleii.a78

the file: c:/v7800/roms/poleii.a78 will be loaded. If you put a path in the
command line then it will override the config file:

v7800 c:/v7800/poleii.a78

will load the file c:/v7800/poleii.a78

-----------------------------------------------------------------------------
Command line options:

v7800 file -[options]

        file - 7800 ROM image to load. This must be a raw binary file, with a
        special 128 byte header.

        -frame=# - Sets frame skip rate. The emulator will display 1 out of
        every # frames. The higher the number, the faster the emulation, but
        more frames are skipped. I find that a frame rate of -frame=4 works
        good for most games.

        -top=# - sets the first scanline to display on the screen. Default
        is 32. The 7800 screen is only supposed to be 192 lines high, but
        some games stretch this beyond 200, thus the emulator will cut off
        the bottom of the image. The image can be shifted up and down with
        this setting.

        -modex - This makes the emulator use the VGA 320x240 Mode. This
         mode is slower the normal mode, but allows for a bigger display.

        -control =
            This configures what type of control you wish to use. After the
        equals put one of the following options:

           key    - Disables all other controls and uses the keyboard.

           stick - Enables a real joystick to be used in digital mode. This
                    mode works good for most games.


         -nostick - Disables real joystick. This will override any other
          joystick command line options.

        -nosound - Disables sound emulation.

        -nolimit - Disables the speed limiter.


----------------------------------------------------------------------------
Cart Header:

To work with this emulator ROM images must have this 128 byte cart header at
the start of the raw data. This header allows the emulator to know the features
of the cart thus preventing you from having to use a bunch of command line
options.

0      Header version     - 1 byte
1..16  "ATARI7800      "  - 16 bytes
17..48 Cart title         - 32 bytes
49..52 data length        - 4 bytes
53..54 cart type          - 2 bytes
    bit 0 - Pokey cart
    bit 1 - Supercart bank switched
    bit 2 - Supercart RAM
55     controller 1 type  - 1 byte
56     controller 2 type  - 1 byte
    0 = None
    1 = Joystick
    2 = Light Gun

100..127 "ACTUAL CART DATA STARTS HERE" - 28 bytes

-------------------------------------------------------------

Controls:

    Arrow keys = Joystick 1
    E,D,S,F    = Joystick 2
    Left Ctrl       = Fire A Stick 1
    Left Shift      = Fire B Stick 1
    Right Ctrl       = Fire A Stick 2
    Right Shift      = Fire B Stick 2

    Q          = Leave the emulator
    F1         = Reset
    F2         = Start
    F3         = Pause

----------------------------------------------------------------------------

Limitations:
- No POKEY sound emulation in Ballblazer
- Only supports standard carts, supercarts not supported
- Does not run Atari 2600 ROMS, you can use standalone 2600 emulators for this
  like Stella or PC Atari.

Know Problems:
Ballblazer - No sound, flickery display
Xevious - Colors
Donkey Kong - Colors

---------------------------------------------------------------------------
Version History:

v0.10  05/17/99 First Public Release
v0.12  06/17/99
  - v7800 now shuts down properly when started with -nosound
  - Fixed VBLANK timing. (Foodfight)
  - Added support for 48K carts
  - Added pause button
  - Fixed holey DMA support (holey DMA only above $8000)  (Lucasfilm logo)
  - Replaced 6502 CPU core with Neil Bradley's ASM 6502 core. (Increased
    speed, and accuracy)
  - Fixed handling of fire buttons.
  - Implemented Debugger. Only available in debug version.
  - Config file is now names v7800.cfg instead of 7800.cfg.

