Caprice32 v1.10 - The 32-bit Amstrad CPC Emulator
Copyright (c) 1997-1999 Ulrich Doewich
All Rights Reserved

Firmware and BASIC ROMs
Copyright Locomotive Software and Amstrad plc
Amstrad has given permission for their redistribution,
but retains the copyright

Caprice32 makes use of the CWSDPMI DOS extender, which is
Copyright (c) 1995-1997 Charles W Sandmann
check ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/
for the latest binary & source distributions

French translation by Emmanuel Roussin
German translation by Ulrich Doewich
Norwegian translation by Lars Magnus Hvattum
Spanish translation by Gerardo Briseo


DISCLAIMER ...............................................................

 This software is provided as is. The author accepts no responsibility for
 damages occurring as a direct or indirect result of using this software.


SYNOPSIS .................................................................

 Caprice32 is a software emulator of the Amstrad CPC 8bit home computer
 series. The emulator faithfully imitates the CPC464, CPC664, and CPC6128
 models. By recreating the operations of all hardware components at a low
 level, the emulator achieves a high degree of compatibility with original
 CPC software. These programs or games can be run unmodified at real-time or
 higher speeds, depending on the PC environment used.


COMPATIBILITY ............................................................

 What's emulated:

  CRTC  - CRTC type 0 (HD6845) - all standard operations
  FDC   - complete
  GA    - complete
  PPI   - complete
  PSG   - complete
  Z80   - all documented and undocumented opcodes
  extra - Romantic Robot's Multiface 2 hardware

 What's missing:

  CRTC  - not 100% accurate yet
  FDC   - not 100% accurate yet
  PSG   - not 100% accurate yet
  misc  - tape, printer, and additional RAM


REQUIREMENTS .............................................................

 Minimum system requirements:

  Pentium class CPU
  8MB RAM
  MS-DOS v2.0
  SVGA graphics card with VESA BIOS v2.0

 If your video card lacks a VESA BIOS, or has a version number less than
 2.0, I suggest you surf to http://www.scitechsoft.com/ and get hold of SDD
 (SciTech Display Doctor). It provides the VESA standard in a software layer
 which, in some cases, is even faster than the original version by the card
 manufacturer! For the purposes of Caprice32, the DOS version is sufficient.


INSTALLATION .............................................................

 NOTE: The distribution archive contains directories! Uncompress it with the
       -d command line switch, if you are using PKUNZIP.

 Depending on the environment you run Caprice32 in, you may or may not need
 the CWSDPMI.EXE file. It is only required if the emulator is to be run
 under plain DOS. Windows has its own memory management and therefore does
 not need the DOS extender - you may remove the file in this case.

 If you intend to use ZIP compressed DSK or SNA files, you will also need to
 get hold of Info-ZIP's Zip & UnZip. The latest versions should always be
 available from ftp://ftp.cdrom.com/pub/infozip/MSDOS/ . The files you are
 looking for are called zip??x.exe and unz???x3.exe, where ?? and ???
 represents the latest version number. All that is required from these
 packages is ZIP32.EXE & UNZIP32.EXE, which you should put anywhere on the
 current search path (as specified with PATH in your AUTOEXEC.BAT file).


GETTING STARTED ..........................................................

 Start Caprice32 by running CAP32.EXE. After viewing the copyright notice,
 you will be presented with the standard CPC startup screen: yellow text on
 a blue background. The PC keyboard will now imitate the keyboard of a CPC -
 so don't be alarmed if a key press results in something other than what is
 printed on the key! If you are not yet familiar with the CPC's keyboard
 layout, see the included KEYBOARD.GIF file for a simplified representation.

 The function keys of the PC keyboard are reserved for use by the emulator,
 and are assigned as follows:

  F1            <not used>
  F2            QuickLoad snapshot
  Ctrl-F2       load snapshot
  F3            <not used>
  F4            QuickSave snapshot
  Ctrl-F4       save snapshot
  F5            MF2 reset button (see FEATURES)
  Ctrl-F5       hard reset (clears memory)
  F6            file selector for CPC disk drive A
  F7            file selector for CPC disk drive B
  F8            options menu
  F9            capture screen to BMP file
  F10           exit emulation
  F11           MF2 stop button (see FEATURES)
  F12           emulation speed toggle
  Ctrl-F12      frames-per-second display toggle

 Some CPC keys had to be remapped to alternate locations:

  Left-Alt      CPC COPY key
  Insert        CPC CLR key
  Right-Alt     CPC \ key

 The purpose behind some of the not-so-obvious emulator features (e.g.
 snapshots) will be revealed in detail below. At this point, feel free to
 experiment with Caprice32, and return if something is unclear, or you wish
 to tweak the emulation for best performance.

 If you run into any kind of problems, please refer to the TROUBLESHOOTING
 section.


