THE PATCH for THE QUILL/ILLUSTRATOR



It is assumed that you are thoroughly familiar with THE QUILL and THE

ILLUSTRATOR, especially the use of flags. Although not essential, you are

recommended to use a "C Series" Quill, which has several extra facilities.



INTRODUCTION



The Patch enables you to create graphics adventures with THE QUILL and The

ILLUSTRATOR and then amend the code so that "Split-Screen" Text/Pictures are

displayed when the adventure is played. It does this by inserting a number of

extra routines into a final adventure which prevent the normal action of waiting

for a key, clearing the screen and restoring colours. Instead the colours

remain as set by the Illustrator and text is printed from the line specified by

flag 27. The patch also provides you with a number of extra routines which are

accessed using a special form of the PAUSE command (changing the operation of a

program in this way is called 'patching' which is where The Patch gets its

name).



HOW TO USE THE PATCH



Careful planning is always necessary when writing a Quilled adventure. This is

even more true when using The Patch as the extra routines do not have any effect

until the final adventure is assembled. It is suggested that you read through

the next part a couple of times before attempting to write your first "Patched"

adventure.



COLOURS

In a "normal" Illustrator adventure, you don't need to worry about the colours

used in pictures, as the text is quite separate and the player never sees the

two together. However, your pictures will now he displayed with the text.



To make things as easy as possible, the Patch alters the Illustrator interpreter

(using quite an extensive re-write!) so that the background colours, as

specified in the Graphics Start Table, are carried through to the Quill. The

Illustrator also sets PAPER 8 (transparent) and INK 9 (contrast), so your text

should always he readable no matter what background colours you have used for

the picture. You can, of course, use colour control codes buried in your

Location Descriptions and Messages to over-ride the paper 8/ink 9 effect.



The background colours for a picture will be used, even if the pictures have

been turned off or if the picture is not drawn because the player has previously

visited the location. You can therefore rely on the Illustrator to set the

colours for all locations which have a picture.



If a location is a "Subroutine", the Illustrator will NOT set any colours, and

the colours used will be unchanged from the last location. This could mean that

such a location will use different background colours depending on the direction

in which the player is travelling. If this could be a problem, you can cater for

it by specifying the wanted colours in the Event Table, and deleting the

Movement Table entries - assuming you have a C Series Quill.



If a player uses SAVE (or RAM SAVE) at a "subroutine" location, the colours used

will be those current when using LOAD (or RAM LOAD). There is no easy way of

overcoming this, but the colours will be properly set at the first location

