home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************************
- * *
- * Documentation for CPCEMU(v0.3) -- The CPC-Emulator *
- * *
- *****************************************************************************
-
-
- What's CPCEMU ??
- CPCEMU emulates the Z80-CPU and most CPC 6128 - hardware.
-
-
- What's CPC 6128 ?
- The CPC 6128 is (or was) a Z80-based-homecomputer with internal
- 3" Floppy (yes, 3", not 3.5"), Locomotive Basic, CP/M 2.2 or CP/M Plus.
- - CPU:
- Z80A, 4 MHz, interrupts every 1/300 sec
- - Memory :
- 128 KB RAM , 48 KB ROM (AMSTRAD-OS, BASIC, AMSDOS)
- - Graphics:
- 640x200x2 or 320x200x4 or 160x200x16
- palette of 27 different colors
- - Sound:
- 3-channel-stereo-sound
- - ...
-
-
- What do you need ?
- - a fast computer (386)
- - a VGA-Card (maybe EGA but wrong colors)
- - a CPC (best 6128) to get the ROM from (use ROMGET1)
- ( otherwise you can only test Z80NOROM.ROM with ZCOPY.ROM )
-
-
- How to start:
- Start CPCEMU.
- After the opening-screen, press a key, and CPCEMU checks the memory
- and tries to load the ROM.
- It will only find Z80NOROM.ROM and ZCOPY.ROM.
-
- Now you will see a debug-menu, it will look like:
-
- CPCEMU (v0.2) - The CPC-Emulator
- (c) Marco Vieth, 21.12.1992
-
- R)un T)race S)tep A)ssem D)ump I)nput L)oad saV)e M)ode P)c F)ast Q)uit
- AF=0000 BC=0000 DE=0000 HL=0000 IX=0000 IY=0000 SP=0000 PC=0000 IR=0000
- AF'=0000 BC'=0000 DE'=0000 HL'=0000 IFF1=0 IFF2=0 IMmod=0 NZ NC PO P
- 0000 : 01 89 7F LD BC,&7F89
- ->
-
- You can quit the program by pressing Q <ENTER>.
- But first press R <ENTER> to R)un the emulation.
- Note: You can always stop the running emulation by pressing F10 and
- you can continue with 'R'.
- A menu and a pointer appears (all in german, sorry).
- Switch off NUM-Lock to use the keypad as joystick.
- Start COPYMATE by selecting 'copymate' and pressing keypad-'5' (fire).
- It's a copy-program for CPC, but not very useful in emulation.
- But it's the only PD-program I know which doesn't need the AMSTRAD-ROM.
- You can click something ...
- If you've seen enough, select 'ENDE' in the middle of the screen.
- Another menue will appear, select 'Beenden' to leave Copymate.
- At this point, <ESC> will restart the 'operating system'.
- To stop emulation, use F10 now.
- You can repeat this by pressing 'F' for fast-emulation. You can see
- the improvement of the fast-emulation only with the pointer.
- The rest is rather slow, since COPYMATE flips very often between
- 2 memory-states, were 2 4000h KB banks must be swapped.
-
- If you want a real CPC, you must copy the ROM's to a file first.
- See below.
-
- How to get a real CPC:
- For copyright reasons I can't include the original AMSTRAD-ROM,
- you should get it from somewhere else.
- If you've a 5.25"-Floppy connected to your CPC, there's no problem.
- - Use 22DISK by SYDEX to copy ROMGET1 to a CPC-formatted disk.
- - start ROMGET1 on your CPC
- (it will save the OS/BASIC as 32K-File called Z80CPC.ROM
- and the AMSDOS as 16K-File called ZDISK.ROM (only if present) )
- - Copy these files with 22DISK to your PC in the same directory
- where CPCEMU is.
- - Start CPCEMU and you've a real CPC on your PC.
-
-
- The debug-menu:
- A Z80-CPU-Dump shows all registers.
- Use the following commands :
- [option] is optional.
-
- 'R'[address]
- to Run the slow-emulation at full speed (graphic-mode 0x0e
- is selected) from actual PC or optional address.
- You can stop the emulation by F10 and you can
- always continue with 'R' ,'S' , 'T' , 'F' !
- Examples:
- -> r run emulation from current PC
- -> r100 set PC to 100h and run emulation
-
- 'S'[address]
- Step-over from current PC or address. After the actual
- instruction a (invisible) breakpoint is placed and emulation
- continues until this breakpoint is reached or F10 is
- pressed.
-
- 'T'[address]
- Trace-into, real single step, only one instruction is
- executed. 'Enter' repeats T, other key+return exits.
-
- 'D'[address]
- Dumps memory from PC or address.
- 'Enter' repeats D, other key+return exits.
-
- 'A'[address]
- DisAssembles from PC or address.
- 'Enter' repeats D, other key+return exits.
-
- 'I'[address]
- Input (edit) Bytes from PC or address. Enter hex-Values
- to change, use 'Enter' to take and '-1' (or some other non-byte
- value) to quit input.
-
- 'L'[filename]
- Loads binary-file (with 0x80-Byte-Header) to address PC.
-
- 'V'[filename]
- Saves binary-file (with 0x80-Byte-Header) from address PC.
- You should input the desired length.
- (At the moment, the header is only filled with 'M'.)
-
- 'P'[address]
- Sets PC to address.
-
- 'M'
- Change display-mode (Disassemble,CPU-Dump on/off)
-
- 'F'[address]
- Fast-Emulation with a Assembler-Z80-Emulator by Juergen Weber.
- Now it's functional !
-
- 'Q'
- Quit CPCEMU.
-
- Examples:
- -> p3ab0 (or p <enter> 3ab0 <enter>) set PC to 3ab0h
- -> da000 (or ...) dump memory from 0a000h
- -> r0 run slow-emulation from 0 (reset)
- -> lName <enter> loads file 'name' to address PC
- (or l <enter> Name <enter> )
- -> vName <enter> 4000 <enter> saves 4000h bytes from address PC
- to a file Name.
- -> f <enter> run fast-emulation from PC
-
-
- During Emulation :
- - Keyboard:
- I've implemented a new keyboard-handler by Arnt Gulbrandsen, Arnt uses
- it in his spectrum-emulaton JPP. It took me nearly one afternoon to
- understand the routine and adapt it for CPC. Thanks anyway.
- Close your eyes, imagine the CPC and press the key you wish.
- This means, the keyboard-layout on PC is nearly the same as on CPC.
- Special keys:
- PC: - CPC or function:
- ----------------------------
- F2 - see CPC-screen (in graphics mode)
- F3 - see message-screen (p.e. cat from cassette)
-
- F8 - full emulation-reset (like a CPC-reset-button)
- use it, if CTRL-SHIFT-ESC isn't running.
-
- F10 - stop emulation
- ALT, ALT2 - COPY
- keypad - function-keys f0..f9 (with num-lock on)
- keypad - Joystick (0) (with num-lock off)
-
-
-
- What's supported:
-
- - Z80-Emulation :
- There're two different emulations:
- a) A slow emulation written in C:
- All Z80-Instructions are emulated, also 'illegal', like
- DD 63 LD XH,E (loads the high-byte of IX with E).
- FD CB 12 18 RR (IY+&12) & LD B ( rotates (IY+&12) right and
- loads the result to B : & LD B,(IX+&12) )
- R-Register not supported any more. (But it's only a #define ...)
- Every 600 instructions, an interrupt is generated and every
- 3th interrupt, the screen is updated.
- See Z80INS.DOC for a (nearly) full instruction-table.
-
- b) The fast-Z80-emulation written by Jürgen Weber (he uses it in
- his CP/M-Emulator ZSIM and implemented banking).
- It's entirely written in assembler and highly optimised. So it is
- five to - don't ask me - times faster than the slow-version.
- It also supports most 'illegal' instructions.
- [ Every 1/300 sec an interrupt is generated and every
- 6th interrupt, the screen is updated. ]
- In this version : every 1600 instructions.
-
-
- - CPC-Hardware:
- The Z80 CPU communicates with the CPC-hardware via IN and OUT :
-
- a) GATE-Array :
- - all 32 colours of the CPC (27 different)
- - all 3 modes (x,y,colours) :
- mode 0 = 160x200x16
- mode 1 = 320x200x4
- mode 2 = 640x200x2
- - rom-banking (16KB OS, 16KB BASIC, 16KB AMSDOS)
- - ram-banking (8*16KB = 128KB)
- Rather slow, since the banks must be moved.
-
- b) CRTC :
- - screen-base, screen-offset (hardware-scrolling)
- - different screen-sizes (with CRTC-Reg. 1 and 6)
-
- c) PIO 8255:
- - Keyboard (connected to PSG)
-
- d) FDC:
- - read/write sector for Drive A supported
- (uses file DISK1.CPC wich is a special image of a CPC-Disk)
-
- e) CASSETTE:
- Cassette-Commands (use |TAPE first) are redirected to files
- in the current directory.
- This is done by modifying the ROM (depending on CPC) with a
- new instruction only the emulator knows:
- ED FC xx USER &BCxx ;only valid for some RAM-Vectors.
- calls a special routine for handling the vector.
- Note: You can still patch the RAM-vectors !
-
- You can use files with header (BINARY,BASIC) or without (ASCII).
- The Header is AMSDOS-like, so you can copy single files from a
- CPC-diskette. Use filenames up to 16 characters (limited by BASIC).
- With F3 you can flip to the message window to see, if some errors
- occur. The CATaloge is listed there, too.
- F2 flips back to CPC-screen.
-
-
-
- Not yet supported:
- - Sound (PSG=Programmable Sound Generator)
- - PC-Joystick
- - different modes on the screen (maybe later ...)
- - real frame-fly (only after 6 interrupts one frame-fly, now
- every 3th in(&f5xx) the vsync-bit toggles. )
- - overscan (never, it's too slow)
-
- Bugs:
- - There seem to be some minor bugs in the emulation
- (INPUT #9,t$ (IN CHAR) isn't functional)
- - With COPYMATE: You can't load a program. (It uses a trick ...)
- - Problem with CP/M Plus
- - PLEASE REPORT ANY BUGS !
-
-
- What's running:
- a)
- - OS, BASIC, AMSDOS
- - CP/M 2.2 (I think)
-
- b) Games (tested):
- - Ghosts'n Goblins, Avenger
-
-
-
- Finally :
- Thanks to Jürgen Weber for his fast Z80-Emulation (and ZSIM-source),
- thanks to Arnt Gulbrandsen for his keyboard-handler (and JPP-source).
-
-
-
- Write your comments to:
- *************************
- * Marco Vieth *
- * Auf dem Uekern 4 *
- * 4791 Lichtenau-Atteln *
- * (Germany) *
- *************************
-
- or use email:
- ali@uni-paderborn.de
-
-
-
- ------------------------------------------------------------------------------
- the next doc will be much better if there is some interest ...
- ------------------------------------------------------------------------------
-