FEATURES .................................................................

 SNAPSHOTS

 Snapshots are used to preserve the entire state of the emulation at the
 exact moment the snapshot is taken. Used with a game for example, the
 snapshot facility gives you the ability to save your progress at any time.

 Caprice32 further offers a faster way to load and save a snapshot in the
 form of the QuickLoad & QuickSave feature. The first time either option is
 used, the normal snapshot file selector will be shown. On subsequent calls,
 the QuickLoad function will reload the same snapshot without prompting you
 for any input. Likewise, QuickSave will overwrite the active snapshot with
 the current emulator state.

 If you wish to load a different snapshot or save under a new name, use the
 same function key (F2 or F4) while holding down Ctrl. The QuickLoad/
 QuickSave mode will automatically be disabled when the emulation is reset
 (F5).

 NOTE: snapshots only store what is currently in memory. If for example, you
       are playing a game that loads level data from disk, you will have to
       have the DSK image in the CPC drive for the game to continue properly
       from the point the snapshot was taken. It is generally _not_ a good
       idea to take a snapshot while the CPC is accessing any of its disk
       drives.


 ROMS

 Caprice32 allows (just like the original CPC) the use of up to 251
 expansion ROMs. If you had additional ROMs for your CPC, you may be able to
 use them under Caprice32 as well. As a bonus, Richard Wilson's replacement
 disk operating system PARADOS is included in the Caprice32 archive. To
 activate it, remove the semicolon in front of the '#rom = 7, PARADOS.ROM"
 line in the CAP32.CFG file, and comment out "#rom = 7, AMSDOS.ROM" instead
 (see the CONFIG FILE section for more details). PARADOS is more tolerant of
 high capacity disk formats, and by default configures CPC drive B to be a
 double sided, 80 track capable disk drive. Enter the "|DRIVE" command at
 the BASIC prompt to access the built in utility suite of PARADOS.


 MULTIFACE 2

 Quoted from the MF2 manual:

 MULTIFACE 2 Is a true MULTIpurpose InterFACE for the CPC range with:
 1) Fully automatic back up of any program once loaded Into RAM
 2) 8K RAM extension - for software such as our INSIDER, or as a buffer, etc.
 3) MULTI TOOLKIT to study/modify/develop programs. POKE infinite lives, etc.
 4) TRUE RESET BUTTON which clears the first 64K CPC RAM.

 As you can see, quite a useful bit of hardware to have, and now it's
 available to you for use with Caprice32! To activate it, you first have to
 get hold of the MF2 ROM file - Try

  ftp://ftp.nvg.unit.no/pub/cpc/emulator/rom/multface.zip

 as one possible source. Uncompress the ZIP to the ROM directory and rename
 it to MF2.ROM. To have it load when Caprice32 starts up, the #mf2_rom
 keyword in the CAP32.CFG file needs to be uncommented (see the CONFIG FILE
 section for instructions).

 The MF2 is activated by pressing the F11 key. That should result in a two
 line menu at the bottom of the screen. To return to the CPC hit the r key.

 The complete MF2 manual will be available from the official Caprice32 web
 site (see HOW TO GET IN TOUCH for the URL).


