MIRACLE SYSTEMS LTD Super Gold Card Supplement (NOTE: If you are using a Gold Card please skip this supplement.) OVERVIEW The Super Gold Card brings true 32-bit processing to the QL for the first time together with several other benefits. These are: 68020 microprocessor running at 24MHz for high speed 3968K of 32-bit, no wait state memory seen by QDOS Parallel port for fast graphics printing Two disk drive connectors for four drive capability Battery backed clock with crash protection Automatic booting option for unattended operation Automatic enabling of Toolkit II option External regulated 5V input connector to allow easy connection of switch mode power supply Fitting the Super Gold Card: The Super Gold Card contains static sensitive devices and should be kept in the anti-static bag supplied when not plugged into the QL. Other types of anti-static bag could cause the clock battery to discharge. Make sure that the power to the QL is switched off. Remove the cover at the left hand end of the QL. Very carefully plug the Super Gold Card into the now exposed expansion port. The gold coloured heatsink should just touch the QL's case top when the Super Gold Card is fully plugged in. Power may now be applied. The Super Gold Card has all the functionality of the Gold Card and all references in the manual to Gold Card also refer to the Super Gold Card. Connecting the disk drives: There are two disk drive connectors on the Super Gold Card. If you have a double drive it should be plugged into the upright connector, i.e the one nearest the QL, and the drives are FLP1_ and FLP2_ as expected. A second double drive may be plugged into the connector to the left of the first and the drives become FLP3_ and FLP4_ The upright connector is wired so that all four drives can be connected to it via a single cable but the third and fourth drive mechanisms must have their jumpers set for DS2 and DS3 respectively. If in doubt please consult the data sheet for the drive mechanism in question. Details of the disk drive connectors appear later in this supplement. PARALLEL PORT To connect the Super Gold Card's parallel port to the printer plug one end of the cable provided into the connector below the gold coloured heatsink and plug the other into the printer. The main advantage of the parallel port over the serial port is high speed printing of graphics but it also simplifies setting up as once the cable connects the Super Gold Card to the printer nothing else is required. The device name is PAR and in addition to the parameters accepted by the SER device four new options are available. The T option, which is the default, will use an active translation table. The D option does not translate. (The default SDP_DEV uses PARD. See later for more on SDP_DEV.) The A option precedes every line feed, CHR$(10), with a carriage return, CHR$(l3). The A option is only necessary if the printed page looks something like this: This is line one This is line two This is line three The F option sends a form feed, CHR$(l2), at the end of a file i.e. when the channel is closed. The following will print a file ending with a form feed: COPY_N "flpl myfile" TO "parf" To print the same file followed by a form feed but with all line feeds preceded by carriage returns: COPY_N "flpl myfile" TO "paraf" For compatibility with other parallel port drivers, the name PAR may be followed by an underscore and a number, optionally ending in a K character although this is ignored. For example: OPEN #3,"par_6K" The PAR_USE command: To allow the parallel port to be used with software that only allows output to SER1 or SER2 a command PAR_USE has been provided. An example is: PAR_USE "ser" COPY_N "flp1_myfile" TO "ser2" which will send the file to PAR. If you use QUILL and it currently prints to one of the serial ports just put the line PAR_USE "ser" at the beginning of the boot program and it will print using the parallel port. PAR_USE also allows the use of extra parameters. For example PAR_USE "ser" COPY_N "flpl myfile" TO "ser1f" will print the file to PAR ending with a form feed. Buffering output to PAR: To print a file using the parallel port using free memory as a buffer enter the following: PAR_USE "lpt" PRT_USE "par","lpt" COPY_N "flp1_myfile" TO "par" If you are using a program, for example QUILL, configured to print via SER1 or SER2 and you wish it to print via PAR with a buffer add the following to the start of the BOOT program. PRT_USE "ser","par" See later in the manual for more information on PRT_USE. Details of the parallel port connector appear later. ENABLING TOOLKIT II & AUTOMATIC BOOTING If your QL has a Sinclair ROM installed there is the option of simulating the pressing of F1 or F2 as well as invoking TK2_EXT. On a QL fitted with Minerva these commands will only invoke TK2_EXT as all Minervae auto boot. To invoke TK2_EXT and simulate pressing F1 enter: AUTO_TK2F1 To invoke TK2_EXT and simulate pressing F2 enter: AUTO_TK2F2 To disable automatic booting or if you have software that does not work if Toolkit II has been enabled enter: AUTO_DIS FLP JIGGLE The Gold Card and Super Gold Card incorporate a software fix for a problem when accessing Mitsubishi ED disk drives in the form of a number of rapid steps of the drive head. This rapid stepping of the drive head, referred to as a jiggle, when applied to other makes and types of disk drive can result in the drive giving "not found" or 'bad or changed medium' errors. There is a command to enable or disable this jiggle. Suppose your system comprises one of our Dual ED Disk Drives for FLP1_ and FLP2_ and some other make of double drive for FLP3_ and FLP4_. To boot up reliably the head jiggle must be enabled so from the command line enter: FLP_JIGGLE 1 FLP3_ and FLP4_ do not require the head jiggle so add the following lines to the start of your boot program: FLP_JIGGLE 3,0 FLP_JIGGLE 4,0 If the command is given only one parameter it is memorised and remains in force the next time the QL is powered up or reset. Individual settings are not memorised and have to be set each time the QL is powered up or reset. THE CACHE There is a cache on the Super Gold Card that can increase performance but it can cause problems with programs that modify themselves during execution. There is no way of knowing whether or not a program is self-modifying so try each program first with the cache off, by typing: CACHE_OFF and then with the cache on, by typing: CACHE_ON If the program behaves differently with the cache on, other than going slightly faster, it is a sign that it is self-modifying and should only be run with the cache off. EVEN MORE SPEED The QL's hardware allows the screen to be taken from one of two areas in memory. Sinclair ROMs offer no choice but some games ignore the ROM and use the second screen and Minerva offers this as an option. If you do not make use of the second screen it is possible to disable it and gain maximum performance. Entering the command SCR2DIS disables the second screen. To reenable it enter SCR2EN. This command is memorised by the Super Gold Card so it is only necessary to type it once. EXTERNAL POWER INPUT If you are using your system with a standard power supply ignore this section. If you wish to power your system from a switch mode power supply 5V may be fed into the Super Gold Card directly via a 2.1mm power connector located under the heatsink. The heatsink should not be removed and the regulator should be left in place. Wire the plug with +5V on the outside and the centre grounded. A suitable plug is available from Miracle Systems. ASSEMBLY LANGUAGE If you are interested in using assembly language on the QL please read this section. First and foremost the Super Gold Card is for running existing QL programs faster. QL programs are written for the 68000 and there is software on the Super Gold Card to make it look as much as possible like a 68000 system. Also we recommend that your programs do not make use of special 68020 instructions so that they run on all QL systems. This is a particularly important consideration for any program destined for sale or publication. The golden rule is: assume you are writing for the 68000. Incidentally, we did not use or need a 68020 assembler in extending the Gold Card software for the Super Gold Card. The only 68020 instruction is the one to write to the cache control register. Additional information regarding the 68020 is NOT available from Miracle Systems. The cache from assembler: The cache is always on in supervisor mode and should not be turned off. To do so would cause problems for device drivers such as the Microdrives which are written to work at the speed of the 68020 with its cache enabled. There is no operating system call to alter the cache mode. The CACHE_ON command should be used from SuperBASIC. However, it is possible to turn the cache on from user mode temporarily by entering supervisor mode. Once the program goes back to user mode the cache will be disabled after the next interrupt or TRAP call. Reading the status register: The instruction to read the status register: MOVE.W SR, is privileged on the 68020. For QL program compatibility the Super Gold Card intercepts this privilege violation and emulates the instruction in software. Exception stack frame: The 68020 stacks at least one additional word of information when an exception is generated and consequently expects this additional information when the RTE instruction is executed. If your programs use the technique of going from user mode into supervisor mode and stacking an address and the status register and then executing an RTE to return to user mode they will cause problems on the Super Gold Card. If your program entered supervisor mode from user mode only return to user mode by writing to the status register. User definable exception vectors: All the user definable exception vectors that require it are preceded by code that makes the information on the stack look like that generated by the 68000 except that the format word stacked by the 68020 is also there. This need not be a problem as the format word is the first thing stacked as explained by the following example. Suppose you wish to use the trace mode to invoke your own set of routines. The exception stack frame on the left is as generated on a QL and the one on the right by a QL fitted with the Super Gold Card and not as that generated by the 68020. The stacked PC is the address of the instruction being traced. Example address | | | | A7 before |-----------------| |-----------------| $28480 | ? | | ? | <- (A7) |-----------------| |-----------------| $2847E | Low word of PC | | Format word | <- (A7-2) |-----------------| |-----------------| $2847C | High word of PC | | Low word of PC | <- (A7-4) |-----------------| |-----------------| $2847A | Status register | | High word of PC | <- (A7-6) |-----------------| |-----------------| $28478 | Empty | | Status register | <- (A7-8) |-----------------| |-----------------| A7 after $28476 | Empty | | Empty | |-----------------| |-----------------| The trace handler might look a bit like this: MOVEM.L D0/A0,-(A7) * Save a coupe of registers MOVE.L 2*4+2(A7),A0 * Get address of instruction MOVE.W (A0),D0 * Get instruction itself ... * Take some action MOVEM.L (A7)+ ,D0/A0 * Restore registers saved RTE * Resume execution of main program The above example would work without modification on the QL with or without a Super Gold Card and know nothing about the extra word on the stack. PRINTER PORT CONNECTOR DETAILS View looking into the plug. --- NC 26 |o|o| 25 NC GND 24 |o|o| 23 NC GND 22 |o|o| 21 Busy GND 20 |o|o| 19 NC GND 18 |o|o| 17 D7 GND 16 |o|o 15 D6 GND 14 |o|o 13 D5 GND 12 |o|o 11 D4 GND 10 |o|o| 9 D3 GND 8 |o|o| 7 D2 GND 6 |o|o| 5 D1 GND 4 |o|o| 3 D0 GND 2 |o|o| 1 /Strobe --- THE EXPANSION CONNECTOR: The expansion connector on the Super Gold Card is detailed below. Signals marked NC are signals either not required or not provided by the Super Gold Card depending on whether they are inputs or outputs respectively. Below is a view into the Super Gold Card's expansion connector. Use on SGC Use on SGC ______ | | - | VIN VIN | b 32 a | VIN VIN VIN VIN | b 31 a | VM12 NC NC EXTINTL | b 30 a | VPI2 NC IPLIL IPLIL | b 29 a | SPO GND NC BERRL | b 28 a | SPI GND NC IPL0L | b 27 a | DSMCL NC GND SP3 | b 26 a | SF2 GND A2 A2 | b 25 a | DBGL NC A1 A1 | b 24 a | A3 A3 NC ROMOEH | b 23 a | A4 A4 A0 A0 | b 22 a | A5 A5 NC FC0 | b 21 a | A6 A6 NC FC1 | b 20 a | A7 A7 NC FC2 | b 19 a | A8 A8 NC BLUE | b 19 a | A9 A9 NC GREEN | b 17 a | A10 A10 NC VPAL | b 16 a | A11 A11 NC VSYNCH | b I5 a | A12 A12 NC E | b 14 a | A13 A13 Refresh CSYNCL | b 13 a | A14 A14 RESETCPUL RESETCPUL | b 12 a | RED NC A15 A15 | b 11 a | CLKCPU NC GND BRL | b 10 a | A16 A16 NC BGL | b 9 a | AI7 A17 DTACKL DTACKL | b 8 a | A18 A18 See text RDWL RDWL | b 7 a | A19 A19 See text DSL DSL | b 6 a | D7 D7 Same as DSL ASL | b 5 a | D6 D6 D0 D0 | b 4 a | D5 D5 D1 D1 | b 3 a | D4 D4 D2 D2 | b 2 a | D3 D3 GND GND | b 1 a | GND GND - | |______| Signals AO...Al9, DO...D7, DSL and RDWL are high impedance while RESETCPUL is low. The Super Gold Card can drive peripherals, which it maps into the area from $4C0000 to $4FFFFF, provided that they do not use VPAL, E, BRL, BGL or BERRL. Signals are not synchronised with CLKCPU. Signals A18 and A19 on the expansion connector are both high during accesses to the peripheral area. A18 and A19 are both low during other accesses to the QL. DISK DRIVE CONNECTOR DETAILS View looking into the plug pointing upwards. Direction Function Function --- - NC 34 |o|o| 33 GND OUTPUT SIDE ONE SELECT 32 |o|o| 31 GND INPUT READ DATA 30 |o|o| 29 GND INPUT WRITE PROTECT 28 |o|o| 27 GND INPUT TRACK ZERO 26 |o|o| 25 GND OUTPUT WRITE GATE 24 |o|o| 23 GND OUTPUT WRITE DATA 22 |o|o| 21 GND OUTPUT STEP 20 |o|o 19 GND OUTPUT STEP DIRECTION 18 |o|o 17 GND OUTPUT MOTOR ON 16 |o|o 15 GND OUTPUT DRIVE SELECT 2 14 |o|o| 13 GND OUTPUT DRIVE SELEUF 1 12 |o|o| 11 GND OUTPUT DRIVE SELECT 0 10 |o|o| 9 GND INPUT INDEX 8 |o|o| 7 GND OUTPUT DRIVE SELECT 3 6 |o|o| 5 GND - NC 4 |o|o| 3 GND - NC 2 |o|o| 1 GND --- View looking into the plug pointing sideways. Direction Function Function --- - NC 34 |o|o| 33 GND OUTPUT SIDE ONE SELECT 32 |o|o| 31 GND INPUT READ DATA 30 |o|o| 29 GND INPUT WRITE PROTECT 28 |o|o| 27 GND INPUT TRACK ZERO 26 |o|o| 25 GND OUTPUT WRITE GATE 24 |o|o| 23 GND OUTPUT WRITE DATA 22 |o|o| 21 GND OUTPUT STEP 20 |o|o 19 GND OUTPUT STEP DIRECTION 18 |o|o 17 GND OUTPUT MOTOR ON 16 |o|o 15 GND OUTPUT DRIVE SELECT 2 14 |o|o| 13 GND OUTPUT DRIVE SELEUF 1 12 |o|o| 11 GND OUTPUT DRIVE SELECT 0 10 |o|o| 9 GND INPUT INDEX 8 |o|o| 7 GND OUTPUT DRIVE SELECT 3 6 |o|o| 5 GND - NC 4 |o|o| 3 GND - NC 2 |o|o| 1 GND ---