VIDI-ZX ROMBO PRODUCTIONS VIDI-ZX THE VIDEO DIGITISER FOR THE ZX-SPECTRUM RANGE OF COMPUTERS Copyright 1988, ROMBO Productions. Credits: Software Robin Holman / Marcus Sharp Hardware Colin Faulkner ROMBO Productions, 6 Fairbairn Rd, Kirkton North, Livingston, Scotland, EH54 6TS. Tel: (0506) 414631 1. INTRODUCTION 1.1 VIDI-ZX Overview VIDI-ZX is a Video Digitiser designed especially for the ZX Spectrum range of Home Computers. The interface is compatible with 48k, 128k, +2 and +3 machines. Tape, Microdrive, Disc and Disciple interfaces are all fully supported. VIDI-ZX operates on the "Frame Grabber" principle, taking a complete picture or Frame in 1/50th of a second. This means that a static image is not required. The grabbed pictures are displayed on the computer screen at up to 12 frames a second, practically real time. VIDI-ZX displays the grabbed image by setting each pixel to black and white, or to the defined INK and PAPER colour on the Spectrum screen. By using the 'SHADE' option, an intermediate shade or stipple can be shown. VIDI-ZX is fully menu controlled. The software allows easy control of all functions. Grabbing, Saving and Loading screens, Animation. Printing, are all menu driven from within the package. 1.2 Items Supplied Your VIDI-ZX pack should contain: VIDI-ZX Interface Software on Cassette Registration Card This Manual 1.3 Hardware Requirements To use VIDI-ZX you will need: a Spectrum 48k, 128k, +2 or +3 machine; a video source and its connecting lead. The video source may be anything that produces a COMPOSITE VIDEO signal; this can be a domestic video recorder, colour or black and white camera or a modern television equipped with a SCART or A/V socket. 2. GETTING STARTED 2.1 *********************************************** BEFORE CONNECTING AN INTERFACE TO YOUR COMPUTER ENSURE THAT THE COMPUTER POWER IS SWITCHED OFF *********************************************** To avoid problems it is recommended that the Expansion Connector contact fingers on your computer are cleaned to remove surface contamination. This can be done by using a cotton bud soaked in spirit, or applying a pencil rubber gently to the surface of the contact until a clean surface is obtained. If your ZX Spectrum uses Tape, Microdrive or Disc (+3) ensure that the small LINK at the bottom left-hand side of VIDI-ZX is set to the top 2 pins. If you use a DISCIPLE or similar interface, ensure that the LINK is set to the bottom 2 pins. This link controls the address that VIDI-ZX is mapped to, using either Address line 6 or Address line 4 (Disciple). 1 When you are satisfied all is ready, with the computer OFF, plug the VIDI-ZX onto the Expansion Connector at the rear of your computer. Connect the video source using your lead to the Phono Socket on VIDI-ZX and switch your computer back on. If all is well, your computer will operate as normal. If you have problems, switch off immediately and re-check the above steps. If all else fails ring us for technical support. 2.2 Loading the Software Connect your cassette recorder. Insert the program tape and load the software as normal by typing - Load "". The Basic program "VIDI" will autorun and load the Machine Code program "VIDICODE". These programs are recorded twice on the same side of the cassette. 2.3 Running VIDI-ZX If the program has loaded successfully, you will see a blank screen with a menu bar at the top showing our copyright message. Turn on your video source and press ENTER 3 times - carefully adjust the "Sample Level" control on the interface, hey presto! - digitised pictures on your Spectrum screen. Pressing the SPACEBAR will toggle the SHADE option on/off and the ENTER key will stop the action. 2.4 Configuring and Backing Up the Software Stop digitising by pressing ENTER, press the SPACEBAR 5 times to select MENU and again press ENTER. This will bring you back to the opening menu - FUNCTION:OPTION-SELECT:FAST GRAB Press the Spacebar twice to change the OPTION to MEDIA, press ENTER. The menu line will now show - FUNCTION:MEDIA-SELECT:DIS'PLE/+D. Use the Spacebar to step to the storage Media you are using and press ENTER to select. Press the Spacebar three times to change the OPTION to BACKUP, ensure you have blank media in your drive (Tape, Disc or Cartridge) and press ENTER. The programs VIDI and VIDICODE will then be transferred completely. Easy wasn't it! - VIDI-ZX uses the same Spacebar/ENTER key combination for all menu selections. 3. USING VIDI-ZX 3.1 Menu Choice/Selection All of VIDI-ZX options are selected by stepping through menu choices using the Spacebar and selecting by pressing the ENTER key. If for any reason an error is made and Basic is re-entered, simply type RUN, press ENTER and you will be returned to the VIDI-ZX program with no loss of screens etc. The menu structure is easy to use and allows you to to select options quickly and confidently. The following sections show how the menus are arranged and inter-linked. It is perhaps best if the program is run and each menu option explored while referring to these sections. 3.2 FUNCTION:OPTION-SELECT: When the program has first loaded, this menu is presented. It comprises the following sub-menus: :FAST GRAB - This is the initial option and allows fast single screen digitising. Press ENTER to select. :RUN - When this is selected, and providing a video signal is present, fast digitised images will be displayed on your computer screen. The overall brightness of the picture is controlled by the "Sample Level" knob on the side of the VIDI-ZX interface. Careful adjustment of this control will be required for best results. Pressing the Spacebar will toggle the Shade option and bring in an intermediate shade to the picture. This will show as vertical lines when frames are being grabbed, but when stopped the picture will be "stippled" for better effect. Press ENTER to stop digitising. 2 :SAVE - This will allow you to save the current screen to storage media; enter a valid file name and press ENTER. It's a good idea to use descriptive filenames if possible, perhaps adding the extension ".VID" to identify VIDI picture files. If you don't you will end up with discs full of TEST1, 2 and 3 etc. - not easy to sort through! :COPY - Copy uses the Basic 'COPY' command to dump the current picture to the printer. If required the Basic program (line 20) may be modified to re-direct the output elsewhere. :LOAD - Previously saved pictures may be loaded onto the current screen using this option. :VRFY - This option will check if you have saved the pictures correctly. :MENU - This will return you the previous menu. 3.3 :SEQUENCE This menu allows a different operating mode for VIDI-ZX. Instead of images being displayed one at a time on the screen, they are first stored in a memory carousel. Up to six pictures may be stored before the first one grabbed is overwritten as the sequence repeats. In this mode when Digitising is stopped, the preceding six images are kept and may be stored for animation. :RUN - As in 3.3.1 Spacebar will toggle 'Shade' and ENTER stop the digitising. When the picture is stopped, a small delay is incurred to allow the carousel of pictures to be sorted in memory. :ANIMATE - This selection allows the carousel of stored pictures to be re-played on the computer screen. This selection leads to the following sub-selections: :RUN Replays the sequence. NOTE Press Spacebar to stop. :DIRECT Selects Forward or Backward animation. :LOOP LOOP selects continuous or single shot. :MENU Returns to previous menu. :SPEED - This allows both the digitising and the animation rate to be set to either SLOW, MEDIUM or FAST. Interesting results can be obtained by using a slow sequence capture rate and a fast animate rate - try it!. :NOFRAMES - This allows you to set the number of frames used by the carousel store. :SAVE - Using this option saves single frames or a complete carousel of frames to the selected media This leads to the following sub-selections: :SEQUENCE Will save the frames, along with animate code. :VERIFY Verifies the specified file. :FRAME ONLY Another sub-menu set, this is very useful as it allows you to step through and select which frames to SAVE/LOAD etc. It has the following options: :FRAME Press ENTER to step through the carousel. :SAVE Saves this screen. :VERFY Guess! :COPY Copies this screen. :MENU Returns to previous menu. :LOAD - Allows a previously stored sequence to be loaded. :MENU - Returns to previous menu. 3.4 :MEDIA This menu allows you to select the storage media used for picture saving and loading etc. It also has a "spare" option OTHER, that you can customise - see TECHNICAL. :DIS'PLE/+D - Selects the DISCIPLE and +D file syntax. NOTE the LINK on VIDI-ZX must be set to the bottom 2 pins. :MICRO DRIVE - Selects this interface. 3 :+3 DISK- Use for SINCLAIR 128K +3. :TAPE - 48K, 128K+2 or +3 Cassette standard media. :OTHER - Available for customisation. See TECHNICAL. 3.5 :BACK-UP See section 2.4; you should have backed up your software by now! NOTE that when this option is used any options selected - MEDIA, PAPER and INK etc are saved as default values when the program is re-loaded. 3.6 :COLOUR This menu set allows you to set PAPER, INK, BORDER, BRIGHT and even FLASH screen attributes. Simply select the function using SPACEBAR and ENTER keys - try it. 3.7 Below is a Menu Map. NOTE FUNCTION:OPTION-SELECT:FAST GRAB may be reached at any time by pressing the '1' and 'EDIT' keys together. OPTION-SELECT +---------+--------+-----+-------+ FAST-GRAB SEQUENCE MEDIA BACK-UP COLOUR | | | | | | | COLOUR-SELECT | | | +-----+---+------+-----+------+ | | | PAPER INK BRIGHT FLASH BORDER MENU | | MEDIA-SELECT | | +-----------+------------+--------+-----+ | | DIS'PLE/+D MICRO DRIVE +3 DISK TAPE OTHER | | | SEQUENCE-SELECT | +----+--------+------+---------+-----+-----+ | RUN ANIMATE SPEED NOFRAMES SAVE LOAD MENU | | | | ANIMATE-SELECT SAVE-SELECT | +----+-------+-----+ +---------+-------+-----------+ | RUN DIRECT LOOP MENU SEQUENCE VERIFY FRAME ONLY MENU | | FAST GRAB-SELECT FRAME SAVE-SELECT +----+-----+-----+-----+-------+ +-----+-------+-----+ RUN SAVE COPY LOAD VERIFY MENU SAVE VERIFY COPY MENU 4. Animation 4.1 When a frame sequence is saved, a small machine code routine is saved along with the digitised pictures. This code can be called from Basic to animate the pictures within your own programs. 4.2 For example if you have saved a sequence of six frames called BIRDS.SEQ which you wish to animate, carry out the following: 1. Reset the computer. 2. Type CLEAR 25999 3. LOAD "BIRDS.SEQ" CODE 4. LOAD "ANIMATE" CODE 62900 5. RANDOMIZE USR 62900 When ENTER is pressed our sequence of 6 frames will be displayed and Basic re-entered. 4.3 The above commands could have been part of a more complex Basic program, perhaps displaying text 4 between animated pictures - perfect for adding Video Titles to your latest production!. When the Sequence and Animation code is saved from within VIDI, all the settings - SPEED, DIRECTION etc. - are saved as well. However, the sequence mode may be changed while it is being animated by POKING the following locations within the ANIMATE code: POKE 62900+6,0 run forwards; POKE 62900+6,1 run backwards POKE 62900+1,0 single loop; POKE 62900+1,1 continuous loop. NOTE press Spacebar to exit loop mode. POKE 62900+4,n where n is the number of frames displayed. POKE 62900+69,n where n is 1-255, 20=FAST, 40=MEDIUM, 60=SLOW 4.4 Note that the animation code "ANIMATE" saved with the sequence is 110 bytes In length and is totally relocatable. Its start or "RANDOMIZE USR" address is always the load address. 4.5 The address of the frame sequence always starts at 26000 onwards. Each screen consists of 6144 bytes, so the full 6 screens will occupy 6*6144, 36864 bytes - make sure you have enough memory available! 4.6 The ANIMATE code is the only part of VIDI-ZX Version 2.00 that you can use outside of the full menu driven package. Call addresses for the main program are NOT available. If you wish to drive the VIDI interface directly from Basic, you will have to resort to the original VIDI code - see Technical. 5. Technical - Software 5.1 The core of VIDI is written in machine (VIDICODE) code for speed. However, all file handling is done in Basic. When Basic is re-entered from VIDICODE, 3 variables are set to signal the operation required: a, b and c. They have the following significance: a = MEDIA type 1=OTHER 2=TAPE 3=+3 DISK 4=MICRO DRIVE 5=DISCIPLE/+D b = No. FRAMES, 1 to 6 c = OPERATION 1=LOAD 2=SAVE 3=VERIFY 4=COPY 5=BACK-UP 5.2 With this information it will be possible to modify the Basic part of VIDI to perform other functions, perhaps to allow pictures to be transmitted via an RS232 link etc. 5.3 The MEDIA menu has an option called 'OTHER'. This option allows you to add other storage media to the program. For example, if you wished to add to the menu options, the following lines would need to be edited to include the new commands:- 100,150,200,260 and 320. Ensure you have a copy of your original VIDI program safe! 5.4 The software synchronises the VIDI interface hardware to the even frames in an interlaced video signal. When the correct frame is located, the frame grabber is armed and triggered, capturing one complete frame into the on-board frame store (8K). 5.5 In order to preserve the correct aspect ratio on the computer screen, every 4th line in the frame store has to be discarded. In this way the 8K frame store is compressed down to a standard 6K screen. 5.6 The SHADING is carried out after grabbing by rotating all the bits on alternate screen lines to produce a fine stippled picture. 5 6. Technical - Hardware 6.1 The VIDI interface is selected by one address line being low. The LINK setting selects which address line is used. Normally the LINK will be set to use address line 6 by linking the top 2 pins. 6.2 If you use a DISCiple interface, which itself uses this address line, the LINK will have to be changed to the bottom 2 pins, and the correct MEDIA option selected. 6.3 NOTE If LINK 1 is removed completely the VIDI interface is de-selected. This feature may be used to isolate VIDI when other peripherals are being used. 6.4 VIDI-ZX accepts a Composite Video signal black and white or colour, of between 1 and 2 volts peak to peak. Note that the input is not terminated in 75 ohms, in order to get as high an input signal as possible to work with. 6.5 The brightness of the digitised picture is set by the "Sample Level" control; this determines whether a pixel will be on or off. 6.6 The stipple or SHADE option is produced by mixing with the incoming video a signal of half the sample frequency. This has the effect of producing an intermediate or 3rd shade band into the digitised image. 7. Trouble Shooting and Video Cables 7.1 If you have the software loaded and have selected :RUN from the FAST GRAB menu, and have no picture, check:- 1. The "Sample Level" control on VIDI-ZX; turn it both ways slowly over the full range. 2. The VIDEO SOURCE - check that you are connected to VIDEO OUT. 3. The VIDEO LEAD - most VCRs have the VIDEO out signal on a BNC type of connector. In this case you will need a BNC to PHONO cable; these are available from most VIDEO shops, or direct from us for #3.95 inc. Other types of connectors are sometimes used: PHONO, SCART, etc. and these will need different cables. 4. The LINK setting. 5. RING ROMBO for technical support 8. VIDI-ZX Version 1.00 8.1 At the end of the supplied cassette you will find the original VIDI program - VIDI, VIDCODE and VIDI4, VIDCODE4. These programs are included so that users may control the interface from BASIC if required. 8.2 VIDI, VIDCODE are for use with address line 6; VIDI4, VIDCODE4 for address select line 4. VIDCODE and VIDCODE4 are NOT relocatable; CLEAR 32767 first and use a load address of 32768. 8.3 The routines to operate the VIDI-ZX interface are written in machine code. They are split up into small subroutines, each written to control a specific function of VIDI-ZX. These are documented as follows: START =32768 Load address START+0 =INITIALISE Initialises the interface START+3 =SYNC Grabs a frame after a sync START+6 =FETCH Reads the frame from VIDI-ZX RAM START+9 =VIEWSTORE Switches the menu bar on/off START+12=STORE Stores the screen START+15=RETRIEVE Retrieves the screen START+18=FETCHSTIPPLE Reads a stippled frame START+21=STIPPLE Stipples a shaded frame START+24=FILTERVAR 0=2 Shade, 1=3 Shade START+25=VIEWVAR 0=menu, 1=full screen START+26=SYNCFLAG 0=sync, 1=no sync 6 8.4 It is not difficult to drive VIDI from Basic using VIDCODE. Examine the supplied VIDI program and pay attention to the following: 1. CLEAR 32767 and load VIDCODE(4) to 32768 2. Set up the subroutine addresses using LET statements 3. The INITIALISE routine MUST be called first 4. POKE VIEWVAR,0: POKE FILTERVAR,0 5. Call SYNC to synchronise the interface 6. If PEEK(SYNCFLAG)=0 then RANDOMIZE USR FETCH You should have grabbed a frame! - good luck.