home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
emulate
/
systems
/
zx80
/
summary.doc
< prev
next >
Wrap
Text File
|
1992-07-26
|
23KB
|
447 lines
Sinclair ZX Spectrum Emulator V1.41 - 27/7/92 - by G.A. Lunter
For those who do not know enough Dutch to read the manual
Z80.DOC, a summary follows in English:
1. Introduction & Registration
The Spectrum Emulator 'Z80' is a program that emulates a
Sinclair ZX Spectrum 48K model 2 or 3, with Interface I,
complete Z80, screen, keyboard, interrupt and sound emulation,
full tape support (normal and speedload), and has many
additional features such as Interface I RS232 in/output to
PC devices (file, COM, LPT), many Spectrum joystick interfaces
controllable by PC cursor keys, analog and digital PC joysticks,
conversion programs that make GIF files out of Spectrum screens,
turn Spectrum BASIC programs into PC textfiles and vice versa,
convert snapshot files of VGASPEC and JPP (also Spectrum
Emulators) into .Z80 files (this Spectrum Emulator's snapshot
format) and vice versa, a DISCiPLE disk read program, an
extensive manual, and more!
The Spectrum Emulator is a Shareware-program. You are allowed to
try it for a month, and if you like it you should register for it.
When registered, you will receive a registered version of the
Spectrum Emulator, four utilities and the sourcefiles of the
Emulator. The shareware-version of the Emulator is fully
functional, except for the Tape support and the possibility of
slowing down the Emulator, which are available only to
registered users. Registered users will also be informed of
future updates of the Emulator.
The shareware package of the Spectrum Emulator consists of the
following files:
Z80.EXE - The Emulator
ROMS.BIN - The ROMs of the Spectrum and SamRam
GETRS.COM - Utility to send programs from Spectrum to PC
SAVESPEC.BAS - Idem, see paragraph 6.
DIAGRAMS.Z80 - Diagrams for tape interfaces, and calibration
Z80.DOC - Documentation file --- in Dutch
LEESMIJ.DOC - Summary of documentation --- in Dutch
NIEUW.DOC - What's new
SUMMARY.DOC - This file
These are the utilities you'll receive upon registering:
CONVERT - a general conversion program for converting
many Spectrum file formats into PC formats
and vice versa. It can produce GIF files of
Spectrum screens, make text-listings of
programs and more.
CONVZ80 - Translates snapshot files from VGASPEC's .SNA
and JPP's .SP formats to this Emulator's .Z80
format and vice versa.
Z80DUMP - Shows the contents of the header of a .Z80
file
DISCIPLE - Reads DISCiPLE diskettes. It translates
normal files into files that can be read
using the Interface I's LOAD *"b" command,
and translates snapshot files into .Z80
files.
The registration fee is 35 Dutch guilders, 10 English pounds,
20 US$, or 35 Deutsche Marken. For Dutch users, the registration
fee is Hfl 25,--. Please send the money to:
G.A. Lunter,
Aweg 11a,
9718 CT Groningen,
The Netherlands
If you can, please use Eurocheques or send it cash. If you use
Eurocheques please do NOT fill in the place (or fill in
'Groningen'), because otherwise I have to pay a large commission.
Unfortunately I cannot accept creditcards. Also, please don't
forget to give me your address (including your country.) It is
also possible to reach me by Internet via Johan Muizelaar: his
e-mail address is mouse@frw.rug.nl
2. Getting Started
The Spectrum Emulator can be configured in many ways. Most of
these configurations can be altered from the Main Menu. You enter
the Main Menu by pressing F10. Other configurations must be
specified when the Emulator is loaded, by putting the right
'switches' on the command line. The following switches are
possible:
-h Hercules graphics
-x Extended Hercules graphics
-c CGA graphics
-e EGA/VGA graphics
-p Plantronics graphics
-q Plantronics (greytones)
-n Standard Spectrum (without IF1)
-s Spectrum with SamRam
-jk Kempston joystick (instead of Cursor)
-j1, -j2 Sinclair joystick 1,2 (instead of Cursor)
-kk Do not use a digital or analog joystick
-kz Use digital Zandbergen joystick
-d Double interruptfrequency
-l LDIR/LDDR emulation
-f Faster FLASH emulation
-r R register emulation
-w 16K IF1 bankswitch
-2 Emulate Issue-2 Spectrum
-g No sound
-bN Tape I/O via LPTn
-yl, -yh Low, high video sync.
-aN Spec RS232 output to LPTn
-oN Spec RS232 output to COMn
-iN COMn to Spec RS232 input
-tF Spec RS232 output to file F
-uF File F to Spec RS232 input
-znnn.n Force relative snelheid nnn.n%
-? Short summary of possible options (in Dutch!)
Normally, the Spectrum Emulator tries to find out on his own
which video adapter should be used. You can bypass this by
specifying directly which one should be used, using the switches
-h, -x, -e, -p or -q. If you have a Hercules adapter, try using
-x; it gives a better result and works on most systems.
When -n is specified, the Emulator is stripped to the bone:
only the original Spectrum is emulated, without the Interface
I. If you have memory problems, this might be useful.
Options -jk and -j1, -j2 control the joystick emulation.
Normally, the PC-cursor keys are attached to the Spectrum
cursor keys, 5 6 7 8 and 0. (The TAB key, and the 5, 0 and .
keys are emulated as 'Fire', 0 in the case of cursor keys). The
Kempston joystick is emulated when -jk is specified, and the
Sinclair 1 and 2 joysticks respectively when -j1 or -j2 is
specified. The Spectrum joystick can also be controlled by
an analog PC-joystick or a digital joystick. If a joystick is
attached it will automatically be made to control the Spectrum
joystick. If you don't want joystick-control, option -kk
disables the analog joystick. Option -kz enables the digital
Zandbergen joystick. (A wiring diagram of the Zandbergen
digital joystickinterface is to be found in the file Z80.DOC)
Option -d results in a twice as high as normal interrupt
frequency. This may speed up some games, slow down others, and
makes the keyboard respond more promptly when typing in BASIC
programs on the Emulated Spectrum.
The -l option slows down the LDIR and LDDR instructions of
the emulated Z80. These instructions are carried out very much
faster relative to the other Z80 instructions. Some programs,
notably Jetset Willy and Manic Miner, will get irritatingly
fast if this option is not used.
If -f is specified, the Flash-frequency is doubled. This is
not particularly useful, although it might be on the slowest
PC's.
Option -r is rarely needed. Only when this option is
specified the R-register of the Z80 will behave correctly,
increasing by one every time an instruction is carried out.
Otherwise the R-register will behave as an random-generator.
Activation the R register emulation will slow down the Spectrum
Emulator by about 30%. This options is only useful if you want
to load copy-protected games from tape: these games use the R
register for protection purposes.
From version 1.25 onwards, option -2 is added, because of
compatibility problems with older Spectrum programs. PRINT IN
254 will give a number lower or equal to 191 on Issue 3
Spectrums, but gives 255 (when no keys are being pressed) on
Issue 2's.
Option -g turns off the sound.
Options -a, -o, -i, -t and -u are used to control the
communication of the emulated Spectrum with the PC. The RS232
channel of the Interface I can be attached to COM-ports
(bidirectional), to the LPT ports (unidirectional) and to
files (bidirectional). It is more convenient, however, to use
the Main Menu to alter these settings instead of specifying
them at the command line.
Option -z can be used to slow down the Emulator on fast
machines. This option is only available to registered users.
The Emulator may be slowed down up to a factor four, and will by
default run as fast as it can. After the z the desired speed as
a percentage of the speed of the real Spectrum should be given.
For instance, "-z 100" will make the Emulator run exactly as
fast as the real Spectrum, "-z 0" will make it run as slow as
possible. This option is available only to registered users.
Occasionally, the moving characters of a Spectrum program
tend to 'flicker' on the Spectrum Emulator, even if they didn't
do so on the real Spectrum. If this happens, try using -yl or
-yh. Usually -yl works.
Finally, a filename can be specified on the command line.
This file will be regarded as a .Z80 file, and loaded into the
Emulator. It is no necessary to specify the extension .Z80.
3. Keyboard
Special keys are:
F1 = Help page
F2 = Save Spectrum program (as .Z80 file)
F3 = Load Spectrum program (as .Z80 file)
F4 = Change settings
F5 = Generate NMI
ALT-F6 = Generate Reset
F7 = Enter Real mode (see next paragraph)
F10 = Enter Main Menu
ALT, CTRL = Symbol Shift
ESC = EDIT (Shift-1)
PC-cursorkeys = Joystick (kempston, cursor or sinclair 1-2)
TAB, 0, 5, . = Fire! (joystick) (0,5,. on numeric keypad)
CTRL-BREAK = Quit the Emulator
Normally, an NMI generates a reset or does nothing at all. When
the SamRam is active (use option -s when starting the Emulator),
you can, among other things, use the build-in disassembler,
which is very MONS-like, at least visually.
4. Tape support
Version 1.40 of the Spectrum Emulator includes full tape support.
This means that all Spectrum programs can be loaded directly
from tape. This includes programs that use speedload! Also,
Spectrum programs that run on the Emulator can be saved back to
tape to be loaded into a real Spectrum. Tape support is,
however, available to registered users only.
To connect your PC to a taperecorder, you'll need a
tape-interface. In the file DIAGRAMS.Z80, a Spectrum program
that can be run by the Emulator, there are two diagrams for tape
interfaces, that use the LPT port to connect the PC to a tape
recorder. The first diagram involves an OpAmp and works very
well. The second, simpler diagram also works well, but the
setting of the volume is more sensitive, and it must be cali-
brated. The program DIAGRAMS.Z80 includes a small program that
tests the interface, and can used to calibrate the simple
interface.
Just type LOAD "" to start loading a Spectrum program from tape.
A window appears on screen, saying that the Emulator is loading
a header-type block from tape of 17 bytes. If you use an EGA or
VGA video adapter you should see bars in the border just as on
an ordinary Spectrum. After each block (that is, after a header
or data-block) the window disappears and the Emulator continues
emulating. Any tape error also causes the window to disappear,
and leaves the ROM to handle the error in the usual way.
Pressing any key (not only the space bar) causes a BREAK to be
generated.
In this mode of loading, a small subroutine of the Emulator
loads the program from tape. It is not the emulated ROM that
loads the program. This means that even with a slow PC you can
load programs, and that the speed of the emulated Spectrum does
not need to be 100%. It also means that it is impossible to load
programs that use own load-routines, such as speed-loaders.
There is another mode, the so-called Real mode, in which the
Emulator runs smooth and allows for the loading of speed-saved
programs. In this mode, the keyboard cannot be used and the
PC-screen is not updated. If you want to load a Spectrum program
in Real mode, you need a fast computer. The Emulator should run
at at least 100%, preferably at 110%. If the Emulator runs too
fast, it should be slowed down to 110% as closely as possible.
(On very fast computers, the real speed may be slightly off the
computed speed, and a little experimentation may be needed to
get the best results.) Type LOAD "", and press F7 to go to the
Real mode. A small window appears, and from now on nothing
happens on screen anymore (except for bars in the border if you
are loading and use EGA of VGA.). At the short breaks between
the blocks you may press U to update the screen and see what's
happened. Never press U during loading, since tape errors will
result. If the program has loaded, you can return to the normal
mode and play the game.
If you try to load speed-saved programs, you'll notice that some
may crash upon loading or even before. This is because many
speed-saved programs are protected in many ingenious ways that
make use of rarely needed properties of the Z80 chip. If this
happens, try using options -r and -l (R-register and LDIR
emulation). The first option has the drawback that it slows down
the Emulator so that it may be unable to load the program in
Real mode. In this case, and also when your computer is slightly
too slow even when -r isn't used, you can try to let your
tape-recorder run slower than normal.
On some EGA/VGA display cards, it is possible that 'snow' appears
on the monitor during loading. Unfortunately, there is no way to
avoid this, but it causes no problems.
Saving is also possible in two ways, but I don't see a point in
saving programs in real mode. The result is always better if you
use the built-in save routine, and it works much easier.
Finally, there is an easy way to save complete Spectrum programs
in a standard format to tape, which can be loaded by normal
Spectrums. This method uses the software of the SamRam. This is
how it works: start up the Emulator using switch -s and load the
program (as .Z80 file, or from tape). At a convenient point,
press F5 to generate an NMI, and press S to save the program,
and S to enter a filename. Press enter, and the program will be
saved. It is understood that this method may NOT be used to
copy commercial programs!!
5. .Z80 files
The .Z80 files are a slightly packed Spectrum memory dump
format. At any point in the program, you can save the current
state of the Spectrum in such a file, by going to the Main Menu
and using option 'Save Program'. It can then be loaded back,
by specifying the filename on the command line, or using option
'Load Program'.
For the insiders, an explanation of the format of .Z80 files
will now be given. A .Z80 file starts off with an 30-byte header-
block. In this block, the status of the emulated Z80 processor at
the point at which the Z80-emulator was stopped by the user is
specified. A few extra environmental variables complete the
header.
Byte Length Description
0 1 A register
1 1 F register
2 2 BC register pair (LSB, i.e. C, first)
4 2 HL register pair
6 2 Program counter
8 2 Stack pointer
10 1 Interrupt register
11 1 Refresh register (Bit 7 is not significant!)
12 1 Bit 0 : Bit 7 of the R-register
Bit 1-3: Border colour
Bit 4 : 1=SamRom switched in
Bit 5 : 1=Block of data is 'squeezed'
Bit 6-7: No meaning
13 2 DE register pair
15 2 BC' register pair
17 2 DE' register pair
19 2 HL' register pair
21 1 A' register
22 1 F' register
23 2 IY register (Again LSB first)
25 2 IX register
27 1 Interrupt flipflop, 0=DI, otherwise EI
28 1 IFF2 (not particularly important...)
29 1 Bit 0-1: Interrupt mode (0, 1 or 2)
Bit 2 : 1=Issue 2 emulation
Bit 3 : 1=Double interruptfrequency
Bit 4-5: 1=High video synchronisation
3=Low video synchronisation
0,2=Normal
Bit 6-7: 0=Cursor/Protek/AGF joystick
1=Kempston joystick
2=Sinclair 1 joystick
3=Sinclair 2 joystick
After these 30 bytes, a memory dump of the emulated Spectrum
follows, consisting of the bytes at address 16384 up to 65535.
The first versions of the Spectrum Emulator just dumped the full
48K after the header. These versions therefore produced .Z80
files that were 49182 bytes (=48K + 30 bytes) in length. The
sharewareversions of the Emulator all use a slightly different
method of storing the 48K datablock, thereby reducing the size
of the .Z80 files. In effect, the method consists of finding all
sequences of equal bytes, and replacing them by a code of four
bytes, "ED ED xx yy" which tells that byte yy is to repeated xx
times. An example will make it clear:
ED 00 44 ED ED 05 00 02 ... (.Z80 file)
is translated back into
ED 00 44 00 00 00 00 00 02 ... (Spec-memory)
Obviously, only sequences of length at least 4 will be coded,
for otherwise there would be no gain in the number of stored
bytes. Sequences of 'ED' are treated separately: the minimum
length of an 'ED'-sequence to be coded is 2, to avoid problems
when translating back. And lastly, if a single 'ED' is
encountered, thus an 'ED' followed by a different byte, then this
byte following the 'ED' will not be included in a block. This is
done to avoid 'ED 00 00 00 00 00' to be translated into 'ED ED ED
05 00' which would not be translated back correctly. This
particular sequence of bytes will be coded into 'ED 00 ED ED 04
00'. For a coder-decoder algorithm worked out in 8086-assembly,
see the source of CONVZ80. (Only for registered users, of course!)
6. Porting programs
There are several ways to port a program from the Spectrum to
the PC-environment, where it can be used by the Spectrum
Emulator. The simplest way is to load Spectrum programs from
tape, see paragraph 4.
Sencondly, if you have a Disciple disk interface, you can load
all files directly from Disciple disks using a converter program
which is supplied with the registered version of the Emulator.
If you have an interface I, you can also use the RS232 interface
to send the program to the PC. You can use a null-modem cable to
connect the Interface-I with the PC. Then:
- Type: Z80 /u savespec.bas
- Type at the emulated-Spectrum prompt: LOAD *"b"
- Type Enter: you'll see a short BASIC-program appear.
- Type this program over into a real Spectrum.
- RUN it on the real Spectrum. It will generate a short piece
of code, which will be saved to tape.
- Now load the program you want to download to the PC in the real
Spectrum, and stop it. (This might be the most difficult part!)
- Type: OPEN #3,"b" on the real Spectrum.
- Configure COM1 (or 2, of course) using MODE at 9600,n,8,1.
- Type at the DOS-prompt: GETRS filename.Z80 (or: GETRS /2 etc)
- LOAD, on the real Spectrum, the short piece of machine-code at
any convenient place in the memory. If you don't know where to
load it, you can always load it into screen-memory, using
LOAD "" CODE 16384.
- Type: RANDOMIZE USR 16384 on the real Spectrum. You should see
a fast-running counter on the PC-screen. When it reaches
49182, it stops, and after two of three seconds GETRS writes
the block of data to disk.
- Now type Z80, go to the Main Menu, load the program, go back
using option 'T', and start the program using a RUN or a
RANDOMIZE USR. If it runs allright, write it back to disk,
using the option 'Save program' in the main menu. It will
now be packed, occupying less than 49182 bytes on the disk.
There is another convenient way to port Spectrum programs to the
PC environment, using a program called BDDE with which you can
read Beta-disk floppies directly into the PC. BDDE is a
shareware program, and is available at many BBS's in the
Netherlands, and on the Spectrum Emulator Support BBS,
+31-50-264840 1200/2400 bps, between 22.00 and 11.00 local time.
<*** End of Summary.Doc ***>