home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 25
/
CD_ASCQ_25_1095.iso
/
dos
/
prg
/
cpe50
/
cpe.doc
< prev
next >
Wrap
Text File
|
1995-09-15
|
46KB
|
900 lines
CCCCC An Amstrad CPC emulator
CC
CC Copyright 1991-1995 Bernd Schmidt
CC GUS support Copyright 1995 Ulrich Doewich
CCCCC PPPPP
PP Amstrad and Locomotive Software permit the
PP use of the included ROM images with an
PP emulator, but retain the copyright.
PPPPP
PP This program is freeware. You may
PP distribute it freely, provided that you
PP EEEEE do not charge a fee of more than DM 8,-
EE EE or the equivalent in any other currency
EEEEEE for copying the disk and provided that
EE you always distribute the whole archive
EEEEE V.5.0i including all the files.
-----------------------------------------------------------------------------
1. What is this then?
=====================
This is a doc file. It belongs to a program called CPE, which can emulate an
Amstrad CPC on your IBM compatible 386-AT. All files in this distribution are
public domain, you may distribute them freely, but you may not charge more
than a fee of DM 8,- for copying. If you want to include CPE with other
programs on a CD-ROM, you may do so. In any case you must preserve the
original contents of the archive; you may not modify any of the files, you may
not omit or add files if you distribute the package. There is no warranty on
any of the included programs, you use them absolutely at your own risk. The
author refuses to accept any responsibility for any damages whatsoever you or
your computer system, or in fact anything may take from using any of the
supplied programs.
Be warned that you COULD in fact damage your monitor if you are careless!
Read this manual carefully before using the emulator.
The source code for this program is freely available, it may be copied as
well, and you may do whatever you like with it for private purposes. If you
derive other programs from it, you should state that parts of the CPE source
code were used.
You don't need to distribute the source code together with the executable
program.
None of the programs or data supplied may be used for military purposes. I
doubt that they can be used for military purposes, but anyway...
If you don't agree with these terms, delete everything and forget about CPE.
But you will miss a lot...
Mind you, this is freeware, not shareware. I am not asking you for any
payment, so don't send me money. But do write me if you like this program!
Any comments, suggestions or bug reports are highly welcome.
Share and Enjoy!
und nocheinmal auf deutsch, damit niemand sagen kann, er hätte die Passage
nicht verstanden: Benutzung der Programme auf eigene Gefahr, der Autor
übernimmt keine Haftung fuer irgendwelche Schaeden, die durch die Benutzung
des Programms entstehen, sei es durch sachgemässe oder unsachgemässe
Verwendung. Drücken Sie nicht F2, ohne vorher diese Datei gelesen zu haben,
Sie könnten Ihren Monitor unter Umstaenden beschädigen.
1.1. About the ROM images
=========================
Since version 4.8i, the ROM images of all CPC models are included. These
are copyrighted by Amstrad and Locomotive, but these companies have permitted
the use and distribution of the ROMs together with emulators.
In previous versions, I was reluctant to include the ROMs because I don't have
a written permission, only emails, which made me feel a bit uneasy. But I am
convinced now because
- Amstrad and Locomotive have repeatedly stated on comp.sys.amstrad.8bit that
it is legal
- I have received copies of written permissions granted to a german magazine
(ASM) who included CPE and CPCEMU on a CD
- The ROMs are widely available anyway
- why shouldn't I believe the emails I have?
1.2 About the GUS support
=========================
The sound emulation for the GUS was written by Ulrich Doewich. Bug reports,
fan mail, flames etc. about it should be sent to him. Please read the file
README.GUS for information on how to contact Ulrich.
2. General information
======================
2.1. The Amstrad CPC family
===========================
A couple of years ago 8 bit homecomputers were very popular. The best seller
among these was the Commodore 64, but another family of computers was also
very successful in many countries. These were the Amstrad CPCs (they were
distributed under other names in some countries, e.g. you may own a Schneider
CPC if you live in Germany).
There were three different models:
- The CPC464. Released in 1984; it had 32K ROM, 64K RAM and a built-in
cassette recorder, sitting next to the keyboard. The ROM included the
Amstrad operating system and Locomotive BASIC 1.0, which was very good.
You could buy external floppy drives, the one sold by Amstrad used 3-inch
disks, which were incredibly expensive, since no other computer manufacturers
used these for their own systems (apart from exotic models like one called
"Einstein", for example). There were a couple of companies which sold floppy
drives using 5.25-inch and 3.5-inch disks, but these never were of much
importance. Included with Amstrad's disk drives was the at that time still
very widely used disk operating system CP/M 2.2, so that many applications
became available for the CPC; only the disks did not fit in the 3" drives...
- The CPC664 was the next step in the development. It no longer had a cassette
recorder to the right of the keyboard, but a 3" floppy disk drive instead.
The operating system and BASIC ROMs were a little improved, BASIC now had a
few extra commands and the version number 1.1. The 16K floppy ROM was of
course already present, so that this computer had a total of 48K ROM.
It was released in mid-1985.
- Only a couple of months later, Amstrad presented the CPC6128. It was
basically a CPC664 with the double amount of RAM: incredible 128K! There
were minor changes in the ROMs, but the increased amount of memory was in
no way supported by BASIC. To use it, you had to load special banking
software from disk. Amstrad also supplied a new version of CP/M: CP/M Plus
or 3.0, which could use the extra memory, so that the problems some programs
had with the limited memory of the older models were history. After the
release of the CPC6128, production of the CPC664 was abandoned.
The differences between the systems are small compared to the features they
all have in common:
- the processor: a Zilog Z80A, an 8-bit CPU running at 4MHz, derived from
INTeLs 8080.
- the video chip: a Motorola CRTC 6845. Together with the Gate Array it is
responsible for the generation of a video signal. The CPCs knew three video
modes:
mode 0: resolution 160x200 pixel, 16 out of 27 colors + border
mode 1: resolution 320x200 pixel, 4 out of 27 colors + border
mode 2: resolution 640x200 pixel, 2 out of 27 colors + border
Apart from these, the CRTC could be programmed to display many other
resolutions.
- the sound chip: An AY-3-8192; with three independent sound channels, and one
noise generator. The same chip was later used in the Atari ST computers.
Some mean people say it has FOUR noise generators.
- the memory management: Although the Z80 CPU only has a 16 bit address bus,
thus being merely able to address 65536 bytes of memory, you can (in theory)
use hundreds of kilobytes of RAM and even thousands of kilobytes of ROM.
This is made possible by the Gate Array, which implements RAM- and
ROM-banking in the CPC. The 64K that are seen by the CPU are divided into
4 blocks of 16K each, and by programming the banking registers you can make
the Z80 access different blocks of memory at the same address. So, the
highest memory bank (addresses C000-FFFF) usually contains the video RAM,
but you can als access the BASIC and floppy ROMs at the same addresses.
- All models were only sold together with a monitor. You could either choose a
color monitor (CTM 644) or, if you did not have that much money, a green
monitor (GT65). These were not just monitors, they also included the mains
adaptor. The CPC464 received its 5V supply from the monitor, the two later
models also needed a 12V supply for the floppy disk. It was a very effective
way of preventing the users to buy other monitors than those manufactured
by Amstrad.
- There was similar trouble with the printer port. Instead of fitting the
usual 8 bit Centronics port, Amstrad invented something a LOT more useful:
The 7 bit Centronics port! It was just another way to prevent users from
buying external devices from other companies than Amstrad, since Amstrad
alone built 7-bit printers. But Amstrad had less success here than in the
case of the monitor; many users owned »alien« printers.
- the joystick port: Amstrad also produced joysticks, and of course they did
not want CPC users to buy other (better) joysticks than their own, so
they fitted the CPCs with only one joystick port instead of two. To use two
joysticks, you had to plug an Amstrad joystick into the computer and plug
the second joystick into the first - it was the only joystick ever with a
built-in joystick port!
In fact, the description of the features is not really complete. This just
describes what the CPC can "officially" do. For example, it is perfectly
possible to use resolutions up to 768x280 in all 27 colors, and capable
programmers have indeed done things like that. More about that in the next
sections...
2.2. The emulator
=================
This is version 5.0i of the emulator; the i means INTeL.
Since version 4.6i, there are in fact two emulators. The two executables are
called CPE.EXE and CPE2.EXE. The reason why there is not just one is the
diversity in PC hardware. You can emulate the CPC in all detail, so that
ideally all programs would not only work on the emulator, but work just like
on a real CPC. This requires a lot of computing power. It's not a problem to
emulate the processor of the CPC, this can be done without problems on a
mildly fast 386. The difficulty lies in the graphics emulation, and if the
graphics are supposed to be emulated exactly, a lot of effort is needed.
If the CPC must be emulated on a comparatively slow machine, not everything
will be perfect. Most programs will still run, and you will not see a
difference for CPC programs that just use what's "in the specs". These
specifications are described in the previous section. But especially graphics
demos use a lot of undocumented features that the PC simply can't handle.
It is perfectly possible to display any of the standard CPC video modes in
a standard VGA mode. But there is no standard VGA mode that permits
displaying 768x280 pixels in 27 colors.
Since there are so different needs for emulation, there are two executable
files. Both of these have some configuration options that can be used to
tweak the power of the emulator to suit your hardware exactly, at the expense
of some configuration work. It should be possible however, to use either of
the two programs with the preset default values on most hardware
configurations. You might not get the optimal result, however.
If you have only a 386, or a slow 486, you will want to use CPE.EXE. If your
hardware is more powerful, you should try to find a setting for CPE2.EXE that
gives satisfactory results for your machine. Everyone with a 486DX2-66 or
higher should not use CPE.EXE. It is much inferior when it comes to graphics
emulation when compared to CPE2.EXE.
Further below, after all configuration options are explained, I will give
some more detail on example configurations.
Eventually, CPE.EXE will go away as fast PCs become more widely used. Before
that, some of the options that give you a 1% speed increase will go away.
Some already have gone.
Here's a list of reasons why you would want to use CPE.EXE instead of
CPE2.EXE:
- you have a slow computer
- you want to run applications that require full speed
This list used to be longer in previous releases: CPE2 now can support the
high resolution mode (mode 2) of the CPC without packing two pixels into one.
By the way, there is also an Amiga version of CPE, but it is fairly old and
nowhere near as good as the PC version. I stopped working on it in mid-1993,
when I bought my first PC. AmigaCPE is not going to be improved, but it is
available with source on a couple of ftp sites (see below).
2.3. Hardware requirements
==========================
You need: An IBM compatible AT with a 386 (or higher) processor, a VGA card,
at least a diskdrive (better a hard disk), a keyboard, a monitor, ...
If you have a Soundblaster or compatible sound card (possibly AdLib as well)
you can also emulate the CPC sound. The beeper is not supported. Buy a sound
card instead!
From release 4.8i onward, CPE also supports the Gravis Ultrasound.
For CPE2.EXE, replace 386 with 486DX2-66 and fast video card... it runs on a
386, but you wouldn't want to use it. It may be bearable on slower 486 PCs.
2.4. Emulating documented features
==================================
CPE can emulate all three CPC models on your PC. In fact, it always emulates
6128 hardware, but this will never cause you any trouble, since there have
been really no changes in the hardware and but one extension. Which model you
get is determined by the contents of the ROM files. More about that later.
All documented hardware features are emulated. Of course, some things cannot
be duplicated exactly on a totally different system. The PC's keyboard layout
differs from that of the CPC keyboard, so you may have some trouble finding
some keys when you start using CPE. The sound chip's noise generator is not
emulated correctly on a Soundblaster, it always generates noise of the same
frequency. And finally, in CPE.EXE the Z80 instructions are not timed
accurately - the faster your PC is, the faster the emulator will run CPC
software. On a 486DX2-66, you get a CPC running at about 15MHz, a P90 yields
32MHz, on a 386DX40 you will have more or less original speed. There is,
however, an option that makes the system slow down to what is supposed to be
the original 100% CPC speed. This only works on fast systems (on a 386, there
is no need to slow anything down, and it will in fact be slower than a real
CPC), and it can in fact be confused by some time-consuming tasks like
scrolling.
CPE2.EXE will always perform at the exact speed of a CPC, unless you tell
it not to. If your system is fast enough, there will be no difference to a
real CPC.
2.5. Emulating undocumented features
====================================
A CPC can not only do things the manual tells you about. Especially the video
chip (CRTC) can do a lot more than one might think. CPE2.EXE can emulate
overscan screens, raster effects and 32K screens. It can emulate some split
screen effects that are used in demos, but this is still a little buggy.
CPE2 can only emulate 32K screens if EMS and 800x600 mode are enabled.
If you use CPE.EXE, only overscan screens and some raster effects can be
emulated. Many raster effects will fail, and 32K screens are not implemented.
The split screen technique will not work at all.
3. Using the emulator
=====================
3.1. Configuration
==================
First of all, explode the archive into a directory called CPE. You will need
some other directories as well:
CPE\ main directory for executables
CPE\ROM for the ROM files
CPE\SNAP optional, for snapshot files
CPE\TAPE optional, for tape support
CPE\DISKS optional, for disk support (.CPD disk images)
CPE\DISC optional, for CPCEMU style .DSK images
If you used the "-d" option while unzipping the archive, this directory
structure will already be present. If you did not give that switch, you
must move all files ending on ".ROM" into the ROM directory, and all the files
ending on ".BAS" into the TAPE directory.
.DSK files are currently emulated only write-protected. If you want to do any
"real" work, you have to use uncompressed .CPD diskfiles. More about disk
images in a later section.
The second step is to run CPESETUP. This program enables you to configure
the emulator for your system. CPESETUP has several menus, in the main menu
you can choose to configure the general setup, configure CPE.EXE, or configure
CPE2.EXE.
Many options are simple yes/no questions, others require you to type a number.
Numbers are often given in hexadecimal notation (0x??, as used in the C
programming language).
The defaults are supposed to be "reasonable", so that you can in theory just
use these (this has changed from previous versions :-). Explanations for all
of the options follow. (If you have used CPE before, you may note that some
bogus options have gone away.)
Options you probably won't need to touch are marked with "IGNORE". You may
not need to touch many of the others as well. In a later section I will
present some sample configurations for a number of different machines.
General setup
-------------
Soundblaster delay: (IGNORE)
Ignore this if you do not have a sound card.
Ignore it if you have a sound card, and sound output works well.
If you are experiencing problems with the sound support, you should set
this to a higher value (0x23 is the "official" value that should work
for every system). The default is 0x1.
Installed sound card:
Choose either no soundcard, a Soundblaster, or a GUS,
as appropriate for your system.
Soundcard base address:
This is usually 0x220. This value can be changed in the configuration of
the sound card. Enter the correct value for your system, or you will not
hear a thing. You might even cause damage (fairly unlikely, I think), e.g.
if another card uses this port address.
You need to set this option for both the SB and the GUS emulation.
Printer port:
For printer emulation, set this to the appropriate port where your printer
is connected. Usually, this is LPT1.
CPC model (464,664,6128):
selects the ROM image that CPE will load on startup. There should be no
programs that require a 664, but there are programs that won't run on a
464/664, and there may be programs that don't run on a 664/6128. Your best
choice is probably to use a 6128 unless you find something that does not
work.
Enable EMS: (IGNORE)
Ignore this if everything is working perfectly.
If CPE does not work, try if it works without EMS. This might be a bug
in your the EMS manager that runs on your system, or in CPE. I have not
yet heard of any problems.
Soundcard interrupt: (IGNORE)
Only needed for GUS cards, and currently ignored. You don't need to change
this setting. If someone out there really knows how to program the
interrupt controller, please contact Ulrich.
Quiet cassette mode: (IGNORE)
If you've used a real CPC before, you probably know the messages "Press
Play on tape then any key", or "Loading block xxx". This sort of thing is
pointless on the emulator. It can be a nuisance, especially if you put
file in the tape directory that expect to live on a floppy disk. They will
clutter up the screen with loads of these junk messages. Quiet cassette
mode turns all of these off, except for the directory display where you'd
want them.
Green monitor:
As explained in an earlier section, CPCs were either sold with a green or
a color monitor. You can choose the one you used to have, or the one you
like better.
Color is the default. Looks better.
Use Sound:
You can permanently disable sound with this setting, even if you have
configured the sound card. But there's no point in doing so, really.
Use Soundblaster noise generator:
There are problems if you try to emulate the CPC's noise generator with a
Soundblaster: it's not too exact. Therefore, you can permanently turn it
off if it bothers you. If you like it, just leave it set.
Use german keyboard layout:
Don't activate this for a REAL emulation, but I think this is useful if you
can accept minor differences between CPE and your CPC. At least, if you live
in Germany. If you'd like to see another keyboard language supported, tell
me about it.
Use joystick:
You can use an analog PC joystick with CPE, or you can use special keys to
emulate the joystick. You will probably want to turn this on if you own a
PC joystick. It may slow down the emulation, but not a lot (I don't think
you'll notice).
Since the PC joystick is a braindead piece of hardware, you need to
calibrate it before using. In previous versions, you could try to enable
an uncalibrated joystick, with the probable result of a system crash. This
is no longer possible.
Calibrate joystick:
As explained above, a PC joystick must be calibrated before use. The setup
program will instruct you to press the joystick in some directions, and
press the buttons. Please follow the instructions on the screen.
You can't use joystick support together with the joystick keys. It's
either-or.
Special options for CPE.EXE
---------------------------
Overscan graphics mode:
many CPC programs use non-standard video modes with more than 200 lines,
or more than 640 horizontal pixels. These will not look good in the
standard VGA mode CPE is using, which is 640x200 in 16 colors.
To show these special modes in full, you have to switch to a mode with
more lines. Note: the mode you select here must use 16 colors.
There are mainly two alternatives. On every VGA card, it should be
possible to use mode 0x10, which has a resolution of 640x350 pixels.
If you have a SVGA card, you might use the 800x600 mode, which usually has
the mode number 0x6A. But you have to consult your manual for this
information, since PC hardware is too creative for exact answers. Sorry.
800x600 should look better, the pixel geometry is more exact. You can't
display horizontal overscan screens in 640x350.
Double lines in overscan mode:
By turning on double lines, you will reduce the number of lines displayed
in the overscan video mode by a factor of two. That is, instead of 800x600,
you will see 800x300 pixels. This fits the CPC's screen geometry very
nicely.
Switch it off if you use 640x350, since otherwise the screen height would
be reduced to 640x175, which would completely eliminate the point of
having an "overscan" screen size.
Screen length in display mode 2:
CPE.EXE tries to emulate some of the graphical effects that CPE2.EXE is
capable of emulating as well. To do this, you have to switch into 50Hz
mode which is described in a section below. It will be necessary to
fine-tune this mode for your graphics card to get it to work. Read the
section below for more information.
Note: A better solution than running CPE.EXE in 50Hz mode is to run
CPE2.EXE, which can emulate all these graphical effects more reliably.
Special options for CPE2.EXE
---------------------------
Screen refresh frequency:
This option will enable you to use CPE2.EXE at full speed, even if your
hardware is not as fast as needed for a perfect emulation.
Usually, CPE2.EXE redraws the screen 50 times a second, just like a real
CPC does. If you use it with a resolution of 320x200 (more about the
different resolutions below), this totals in a transfer rate of about
3 MB/s between main and VGA memory, and that's only the video emulation.
In the best available resolution, 800x600 with borders enabled, the total
will be 11 MB/s. Even a P90 can't handle this.
If you set this value to 1, every screen will be drawn. This yields 50
frames per second, and all animations will be perfectly smooth. If you
set this to 2, only one out of two screens will be drawn, If you set it to
5, only only 10 frames will be drawn per second, and animations will not
look good at all. If you have to use a value of 5 or higher to get a
reasonable speed, you should consider using CPE.EXE instead.
Use VESA mode 800x600:
Usually, CPE2.EXE uses a screen resolution of 320x200 pixels, in 256
colors. If you have a Super-VGA card with VESA BIOS extensions, you can
change this to 800x600 (actually 800x300, see above about line doubling)
in 256 colors. The advantage of the high resolution is that all possible
overscan screens the CPC can display will fit in 800x300, whereas they may
be truncated in 320x200. Some features of the CRTC are only emulated in
800x600 mode.
See also the next entry:
Use only a small screen in VESA mode:
If you use a higher resolution, the amount of data the CPU has to process
rises. If your system is too slow to handle that, you can still have the
advantage of the higher resolution by enabling this option. The emulator
will still open an 800x600 screen if you enable this option, but will only
paint into a 320x200 sized block in the top left corner. There will be only
a very small picture, but you will have the advantage of being able to use
overscan and 32k screens.
Use graphical menus in VESA mode: (IGNORE)
In CPE.EXE, and in CPE2.EXE in 320x200 resolution, CPE will switch back to
a standard text mode to display its menus. There is no problem with this,
unless you have enabled the 800x600 resolution. Switching back and forth
from video modes is not very nice to your monitor, so CPE2 can paint menus
in the graphical mode without switching back if you enable this option.
There really is no reason to disable this, unless it should not work for
some obscure reason. (One reason might be that you replaced the CPC's
system ROM with something else, this option needs the character images
from the ROM.)
Use borders in 800x600 VESA mode:
Usually, CPE2.EXE does not emulate the borders that are present on the CPC
screen. However, in a resolution of 800x300 there is enough room for these
borders, so these can be enabled. Setting this option will result in a much
nicer picture, there will be no junk pixels displayed in areas of the screen
that are currently not updated (run CPE2 without borders and you'll
probably see what I mean); and pictures will always be centered nicely.
Setting this option may decrease the speed of the emulation, there is more
data to process.
3.2. Starting the emulator
==========================
Once CPE is set up, simply type either "CPE" or "CPE2" to start the emulator.
It should start showing the ROM power-on message (system type, copyright) in
yellow text on blue ground. If you enabled the green monitor in the setup,
make that green text on green ground.
3.3. Special keys
=================
During emulation, most of the keys you press will be reported to the
emulated CPC. However, the function keys invoke special functions of the
emulator.
F1 will load a snapshot file from CPE\SNAP
F3 will save a snapshot file to CPE\SNAP. You will be shown a list of all
the available snapshot files, and you have to enter a name for the new
file.
F4 does not do anything (try it! :-)
F5 will hard reset the emulated CPC
F6 will show you a listing of all the disk files you have installed in
the DISC and DISKS subdirectories, you can move the cursor and select
one diskfile, which will be inserted into the emulated drive A.
F7 shows you a screen of options. More about that in a later section.
F10 exits. You really don't want to press that key.
If you are using CPE.EXE, there are three more keys:
F2 will toggle 50Hz video mode. Read the section below on that video mode
before you press that key.
F8 toggles interrupt speed. You might only need this if you are running
CPE on a machine <=386DX-40. Otherwise, please ignore this key. It is
for games like ELITE that crash slow machines if the interrupts come
too fast. This key will go away in future versions. (no, not the key,
the effect of pressing it will go away!)
F9 scrolls multimodes. This might help for some software. It is unlikely
that it does. If CPE.EXE does not display multimodes correctly, use
CPE2.EXE.
In CPE2.EXE, the following extra keys can be used:
F8,F9: scroll screen vertically and
F11,F12: scroll screen horizontally. If you are using CPE2.EXE with a
screen resolution of 320x200 pixels, overscan screens that the
CPC tries to display might not fit. You can use these four keys
to move the visible area around. The better solution is to enable
the 800x600 mode in the setup.
Yes, I know they are dangerously close to the exit key...
3.4. 50Hz mode in CPE.EXE
=========================
This one remains from a time when computers were slow, and proper emulation
of a CPC required all sorts of strange hacks.
Imagine you write a game for the CPC, and don't want to use mode 0 because
it has only 160x200 pixels. You want to use mode 1, in 320x200 pixels. But
you only have four colors, and that's not too much for a game.
There is a well-known trick to make the CPC display more colors in a high
resolution screen. It requires changing colors while the electron beam on
the monitor is displaying the picture. If you change all the colors in the
picture exactly when the beam is in the middle of the screen, the upper half
of the screen has different colors than the lower half. So, you now have
eight colors in mode 1.
This works fine on a CPC, because interrupts are synchronized with the beam
position. But on an emulation running on a PC, interrupts are usually not
synchronized with the beam, because a VGA card uses a higher refresh rate
that is more eye-friendly. This results in flickering of the colors in many
games.
The solution is to make the VGA card display the screen also with 50Hz, and
synchronize the emulator with the VGA card. This is enabled when you press
F2 in CPE.EXE.
*** CAUTION ***
[The next few lines are in red bold print]
Check your monitor's manual to see if it supports a refresh rate of 50Hz.
There are some monitors that can't handle this; usually fixed frequency
monitors, but some NEC Multisync monitors can't do this either. Wrong
refresh rates can damage your monitor. The author is not responsible for any
damage that might result to your hardware from using this program. If at any
time during execution of CPE your monitor starts acting strangely, turn it
off at once, and reset the PC.
[End of red bold print]
This will probably not work without configuring. If you really want to use
this mode, start CPE.EXE and run the STRIPES.BAS program that comes with it.
It lives in the TAPE directory, unless you forgot to give PKUNZIP the "-d"
switch. Type '|TAPE:RUN"STRIPES"' to start it. The screen will begin to
flicker wildly. Press F2, and the flicker will be reduced. You should now be
able to see six colored stripes moving across the screen. You now have to
exit CPE and run the setup program. In the "CPE options" section, you can
configure the screen length. I have so far seen possible values for this
in the range of 0x5D..0x6E. Experiment a little to see whether high values
make the stripes move slower or whether low values are better. One setting
should match exactly, and the picture should be fixed.
It is, in fact, a weird hack. Use CPE2.EXE if you can, because this handles
similar, but more advanced, tricks much better.
3.5. The menu screen
====================
It is unlikely that you will need all of these options. Some of them are left
in only for historical reasons. Experiment with them if you encounter
problems with graphics emulation, sometimes it might help. Most of the
options are different for CPE and CPE2, so they are listed separately.
Most of the options in CPE are not needed in CPE2, because CPE2 can do all of
the special effects without requiring this sort of fiddling with parameters.
Some of these options can also be set up permanently in CPESETUP. I am not
going to describe those again. Here is a list of the remainder.
The only global option, apart from those configurable in the setup, is
Emulate R register:
Turn it off if you are desperate for speed, leave it on otherwise. Some
programs use the R register of the Z80 CPU as a random number generator,
others use it for encrypting data (e.g. copy protection). Programs may
fail if this is off, but many will run unaffected, that is why there is
an option. There would be no point in an option to turn off the Z80 stack
pointer...
Options in CPE.EXE:
-------------------
Realtime CPC:
This tries to keep the speed at exactly 100% of a real CPC.
It does not time single instructions, instead, it adds up cyles,
and if the right amount is reached, it just waits for the next interrupt to
occur. So, if your program only needs to work at exact speed in 300Hz
intervals, you are lucky, if your program uses nasty timing loops to do
"copper" color effects, then you will not enjoy this. The cassette save
routines would not work this way if redirected to a soundblaster/cassette
deck combination. They need to be timed exactly at instruction level.
This option works on a 486DX2-66, it might also work on a 486DX-40,
but probably not on slower machines.
CPE2.EXE does a better job at realtime emulation.
Frame fly asynchronous to vertical retrace:
Don't touch it unless you have problems with the graphics (may be useful
against flickering; then again, it may not)
Permit double buffering:
Some CPC software uses two memory banks to do a double buffering effect.
If this option is enabled, the PC tries to do the same trick in VGA
memory. Usually, it succeeds, and is a lot faster than without. This is
enabled by default.
Double buffering, exchange pages:
A hack. Use if your double-buffering software looks like it always shows
the wrong page (resulting in flicker, or some areas "blanked out" of a
picture. Unfortunately, timing differs between VGA cards and CPCs, so this
is sometimes needed to display the right screen page.
This is an option from the category "one menu item for every program that
does not work right" (Marco Vieth)
Options in CPE2.EXE:
--------------------
Wait for frame fly:
Usually, CPE2 will run at 100% the speed of a real CPC, or less if your
system is too slow. This is by synchronising the CPC interrupts with the
PC interrupts. This can be disabled by turning off this option. Usually,
you don't want to do this (games usually become unplayable if the CPC is
too fast), but if you are doing "real work" on the CPC, you might benefit
from a higher speed. Your best bet in that case is to run CPE.EXE, because
it's much faster anyway, and applications for serious work are unlikely to
require the exact emulation that CPE2.EXE provides.
Do not turn this on to increase the speed of the emulation if it is too
slow. Instead, use the refresh rate setting in the setup program, or turn
off the sound support, which can be rather time consuming, too.
Permit vertical overscan:
Only relevant in 320x200 mode. As I stated earlier, overscan screens may
be truncated in this mode. If a screen is just too high, not too wide,
you may turn on this option to increase the resolution to 320x400 pixels.
I don't really recommend this, the screen will be fairly distorted. Try
using 800x600 mode instead (in the setup).
3.6. Using the emulator
=======================
There are few things to explain about using the emulation itself - it behaves
just like a CPC. However, there has to be some explanation on how to use
external data.
If you have any CPC files, you can put them in the tape directory and access
them as "tape files". On a CPC, you access the tape by first typing '|TAPE'
(the "|" sign is on Shift-"Ü" on german keyboards, and somewhere else on an
American keyboard (I think it's the key to the right of the "P") and then
using the BASIC commands to load files (saving to the tape directory is not
supported right now). You can get a directory listing by typing 'CAT' and
load files with 'LOAD"file"'. If you want to execute a program, type
'RUN"program"'.
Disk support works with the same BASIC commands, you just do not type '|TAPE'.
If you typed that command, and want to use disks again, you must type '|DISC'.
If you start the emulator and type 'CAT', you will get the message 'Disc
missing in drive A'. This is because you have to "insert" a diskfile first.
Disks are emulated by using special files which hold a 1:1 image of the data
on a CPC floppy disk. If you have installed disk files, you can get a list
of them by pressing the F6 key. Move the cursor to the one you want and press
Return. Press Esc if you don't want to insert a disk. After you have inserted
a disk, the BASIC commands like 'CAT' or 'LOAD' should work.
There are two types of disk files: CPE "native" diskfiles, which have the
suffix ".CPD" (CPC Disk File), and CPCEMU diskfiles, that have the suffix
".DSK". If you have .CPD files, you must install them in the DISKS directory;
.DSK files go into the DISC directory (paths relative to the directory where
CPE is located).
Currently, CPE can't write to .DSK files for safety (they might come
in certain variants, and I don't want to trash a disk file simply because
it's in an unexpected format) and laziness reasons. But this is on my "high
priority list", it will get fixed.
There is a tool called CONVDISK.EXE which can convert between the types.
It can also create compressed .CPD disk files that take up less space, but
cannot be written to.
3.7. Example configurations
===========================
Here are some configurations that I consider to be ideal for each system
(I used each one myself).
386DX-40, ISA bus, cheapo VGA card.
Use CPE.EXE; do not turn on realtime emulation in the menu, because it
will be too slow. The speed should be about the same as a real CPC. Some
speed can be gained by disabling the R register emulation in the menu.
486DX2-66, VLB, good SVGA card.
Use CPE2.EXE with a resolution of 320x200 pixels (i.e., turn off 800x600
mode in the setup). Use a frame rate of 25Hz (enter "2" in the refresh
rate setting).
This is a conservative setup. Usually, using 320x200 will enable you to
use a refresh rate of 50Hz, making animations more smooth. You might be
able to achieve full speed even in full 800x600 mode with borders enabled
and a refresh rate of 25Hz. My 486 can handle this.
Pentium-90, PCI, good SVGA card.
Use CPE2.EXE, turn on 800x600 mode, no small screen, borders on. Refresh
rate should be 25Hz; if you turn borders off or if you have a very good
system, you might be able to run at a 50Hz refresh rate.
It may be surprising that the 486 and the Pentium achieve the same results. I
guess the reason for this is that it's not the CPU speed that is most
important, but in fact the transfer rate from memory to the VGA card. If you
enable full 800x600 mode, turn on the borders, and try to get a 50Hz refresh
rate, this transfer rate lies somewhere about 11MB/s.
This is limited by the bus and by the VGA card itself. It seems like VLB or
PCI doesn't make that much of a difference here.
For systems in between, you might have to experiment a little. Especially
owners of medium-fast 486s might have some difficulties in finding a good
set of options. Try starting with CPE2 and getting this to work at full speed
at the expense of the frame rate. If it turns out to be unusable, use
CPE.EXE.
4. Technical information
========================
is not included in this manual. A rather large text about the internals of
CPE is on Kevin Thacker's WEB page (look in chapter "Pointers" to find out the
address). The source is also available, so RTFS.
Let me only say something about
4.1. File formats
=================
If you are already using Marco Vieth's CPCEMU, you will want to use your
software with CPE as well. For tape files, there is no problem. Just copy
these to CPE\TAPE. Same for snapshots, they go to CPE\SNAP. Currently, CPE
does not support 128K snapshots.
CPE can read, but not write .DSK files that CPCEMU understands. The native
disk file format for CPE is .CPD; and all .CPD files must go in CPE\DISKS.
CPCEMU-style .DSK files must go in CPE\DISC. The utility CONVDISK.EXE can
convert between the formats.
The ROM files are also the same.
4.2. Missing bits
=================
By now, almost 100% of the CPC are emulated. Recent additions are overscan
screens in CPE2, the 'split screen' technique, and those nifty 32K screens
that some demos use to display huge pictures.
Some demos do very weird things to the CRTC. While many split-screen effects
are emulated quite well in this version, there are others which are
problematic.
A big problem is the accuracy of the interrupt emulation. The Gate Array
sometimes behaves in a weird manner, and I have not quite figured out the
pattern completely yet.
5. Final words...
=================
5.1. Thanks and acknowledgements
================================
(in no particular order) to...
- Amstrad for developing the CPC in the first place
- Marco Vieth for providing me with software, bug reports and his own CPC
emulator called CPCEMU, which is very good. It is also available as
freeware, so try to get a copy.
- Kevin Thacker, for making an excellent WEB homepage for Amstrad computers.
- Emmanuel Roussin for sending me the FAQ.
- Herman Dullink: for sending me his CPC emulator.
- Zilog, Inc. for LOTS of undocumented opcodes.
- Charlie Gibbs, who wrote a CP/M emulator for the Amiga. This emulator first
made me think about writing a CPC emulator, and I derived some basic ideas
from it.
- Andreas Lober, who sent me copies of the permissions given to him by
Amstrad and Locomotive to distribute the ROMs.
- Ulrich Doewich who wrote the sound emulation for GUS cards.
- everyone whom I've forgotten.
5.2. The author
===============
crux@pool.informatik.rwth-aachen.de
or:
Bernd Schmidt
Schlossweiherstrasse 14
52072 Aachen
Germany
Contact me! If you have comments, bug reports, ideas for enhancements, or
anything interesting, let me know! I can't promise that I will answer your
letters, but I will do my best.
Excuse me if I have insulted you with my English. It should not be too bad,
but it's my second language, so this text is bound to contain mistakes.
5.3. Other emulators
====================
I have seen a few emulators besides CPE. CPCEMU, which was written by Marco
Vieth, is a very nice piece of software. It can do less to support eccentric
video modes (although this has been improved, it can now display multimodes
and overscan) but it is usually a good deal faster than CPE. It is very useful
to have both emulators, since it depends on what software you use which one
is more suitable. The latest version is 1.3B.
Another very promising emulator is currently being developed by Herman
Dullink. It's still in beta stage, but it is very fast and already quite
compatible. I should expect a release version here relatively soon.
For the Amiga, Kevin Thacker is developing A-CPC. Once this is released,
I hope the amount of email I get about the inadequacies of my own AmigaCPE
gets a little lower. It will support all the features the emulators for the PC
have.
The last one I have seen works, but that is about all you can say about it.
It is called SIMCPC, features black and white graphics and does not run
properly on fast machines, the poor thing. It is not of much use, but was
apparently never intended to be.
There is allegedly a fifth one somewhere on the net, but I have yet to find it.
5.4. Pointers
=============
If you have Internet access, you may want to check out the following:
- There is a newsgroup for Amstrad 8 bit computers, it is called
"comp.sys.amstrad.8bit". Information about new versions of CPC emulators
and other interesting news are posted here.
Maybe you'll also want to look at comp.os.cpm. But this is not Amstrad
specific.
- ftp.nvg.unit.no:pub/cpc
sunshine.informatik.uni-wuerzburg.de:pub/joscho/cpcemu
ftp.ibp.fr:pub/amstrad
ftp.demon.co.uk:/pub/cpm
oak.oakland.edu (or any SimTel mirror):SimTel/msdos/emulator
All these are ftp sites that might be of interest if you are interested in
CPC related stuff. On SimTel, you'll find the latest version of Marco
Vieth's CPCEMU. The Wuerzburg site mirrors ftp.nvg.unit.no.
- http://www.cm.cf.ac.uk/User/K.E.W.Thacker/Amstrad/index.html
An *excellent* home page with loads of technical information.
If you want to write an emulator, this is the place to look at.