which has a picture. (This is also true in a "normal" Quill or Illustrator/Quill

adventure. It's not a fault in The Patch!)



FLAG 27 - THE LINE NUMBER

BEFORE a picture in drawn, flag 27 must be set to the Line Number at which text

printing is to start. It is recommended that you always use Location 0 as an

introduction screen, with no picture, and include the following entry early in

the Status Table:- AT 0 LET 27 ** ANYKEY GOTO etc., where "**" is the line

number appropriate for the first picture.



The Line Numbers used are not unfortunately, the same as in BASIC. They are

numbered 1-24 FROM THE BOTTOM OF THE SCREEN, so if Flag 27 is set to 15 -

printing will commence on "BASIC" line 9. If you use a value of less than 4 or

more than 24, the Patch will ignore you and use a "default" value which is set

as standard to 12. You could, therefore, use the default value throughout the

adventure and release flag 27 for use as long as its value is 0 or greater than

24. You can also change the default value - see the later "POKES" section.



Resist the temptation to keep changing the picture size and the value of flag

27. Remember that players travel "backwards" through an adventure at times, and

you need status or Event table entries to change the flag.



When a picture has not been drawn, because there is no picture or the player is

revisiting a location, printing starts at the top of the screen as normal.



Be careful to leave room for the location description AND THE SYSTEM MESSAGE

"Give me your command" etc., or your picture will start to scroll off the screen

almost on soon as it's drawn. It's a good idea to change all the "Await command"

system messages so that they take up only one line. As standard, they include a

blank line (two CHR$ 6's) before the actual message. Bear in mind that visible

objects also take up one line each, plus the message "I/You can also see:-'.



FLAG 28 & PAUSE - THE ROUTINES

All the other routines are accessed by setting flag 28 to the appropriate number

and using a PAUSE command. You can place the necessary entries in the Status or

Event Tables. The use of PAUSE in this way may seen a little strange at first,

but you'll noon get used to it.



After a Routine has been executed, Flag 28 is RESET (i.e. made ZERO) so that any

further PAUSE commands behave normally. This has been done to save memory, as

otherwise you'd have to Reset it yourself after every use of a routine. Some of

the Routines use the value of the Pause to determine how many repeats, which

also saves memory.



The following table shows the necessary setting for flag 28, and also shows the

effect of the number that you use after Pause.  A "*" in the Pause column means

any number may be used, as it has no effect, but you must still include a Pause

command.



Value of                                             Effect of

Flag 28                 ROUTINE                       PAUSE No.



 0     Normal Pause Effect                            Normal

 1     Sound Effect 1 (Rising Siren)                  Length

 2     Sound Effect 2 (Telephone)                     Repeats

 3     Sound Effect 3 (Falling Siren)                 Length

 4     Sound Effect 4 (Electric shock)                Repeats

 5     Sound Effect 5 (White noise - Long)            Repeats

 6     Sound Effect 6 (White noise - Short)           Repeats

 7     Revert to normal typeface                         *

 8     Use alternate typeface                            *

 9     "Wipe" Screen-Clear Effect (use CLS after)        *

10     Replace System Message 1, with System Message n   n

11     Set "Objects Conveyable" to value of Pause.       n

12     Super-Quit (Restarts Adventure)                   *

13     Crash (Re-sets Computer)                          *

14     Increase "Objects Conveyable" by value of Pause.  n

15     Decrease "Objects Conveyable" by value of Pause.  n

16     Normal Key-click                                  *

17     Low-pitched "beep" Key-click                      *

18     High-pitched "beep" Key-click                     *

19     Turn Pictures OFF - use pause value of 255 (0FF in hex!)

19     Turn Pictures ON - any other pause value

20     Amend print position UP screen by value of PAUSE.

21     RAM LOAD - Use Pause value of 50 (L = Roman 50)

21     RAM SAVE - Use any other Pause value



N.B. Any other value for Flag 28 produces the normal PAUSE effect, but Flag 28

Is NOT cleared.



As an example, an entry (in Status or Event table) of:-

   "LET 28 1 PAUSE 200 LET 28 9 PAUSE 1 CLS PAUSE 50"



would cause:- A rising siren to sound (quite long), followed by the Wipe

routine, followed by a pause of one second.



A more detailed description of each routine is given later in this manual.



PATCHING - THE FINISHED PRODUCT

When you have written your adventure (including your special PAUSE actions),

drawn the pictures and saved the databases, you can proceed to use The Patch.



a)  Load the Illustrator, load in the graphics, select "Save adventure" and load

in the Quill database.  Select "SAVE" option and save the game on a blank tape.

Reset the computer.



b)  Load the Patch and stop the tape when told. Don't rewind yet!



c)  Load in the saved game.



d)  Replace The Patch in the recorder and start the tape to loud in the last

section of The Patch.



e)  if you have at least 768 bytes spare, the Patch will ask "CHR$ ?". If you

wish to use an alternate typeface, answer "y" +Enter and LOAD your typeface from

cassette.  The Patch will automatically POKE the required locations with the

numbers needed to address your typeface.



f)  Make a note of the figures given on screen.



g)  Insert a blank tape into the recorder and start recording.



h)  Press "a" to save all the code in one block, or any other key and the Patch

will save your Patched adventure (in three parts) without any further key

presses.



i)  Make further copies as needed.



N.B. The minimum Basic loader program for a patched adventure is



   10 CLEAR 24662 : LOAD "" CODE : LOAD "" CODE : RANDOMISE USR 25000



(If you saved the code as one block, omit a LOAD "" CODE



The loader may be as long as you can fit beneath RAMTOP, as the Patch reclaims

the BASIC area for use by the stack - but avoid the use of variables whose space

is not reclaimed.



You may test the completed adventure by entering, as a direct command, RANDOMIZE

USR 25000. Best of Luck!



SELLING YOUR PATCHED ADVENTURE



I hope that you will find The Patch useful in helping you to create a better,

more professional adventure. As with the Quill itself. there are no restrictions

on selling your product, but please mention The Patch somewhere.



THE ROUTINES IN DETAIL



0)  A value of 0 (or any value greater than 21) for flag 28 will mean that a

PAUSE command in the Statue or Event tables will behave normally.



1)  "LET 28 1 PAUSE n" will invoke the RISING SIREN sound effect. The value of

PAUSE will determine the length i.e. the number of "notes" in the sound. The

starting pitch is fixed.



2)  The TELEPHONE sound effect is very distinctive, and consists of TWO warbles

followed by a pause of 1 second. The pause value determines the number of

repeats.



3)  The FALLING SIREN uses the same starting pitch as 1) above, and is used in

exactly the same way.



4)  This is more than just a sound effect, and does the following:- All the

attributes on the screen are made "negative" in that black becomes white and all

the colours take on their "opposite" blue/yellow etc.). There is then a short