INTERFACE ................................................................

 FILE SELECTOR

 The file selector used throughout Caprice32 uses the same layout and
 control method in all instances. When active, the display is split in two
 parts: the upper portion holds information relevant to the current mode,
 the lower part contains the actual file listing.

 Keys common to all modes:

  Cursor Up     move up by one entry
  Cursor Down   move down by one entry
  Page Up       move up by one screen
  Page Down     move down by one screen
  Home          move to top of file listing
  End           move to bottom of file listing
  Enter or      change drive/ directory, or select highlighted file (+ exit)
  Cursor Right
  Backspace or  return to parent directory
  Cursor Left
  Delete        prompt for deletion of highlighted file
  Esc           exit file selector

 Keys specific to the save snapshot file selector:

  Insert        save snapshot under new name

 Keys specific to the disk drive file selector:

  Cursor Right  change drive/ directory, or select highlighted file (no exit)
  Insert        insert a new, blank disk (see OPTIONS MENU)
  Tab           toggle write protect status of active disk
  Ctrl-E        eject disk from drive
  Ctrl-S        prompt for filename to save active disk under a new name

 All alphanumeric keys are used to quickly locate a desired file. If, for
 example, you wanted to select the file BLUESKY.DSK, you would only have to
 start typing B-L-U- etc., and the cursor would move first to the entries
 starting with B, then to those with BL, and so forth. To clear a search in
 progress, use one of the navigation keys. Searches are performed from the
 cursor on downwards, so if you want the search to apply to the entire
 listing, use the Home key first.



 OPTIONS MENU

 The options menu allows you to alter the performance and appearance of the
 emulation. Any changes you make will become active when you exit this
 screen. The menu is navigated with the following keys:

  Cursor Up     move up by one entry
  Cursor Down   move down by one entry
  Home          move to the first entry
  End           move to the last entry
  Cursor Left   scroll backward through all settings of the selected item
  Enter or      scroll forward through all settings of the selected item
  Cursor Right
  Esc           exit options menu


 Model Emulated

  Selects which of the three Amstrad CPC models you would like to work with.
  Most of the time you should have this set to 6128, as some software will
  require the additional 64K of RAM. Some older programs might insist on the
  use of the 464 however.


 Speed

  Controls the speed at which the emulated CPC runs. 'Original' is what is
  says: 100% original speed. 'No Slowdowns' means the speed throttling is
  removed and Caprice32 runs as fast as your PC allows it to. 'VSYNC' stands
  for Vertical Synchronization and forces the emulation to run at the
  vertical refresh rate of your monitors current resolution. How to use this
  setting is described in detail in the TIPS section.


 Interface Language

  Specifies what language Caprice32 is to present itself in.


 Joystick 1 & 2

  Allows you to set the method in which the CPC's joysticks are to be
  'emulated'. If set to 'Keyboard', CPC joystick 1 may be controlled via the
  following keys:

   Home         Joystick 1 up
   Delete       Joystick 1 left
   End          Joystick 1 down
   Page Down    Joystick 1 right
   Right-Ctrl   Joystick 1 fire

  'Analog PC', 'Atari on LPT1', and 'SEGA Genesis on LPT1' refer to physical
  joysticks attached to the joystick port and printer port respectively. See
  the TIPS section for more details on the last two settings.


 VESA Mode

  Lets you choose among the available video modes of your graphics card.
  Please note that the list has already been narrowed down to only contain
  those modes Caprice32 can actually use.


 CPC Resolution (X)

  Defines whether the CPC mode 2 resolution (640x200) is displayed normally
  ('Doubled' setting; only available in VESA modes of 640 and more pixels
  horizontally), or halved ('Normal' setting; allows Caprice32 to use VESA
  modes with less than 640 pixels horizontally).


 CPC Resolution (Y)

  Determines whether or not every display line is doubled, to maintain the
  correct aspect ratio of the CPC screen. This option is only effective if a
  VESA mode with a vertical resolution of at least 400 lines is used. The
  'Doubled using Scanlines' setting doubles the display by inserting a black
  pixel row between every CPC screen line, to mimic the look of an ordinary
  TV. It also does not incur the serious performance hit associated with the
  normal 'Doubled' mode.


 CPC Monitor Type

  Lets you choose between the two monitor types the CPC was sold with:
  'Colour' and 'Green'.


 Output

  Turns sound output through the PCs sound card on or off.


 Playback Rate

  Defines the playback rate of your PCs sound card. The 44kHz setting makes
  high notes sound clearer, but demands more processor time from the CPU.


 Mode

  Lets you choose between mono and stereo sound. The CPC always outputs
  sound in stereo; the mono option is only offered here to reduce CPU load
  on lower-end PCs.


 Access Indicator

  CPC disk drive activity can be shown via an on-screen indicator (red LED
  in the top right corner of the PC screen), by flashing the Scroll Lock LED
  of the keyboard, or both.


 Create New Disks in

  Determines which format a new disk has when inserted in either of the CPC
  disk drives. 'Data Format' and 'System Format' refer to the two standard
  formats that were used on the common 3" 180K CPC disks. If set to 'Custom
  Format', the Insert New Disk feature will use settings from the
  #custom_fmt keyword in the CAP32.CFG file (see the CONFIG FILE section for
  more details).


