home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / emulator / cpc / cpcemu.doc next >
Encoding:
Text File  |  1992-12-29  |  10.0 KB  |  292 lines

  1. *****************************************************************************
  2. *                                                                           *
  3. *       Documentation for CPCEMU(v0.3)  --  The CPC-Emulator                *
  4. *                                                                           *
  5. *****************************************************************************
  6.  
  7.  
  8. What's CPCEMU ??
  9.   CPCEMU emulates the Z80-CPU and most CPC 6128 - hardware.
  10.  
  11.  
  12. What's CPC 6128 ?
  13.   The CPC 6128 is (or was) a Z80-based-homecomputer with internal
  14.   3" Floppy (yes, 3", not 3.5"), Locomotive Basic, CP/M 2.2 or CP/M Plus.
  15.   - CPU:
  16.     Z80A, 4 MHz, interrupts every 1/300 sec
  17.   - Memory :
  18.     128 KB RAM , 48 KB ROM (AMSTRAD-OS, BASIC, AMSDOS)
  19.   - Graphics:
  20.     640x200x2 or 320x200x4 or 160x200x16
  21.     palette of 27 different colors
  22.   - Sound:
  23.     3-channel-stereo-sound
  24.   - ...
  25.  
  26.  
  27. What do you need ?
  28.   - a fast computer (386)
  29.   - a VGA-Card (maybe EGA but wrong colors)
  30.   - a CPC (best 6128) to get the ROM from (use ROMGET1)
  31.     ( otherwise you can only test Z80NOROM.ROM with ZCOPY.ROM )
  32.  
  33.  
  34. How to start:
  35.   Start CPCEMU.
  36.   After the opening-screen, press a key, and CPCEMU checks the memory
  37.   and tries to load the ROM.
  38.   It will only find Z80NOROM.ROM and ZCOPY.ROM.
  39.  
  40.   Now you will see a debug-menu, it will look like:
  41.  
  42. CPCEMU (v0.2) - The CPC-Emulator
  43. (c) Marco Vieth, 21.12.1992
  44.  
  45. R)un T)race S)tep  A)ssem D)ump I)nput  L)oad saV)e  M)ode  P)c F)ast Q)uit
  46. AF=0000 BC=0000 DE=0000 HL=0000 IX=0000 IY=0000 SP=0000 PC=0000 IR=0000
  47. AF'=0000 BC'=0000 DE'=0000 HL'=0000 IFF1=0 IFF2=0 IMmod=0 NZ NC PO P
  48. 0000 : 01 89 7F       LD BC,&7F89
  49. ->
  50.  
  51.   You can quit the program by pressing Q <ENTER>.
  52.   But first press R <ENTER> to R)un the emulation.
  53.   Note: You can always stop the running emulation by pressing F10 and
  54.   you can continue with 'R'.
  55.   A menu and a pointer appears (all in german, sorry).
  56.   Switch off NUM-Lock to use the keypad as joystick.
  57.   Start COPYMATE by selecting 'copymate' and pressing keypad-'5' (fire).
  58.   It's a copy-program for CPC, but not very useful in emulation.
  59.   But it's the only PD-program I know which doesn't need the AMSTRAD-ROM.
  60.   You can click something ...
  61.   If you've seen enough, select 'ENDE' in the middle of the screen.
  62.   Another menue will appear, select 'Beenden' to leave Copymate.
  63.   At this point, <ESC> will restart the 'operating system'.
  64.   To stop emulation, use F10 now.
  65.   You can repeat this by pressing 'F' for fast-emulation. You can see
  66.   the improvement of the fast-emulation only with the pointer.
  67.   The rest is rather slow, since COPYMATE flips very often between
  68.   2 memory-states, were 2 4000h KB banks must be swapped.
  69.  
  70.   If you want a real CPC, you must copy the ROM's to a file first.
  71.   See below.
  72.  
  73. How to get a real CPC:
  74.   For copyright reasons I can't include the original AMSTRAD-ROM,
  75.   you should get it from somewhere else.
  76.   If you've a 5.25"-Floppy connected to your CPC, there's no problem.
  77.   - Use 22DISK by SYDEX to copy ROMGET1 to a CPC-formatted disk.
  78.   - start ROMGET1 on your CPC
  79.     (it will save the OS/BASIC as 32K-File called Z80CPC.ROM
  80.      and the AMSDOS as 16K-File called ZDISK.ROM (only if present) )
  81.   - Copy these files with 22DISK to your PC in the same directory
  82.     where CPCEMU is.
  83.   - Start CPCEMU and you've a real CPC on your PC.
  84.  
  85.  
  86. The debug-menu:
  87.   A Z80-CPU-Dump shows all registers.
  88.   Use the following commands :
  89.   [option] is optional.
  90.  
  91.   'R'[address]
  92.     to Run the slow-emulation at full speed (graphic-mode 0x0e
  93.     is selected) from actual PC or optional address.
  94.     You can stop the emulation by F10 and you can
  95.     always continue with 'R' ,'S' , 'T' , 'F' !
  96.     Examples:
  97.     -> r        run emulation from current PC
  98.     -> r100        set PC to 100h and run emulation
  99.  
  100.   'S'[address]
  101.     Step-over from current PC or address. After the actual
  102.     instruction a (invisible) breakpoint is placed and emulation
  103.     continues until this breakpoint is reached or F10 is
  104.     pressed.
  105.  
  106.   'T'[address]
  107.     Trace-into, real single step, only one instruction is
  108.     executed. 'Enter' repeats T, other key+return exits.
  109.  
  110.   'D'[address]
  111.     Dumps memory from PC or address.
  112.     'Enter' repeats D, other key+return exits.
  113.  
  114.   'A'[address]
  115.     DisAssembles from PC or address.
  116.     'Enter' repeats D, other key+return exits.
  117.  
  118.   'I'[address]
  119.     Input (edit) Bytes from PC or address. Enter hex-Values
  120.     to change, use 'Enter' to take and '-1' (or some other non-byte
  121.     value) to quit input.
  122.  
  123.   'L'[filename]
  124.     Loads binary-file (with 0x80-Byte-Header) to address PC.
  125.  
  126.   'V'[filename]
  127.     Saves binary-file (with 0x80-Byte-Header) from address PC.
  128.     You should input the desired length.
  129.     (At the moment, the header is only filled with 'M'.)
  130.  
  131.   'P'[address]
  132.     Sets PC to address.
  133.  
  134.   'M'
  135.     Change display-mode (Disassemble,CPU-Dump on/off)
  136.  
  137.   'F'[address]
  138.     Fast-Emulation with a Assembler-Z80-Emulator by Juergen Weber.
  139.     Now it's functional !
  140.  
  141.   'Q'
  142.     Quit CPCEMU.
  143.  
  144.   Examples:
  145.   -> p3ab0  (or p <enter> 3ab0 <enter>)    set PC to 3ab0h
  146.   -> da000  (or ...)            dump memory from 0a000h
  147.   -> r0                    run slow-emulation from 0 (reset)
  148.   -> lName <enter>            loads file 'name' to address PC
  149.      (or l <enter> Name <enter> )
  150.   -> vName <enter> 4000 <enter>        saves 4000h bytes from address PC
  151.                     to a file Name.
  152.   -> f <enter>                run fast-emulation from PC
  153.  
  154.  
  155. During Emulation :
  156.   - Keyboard:
  157.     I've implemented a new keyboard-handler by Arnt Gulbrandsen, Arnt uses
  158.     it in his spectrum-emulaton JPP. It took me nearly one afternoon to
  159.     understand the routine and adapt it for CPC. Thanks anyway.
  160.     Close your eyes, imagine the CPC and press the key you wish.
  161.     This means, the keyboard-layout on PC is nearly the same as on CPC.
  162.     Special keys:
  163.       PC:    - CPC or function:
  164.       ----------------------------
  165.       F2    - see CPC-screen (in graphics mode)
  166.       F3    - see message-screen (p.e. cat from cassette)
  167.  
  168.       F8    - full emulation-reset (like a CPC-reset-button)
  169.           use it, if CTRL-SHIFT-ESC isn't running.
  170.  
  171.       F10     - stop emulation
  172.       ALT, ALT2    - COPY
  173.       keypad    - function-keys f0..f9 (with num-lock on)
  174.       keypad    - Joystick (0) (with num-lock off)
  175.  
  176.  
  177.  
  178. What's supported:
  179.  
  180.   - Z80-Emulation :
  181.     There're two different emulations:
  182.     a) A slow emulation written in C:
  183.        All Z80-Instructions are emulated, also 'illegal', like
  184.        DD 63  LD XH,E  (loads the high-byte of IX with E).
  185.        FD CB 12 18  RR (IY+&12) & LD B ( rotates (IY+&12) right and
  186.        loads the result to B :  & LD B,(IX+&12)  )
  187.        R-Register not supported any more. (But it's only a #define ...)
  188.        Every 600 instructions, an interrupt is generated and every
  189.        3th interrupt, the screen is updated.
  190.        See Z80INS.DOC for a (nearly) full instruction-table.
  191.  
  192.     b) The fast-Z80-emulation written by Jürgen Weber (he uses it in
  193.        his CP/M-Emulator ZSIM and implemented banking).
  194.        It's entirely written in assembler and highly optimised. So it is
  195.        five to - don't ask me - times faster than the slow-version.
  196.        It also supports most 'illegal' instructions.
  197.        [ Every 1/300 sec an interrupt is generated and every
  198.        6th interrupt, the screen is updated. ]
  199.        In this version : every 1600 instructions.
  200.  
  201.  
  202.   - CPC-Hardware:
  203.     The Z80 CPU communicates with the CPC-hardware via IN and OUT :
  204.  
  205.     a) GATE-Array :
  206.     - all 32 colours of the CPC (27 different)
  207.     - all 3 modes (x,y,colours) :
  208.       mode 0 = 160x200x16
  209.       mode 1 = 320x200x4
  210.       mode 2 = 640x200x2
  211.     - rom-banking (16KB OS, 16KB BASIC, 16KB AMSDOS)
  212.     - ram-banking (8*16KB = 128KB)
  213.       Rather slow, since the banks must be moved.
  214.  
  215.     b) CRTC :
  216.     - screen-base, screen-offset (hardware-scrolling)
  217.     - different screen-sizes (with CRTC-Reg. 1 and 6)
  218.  
  219.     c) PIO 8255:
  220.     - Keyboard (connected to PSG)
  221.  
  222.     d) FDC:
  223.     - read/write sector for Drive A supported
  224.       (uses file DISK1.CPC wich is a special image of a CPC-Disk)
  225.  
  226.     e) CASSETTE:
  227.        Cassette-Commands (use |TAPE first) are redirected to files
  228.        in the current directory.
  229.        This is done by modifying the ROM (depending on CPC) with a
  230.        new instruction only the emulator knows:
  231.      ED FC xx  USER &BCxx    ;only valid for some RAM-Vectors.
  232.             calls a special routine for handling the vector.
  233.             Note: You can still patch the RAM-vectors !
  234.  
  235.        You can use files with header (BINARY,BASIC) or without (ASCII).
  236.        The Header is AMSDOS-like, so you can copy single files from a
  237.        CPC-diskette. Use filenames up to 16 characters (limited by BASIC).
  238.        With F3 you can flip to the message window to see, if some errors
  239.        occur. The CATaloge is listed there, too.
  240.        F2 flips back to CPC-screen.
  241.  
  242.  
  243.  
  244. Not yet supported:
  245.     - Sound (PSG=Programmable Sound Generator)
  246.     - PC-Joystick
  247.     - different modes on the screen (maybe later ...)
  248.     - real frame-fly (only after 6 interrupts one frame-fly, now
  249.       every 3th in(&f5xx) the vsync-bit toggles. )
  250.     - overscan (never, it's too slow)
  251.  
  252. Bugs:
  253.     - There seem to be some minor bugs in the emulation
  254.       (INPUT #9,t$ (IN CHAR) isn't functional)
  255.     - With COPYMATE: You can't load a program. (It uses a trick ...)
  256.     - Problem with CP/M Plus
  257.     - PLEASE REPORT ANY BUGS !
  258.  
  259.  
  260. What's running:
  261.   a)
  262.   - OS, BASIC, AMSDOS
  263.   - CP/M 2.2 (I think)
  264.  
  265.   b) Games (tested):
  266.   - Ghosts'n Goblins, Avenger
  267.  
  268.  
  269.  
  270. Finally :
  271.   Thanks to Jürgen Weber for his fast Z80-Emulation (and ZSIM-source),
  272.   thanks to Arnt Gulbrandsen for his keyboard-handler (and JPP-source).
  273.  
  274.  
  275.  
  276.   Write your comments to:
  277.   *************************
  278.   * Marco Vieth           *
  279.   * Auf dem Uekern 4      *
  280.   * 4791 Lichtenau-Atteln *
  281.   * (Germany)             *
  282.   *************************
  283.  
  284. or use email:
  285.   ali@uni-paderborn.de
  286.  
  287.  
  288.  
  289. ------------------------------------------------------------------------------
  290. the next doc will be much better if there is some interest ...
  291. ------------------------------------------------------------------------------
  292.