                           SVI Emulator 0.33

                    SVI-318/328 emulator for MS-DOS
                 Copyright (C) 1998-2000 Jimmy Mrdell

                  http://www.acc.umu.se/~yarin/sviemu/


HARDWARE REQUIREMENTS
=====================
A 486SX-25 (Pentium 90 recommended)
A VGA card
SB supported


KEYBOARD MAPPING
================
STOP        Scroll Lock
LEFT GRPH   Alt
RIGHT GRPH  Alt Gr
SELECT      PgUp
PRINT       PgDn


SPECIAL KEYS
============
\           Run emulator at full speed (no sync)
F6          Rewind tape (to the beginning)
F7          Wind tape (next saved entry)
F8          Reset the emulator
F9          Enter debugger
F10         Enter menu system
F11         Quicksave image
F12         Quit


COMMAND LINE OPTIONS
====================

FILE SELECTING

-rom <filename> [SVI.ROM] Select ROM file (must be 32768 bytes)
-tape <filename>          Select tape
-tapa <filename>          Select tape + load & run the first program
-cart <filename>          Select cartridge
-image <filename>         RAM image to load
-printer <filename>       Redirect printer output to a file
-diska <filename>         Select disk image for drive 1
-diskb <filename>         Select disk image for drive 2

SYSTEM CONFIGURATION

-model <n>  [328]     Choose SVI model:
                        318 - SVI 318 with 16k RAM (lower bank 02)
                        328 - SVI 328 with 64k RAM (bank 02 & 21)

-ram16                Simulates the use of a 16k RAM card
-ram64 <nn;nn;..>     Simulates the use of one or more 64k RAM
                      cards. Parameters are the RAM banks to be used,
                      separated by a semicolon. Valid banks are:
                        02 (no effect on 328 or 318 with -ram16)
                        21 (no effect on 328)
                        22
                        31
                        32                     

-joy1 <n>   [1]       Choose joystick emulation keys:
-joy2 <n>   [2]         0 - Don't simulate this joystick
                        1 - Arrow keys
                        2 - Numeric keypad
                        3 - Arrow keys, but disable those as keyboard keys
                        4 - Numeric keypad, but disable those as above
-speed <n>  [1]       Choose emulation speed:
                        0 - As fast as possible
                        1 - 100%
                        2 - 200%
                        4 - 400%
-sprite <n> [0]       Choose sprite emulation mode:
                        0 - Don't remove fifth sprite
                        1 - Remove fifth sprite (may cause flicker)


DISPLAY & SOUND

-video <n>  [0]       Choose video mode:
                        0 - Mode 13h (320x200)
                        1 - Mode-X   (320x240) (Slow, P200 recommended)
-pal <n>    [0]       Chooses palette to use:
                        0 - Default palette
                        1 - Another palette (if you got a dark monitor)
                        2 - Grayscale (monochrome nostalgy!)
-sound <n>  [1]       Choose sound:
                        0 - Off
                        1 - SB autodetect

OTHER

-showspeed            Show emulation speed
-psg <name>           Saves states of PSG register 50 times/second to <name>
-smp <name>           Saves SB output to file (unsigned, 8 bit, 22khz)
-bin <name> <addr>    Patches a binary file into <addr> (Bank02)


DEBUG

-debug                Start in debug mode 
-traceio              Write all executed I/O instructions to stdout
-tracepsg             Write I/O to PSG to stdout
-tracevdp             Write I/O to VDP to stdout


DEBUGGER
========
Q            Quit emulator
G [<addr>]   Continue emulation, until <addr> (if specified)
D [<addr>]   Dump 128 bytes of VRAM to screen
S            Show screen 0 in textmode (obsolete)
V            Dump VRAM to file VRAM.BIN
H            Show hardware info (VDP & PSG)
HV <r><v>    Change VDP register <r> (0-7) to <v> (00-FF)
P            Proceed current instruction (execute instruction/call)
T            Trace instruction

(any other key will currently also trace)