CONFIG FILE ..............................................................

 Caprice32 stores all settings relevant to the emulation in the CAP32.CFG
 file. It is automatically updated with any changes you make in the
 emulator. However, the file does includes a few additional settings that
 cannot be changed via the Options Menu. These keywords will be explained
 below.

 If you wish to make changes, load CAP32.CFG into a standard text editor
 such as EDIT.COM (MS-DOS) or NOTEPAD.EXE (Windows). Keywords start with a #
 symbol; Comments begin with a semicolon, and everything following one is
 ignored, until the end of the line.


 #path_rom
 #path_temp
 #path_sdump

  Defines the paths where Caprice32 looks for ROMs (CPC & expansion), stores
  temporary files (i.e. when unZIPping), and the place where screen captures
  are saved to BMP files.


 #max_file_count

  The maximum amount of entries the file selector will display. This number
  includes all drives, directories and files.


 #custom_fmt

  Used by the Insert New Disk feature of the file selector, this keyword
  defines a custom format to use. The syntax is: "tracks, sides, starting
  sector number". A "custom_fmt = 80, 2, 1" line for example, would create a
  double sided, 80 track DSK image, with nine 512 bytes sectors to each
  track.


 #OEM_name

  Influences which power-on message the emulated CPC will have. Possible
  choices are:

   0    Isp
   1    Triumph
   2    Saisho
   3    Solavox
   4    Awa
   5    Schneider
   6    Orion
   7    Amstrad


 #splash_screen

  Controls whether or not to display the Caprice32 copyright message when
  starting the emulator.


 #rom

  Caprice32 allows you to add as many as 251 ROMs to the emulated CPC. The
  syntax is: "#rom = ROM number (1-251), ROM file name". For a ROM to be
  initialized during the CPC's startup sequence, its ROM number has to be
  between 1 and 7 for the CPC 464, and between 1 and 15 for the CPC
  664/6128. The ROM file should be placed in the designated ROM subdirectory
  (specified by the #path_rom keyword, see above), and should be at most
  16384 bytes long. Naturally, only those ROMs which do not rely on extra
  hardware will work correctly. If you want to see a specific ROM/hardware
  add-on emulated by Caprice32, please let me know and I will tell you what
  additional information I may required to support it.


 #mf2_rom

  If this keyword is included in the CAP32.CFG file, the parameter is used
  as the name of the Multiface 2 ROM file. Remove the keyword, or place a
  semicolon in front of it, if you do not want the MF2 active in the
  emulation. Please note that Caprice32 does not give any indication whether
  or not the MF2 ROM load succeeded - if F11 does not work in the emulation,
  then most likely Caprice32 couldn't find the ROM under the specified name!


TIPS .....................................................................

 LOADING GAMES

  Start the emulator and hit F6 to open the file selector for CPC drive A.
  Using the cursor keys, navigate to where you placed the DSK or the ZIP
  which contains it. Highlight the desired file and press Enter. Back on the
  blue CPC screen, type CAT to list the contents of the disk image. Two
  things can happen at this point: a) either a bunch of names appears, or b)
  you get a 'Drive A: read fail' error message. Depending on what you got,
  follow the instructions in the corresponding paragraph below.

  a) locate the file with the smallest size and a .BAS, .BIN, or no
     extension. Enter this file name; now hold down CTRL, press the left
     cursor key once, and while still holding CTRL hit the Enter key of the
     number pad. That will result in a RUN"<filename> command which should
     get things going. However, sometimes the file you identified is not the
     game's loader, and the RUN" command results in a 'BASIC 1.x' or 'Memory
     full' message. In that case, use CAT to locate a different file and try
     the same procedure again.

  b) reset the emulation (F5) and try starting the game with the |CPM
     command. The | symbol is entered by pressing Shift+[ (US keyboard). If
     this still results in a read error then most likely the DSK image is
     corrupt, or not a valid CPC disk.


 SMOOTH SCROLLING

  Many demos and some CPC games use a special 'technique' to achieve
  eye-pleasing, silky-smooth scrolling effects. This can be recreated with
  Caprice32, _if_ your monitor is capable of running at a vertical refresh
  rate of 50Hz (check your monitor's manual).

  Assuming your monitor can handle the 50Hz refresh rate (most modern
  multi-sync monitors do), get hold of a freeware utility called
  "UniRefresh" from http://home.student.utwente.nl/r.muller/unirefresh , and
  configure it according to the instructions in its readme file. Before
  leaving the UniRefresh Setup program, change the refresh rate of the VESA
  mode you wish to run Caprice32 in (only 8 bpp modes), to 50Hz. Save your
  changes and exit. Next run UNIRFRSH.EXE, and finally start Caprice32. Go
  to the Options Menu (F8) and change the 'Speed' setting to 'VSYNC'. That's
  it!


 JOYSTICKS

  Wouldn't it be great if you could use the same digital joystick that you
  had connected to your CPC, with Caprice32? Well, guess what?! Not a
  problem - _if_ you don't mind building a small interface...

  All the information and construction plans you need can be found on the
  DirectPad Pro homepage at: http://www.ziplabel.com/dpadpro/index.html

  Caprice32 only supports the Atari/SMS and Genesis interfaces right now, on
  printer port 1 (LPT1). If you want to see support for other gaming
  devices, let me know.


 JERKY VIDEO / SOUND BREAK-UP

  If you are running Caprice32 from a DOS box within Windows, chances are
  you experience sudden slowdowns, jumps in the video output, and/or
  occasional sound interruptions. All symptoms can be attributed to the
  multitasking of Windows. It is therefore advisable to remove all other
  programs from memory, especially those applications sitting in the tray
  area (e.g. ICQ), before running Caprice32. If the problem persists, run
  the emulator from plain MS-DOS: select "Restart in MS-DOS mode" from the
  Windows Shut Down menu. When you're done with Caprice32, you only have to
  type "exit" at the DOS prompt to reload Windows.


TROUBLESHOOTING ..........................................................

 ERROR - LANGUAGE.DAT not found or corrupt!

  The LANGUAGE.DAT file must be located in the same directory as CAP32.EXE.
  If it is present, it might have been corrupted, in which case you should
  simply restore it from the distribution archive.


 ERROR - ROM file not found!

  The path to the ROM directory is invalid, or the CPC ROM files are
  missing. Check the #path_rom keyword in the config file; make sure the
  files CPC464.ROM, CPC664.ROM, CPC6128.ROM and AMSDOS.ROM are present in
  the ROM directory.


 ERROR - valid ROM slots are 1 - 251!

  One of the #rom keywords in the config file uses a ROM number that is out
  of range.


 ERROR - <filename> not found!

  One of the #rom keywords in the config file specifies a ROM file that does
  not exist. Expansion ROMs must be located in the directory specified by
  #path_rom.


 ERROR - BLASTER variable not set!

  The driver install software of your SoundBlaster (compatible) card should
  have placed a line into your AUTOEXEC.BAT file, that reads something like
  this (only the first three parameters are important; values may differ
  from your case):

   SET BLASTER=A220 I5 D1 H5 P330 E620 T6

  If it is missing, consult the manual that came with your sound card on how
  to set it up for use in MS-DOS.


 ERROR - BLASTER variable improperly set!

  One of the required values (A, I, or D) is missing from the BLASTER
  environment variable. Consult the manual that came with your sound card on
  how to set it up for use in MS-DOS.


 ERROR - only DSP v2.00+ supported!

  The sound card in your system does not have some of the features required
  by the sound code of Caprice32. Unfortunately, there is no workaround -
  edit the CAP32.CFG file and set #sound to 0 (see the CONFIG FILE section
  for more details).


 ERROR - no VESA BIOS found!

  Caprice32 requires a SVGA graphics card with a VESA BIOS. See the
  REQUIREMENTS section for a solution to this problem.


 ERROR - at least VBE 2.0 required!

  The VESA BIOS of your video card does not support some of the features
  required by the graphics engine of Caprice32. See the REQUIREMENTS section
  for a solution to this problem.


 ERROR - no video mode supports linear memory access!

  None of the video modes of your graphics card supports memory access in
  one continuous block. See the REQUIREMENTS section for a solution to this
  problem.


 ERROR - mapping video memory to RAM failed!

  The memory of your video card could not be mapped to main memory. SDD may
  be able to alleviate this problem. See the REQUIREMENTS section to find
  out where to obtain it.


 ERROR - set video mode failed!

  The requested video mode could not be initialized. SDD may be able to
  alleviate this problem. See the REQUIREMENTS section to find out where to
  obtain it.


HOW TO GET IN TOUCH ......................................................

 If you want to let me know what you think about Caprice32, submit a bug
 report, or have a suggestion for a future version, drop me a line via one
 of the following methods:

 e-mail:
   caprice32@cybercube.com

 snail mail:
   Ulrich Doewich
   112 Tea Rose Street
   Markham, Ontario L6C 1X3
   Canada

 You can always find the latest version of Caprice32 and other utilities
 authored by me on the official Caprice32 web site at:

   http://www.classicgaming.com/caprice


BACKGROUND INFORMATION ...................................................

 Caprice32 is written entirely by me. The emulation core is 32 bit protected
 mode x86 assembly code; the menu and file handling routines are written in
 C. I use two excellent freeware utilities to develop the emulator: DJGPP
 and NASM - which (once you figured out how) work _very_ well together! :)


