home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 25 / CD_ASCQ_25_1095.iso / dos / prg / cpe50 / cpe.doc < prev    next >
Text File  |  1995-09-15  |  46KB  |  900 lines

  1.   CCCCC                          An Amstrad CPC emulator
  2.  CC
  3.  CC                              Copyright 1991-1995 Bernd Schmidt
  4.  CC                              GUS support Copyright 1995 Ulrich Doewich
  5.   CCCCC  PPPPP
  6.              PP                  Amstrad and Locomotive Software permit the
  7.              PP                  use of the included ROM images with an
  8.              PP                  emulator, but retain the copyright.
  9.          PPPPP
  10.          PP                      This program is freeware. You may
  11.          PP                      distribute it freely, provided that you
  12.          PP     EEEEE            do not charge a fee of more than DM 8,-
  13.                EE   EE           or the equivalent in any other currency
  14.                EEEEEE            for copying the disk and provided that
  15.                EE                you always distribute the whole archive
  16.                 EEEEE   V.5.0i   including all the files.
  17.  
  18. -----------------------------------------------------------------------------
  19.  
  20. 1. What is this then?
  21. =====================
  22.  
  23. This is a doc file. It belongs to a program called CPE, which can emulate an
  24. Amstrad CPC on your IBM compatible 386-AT. All files in this distribution are
  25. public domain, you may distribute them freely, but you may not charge more
  26. than a fee of DM 8,- for copying. If you want to include CPE with other
  27. programs on a CD-ROM, you may do so. In any case you must preserve the
  28. original contents of the archive; you may not modify any of the files, you may
  29. not omit or add files if you distribute the package. There is no warranty on
  30. any of the included programs, you use them absolutely at your own risk. The
  31. author refuses to accept any responsibility for any damages whatsoever you or
  32. your computer system, or in fact anything may take from using any of the
  33. supplied programs.
  34.  
  35. Be warned that you COULD in fact damage your monitor if you are careless!
  36. Read this manual carefully before using the emulator.
  37.  
  38. The source code for this program is freely available, it may be copied as
  39. well, and you may do whatever you like with it for private purposes. If you
  40. derive other programs from it, you should state that parts of the CPE source
  41. code were used.
  42. You don't need to distribute the source code together with the executable
  43. program.
  44.  
  45. None of the programs or data supplied may be used for military purposes. I
  46. doubt that they can be used for military purposes, but anyway...
  47. If you don't agree with these terms, delete everything and forget about CPE.
  48. But you will miss a lot...
  49.  
  50. Mind you, this is freeware, not shareware. I am not asking you for any
  51. payment, so don't send me money. But do write me if you like this program!
  52. Any comments, suggestions or bug reports are highly welcome.
  53.  
  54. Share and Enjoy!
  55.  
  56. und nocheinmal auf deutsch, damit niemand sagen kann, er hätte die Passage
  57. nicht verstanden: Benutzung der Programme auf eigene Gefahr, der Autor
  58. übernimmt keine Haftung fuer irgendwelche Schaeden, die durch die Benutzung
  59. des Programms entstehen, sei es durch sachgemässe oder unsachgemässe
  60. Verwendung. Drücken Sie nicht F2, ohne vorher diese Datei gelesen zu haben,
  61. Sie könnten Ihren Monitor unter Umstaenden beschädigen.
  62.  
  63.  
  64. 1.1. About the ROM images
  65. =========================
  66.  
  67. Since version 4.8i, the ROM images of all CPC models are included. These
  68. are copyrighted by Amstrad and Locomotive, but these companies have permitted
  69. the use and distribution of the ROMs together with emulators.
  70.  
  71. In previous versions, I was reluctant to include the ROMs because I don't have
  72. a written permission, only emails, which made me feel a bit uneasy. But I am
  73. convinced now because
  74.  - Amstrad and Locomotive have repeatedly stated on comp.sys.amstrad.8bit that
  75.    it is legal
  76.  - I have received copies of written permissions granted to a german magazine
  77.    (ASM) who included CPE and CPCEMU on a CD
  78.  - The ROMs are widely available anyway
  79.  - why shouldn't I believe the emails I have?
  80.  
  81.  
  82. 1.2 About the GUS support
  83. =========================
  84.  
  85. The sound emulation for the GUS was written by Ulrich Doewich. Bug reports,
  86. fan mail, flames etc. about it should be sent to him. Please read the file
  87. README.GUS for information on how to contact Ulrich.
  88.  
  89.  
  90. 2. General information
  91. ======================
  92.  
  93. 2.1. The Amstrad CPC family
  94. ===========================
  95.  
  96. A couple of years ago 8 bit homecomputers were very popular. The best seller
  97. among these was the Commodore 64, but another family of computers was also
  98. very successful in many countries. These were the Amstrad CPCs (they were
  99. distributed under other names in some countries, e.g. you may own a Schneider
  100. CPC if you live in Germany).
  101.  
  102. There were three different models:
  103. - The CPC464. Released in 1984; it had 32K ROM, 64K RAM and a built-in
  104.   cassette recorder, sitting next to the keyboard. The ROM included the
  105.   Amstrad operating system and Locomotive BASIC 1.0, which was very good.
  106.   You could buy external floppy drives, the one sold by Amstrad used 3-inch
  107.   disks, which were incredibly expensive, since no other computer manufacturers
  108.   used these for their own systems (apart from exotic models like one called
  109.   "Einstein", for example). There were a couple of companies which sold floppy
  110.   drives using 5.25-inch and 3.5-inch disks, but these never were of much
  111.   importance. Included with Amstrad's disk drives was the at that time still
  112.   very widely used disk operating system CP/M 2.2, so that many applications
  113.   became available for the CPC; only the disks did not fit in the 3" drives...
  114. - The CPC664 was the next step in the development. It no longer had a cassette
  115.   recorder to the right of the keyboard, but a 3" floppy disk drive instead.
  116.   The operating system and BASIC ROMs were a little improved, BASIC now had a
  117.   few extra commands and the version number 1.1. The 16K floppy ROM was of
  118.   course already present, so that this computer had a total of 48K ROM.
  119.   It was released in mid-1985.
  120. - Only a couple of months later, Amstrad presented the CPC6128. It was
  121.   basically a CPC664 with the double amount of RAM: incredible 128K! There
  122.   were minor changes in the ROMs, but the increased amount of memory was in
  123.   no way supported by BASIC. To use it, you had to load special banking
  124.   software from disk. Amstrad also supplied a new version of CP/M: CP/M Plus
  125.   or 3.0, which could use the extra memory, so that the problems some programs
  126.   had with the limited memory of the older models were history. After the
  127.   release of the CPC6128, production of the CPC664 was abandoned.
  128.  
  129. The differences between the systems are small compared to the features they
  130. all have in common:
  131. - the processor: a Zilog Z80A, an 8-bit CPU running at 4MHz, derived from
  132.   INTeLs 8080.
  133. - the video chip: a Motorola CRTC 6845. Together with the Gate Array it is
  134.   responsible for the generation of a video signal. The CPCs knew three video
  135.   modes:
  136.     mode 0: resolution 160x200 pixel, 16 out of 27 colors + border
  137.     mode 1: resolution 320x200 pixel,  4 out of 27 colors + border
  138.     mode 2: resolution 640x200 pixel,  2 out of 27 colors + border
  139.   Apart from these, the CRTC could be programmed to display many other
  140.   resolutions.
  141. - the sound chip: An AY-3-8192; with three independent sound channels, and one
  142.   noise generator. The same chip was later used in the Atari ST computers.
  143.   Some mean people say it has FOUR noise generators.
  144. - the memory management: Although the Z80 CPU only has a 16 bit address bus,
  145.   thus being merely able to address 65536 bytes of memory, you can (in theory)
  146.   use hundreds of kilobytes of RAM and even thousands of kilobytes of ROM.
  147.   This is made possible by the Gate Array, which implements RAM- and
  148.   ROM-banking in the CPC. The 64K that are seen by the CPU are divided into
  149.   4 blocks of 16K each, and by programming the banking registers you can make
  150.   the Z80 access different blocks of memory at the same address. So, the
  151.   highest memory bank (addresses C000-FFFF) usually contains the video RAM,
  152.   but you can als access the BASIC and floppy ROMs at the same addresses.
  153. - All models were only sold together with a monitor. You could either choose a
  154.   color monitor (CTM 644) or, if you did not have that much money, a green
  155.   monitor (GT65). These were not just monitors, they also included the mains
  156.   adaptor. The CPC464 received its 5V supply from the monitor, the two later
  157.   models also needed a 12V supply for the floppy disk. It was a very effective
  158.   way of preventing the users to buy other monitors than those manufactured
  159.   by Amstrad.
  160. - There was similar trouble with the printer port. Instead of fitting the
  161.   usual 8 bit Centronics port, Amstrad invented something a LOT more useful:
  162.   The 7 bit Centronics port! It was just another way to prevent users from
  163.   buying external devices from other companies than Amstrad, since Amstrad
  164.   alone built 7-bit printers. But Amstrad had less success here than in the
  165.   case of the monitor; many users owned »alien« printers.
  166. - the joystick port: Amstrad also produced joysticks, and of course they did
  167.   not want CPC users to buy other (better) joysticks than their own, so
  168.   they fitted the CPCs with only one joystick port instead of two. To use two
  169.   joysticks, you had to plug an Amstrad joystick into the computer and plug
  170.   the second joystick into the first - it was the only joystick ever with a
  171.   built-in joystick port!
  172.  
  173. In fact, the description of the features is not really complete. This just
  174. describes what the CPC can "officially" do. For example, it is perfectly
  175. possible to use resolutions up to 768x280 in all 27 colors, and capable
  176. programmers have indeed done things like that. More about that in the next
  177. sections...
  178.  
  179.  
  180. 2.2. The emulator
  181. =================
  182.  
  183. This is version 5.0i of the emulator; the i means INTeL.
  184. Since version 4.6i, there are in fact two emulators. The two executables are
  185. called CPE.EXE and CPE2.EXE. The reason why there is not just one is the
  186. diversity in PC hardware. You can emulate the CPC in all detail, so that
  187. ideally all programs would not only work on the emulator, but work just like
  188. on a real CPC. This requires a lot of computing power. It's not a problem to
  189. emulate the processor of the CPC, this can be done without problems on a
  190. mildly fast 386. The difficulty lies in the graphics emulation, and if the
  191. graphics are supposed to be emulated exactly, a lot of effort is needed.
  192. If the CPC must be emulated on a comparatively slow machine, not everything
  193. will be perfect. Most programs will still run, and you will not see a
  194. difference for CPC programs that just use what's "in the specs". These
  195. specifications are described in the previous section. But especially graphics
  196. demos use a lot of undocumented features that the PC simply can't handle.
  197. It is perfectly possible to display any of the standard CPC video modes in
  198. a standard VGA mode. But there is no standard VGA mode that permits
  199. displaying 768x280 pixels in 27 colors.
  200.  
  201. Since there are so different needs for emulation, there are two executable
  202. files. Both of these have some configuration options that can be used to
  203. tweak the power of the emulator to suit your hardware exactly, at the expense
  204. of some configuration work. It should be possible however, to use either of
  205. the two programs with the preset default values on most hardware
  206. configurations. You might not get the optimal result, however.
  207.  
  208. If you have only a 386, or a slow 486, you will want to use CPE.EXE. If your
  209. hardware is more powerful, you should try to find a setting for CPE2.EXE that
  210. gives satisfactory results for your machine. Everyone with a 486DX2-66 or
  211. higher should not use CPE.EXE. It is much inferior when it comes to graphics
  212. emulation when compared to CPE2.EXE.
  213. Further below, after all configuration options are explained, I will give
  214. some more detail on example configurations.
  215. Eventually, CPE.EXE will go away as fast PCs become more widely used. Before
  216. that, some of the options that give you a 1% speed increase will go away.
  217. Some already have gone.
  218.  
  219. Here's a list of reasons why you would want to use CPE.EXE instead of
  220. CPE2.EXE:
  221.   - you have a slow computer
  222.   - you want to run applications that require full speed
  223.  
  224. This list used to be longer in previous releases: CPE2 now can support the
  225. high resolution mode (mode 2) of the CPC without packing two pixels into one.
  226.  
  227. By the way, there is also an Amiga version of CPE, but it is fairly old and
  228. nowhere near as good as the PC version. I stopped working on it in mid-1993,
  229. when I bought my first PC. AmigaCPE is not going to be improved, but it is
  230. available with source on a couple of ftp sites (see below).
  231.  
  232.  
  233. 2.3. Hardware requirements
  234. ==========================
  235.  
  236. You need: An IBM compatible AT with a 386 (or higher) processor, a VGA card,
  237. at least a diskdrive (better a hard disk), a keyboard, a monitor, ...
  238. If you have a Soundblaster or compatible sound card (possibly AdLib as well)
  239. you can also emulate the CPC sound. The beeper is not supported. Buy a sound
  240. card instead!
  241. From release 4.8i onward, CPE also supports the Gravis Ultrasound.
  242.  
  243. For CPE2.EXE, replace 386 with 486DX2-66 and fast video card... it runs on a
  244. 386, but you wouldn't want to use it. It may be bearable on slower 486 PCs.
  245.  
  246.  
  247. 2.4. Emulating documented features
  248. ==================================
  249.  
  250. CPE can emulate all three CPC models on your PC. In fact, it always emulates
  251. 6128 hardware, but this will never cause you any trouble, since there have
  252. been really no changes in the hardware and but one extension. Which model you
  253. get is determined by the contents of the ROM files. More about that later.
  254.  
  255. All documented hardware features are emulated. Of course, some things cannot
  256. be duplicated exactly on a totally different system. The PC's keyboard layout
  257. differs from that of the CPC keyboard, so you may have some trouble finding
  258. some keys when you start using CPE. The sound chip's noise generator is not
  259. emulated correctly on a Soundblaster, it always generates noise of the same
  260. frequency. And finally, in CPE.EXE the Z80 instructions are not timed
  261. accurately - the faster your PC is, the faster the emulator will run CPC
  262. software. On a 486DX2-66, you get a CPC running at about 15MHz, a P90 yields
  263. 32MHz, on a 386DX40 you will have more or less original speed. There is,
  264. however, an option that makes the system slow down to what is supposed to be
  265. the original 100% CPC speed. This only works on fast systems (on a 386, there
  266. is no need to slow anything down, and it will in fact be slower than a real
  267. CPC), and it can in fact be confused by some time-consuming tasks like
  268. scrolling.
  269.  
  270. CPE2.EXE will always perform at the exact speed of a CPC, unless you tell
  271. it not to. If your system is fast enough, there will be no difference to a
  272. real CPC.
  273.  
  274.  
  275. 2.5. Emulating undocumented features
  276. ====================================
  277.  
  278. A CPC can not only do things the manual tells you about. Especially the video
  279. chip (CRTC) can do a lot more than one might think. CPE2.EXE can emulate
  280. overscan screens, raster effects and 32K screens. It can emulate some split
  281. screen effects that are used in demos, but this is still a little buggy.
  282.  
  283. CPE2 can only emulate 32K screens if EMS and 800x600 mode are enabled.
  284.  
  285. If you use CPE.EXE, only overscan screens and some raster effects can be
  286. emulated. Many raster effects will fail, and 32K screens are not implemented.
  287. The split screen technique will not work at all.
  288.  
  289.  
  290. 3. Using the emulator
  291. =====================
  292.  
  293. 3.1. Configuration
  294. ==================
  295.  
  296. First of all, explode the archive into a directory called CPE. You will need
  297. some other directories as well:
  298. CPE\          main directory for executables
  299. CPE\ROM       for the ROM files
  300. CPE\SNAP      optional, for snapshot files
  301. CPE\TAPE      optional, for tape support
  302. CPE\DISKS     optional, for disk support (.CPD disk images)
  303. CPE\DISC      optional, for CPCEMU style .DSK images
  304.  
  305. If you used the "-d" option while unzipping the archive, this directory
  306. structure will already be present. If you did not give that switch, you
  307. must move all files ending on ".ROM" into the ROM directory, and all the files
  308. ending on ".BAS" into the TAPE directory.
  309.  
  310. .DSK files are currently emulated only write-protected. If you want to do any
  311. "real" work, you have to use uncompressed .CPD diskfiles. More about disk
  312. images in a later section.
  313.  
  314. The second step is to run CPESETUP. This program enables you to configure
  315. the emulator for your system. CPESETUP has several menus, in the main menu
  316. you can choose to configure the general setup, configure CPE.EXE, or configure
  317. CPE2.EXE.
  318. Many options are simple yes/no questions, others require you to type a number.
  319. Numbers are often given in hexadecimal notation (0x??, as used in the C
  320. programming language).
  321. The defaults are supposed to be "reasonable", so that you can in theory just
  322. use these (this has changed from previous versions :-). Explanations for all
  323. of the options follow. (If you have used CPE before, you may note that some
  324. bogus options have gone away.)
  325. Options you probably won't need to touch are marked with "IGNORE". You may
  326. not need to touch many of the others as well. In a later section I will
  327. present some sample configurations for a number of different machines.
  328.  
  329. General setup
  330. -------------
  331.  
  332. Soundblaster delay: (IGNORE)
  333.   Ignore this if you do not have a sound card.
  334.   Ignore it if you have a sound card, and sound output works well.
  335.   If you are experiencing problems with the sound support, you should set
  336.   this to a higher value (0x23 is the "official" value that should work
  337.   for every system). The default is 0x1.
  338.  
  339. Installed sound card:
  340.   Choose either no soundcard, a Soundblaster, or a GUS,
  341.   as appropriate for your system.
  342.  
  343. Soundcard base address:
  344.   This is usually 0x220. This value can be changed in the configuration of
  345.   the sound card. Enter the correct value for your system, or you will not
  346.   hear a thing. You might even cause damage (fairly unlikely, I think), e.g.
  347.   if another card uses this port address.
  348.   You need to set this option for both the SB and the GUS emulation.
  349.  
  350. Printer port:
  351.   For printer emulation, set this to the appropriate port where your printer
  352.   is connected. Usually, this is LPT1.
  353.  
  354. CPC model (464,664,6128):
  355.   selects the ROM image that CPE will load on startup. There should be no
  356.   programs that require a 664, but there are programs that won't run on a
  357.   464/664, and there may be programs that don't run on a 664/6128. Your best
  358.   choice is probably to use a 6128 unless you find something that does not
  359.   work.
  360.  
  361. Enable EMS: (IGNORE)
  362.   Ignore this if everything is working perfectly.
  363.   If CPE does not work, try if it works without EMS. This might be a bug
  364.   in your the EMS manager that runs on your system, or in CPE. I have not
  365.   yet heard of any problems.
  366.  
  367. Soundcard interrupt: (IGNORE)
  368.   Only needed for GUS cards, and currently ignored. You don't need to change
  369.   this setting. If someone out there really knows how to program the
  370.   interrupt controller, please contact Ulrich.
  371.  
  372. Quiet cassette mode: (IGNORE)
  373.   If you've used a real CPC before, you probably know the messages "Press
  374.   Play on tape then any key", or "Loading block xxx". This sort of thing is
  375.   pointless on the emulator. It can be a nuisance, especially if you put
  376.   file in the tape directory that expect to live on a floppy disk. They will
  377.   clutter up the screen with loads of these junk messages. Quiet cassette
  378.   mode turns all of these off, except for the directory display where you'd
  379.   want them.
  380.  
  381. Green monitor:
  382.   As explained in an earlier section, CPCs were either sold with a green or
  383.   a color monitor. You can choose the one you used to have, or the one you
  384.   like better.
  385.   Color is the default. Looks better.
  386.  
  387. Use Sound:
  388.   You can permanently disable sound with this setting, even if you have
  389.   configured the sound card. But there's no point in doing so, really.
  390.  
  391. Use Soundblaster noise generator:
  392.   There are problems if you try to emulate the CPC's noise generator with a
  393.   Soundblaster: it's not too exact. Therefore, you can permanently turn it
  394.   off if it bothers you. If you like it, just leave it set.
  395.  
  396. Use german keyboard layout:
  397.   Don't activate this for a REAL emulation, but I think this is useful if you
  398.   can accept minor differences between CPE and your CPC. At least, if you live
  399.   in Germany. If you'd like to see another keyboard language supported, tell
  400.   me about it.
  401.  
  402. Use joystick:
  403.   You can use an analog PC joystick with CPE, or you can use special keys to
  404.   emulate the joystick. You will probably want to turn this on if you own a
  405.   PC joystick. It may slow down the emulation, but not a lot (I don't think
  406.   you'll notice).
  407.   Since the PC joystick is a braindead piece of hardware, you need to
  408.   calibrate it before using. In previous versions, you could try to enable
  409.   an uncalibrated joystick, with the probable result of a system crash. This
  410.   is no longer possible.
  411.  
  412. Calibrate joystick:
  413.   As explained above, a PC joystick must be calibrated before use. The setup
  414.   program will instruct you to press the joystick in some directions, and
  415.   press the buttons. Please follow the instructions on the screen.
  416.   You can't use joystick support together with the joystick keys. It's
  417.   either-or.
  418.  
  419. Special options for CPE.EXE
  420. ---------------------------
  421.  
  422. Overscan graphics mode:
  423.   many CPC programs use non-standard video modes with more than 200 lines,
  424.   or more than 640 horizontal pixels. These will not look good in the
  425.   standard VGA mode CPE is using, which is 640x200 in 16 colors.
  426.   To show these special modes in full, you have to switch to a mode with
  427.   more lines. Note: the mode you select here must use 16 colors.
  428.   There are mainly two alternatives. On every VGA card, it should be
  429.   possible to use mode 0x10, which has a resolution of 640x350 pixels.
  430.   If you have a SVGA card, you might use the 800x600 mode, which usually has
  431.   the mode number 0x6A. But you have to consult your manual for this
  432.   information, since PC hardware is too creative for exact answers. Sorry.
  433.   800x600 should look better, the pixel geometry is more exact. You can't
  434.   display horizontal overscan screens in 640x350.
  435.  
  436. Double lines in overscan mode:
  437.   By turning on double lines, you will reduce the number of lines displayed
  438.   in the overscan video mode by a factor of two. That is, instead of 800x600,
  439.   you will see 800x300 pixels. This fits the CPC's screen geometry very
  440.   nicely.
  441.   Switch it off if you use 640x350, since otherwise the screen height would
  442.   be reduced to 640x175, which would completely eliminate the point of
  443.   having an "overscan" screen size.
  444.  
  445. Screen length in display mode 2:
  446.   CPE.EXE tries to emulate some of the graphical effects that CPE2.EXE is
  447.   capable of emulating as well. To do this, you have to switch into 50Hz
  448.   mode which is described in a section below. It will be necessary to
  449.   fine-tune this mode for your graphics card to get it to work. Read the
  450.   section below for more information.
  451.   Note: A better solution than running CPE.EXE in 50Hz mode is to run
  452.   CPE2.EXE, which can emulate all these graphical effects more reliably.
  453.  
  454. Special options for CPE2.EXE
  455. ---------------------------
  456.  
  457. Screen refresh frequency:
  458.   This option will enable you to use CPE2.EXE at full speed, even if your
  459.   hardware is not as fast as needed for a perfect emulation.
  460.   Usually, CPE2.EXE redraws the screen 50 times a second, just like a real
  461.   CPC does. If you use it with a resolution of 320x200 (more about the
  462.   different resolutions below), this totals in a transfer rate of about
  463.   3 MB/s between main and VGA memory, and that's only the video emulation.
  464.   In the best available resolution, 800x600 with borders enabled, the total
  465.   will be 11 MB/s. Even a P90 can't handle this.
  466.   If you set this value to 1, every screen will be drawn. This yields 50
  467.   frames per second, and all animations will be perfectly smooth. If you
  468.   set this to 2, only one out of two screens will be drawn, If you set it to
  469.   5, only only 10 frames will be drawn per second, and animations will not
  470.   look good at all. If you have to use a value of 5 or higher to get a
  471.   reasonable speed, you should consider using CPE.EXE instead.
  472.  
  473. Use VESA mode 800x600:
  474.   Usually, CPE2.EXE uses a screen resolution of 320x200 pixels, in 256
  475.   colors. If you have a Super-VGA card with VESA BIOS extensions, you can
  476.   change this to 800x600 (actually 800x300, see above about line doubling)
  477.   in 256 colors. The advantage of the high resolution is that all possible
  478.   overscan screens the CPC can display will fit in 800x300, whereas they may
  479.   be truncated in 320x200. Some features of the CRTC are only emulated in
  480.   800x600 mode.
  481.   See also the next entry:
  482.  
  483. Use only a small screen in VESA mode:
  484.   If you use a higher resolution, the amount of data the CPU has to process
  485.   rises. If your system is too slow to handle that, you can still have the
  486.   advantage of the higher resolution by enabling this option. The emulator
  487.   will still open an 800x600 screen if you enable this option, but will only
  488.   paint into a 320x200 sized block in the top left corner. There will be only
  489.   a very small picture, but you will have the advantage of being able to use
  490.   overscan and 32k screens.
  491.  
  492. Use graphical menus in VESA mode: (IGNORE)
  493.   In CPE.EXE, and in CPE2.EXE in 320x200 resolution, CPE will switch back to
  494.   a standard text mode to display its menus. There is no problem with this,
  495.   unless you have enabled the 800x600 resolution. Switching back and forth
  496.   from video modes is not very nice to your monitor, so CPE2 can paint menus
  497.   in the graphical mode without switching back if you enable this option.
  498.   There really is no reason to disable this, unless it should not work for
  499.   some obscure reason. (One reason might be that you replaced the CPC's
  500.   system ROM with something else, this option needs the character images
  501.   from the ROM.)
  502.  
  503. Use borders in 800x600 VESA mode:
  504.   Usually, CPE2.EXE does not emulate the borders that are present on the CPC
  505.   screen. However, in a resolution of 800x300 there is enough room for these
  506.   borders, so these can be enabled. Setting this option will result in a much
  507.   nicer picture, there will be no junk pixels displayed in areas of the screen
  508.   that are currently not updated (run CPE2 without borders and you'll
  509.   probably see what I mean); and pictures will always be centered nicely.
  510.   Setting this option may decrease the speed of the emulation, there is more
  511.   data to process.
  512.  
  513.  
  514. 3.2. Starting the emulator
  515. ==========================
  516.  
  517. Once CPE is set up, simply type either "CPE" or "CPE2" to start the emulator.
  518. It should start showing the ROM power-on message (system type, copyright) in
  519. yellow text on blue ground. If you enabled the green monitor in the setup,
  520. make that green text on green ground.
  521.  
  522.  
  523. 3.3. Special keys
  524. =================
  525.  
  526. During emulation, most of the keys you press will be reported to the
  527. emulated CPC. However, the function keys invoke special functions of the
  528. emulator.
  529.  
  530.   F1  will load a snapshot file from CPE\SNAP
  531.   F3  will save a snapshot file to CPE\SNAP. You will be shown a list of all
  532.       the available snapshot files, and you have to enter a name for the new
  533.       file.
  534.   F4  does not do anything (try it! :-)
  535.   F5  will hard reset the emulated CPC
  536.   F6  will show you a listing of all the disk files you have installed in
  537.       the DISC and DISKS subdirectories, you can move the cursor and select
  538.       one diskfile, which will be inserted into the emulated drive A.
  539.   F7  shows you a screen of options. More about that in a later section.
  540.   F10 exits. You really don't want to press that key.
  541.  
  542. If you are using CPE.EXE, there are three more keys:
  543.  
  544.   F2  will toggle 50Hz video mode. Read the section below on that video mode
  545.       before you press that key.
  546.   F8  toggles interrupt speed. You might only need this if you are running
  547.       CPE on a machine <=386DX-40. Otherwise, please ignore this key. It is
  548.       for games like ELITE that crash slow machines if the interrupts come
  549.       too fast. This key will go away in future versions. (no, not the key,
  550.       the effect of pressing it will go away!)
  551.   F9  scrolls multimodes. This might help for some software. It is unlikely
  552.       that it does. If CPE.EXE does not display multimodes correctly, use
  553.       CPE2.EXE.
  554.  
  555. In CPE2.EXE, the following extra keys can be used:
  556.  
  557.   F8,F9:   scroll screen vertically and
  558.   F11,F12: scroll screen horizontally. If you are using CPE2.EXE with a
  559.            screen resolution of 320x200 pixels, overscan screens that the
  560.            CPC tries to display might not fit. You can use these four keys
  561.            to move the visible area around. The better solution is to enable
  562.            the 800x600 mode in the setup.
  563.            Yes, I know they are dangerously close to the exit key...
  564.  
  565.  
  566. 3.4. 50Hz mode in CPE.EXE
  567. =========================
  568.  
  569. This one remains from a time when computers were slow, and proper emulation
  570. of a CPC required all sorts of strange hacks.
  571. Imagine you write a game for the CPC, and don't want to use mode 0 because
  572. it has only 160x200 pixels. You want to use mode 1, in 320x200 pixels. But
  573. you only have four colors, and that's not too much for a game.
  574. There is a well-known trick to make the CPC display more colors in a high
  575. resolution screen. It requires changing colors while the electron beam on
  576. the monitor is displaying the picture. If you change all the colors in the
  577. picture exactly when the beam is in the middle of the screen, the upper half
  578. of the screen has different colors than the lower half. So, you now have
  579. eight colors in mode 1.
  580. This works fine on a CPC, because interrupts are synchronized with the beam
  581. position. But on an emulation running on a PC, interrupts are usually not
  582. synchronized with the beam, because a VGA card uses a higher refresh rate
  583. that is more eye-friendly. This results in flickering of the colors in many
  584. games.
  585. The solution is to make the VGA card display the screen also with 50Hz, and
  586. synchronize the emulator with the VGA card. This is enabled when you press
  587. F2 in CPE.EXE.
  588.                                 *** CAUTION ***
  589. [The next few lines are in red bold print]
  590. Check your monitor's manual to see if it supports a refresh rate of 50Hz.
  591. There are some monitors that can't handle this; usually fixed frequency
  592. monitors, but some NEC Multisync monitors can't do this either. Wrong
  593. refresh rates can damage your monitor. The author is not responsible for any
  594. damage that might result to your hardware from using this program. If at any
  595. time during execution of CPE your monitor starts acting strangely, turn it
  596. off at once, and reset the PC.
  597. [End of red bold print]
  598.  
  599. This will probably not work without configuring. If you really want to use
  600. this mode, start CPE.EXE and run the STRIPES.BAS program that comes with it.
  601. It lives in the TAPE directory, unless you forgot to give PKUNZIP the "-d"
  602. switch. Type '|TAPE:RUN"STRIPES"' to start it. The screen will begin to
  603. flicker wildly. Press F2, and the flicker will be reduced. You should now be
  604. able to see six colored stripes moving across the screen. You now have to
  605. exit CPE and run the setup program. In the "CPE options" section, you can
  606. configure the screen length. I have so far seen possible values for this
  607. in the range of 0x5D..0x6E. Experiment a little to see whether high values
  608. make the stripes move slower or whether low values are better. One setting
  609. should match exactly, and the picture should be fixed.
  610.  
  611. It is, in fact, a weird hack. Use CPE2.EXE if you can, because this handles
  612. similar, but more advanced, tricks much better.
  613.  
  614.  
  615. 3.5. The menu screen
  616. ====================
  617.  
  618. It is unlikely that you will need all of these options. Some of them are left
  619. in only for historical reasons. Experiment with them if you encounter
  620. problems with graphics emulation, sometimes it might help. Most of the
  621. options are different for CPE and CPE2, so they are listed separately.
  622. Most of the options in CPE are not needed in CPE2, because CPE2 can do all of
  623. the special effects without requiring this sort of fiddling with parameters.
  624. Some of these options can also be set up permanently in CPESETUP. I am not
  625. going to describe those again. Here is a list of the remainder.
  626.  
  627. The only global option, apart from those configurable in the setup, is
  628.  
  629. Emulate R register:
  630.    Turn it off if you are desperate for speed, leave it on otherwise. Some
  631.    programs use the R register of the Z80 CPU as a random number generator,
  632.    others use it for encrypting data (e.g. copy protection). Programs may
  633.    fail if this is off, but many will run unaffected, that is why there is
  634.    an option. There would be no point in an option to turn off the Z80 stack
  635.    pointer...
  636.  
  637. Options in CPE.EXE:
  638. -------------------
  639.  
  640. Realtime CPC:
  641.    This tries to keep the speed at exactly 100% of a real CPC.
  642.    It does not time single instructions, instead, it adds up cyles,
  643.    and if the right amount is reached, it just waits for the next interrupt to
  644.    occur. So, if your program only needs to work at exact speed in 300Hz
  645.    intervals, you are lucky, if your program uses nasty timing loops to do
  646.    "copper" color effects, then you will not enjoy this. The cassette save
  647.    routines would not work this way if redirected to a soundblaster/cassette
  648.    deck combination. They need to be timed exactly at instruction level.
  649.    This option works on a 486DX2-66, it might also work on a 486DX-40,
  650.    but probably not on slower machines.
  651.    CPE2.EXE does a better job at realtime emulation.
  652.  
  653. Frame fly asynchronous to vertical retrace:
  654.    Don't touch it unless you have problems with the graphics (may be useful
  655.    against flickering; then again, it may not)
  656.  
  657. Permit double buffering:
  658.    Some CPC software uses two memory banks to do a double buffering effect.
  659.    If this option is enabled, the PC tries to do the same trick in VGA
  660.    memory. Usually, it succeeds, and is a lot faster than without. This is
  661.    enabled by default.
  662.  
  663. Double buffering, exchange pages:
  664.    A hack. Use if your double-buffering software looks like it always shows
  665.    the wrong page (resulting in flicker, or some areas "blanked out" of a
  666.    picture. Unfortunately, timing differs between VGA cards and CPCs, so this
  667.    is sometimes needed to display the right screen page.
  668.    This is an option from the category "one menu item for every program that
  669.    does not work right" (Marco Vieth)
  670.  
  671.  
  672. Options in CPE2.EXE:
  673. --------------------
  674.  
  675. Wait for frame fly:
  676.    Usually, CPE2 will run at 100% the speed of a real CPC, or less if your
  677.    system is too slow. This is by synchronising the CPC interrupts with the
  678.    PC interrupts. This can be disabled by turning off this option. Usually,
  679.    you don't want to do this (games usually become unplayable if the CPC is
  680.    too fast), but if you are doing "real work" on the CPC, you might benefit
  681.    from a higher speed. Your best bet in that case is to run CPE.EXE, because
  682.    it's much faster anyway, and applications for serious work are unlikely to
  683.    require the exact emulation that CPE2.EXE provides.
  684.    Do not turn this on to increase the speed of the emulation if it is too
  685.    slow. Instead, use the refresh rate setting in the setup program, or turn
  686.    off the sound support, which can be rather time consuming, too.
  687.  
  688. Permit vertical overscan:
  689.    Only relevant in 320x200 mode. As I stated earlier, overscan screens may
  690.    be truncated in this mode. If a screen is just too high, not too wide,
  691.    you may turn on this option to increase the resolution to 320x400 pixels.
  692.    I don't really recommend this, the screen will be fairly distorted. Try
  693.    using 800x600 mode instead (in the setup).
  694.  
  695.  
  696. 3.6. Using the emulator
  697. =======================
  698.  
  699. There are few things to explain about using the emulation itself - it behaves
  700. just like a CPC. However, there has to be some explanation on how to use
  701. external data.
  702. If you have any CPC files, you can put them in the tape directory and access
  703. them as "tape files". On a CPC, you access the tape by first typing '|TAPE'
  704. (the "|" sign is on Shift-"Ü" on german keyboards, and somewhere else on an
  705. American keyboard (I think it's the key to the right of the "P") and then
  706. using the BASIC commands to load files (saving to the tape directory is not
  707. supported right now). You can get a directory listing by typing 'CAT' and
  708. load files with 'LOAD"file"'. If you want to execute a program, type
  709. 'RUN"program"'.
  710. Disk support works with the same BASIC commands, you just do not type '|TAPE'.
  711. If you typed that command, and want to use disks again, you must type '|DISC'.
  712. If you start the emulator and type 'CAT', you will get the message 'Disc
  713. missing in drive A'. This is because you have to "insert" a diskfile first.
  714. Disks are emulated by using special files which hold a 1:1 image of the data
  715. on a CPC floppy disk. If you have installed disk files, you can get a list
  716. of them by pressing the F6 key. Move the cursor to the one you want and press
  717. Return. Press Esc if you don't want to insert a disk. After you have inserted
  718. a disk, the BASIC commands like 'CAT' or 'LOAD' should work.
  719.  
  720. There are two types of disk files: CPE "native" diskfiles, which have the
  721. suffix ".CPD" (CPC Disk File), and CPCEMU diskfiles, that have the suffix
  722. ".DSK". If you have .CPD files, you must install them in the DISKS directory;
  723. .DSK files go into the DISC directory (paths relative to the directory where
  724. CPE is located).
  725. Currently, CPE can't write to .DSK files for safety (they might come
  726. in certain variants, and I don't want to trash a disk file simply because
  727. it's in an unexpected format) and laziness reasons. But this is on my "high
  728. priority list", it will get fixed.
  729. There is a tool called CONVDISK.EXE which can convert between the types.
  730. It can also create compressed .CPD disk files that take up less space, but
  731. cannot be written to.
  732.  
  733.  
  734. 3.7. Example configurations
  735. ===========================
  736.  
  737. Here are some configurations that I consider to be ideal for each system
  738. (I used each one myself).
  739.  
  740. 386DX-40, ISA bus, cheapo VGA card.
  741.   Use CPE.EXE; do not turn on realtime emulation in the menu, because it
  742.   will be too slow. The speed should be about the same as a real CPC. Some
  743.   speed can be gained by disabling the R register emulation in the menu.
  744.  
  745. 486DX2-66, VLB, good SVGA card.
  746.   Use CPE2.EXE with a resolution of 320x200 pixels (i.e., turn off 800x600
  747.   mode in the setup). Use a frame rate of 25Hz (enter "2" in the refresh
  748.   rate setting).
  749.   This is a conservative setup. Usually, using 320x200 will enable you to
  750.   use a refresh rate of 50Hz, making animations more smooth. You might be
  751.   able to achieve full speed even in full 800x600 mode with borders enabled
  752.   and a refresh rate of 25Hz. My 486 can handle this.
  753.  
  754. Pentium-90, PCI, good SVGA card.
  755.   Use CPE2.EXE, turn on 800x600 mode, no small screen, borders on. Refresh
  756.   rate should be 25Hz; if you turn borders off or if you have a very good
  757.   system, you might be able to run at a 50Hz refresh rate.
  758.  
  759. It may be surprising that the 486 and the Pentium achieve the same results. I
  760. guess the reason for this is that it's not the CPU speed that is most
  761. important, but in fact the transfer rate from memory to the VGA card. If you
  762. enable full 800x600 mode, turn on the borders, and try to get a 50Hz refresh
  763. rate, this transfer rate lies somewhere about 11MB/s.
  764. This is limited by the bus and by the VGA card itself. It seems like VLB or
  765. PCI doesn't make that much of a difference here.
  766.  
  767. For systems in between, you might have to experiment a little. Especially
  768. owners of medium-fast 486s might have some difficulties in finding a good
  769. set of options. Try starting with CPE2 and getting this to work at full speed
  770. at the expense of the frame rate. If it turns out to be unusable, use
  771. CPE.EXE.
  772.  
  773.  
  774. 4. Technical information
  775. ========================
  776.  
  777. is not included in this manual. A rather large text about the internals of
  778. CPE is on Kevin Thacker's WEB page (look in chapter "Pointers" to find out the
  779. address). The source is also available, so RTFS.
  780. Let me only say something about
  781.  
  782.  
  783. 4.1. File formats
  784. =================
  785.  
  786. If you are already using Marco Vieth's CPCEMU, you will want to use your
  787. software with CPE as well. For tape files, there is no problem. Just copy
  788. these to CPE\TAPE. Same for snapshots, they go to CPE\SNAP. Currently, CPE
  789. does not support 128K snapshots.
  790. CPE can read, but not write .DSK files that CPCEMU understands. The native
  791. disk file format for CPE is .CPD; and all .CPD files must go in CPE\DISKS.
  792. CPCEMU-style .DSK files must go in CPE\DISC. The utility CONVDISK.EXE can
  793. convert between the formats.
  794. The ROM files are also the same.
  795.  
  796.  
  797. 4.2. Missing bits
  798. =================
  799.  
  800. By now, almost 100% of the CPC are emulated. Recent additions are overscan
  801. screens in CPE2, the 'split screen' technique, and those nifty 32K screens
  802. that some demos use to display huge pictures.
  803.  
  804. Some demos do very weird things to the CRTC. While many split-screen effects
  805. are emulated quite well in this version, there are others which are
  806. problematic.
  807.  
  808. A big problem is the accuracy of the interrupt emulation. The Gate Array
  809. sometimes behaves in a weird manner, and I have not quite figured out the
  810. pattern completely yet.
  811.  
  812. 5. Final words...
  813. =================
  814.  
  815. 5.1. Thanks and acknowledgements
  816. ================================
  817.  
  818. (in no particular order) to...
  819.  
  820. - Amstrad for developing the CPC in the first place
  821. - Marco Vieth for providing me with software, bug reports and his own CPC
  822.   emulator called CPCEMU, which is very good. It is also available as
  823.   freeware, so try to get a copy.
  824. - Kevin Thacker, for making an excellent WEB homepage for Amstrad computers.
  825. - Emmanuel Roussin for sending me the FAQ.
  826. - Herman Dullink: for sending me his CPC emulator.
  827. - Zilog, Inc. for LOTS of undocumented opcodes.
  828. - Charlie Gibbs, who wrote a CP/M emulator for the Amiga. This emulator first
  829.   made me think about writing a CPC emulator, and I derived some basic ideas
  830.   from it.
  831. - Andreas Lober, who sent me copies of the permissions given to him by
  832.   Amstrad and Locomotive to distribute the ROMs.
  833. - Ulrich Doewich who wrote the sound emulation for GUS cards.
  834. - everyone whom I've forgotten.
  835.  
  836.  
  837. 5.2. The author
  838. ===============
  839.  
  840. crux@pool.informatik.rwth-aachen.de
  841.  
  842. or:
  843.  
  844. Bernd Schmidt
  845. Schlossweiherstrasse 14
  846. 52072 Aachen
  847. Germany
  848.  
  849. Contact me! If you have comments, bug reports, ideas for enhancements, or
  850. anything interesting, let me know! I can't promise that I will answer your
  851. letters, but I will do my best.
  852.  
  853. Excuse me if I have insulted you with my English. It should not be too bad,
  854. but it's my second language, so this text is bound to contain mistakes.
  855.  
  856.  
  857. 5.3. Other emulators
  858. ====================
  859.  
  860. I have seen a few emulators besides CPE. CPCEMU, which was written by Marco
  861. Vieth, is a very nice piece of software. It can do less to support eccentric
  862. video modes (although this has been improved, it can now display multimodes
  863. and overscan) but it is usually a good deal faster than CPE. It is very useful
  864. to have both emulators, since it depends on what software you use which one
  865. is more suitable. The latest version is 1.3B.
  866. Another very promising emulator is currently being developed by Herman
  867. Dullink. It's still in beta stage, but it is very fast and already quite
  868. compatible. I should expect a release version here relatively soon.
  869. For the Amiga, Kevin Thacker is developing A-CPC. Once this is released,
  870. I hope the amount of email I get about the inadequacies of my own AmigaCPE
  871. gets a little lower. It will support all the features the emulators for the PC
  872. have.
  873. The last one I have seen works, but that is about all you can say about it.
  874. It is called SIMCPC, features black and white graphics and does not run
  875. properly on fast machines, the poor thing. It is not of much use, but was
  876. apparently never intended to be.
  877. There is allegedly a fifth one somewhere on the net, but I have yet to find it.
  878.  
  879.  
  880. 5.4. Pointers
  881. =============
  882.  
  883. If you have Internet access, you may want to check out the following:
  884.  
  885.  - There is a newsgroup for Amstrad 8 bit computers, it is called
  886.    "comp.sys.amstrad.8bit". Information about new versions of CPC emulators
  887.    and other interesting news are posted here.
  888.    Maybe you'll also want to look at comp.os.cpm. But this is not Amstrad
  889.    specific.
  890.  - ftp.nvg.unit.no:pub/cpc
  891.    sunshine.informatik.uni-wuerzburg.de:pub/joscho/cpcemu
  892.    ftp.ibp.fr:pub/amstrad
  893.    ftp.demon.co.uk:/pub/cpm
  894.    oak.oakland.edu (or any SimTel mirror):SimTel/msdos/emulator
  895.    All these are ftp sites that might be of interest if you are interested in
  896.    CPC related stuff. On SimTel, you'll find the latest version of Marco
  897.    Vieth's CPCEMU. The Wuerzburg site mirrors ftp.nvg.unit.no.
  898.  - http://www.cm.cf.ac.uk/User/K.E.W.Thacker/Amstrad/index.html
  899.    An *excellent* home page with loads of technical information.
  900.    If you want to write an emulator, this is the place to look at.