burst of white noise accompanied by a multicoloured striped border. If you use

an EVEN number for the Pause value, the screen will end up as normal. An Odd

number will give a very odd effect! It could be used to simulate an electric

shock, but I'm sure you can find other uses for it.



5)  The LONG WHITE NOISE sound effect, can be quite effective when used with

repeats (pause value) and can sound like machinery.



6)  The SHORT WHITE NOISE sound effect is actually a variant of 5) above, and is

used in the same way.



7)  "LET 28 7 PAUSE *" will cause the Quill to revert to the normal Spectrum

type-face.  The initialisation routines inserted into the Quill interpreter by

the Patch will also do this, so a "QUIT" (or SUPER-QUIT) will always re-set the

type-face to normal. N.B. If you have the space, patience and inclination you

may have TWO non-standard type-faces in memory and switch between them, but you

lose the normal Spectrum type-face. Details on how to do this are given in the

"POKES" section later on.



8)  "LET 28 8 PAUSE *"will switch to alternate typeface. If you did not load a

typeface when patching, the normal Sinclair typeface is used.



9)  The WIPE routine is called with a Flag 28 value of 9. The pause value does

not matter (you wouldn't want to REPEAT it would you?) but it should normally be

followed with a CLS command or you will get some very odd effects. If it's used

just before a GOTO locno, you may omit the CLS as the Quill will clear the

screen before making the jump. If, for some strange reason, you do not possess

a Series C Quill, you will be able to use "wipe" in the last named manner only,

as Series A Quills do not have a CLS function.



10)  "LET 26 10 PAUSE n" will cause the System Message 'I can also see:-" to be

replaced with System Message n. If n>29 the commend is ignored. System Message 1

is re-set after a QUIT



Note

System Message 5 is now "spare" for use by this routine, which could be used

(with a message like "You are also aware of :-) if the player has been made

blind in the adventure etc.



The Quill will now choose between System Messages 2, 3 & 4 in the ratio

45:45:10, when asking for input.



1l)  "LET 28 11 PAUSE n" will SET the maximum number of Objects Conveyable to

the value of n. QUIT (or Super-Quit) will re-set the objects conveyable.



12)  "LET 28 12 PAUSE *" will cause a complete RE-START of the game,

(SUPER-QUIT). This routine (and the normal QUIT) will also do the following

"house-keeping":-

   System Message 1 Re-set.

   Objects conveyable re-set.

   Type-face re-set to normal.

   Pictures "ON"

   Key-click normal.

   + all usual re-sets as per normal Quill.



You should note that the player will NOT be asked "Do you really want to quit

now?" (or whatever you have amended System Message 12 to read) so you should

warn the player of this fact in the instructions. or use a different word to

invoke the routine. You should not include this routine as a hidden feature of

the adventure, as some players can be quite big blokes......



13)  This routine (note the number!) will completely clear the player's Spectrum

- just like RANDOMISE USR 0 or pulling the plug out. The player should certainly

be warned of this (if you include the feature) and it's beat to use some

peculiar Vocab. words (like ZXZX ZXZX) to invoke it



It is, of course, a handy way for the player to end a session without going

through the normal QUIT routine or pulling the plug. You could, perhaps, also

use it in a multi-part adventure where a password needs to be entered in part 2,

but use a countdown flag to give the player the chance of making a couple of

mistakes before making him/her reload.



14)  "LET 28 14 PAUSE n" will INCREASE the maximum number at Objects Conveyable

by, n, but will not go past 255.



15)  "LET 28 15 PAUSE n" will DECREASE the maximum number of Objects Conveyable

by n. This routine is best used to add realism. e.g. If the Player is carrying

something heavy. or is tired, or is wearing something restricting he/she will

not be able to carry as many objects. If the offending garment is removed, or

the heavy object is dropped, use routine 14 to amend obj/conv. The number will

not decrease past 0.



16)  This routine RE-SETS the key-click to the normal Quill type. The pause

value is ignored, but must be included.



17)  "LET 26 17 PAUSE *" will change the key-click to a low-pitched beep. You

could use this to warn of approaching danger, low energy, nearing the goal,

wrong direction etc.  If you tell the player of the significance in the

instructions, it will add to the excitement.



18)  This routine is similar to 17) above, but the key-board will emit a higher-

pitched beep.



Resist the temptation to over-use the above two routines - a beeping keyboard

may annoy some players.



19)  "LET 28 19 PAUSE 255" will turn the pictures OFF. This can be very useful,

and would normally be under the player's control to allow him/her to step

quickly through your adventure to a certain point then restore the pictures. It

has no effect on the picture already on screen, unless you follow it with CLS!