ACKNOWLEDGEMENTS .........................................................

 Thanks must go out to...

   My brother Ralf, who is a great resource when it comes to hard and
   software problems. Together we have traced quite a few signals of the CPC
   hardware. He is also responsible for designing the Caprice32 logo and all
   other graphics used in the emulator.

   Kevin Thacker, with whom I have frequent e-mail exchanges. We've pinned
   down the inner workings of the CRTC/GA combo pretty accurately now, and
   continue to delve deeper into their secrets until we perfect the video
   emulation...

   Simon Tatham and Julian Hall, for creating NASM - The Netwide Assembler.
   Anyone interested in this _free_ x86 assembler that can produce both 16
   and 32 bit code should point their browser to:
   http://www.web-sites.co.uk/nasm/

   Dirk Junker, who was kind enough to send me his Schneider CPC 6128 from
   Germany. Without having the actual machine to test software and theories
   on, Caprice32 probably wouldn't exist today!

   Brian Watson, for sending me a replacement drive belt for the CPCs 3"
   floppy disk drive.

   Marco Bergman, for sending me his CPC mouse - which shall be emulated in
   an upcoming Caprice32 version.

   Duane Doucet, for lending me one of his Matrox Millenium boards, so that
   I could fix my video code to work with it.

   Richard Wilson, for giving permission to include his AMSDOS replacement
   ROM PARADOS with Caprice32.

   Sergio Bayarri
   Ricardo Bittencourt Vidigal Leitao
   Gerardo Briseo
   Christophe Copin
   Craig Harrison
   Lars Magnus Hvattum
   Frederic Herlem
   Vaggelis Kapartzianis
   Noel Llopis-Artime
   Emmanuel Roussin
   Bernd Schmidt
   Marco Vieth

 ...and last, but certainly not least, to all the users of Caprice32!
