home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / x128xf86.zip / x128.txt < prev    next >
Text File  |  1996-06-27  |  36KB  |  972 lines

  1. X128 Spectrum 128 Emulator V0.4.
  2.  
  3. X128 is a Spectrum 128 Emulator for a Unix based machine running X-Windows,
  4. it supports 8-bit (256 colour) and monochrome screens.
  5. X128 for DOS is the MS-DOS version for the PC, a 486DX+ is recommended.
  6.  
  7. NOTE : THIS VERSION DOES NOT COMPILE CORRECTLY UNDER BORLAND C!!!!!!
  8. It does compile but produces a faulty executable (under BC V3.1 anyway).
  9.  
  10.  
  11. FIRSTLY:
  12. --------
  13. Firstly I know little about Unix.
  14.  
  15. The Unix version is supplied with a Makefile.
  16.  
  17. However there are a number of #define s that you may have to change...
  18. These are located at the top of the file x128_t.c except for LSB_FIRST.
  19.  
  20. #define LSB_FIRST
  21.  
  22. NOTE : Place this at the top of x128_end.c
  23. If your machine has LSB first memory then define this, if you don't know
  24. then you could just try compiling it both ways!
  25. NOTE : Intel processor = LSB.
  26.  
  27. #define MITSHM
  28.  
  29. This applies to the X-Windows version only.
  30. No need to change, it will autodetect, but if the autodetect is substandard,
  31. then you can switch off mitshm completely (causing even slower running).
  32.  
  33. #define Verbose 1
  34.  
  35. This applies to the X-Windows version only.
  36. Set this to 0 if you want rid of the startup messages.
  37.  
  38. #define SCALE2
  39.  
  40. This applies to the X-Windows version only, don't even think about trying
  41. it on the DOS version.
  42. What this does is double the X and Y dimensions of the window from 320x192
  43. to 640x384, this will inevitably run slower, so use this if you have a
  44. really hot machine!
  45.  
  46. #define LINUX
  47.  
  48. This is a type of Unix for the PC, and this allows some of the things that
  49. the DOS version has to be used, namely the PC internal speaker for the
  50. Spectrum internal speaker, and Adlib for the AY-3-8912.
  51. This is done using I/O, not through any C library, so if you are not running
  52. a PC based Unix then DON'T USE THIS OPTION!!  The routines write to ports
  53. 0x61, 0x388 and 0x389, these could be anything at all on other types of
  54. machines and could really mash things up, so don't do it.
  55.  
  56. If you are running another type of PC Unix, then you could try this but I
  57. will not guarantee anything and will not be held responsible in case
  58. something goes horribly wrong!
  59.  
  60. The Adlib routine has not been tested very much, it is possible that you may
  61. have to be 'root' to get the sound to work but I don't know.
  62.  
  63. These routines were tested on the Slakware Linux V1.1.18 release.
  64. Sometimes the sound will not start, I don't know why, but when you go back
  65. to DOS you find that nothing else will make noise either!  In my case with
  66. a Sound Galaxy NX Pro card, I have to run \sgnxpro\utility\sg2 (and test the
  67. FM output) from DOS before I can be sure that I can go into Linux and get
  68. Adlib output to work.
  69.  
  70.  
  71. LEAVE THE OTHER #defines ALONE!
  72.  
  73.  
  74. COMPILATION - UNIX:
  75. -------------------
  76. The Unix version now comes with a Makefile.
  77.  
  78. To compile, just type 'make'.
  79.  
  80. If you are short of memory try removing the -O3 option from the Makefile.
  81.  
  82. The -l... options are libraries, you should have the X11 and Xext libraries
  83. around somewhere, otherwise you can't compile this.
  84. If you have some funny X11 libraries then put them in instead, the
  85. -I option should point to where you have your include files.
  86.  
  87. If you want to have the double sized window, then I recommend you add the
  88. #define via the Makefile, so that the line in the Makefile looks like
  89. this:
  90.  
  91. CFLAGS=...... -O3 -DSCALE2
  92.  
  93. The same goes for the Linux option:
  94.  
  95. CFLAGS=...... -O3 -DLINUX
  96.  
  97. And you can do more than one:
  98.  
  99. CFLAGS=...... -O3 -DLSB_FIRST -DLINUX -DSCALE2
  100.  
  101.  
  102. COMPILATION - DOS:
  103. ------------------
  104. A Watcom C compiled EXE is supplied, so you don't have to compile it.
  105.  
  106. This has been designed to be compilable(?) on Borland C and Watcom C, it
  107. has been tested on Borland C V3.1 and Watcom C (I can't remember what
  108. version).  Note that by using Watcom C it uses the 32-bit memory model,
  109. which seems to result in a much faster EXE (or maybe it just optimises
  110. better).  Do not worry about this if you own a DX2-66 or above, because you
  111. won't notice the difference - it will still run at full speed.  In fact, on
  112. a 486SX-25 Borland does it too slow and Watcom does it a bit too slow.  It
  113. is possible that it will be acceptable on a 486SX-33 but I haven't been able
  114. to find a machine that is faster than SX-25 and slower than DX2-66.
  115. Note that the quality of video card will make a large difference to the
  116. execution speed, eg Trident = Slow.  Anything seems to be faster than this.
  117.  
  118. Anyway!
  119.  
  120. If using Watcom:
  121.  
  122. Rename makefile.wc into makefile, then do 'wmake'.  It should compile
  123. happily.  This is the recommended compiler.
  124. Note : If (when recompiling) the PC locks up, then reset the PC, delete all
  125. .PCH files then 'wmake' again, it should now work.
  126.  
  127. If using Borland:
  128.  
  129. Rename makefile.bc into makefile, then change the library path and include
  130. file path in the makefile to that of your Borland C setup, then type 'make'
  131. and it should go fine, providing that you have supplied the correct paths.
  132.  
  133. If using other:
  134.  
  135. If you are using Turbo C, then try putting #define __BORLANDC__ at the start
  136. of x128_t.c and hope for the best.
  137. If you are using Visual C, then you will probably have to fiddle with the
  138. code a bit, which will require some knowledge of Visual C - only x128_t.c
  139. should require alterations (unless outp() in AY8910.C is not allowed).  Or
  140. unless you need to change the memory allocation near the bottom of
  141. s128_def.c (grab_mem and free_mem).  The file selector code may need
  142. modification also.
  143. Also consider that a word must be 16 bits wide, this is declared in
  144. x128_end.c , but different compilers can interpret 'unsigned int' as either
  145. 16 bits or 32 bits.  If your int is 32 bits then you will have to use
  146. 'unsigned short'.  Watcom and gcc use 'short', whereas Borland uses 'int'.
  147. You can also only use a version of Visual C that can produce DOS EXE files,
  148. unless you are planning on a major alteration!  If you get this to work in
  149. Visual C then tell me about the changes.
  150.  
  151.  
  152. EASY GUIDE TO SPECTRUM FILES YOU CAN USE
  153. ----------------------------------------
  154. file.z80 : Use F5 to load.
  155. file.sna : Use F5 to load.
  156. file.slt : Use F5 to load.
  157. file.tap : Use F7 to select, then type load "" or use tape loader.
  158.  
  159. If you get a .z80 file with other files called .dat then these will be
  160. dealt with automatically, just load the .z80 as described above, and if the
  161. filenames of the .dat files are wrong then the file selector will appear and
  162. you will have to select the correct DAT, or press ESCAPE.  If you downloaded
  163. it then this should not be the case.  If the file is a SLT format file
  164. (which has still been named .z80 at the end) then this emulator deals
  165. with it automatically.
  166.  
  167. file.voc : This cannot deal with sampled tapes.
  168. file.dsk : This cannot deal with +3/CPC disk files.
  169. file.mdr : This cannot deal with microdrive cartridges.
  170.  
  171. Any other file type you come across cannot be handled in this version of
  172. the emulator.
  173.  
  174.  
  175. TROUBLESHOOTING - UNIX:
  176. -----------------------
  177. SYMPTOM : Compile failed with 'out of memory' style error.
  178. CAUSE   : Try removing the -O3 option and try -O2 then -O1 all the way down
  179. to -O0, this will result in faster compilation, but will cause a slower
  180. emulation.  Each one is progressively slower.
  181.  
  182.  
  183. SYMPTOM : Compile failed with a 'couldn't find' type of error.
  184. CAUSE   : Probably the X11 and Xext libraries.  If you don't have them then
  185. I don't know how I can help you.  If you have them somewhere else, then you
  186. could try messing about with the -I option to direct the compiler to the
  187. right place.
  188.  
  189.  
  190. SYMPTOM : The screen is all full of mush.  And no BASIC or any snap will
  191. work, but you can load stuff in using the F-keys.
  192. CAUSE   : Your machine could be the opposite endian compared to how this
  193. was compiled, try using #define LSB_FIRST or if it is defined then delete it
  194. and compile again.
  195. CAUSE   : Your display is not 8 bits per pixel (256 colour) or 1 bit per
  196. pixel (monochrome).  These are the only screen modes I have written drivers
  197. for, all you can do is see if you can alter the screen mode on your terminal
  198. to one of these values.
  199.  
  200.  
  201. SYMPTOM : On a colour screen, the colours are wrong, or are missing.
  202. CAUSE   : There is a limited number of colours allowed on screen, you may be
  203. running another application that is reserving the palette for itself, so
  204. you could try quitting x128 then closing all the other applications then
  205. try running x128 again and see if it works.
  206. CAUSE   : I did see a message somewhere from someone who said they had a
  207. 16 colour screen (4 bits per pixel), if you do then it won't work anyway
  208. as I have not written a 16 colour screen driver, and if I had it would be
  209. unlikely that I could snatch every palette colour available.
  210.  
  211.  
  212. SYMPTOM : The emulation is too slow.
  213. CAUSE   : Try removing other background processes that could be taking up
  214. CPU time, also try running x128 on a mono terminal as there is less graphic
  215. data to move about.  If you compiled without the -O3 option then re-compile
  216. using this - if your machine allows it.  If you are running on a terminal
  217. that does not use MIT shared memory then try and find one that does.
  218. Alternatively all you can do is get a faster machine or hope that a future
  219. release of this is more efficient.  Or you could try using the frame skip
  220. menu option to cause less screen output.
  221.  
  222.  
  223. SYMPTOM : The emulation is too fast.
  224. CAUSE   : You are obviously using a hot Unix workstation, so what you can
  225. do is select the menu option 'Alter Slow Down' which is a value between
  226. 0 and 65535.  The higher the number the greater the delay, 0 is no delay
  227. and 65535 is a lot!  Don't set it to a ridiculously high value, or you'll
  228. get stuck.
  229.  
  230.  
  231. SYMPTOM : The window opens up but then closes and some sort of error message
  232. appears.
  233. CAUSE   : Possibly the wrong LSB/MSB setup (see above).  Or it could be that
  234. you are running on the wrong type of screen, see if there is anyway of
  235. altering the screen mode of the terminal to 256 colour or monochrome modes.
  236.  
  237.  
  238. SYMPTOM : I exited the emulator, and now the key autorepeat is turned off!
  239. CAUSE   : The emulator turns off the autorepeat for its emulation, if you
  240. kill the window by clicking on the top left of the window and shutting the
  241. process down then the exit routine will never be reached and autorepeat
  242. will remain off (unless you kill the window while the fileselector is on,
  243. in which case the autorepeat is turned on).  You may be stuck by the number
  244. of function keys on your terminal though, since F10 is quit and I have seen
  245. some Unix machines that have only 8 function keys...  In this case use the
  246. F1 or Help keys, then you can choose any function key option from the
  247. little menu.
  248.  
  249.  
  250. SYMPTOM : The file selector will not open.
  251. CAUSE   : Desperate shortage of memory!  Close some other windows.
  252.  
  253.  
  254. SYMPTOM : Some of the function keys don't work.
  255. CAUSE   : Some X-windows managers like to steal the function keys for its
  256. own purposes.  As long as F1 or Help work, then you can pick any option.
  257. CAUSE   : Unix terminals tend to have different numbers of function keys
  258. on their keyboard.  Use F1 (or Help key) to select any of the options.
  259.  
  260.  
  261. SYMPTOM : Linux is returning no sound.
  262. CAUSE   : You did not compile with -DLINUX in the Makefile, or you did but
  263. the compiler used the old object files, so make sure that -DLINUX is in the
  264. Makefile and delete the *.o files.
  265. CAUSE   : You do not have an adlib card.
  266. CAUSE   : You do not have permission to access the I/O ports, so try this
  267. as root instead.  (Unless someone else is root!)
  268. CAUSE   : The sound is toggled off, press F11 or select the option from
  269. the help menu (F1).
  270. CAUSE   : Sometimes the Adlib card like to produce no sound when you get to
  271. Linux, try running an Adlib test program before x128 to try and reset the
  272. soundcard into working order again, even if this means using a DOS program
  273. then going into Linux.
  274.  
  275.  
  276. TROUBLESHOOTING - DOS:
  277. ----------------------
  278. SYMPTOM : The emulation is too slow.
  279. CAUSE   : Try running this in DOS, if you are using a Windowed environment,
  280. If you compiled this then try re-compiling with more optimisations (varies
  281. depending on compiler).
  282. Alternatively all you can do is get a faster machine or hope that a future
  283. release of this is more efficient.  Or use LIMITED_SCREEN_UPDATE, see near
  284. the top of this document on how use this option.  Another option is to get
  285. your hands on a much faster video card.
  286.  
  287.  
  288. SYMPTOM : The emulation is too fast.
  289. CAUSE   : You must be using a Pentium or DX4 processor, or you have a very
  290. fast video card.  What you can do is select the menu option 'Alter Slow
  291. Down' which is a value between 0 and 65535.  The higher the number the
  292. greater the delay, 0 is no delay and 65535 is a lot!
  293.  
  294.  
  295. SYMPTOM : The EXE supplied will not run.
  296. CAUSE   : Make sure you are using a 386 or above, if you compiled with a
  297. 16-bit memory model then make sure you have about 500K base memory or more.
  298. CAUSE   : DOS4GW returns an error.
  299. Oh dear.  Try the following things:
  300.  
  301. set DOS16M=+  (this tries to fix problems with funny memory).
  302.  
  303. or, for example:
  304.  
  305. SET DOS16M=@2M-4M  (this will force DOS4GW to use the memory 2Mb to 4Mb)
  306.  
  307. Otherwise try and get a 16-bit compiled EXE.
  308.  
  309.  
  310. SYMPTOM : The Borland C makefile will not compile the emulator.
  311. CAUSE   : Make sure that the library path and include file path in the
  312. makefile have been set correctly, as in the Borland C IDE (Alt-O then D).
  313.  
  314.  
  315. SYMPTOM : The file selector will not open.
  316. CAUSE   : Desperate shortage of memory!  Free up some memory before running.
  317.  
  318.  
  319. INSTRUCTIONS:
  320. -------------
  321. Once you have typed 'x128' to run the emulator and the 128 BASIC screen
  322. has appeared (hey, monochrome users can't see the menu bar!) then the
  323. following function keys are available:
  324.  
  325.  
  326. F1 - HELP
  327. ---------
  328. This brings up a list of the functions keys available, on the Spectrum
  329. window, press ESCAPE to go back to the emulation.  This can also be brought
  330. up by the 'help' key on some Unix keyboards.
  331. Now when you bring up this option, you can select the function of any
  332. other function key from the menu that appears, by using cursor up/down and
  333. return to select.  The selected option will have a > beside it.  When you
  334. have completed the selected option, you will return to the emulator, not
  335. the help screen.
  336.  
  337. Options available here that aren't available anywhere else are:
  338.  
  339.  
  340. Alter ULA Delay:
  341.  
  342. This controls the lining up of overscan bits (see F8 and F9 keys), the
  343. max. value is 255.
  344.  
  345.  
  346. Alter Frame Skip:
  347.  
  348. This allows you to set up the screen update, 1/1 is full update, 1/255
  349. updates the screen once every 255 times.  1/0 is effectively 1/256.
  350. Note that most other emulators have 1/2 as the default whereas x128
  351. usually starts as 1/1 screen update.
  352.  
  353.  
  354. Alter Slow Down:
  355.  
  356. I've got a for loop in the code that is executed every Z80 instruction,
  357. this causes a slowdown for the benefit of fast machines, the upper bound
  358. is determined by this value (which can be between 0-65535).  0 is no
  359. delay, indeed the for loop is not even executed.  65535 is a huge delay,
  360. where you can see the display build up a line at a time (but on Unix
  361. you'll just get stuck if you set it too high).
  362.  
  363.  
  364. The values can be changed by moving the cursor to the option and pressing
  365. left (-1), right (+1), page up (-10) or page down (+10).
  366. Remember that Page up/Page Down is -/+ on the keypad for some Unix
  367. machines.
  368. The values will wrap round if you try to pass 0 or its maximum value.
  369. These options don't return to the emulator when you select them, you have
  370. to press Escape.
  371.  
  372.  
  373. Keyboard Issue:
  374.  
  375. Press return to toggle between issue 2 and issue 3, where issue 3 is by
  376. far the most common.  Occasionally a program will need this option to be
  377. set to 2 (usually an old program) otherwise the keys won't respond.
  378. A .Z80/.SLT file will change this value when you load it.
  379. Note that all 128K Spectrums were issue 3 and some Spectrum 48K were
  380. issue 2, but not that many.
  381.  
  382.  
  383. Note that options like load snap, save z80, joystick select, memory mode,
  384. etc return to the help menu, so that you can load in a snap and resave it
  385. with changed settings.
  386.  
  387.  
  388. F2 - NO FUNCTION
  389. ----------------
  390. I haven't got this doing anything just now.
  391. What is really irritating is that I keep pressing F2 trying to reset to
  392. 128K mode, like in the older versions, but it doesn't work!
  393. What could I put here?  Another help menu?  Save & Load chunks of memory?
  394. Debugger thingy?  Pokes database?  Who knows?
  395.  
  396.  
  397. F3 - RESET/MEMORY MODE
  398. ----------------------
  399. From here you have a little menu that you can select reset to 48 or 128
  400. mode, or you can try to swap modes with no reset, note that from 128 to 48
  401. no reset mode that ram page 0 will be slotted in regardless of what ram
  402. was actually paged in.
  403. You can use cursor up/down to move, return to select and escape to abort
  404. selection.
  405.  
  406. You are on your own trying to work out the keywords in 48K Basic.
  407.  
  408.  
  409. F4 - JOYSTICK SELECT
  410. --------------------
  411. This will map one of 4 joystick possibilities (Kempston, Sinc 1, Sinc 2 and
  412. Cursor onto the cursor keys and TAB for fire.
  413.  
  414. You will see the 4 options and a > which points to the current option.  To
  415. select one use cursor keys up and down then press return to select.  To
  416. abort and use current option, press ESCAPE.
  417.  
  418. You can press left or right to toggle caps on/off for cursor keys.
  419.  
  420. Note that .Z80 files set the joystick configuration when loaded.
  421. Whether cursor has caps shift included is not stored in a .Z80 and you
  422. may have to change this yourself.
  423.  
  424.  
  425. F5 - LOAD SNAP FILE
  426. -------------------
  427. Yes, this will allow you to load, at any time, a V1, V2 or V3 .z80 file in
  428. 48K or 128K mode (it will automatically pick the correct mode for the snap).
  429. This also allows loading of .sna files and .slt files.
  430.  
  431. These files are exactly the same format as those used by the famous Z80
  432. Spectrum emulator for the PC.  Note that any hardware like Interface 1,
  433. SamRam or MGT will be stripped off and ignored, if that piece of hardware
  434. was paged in at the time the Z80 was saved, then it might not work.
  435. But this is not usually the case.
  436.  
  437.  
  438. F6 - SAVE Z80 V2 FILE
  439. ---------------------
  440. This allows you to save the whole of memory to a snapshot file.  It can
  441. save in 48K or 128K mode and will decide by itself what memory it has to
  442. save.  The resulting file can be loaded back in using F5, or can be loaded
  443. in by another emulator that supports Z80 V2 files.
  444. This option is good for cheating at games.
  445.  
  446. A little window will pop up containing the full path of the last Z80 file
  447. loaded, you can type the name you want, and you can use backspace or delete
  448. to ... delete a character, you can choose the directory to save to by
  449. altering the path.  If you decide that you didn't want to save after all
  450. then press ESCAPE.  The code will try to be clever and determine whether you
  451. have typed .z80 at the end of the line, and append it as necessary, but you
  452. could still confuse it by calling a filename a.a or whatever.
  453. If the file you are trying to save already exists then you will be given
  454. the message 'Overwrite(Y/N)?'.  You can reply 'y' to overwrite, 'n' to abort
  455. and ESCAPE to abort also.
  456. If you are saving a .SLT file, then the level data will be appended to the
  457. newly saved file (which will have .SLT as its extension), however try to
  458. make sure that you have space on your drive otherwise it is possible you
  459. could create difficulties.  Let me elaborate:
  460.  
  461. If there is no permission to create the temporary file (dump.tmp), then
  462. the save will be aborted with no difficulty.
  463.  
  464. If there is no permission to create the final completed file, then you
  465. will be left with 2 separate files which you will have to merge from the
  466. command line.  (If you were trying to overwrite then you have probably
  467. lost data.)
  468.  
  469. So you would have to exit the emulator, then (after clearing space),
  470. you will have to do:
  471.  
  472. DOS:
  473. copy /b file.z80 dump.tmp new.slt
  474.  
  475. Unix:
  476. cat file.z80 dump.tmp >new.slt
  477.  
  478. (I think).
  479.  
  480. Note that dump.tmp will always be saved in the directory you were in when
  481. you started the emulator, so make sure you have write permission to that
  482. directory!
  483.  
  484.  
  485. F7 - SELECT TAP FILE
  486. --------------------
  487. You want multiload games on emulator, yes?  Well, this allows it to happen
  488. by being a file containing a string of just the important data from saves.
  489.  
  490. These TAP files are the Z80 compatible files, NOT the Warajevo emulator
  491. ones, they won't work at all.
  492.  
  493. Firstly select the file from the file selector.
  494.  
  495. To load a file you must either:
  496.  
  497. Use the 128 BASIC Tape Loader (just press return).
  498. In 128 BASIC (type load Meta-P Meta-P Return).
  499. In 48 BASIC (type J Meta-P Meta-P Return).
  500.  
  501. (Meta is the diamond shape, you can also use ALT).
  502. (On the DOS version use CTRL).
  503. (You can now use SHIFT-' for ")
  504.  
  505. Note for monochrome users: when you start up the invisible bar is on the
  506. Tape Loader option.
  507.  
  508.  
  509. F8 - INCREMENT ULA DELAY
  510. ------------------------
  511. T-States are a tricky business.
  512.  
  513. The Spectrum +2A manual says that there are 228 t-states in a screen line.
  514. Z80 Emulators documentation says 224.
  515. (It turns out that the Spectrum 48K uses 224*312 and the 128K uses 228*311
  516. which is now supported).
  517. Games that you try say 'Any number, all different'.
  518.  
  519. This adds a value to the number of t-states counted at the end of every
  520. screen line (192 of them).
  521. So you can use this option to help align up that nice overscan bit on the
  522. screen.
  523.  
  524. This option usually moves overscan bits DOWN the screen.
  525.  
  526. Now, 4 t-states are added to the counter every time you try to write to
  527. memory between 16384-32767 while the screen is being updated by the ULA,
  528. this lines up the effect in Agent X 2 nicely.
  529. It starts at 0, if you move too far, the emulator performance will start
  530. to be unusual, as this will affect the number of instructions between
  531. interrupts.
  532. The ULA Delay is reset to 0 every time you reset or load a snapshot.
  533.  
  534.  
  535. F9 - DECREMENT ULA DELAY
  536. ------------------------
  537. See above for information.
  538.  
  539. This option usually moves overscan bits UP the screen.
  540. Once you reach 0, it will not go into negative numbers.
  541.  
  542. The ULA Delay is reset to 0 every time you reset or load a snapshot.
  543.  
  544.  
  545. F10- QUIT
  546. ---------
  547. This will quit the emulator and close the window and all that sort of thing,
  548. and yes it does remember to de-allocate the memory and close the TAP file.
  549. On exit you will be told what ULA Delay you had.
  550.  
  551.  
  552. F11- SOUND TOGGLE
  553. -----------------
  554. This toggles the sound on or off, at the moment DOS and Linux does
  555. internal speaker and AY, currently other Unix types do nothing.
  556. It is possible that other PC based Unixs may also work with the Linux
  557. sound option (which uses direct I/O), but I won't guarantee anything,
  558. you could always try it.
  559.  
  560.  
  561. USING THE FILE SELECTOR
  562. -----------------------
  563. Use the cursor keys to move up and down, the file selected is the one at
  564. the top (with the inversed colours).
  565.  
  566. Directories are Magenta and Black with a slash preceeding the name.
  567. File are Blue and White.
  568. Drives (PC) are Cyan and Black.
  569.  
  570. You can change directory/drive by pressing return while it is being pointed
  571. to, the listing of that directory will then appear for you to view.
  572.  
  573. Keys:
  574.  
  575. Up/Down : Move Up 1 file/Down 1 file.
  576. Page Up/Page Down : Move up 22 files/down 22 files.
  577. Home/End : Move to the top/bottom of the list.
  578. Return : select the file/drive/directory.
  579. Escape : leave the file selector without loading anything.
  580.  
  581. Note that I couldn't get page up/down or home/end to work on the Unix
  582. keyboard, so page up and down is now replaced by - and + on the keypad.
  583. - is page up and + is page down.  Look at the keypad, the + is below the -,
  584. this will soon become instinctive!  Page Up and Page Down do work on
  585. Linux though.
  586.  
  587. Another feature is the file search by typing letters, so if you press 'b'
  588. the pointer will be moved to the first file (not directory) that starts
  589. with 'b' (case insensitive).  If the search was successful, then when you
  590. type another letter you will be searching for the 2nd character position
  591. and so on, if a search fails, (in which case the pointer will not move) the
  592. next attempted search will begin with the first character again.
  593. If you move the pointer with cursor keys, page keys or home/end then the
  594. next search will be on the first character.  Also included in the term
  595. 'letters' are numbers and some punctuation symbols.
  596.  
  597.  
  598. COMMAND LINE OPTIONS
  599. --------------------
  600. You can get x128 to do things from the command line by adding the following
  601. parameters:
  602.  
  603. x128 /?
  604. Shows all the command line options available.
  605.  
  606. x128 /48
  607. Resets to 48K mode on startup.
  608.  
  609. x128 /128
  610. Resets to 128K mode on startup (default).
  611.  
  612. x128 /quiet
  613. This starts up the emulator with the sound off, it can still be switched
  614. back on by F11 or the help option.
  615.  
  616. x128 /delay <number>
  617. This sets the slow down delay (0-65535), eg x128 /delay 30000
  618.  
  619. x128 /frame <number>
  620. This sets the frame skip value (0-255), eg x128 /frame 4
  621.  
  622. x128 /ula <number>
  623. This sets the ULA delay (0-255), eg x128 /ula 30
  624.  
  625. NOTE: With all these numerical options, entering non numbers, or numbers
  626. that are too large will cause confusion.  Generally it will decide that
  627. the value should be set to 0, but in the case of /frame this is
  628. effectively 1/256 so you will get a big delay before the screen updates,
  629. so don't enter bad numbers!
  630.  
  631. x128 <filename>
  632. If the filename is a sna or z80 then it will automatically load (and /48
  633. and /128 will be overridden by the type of snap loaded).  This will work
  634. for slt files as well.
  635. If the filename is a tap then it will be selected, but you will still have
  636. to load it via the tape loader or by typing load "".
  637. I suppose this means that x128 can now be used in this 'play spectrum games
  638. across the web thingy'.
  639.  
  640.  
  641. SLT FILES & UTILITIES
  642. ---------------------
  643. The .SLT file is a new file format, it is best described as 'exactly the
  644. same as the DAT file idea, but all in the one file for ease and space
  645. saving'.
  646.  
  647. Two utilities are supplied DAT2SLT and SLT2DAT.
  648.  
  649. DAT2SLT, use this to squash all the files of a Z80 and DATs into a single
  650. SLT file (you must use a V2 or V3 .Z80 as the main part of the file, if
  651. the main file is a .SNA or a V1 .Z80 then convert it to a V2 .Z80 by using
  652. the help menu load and save options within the emulator.)
  653.  
  654. Usage:
  655.  
  656. dat2slt robo robot
  657.  
  658. This will squash robo.z80 and robo*.dat into the file robot.slt .
  659.  
  660. dat2slt roborobo roborobo /dos
  661.  
  662. This will squash the roborobo.z80 and roborobo*.dat into the file
  663. robo.slt , but the filenames of the .dat files that are searched for will
  664. be in the DOS format, ie only 8 letters, for example, under Unix if you
  665. are looking for level 1 of roborobo, then the name of the DAT is:
  666.  
  667. roborobo1.dat
  668.  
  669. but for DOS it is:
  670.  
  671. roborob1.dat
  672.  
  673. So use /dos if you are dealing with DOS style DATs under Unix, of course
  674. you do not have to do this if you are running it on a PC.
  675.  
  676.  
  677. SLT2DAT, use this to undo all the files.
  678.  
  679. Usage:
  680.  
  681. slt2dat robo bog
  682.  
  683. This turns robo.slt into bog.z80 and bog*.dat , you can use /dos if you
  684. wish (default for PC version) this can also be used as an easy way to
  685. rename a set of DATs.
  686.  
  687.  
  688. When overwriting a .slt file within the emulator (for example, you are
  689. regularly saving your progress through a game) the emulator will try to
  690. append all the level data of the old .slt onto the new one.  Exactly
  691. what will happen if the space on your drive is too low is best described
  692. as 'undefined'.  The emulator will spawn the dat2slt and slt2dat
  693. utilities so make sure they are in the same directory as the emulator.
  694. This will mean that a large number of files will be around during the
  695. saving, basically you will require approximately 2 or 3 times the size of
  696. the original SLT file of space on your drive.
  697.  
  698.  
  699. GOOD BITS:
  700. ----------
  701. Emulation of all known opcodes.
  702.  
  703. Emulation of undocumented opcodes, even the ones between ED40-ED7F that
  704. are listed in Z80.DOC which never get used.
  705.  
  706. Runs on 8-bit or mono terminal and autodetects (Arnolds bit).
  707.  
  708. Autodetect MITSHM (Arnold again).
  709.  
  710. Careful timing of screen output to allow screen accuracy of 8x1 pixels and
  711. border accuracy of one colour per line.
  712.  
  713. Ability to line up overscan bits on the screen, as it seems that different
  714. games and different Spectrums had slight speed differences, this is often
  715. as much fun as the game itself.
  716.  
  717. Some emulation (on DOS) of AY-3-8912 soundchip, this part by Marat
  718. Fayzullin.
  719.  
  720. Joysticks (as seen in Z80) are mapped onto the cursor keys.
  721.  
  722. Load ANY type of Z80 file, and play!
  723.  
  724. Gauntlet is now playable on a 486SX-25 (with good video card)!
  725.  
  726. Option (at compile time) to have a double size window in X-Windows, the
  727. window is 640x384 pixels.
  728.  
  729. ED FB level loader trap supported.  It will try .dat first then .DAT before
  730. saying it can't find it.  Also will try the DOS style then the Unix style
  731. filenames before admitting defeat.
  732.  
  733. Hot file selector!
  734.  
  735. Save Z80 V2 snap files in 48 or 128 mode.
  736.  
  737. SLT format files are supported.
  738.  
  739. Alter keyboard issue, caps (with cursor), ula delay, slow down and frame
  740. update within the emulator dynamically at any time.
  741.  
  742.  
  743. BAD BITS:
  744. ---------
  745. Speed : Not bad at all!  The DOS version still runs faster.  But....
  746. The speed is very up and down, causing irregular AY playing, but this tends
  747. to even out on a faster PC (a bit).
  748.  
  749. No support for any terminals that use 2, 4, 16, 24 or 32 bits per pixel.
  750.  
  751. Overscan in some demos, is off line and cannot be fixed with F8 and F9
  752. fiddling (Although the new ULA delay/memory cycle is closer than before).
  753.  
  754. AY sound is incomplete, and some sounds don't happen at all!
  755.  
  756. The Overscan Demo.  It times the Spectrum to determine which model it is,
  757. and if it doesn't like the timing it will refuse to put any colour on the
  758. screen!
  759.  
  760. Look:
  761.  
  762. 33339 ei
  763. 33340 halt (interrupt jumps to 32512)
  764. 32512 ld (33154),hl (redirects interrupt to jump to 33348)
  765. 32515 ei
  766. 32516 inc bc
  767. 32517 jr 32516 (this is exited by interrupt)
  768. 33348 .....
  769.  
  770. (I=128, points to 33153, all in uncontended memory)
  771. (SP=33280, in uncontended memory)
  772.  
  773. This is the code used in Overscan Demo, it is entered with bc=0 and the
  774. interrupt routine just a jp 32512, ld (33154),hl sets the
  775. jp to 33348 which is the comparing routine.
  776.  
  777. Consider that 33345 and 33346 take up 18 t-states, and that there are 70908
  778. t-states in the 128Ks interrupt cycle.  70908/18=3939 so that bc should
  779. equal approximately 3939.
  780.  
  781. x128 has bc=3937,
  782. A real Spectrum 128 has the value bc=3185 !!!
  783. Z80 V3.02 gives the value bc=2803 (I have no idea where it gets this from).
  784. Z80 V3.03 has the value bc=3212 which is a bit unlucky because it just
  785. falls outside the timing required:
  786.  
  787. This is the timing desired by the comparing routine:
  788.  
  789. 3115-3131 Spectrum 48K
  790. 3177-3193 Spectrum 128K/+2
  791. 3608-3624 Spectrum +2A/+3
  792.  
  793. Note that Z80 V3.03 in 48K mode produces bc=3155, which is unlucky again!
  794.  
  795. The reason for this is the slowdown caused by the code executing below
  796. 32768 (contended memory), as a result - the loop is executed less times
  797. than usual before the interrupt occurs.
  798.  
  799. When you think about it, if you want to get the emulator to return 3185
  800. as the value then:
  801.  
  802. (19 = IM 2 setup time, 16 = ld(NN),hl, 4 = ei)
  803.  
  804. 70908 - 19 - 16 - 4 = 70869 (slowdown ignored in this case)
  805.  
  806. 70869/3185 = 22.251 t-states
  807.  
  808. If you want to assume full slowdown then,
  809.  
  810. (19 = IM 2 setup time, 28 = ld(NN),hl, 8 = ei)
  811.  
  812. 70908 - 19 - 28 - 8 = 70853 (assume 4 extra t states per mem read)
  813.  
  814. 70853/3185 = 22.245 t-states
  815.  
  816. In other words, 'inc bc' and 'jr -3' must be set up to take about 22.25
  817. t-states for the Overscan Demo to detect properly.
  818.  
  819. But, 22 or 23 is not good enough,
  820.  
  821. (first 70869 t's then 70853 t's)
  822.  
  823. 22.0 would give bc=3221 or bc=3220 (illegal)
  824. 23.0 would give bc=3081 or bc=3080 (illegal)
  825. 22.1 would give bc=3206 or bc=3206 (illegal)
  826. 22.2 would give bc=3192 or bc=3191 (legal)
  827. 22.3 would give bc=3177 or bc=3177 (on the limit, probably outside)
  828.  
  829. So there you go, it is impossible to get the overscan demo to work without
  830. introducing tenths or indeed hundredths of t-states.
  831.  
  832. And how would the time lag on the loop be split up??
  833. You have 4.25 t-states to split up between three contended memory reads
  834. this doesn't work too well on integer numbers, and the .25 is too important
  835. to cut off.
  836.  
  837. As a result, overscan demos that have auto-calibration will not work, as
  838. I have given up the mem read delay (unless someone comes up with some good
  839. ideas), the auto-detect routines in these demos use the mem read delay,
  840. but the actual overscan routine will often be more dependent on the mem
  841. write delay (which I have included, as a 4 t-state delay) so things with
  842. non-calibration will look better.
  843.  
  844. Aquaplane is dependent on both read and write delay, due to the way it has
  845. it's code in contended memory, and as a result is off line.  You will have
  846. to use ULA delay to line it up.
  847. If you want to run the Overscan demo, then set ULA delay to 30, then press
  848. return then break (to get back to 'you have incompatible...') and when you
  849. press return again, you should have a nice mess on the screen, which you
  850. can partially line up with ULA delay, but not perfectly.
  851.  
  852.  
  853. FUTURE IMPROVEMENTS:
  854. --------------------
  855. Top and bottom borders, at least 24 pixels worth either side.
  856.  
  857. Speed : Ever Better.
  858.  
  859. Shading for the double sized window on mono screens.
  860.  
  861. Maybe the ability to save taps.
  862.  
  863. I don't see how I could do sound, surely all machines are so different?
  864. (Well, proper sound).
  865.  
  866. Better t-state timing for overscan demos.
  867.  
  868. Get the file selector to deal with directories quicker, Compact Disks are
  869. especially slow.  (Bug in the stat command).
  870.  
  871. Emulator figures out what speed it is going at, and allows you to enter
  872. a percentage rather than a number for the slow down delay.
  873.  
  874.  
  875. HOW TO GET GAMES:
  876. -----------------
  877. Check ftp and www sites for files, Norway seems to have a lot.
  878. There may be some on ftp://altair.komkon.com
  879. Try ftp://ftp.nvg.unit.no
  880. Most sites will be in Europe.  Try doing a web search for 'Sinclair' or
  881. 'Spectrum' if you have plenty of spare time that is.
  882. You could register Z80 and get a tape interface and plusd file copier.
  883.  
  884.  
  885. CREDITS:
  886. --------
  887. James McKay : me : Author of the big (getting less) rubbish bit of the code.
  888.  
  889. e-mail com40014@paisley.ac.uk
  890. Until June/July when I will probably become a bin man.
  891.  
  892. Marat Fayzullin : Wrote the original Unix/X drivers for VGB and fMSX, and
  893. I used these in x128.  Also his source gave the idea about how to access a
  894. variable as bytes and words at the same time.  Also the AY emulation is
  895. written by him and Alex Krasivsky.
  896.  
  897. http://www.freeflight.com/fms/
  898. ftp://altair.komkon.com
  899. e-mail fms@freeflight.com
  900.  
  901. Arnold Metselaar : Wrote improved Unix drivers for fMSX, I tore this to
  902. pieces to make the mono screen for x128.
  903.  
  904. e-mail metselr@fys.ruu.nl
  905.  
  906. ALSO:
  907. -----
  908. Gerton Lunter : His Z80.DOC that came with his emulator, was a very useful
  909. technical reference.  Maybe if I get V3.04 it will be an even better one.
  910. Spectrum +2A Manual by Amstrad.
  911. Master Machine Code On Your Amstrad CPC 464 And 664 by Jeff Naylor and
  912. Diane Rogers.
  913. Understanding Your Spectrum by Dr. Ian Logan.
  914. My Spectrum 128 with it's dodgy keyboard.
  915.  
  916.  
  917. HISTORY OF DEVELOPMENT:
  918. -----------------------
  919.  
  920. V0.0 Date (UK DD/MM/YY) : 02/02/96
  921. V0.1 Date (UK DD/MM/YY) : 08/02/96
  922. V0.2 Date (UK DD/MM/YY) : 26/02/96
  923. V0.3 Date (UK DD/MM/YY) : 19/03/96
  924. V0.4 Date (UK DD/MM/YY) : ??/05/96
  925.  
  926.  
  927. V0.3 Bugs Fixed:
  928.  
  929. A successful tape load now sets the zero flag (Turrican thought all levels
  930. failed to load otherwise).
  931.  
  932. Some 48K snaps decided to play a single AY note, never stopping, this has
  933. been fixed.
  934.  
  935. When loading a .sna file iff1 wasn't being set, only iff2.  This bug did
  936. not exist on pre V0.3 version.
  937.  
  938.  
  939. V0.4 Improvements:
  940.  
  941. * A tiny bit faster.  Now that I have the code split into different objects,
  942. I can #define all crucial code without fear of exceeding the compilers
  943. limits (ie Borland).  Oh!  I spoke too soon!
  944.  
  945. * Now saves 48 or 128 Z80 V2 files.
  946.  
  947. * Now tries DOS, Unix and Acorn style filenames for loading .DAT files.
  948.  
  949. * DOS version will compile in Borland C or in Watcom C, and a Makefile is
  950. supplied for Watcom and Borland as well as Unix.
  951.  
  952. * File selector and 'on Spectrum screen' text mean you don't have to
  953. manually type in names, or move the mouse pointer (X-Win) and you can now
  954. see the help screen on DOS.  You can also 'abort' loading and saving
  955. properly.
  956.  
  957. * For the first time, I have been unable to find any Z80A bugs.
  958.  
  959. * Command line options included.
  960.  
  961. * Memory cycles taken into account for overscan bits (sort of).  The price
  962. you pay is speed of course.
  963.  
  964. * SLT file format.
  965.  
  966. * Cursor keys can now have caps or no caps included.
  967.  
  968. * Additional menu options that allow dynamic alteration of a number of
  969. useful options.  Especially frame update.
  970.  
  971. * Slow Down now included, and as a menu option.
  972.