You could perhaps use it as a penalty, but then the player wouldn't see your

works of art.



ANY OTHER value of pause, will turn the pictures ON, which will also have the

effect of re-setting the pictures i.e. they will all be drawn the next time

they're visited whether or not they've been visited before. If you include the

command "DESC" after this routine, the player will get visible confirmation (if

there's a picture) as the picture is drawn.



20)  This routine requires some thought to use properly, and is best explained

by, an example.



"MESSAGE 2 LET 28 20 PAUSE 3 PAUSE 200 MESSAGE 3" would have the following

effect, if Message 2 was three lines long, and Massage 3 was at least as long:-



  a)  Message 2 is printed on the screen.

  b)  The "printing line" is advanced 3 lines UP the screen,

      i.e. to the beginning of Message 2.

  c)  There is a pause of four seconds.

  d)  Message 3 is printed OVER THE TOP of Message 2.



As long as the bottom of the screen has not been reached by "Give me your

command" and the cursor, the screen will not scroll.  You can thus print many

messages without losing the picture. The "PAUSE 100" could have been "ANYKEY" to

allow the player to read the message at leisure, or could have been shorter to

"flash" a message on screen. The "covering" message does not have to be as long

in text; you could pad with CHR$ 6's



This routine checks that you're not going off the screen, so you could use a

pause value of 24 to ensure printing at the top of the screen, if that's what

you want.



21)  The following entry in the Event Table will invoke a RAM SAVE:-

        LET 28 21 PAUSE *        where * is not 50

(It's up to you to define the words which invoke it)

        LET 28 21 PAUSE 50       will invoke a RAM LOAD, and your player will be

instantly transported to the position saved, just like a normal cassette load -

but quicker.



If a player attempts a RAM LOAD without having first done a RAM SAVE, the Patch

will simply ignore the command.



It should be obvious that the RAM SAVED game position is lost when the computer

is switched off or cleared, but a cassette save could immediately follow a RAM

LOAD at the end of a partially successful session!



POKES



In order to use TWO non-standard typefaces: When patching, answer "Y" to the

CHRS? prompt, and load in the typeface which will be the FIRST typeface used.

Press CAPS SHIFT & BREAK. POKE 24791, (PEEK 24802) and POKE 24792, (PEEK 24803).

Then GOTO 15 (Enter). Answer "y" as before, and LOAD the SECOND TYPEFACE. Put in

your blank tape, START RECORDING, and press a key to SAVE the adventure. The

Patch will save all the right bits, and you will find that the adventure will

start with the first typeface you loaded. N.B. If you don't have room for the

second typeface, the Patch will NOT prompt with "CHR$ ?".



The default value for the printing line on split screen pictures is set to 12

(about halfway down the screen). This can be changed by POKEing address 64414

(#FB9E) with the line number you wish to use as a default value. REMEMBER:-

numbers start at 1, from the BOTTOM of the screen. DO NOT use a value less than

4 or greater than 24.



To change the cursor, you will need to alter the following addresses:-



27192 & 27180 POKE with 255 minus ASCII Code of Cursor required. (it's 255-32=

223 for a space at present)



27187  POKE with 255 minus ASCII Code of "Marker" (ie ">" as standard)



27186  POKE with 255 for a non-inverse marker.



27179 & 27191 POKE with 255 for non-flashing cursor.



The above addresses are for PATCHED adventures only.



PLEASE NOTE.  The Quill's error handling routine has been removed so that a tape

loading error (or BREAK during a cassette save) will re-start the game. The

normal END after QUIT will clear the machine after 6 seconds even if a key is

not pressed.



SAVING SCREEN$ TO CASSETTE 



After The patch on the cassette, you sill find two very short blocks of code

named "SCREEN$ SAVE CODE 1" and " SCREEN$ SAVE CODE 2" (using keywords as part

of the filename). If you LOAD each of these into the Illustrator, using Main

Menu option "F" (LOAD GRAPHICS) with a null filename, you will he able to SAVE

your pictures to cassette as a SCREEN$. To do this, select option "A" (GRAPHICS)

from the Main Menu, then option L (+ loc.no.).  START YOUR RECORDER BEFORE

PRESSING ENTER, as the SCREEN$ is saved immediately after drawing. This routine

replaces the printer COPY facility.



CREDITS



"The Quill", 'The Illustrator",  "The Patch" and all associated documentation

are (c) Gilsoft International Ltd.



Thanks to "Spectrum Computers" Castle Meadow, Norwich, for expert help,

encouragement and the use of a decent printer! Also Colin Russell, for the 

idea of the "Objects Conveyable" routines. Finally I must thank Compass Software

for using the POKE (in Project X) which started me thinking...



Phil Wade - May 1985

