home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / emulate / systems / zx80 / summary.doc < prev    next >
Text File  |  1992-07-26  |  23KB  |  447 lines

  1. Sinclair ZX Spectrum Emulator V1.41 - 27/7/92  -  by G.A. Lunter
  2.  
  3.  
  4.         For those who do not know enough Dutch to read the manual
  5.         Z80.DOC, a summary follows in English:
  6.  
  7.  
  8. 1. Introduction & Registration
  9.  
  10.         The Spectrum Emulator 'Z80' is a program that emulates a
  11.         Sinclair ZX Spectrum 48K model 2 or 3, with Interface I,
  12.         complete Z80, screen, keyboard, interrupt and sound emulation,
  13.         full tape support (normal and speedload), and has many
  14.         additional features such as Interface I RS232 in/output to
  15.         PC devices (file, COM, LPT), many Spectrum joystick interfaces
  16.         controllable by PC cursor keys, analog and digital PC joysticks,
  17.         conversion programs that make GIF files out of Spectrum screens,
  18.         turn Spectrum BASIC programs into PC textfiles and vice versa,
  19.         convert snapshot files of VGASPEC and JPP (also Spectrum
  20.         Emulators) into .Z80 files (this Spectrum Emulator's snapshot
  21.         format) and vice versa, a DISCiPLE disk read program, an
  22.         extensive manual, and more!
  23.  
  24.         The Spectrum Emulator is a Shareware-program. You are allowed to
  25.         try it for a month, and if you like it you should register for it.
  26.         When registered, you will receive a registered version of the
  27.         Spectrum Emulator, four utilities and the sourcefiles of the
  28.         Emulator. The shareware-version of the Emulator is fully
  29.         functional, except for the Tape support and the possibility of
  30.         slowing down the Emulator, which are available only to
  31.         registered users. Registered users will also be informed of
  32.         future updates of the Emulator.
  33.  
  34.         The shareware package of the Spectrum Emulator consists of the
  35.         following files:
  36.  
  37.             Z80.EXE      - The Emulator
  38.             ROMS.BIN     - The ROMs of the Spectrum and SamRam
  39.             GETRS.COM    - Utility to send programs from Spectrum to PC
  40.             SAVESPEC.BAS - Idem, see paragraph 6.
  41.             DIAGRAMS.Z80 - Diagrams for tape interfaces, and calibration
  42.             Z80.DOC      - Documentation file --- in Dutch
  43.             LEESMIJ.DOC  - Summary of documentation --- in Dutch
  44.             NIEUW.DOC    - What's new
  45.             SUMMARY.DOC  - This file
  46.  
  47.         These are the utilities you'll receive upon registering:
  48.  
  49.                 CONVERT  - a general conversion program for converting
  50.                            many Spectrum file formats into PC formats
  51.                            and vice versa. It can produce GIF files of
  52.                            Spectrum screens, make text-listings of
  53.                            programs and more.
  54.                 CONVZ80  - Translates snapshot files from VGASPEC's .SNA
  55.                            and JPP's .SP formats to this Emulator's .Z80
  56.                            format and vice versa.
  57.                 Z80DUMP  - Shows the contents of the header of a .Z80
  58.                            file
  59.                 DISCIPLE - Reads DISCiPLE diskettes. It translates
  60.                            normal files into files that can be read
  61.                            using the Interface I's LOAD *"b" command,
  62.                            and translates snapshot files into .Z80
  63.                            files.
  64.  
  65.         The registration fee is 35 Dutch guilders, 10 English pounds,
  66.         20 US$, or 35 Deutsche Marken. For Dutch users, the registration
  67.         fee is Hfl 25,--. Please send the money to:
  68.  
  69.                 G.A. Lunter,
  70.                 Aweg 11a,
  71.                 9718 CT Groningen,
  72.                 The Netherlands
  73.  
  74.         If you can, please use Eurocheques or send it cash. If you use
  75.         Eurocheques please do NOT fill in the place (or fill in
  76.         'Groningen'), because otherwise I have to pay a large commission.
  77.         Unfortunately I cannot accept creditcards. Also, please don't
  78.         forget to give me your address (including your country.) It is
  79.         also possible to reach me by Internet via Johan Muizelaar: his
  80.         e-mail address is mouse@frw.rug.nl
  81.  
  82.  
  83. 2. Getting Started
  84.  
  85.         The Spectrum Emulator can be configured in many ways. Most of
  86.         these configurations can be altered from the Main Menu. You enter
  87.         the Main Menu by pressing F10. Other configurations must be
  88.         specified when the Emulator is loaded, by putting the right
  89.         'switches' on the command line. The following switches are
  90.         possible:
  91.  
  92.          -h        Hercules graphics
  93.          -x        Extended Hercules graphics
  94.          -c        CGA graphics
  95.          -e        EGA/VGA graphics
  96.          -p        Plantronics graphics
  97.          -q        Plantronics (greytones)
  98.          -n        Standard Spectrum (without IF1)
  99.          -s        Spectrum with SamRam
  100.          -jk       Kempston joystick (instead of Cursor)
  101.          -j1, -j2  Sinclair joystick 1,2 (instead of Cursor)
  102.          -kk       Do not use a digital or analog joystick
  103.          -kz       Use digital Zandbergen joystick
  104.          -d        Double interruptfrequency
  105.          -l        LDIR/LDDR emulation
  106.          -f        Faster FLASH emulation
  107.          -r        R register emulation
  108.          -w        16K IF1 bankswitch
  109.          -2        Emulate Issue-2 Spectrum
  110.          -g        No sound
  111.          -bN       Tape I/O via LPTn
  112.          -yl, -yh  Low, high video sync.
  113.          -aN       Spec RS232 output to LPTn
  114.          -oN       Spec RS232 output to COMn
  115.          -iN       COMn to Spec RS232 input
  116.          -tF       Spec RS232 output to file F
  117.          -uF       File F to Spec RS232 input
  118.          -znnn.n   Force relative snelheid nnn.n%
  119.          -?        Short summary of possible options (in Dutch!)
  120.  
  121.         Normally, the Spectrum Emulator tries to find out on his own
  122.         which video adapter should be used. You can bypass this by
  123.         specifying directly which one should be used, using the switches
  124.         -h, -x, -e, -p or -q. If you have a Hercules adapter, try using
  125.         -x; it gives a better result and works on most systems.
  126.  
  127.         When -n is specified, the Emulator is stripped to the bone:
  128.         only the original Spectrum is emulated, without the Interface
  129.         I. If you have memory problems, this might be useful.
  130.  
  131.         Options -jk and -j1, -j2 control the joystick emulation.
  132.         Normally, the PC-cursor keys are attached to the Spectrum
  133.         cursor keys, 5 6 7 8 and 0. (The TAB key, and the 5, 0 and .
  134.         keys are emulated as 'Fire', 0 in the case of cursor keys). The
  135.         Kempston joystick is emulated when -jk is specified, and the
  136.         Sinclair 1 and 2 joysticks respectively when -j1 or -j2 is
  137.         specified. The Spectrum joystick can also be controlled by
  138.         an analog PC-joystick or a digital joystick. If a joystick is
  139.         attached it will automatically be made to control the Spectrum
  140.         joystick. If you don't want joystick-control, option -kk
  141.         disables the analog joystick. Option -kz enables the digital
  142.         Zandbergen joystick. (A wiring diagram of the Zandbergen
  143.         digital joystickinterface is to be found in the file Z80.DOC)
  144.  
  145.         Option -d results in a twice as high as normal interrupt
  146.         frequency. This may speed up some games, slow down others, and
  147.         makes the keyboard respond more promptly when typing in BASIC
  148.         programs on the Emulated Spectrum.
  149.  
  150.         The -l option slows down the LDIR and LDDR instructions of
  151.         the emulated Z80. These instructions are carried out very much
  152.         faster relative to the other Z80 instructions. Some programs,
  153.         notably Jetset Willy and Manic Miner, will get irritatingly
  154.         fast if this option is not used.
  155.  
  156.         If -f is specified, the Flash-frequency is doubled. This is
  157.         not particularly useful, although it might be on the slowest
  158.         PC's.
  159.  
  160.         Option -r is rarely needed. Only when this option is
  161.         specified the R-register of the Z80 will behave correctly,
  162.         increasing by one every time an instruction is carried out.
  163.         Otherwise the R-register will behave as an random-generator.
  164.         Activation the R register emulation will slow down the Spectrum
  165.         Emulator by about 30%. This options is only useful if you want
  166.         to load copy-protected games from tape: these games use the R
  167.         register for protection purposes.
  168.  
  169.         From version 1.25 onwards, option -2 is added, because of
  170.         compatibility problems with older Spectrum programs. PRINT IN
  171.         254 will give a number lower or equal to 191 on Issue 3
  172.         Spectrums, but gives 255 (when no keys are being pressed) on
  173.         Issue 2's.
  174.  
  175.         Option -g turns off the sound.
  176.  
  177.         Options -a, -o, -i, -t and -u are used to control the
  178.         communication of the emulated Spectrum with the PC. The RS232
  179.         channel of the Interface I can be attached to COM-ports
  180.         (bidirectional), to the LPT ports (unidirectional) and to
  181.         files (bidirectional). It is more convenient, however, to use
  182.         the Main Menu to alter these settings instead of specifying
  183.         them at the command line.
  184.  
  185.         Option -z can be used to slow down the Emulator on fast
  186.         machines. This option is only available to registered users.
  187.         The Emulator may be slowed down up to a factor four, and will by
  188.         default run as fast as it can. After the z the desired speed as
  189.         a percentage of the speed of the real Spectrum should be given.
  190.         For instance, "-z 100" will make the Emulator run exactly as
  191.         fast as the real Spectrum, "-z 0" will make it run as slow as
  192.         possible. This option is available only to registered users.
  193.  
  194.         Occasionally, the moving characters of a Spectrum program
  195.         tend to 'flicker' on the Spectrum Emulator, even if they didn't
  196.         do so on the real Spectrum. If this happens, try using -yl or
  197.         -yh. Usually -yl works.
  198.  
  199.         Finally, a filename can be specified on the command line.
  200.         This file will be regarded as a .Z80 file, and loaded into the
  201.         Emulator. It is no necessary to specify the extension .Z80.
  202.  
  203.  
  204. 3. Keyboard
  205.  
  206.         Special keys are:
  207.  
  208.         F1              = Help page
  209.         F2              = Save Spectrum program (as .Z80 file)
  210.         F3              = Load Spectrum program (as .Z80 file)
  211.         F4              = Change settings
  212.         F5              = Generate NMI
  213.         ALT-F6          = Generate Reset
  214.         F7              = Enter Real mode (see next paragraph)
  215.         F10             = Enter Main Menu
  216.         ALT, CTRL       = Symbol Shift
  217.         ESC             = EDIT (Shift-1)
  218.         PC-cursorkeys   = Joystick (kempston, cursor or sinclair 1-2)
  219.         TAB, 0, 5, .    = Fire! (joystick) (0,5,. on numeric keypad)
  220.         CTRL-BREAK      = Quit the Emulator
  221.  
  222.         Normally, an NMI generates a reset or does nothing at all. When
  223.         the SamRam is active (use option -s when starting the Emulator),
  224.         you can, among other things, use the build-in disassembler,
  225.         which is very MONS-like, at least visually.
  226.  
  227.  
  228. 4. Tape support
  229.  
  230.         Version 1.40 of the Spectrum Emulator includes full tape support.
  231.         This means that all Spectrum programs can be loaded directly
  232.         from tape. This includes programs that use speedload! Also,
  233.         Spectrum programs that run on the Emulator can be saved back to
  234.         tape to be loaded into a real Spectrum. Tape support is,
  235.         however, available to registered users only.
  236.  
  237.         To connect your PC to a taperecorder, you'll need a
  238.         tape-interface. In the file DIAGRAMS.Z80, a Spectrum program
  239.         that can be run by the Emulator, there are two diagrams for tape
  240.         interfaces, that use the LPT port to connect the PC to a tape
  241.         recorder. The first diagram involves an OpAmp and works very
  242.         well. The second, simpler diagram also works well, but the
  243.         setting of the volume is more sensitive, and it must be cali-
  244.         brated. The program DIAGRAMS.Z80 includes a small program that
  245.         tests the interface, and can used to calibrate the simple
  246.         interface.
  247.  
  248.         Just type LOAD "" to start loading a Spectrum program from tape.
  249.         A window appears on screen, saying that the Emulator is loading
  250.         a header-type block from tape of 17 bytes. If you use an EGA or
  251.         VGA video adapter you should see bars in the border just as on
  252.         an ordinary Spectrum. After each block (that is, after a header
  253.         or data-block) the window disappears and the Emulator continues
  254.         emulating. Any tape error also causes the window to disappear,
  255.         and leaves the ROM to handle the error in the usual way.
  256.         Pressing any key (not only the space bar) causes a BREAK to be
  257.         generated.
  258.  
  259.         In this mode of loading, a small subroutine of the Emulator
  260.         loads the program from tape. It is not the emulated ROM that
  261.         loads the program. This means that even with a slow PC you can
  262.         load programs, and that the speed of the emulated Spectrum does
  263.         not need to be 100%. It also means that it is impossible to load
  264.         programs that use own load-routines, such as speed-loaders.
  265.  
  266.         There is another mode, the so-called Real mode, in which the
  267.         Emulator runs smooth and allows for the loading of speed-saved
  268.         programs. In this mode, the keyboard cannot be used and the
  269.         PC-screen is not updated. If you want to load a Spectrum program
  270.         in Real mode, you need a fast computer. The Emulator should run
  271.         at at least 100%, preferably at 110%. If the Emulator runs too
  272.         fast, it should be slowed down to 110% as closely as possible.
  273.         (On very fast computers, the real speed may be slightly off the
  274.         computed speed, and a little experimentation may be needed to
  275.         get the best results.) Type LOAD "", and press F7 to go to the
  276.         Real mode. A small window appears, and from now on nothing
  277.         happens on screen anymore (except for bars in the border if you
  278.         are loading and use EGA of VGA.). At the short breaks between
  279.         the blocks you may press U to update the screen and see what's
  280.         happened. Never press U during loading, since tape errors will
  281.         result. If the program has loaded, you can return to the normal
  282.         mode and play the game.
  283.  
  284.         If you try to load speed-saved programs, you'll notice that some
  285.         may crash upon loading or even before. This is because many
  286.         speed-saved programs are protected in many ingenious ways that
  287.         make use of rarely needed properties of the Z80 chip. If this
  288.         happens, try using options -r and -l (R-register and LDIR
  289.         emulation). The first option has the drawback that it slows down
  290.         the Emulator so that it may be unable to load the program in
  291.         Real mode. In this case, and also when your computer is slightly
  292.         too slow even when -r isn't used, you can try to let your
  293.         tape-recorder run slower than normal.
  294.  
  295.         On some EGA/VGA display cards, it is possible that 'snow' appears
  296.         on the monitor during loading. Unfortunately, there is no way to
  297.         avoid this, but it causes no problems.
  298.  
  299.         Saving is also possible in two ways, but I don't see a point in
  300.         saving programs in real mode. The result is always better if you
  301.         use the built-in save routine, and it works much easier.
  302.  
  303.         Finally, there is an easy way to save complete Spectrum programs
  304.         in a standard format to tape, which can be loaded by normal
  305.         Spectrums. This method uses the software of the SamRam. This is
  306.         how it works: start up the Emulator using switch -s and load the
  307.         program (as .Z80 file, or from tape). At a convenient point,
  308.         press F5 to generate an NMI, and press S to save the program,
  309.         and S to enter a filename. Press enter, and the program will be
  310.         saved. It is understood that this method may NOT be used to
  311.         copy commercial programs!!
  312.  
  313.  
  314. 5. .Z80 files
  315.  
  316.         The .Z80 files are a slightly packed Spectrum memory dump
  317.         format. At any point in the program, you can save the current
  318.         state of the Spectrum in such a file, by going to the Main Menu
  319.         and using option 'Save Program'. It can then be loaded back,
  320.         by specifying the filename on the command line, or using option
  321.         'Load Program'.
  322.  
  323.         For the insiders, an explanation of the format of .Z80 files
  324.         will now be given. A .Z80 file starts off with an 30-byte header-
  325.         block. In this block, the status of the emulated Z80 processor at
  326.         the point at which the Z80-emulator was stopped by the user is
  327.         specified. A few extra environmental variables complete the
  328.         header.
  329.  
  330.         Byte    Length  Description
  331.         0       1       A register
  332.         1       1       F register
  333.         2       2       BC register pair (LSB, i.e. C, first)
  334.         4       2       HL register pair
  335.         6       2       Program counter
  336.         8       2       Stack pointer
  337.         10      1       Interrupt register
  338.         11      1       Refresh register (Bit 7 is not significant!)
  339.         12      1       Bit 0  : Bit 7 of the R-register
  340.                         Bit 1-3: Border colour
  341.                         Bit 4  : 1=SamRom switched in
  342.                         Bit 5  : 1=Block of data is 'squeezed'
  343.                         Bit 6-7: No meaning
  344.         13      2       DE register pair
  345.         15      2       BC' register pair
  346.         17      2       DE' register pair
  347.         19      2       HL' register pair
  348.         21      1       A' register
  349.         22      1       F' register
  350.         23      2       IY register (Again LSB first)
  351.         25      2       IX register
  352.         27      1       Interrupt flipflop, 0=DI, otherwise EI
  353.         28      1       IFF2 (not particularly important...)
  354.         29      1       Bit 0-1: Interrupt mode (0, 1 or 2)
  355.                         Bit 2  : 1=Issue 2 emulation
  356.                         Bit 3  : 1=Double interruptfrequency
  357.                         Bit 4-5: 1=High video synchronisation
  358.                                  3=Low video synchronisation
  359.                                  0,2=Normal
  360.                         Bit 6-7: 0=Cursor/Protek/AGF joystick
  361.                                  1=Kempston joystick
  362.                                  2=Sinclair 1 joystick
  363.                                  3=Sinclair 2 joystick
  364.  
  365.         After these 30 bytes, a memory dump of the emulated Spectrum
  366.         follows, consisting of the bytes at address 16384 up to 65535.
  367.         The first versions of the Spectrum Emulator just dumped the full
  368.         48K after the header. These versions therefore produced .Z80
  369.         files that were 49182 bytes (=48K + 30 bytes) in length. The
  370.         sharewareversions of the Emulator all use a slightly different
  371.         method of storing the 48K datablock, thereby reducing the size
  372.         of the .Z80 files. In effect, the method consists of finding all
  373.         sequences of equal bytes, and replacing them by a code of four
  374.         bytes, "ED ED xx yy" which tells that byte yy is to repeated xx
  375.         times. An example will make it clear:
  376.  
  377.                 ED 00 44 ED ED 05 00 02 ...             (.Z80 file)
  378.  
  379.         is translated back into
  380.  
  381.                 ED 00 44 00 00 00 00 00 02 ...          (Spec-memory)
  382.  
  383.         Obviously, only sequences of length at least 4 will be coded,
  384.         for otherwise there would be no gain in the number of stored
  385.         bytes. Sequences of 'ED' are treated separately: the minimum
  386.         length of an 'ED'-sequence to be coded is 2, to avoid problems
  387.         when translating back. And lastly, if a single 'ED' is
  388.         encountered, thus an 'ED' followed by a different byte, then this
  389.         byte following the 'ED' will not be included in a block. This is
  390.         done to avoid 'ED 00 00 00 00 00' to be translated into 'ED ED ED
  391.         05 00' which would not be translated back correctly. This
  392.         particular sequence of bytes will be coded into 'ED 00 ED ED 04
  393.         00'. For a coder-decoder algorithm worked out in 8086-assembly,
  394.         see the source of CONVZ80. (Only for registered users, of course!)
  395.  
  396.  
  397. 6. Porting programs
  398.  
  399.         There are several ways to port a program from the Spectrum to
  400.         the PC-environment, where it can be used by the Spectrum
  401.         Emulator. The simplest way is to load Spectrum programs from
  402.         tape, see paragraph 4.
  403.  
  404.         Sencondly, if you have a Disciple disk interface, you can load
  405.         all files directly from Disciple disks using a converter program
  406.         which is supplied with the registered version of the Emulator.
  407.  
  408.         If you have an interface I, you can also use the RS232 interface
  409.         to send the program to the PC. You can use a null-modem cable to
  410.         connect the Interface-I with the PC. Then:
  411.  
  412.         - Type: Z80 /u savespec.bas
  413.         - Type at the emulated-Spectrum prompt: LOAD *"b"
  414.         - Type Enter: you'll see a short BASIC-program appear.
  415.         - Type this program over into a real Spectrum.
  416.         - RUN it on the real Spectrum. It will generate a short piece
  417.           of code, which will be saved to tape.
  418.         - Now load the program you want to download to the PC in the real
  419.           Spectrum, and stop it. (This might be the most difficult part!)
  420.         - Type: OPEN #3,"b" on the real Spectrum.
  421.         - Configure COM1 (or 2, of course) using MODE at 9600,n,8,1.
  422.         - Type at the DOS-prompt: GETRS filename.Z80 (or: GETRS /2 etc)
  423.         - LOAD, on the real Spectrum, the short piece of machine-code at
  424.           any convenient place in the memory. If you don't know where to
  425.           load it, you can always load it into screen-memory, using
  426.           LOAD "" CODE 16384.
  427.         - Type: RANDOMIZE USR 16384 on the real Spectrum. You should see
  428.           a fast-running counter on the PC-screen. When it reaches
  429.           49182, it stops, and after two of three seconds GETRS writes
  430.           the block of data to disk.
  431.         - Now type Z80, go to the Main Menu, load the program, go back
  432.           using option 'T', and start the program using a RUN or a
  433.           RANDOMIZE USR. If it runs allright, write it back to disk,
  434.           using the option 'Save program' in the main menu. It will
  435.           now be packed, occupying less than 49182 bytes on the disk.
  436.  
  437.         There is another convenient way to port Spectrum programs to the
  438.         PC environment, using a program called BDDE with which you can
  439.         read Beta-disk floppies directly into the PC. BDDE is a
  440.         shareware program, and is available at many BBS's in the
  441.         Netherlands, and on the Spectrum Emulator Support BBS,
  442.         +31-50-264840 1200/2400 bps, between 22.00 and 11.00 local time.
  443.  
  444.  
  445.  
  446. <*** End of Summary.Doc ***>
  447.