home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 March / Chip_1998-03_cd.bin / hry / Sinclair / SimDOS3 / ZX.TXT < prev    next >
Text File  |  1997-03-11  |  18KB  |  441 lines

  1. *******************************************************************************
  2. *******************************************************************************
  3. *********************   Z  X     S  p  e  c  t  r  u  m   *********************
  4. *********************      E  M  U  L  A  T  O  R  v3.68  *********************
  5. *******************************************************************************
  6. ************************************* by Radovan Garabik & Lubomir Salanci ****
  7. *******************************************************************************
  8.  
  9. Introduction:
  10.  
  11. This emulator emulates Sinclair ZX Spectrum 48K. I have written also 
  12. 128K emulator, but it is still in (stopped) developing and has too many
  13. bugs, and I'd rather not put this into public.
  14. There are also some bugs in the 48K emulator, especially in emulating
  15. the R register  and undocumented instructions, but almost all of the 
  16. games run.
  17. Programs using non-standart loaders are also suported.
  18. Tape is emulatig using .LTP files, acting like virtual tapes.
  19. The emulator recognizes also .TAP files and can use them instead .LTP
  20.  
  21. This emulator is for free, you can give it to anybody you want
  22. (in fact, you are encouraged to do so), provided that you do not 
  23. change or delete anything in this package (you can add translation
  24. of this file in your local language) and you do not charge 
  25. anything for this program. 
  26.  
  27. As I said, this program is for free, but I surely will not object 
  28. if you send me some money :-). (How much do you think is this program
  29. worth? I would say, equivalent of $8 is more than enough).
  30. If you do so, you'll become a registered user and get the newest
  31. version (and you'll get always the new version, when there is one 
  32. released, if you have e-mail), some games I downloaded from 
  33. Spectrum (if you want), and sources. 
  34. It would really encourage me in making new versions.
  35.  
  36.  
  37. The other way how to get sources is to ask for them. I'll do
  38. not charge anything, but the sources are not for free. If you
  39. want them, you can get them if you write me a tender poem about
  40. Sinclair ZX Spectrum [you can write the poem in any language you
  41. want, but preferred languages are (in descending order): English,
  42. ZX Basic, Slovak & Czech, Russian, Esperanto, Polish, German]. 
  43. And if you do some not neglidgible improvement with the emulator,
  44. you owe me a copy of that. If you want the sources to be
  45. sent by snailmail, send me enough money to cover postage and a prise of 
  46. one 3.5" diskette (or send me that diskette). No money is necessary,
  47. if you want me to send them via e-mail.
  48.  
  49. How to contact me:
  50.  
  51. My address is:  Radovan Garabik
  52.                 951 48 Jarok 568
  53.                 Slovakia
  54.  
  55. My e-mail is: 2garabik@center.fmph.uniba.sk
  56. or:           garabik@teller.dnp.fmph.uniba.sk
  57.  
  58. I'll answer any questions concerning emulator sent via e-mail (though
  59. the answer will not be necessarily correct :-)).
  60. Both these e-mail addresses will be valid till June 1997. 
  61. After that I'll have to look for some other account :-(
  62.  
  63. Questions concerning VGA graphics, menus or non-standart loading
  64. address to:
  65. 2salanci@pascal.fmph.uniba.sk
  66.  
  67. The version before the latest one can be found at:
  68.  http://kepler.fmph.uniba.sk/~garabik2/zx.html  (then follow the link)
  69. The latest version is reserved for registered users.
  70.  
  71.  
  72. Contents of this package:
  73.  
  74. zx.exe          - emulator itself
  75. zx.ovl          - overlay
  76. zx.txt          - this file
  77. zx.rom          - ZX ROM file
  78. transfer.ltp    - tape file, with mrs 64 (assembler & debugger) and
  79.                   ZX program transfering data from Sinclair to IBM PC
  80. zx2pc.pas       - PC program transfering data from sinclair to IBM PC
  81. zx.ltp          - tape file, consisting of a few games
  82. zxcat.exe       - program displaying contents of *.ltp files
  83. sna2snp.exe     - converter converting from *.sna files to *.snp files
  84. tap2ltp.exe     - converter converting TAP files into *.ltp files
  85. ltp2tap.exe     - converter converting *.ltp files into TAP files
  86. snp2z80.exe     - converter converting *.snp files into *.z80 files
  87.                   (written by Philip Kendall)
  88.  
  89. This program will run fine on 286 AT (the slowest computer I tried
  90. it on was 286, 8 MHz, CGA card - with attributes switched off many
  91. games were quite playable). It should run on PC XT (though very
  92. slowly), but I did not try that.
  93. Supported graphics cards are: CGA, Hercules, VGA. (EGA only
  94. in CGA mode - sorry).
  95.  
  96. *******************************************************************************
  97.  
  98. New features from version 3.67:
  99.  - fixed minor bug in keyboard handling causing crash under Windows
  100.  
  101. *******************************************************************************
  102.  
  103. A concise description of the Sinclair ZX Spectrum Emulator:
  104.  
  105.  
  106. Function keys:
  107.  
  108. F1-display keyboard layout
  109.  
  110. F2-"rewind tape", i.e. the next LOAD will
  111.     read from the beginning of the load-file
  112.  
  113. F3-unsnap from file
  114.  
  115. F4-PLAY/STOP: when the program uses non-standard loader (e.g. WESTBANK
  116.     or HIGHWAY ENCOUNTER), press it after (or even better before)
  117.     entering LOAD "". (And you should press it again after the program
  118.     is loaded)
  119.  
  120. F5-debugger. For more info, press F1 while debugging.
  121.    Warning: it is possible to edit the ROM with debugger.
  122.  
  123. F6-turn sound off/on
  124.  
  125. F7-save the contents of RAM and registers to the disk (snapshot)
  126.    Backup copy of previous snap file is created.
  127.  
  128. F8-restore memory and registers previously saved by F7 (unsnap)
  129.  
  130. These two keys are very handy when playing games. Just set snap
  131. and unsnap files to be the same, and each time you make some progress
  132. in the game, just press F7. If you get killed, press F8 and you 
  133. go again... And if you accidentaly press F7 when just killed,
  134. there is a backup copy (the same name, but extension .bak) of the
  135. previous snapshot.
  136.  
  137.  
  138. F12-ZX RESET
  139.  
  140.  
  141. ScrollLock - set slowing ON (see below)
  142.  
  143. Del (PC keypad) - autofire (Kempston emulation only)
  144.  
  145. F10-set the emulator's parameters and  other options:
  146.  
  147.  Tape Screen Options Keypad Printer Sound Quit
  148. *************************************************************************
  149. Tape - tape-emulation options
  150.  Load file - file which emulates the tape (for LOAD) (*.ltp or TAP file format)
  151.              If you want to choose from TAP files, just enter *.tap as filename
  152.  Save file - file which emulates the tape (for SAVE) (*.ltp or TAP)
  153.  Snap file - file, where the snapshot is saved by F7 (*.snp file format)
  154.  Unsnap file  - snapshot file, where memory is loaded from (*.snp or *.sna
  155.                                                              file format)
  156.  Sentimental - when ON, you have feelings of true
  157.                Sinclair loading (try it). See
  158.                PLAYING/STOPPED (14 lines below)
  159.                for more instructions.
  160.  Snap! - save snapshot on the disk 
  161.          [the same as F7]
  162.  UnSnap! - restore snapshot previously saved by F7
  163.            [the same as F8]
  164.  Dos shell 1 - invoke MSDOS prompt.
  165.             To return to the menu, type EXIT.
  166.  Dos shell 2 - the same as previous command, but
  167.           this one creates a swap file on disk, thus
  168.           leaving you a little more memory for
  169.           your DOS session.
  170.   PLAYING/STOPPED - By setting this option to PLAYING
  171.    you turn the loading emulation to load data
  172.    bit-after-bit. This makes it possible to load
  173.    programs using non-standard loader.
  174.    When loading such a program, first type LOAD "",
  175.    then {call up menu (F10),turn this option to PLAYING,
  176.    escape from menu} or {press F4},
  177.    wait until program loads and then you should turn
  178.    it to STOPPED (or press F4 again) lest the emulator
  179.    continues loading bits, which could cause troubles (in theory),
  180.    when you want to load another program.
  181.    When Sentimental is ON, you must follow this procedure
  182.    when loading any program.
  183.   Encycled tape - when ON, the tape automatically rewinds
  184.   after reaching the end.
  185. ---------------------------------------------------------
  186.  
  187. Screen - set the screen type. It is better to use screen
  188.          type without attributes on slow computers (286).
  189.  
  190. ---------------------------------------------------------
  191.  
  192. Options - different options:
  193.   Slowing delay - set slowing.
  194.             (higher value means slower).
  195.             It is useful when you are running this emulator
  196.             on fast PC and are not able
  197.             to follow games. Works only when the
  198.             following option is ON:
  199.   Slowing - whether the emulator is slowed or not  (this can 
  200.             be switched also by pressing Scroll lock in emulation mode)
  201.   Beep - ZX - perform BEEP using the original
  202.               ROM-routine.
  203.          PC - perform BEEP using the PC-timer,
  204.               this way producing sound with (almost) exactly
  205.               the same length and frequency as on
  206.               the original Spectrum [but during
  207.               BEEPing the emulator will not react
  208.               to any key (except the RESET switch :))].
  209.   POKE - Replace the address with given value.
  210.          Particularly suitable when playing games,
  211.          if you know the POKE.
  212.          (this also allows you to change values in ZX ROM)
  213.   Key interrupt - If it is on, interrupt will be
  214.                   generated each time a key is
  215.                   pressed, therefore a keyboard
  216.                   will react better, but in some
  217.                   games it may cause problems (on slower
  218.                   computers).
  219.                   Turn it on if you want to write texts.
  220.   Interrupt freq - Enter here interrupt frequency.
  221.              Original Sinclair uses interrupt 50 times per
  222.              second (50 Hz).
  223.              On slower computers some games do not work properly
  224.              and then it is better to enter lower number.
  225.                    (e.g. TRANTOR or ZYNAPS -
  226.                     on 12 MHz 286 it was necessary
  227.                     to set frequency less than 8 Hz.,
  228.                     on 40 MHz 386 nothing was necessary)
  229.   EAR bit - if you want to play games which require ISSUE 2,
  230.             turn it to 1. Otherwise it should not matter.
  231.   BORDER (VGA) - If you turn it ON, BORDER will be emulated.
  232.                  It works only in VGA-video modes.
  233.   ZX RESET - resets emulator (the same as F12)
  234.   Flushing keyb - when ON, each time you choose some
  235.     DOS-using action (e.g. loading, menu or snapping)
  236.     it releases all the keys (if you hold a key,
  237.     then chose menu and then released the key,
  238.     the emulator would not recognize it and
  239.     it could cause some troubles).
  240.   Refresh - on fast computers it is better to select this
  241.     option, then the screen is periodically
  242.     redisplayed (otherwise the bytes put into screen
  243.     would be displayed immediately). Useful particularly
  244.     when using programs which write into videoram very often.
  245.     The music will sound somewhat harsh, though.
  246.   Refresh delay - how often will the screen be redisplayed. Set to
  247.                   2 or 1 if your computer is fast enough.
  248.   True R reg - The R-register should be correctly emulated,
  249.                only if this is ON, but it slows down emulation.
  250.                (it does not work quite correctly yet)
  251.   True interrupt - when ON, interrupt is perfomed as close to
  252.                    original as possible (again, this feature
  253.                    is not fully developed). Use carefully.
  254.                
  255. ----------------------------------------------------------------
  256.  
  257. Keypad - indicates how the numeric keypad will be
  258.          interpreted (what joystick it emulates)
  259.  
  260. ----------------------------------------------------------------
  261.  
  262. Printer - emulate ZX Printer on a printer compatible
  263.           with IBM Graphics Printer or Epson FX 80
  264.   Printer emulation - if on, printer is being emulated.
  265.   Output file - output file
  266.                 (PRN=printer)
  267.   Left margin - left margin (in chars)
  268.   Copy - copy screen (without attributes)
  269.   Full copy & attr - copy screen, attributes will be replaced
  270.                      by different patterns.
  271.   Inverse - if 1, printing is inverse (white on black)
  272. ---------------------------------------------------------------
  273.  
  274. Sound - Sound options
  275.   Sound ON/OFF - I think this is clear enough.
  276.   PC Speaker - internal speaker will be used.
  277.   COVOX - COVOX (= Disney Sound Source) will be used.
  278.   COVOX Port - This is the address of the port COVOX is
  279.                connected to. Default it is set to LPT1.
  280. ---------------------------------------------------------------
  281.  
  282. Quit - quits the program.
  283.  
  284. *************************************************************************
  285.  
  286. As a parameter of ZX.EXE use the load-file name or unsnap-file name 
  287. (i.e. LTP, .TAP, .SNA, .SNP files can be used)
  288. (e.g. ZX.EXE GAMES1.TAP).
  289. If omitted, ZX.LTP is used.
  290.  
  291. Other parameters:
  292. zx.exe /scr:x  use screen mode No.x
  293. zx.exe /snd- start with sound disabled
  294. zx.exe /snt+ start in Sentimental mode
  295. zx.exe /rom:myrom.rom   use the file "myrom.rom" as ZX ROM (default zx.rom)
  296.                         If the file is longer than 16384 B, it will load,
  297.                         but only low 16KB will be write-protected
  298. zx.exe /cov:1   use COVOX rather than internal PC speaker
  299. zx.exe /slw:n   set slowing delay to n
  300. zx.exe /kpd:n   set joystick emulated by the keypad:
  301.                  1 - Cursor joystick
  302.                  2 - Sinclair #1 joystick
  303.                  3 - Sinclair #2 joystick
  304.                  4 - Kempston joystick
  305.                  5 - Numbers
  306.  
  307. zx.exe /h  display possible start-up parameters
  308.  
  309. If running on Hercules or CGA graphics card, use appropriate start-up
  310. screen mode (e.g. zx /scr:3 for CGA and zx /scr:8 for Hercules)
  311.  
  312. Program ZXCAT.EXE displays the contest
  313. of load-files.
  314. As a parameter use the load-file name.
  315.  
  316. *******************************************************************************
  317.  
  318. How to transfer programs from ZX tapes into *.ltp files
  319.  
  320.  
  321. I used Sinclair ZX Spectrum with parallel ports (it was actually
  322. a clone of Sinclair, but it is valid for original Sinclair with similar
  323. interface, e.g. Interface 1), which had 3 parallel I/O port. I connected
  324. this to a PC's printer port:
  325.  
  326.            ZX:                         PC:                 meaning:
  327.  
  328.     port 63 7th bit   <----   LPT1 output (any bit)       ready for data
  329.  
  330.     port 31 1st bit   ---->   LPT1 input 7th bit (BUSY)   data
  331.  
  332.     port 31 0th bit   ---->   LPT1 input 5th bit          sending data
  333.                               (OUT OF PAPER)              
  334.  
  335.     GND               -----   GND                         ground
  336.    
  337.  
  338. You can use other ports, but you must change the program zx2pc.pas
  339. and its sinclair counterpart accordingly.
  340.  
  341. Converting software:
  342. PC:  zx2pc.pas
  343. ZX:
  344.   1) choose the tape file "transfer.ltp" e.g. type "zx.exe transfer.ltp" from
  345.      MSDOS command line or choose "Load tape" in menu
  346.   2) type LOAD ""
  347.      mrs 64 will load (very good assembler & debugger indeed)
  348.   3) type edi
  349.   4) type loa
  350.   5) type ln=1
  351.  
  352.    and you see the Sinclair program
  353.    All you have to do is to rewrite it on you original Sinclair into your 
  354.    favourite assembler and compile.
  355.    The starting  address is 65531.
  356.  
  357.    The alternative is to type in the following program:
  358.  
  359.  10 CLEAR 40000
  360.  20 FOR i=65447 TO 65535
  361.  30 READ a
  362.  40 POKE i,a
  363.  50 RANDOMIZE USR 65531
  364. 100 DATA 166,191,55, 63, 237,82, 34, 0,  64, 35, 35, 84, 93, 33, 0,  64
  365. 110 DATA 78, 6,  8,  175,211,31, 219,63, 230,128,40, 250,203,17, 23, 55
  366. 120 DATA 63, 23, 211,31, 246,1,  211,31, 219,63, 230,128,32, 250,175,211
  367. 130 DATA 31, 16, 224,27, 35, 122,179,32, 215,24, 181,0,  0,  62, 130,211
  368. 140 DATA 127,175,211,31, 49, 254,255,24, 167
  369.                                                                           
  370.                                                                           
  371.  
  372.  
  373.    When run, the program reads tape 
  374.    played to Sinclair and after each block of data it transfers these data
  375.    to a PC (this will take only a few seconds). Sometimes it's necessary
  376.    to pause the tape recorder between a long block and next one, when there 
  377.    is too small gap. The PC program generates a *.ltp file ready for the 
  378.    emulator.
  379.    Run PC program first, then run Sinclair program.
  380.  
  381.  The three bad things about this are:
  382.  1) This method required PC and Sinclair with interface
  383.  2) It is impossible to transfer programs saved in turbo mode.
  384.  3) It can transfer blocks max. 49062 bytes long [ this problem could be 
  385.     solved by writting special loader, rewritting part of screen memory
  386.     when the loading length exceeds free memory (it's quite easy), or by 
  387.     on-line compression when loading - I've seen such a program ! (TFCOPY) ]
  388.  
  389.  
  390. *******************************************************************************
  391.  
  392. Description of *.ltp file:
  393. --------------------------
  394. first block:
  395.  
  396.   2 bytes - length of the data block without flag-byte and without
  397.             checksum byte
  398.   1 byte - flag byte (00 for header, FF for data) ---
  399.   data                                               |- as at original ZX tape
  400.   1 byte - checksum                               --- 
  401.  
  402. next block... 
  403. --------------------------------
  404. As you see, it is almost the same as TAP format, except for the first two
  405. bytes containing the length, which is 2 bytes shorter. 
  406. Why didn't I use TAP format? Well, I started to write this emulator 
  407. before I ever heard of TAP...
  408.  
  409. Use tap2ltp.exe and ltp2tap.exe for converting.
  410.  
  411.  
  412. Programs converting *.sna files into *.snp files
  413. is called sna2snp.exe and works reasonably well.
  414. It is a little more difficult the other way, beause 
  415. of a bit weird SNA format. 
  416.  
  417.  
  418. Description of *.snp file:
  419. 0000-bfff   48KB of ZX memory
  420. c000-c001   AF
  421. c002        BORDER colour
  422. c003        reserved
  423. c004-c005   BC
  424. c006-c007   DE
  425. c008-c009   HL
  426. c00a-c00b   PC
  427. c00c-c00d   SP
  428. c00e-c00f   IX
  429. c010-c011   IY
  430. c012        reserved (IFF2 intended, but not implemented)
  431. c013        interrupt: 00-disabled, other-enabled
  432. c014        interrupt mode: 0,1 or 2
  433. c015        R
  434. c016        I
  435. c017-c018   AF'
  436. c019-c01a   BC'
  437. c01b-c01c   DE'
  438. c01d-c01e   HL'
  439.  
  440. *******************************************************************************
  441.