MENU OPTIONS
============
 1. Change tape name

     Select a new tape image. If no path is given, the program first
     searches in the default TAPE path, and after that in the current
     path. If the image is not found, you'll will get the chance
     to create a new tape. The new tape is stored in the TAPE path.
     If no image is specified, the current tape is simply ejected.

 2. Change RAM image

     Select a new RAM image to save/load from. If no
     image specified, the default QUICK.IMG is chosen.

 3. Change PSG image

     Select a new image to record PSG files to. A NEW file will
     ALWAYS be created after you selected this option, unless you
     just press enter.

 4. Change SMP image

     Select a new sample image. The recording starts right away.

 5. Start/Stopp PSG recording

     If a PSG image is specified, it's possible to record the
     the PSG register at 50hz. This .PSG file can be converted
     by PSG2YM in the Utils\ directory, and later played with
     STsound95.

 6. Screenshot

     Stores the screen (not the border) in a .BMP file. The first
     file in the format SVIxxx.BMP (where xxx is 0-999) that doesn't
     exist is used.

 7. Load image

     Load the current selected RAM image.

 8. Save image

     Save the current RAM memory to an RAM image.

 9. Resume emulation

     Continue the SVI-318/328 emulation.

10. Quit

     Quit the SVI-318/328 emulator.


ABOUT RAM IMAGES
================
A RAM image saves only the RAM memory and registers of any sort,
not other settings. For instance, if you're using the
cart SWECHARS.ROM when making a RAM image, you must use
the same cart when loading the image, since the SVI will most
likely crash else.

Currently the whole RAM memory is stored, even though many
banks may not be available. This may be changed in a later
version of the emulator. In that case, it will most likely
still be possible to read the old images.


ABOUT TAPE IMAGES
=================
A tape image can be at most 512k, which should be enough for
anyone. Currently the tape emulation is faked, which means
that program using their own tape saving functions (The hobbit,
the MSX emulator, etc) won't work. True tape emulation is hard,
and although it might be added later, don't expect it.


AUTORUN
=======
If you select a tape with the -tapa option instead of -tape,
the first program on the tape is checked, and automatically
run. When such a program is run, an internal RAM image is
used, which consist of a newly reset SVI, all banks
available and no cartridges used. So there's no point
in specifying other system parameters.

If the first program on the tape is not a CSAVE or BSAVE
program, the -tapa functions as a simple -tape. Note that
programs saved with SAVE aren't supported yet.


CONFIGURATION FILE
==================
Currently the SVI.CFG file contains two different sections:

Default paths

  When using images, it's often nice to store different kind
  of images in different directories. This is tedious if
  you have to specify the directory name all the time. By
  using default paths, this isn't necessary.

  In this version of the emulator, only the TAPE and CART
  default paths are actually functional. Whenever you
  load a tape and/or a cart, the default path is first
  search for the file. If it isn't found, the current
  path is searched. If the name of the tape consist
  of a path, the searching in the default path is skipped.
  Creating a new tape in the current directory is thus done
  by adding .\ in front of the tape name.

Configurations

  Using parameters is nice, but when you use many of them,
  many the same, every time you start the emulator. Therefore,
  you can set up standard parameters. The parameters in the
  default configuration is ALWAYS used.

  Adding your own configurations is done by simply typing
  the name of the configuration, an equal (=) sign, followed
  by the parameters. To use a configuration, you use the
  parameter -<configuration name>. For instance:

    [Configurations]
    megalone = -tapa megalone -joy2 4

  Starting the SVI-318/328 emulator with the following line

    svi -megalone

  would automatically load megalone from tape, and also
  disable the numeric keypad.

  Note that you cannot override the names of the standard
  options. Thus, a configuration with the name 'speed' wouldn't
  be possible to use, since it would try to set the emulator
  speed in stead. Also note that you can call on a configuration
  from a configuration, and also that creating circular loops
  this way is no problem - the configuration is only used the
  first time.


TROUBLESHOOTING
===============
If the session hangs when starting the emulator, it's most
likely because of the badly implemented sound support. Currently,
only SB is supported, with autodetect. If you're running another
application using the soundcard, you will get an error message.
If it hangs, try press F12 to quit, and use the -sound 0 option
to run without sound.


HOW TO CONTACT ME
=================
Email.....: yarin@acc.umu.se
IRC.......: Often on EFnet/IRCnet as Yarin
ICQ.......: 14193765 
Homepage..: http://www.acc.umu.se/~yarin/


CREDITS
=======
Berndt Schmidt   - The Z80 core in the CPE emulator
Michael Cuddy    - PSG emulator
Shawn Hargreaves - The Allegro library
Marat Fayzullin  - The Z80 core in C (used in the early stage)
Marcel de Kogel  - fMSX-DOS
Sean Young       - TMS9918A VDP description
Tomas Karlsson   - The Unofficial SVI homepage, beta testing
Johan Winge      - SviCasMan, beta testing

Also thanks to (in no particular order)
  David Rydh, Burkhard Arenfeld, ...
