Home » Personal collection » Acorn ADFS disks » Archimedes » IJJOBS21.ADF » PT3P1\TXT

PT3P1\TXT

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Archimedes » IJJOBS21.ADF
Filename: PT3P1\TXT
Read OK:
File size: 6CDD bytes
Load address: FFFFFF48
Exec address: 4EA3B268
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
Programming Technique
Part 3: Graphics - Screen Memory

Written by Dominic Ford

At the end of the last article, you could program graphics in colour using
the built in MOVE and DRAW commands in BASIC, and could program fast,
detailed graphics in black and white using user defined characters. But
there was a problem if we wanted graphics in both colour and detail, as
by both methods the production of such graphics would be incredibly slow.

There is a solution to this problem, which involves taking advantage of the
way in which the computer's video system operates. The colour of each pixel
on your monitor is determined the data sent to the monitor by your computer -
thats fairly obvious. But if you have drawn a very complex set of shapes on
the computer screen, perhaps using a BASIC program which took several hours
to calculate and draw the result you see on the screen, how does the 
computer remember the colour of every pixel on the screen, and know what
data to send to your monitor? The answer is simple: within your computer's
memory there is an area set aside to store the colour of every pixel on the
screen, and when the monitor requests the colour of a particular pixel, the
computer simply reads the colour of the pixel from this area of memory.
This area of memory is called "Screen Memory". It can be considered as a
sort of giant table, holding data for the colours of all of the pixels in
a huge matrix of memory locations.

But of what use is this to the programmer you might be wondering. The
answer is that when you use user defined characters, MOVE and DRAW commands,
or any other method of putting anything on the screen, the computer simply
alters a few values in this giant table. But the computer takes time to
process your MOVE and DRAW commands to work out which values in the table
to alter. If you could bypass this stage, and set the values in this giant
table yourself without using the computer's general purpose graphics
commands, you can get exactly the result that you want, and much faster
than you would achieve if you were doing the operation through the
computer's commands. These have to process the parameters which you give,
and then calculate where abouts in the giant table you want to alter,
before they can actually do any useful work. Thus a lot of computer time
is wasted in performing calculations, which can actually be skipped if the
programmer is careful.

There are two possible ways of achieving this idea, both of which are useful
in different situations:

1. Save screen memory to disc.

This idea is fairly simple to understand. You, as the programmer, write a
program to plot the artwork for your program onto the screen, taking
however many hours it may take to complete all of the calculations
required to plot the graphics. You run this program once on your computer,
so that your masterpiece is stored in the screen memory of your computer
(ie. is on the monitor of your computer). You than transfer the entire
contents of the screen memory on your computer to floppy disc.

Then, in the final program which you want the user to operate, you include
a command to load this data back from floppy disc into the screen memory
of their computer. In a matter of a couple of seconds, graphics which took
possible hours to calculate will appear on their screen. This is a
technique which I have used in several of my programs. The main menu of
Shipwrecked II: Jupiter 3, where you select Play, Instructions, Game
Complete or Cheat with the starfield backdrop was done in this way - the
screen took nearly an hour for my computer to calculate, but I was able
to make it appear in seconds on your screen. I should also mention the title
screen to Shipwreck with the animated sea, not to mention the endless EUG
title screens I have done in this way - the Christmas EUG 35 screen with
the swirly blue background (credited erroneously to Robert Sprowson) took
two whole days to plot!

In order to achieve this, you simply need to understand two BASIC commands:

*SAVE Filename nnnn mmmm
*LOAD Filename nnnn

These load and save areas of the computer's memory to floppy disc or cassette
with the filename givan in place of the work Filename, starting at memory
location nnnn, and continuing until memory location mmmm (where nnnn and mmmm
are both in hexidecimal - base 16). Don't worry if you don't entirely
understand this - it is not necessary to entirely understand the workings
of these commands, or of hexidecimal to use them to store and retrieve
screen memory. All you need to do is substitute nnnn and mmmm for the
addresses of the start and finish of screen memory. The location of these
within your computer varies depeding upon which graphics mode you are using
(which you selected using the MODE command - see previous tutorial if you
are unsure of what this is), but is always constant for any particular
mode. the values for the different modes are given below:

Mode            nnnn    mmmm   NOTES:
0               3000    7FFF
1               3000    7FFF   - nnnn and mmmm values given to the left are
2               3000    7FFF   all in hexidecimal. Therefore they can be
3               4000    7FFF   substituted directly into the *LOAD and *SAVE
4               5800    7FFF   commands with no conversion required.
5               5800    7FFF
6               6000    7FFF   - Values are not valid for the BBC model A in
7               7C00    7FFF   modes 4,5,6 or 7.

Examples:

Suppose you are in mode 2, and want to store the screen to a floppy. From
the table above, nnnn is 3000 and mmmm is 7FFF for mode 2. Therefore, to
save the screen under the filename "Screen", you would type:

*SAVE Screen 3000 7FFF

Now, if you want to restore the screen again, and put your graphics back
on the screen again, you would use *LOAD. Notice that this time only a
value for nnnn is required, and not for mmmm:

*LOAD Screen 3000

You can try this out now, if you switch on your Electron, and insert a work
disc into your floppy drive. If you use ADFS, you may need to use *MOUNT
to select the floppy disc, and be able to write to it. Now enter mode 2
by typing:

MODE 2

Now type some text on the screen which will represent the graphics which
you want to save. When you have finished, save the contents of screen memory
to floppy disk as shown above, by typing:

*SAVE Screen 3000 7FFF

When the disk drive has finished, clear the text off the screen by typing:

CLS

The text which you typed onto the screen has now been wiped from the
computer's memory, but should still be stored on the floppy disc. We can
show that this is so by typing:

*LOAD Screen 3000

Your text should now reappear on the screen. You can repeat this with any
kind of complex graphics on screen, and it will still work. The same can
be done in any other graphics mode, simply by changing the values of nnnn
and mmmm to those given in the table above. For example in mode 5 you
would use:

*SAVE Screen 5800 7FFF

followed by:

*LOAD Screen 5800 7FFF

There are, however, a few precautionary points which should be mentioned
about this technique of saving screen memory:

- As you probably realise, in four colour modes, the four colours you
can use can be changed from the default black, red, yellow and white by
using VDU 19 to change the palette. The colours in the palette are not
saved when this technique is used, and must be restored by repeating the
VDU 19 commands again. If you define the palette to, for example, black,
blue, cyan and white, and create a picture which looks good in this colour
scheme, you must remember that unless you define the palette to these four
colours before performing *LOAD to restore the picture, it may appear
rather odd when reloaded, as it will appear in black, red, yellow and
white - the default colour scheme.

- The exact reason why this happens is rather complicated, but if you allow
the cursor to go down off the bottom line of the screen, and allow the screen
to scroll up one line, this technique stops working until you perform a
MODE command, or clear the screen using CLS. Basically what happens is that
the computer does not physically move every line of text on the screen up
one line, but instead makes a note that every line in screen memory is stored
one line lower than it should be. When you reload from disk, this note is
lost, and the computer draws every line lower than it should be. Each time
that CLS or MODE is executed, screen memory is cleared and reinitiated, so
that every line is stored in memory where you would expect it to be. Simply
remember not to allow the screen to scroll between clearing it, and saving
the contents of screen memory to disc.

- The files created when you save the contents of screen memory to disk
are fairly large - so large, in fact, that you can often only fit around
15 such files onto each disk that you use (the exact number depends upon
what modes the images are in). Therefore this technique is not feasable
for a large number of images. Each screen in a game like Shipwrecked cannot
be stored in this way - if I had stored every screen of the game like this,
it would have required six floppy disks to store the data for the game!
This means that saved screens must be reserved for the purposes of title
screens only.

Earlier in the article, I mentioned several examples of screens which I have
done for EUG using saved screens using this technique. These included the
title screens for both Shipwrecked games, and also several EUG title
screens. You may have noticed that these were actually animated (see the
starfield in Jupiter 3 and the EUG 35 title). This was achieved by palette
switching as used in the previous article. If you look again at the
programming technique demonstration from this article (on EUG 36), and
select option 5, the same effect will appear on your screen. The same
principal was applied in both animated screens mentioned above - the only
difference is that in these title screens the pattern on screen which is
being palette switched is rather more complex. Shipwreck's title screen
(with the animated water scene) was also created in this way, except that
for this screen there was also a machine code program altering the contents
of screen memory as well, to enhance the effect.

So, we have a technique which allows us to store a small number of very
detailed screens on floppy, and recall then at very great speed. But what if
we want to use this method for a large number of screens? And what if we
want a situation like a game, where the user can move sprites on the screen
around. This can also be done by altering the values in screen memory
directly, but in a different way...

2. Editing screen memory

The basic idea is this: in any program, you only usually require a certain,
small number of little 'blocks' to make up a whole picture. In a word
processor, for example, you only need the letters of the alphabet to appear
on the screen. These letters are small blocks of graphics which appear on
your screen (called characters). Because only these 26 blocks are required,
the word processor does not need to store every letter as all of the pixels
which make it up (ie. as a bitmap), but just as a code for that particular
letter. When the word processor wants to display a letter on the screen, it
looks up the letter code, and then copies the graphic data for what that
letter looks like onto the screen. Therefore, the graphic data for what
colour all of the pixels should be for that particular letter (which might
take several bytes) need only be stored once, and that letter can be stored
in your script in just one byte, for the letter code. Thus, the memory
taken up by your script is reduced dramatically.

The same principal can be used in graphics. Look at two brick walls in
an arcade adventure such as Shipwrecked - can you see the difference
between them? If they are the same, surely you only need to store the
graphic data for a brick wall once, and then copy it onto the screen
whenever you want a brick wall. In Shipwrecked, for example, the graphic
data to describe what a brick wall looks like took 128 bytes. Yet every
time I wanted that brick wall (which was over a hundred times) I could
simply use one byte to say "Put a brick wall here!".

The easiest way to use this block idea, as you may already have realised,
is using user defined characters. You redefine the letters of the alphabet
as different pictures, and then use the standard BASIC PRINT command to
output these pictures to the screen, as and when they are required. But,
as we already realised in the last article, this only allows you to use
one colour in each character. Even so, this is a reasonable technique if
you don't mind the lack of colour. Many commercial games actually never
addressed this problem, and had graphics which lacked colour somewhat.
Even Dizzy (for those who have never heard of it, a great arcade adventure
of the 1980s, which caused quite a cult following at the time on the
Spectrum and C64, but never quite reached the Elk) did not have more than
one colour (other than black) per block. Different blocks were, however,
different colours - trees were green and the ground was red - but there
was never any overlap between the two colour areas.

There is, however, a way of creating an effect just like user defined
characters, but in full colour, and the principal is very similar to
that used before in saving screen memory. Basically, you design you small
block on the screen, using whatever technique you like to draw it, and then
save the small part of screen memory which contains your design. This time,
however, you will not save it to floppy disc, but to another area of memory.
You can then copy this block back to screen memory whenever and wherever you
want it. If you want it, say, in the fifth row down, and twelve characters
along, you can calculate where abouts this corresponds to in screen memory,
and copy the block to this location. As the block is stored in your
computer's RAM, as opposed to on floppy, this transfer can be done by
machine code at very great speed (taking only a small fraction of a second).
For those programmers who are not familiar with machine code, a module
is included with this tutorial allowing you to do this. The program code
for this module is actually taken directly from Shipwrecked.

If you are not familiar with machine code, then you can probably skip the next
section on how to directly access screen memory, as it is impossible
to achieve any speed by accessing screen memory directly in BASIC - your
program will crawl along incredibly slowly. You could still use such a
technique in preparing a screen which you intend to save to floppy using
the technique described before with *SAVE and *LOAD.

Firstly, it is important to know how screen memory is laid out in memory.
The exact position of each character within the memory of your computer
varies from one graphics mode to another, but the basic principals are the
same:

- The screen area is divided up into characters. These are blocks of eight 
  pixels by eight pixels, and are the same size as the rectangular block
  of space taken up by one letter when you print text to the screen. Screen
  memory is divided up into blocks, with each the characters being defined
  by one of these blocks.
- The screen is stored row by row, with the top row first and the bottom
  row last.
- Within each of these rows, characters are stored one by one, from left to
  right.
- In all modes, screen memory ends at &7FFF (ie. at the end of RAM)

Footnote: By convention, memory addresses are specified in hexidecimal. I
          use the standard Acorn '&' prefix to indicate hexidecimal values.
          Those used to dealing with PCs are any other computers may be used
          to the American convention of using a dollar prefix in its place.
          It should be noted that the Elk expects & and will not accept $.

Example:

Suppose I want to draw a blob in character square (6,7), in mode 1. What is 
the address of this square? (given that each character takes 16 bytes of
screen memory to define in mode 1 - we'll come to how to calculate this in
a minute).

Well - looking at the table earlier, screen memory starts at &3000 in mode 1.
We want to find the start of row 7 in screen memory. This row has 7 rows of
characters above it, and which will be stored before it. Each of these rows
consists of 40 characters, which take up 16 bytes each. Therefore the total
memory taken up by these rows is 7 * 40 * 16 = 4480 bytes. [Each character
is 16 bytes, each row consists of 40 of these characters, therefore we
multiply by 40, and as there are 7 of these complete rows, we multiply by
7 to get the value for seven of these rows]

Now we have that the starting address of row 7 is at:

&3000 + 4480 = &4180

Now that we have found where abouts in memory this row starts, we need to
locate character 6. This should be fairly easy - we know that characters are
stored from left to right, so just add on the memory required to store six
characters to the left of the one we want, i.e. 16 * 6 = 96 bytes [Six
characters, each taking 16 bytes to store].

Therefore the address of character (6,7) will be:

&4180 + 96 = &41E0

Answer: Character (6,7) is stored from &41E0 to &41EF

Just to check the answer is correct, type this simple loop:

10 MODE 1
20 FOR ad=&41E0 TO &41EF
30 ?ad=255
40 NEXT

And yes, a white splodge does appear in square (6,7).

This whole procedure can actually be refined down, and expressed as a simple
formula:

Address = Base + ( y * No. characters per line + x ) * Memory per character

Where: Address= The memory location of the start of the character you want.
       Base   = Start of screen memory in current graphics mode.
       (x,y)  = Co-ordinate of square you want to access (same as PRINT TAB)

Since the number of characters per line, the number of bytes per character,
and the base address of screen memory are all constant for any particular
graphics mode, the values for the graphics mode you are using can be
substituted into the equation in your program. For mode 1, for example, you
would use:

Address = &3000 + (40 * y + x) * 16

Before continuing, one note should be borne in mind. You may remember that
a while back I mentioned that when you type text which overflows off the
bottom of the screen, the computer makes a note that each line is stored
in memory one line lower than it should be, but does not actually move
anything around in screen memory. The same effect can cause problems with
direct access to screen memory as well. The simple rule for beginners is,
NEVER attempt to use direct screen memory access when there is even the
slightest possibility that the screen might have been allowed to scroll up
at all (e.g. after using INPUT to get input from the user - how do you
know that they didn't type so much that it went of the bottom of the screen?)
If you know what you are doing, this rule can be ignored, and high-speed
scrolling can be achieved as a result, but that is not for the beginner! I
can tell you from first hand experience, that creating scrolling in Jupiter
3 by this technique was a nightmare - especially when the operating system
calls you need to make to achieve this are completely different on the BBC
to the Elk, so you need to find out which platform you are operating on,
and then make the relavant calls for that platform!

Now that you can locate a the memory occupied by a character in screen
memory, you need to know how the bytes within this block are laid out, so that
you can have pixel by pixel control over your monitor screen. This is also
required if you are to be able to calculate the amount of memory taken up
by each character's definition in a particular mode.

The graphics modes can be divided into three categories: monochrome modes
(ie. two colours), four colour modes, and sixteen colour modes. All of the
Elk's modes fall into these three groupings. Which of these colours each
pixel of the screen is depends upon the status of a number of binary bits.
These have two states, 0 or 1. Now, in a monochrome mode, one bit is
sufficient to define the colour of one pixel (bits have two states, 0 or 1,
and the pixels have two states, colour 0 or colour 1). In a four colour mode,
on the other hand, one bit will not be sufficient, as four different states
are required. Two bits will be enough to store the colour of one pixel,
however:

Bit 1 state     Bit 2 state     Colour
  0               0               0
  0               1               1
  1               0               2
  1               1               3

Those familiar with binary will spot the pattern straight away - simply
convert the binary value of the two bits into decimal, and you have the
logical colour number. A very similar pattern applies to MODE 2 - the Elk's
16 colour mode. Each pixel requires 4 bits to store its colour (2^4=16).
Once again, the colour of the pixel is the logical colour whose number is
given when the four bits are put together to form a binary value:

Bit 1 state  Bit 2 state  Bit 3 state  Bit 4 state  Colour  Default
  0            0            0            0            0       BLK
  0            0            0            1            1       RED
  0            0            1            0            2       GRN
  0            0            1            1            3       YEL
  0            1            0            0            4       BLE
  0            1            0            1            5       MGT
  0            1            1            0            6       CYN
  0            1            1            1            7       WHT
  1            0            0            0            8     BLK/WHT
  1            0            0            1            9     RED/CYN
  1            0            1            0            10    GRN/MGT
  1            0            1            1            11    YEL/BLE
  1            1            0            0            12    BLE/YEL
  1            1            0            1            13    MGT/GRN
  1            1            1            0            14    CYN/RED
  1            1            1            1            15    WHT/BLK

[Default: Default setting of this logical colour when MODE 2 is first
entered]

So... the Electron has modes where the definition of the colour of a
certain pixel can take 1, 2 or 4 bits. As each byte of the electron's
memory consists of 8 seperate bits, this means that in monochrome modes
we can fit 8 pixels into each byte (8/1=8). In four colour modes (where
each pixel requires two bits) we can fit 4 pixels into each byte (8/2=4).
Finally in MODE 2 (the sixteen colour mode where each pixel requires 4
bits) we can fit two pixels into each byte. Let's now look at how each is
laid out in more depth:

MONOCHROME MODES:

These are laid out in the simplest way, as eight pixels fit into each byte.
The character, remember, consists of an 8 by 8 square of pixels. The data
is stored in the same way as user defined characters are defined using
VDU23. The first byte of the definition defines the top row of eight pixels;
the second defines the second row down, etc. Thus the entire character can
be defined in eight bytes, and this is the number of bytes of the Elk's
memory which is used by each character. Note - the most significant bit of
each byte defines the left-most pixel of the row, and the least significant
bit defines the right-most pixel (just as with VDU 23 definitions)

FOUR COLOUR MODES:

This time each byte can only hold four pixels. Once again, each byte holds
a number of pixels which are in a horizontal line. This time, as before,
the first eight bytes run down in a vertical line. This time, though, not
all of the pixels in the character are being defined, and only the left
most 4 pixels. The right-most four pixels are defined in a second downward
vertical sweep. Thus the total memory allocation for each character is
sixteen bytes. The layout is shown more clearly using a diagram. This
shows the eight by eight block of pixels in a character, and each has
the offset of the memory location where this pixel is stored from the
start of the character definition. Offsets are given in hexidecimal:

PIXEL-BY PIXEL LAYOUT    MEMORY FLOW

00008888                   0      8
11119999                   �      �
2222AAAA                   �      �
3333BBBB                   �      �
4444CCCC                   �      �
5555DDDD                   �      �
6666EEEE                  \ /    \ /
7777FFFF                   7      F

Each of these sixteen bytes, as already discussed, contains four pixel
definitions. But within the byte's eight bits, they are not laid out as
you might at first imagine. If we call the four pixels A, B, C and D (A is
left-most, D is right-most), the lay out is:

[MOST SIGNIFICANT]    A1 B1 C1 D1 A0 B0 C0 D0    [LEAST SIGNIFICANT]

Where: A1: Most significant bit of A's definition  � Two bit definition
       A0: Least significant bit of A's definition �  of pixel A.

The same pattern holds for B, C and D.

Example:

Let's suppose we want to set the colour of the left-most pixel in a byte
of a four colour mode to be colour 3. We would use:

?address=(?address AND &77) OR &88

Explanation - The (?address AND &77) bit clears the two bits defining the
pixel that we want to change. The OR &88 then sets the two bits that we
want set. This way we ensure that when we are going way from colour 1 to
colour 2, the least significant bit of the definition is cleared as well
as the most significant bit being set.

It is important to notice the pattern in these bits - each pixel requires
a two bit definition, but these two bits are not next to each other in
the byte - instead all of the high-bytes are stored together, and all of
the low-bytes are stored together.

SIXTEEN COLOUR MODES

The pattern for sixteen colour modes is similar to that found in four
colour modes, except that each byte can only store two pixels (each
occupies four bits). As with previous cases, the pixels are stored
in a number of vertical sweeps starting at the left of the character,
and moving to the right. This time, though, four vertical sweeps are
required to cover the entire character, not two as with four colour
modes:

PIXEL-BY PIXEL LAYOUT    MEMORY FLOW

00880088                   0      8    10    18
11991199                   �      �     �     �
22AA22AA                   �      �     �     �
33BB33BB                   �      �     �     �
44CC44CC                   �      �     �     �
55DD55DD                   �      �     �     �
66EE66EE                  \ /    \ /   \ /   \ /
77FF77FF                   7      F    17    1F

NB: Offsets given in hexadecimal. Values in right half of left diagram
should have &10 added to them (only least significant character given)

The pattern of the layout of the pixel data in each of the bytes
is also similar to that for the four colour modes (the two pixels
are A and B, and each comprises of four bits 0-3, where 0 is least
significant and 3 is most significant).

[MOST SIGNIFICANT]    A3 B3 A2 B2 A1 B1 A0 B0    [LEAST SIGNIFICANT]

Notice that once again bits defining the pixels A and B are not
stored together, but those defining the least/most significant
bits are stored together.
00000000  50 72 6f 67 72 61 6d 6d  69 6e 67 20 54 65 63 68  |Programming Tech|
00000010  6e 69 71 75 65 0d 0a 50  61 72 74 20 33 3a 20 47  |nique..Part 3: G|
00000020  72 61 70 68 69 63 73 20  2d 20 53 63 72 65 65 6e  |raphics - Screen|
00000030  20 4d 65 6d 6f 72 79 0d  0a 0d 0a 57 72 69 74 74  | Memory....Writt|
00000040  65 6e 20 62 79 20 44 6f  6d 69 6e 69 63 20 46 6f  |en by Dominic Fo|
00000050  72 64 0d 0a 0d 0a 41 74  20 74 68 65 20 65 6e 64  |rd....At the end|
00000060  20 6f 66 20 74 68 65 20  6c 61 73 74 20 61 72 74  | of the last art|
00000070  69 63 6c 65 2c 20 79 6f  75 20 63 6f 75 6c 64 20  |icle, you could |
00000080  70 72 6f 67 72 61 6d 20  67 72 61 70 68 69 63 73  |program graphics|
00000090  20 69 6e 20 63 6f 6c 6f  75 72 20 75 73 69 6e 67  | in colour using|
000000a0  0d 0a 74 68 65 20 62 75  69 6c 74 20 69 6e 20 4d  |..the built in M|
000000b0  4f 56 45 20 61 6e 64 20  44 52 41 57 20 63 6f 6d  |OVE and DRAW com|
000000c0  6d 61 6e 64 73 20 69 6e  20 42 41 53 49 43 2c 20  |mands in BASIC, |
000000d0  61 6e 64 20 63 6f 75 6c  64 20 70 72 6f 67 72 61  |and could progra|
000000e0  6d 20 66 61 73 74 2c 0d  0a 64 65 74 61 69 6c 65  |m fast,..detaile|
000000f0  64 20 67 72 61 70 68 69  63 73 20 69 6e 20 62 6c  |d graphics in bl|
00000100  61 63 6b 20 61 6e 64 20  77 68 69 74 65 20 75 73  |ack and white us|
00000110  69 6e 67 20 75 73 65 72  20 64 65 66 69 6e 65 64  |ing user defined|
00000120  20 63 68 61 72 61 63 74  65 72 73 2e 20 42 75 74  | characters. But|
00000130  0d 0a 74 68 65 72 65 20  77 61 73 20 61 20 70 72  |..there was a pr|
00000140  6f 62 6c 65 6d 20 69 66  20 77 65 20 77 61 6e 74  |oblem if we want|
00000150  65 64 20 67 72 61 70 68  69 63 73 20 69 6e 20 62  |ed graphics in b|
00000160  6f 74 68 20 63 6f 6c 6f  75 72 20 61 6e 64 20 64  |oth colour and d|
00000170  65 74 61 69 6c 2c 20 61  73 0d 0a 62 79 20 62 6f  |etail, as..by bo|
00000180  74 68 20 6d 65 74 68 6f  64 73 20 74 68 65 20 70  |th methods the p|
00000190  72 6f 64 75 63 74 69 6f  6e 20 6f 66 20 73 75 63  |roduction of suc|
000001a0  68 20 67 72 61 70 68 69  63 73 20 77 6f 75 6c 64  |h graphics would|
000001b0  20 62 65 20 69 6e 63 72  65 64 69 62 6c 79 20 73  | be incredibly s|
000001c0  6c 6f 77 2e 0d 0a 0d 0a  54 68 65 72 65 20 69 73  |low.....There is|
000001d0  20 61 20 73 6f 6c 75 74  69 6f 6e 20 74 6f 20 74  | a solution to t|
000001e0  68 69 73 20 70 72 6f 62  6c 65 6d 2c 20 77 68 69  |his problem, whi|
000001f0  63 68 20 69 6e 76 6f 6c  76 65 73 20 74 61 6b 69  |ch involves taki|
00000200  6e 67 20 61 64 76 61 6e  74 61 67 65 20 6f 66 20  |ng advantage of |
00000210  74 68 65 0d 0a 77 61 79  20 69 6e 20 77 68 69 63  |the..way in whic|
00000220  68 20 74 68 65 20 63 6f  6d 70 75 74 65 72 27 73  |h the computer's|
00000230  20 76 69 64 65 6f 20 73  79 73 74 65 6d 20 6f 70  | video system op|
00000240  65 72 61 74 65 73 2e 20  54 68 65 20 63 6f 6c 6f  |erates. The colo|
00000250  75 72 20 6f 66 20 65 61  63 68 20 70 69 78 65 6c  |ur of each pixel|
00000260  0d 0a 6f 6e 20 79 6f 75  72 20 6d 6f 6e 69 74 6f  |..on your monito|
00000270  72 20 69 73 20 64 65 74  65 72 6d 69 6e 65 64 20  |r is determined |
00000280  74 68 65 20 64 61 74 61  20 73 65 6e 74 20 74 6f  |the data sent to|
00000290  20 74 68 65 20 6d 6f 6e  69 74 6f 72 20 62 79 20  | the monitor by |
000002a0  79 6f 75 72 20 63 6f 6d  70 75 74 65 72 20 2d 0d  |your computer -.|
000002b0  0a 74 68 61 74 73 20 66  61 69 72 6c 79 20 6f 62  |.thats fairly ob|
000002c0  76 69 6f 75 73 2e 20 42  75 74 20 69 66 20 79 6f  |vious. But if yo|
000002d0  75 20 68 61 76 65 20 64  72 61 77 6e 20 61 20 76  |u have drawn a v|
000002e0  65 72 79 20 63 6f 6d 70  6c 65 78 20 73 65 74 20  |ery complex set |
000002f0  6f 66 20 73 68 61 70 65  73 20 6f 6e 0d 0a 74 68  |of shapes on..th|
00000300  65 20 63 6f 6d 70 75 74  65 72 20 73 63 72 65 65  |e computer scree|
00000310  6e 2c 20 70 65 72 68 61  70 73 20 75 73 69 6e 67  |n, perhaps using|
00000320  20 61 20 42 41 53 49 43  20 70 72 6f 67 72 61 6d  | a BASIC program|
00000330  20 77 68 69 63 68 20 74  6f 6f 6b 20 73 65 76 65  | which took seve|
00000340  72 61 6c 20 68 6f 75 72  73 0d 0a 74 6f 20 63 61  |ral hours..to ca|
00000350  6c 63 75 6c 61 74 65 20  61 6e 64 20 64 72 61 77  |lculate and draw|
00000360  20 74 68 65 20 72 65 73  75 6c 74 20 79 6f 75 20  | the result you |
00000370  73 65 65 20 6f 6e 20 74  68 65 20 73 63 72 65 65  |see on the scree|
00000380  6e 2c 20 68 6f 77 20 64  6f 65 73 20 74 68 65 20  |n, how does the |
00000390  0d 0a 63 6f 6d 70 75 74  65 72 20 72 65 6d 65 6d  |..computer remem|
000003a0  62 65 72 20 74 68 65 20  63 6f 6c 6f 75 72 20 6f  |ber the colour o|
000003b0  66 20 65 76 65 72 79 20  70 69 78 65 6c 20 6f 6e  |f every pixel on|
000003c0  20 74 68 65 20 73 63 72  65 65 6e 2c 20 61 6e 64  | the screen, and|
000003d0  20 6b 6e 6f 77 20 77 68  61 74 0d 0a 64 61 74 61  | know what..data|
000003e0  20 74 6f 20 73 65 6e 64  20 74 6f 20 79 6f 75 72  | to send to your|
000003f0  20 6d 6f 6e 69 74 6f 72  3f 20 54 68 65 20 61 6e  | monitor? The an|
00000400  73 77 65 72 20 69 73 20  73 69 6d 70 6c 65 3a 20  |swer is simple: |
00000410  77 69 74 68 69 6e 20 79  6f 75 72 20 63 6f 6d 70  |within your comp|
00000420  75 74 65 72 27 73 0d 0a  6d 65 6d 6f 72 79 20 74  |uter's..memory t|
00000430  68 65 72 65 20 69 73 20  61 6e 20 61 72 65 61 20  |here is an area |
00000440  73 65 74 20 61 73 69 64  65 20 74 6f 20 73 74 6f  |set aside to sto|
00000450  72 65 20 74 68 65 20 63  6f 6c 6f 75 72 20 6f 66  |re the colour of|
00000460  20 65 76 65 72 79 20 70  69 78 65 6c 20 6f 6e 20  | every pixel on |
00000470  74 68 65 0d 0a 73 63 72  65 65 6e 2c 20 61 6e 64  |the..screen, and|
00000480  20 77 68 65 6e 20 74 68  65 20 6d 6f 6e 69 74 6f  | when the monito|
00000490  72 20 72 65 71 75 65 73  74 73 20 74 68 65 20 63  |r requests the c|
000004a0  6f 6c 6f 75 72 20 6f 66  20 61 20 70 61 72 74 69  |olour of a parti|
000004b0  63 75 6c 61 72 20 70 69  78 65 6c 2c 20 74 68 65  |cular pixel, the|
000004c0  0d 0a 63 6f 6d 70 75 74  65 72 20 73 69 6d 70 6c  |..computer simpl|
000004d0  79 20 72 65 61 64 73 20  74 68 65 20 63 6f 6c 6f  |y reads the colo|
000004e0  75 72 20 6f 66 20 74 68  65 20 70 69 78 65 6c 20  |ur of the pixel |
000004f0  66 72 6f 6d 20 74 68 69  73 20 61 72 65 61 20 6f  |from this area o|
00000500  66 20 6d 65 6d 6f 72 79  2e 0d 0a 54 68 69 73 20  |f memory...This |
00000510  61 72 65 61 20 6f 66 20  6d 65 6d 6f 72 79 20 69  |area of memory i|
00000520  73 20 63 61 6c 6c 65 64  20 22 53 63 72 65 65 6e  |s called "Screen|
00000530  20 4d 65 6d 6f 72 79 22  2e 20 49 74 20 63 61 6e  | Memory". It can|
00000540  20 62 65 20 63 6f 6e 73  69 64 65 72 65 64 20 61  | be considered a|
00000550  73 20 61 0d 0a 73 6f 72  74 20 6f 66 20 67 69 61  |s a..sort of gia|
00000560  6e 74 20 74 61 62 6c 65  2c 20 68 6f 6c 64 69 6e  |nt table, holdin|
00000570  67 20 64 61 74 61 20 66  6f 72 20 74 68 65 20 63  |g data for the c|
00000580  6f 6c 6f 75 72 73 20 6f  66 20 61 6c 6c 20 6f 66  |olours of all of|
00000590  20 74 68 65 20 70 69 78  65 6c 73 20 69 6e 0d 0a  | the pixels in..|
000005a0  61 20 68 75 67 65 20 6d  61 74 72 69 78 20 6f 66  |a huge matrix of|
000005b0  20 6d 65 6d 6f 72 79 20  6c 6f 63 61 74 69 6f 6e  | memory location|
000005c0  73 2e 0d 0a 0d 0a 42 75  74 20 6f 66 20 77 68 61  |s.....But of wha|
000005d0  74 20 75 73 65 20 69 73  20 74 68 69 73 20 74 6f  |t use is this to|
000005e0  20 74 68 65 20 70 72 6f  67 72 61 6d 6d 65 72 20  | the programmer |
000005f0  79 6f 75 20 6d 69 67 68  74 20 62 65 20 77 6f 6e  |you might be won|
00000600  64 65 72 69 6e 67 2e 20  54 68 65 0d 0a 61 6e 73  |dering. The..ans|
00000610  77 65 72 20 69 73 20 74  68 61 74 20 77 68 65 6e  |wer is that when|
00000620  20 79 6f 75 20 75 73 65  20 75 73 65 72 20 64 65  | you use user de|
00000630  66 69 6e 65 64 20 63 68  61 72 61 63 74 65 72 73  |fined characters|
00000640  2c 20 4d 4f 56 45 20 61  6e 64 20 44 52 41 57 20  |, MOVE and DRAW |
00000650  63 6f 6d 6d 61 6e 64 73  2c 0d 0a 6f 72 20 61 6e  |commands,..or an|
00000660  79 20 6f 74 68 65 72 20  6d 65 74 68 6f 64 20 6f  |y other method o|
00000670  66 20 70 75 74 74 69 6e  67 20 61 6e 79 74 68 69  |f putting anythi|
00000680  6e 67 20 6f 6e 20 74 68  65 20 73 63 72 65 65 6e  |ng on the screen|
00000690  2c 20 74 68 65 20 63 6f  6d 70 75 74 65 72 20 73  |, the computer s|
000006a0  69 6d 70 6c 79 0d 0a 61  6c 74 65 72 73 20 61 20  |imply..alters a |
000006b0  66 65 77 20 76 61 6c 75  65 73 20 69 6e 20 74 68  |few values in th|
000006c0  69 73 20 67 69 61 6e 74  20 74 61 62 6c 65 2e 20  |is giant table. |
000006d0  42 75 74 20 74 68 65 20  63 6f 6d 70 75 74 65 72  |But the computer|
000006e0  20 74 61 6b 65 73 20 74  69 6d 65 20 74 6f 0d 0a  | takes time to..|
000006f0  70 72 6f 63 65 73 73 20  79 6f 75 72 20 4d 4f 56  |process your MOV|
00000700  45 20 61 6e 64 20 44 52  41 57 20 63 6f 6d 6d 61  |E and DRAW comma|
00000710  6e 64 73 20 74 6f 20 77  6f 72 6b 20 6f 75 74 20  |nds to work out |
00000720  77 68 69 63 68 20 76 61  6c 75 65 73 20 69 6e 20  |which values in |
00000730  74 68 65 20 74 61 62 6c  65 0d 0a 74 6f 20 61 6c  |the table..to al|
00000740  74 65 72 2e 20 49 66 20  79 6f 75 20 63 6f 75 6c  |ter. If you coul|
00000750  64 20 62 79 70 61 73 73  20 74 68 69 73 20 73 74  |d bypass this st|
00000760  61 67 65 2c 20 61 6e 64  20 73 65 74 20 74 68 65  |age, and set the|
00000770  20 76 61 6c 75 65 73 20  69 6e 20 74 68 69 73 20  | values in this |
00000780  67 69 61 6e 74 0d 0a 74  61 62 6c 65 20 79 6f 75  |giant..table you|
00000790  72 73 65 6c 66 20 77 69  74 68 6f 75 74 20 75 73  |rself without us|
000007a0  69 6e 67 20 74 68 65 20  63 6f 6d 70 75 74 65 72  |ing the computer|
000007b0  27 73 20 67 65 6e 65 72  61 6c 20 70 75 72 70 6f  |'s general purpo|
000007c0  73 65 20 67 72 61 70 68  69 63 73 0d 0a 63 6f 6d  |se graphics..com|
000007d0  6d 61 6e 64 73 2c 20 79  6f 75 20 63 61 6e 20 67  |mands, you can g|
000007e0  65 74 20 65 78 61 63 74  6c 79 20 74 68 65 20 72  |et exactly the r|
000007f0  65 73 75 6c 74 20 74 68  61 74 20 79 6f 75 20 77  |esult that you w|
00000800  61 6e 74 2c 20 61 6e 64  20 6d 75 63 68 20 66 61  |ant, and much fa|
00000810  73 74 65 72 0d 0a 74 68  61 6e 20 79 6f 75 20 77  |ster..than you w|
00000820  6f 75 6c 64 20 61 63 68  69 65 76 65 20 69 66 20  |ould achieve if |
00000830  79 6f 75 20 77 65 72 65  20 64 6f 69 6e 67 20 74  |you were doing t|
00000840  68 65 20 6f 70 65 72 61  74 69 6f 6e 20 74 68 72  |he operation thr|
00000850  6f 75 67 68 20 74 68 65  0d 0a 63 6f 6d 70 75 74  |ough the..comput|
00000860  65 72 27 73 20 63 6f 6d  6d 61 6e 64 73 2e 20 54  |er's commands. T|
00000870  68 65 73 65 20 68 61 76  65 20 74 6f 20 70 72 6f  |hese have to pro|
00000880  63 65 73 73 20 74 68 65  20 70 61 72 61 6d 65 74  |cess the paramet|
00000890  65 72 73 20 77 68 69 63  68 20 79 6f 75 20 67 69  |ers which you gi|
000008a0  76 65 2c 0d 0a 61 6e 64  20 74 68 65 6e 20 63 61  |ve,..and then ca|
000008b0  6c 63 75 6c 61 74 65 20  77 68 65 72 65 20 61 62  |lculate where ab|
000008c0  6f 75 74 73 20 69 6e 20  74 68 65 20 67 69 61 6e  |outs in the gian|
000008d0  74 20 74 61 62 6c 65 20  79 6f 75 20 77 61 6e 74  |t table you want|
000008e0  20 74 6f 20 61 6c 74 65  72 2c 0d 0a 62 65 66 6f  | to alter,..befo|
000008f0  72 65 20 74 68 65 79 20  63 61 6e 20 61 63 74 75  |re they can actu|
00000900  61 6c 6c 79 20 64 6f 20  61 6e 79 20 75 73 65 66  |ally do any usef|
00000910  75 6c 20 77 6f 72 6b 2e  20 54 68 75 73 20 61 20  |ul work. Thus a |
00000920  6c 6f 74 20 6f 66 20 63  6f 6d 70 75 74 65 72 20  |lot of computer |
00000930  74 69 6d 65 0d 0a 69 73  20 77 61 73 74 65 64 20  |time..is wasted |
00000940  69 6e 20 70 65 72 66 6f  72 6d 69 6e 67 20 63 61  |in performing ca|
00000950  6c 63 75 6c 61 74 69 6f  6e 73 2c 20 77 68 69 63  |lculations, whic|
00000960  68 20 63 61 6e 20 61 63  74 75 61 6c 6c 79 20 62  |h can actually b|
00000970  65 20 73 6b 69 70 70 65  64 20 69 66 20 74 68 65  |e skipped if the|
00000980  0d 0a 70 72 6f 67 72 61  6d 6d 65 72 20 69 73 20  |..programmer is |
00000990  63 61 72 65 66 75 6c 2e  0d 0a 0d 0a 54 68 65 72  |careful.....Ther|
000009a0  65 20 61 72 65 20 74 77  6f 20 70 6f 73 73 69 62  |e are two possib|
000009b0  6c 65 20 77 61 79 73 20  6f 66 20 61 63 68 69 65  |le ways of achie|
000009c0  76 69 6e 67 20 74 68 69  73 20 69 64 65 61 2c 20  |ving this idea, |
000009d0  62 6f 74 68 20 6f 66 20  77 68 69 63 68 20 61 72  |both of which ar|
000009e0  65 20 75 73 65 66 75 6c  0d 0a 69 6e 20 64 69 66  |e useful..in dif|
000009f0  66 65 72 65 6e 74 20 73  69 74 75 61 74 69 6f 6e  |ferent situation|
00000a00  73 3a 0d 0a 0d 0a 31 2e  20 53 61 76 65 20 73 63  |s:....1. Save sc|
00000a10  72 65 65 6e 20 6d 65 6d  6f 72 79 20 74 6f 20 64  |reen memory to d|
00000a20  69 73 63 2e 0d 0a 0d 0a  54 68 69 73 20 69 64 65  |isc.....This ide|
00000a30  61 20 69 73 20 66 61 69  72 6c 79 20 73 69 6d 70  |a is fairly simp|
00000a40  6c 65 20 74 6f 20 75 6e  64 65 72 73 74 61 6e 64  |le to understand|
00000a50  2e 20 59 6f 75 2c 20 61  73 20 74 68 65 20 70 72  |. You, as the pr|
00000a60  6f 67 72 61 6d 6d 65 72  2c 20 77 72 69 74 65 20  |ogrammer, write |
00000a70  61 0d 0a 70 72 6f 67 72  61 6d 20 74 6f 20 70 6c  |a..program to pl|
00000a80  6f 74 20 74 68 65 20 61  72 74 77 6f 72 6b 20 66  |ot the artwork f|
00000a90  6f 72 20 79 6f 75 72 20  70 72 6f 67 72 61 6d 20  |or your program |
00000aa0  6f 6e 74 6f 20 74 68 65  20 73 63 72 65 65 6e 2c  |onto the screen,|
00000ab0  20 74 61 6b 69 6e 67 0d  0a 68 6f 77 65 76 65 72  | taking..however|
00000ac0  20 6d 61 6e 79 20 68 6f  75 72 73 20 69 74 20 6d  | many hours it m|
00000ad0  61 79 20 74 61 6b 65 20  74 6f 20 63 6f 6d 70 6c  |ay take to compl|
00000ae0  65 74 65 20 61 6c 6c 20  6f 66 20 74 68 65 20 63  |ete all of the c|
00000af0  61 6c 63 75 6c 61 74 69  6f 6e 73 0d 0a 72 65 71  |alculations..req|
00000b00  75 69 72 65 64 20 74 6f  20 70 6c 6f 74 20 74 68  |uired to plot th|
00000b10  65 20 67 72 61 70 68 69  63 73 2e 20 59 6f 75 20  |e graphics. You |
00000b20  72 75 6e 20 74 68 69 73  20 70 72 6f 67 72 61 6d  |run this program|
00000b30  20 6f 6e 63 65 20 6f 6e  20 79 6f 75 72 20 63 6f  | once on your co|
00000b40  6d 70 75 74 65 72 2c 0d  0a 73 6f 20 74 68 61 74  |mputer,..so that|
00000b50  20 79 6f 75 72 20 6d 61  73 74 65 72 70 69 65 63  | your masterpiec|
00000b60  65 20 69 73 20 73 74 6f  72 65 64 20 69 6e 20 74  |e is stored in t|
00000b70  68 65 20 73 63 72 65 65  6e 20 6d 65 6d 6f 72 79  |he screen memory|
00000b80  20 6f 66 20 79 6f 75 72  20 63 6f 6d 70 75 74 65  | of your compute|
00000b90  72 0d 0a 28 69 65 2e 20  69 73 20 6f 6e 20 74 68  |r..(ie. is on th|
00000ba0  65 20 6d 6f 6e 69 74 6f  72 20 6f 66 20 79 6f 75  |e monitor of you|
00000bb0  72 20 63 6f 6d 70 75 74  65 72 29 2e 20 59 6f 75  |r computer). You|
00000bc0  20 74 68 61 6e 20 74 72  61 6e 73 66 65 72 20 74  | than transfer t|
00000bd0  68 65 20 65 6e 74 69 72  65 0d 0a 63 6f 6e 74 65  |he entire..conte|
00000be0  6e 74 73 20 6f 66 20 74  68 65 20 73 63 72 65 65  |nts of the scree|
00000bf0  6e 20 6d 65 6d 6f 72 79  20 6f 6e 20 79 6f 75 72  |n memory on your|
00000c00  20 63 6f 6d 70 75 74 65  72 20 74 6f 20 66 6c 6f  | computer to flo|
00000c10  70 70 79 20 64 69 73 63  2e 0d 0a 0d 0a 54 68 65  |ppy disc.....The|
00000c20  6e 2c 20 69 6e 20 74 68  65 20 66 69 6e 61 6c 20  |n, in the final |
00000c30  70 72 6f 67 72 61 6d 20  77 68 69 63 68 20 79 6f  |program which yo|
00000c40  75 20 77 61 6e 74 20 74  68 65 20 75 73 65 72 20  |u want the user |
00000c50  74 6f 20 6f 70 65 72 61  74 65 2c 20 79 6f 75 20  |to operate, you |
00000c60  69 6e 63 6c 75 64 65 0d  0a 61 20 63 6f 6d 6d 61  |include..a comma|
00000c70  6e 64 20 74 6f 20 6c 6f  61 64 20 74 68 69 73 20  |nd to load this |
00000c80  64 61 74 61 20 62 61 63  6b 20 66 72 6f 6d 20 66  |data back from f|
00000c90  6c 6f 70 70 79 20 64 69  73 63 20 69 6e 74 6f 20  |loppy disc into |
00000ca0  74 68 65 20 73 63 72 65  65 6e 20 6d 65 6d 6f 72  |the screen memor|
00000cb0  79 0d 0a 6f 66 20 74 68  65 69 72 20 63 6f 6d 70  |y..of their comp|
00000cc0  75 74 65 72 2e 20 49 6e  20 61 20 6d 61 74 74 65  |uter. In a matte|
00000cd0  72 20 6f 66 20 61 20 63  6f 75 70 6c 65 20 6f 66  |r of a couple of|
00000ce0  20 73 65 63 6f 6e 64 73  2c 20 67 72 61 70 68 69  | seconds, graphi|
00000cf0  63 73 20 77 68 69 63 68  20 74 6f 6f 6b 0d 0a 70  |cs which took..p|
00000d00  6f 73 73 69 62 6c 65 20  68 6f 75 72 73 20 74 6f  |ossible hours to|
00000d10  20 63 61 6c 63 75 6c 61  74 65 20 77 69 6c 6c 20  | calculate will |
00000d20  61 70 70 65 61 72 20 6f  6e 20 74 68 65 69 72 20  |appear on their |
00000d30  73 63 72 65 65 6e 2e 20  54 68 69 73 20 69 73 20  |screen. This is |
00000d40  61 0d 0a 74 65 63 68 6e  69 71 75 65 20 77 68 69  |a..technique whi|
00000d50  63 68 20 49 20 68 61 76  65 20 75 73 65 64 20 69  |ch I have used i|
00000d60  6e 20 73 65 76 65 72 61  6c 20 6f 66 20 6d 79 20  |n several of my |
00000d70  70 72 6f 67 72 61 6d 73  2e 20 54 68 65 20 6d 61  |programs. The ma|
00000d80  69 6e 20 6d 65 6e 75 20  6f 66 0d 0a 53 68 69 70  |in menu of..Ship|
00000d90  77 72 65 63 6b 65 64 20  49 49 3a 20 4a 75 70 69  |wrecked II: Jupi|
00000da0  74 65 72 20 33 2c 20 77  68 65 72 65 20 79 6f 75  |ter 3, where you|
00000db0  20 73 65 6c 65 63 74 20  50 6c 61 79 2c 20 49 6e  | select Play, In|
00000dc0  73 74 72 75 63 74 69 6f  6e 73 2c 20 47 61 6d 65  |structions, Game|
00000dd0  0d 0a 43 6f 6d 70 6c 65  74 65 20 6f 72 20 43 68  |..Complete or Ch|
00000de0  65 61 74 20 77 69 74 68  20 74 68 65 20 73 74 61  |eat with the sta|
00000df0  72 66 69 65 6c 64 20 62  61 63 6b 64 72 6f 70 20  |rfield backdrop |
00000e00  77 61 73 20 64 6f 6e 65  20 69 6e 20 74 68 69 73  |was done in this|
00000e10  20 77 61 79 20 2d 20 74  68 65 0d 0a 73 63 72 65  | way - the..scre|
00000e20  65 6e 20 74 6f 6f 6b 20  6e 65 61 72 6c 79 20 61  |en took nearly a|
00000e30  6e 20 68 6f 75 72 20 66  6f 72 20 6d 79 20 63 6f  |n hour for my co|
00000e40  6d 70 75 74 65 72 20 74  6f 20 63 61 6c 63 75 6c  |mputer to calcul|
00000e50  61 74 65 2c 20 62 75 74  20 49 20 77 61 73 20 61  |ate, but I was a|
00000e60  62 6c 65 0d 0a 74 6f 20  6d 61 6b 65 20 69 74 20  |ble..to make it |
00000e70  61 70 70 65 61 72 20 69  6e 20 73 65 63 6f 6e 64  |appear in second|
00000e80  73 20 6f 6e 20 79 6f 75  72 20 73 63 72 65 65 6e  |s on your screen|
00000e90  2e 20 49 20 73 68 6f 75  6c 64 20 61 6c 73 6f 20  |. I should also |
00000ea0  6d 65 6e 74 69 6f 6e 20  74 68 65 20 74 69 74 6c  |mention the titl|
00000eb0  65 0d 0a 73 63 72 65 65  6e 20 74 6f 20 53 68 69  |e..screen to Shi|
00000ec0  70 77 72 65 63 6b 20 77  69 74 68 20 74 68 65 20  |pwreck with the |
00000ed0  61 6e 69 6d 61 74 65 64  20 73 65 61 2c 20 6e 6f  |animated sea, no|
00000ee0  74 20 74 6f 20 6d 65 6e  74 69 6f 6e 20 74 68 65  |t to mention the|
00000ef0  20 65 6e 64 6c 65 73 73  20 45 55 47 0d 0a 74 69  | endless EUG..ti|
00000f00  74 6c 65 20 73 63 72 65  65 6e 73 20 49 20 68 61  |tle screens I ha|
00000f10  76 65 20 64 6f 6e 65 20  69 6e 20 74 68 69 73 20  |ve done in this |
00000f20  77 61 79 20 2d 20 74 68  65 20 43 68 72 69 73 74  |way - the Christ|
00000f30  6d 61 73 20 45 55 47 20  33 35 20 73 63 72 65 65  |mas EUG 35 scree|
00000f40  6e 20 77 69 74 68 0d 0a  74 68 65 20 73 77 69 72  |n with..the swir|
00000f50  6c 79 20 62 6c 75 65 20  62 61 63 6b 67 72 6f 75  |ly blue backgrou|
00000f60  6e 64 20 28 63 72 65 64  69 74 65 64 20 65 72 72  |nd (credited err|
00000f70  6f 6e 65 6f 75 73 6c 79  20 74 6f 20 52 6f 62 65  |oneously to Robe|
00000f80  72 74 20 53 70 72 6f 77  73 6f 6e 29 20 74 6f 6f  |rt Sprowson) too|
00000f90  6b 0d 0a 74 77 6f 20 77  68 6f 6c 65 20 64 61 79  |k..two whole day|
00000fa0  73 20 74 6f 20 70 6c 6f  74 21 0d 0a 0d 0a 49 6e  |s to plot!....In|
00000fb0  20 6f 72 64 65 72 20 74  6f 20 61 63 68 69 65 76  | order to achiev|
00000fc0  65 20 74 68 69 73 2c 20  79 6f 75 20 73 69 6d 70  |e this, you simp|
00000fd0  6c 79 20 6e 65 65 64 20  74 6f 20 75 6e 64 65 72  |ly need to under|
00000fe0  73 74 61 6e 64 20 74 77  6f 20 42 41 53 49 43 20  |stand two BASIC |
00000ff0  63 6f 6d 6d 61 6e 64 73  3a 0d 0a 0d 0a 2a 53 41  |commands:....*SA|
00001000  56 45 20 46 69 6c 65 6e  61 6d 65 20 6e 6e 6e 6e  |VE Filename nnnn|
00001010  20 6d 6d 6d 6d 0d 0a 2a  4c 4f 41 44 20 46 69 6c  | mmmm..*LOAD Fil|
00001020  65 6e 61 6d 65 20 6e 6e  6e 6e 0d 0a 0d 0a 54 68  |ename nnnn....Th|
00001030  65 73 65 20 6c 6f 61 64  20 61 6e 64 20 73 61 76  |ese load and sav|
00001040  65 20 61 72 65 61 73 20  6f 66 20 74 68 65 20 63  |e areas of the c|
00001050  6f 6d 70 75 74 65 72 27  73 20 6d 65 6d 6f 72 79  |omputer's memory|
00001060  20 74 6f 20 66 6c 6f 70  70 79 20 64 69 73 63 20  | to floppy disc |
00001070  6f 72 20 63 61 73 73 65  74 74 65 0d 0a 77 69 74  |or cassette..wit|
00001080  68 20 74 68 65 20 66 69  6c 65 6e 61 6d 65 20 67  |h the filename g|
00001090  69 76 61 6e 20 69 6e 20  70 6c 61 63 65 20 6f 66  |ivan in place of|
000010a0  20 74 68 65 20 77 6f 72  6b 20 46 69 6c 65 6e 61  | the work Filena|
000010b0  6d 65 2c 20 73 74 61 72  74 69 6e 67 20 61 74 20  |me, starting at |
000010c0  6d 65 6d 6f 72 79 0d 0a  6c 6f 63 61 74 69 6f 6e  |memory..location|
000010d0  20 6e 6e 6e 6e 2c 20 61  6e 64 20 63 6f 6e 74 69  | nnnn, and conti|
000010e0  6e 75 69 6e 67 20 75 6e  74 69 6c 20 6d 65 6d 6f  |nuing until memo|
000010f0  72 79 20 6c 6f 63 61 74  69 6f 6e 20 6d 6d 6d 6d  |ry location mmmm|
00001100  20 28 77 68 65 72 65 20  6e 6e 6e 6e 20 61 6e 64  | (where nnnn and|
00001110  20 6d 6d 6d 6d 0d 0a 61  72 65 20 62 6f 74 68 20  | mmmm..are both |
00001120  69 6e 20 68 65 78 69 64  65 63 69 6d 61 6c 20 2d  |in hexidecimal -|
00001130  20 62 61 73 65 20 31 36  29 2e 20 44 6f 6e 27 74  | base 16). Don't|
00001140  20 77 6f 72 72 79 20 69  66 20 79 6f 75 20 64 6f  | worry if you do|
00001150  6e 27 74 20 65 6e 74 69  72 65 6c 79 0d 0a 75 6e  |n't entirely..un|
00001160  64 65 72 73 74 61 6e 64  20 74 68 69 73 20 2d 20  |derstand this - |
00001170  69 74 20 69 73 20 6e 6f  74 20 6e 65 63 65 73 73  |it is not necess|
00001180  61 72 79 20 74 6f 20 65  6e 74 69 72 65 6c 79 20  |ary to entirely |
00001190  75 6e 64 65 72 73 74 61  6e 64 20 74 68 65 20 77  |understand the w|
000011a0  6f 72 6b 69 6e 67 73 0d  0a 6f 66 20 74 68 65 73  |orkings..of thes|
000011b0  65 20 63 6f 6d 6d 61 6e  64 73 2c 20 6f 72 20 6f  |e commands, or o|
000011c0  66 20 68 65 78 69 64 65  63 69 6d 61 6c 20 74 6f  |f hexidecimal to|
000011d0  20 75 73 65 20 74 68 65  6d 20 74 6f 20 73 74 6f  | use them to sto|
000011e0  72 65 20 61 6e 64 20 72  65 74 72 69 65 76 65 0d  |re and retrieve.|
000011f0  0a 73 63 72 65 65 6e 20  6d 65 6d 6f 72 79 2e 20  |.screen memory. |
00001200  41 6c 6c 20 79 6f 75 20  6e 65 65 64 20 74 6f 20  |All you need to |
00001210  64 6f 20 69 73 20 73 75  62 73 74 69 74 75 74 65  |do is substitute|
00001220  20 6e 6e 6e 6e 20 61 6e  64 20 6d 6d 6d 6d 20 66  | nnnn and mmmm f|
00001230  6f 72 20 74 68 65 0d 0a  61 64 64 72 65 73 73 65  |or the..addresse|
00001240  73 20 6f 66 20 74 68 65  20 73 74 61 72 74 20 61  |s of the start a|
00001250  6e 64 20 66 69 6e 69 73  68 20 6f 66 20 73 63 72  |nd finish of scr|
00001260  65 65 6e 20 6d 65 6d 6f  72 79 2e 20 54 68 65 20  |een memory. The |
00001270  6c 6f 63 61 74 69 6f 6e  20 6f 66 20 74 68 65 73  |location of thes|
00001280  65 0d 0a 77 69 74 68 69  6e 20 79 6f 75 72 20 63  |e..within your c|
00001290  6f 6d 70 75 74 65 72 20  76 61 72 69 65 73 20 64  |omputer varies d|
000012a0  65 70 65 64 69 6e 67 20  75 70 6f 6e 20 77 68 69  |epeding upon whi|
000012b0  63 68 20 67 72 61 70 68  69 63 73 20 6d 6f 64 65  |ch graphics mode|
000012c0  20 79 6f 75 20 61 72 65  20 75 73 69 6e 67 0d 0a  | you are using..|
000012d0  28 77 68 69 63 68 20 79  6f 75 20 73 65 6c 65 63  |(which you selec|
000012e0  74 65 64 20 75 73 69 6e  67 20 74 68 65 20 4d 4f  |ted using the MO|
000012f0  44 45 20 63 6f 6d 6d 61  6e 64 20 2d 20 73 65 65  |DE command - see|
00001300  20 70 72 65 76 69 6f 75  73 20 74 75 74 6f 72 69  | previous tutori|
00001310  61 6c 20 69 66 20 79 6f  75 0d 0a 61 72 65 20 75  |al if you..are u|
00001320  6e 73 75 72 65 20 6f 66  20 77 68 61 74 20 74 68  |nsure of what th|
00001330  69 73 20 69 73 29 2c 20  62 75 74 20 69 73 20 61  |is is), but is a|
00001340  6c 77 61 79 73 20 63 6f  6e 73 74 61 6e 74 20 66  |lways constant f|
00001350  6f 72 20 61 6e 79 20 70  61 72 74 69 63 75 6c 61  |or any particula|
00001360  72 0d 0a 6d 6f 64 65 2e  20 74 68 65 20 76 61 6c  |r..mode. the val|
00001370  75 65 73 20 66 6f 72 20  74 68 65 20 64 69 66 66  |ues for the diff|
00001380  65 72 65 6e 74 20 6d 6f  64 65 73 20 61 72 65 20  |erent modes are |
00001390  67 69 76 65 6e 20 62 65  6c 6f 77 3a 0d 0a 0d 0a  |given below:....|
000013a0  4d 6f 64 65 20 20 20 20  20 20 20 20 20 20 20 20  |Mode            |
000013b0  6e 6e 6e 6e 20 20 20 20  6d 6d 6d 6d 20 20 20 4e  |nnnn    mmmm   N|
000013c0  4f 54 45 53 3a 0d 0a 30  20 20 20 20 20 20 20 20  |OTES:..0        |
000013d0  20 20 20 20 20 20 20 33  30 30 30 20 20 20 20 37  |       3000    7|
000013e0  46 46 46 0d 0a 31 20 20  20 20 20 20 20 20 20 20  |FFF..1          |
000013f0  20 20 20 20 20 33 30 30  30 20 20 20 20 37 46 46  |     3000    7FF|
00001400  46 20 20 20 2d 20 6e 6e  6e 6e 20 61 6e 64 20 6d  |F   - nnnn and m|
00001410  6d 6d 6d 20 76 61 6c 75  65 73 20 67 69 76 65 6e  |mmm values given|
00001420  20 74 6f 20 74 68 65 20  6c 65 66 74 20 61 72 65  | to the left are|
00001430  0d 0a 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |..2             |
00001440  20 20 33 30 30 30 20 20  20 20 37 46 46 46 20 20  |  3000    7FFF  |
00001450  20 61 6c 6c 20 69 6e 20  68 65 78 69 64 65 63 69  | all in hexideci|
00001460  6d 61 6c 2e 20 54 68 65  72 65 66 6f 72 65 20 74  |mal. Therefore t|
00001470  68 65 79 20 63 61 6e 20  62 65 0d 0a 33 20 20 20  |hey can be..3   |
00001480  20 20 20 20 20 20 20 20  20 20 20 20 34 30 30 30  |            4000|
00001490  20 20 20 20 37 46 46 46  20 20 20 73 75 62 73 74  |    7FFF   subst|
000014a0  69 74 75 74 65 64 20 64  69 72 65 63 74 6c 79 20  |ituted directly |
000014b0  69 6e 74 6f 20 74 68 65  20 2a 4c 4f 41 44 20 61  |into the *LOAD a|
000014c0  6e 64 20 2a 53 41 56 45  0d 0a 34 20 20 20 20 20  |nd *SAVE..4     |
000014d0  20 20 20 20 20 20 20 20  20 20 35 38 30 30 20 20  |          5800  |
000014e0  20 20 37 46 46 46 20 20  20 63 6f 6d 6d 61 6e 64  |  7FFF   command|
000014f0  73 20 77 69 74 68 20 6e  6f 20 63 6f 6e 76 65 72  |s with no conver|
00001500  73 69 6f 6e 20 72 65 71  75 69 72 65 64 2e 0d 0a  |sion required...|
00001510  35 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |5               |
00001520  35 38 30 30 20 20 20 20  37 46 46 46 0d 0a 36 20  |5800    7FFF..6 |
00001530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 36 30  |              60|
00001540  30 30 20 20 20 20 37 46  46 46 20 20 20 2d 20 56  |00    7FFF   - V|
00001550  61 6c 75 65 73 20 61 72  65 20 6e 6f 74 20 76 61  |alues are not va|
00001560  6c 69 64 20 66 6f 72 20  74 68 65 20 42 42 43 20  |lid for the BBC |
00001570  6d 6f 64 65 6c 20 41 20  69 6e 0d 0a 37 20 20 20  |model A in..7   |
00001580  20 20 20 20 20 20 20 20  20 20 20 20 37 43 30 30  |            7C00|
00001590  20 20 20 20 37 46 46 46  20 20 20 6d 6f 64 65 73  |    7FFF   modes|
000015a0  20 34 2c 35 2c 36 20 6f  72 20 37 2e 0d 0a 0d 0a  | 4,5,6 or 7.....|
000015b0  45 78 61 6d 70 6c 65 73  3a 0d 0a 0d 0a 53 75 70  |Examples:....Sup|
000015c0  70 6f 73 65 20 79 6f 75  20 61 72 65 20 69 6e 20  |pose you are in |
000015d0  6d 6f 64 65 20 32 2c 20  61 6e 64 20 77 61 6e 74  |mode 2, and want|
000015e0  20 74 6f 20 73 74 6f 72  65 20 74 68 65 20 73 63  | to store the sc|
000015f0  72 65 65 6e 20 74 6f 20  61 20 66 6c 6f 70 70 79  |reen to a floppy|
00001600  2e 20 46 72 6f 6d 0d 0a  74 68 65 20 74 61 62 6c  |. From..the tabl|
00001610  65 20 61 62 6f 76 65 2c  20 6e 6e 6e 6e 20 69 73  |e above, nnnn is|
00001620  20 33 30 30 30 20 61 6e  64 20 6d 6d 6d 6d 20 69  | 3000 and mmmm i|
00001630  73 20 37 46 46 46 20 66  6f 72 20 6d 6f 64 65 20  |s 7FFF for mode |
00001640  32 2e 20 54 68 65 72 65  66 6f 72 65 2c 20 74 6f  |2. Therefore, to|
00001650  0d 0a 73 61 76 65 20 74  68 65 20 73 63 72 65 65  |..save the scree|
00001660  6e 20 75 6e 64 65 72 20  74 68 65 20 66 69 6c 65  |n under the file|
00001670  6e 61 6d 65 20 22 53 63  72 65 65 6e 22 2c 20 79  |name "Screen", y|
00001680  6f 75 20 77 6f 75 6c 64  20 74 79 70 65 3a 0d 0a  |ou would type:..|
00001690  0d 0a 2a 53 41 56 45 20  53 63 72 65 65 6e 20 33  |..*SAVE Screen 3|
000016a0  30 30 30 20 37 46 46 46  0d 0a 0d 0a 4e 6f 77 2c  |000 7FFF....Now,|
000016b0  20 69 66 20 79 6f 75 20  77 61 6e 74 20 74 6f 20  | if you want to |
000016c0  72 65 73 74 6f 72 65 20  74 68 65 20 73 63 72 65  |restore the scre|
000016d0  65 6e 20 61 67 61 69 6e  2c 20 61 6e 64 20 70 75  |en again, and pu|
000016e0  74 20 79 6f 75 72 20 67  72 61 70 68 69 63 73 20  |t your graphics |
000016f0  62 61 63 6b 0d 0a 6f 6e  20 74 68 65 20 73 63 72  |back..on the scr|
00001700  65 65 6e 20 61 67 61 69  6e 2c 20 79 6f 75 20 77  |een again, you w|
00001710  6f 75 6c 64 20 75 73 65  20 2a 4c 4f 41 44 2e 20  |ould use *LOAD. |
00001720  4e 6f 74 69 63 65 20 74  68 61 74 20 74 68 69 73  |Notice that this|
00001730  20 74 69 6d 65 20 6f 6e  6c 79 20 61 0d 0a 76 61  | time only a..va|
00001740  6c 75 65 20 66 6f 72 20  6e 6e 6e 6e 20 69 73 20  |lue for nnnn is |
00001750  72 65 71 75 69 72 65 64  2c 20 61 6e 64 20 6e 6f  |required, and no|
00001760  74 20 66 6f 72 20 6d 6d  6d 6d 3a 0d 0a 0d 0a 2a  |t for mmmm:....*|
00001770  4c 4f 41 44 20 53 63 72  65 65 6e 20 33 30 30 30  |LOAD Screen 3000|
00001780  0d 0a 0d 0a 59 6f 75 20  63 61 6e 20 74 72 79 20  |....You can try |
00001790  74 68 69 73 20 6f 75 74  20 6e 6f 77 2c 20 69 66  |this out now, if|
000017a0  20 79 6f 75 20 73 77 69  74 63 68 20 6f 6e 20 79  | you switch on y|
000017b0  6f 75 72 20 45 6c 65 63  74 72 6f 6e 2c 20 61 6e  |our Electron, an|
000017c0  64 20 69 6e 73 65 72 74  20 61 20 77 6f 72 6b 0d  |d insert a work.|
000017d0  0a 64 69 73 63 20 69 6e  74 6f 20 79 6f 75 72 20  |.disc into your |
000017e0  66 6c 6f 70 70 79 20 64  72 69 76 65 2e 20 49 66  |floppy drive. If|
000017f0  20 79 6f 75 20 75 73 65  20 41 44 46 53 2c 20 79  | you use ADFS, y|
00001800  6f 75 20 6d 61 79 20 6e  65 65 64 20 74 6f 20 75  |ou may need to u|
00001810  73 65 20 2a 4d 4f 55 4e  54 0d 0a 74 6f 20 73 65  |se *MOUNT..to se|
00001820  6c 65 63 74 20 74 68 65  20 66 6c 6f 70 70 79 20  |lect the floppy |
00001830  64 69 73 63 2c 20 61 6e  64 20 62 65 20 61 62 6c  |disc, and be abl|
00001840  65 20 74 6f 20 77 72 69  74 65 20 74 6f 20 69 74  |e to write to it|
00001850  2e 20 4e 6f 77 20 65 6e  74 65 72 20 6d 6f 64 65  |. Now enter mode|
00001860  20 32 0d 0a 62 79 20 74  79 70 69 6e 67 3a 0d 0a  | 2..by typing:..|
00001870  0d 0a 4d 4f 44 45 20 32  0d 0a 0d 0a 4e 6f 77 20  |..MODE 2....Now |
00001880  74 79 70 65 20 73 6f 6d  65 20 74 65 78 74 20 6f  |type some text o|
00001890  6e 20 74 68 65 20 73 63  72 65 65 6e 20 77 68 69  |n the screen whi|
000018a0  63 68 20 77 69 6c 6c 20  72 65 70 72 65 73 65 6e  |ch will represen|
000018b0  74 20 74 68 65 20 67 72  61 70 68 69 63 73 20 77  |t the graphics w|
000018c0  68 69 63 68 0d 0a 79 6f  75 20 77 61 6e 74 20 74  |hich..you want t|
000018d0  6f 20 73 61 76 65 2e 20  57 68 65 6e 20 79 6f 75  |o save. When you|
000018e0  20 68 61 76 65 20 66 69  6e 69 73 68 65 64 2c 20  | have finished, |
000018f0  73 61 76 65 20 74 68 65  20 63 6f 6e 74 65 6e 74  |save the content|
00001900  73 20 6f 66 20 73 63 72  65 65 6e 20 6d 65 6d 6f  |s of screen memo|
00001910  72 79 0d 0a 74 6f 20 66  6c 6f 70 70 79 20 64 69  |ry..to floppy di|
00001920  73 6b 20 61 73 20 73 68  6f 77 6e 20 61 62 6f 76  |sk as shown abov|
00001930  65 2c 20 62 79 20 74 79  70 69 6e 67 3a 0d 0a 0d  |e, by typing:...|
00001940  0a 2a 53 41 56 45 20 53  63 72 65 65 6e 20 33 30  |.*SAVE Screen 30|
00001950  30 30 20 37 46 46 46 0d  0a 0d 0a 57 68 65 6e 20  |00 7FFF....When |
00001960  74 68 65 20 64 69 73 6b  20 64 72 69 76 65 20 68  |the disk drive h|
00001970  61 73 20 66 69 6e 69 73  68 65 64 2c 20 63 6c 65  |as finished, cle|
00001980  61 72 20 74 68 65 20 74  65 78 74 20 6f 66 66 20  |ar the text off |
00001990  74 68 65 20 73 63 72 65  65 6e 20 62 79 20 74 79  |the screen by ty|
000019a0  70 69 6e 67 3a 0d 0a 0d  0a 43 4c 53 0d 0a 0d 0a  |ping:....CLS....|
000019b0  54 68 65 20 74 65 78 74  20 77 68 69 63 68 20 79  |The text which y|
000019c0  6f 75 20 74 79 70 65 64  20 6f 6e 74 6f 20 74 68  |ou typed onto th|
000019d0  65 20 73 63 72 65 65 6e  20 68 61 73 20 6e 6f 77  |e screen has now|
000019e0  20 62 65 65 6e 20 77 69  70 65 64 20 66 72 6f 6d  | been wiped from|
000019f0  20 74 68 65 0d 0a 63 6f  6d 70 75 74 65 72 27 73  | the..computer's|
00001a00  20 6d 65 6d 6f 72 79 2c  20 62 75 74 20 73 68 6f  | memory, but sho|
00001a10  75 6c 64 20 73 74 69 6c  6c 20 62 65 20 73 74 6f  |uld still be sto|
00001a20  72 65 64 20 6f 6e 20 74  68 65 20 66 6c 6f 70 70  |red on the flopp|
00001a30  79 20 64 69 73 63 2e 20  57 65 20 63 61 6e 0d 0a  |y disc. We can..|
00001a40  73 68 6f 77 20 74 68 61  74 20 74 68 69 73 20 69  |show that this i|
00001a50  73 20 73 6f 20 62 79 20  74 79 70 69 6e 67 3a 0d  |s so by typing:.|
00001a60  0a 0d 0a 2a 4c 4f 41 44  20 53 63 72 65 65 6e 20  |...*LOAD Screen |
00001a70  33 30 30 30 0d 0a 0d 0a  59 6f 75 72 20 74 65 78  |3000....Your tex|
00001a80  74 20 73 68 6f 75 6c 64  20 6e 6f 77 20 72 65 61  |t should now rea|
00001a90  70 70 65 61 72 20 6f 6e  20 74 68 65 20 73 63 72  |ppear on the scr|
00001aa0  65 65 6e 2e 20 59 6f 75  20 63 61 6e 20 72 65 70  |een. You can rep|
00001ab0  65 61 74 20 74 68 69 73  20 77 69 74 68 20 61 6e  |eat this with an|
00001ac0  79 0d 0a 6b 69 6e 64 20  6f 66 20 63 6f 6d 70 6c  |y..kind of compl|
00001ad0  65 78 20 67 72 61 70 68  69 63 73 20 6f 6e 20 73  |ex graphics on s|
00001ae0  63 72 65 65 6e 2c 20 61  6e 64 20 69 74 20 77 69  |creen, and it wi|
00001af0  6c 6c 20 73 74 69 6c 6c  20 77 6f 72 6b 2e 20 54  |ll still work. T|
00001b00  68 65 20 73 61 6d 65 20  63 61 6e 0d 0a 62 65 20  |he same can..be |
00001b10  64 6f 6e 65 20 69 6e 20  61 6e 79 20 6f 74 68 65  |done in any othe|
00001b20  72 20 67 72 61 70 68 69  63 73 20 6d 6f 64 65 2c  |r graphics mode,|
00001b30  20 73 69 6d 70 6c 79 20  62 79 20 63 68 61 6e 67  | simply by chang|
00001b40  69 6e 67 20 74 68 65 20  76 61 6c 75 65 73 20 6f  |ing the values o|
00001b50  66 20 6e 6e 6e 6e 0d 0a  61 6e 64 20 6d 6d 6d 6d  |f nnnn..and mmmm|
00001b60  20 74 6f 20 74 68 6f 73  65 20 67 69 76 65 6e 20  | to those given |
00001b70  69 6e 20 74 68 65 20 74  61 62 6c 65 20 61 62 6f  |in the table abo|
00001b80  76 65 2e 20 46 6f 72 20  65 78 61 6d 70 6c 65 20  |ve. For example |
00001b90  69 6e 20 6d 6f 64 65 20  35 20 79 6f 75 0d 0a 77  |in mode 5 you..w|
00001ba0  6f 75 6c 64 20 75 73 65  3a 0d 0a 0d 0a 2a 53 41  |ould use:....*SA|
00001bb0  56 45 20 53 63 72 65 65  6e 20 35 38 30 30 20 37  |VE Screen 5800 7|
00001bc0  46 46 46 0d 0a 0d 0a 66  6f 6c 6c 6f 77 65 64 20  |FFF....followed |
00001bd0  62 79 3a 0d 0a 0d 0a 2a  4c 4f 41 44 20 53 63 72  |by:....*LOAD Scr|
00001be0  65 65 6e 20 35 38 30 30  20 37 46 46 46 0d 0a 0d  |een 5800 7FFF...|
00001bf0  0a 54 68 65 72 65 20 61  72 65 2c 20 68 6f 77 65  |.There are, howe|
00001c00  76 65 72 2c 20 61 20 66  65 77 20 70 72 65 63 61  |ver, a few preca|
00001c10  75 74 69 6f 6e 61 72 79  20 70 6f 69 6e 74 73 20  |utionary points |
00001c20  77 68 69 63 68 20 73 68  6f 75 6c 64 20 62 65 20  |which should be |
00001c30  6d 65 6e 74 69 6f 6e 65  64 0d 0a 61 62 6f 75 74  |mentioned..about|
00001c40  20 74 68 69 73 20 74 65  63 68 6e 69 71 75 65 20  | this technique |
00001c50  6f 66 20 73 61 76 69 6e  67 20 73 63 72 65 65 6e  |of saving screen|
00001c60  20 6d 65 6d 6f 72 79 3a  0d 0a 0d 0a 2d 20 41 73  | memory:....- As|
00001c70  20 79 6f 75 20 70 72 6f  62 61 62 6c 79 20 72 65  | you probably re|
00001c80  61 6c 69 73 65 2c 20 69  6e 20 66 6f 75 72 20 63  |alise, in four c|
00001c90  6f 6c 6f 75 72 20 6d 6f  64 65 73 2c 20 74 68 65  |olour modes, the|
00001ca0  20 66 6f 75 72 20 63 6f  6c 6f 75 72 73 20 79 6f  | four colours yo|
00001cb0  75 0d 0a 63 61 6e 20 75  73 65 20 63 61 6e 20 62  |u..can use can b|
00001cc0  65 20 63 68 61 6e 67 65  64 20 66 72 6f 6d 20 74  |e changed from t|
00001cd0  68 65 20 64 65 66 61 75  6c 74 20 62 6c 61 63 6b  |he default black|
00001ce0  2c 20 72 65 64 2c 20 79  65 6c 6c 6f 77 20 61 6e  |, red, yellow an|
00001cf0  64 20 77 68 69 74 65 20  62 79 0d 0a 75 73 69 6e  |d white by..usin|
00001d00  67 20 56 44 55 20 31 39  20 74 6f 20 63 68 61 6e  |g VDU 19 to chan|
00001d10  67 65 20 74 68 65 20 70  61 6c 65 74 74 65 2e 20  |ge the palette. |
00001d20  54 68 65 20 63 6f 6c 6f  75 72 73 20 69 6e 20 74  |The colours in t|
00001d30  68 65 20 70 61 6c 65 74  74 65 20 61 72 65 20 6e  |he palette are n|
00001d40  6f 74 0d 0a 73 61 76 65  64 20 77 68 65 6e 20 74  |ot..saved when t|
00001d50  68 69 73 20 74 65 63 68  6e 69 71 75 65 20 69 73  |his technique is|
00001d60  20 75 73 65 64 2c 20 61  6e 64 20 6d 75 73 74 20  | used, and must |
00001d70  62 65 20 72 65 73 74 6f  72 65 64 20 62 79 20 72  |be restored by r|
00001d80  65 70 65 61 74 69 6e 67  20 74 68 65 0d 0a 56 44  |epeating the..VD|
00001d90  55 20 31 39 20 63 6f 6d  6d 61 6e 64 73 20 61 67  |U 19 commands ag|
00001da0  61 69 6e 2e 20 49 66 20  79 6f 75 20 64 65 66 69  |ain. If you defi|
00001db0  6e 65 20 74 68 65 20 70  61 6c 65 74 74 65 20 74  |ne the palette t|
00001dc0  6f 2c 20 66 6f 72 20 65  78 61 6d 70 6c 65 2c 20  |o, for example, |
00001dd0  62 6c 61 63 6b 2c 0d 0a  62 6c 75 65 2c 20 63 79  |black,..blue, cy|
00001de0  61 6e 20 61 6e 64 20 77  68 69 74 65 2c 20 61 6e  |an and white, an|
00001df0  64 20 63 72 65 61 74 65  20 61 20 70 69 63 74 75  |d create a pictu|
00001e00  72 65 20 77 68 69 63 68  20 6c 6f 6f 6b 73 20 67  |re which looks g|
00001e10  6f 6f 64 20 69 6e 20 74  68 69 73 20 63 6f 6c 6f  |ood in this colo|
00001e20  75 72 0d 0a 73 63 68 65  6d 65 2c 20 79 6f 75 20  |ur..scheme, you |
00001e30  6d 75 73 74 20 72 65 6d  65 6d 62 65 72 20 74 68  |must remember th|
00001e40  61 74 20 75 6e 6c 65 73  73 20 79 6f 75 20 64 65  |at unless you de|
00001e50  66 69 6e 65 20 74 68 65  20 70 61 6c 65 74 74 65  |fine the palette|
00001e60  20 74 6f 20 74 68 65 73  65 20 66 6f 75 72 0d 0a  | to these four..|
00001e70  63 6f 6c 6f 75 72 73 20  62 65 66 6f 72 65 20 70  |colours before p|
00001e80  65 72 66 6f 72 6d 69 6e  67 20 2a 4c 4f 41 44 20  |erforming *LOAD |
00001e90  74 6f 20 72 65 73 74 6f  72 65 20 74 68 65 20 70  |to restore the p|
00001ea0  69 63 74 75 72 65 2c 20  69 74 20 6d 61 79 20 61  |icture, it may a|
00001eb0  70 70 65 61 72 0d 0a 72  61 74 68 65 72 20 6f 64  |ppear..rather od|
00001ec0  64 20 77 68 65 6e 20 72  65 6c 6f 61 64 65 64 2c  |d when reloaded,|
00001ed0  20 61 73 20 69 74 20 77  69 6c 6c 20 61 70 70 65  | as it will appe|
00001ee0  61 72 20 69 6e 20 62 6c  61 63 6b 2c 20 72 65 64  |ar in black, red|
00001ef0  2c 20 79 65 6c 6c 6f 77  20 61 6e 64 0d 0a 77 68  |, yellow and..wh|
00001f00  69 74 65 20 2d 20 74 68  65 20 64 65 66 61 75 6c  |ite - the defaul|
00001f10  74 20 63 6f 6c 6f 75 72  20 73 63 68 65 6d 65 2e  |t colour scheme.|
00001f20  0d 0a 0d 0a 2d 20 54 68  65 20 65 78 61 63 74 20  |....- The exact |
00001f30  72 65 61 73 6f 6e 20 77  68 79 20 74 68 69 73 20  |reason why this |
00001f40  68 61 70 70 65 6e 73 20  69 73 20 72 61 74 68 65  |happens is rathe|
00001f50  72 20 63 6f 6d 70 6c 69  63 61 74 65 64 2c 20 62  |r complicated, b|
00001f60  75 74 20 69 66 20 79 6f  75 20 61 6c 6c 6f 77 0d  |ut if you allow.|
00001f70  0a 74 68 65 20 63 75 72  73 6f 72 20 74 6f 20 67  |.the cursor to g|
00001f80  6f 20 64 6f 77 6e 20 6f  66 66 20 74 68 65 20 62  |o down off the b|
00001f90  6f 74 74 6f 6d 20 6c 69  6e 65 20 6f 66 20 74 68  |ottom line of th|
00001fa0  65 20 73 63 72 65 65 6e  2c 20 61 6e 64 20 61 6c  |e screen, and al|
00001fb0  6c 6f 77 20 74 68 65 20  73 63 72 65 65 6e 0d 0a  |low the screen..|
00001fc0  74 6f 20 73 63 72 6f 6c  6c 20 75 70 20 6f 6e 65  |to scroll up one|
00001fd0  20 6c 69 6e 65 2c 20 74  68 69 73 20 74 65 63 68  | line, this tech|
00001fe0  6e 69 71 75 65 20 73 74  6f 70 73 20 77 6f 72 6b  |nique stops work|
00001ff0  69 6e 67 20 75 6e 74 69  6c 20 79 6f 75 20 70 65  |ing until you pe|
00002000  72 66 6f 72 6d 20 61 0d  0a 4d 4f 44 45 20 63 6f  |rform a..MODE co|
00002010  6d 6d 61 6e 64 2c 20 6f  72 20 63 6c 65 61 72 20  |mmand, or clear |
00002020  74 68 65 20 73 63 72 65  65 6e 20 75 73 69 6e 67  |the screen using|
00002030  20 43 4c 53 2e 20 42 61  73 69 63 61 6c 6c 79 20  | CLS. Basically |
00002040  77 68 61 74 20 68 61 70  70 65 6e 73 20 69 73 20  |what happens is |
00002050  74 68 61 74 0d 0a 74 68  65 20 63 6f 6d 70 75 74  |that..the comput|
00002060  65 72 20 64 6f 65 73 20  6e 6f 74 20 70 68 79 73  |er does not phys|
00002070  69 63 61 6c 6c 79 20 6d  6f 76 65 20 65 76 65 72  |ically move ever|
00002080  79 20 6c 69 6e 65 20 6f  66 20 74 65 78 74 20 6f  |y line of text o|
00002090  6e 20 74 68 65 20 73 63  72 65 65 6e 20 75 70 0d  |n the screen up.|
000020a0  0a 6f 6e 65 20 6c 69 6e  65 2c 20 62 75 74 20 69  |.one line, but i|
000020b0  6e 73 74 65 61 64 20 6d  61 6b 65 73 20 61 20 6e  |nstead makes a n|
000020c0  6f 74 65 20 74 68 61 74  20 65 76 65 72 79 20 6c  |ote that every l|
000020d0  69 6e 65 20 69 6e 20 73  63 72 65 65 6e 20 6d 65  |ine in screen me|
000020e0  6d 6f 72 79 20 69 73 20  73 74 6f 72 65 64 0d 0a  |mory is stored..|
000020f0  6f 6e 65 20 6c 69 6e 65  20 6c 6f 77 65 72 20 74  |one line lower t|
00002100  68 61 6e 20 69 74 20 73  68 6f 75 6c 64 20 62 65  |han it should be|
00002110  2e 20 57 68 65 6e 20 79  6f 75 20 72 65 6c 6f 61  |. When you reloa|
00002120  64 20 66 72 6f 6d 20 64  69 73 6b 2c 20 74 68 69  |d from disk, thi|
00002130  73 20 6e 6f 74 65 20 69  73 0d 0a 6c 6f 73 74 2c  |s note is..lost,|
00002140  20 61 6e 64 20 74 68 65  20 63 6f 6d 70 75 74 65  | and the compute|
00002150  72 20 64 72 61 77 73 20  65 76 65 72 79 20 6c 69  |r draws every li|
00002160  6e 65 20 6c 6f 77 65 72  20 74 68 61 6e 20 69 74  |ne lower than it|
00002170  20 73 68 6f 75 6c 64 20  62 65 2e 20 45 61 63 68  | should be. Each|
00002180  20 74 69 6d 65 0d 0a 74  68 61 74 20 43 4c 53 20  | time..that CLS |
00002190  6f 72 20 4d 4f 44 45 20  69 73 20 65 78 65 63 75  |or MODE is execu|
000021a0  74 65 64 2c 20 73 63 72  65 65 6e 20 6d 65 6d 6f  |ted, screen memo|
000021b0  72 79 20 69 73 20 63 6c  65 61 72 65 64 20 61 6e  |ry is cleared an|
000021c0  64 20 72 65 69 6e 69 74  69 61 74 65 64 2c 20 73  |d reinitiated, s|
000021d0  6f 0d 0a 74 68 61 74 20  65 76 65 72 79 20 6c 69  |o..that every li|
000021e0  6e 65 20 69 73 20 73 74  6f 72 65 64 20 69 6e 20  |ne is stored in |
000021f0  6d 65 6d 6f 72 79 20 77  68 65 72 65 20 79 6f 75  |memory where you|
00002200  20 77 6f 75 6c 64 20 65  78 70 65 63 74 20 69 74  | would expect it|
00002210  20 74 6f 20 62 65 2e 20  53 69 6d 70 6c 79 0d 0a  | to be. Simply..|
00002220  72 65 6d 65 6d 62 65 72  20 6e 6f 74 20 74 6f 20  |remember not to |
00002230  61 6c 6c 6f 77 20 74 68  65 20 73 63 72 65 65 6e  |allow the screen|
00002240  20 74 6f 20 73 63 72 6f  6c 6c 20 62 65 74 77 65  | to scroll betwe|
00002250  65 6e 20 63 6c 65 61 72  69 6e 67 20 69 74 2c 20  |en clearing it, |
00002260  61 6e 64 20 73 61 76 69  6e 67 0d 0a 74 68 65 20  |and saving..the |
00002270  63 6f 6e 74 65 6e 74 73  20 6f 66 20 73 63 72 65  |contents of scre|
00002280  65 6e 20 6d 65 6d 6f 72  79 20 74 6f 20 64 69 73  |en memory to dis|
00002290  63 2e 0d 0a 0d 0a 2d 20  54 68 65 20 66 69 6c 65  |c.....- The file|
000022a0  73 20 63 72 65 61 74 65  64 20 77 68 65 6e 20 79  |s created when y|
000022b0  6f 75 20 73 61 76 65 20  74 68 65 20 63 6f 6e 74  |ou save the cont|
000022c0  65 6e 74 73 20 6f 66 20  73 63 72 65 65 6e 20 6d  |ents of screen m|
000022d0  65 6d 6f 72 79 20 74 6f  20 64 69 73 6b 0d 0a 61  |emory to disk..a|
000022e0  72 65 20 66 61 69 72 6c  79 20 6c 61 72 67 65 20  |re fairly large |
000022f0  2d 20 73 6f 20 6c 61 72  67 65 2c 20 69 6e 20 66  |- so large, in f|
00002300  61 63 74 2c 20 74 68 61  74 20 79 6f 75 20 63 61  |act, that you ca|
00002310  6e 20 6f 66 74 65 6e 20  6f 6e 6c 79 20 66 69 74  |n often only fit|
00002320  20 61 72 6f 75 6e 64 0d  0a 31 35 20 73 75 63 68  | around..15 such|
00002330  20 66 69 6c 65 73 20 6f  6e 74 6f 20 65 61 63 68  | files onto each|
00002340  20 64 69 73 6b 20 74 68  61 74 20 79 6f 75 20 75  | disk that you u|
00002350  73 65 20 28 74 68 65 20  65 78 61 63 74 20 6e 75  |se (the exact nu|
00002360  6d 62 65 72 20 64 65 70  65 6e 64 73 20 75 70 6f  |mber depends upo|
00002370  6e 0d 0a 77 68 61 74 20  6d 6f 64 65 73 20 74 68  |n..what modes th|
00002380  65 20 69 6d 61 67 65 73  20 61 72 65 20 69 6e 29  |e images are in)|
00002390  2e 20 54 68 65 72 65 66  6f 72 65 20 74 68 69 73  |. Therefore this|
000023a0  20 74 65 63 68 6e 69 71  75 65 20 69 73 20 6e 6f  | technique is no|
000023b0  74 20 66 65 61 73 61 62  6c 65 0d 0a 66 6f 72 20  |t feasable..for |
000023c0  61 20 6c 61 72 67 65 20  6e 75 6d 62 65 72 20 6f  |a large number o|
000023d0  66 20 69 6d 61 67 65 73  2e 20 45 61 63 68 20 73  |f images. Each s|
000023e0  63 72 65 65 6e 20 69 6e  20 61 20 67 61 6d 65 20  |creen in a game |
000023f0  6c 69 6b 65 20 53 68 69  70 77 72 65 63 6b 65 64  |like Shipwrecked|
00002400  20 63 61 6e 6e 6f 74 0d  0a 62 65 20 73 74 6f 72  | cannot..be stor|
00002410  65 64 20 69 6e 20 74 68  69 73 20 77 61 79 20 2d  |ed in this way -|
00002420  20 69 66 20 49 20 68 61  64 20 73 74 6f 72 65 64  | if I had stored|
00002430  20 65 76 65 72 79 20 73  63 72 65 65 6e 20 6f 66  | every screen of|
00002440  20 74 68 65 20 67 61 6d  65 20 6c 69 6b 65 20 74  | the game like t|
00002450  68 69 73 2c 0d 0a 69 74  20 77 6f 75 6c 64 20 68  |his,..it would h|
00002460  61 76 65 20 72 65 71 75  69 72 65 64 20 73 69 78  |ave required six|
00002470  20 66 6c 6f 70 70 79 20  64 69 73 6b 73 20 74 6f  | floppy disks to|
00002480  20 73 74 6f 72 65 20 74  68 65 20 64 61 74 61 20  | store the data |
00002490  66 6f 72 20 74 68 65 20  67 61 6d 65 21 0d 0a 54  |for the game!..T|
000024a0  68 69 73 20 6d 65 61 6e  73 20 74 68 61 74 20 73  |his means that s|
000024b0  61 76 65 64 20 73 63 72  65 65 6e 73 20 6d 75 73  |aved screens mus|
000024c0  74 20 62 65 20 72 65 73  65 72 76 65 64 20 66 6f  |t be reserved fo|
000024d0  72 20 74 68 65 20 70 75  72 70 6f 73 65 73 20 6f  |r the purposes o|
000024e0  66 20 74 69 74 6c 65 0d  0a 73 63 72 65 65 6e 73  |f title..screens|
000024f0  20 6f 6e 6c 79 2e 0d 0a  0d 0a 45 61 72 6c 69 65  | only.....Earlie|
00002500  72 20 69 6e 20 74 68 65  20 61 72 74 69 63 6c 65  |r in the article|
00002510  2c 20 49 20 6d 65 6e 74  69 6f 6e 65 64 20 73 65  |, I mentioned se|
00002520  76 65 72 61 6c 20 65 78  61 6d 70 6c 65 73 20 6f  |veral examples o|
00002530  66 20 73 63 72 65 65 6e  73 20 77 68 69 63 68 20  |f screens which |
00002540  49 20 68 61 76 65 0d 0a  64 6f 6e 65 20 66 6f 72  |I have..done for|
00002550  20 45 55 47 20 75 73 69  6e 67 20 73 61 76 65 64  | EUG using saved|
00002560  20 73 63 72 65 65 6e 73  20 75 73 69 6e 67 20 74  | screens using t|
00002570  68 69 73 20 74 65 63 68  6e 69 71 75 65 2e 20 54  |his technique. T|
00002580  68 65 73 65 20 69 6e 63  6c 75 64 65 64 20 74 68  |hese included th|
00002590  65 0d 0a 74 69 74 6c 65  20 73 63 72 65 65 6e 73  |e..title screens|
000025a0  20 66 6f 72 20 62 6f 74  68 20 53 68 69 70 77 72  | for both Shipwr|
000025b0  65 63 6b 65 64 20 67 61  6d 65 73 2c 20 61 6e 64  |ecked games, and|
000025c0  20 61 6c 73 6f 20 73 65  76 65 72 61 6c 20 45 55  | also several EU|
000025d0  47 20 74 69 74 6c 65 0d  0a 73 63 72 65 65 6e 73  |G title..screens|
000025e0  2e 20 59 6f 75 20 6d 61  79 20 68 61 76 65 20 6e  |. You may have n|
000025f0  6f 74 69 63 65 64 20 74  68 61 74 20 74 68 65 73  |oticed that thes|
00002600  65 20 77 65 72 65 20 61  63 74 75 61 6c 6c 79 20  |e were actually |
00002610  61 6e 69 6d 61 74 65 64  20 28 73 65 65 20 74 68  |animated (see th|
00002620  65 0d 0a 73 74 61 72 66  69 65 6c 64 20 69 6e 20  |e..starfield in |
00002630  4a 75 70 69 74 65 72 20  33 20 61 6e 64 20 74 68  |Jupiter 3 and th|
00002640  65 20 45 55 47 20 33 35  20 74 69 74 6c 65 29 2e  |e EUG 35 title).|
00002650  20 54 68 69 73 20 77 61  73 20 61 63 68 69 65 76  | This was achiev|
00002660  65 64 20 62 79 20 70 61  6c 65 74 74 65 0d 0a 73  |ed by palette..s|
00002670  77 69 74 63 68 69 6e 67  20 61 73 20 75 73 65 64  |witching as used|
00002680  20 69 6e 20 74 68 65 20  70 72 65 76 69 6f 75 73  | in the previous|
00002690  20 61 72 74 69 63 6c 65  2e 20 49 66 20 79 6f 75  | article. If you|
000026a0  20 6c 6f 6f 6b 20 61 67  61 69 6e 20 61 74 20 74  | look again at t|
000026b0  68 65 0d 0a 70 72 6f 67  72 61 6d 6d 69 6e 67 20  |he..programming |
000026c0  74 65 63 68 6e 69 71 75  65 20 64 65 6d 6f 6e 73  |technique demons|
000026d0  74 72 61 74 69 6f 6e 20  66 72 6f 6d 20 74 68 69  |tration from thi|
000026e0  73 20 61 72 74 69 63 6c  65 20 28 6f 6e 20 45 55  |s article (on EU|
000026f0  47 20 33 36 29 2c 20 61  6e 64 0d 0a 73 65 6c 65  |G 36), and..sele|
00002700  63 74 20 6f 70 74 69 6f  6e 20 35 2c 20 74 68 65  |ct option 5, the|
00002710  20 73 61 6d 65 20 65 66  66 65 63 74 20 77 69 6c  | same effect wil|
00002720  6c 20 61 70 70 65 61 72  20 6f 6e 20 79 6f 75 72  |l appear on your|
00002730  20 73 63 72 65 65 6e 2e  20 54 68 65 20 73 61 6d  | screen. The sam|
00002740  65 0d 0a 70 72 69 6e 63  69 70 61 6c 20 77 61 73  |e..principal was|
00002750  20 61 70 70 6c 69 65 64  20 69 6e 20 62 6f 74 68  | applied in both|
00002760  20 61 6e 69 6d 61 74 65  64 20 73 63 72 65 65 6e  | animated screen|
00002770  73 20 6d 65 6e 74 69 6f  6e 65 64 20 61 62 6f 76  |s mentioned abov|
00002780  65 20 2d 20 74 68 65 20  6f 6e 6c 79 0d 0a 64 69  |e - the only..di|
00002790  66 66 65 72 65 6e 63 65  20 69 73 20 74 68 61 74  |fference is that|
000027a0  20 69 6e 20 74 68 65 73  65 20 74 69 74 6c 65 20  | in these title |
000027b0  73 63 72 65 65 6e 73 20  74 68 65 20 70 61 74 74  |screens the patt|
000027c0  65 72 6e 20 6f 6e 20 73  63 72 65 65 6e 20 77 68  |ern on screen wh|
000027d0  69 63 68 20 69 73 0d 0a  62 65 69 6e 67 20 70 61  |ich is..being pa|
000027e0  6c 65 74 74 65 20 73 77  69 74 63 68 65 64 20 69  |lette switched i|
000027f0  73 20 72 61 74 68 65 72  20 6d 6f 72 65 20 63 6f  |s rather more co|
00002800  6d 70 6c 65 78 2e 20 53  68 69 70 77 72 65 63 6b  |mplex. Shipwreck|
00002810  27 73 20 74 69 74 6c 65  20 73 63 72 65 65 6e 0d  |'s title screen.|
00002820  0a 28 77 69 74 68 20 74  68 65 20 61 6e 69 6d 61  |.(with the anima|
00002830  74 65 64 20 77 61 74 65  72 20 73 63 65 6e 65 29  |ted water scene)|
00002840  20 77 61 73 20 61 6c 73  6f 20 63 72 65 61 74 65  | was also create|
00002850  64 20 69 6e 20 74 68 69  73 20 77 61 79 2c 20 65  |d in this way, e|
00002860  78 63 65 70 74 20 74 68  61 74 0d 0a 66 6f 72 20  |xcept that..for |
00002870  74 68 69 73 20 73 63 72  65 65 6e 20 74 68 65 72  |this screen ther|
00002880  65 20 77 61 73 20 61 6c  73 6f 20 61 20 6d 61 63  |e was also a mac|
00002890  68 69 6e 65 20 63 6f 64  65 20 70 72 6f 67 72 61  |hine code progra|
000028a0  6d 20 61 6c 74 65 72 69  6e 67 20 74 68 65 20 63  |m altering the c|
000028b0  6f 6e 74 65 6e 74 73 0d  0a 6f 66 20 73 63 72 65  |ontents..of scre|
000028c0  65 6e 20 6d 65 6d 6f 72  79 20 61 73 20 77 65 6c  |en memory as wel|
000028d0  6c 2c 20 74 6f 20 65 6e  68 61 6e 63 65 20 74 68  |l, to enhance th|
000028e0  65 20 65 66 66 65 63 74  2e 0d 0a 0d 0a 53 6f 2c  |e effect.....So,|
000028f0  20 77 65 20 68 61 76 65  20 61 20 74 65 63 68 6e  | we have a techn|
00002900  69 71 75 65 20 77 68 69  63 68 20 61 6c 6c 6f 77  |ique which allow|
00002910  73 20 75 73 20 74 6f 20  73 74 6f 72 65 20 61 20  |s us to store a |
00002920  73 6d 61 6c 6c 20 6e 75  6d 62 65 72 20 6f 66 20  |small number of |
00002930  76 65 72 79 0d 0a 64 65  74 61 69 6c 65 64 20 73  |very..detailed s|
00002940  63 72 65 65 6e 73 20 6f  6e 20 66 6c 6f 70 70 79  |creens on floppy|
00002950  2c 20 61 6e 64 20 72 65  63 61 6c 6c 20 74 68 65  |, and recall the|
00002960  6e 20 61 74 20 76 65 72  79 20 67 72 65 61 74 20  |n at very great |
00002970  73 70 65 65 64 2e 20 42  75 74 20 77 68 61 74 20  |speed. But what |
00002980  69 66 0d 0a 77 65 20 77  61 6e 74 20 74 6f 20 75  |if..we want to u|
00002990  73 65 20 74 68 69 73 20  6d 65 74 68 6f 64 20 66  |se this method f|
000029a0  6f 72 20 61 20 6c 61 72  67 65 20 6e 75 6d 62 65  |or a large numbe|
000029b0  72 20 6f 66 20 73 63 72  65 65 6e 73 3f 20 41 6e  |r of screens? An|
000029c0  64 20 77 68 61 74 20 69  66 20 77 65 0d 0a 77 61  |d what if we..wa|
000029d0  6e 74 20 61 20 73 69 74  75 61 74 69 6f 6e 20 6c  |nt a situation l|
000029e0  69 6b 65 20 61 20 67 61  6d 65 2c 20 77 68 65 72  |ike a game, wher|
000029f0  65 20 74 68 65 20 75 73  65 72 20 63 61 6e 20 6d  |e the user can m|
00002a00  6f 76 65 20 73 70 72 69  74 65 73 20 6f 6e 20 74  |ove sprites on t|
00002a10  68 65 20 73 63 72 65 65  6e 0d 0a 61 72 6f 75 6e  |he screen..aroun|
00002a20  64 2e 20 54 68 69 73 20  63 61 6e 20 61 6c 73 6f  |d. This can also|
00002a30  20 62 65 20 64 6f 6e 65  20 62 79 20 61 6c 74 65  | be done by alte|
00002a40  72 69 6e 67 20 74 68 65  20 76 61 6c 75 65 73 20  |ring the values |
00002a50  69 6e 20 73 63 72 65 65  6e 20 6d 65 6d 6f 72 79  |in screen memory|
00002a60  0d 0a 64 69 72 65 63 74  6c 79 2c 20 62 75 74 20  |..directly, but |
00002a70  69 6e 20 61 20 64 69 66  66 65 72 65 6e 74 20 77  |in a different w|
00002a80  61 79 2e 2e 2e 0d 0a 0d  0a 32 2e 20 45 64 69 74  |ay.......2. Edit|
00002a90  69 6e 67 20 73 63 72 65  65 6e 20 6d 65 6d 6f 72  |ing screen memor|
00002aa0  79 0d 0a 0d 0a 54 68 65  20 62 61 73 69 63 20 69  |y....The basic i|
00002ab0  64 65 61 20 69 73 20 74  68 69 73 3a 20 69 6e 20  |dea is this: in |
00002ac0  61 6e 79 20 70 72 6f 67  72 61 6d 2c 20 79 6f 75  |any program, you|
00002ad0  20 6f 6e 6c 79 20 75 73  75 61 6c 6c 79 20 72 65  | only usually re|
00002ae0  71 75 69 72 65 20 61 20  63 65 72 74 61 69 6e 2c  |quire a certain,|
00002af0  0d 0a 73 6d 61 6c 6c 20  6e 75 6d 62 65 72 20 6f  |..small number o|
00002b00  66 20 6c 69 74 74 6c 65  20 27 62 6c 6f 63 6b 73  |f little 'blocks|
00002b10  27 20 74 6f 20 6d 61 6b  65 20 75 70 20 61 20 77  |' to make up a w|
00002b20  68 6f 6c 65 20 70 69 63  74 75 72 65 2e 20 49 6e  |hole picture. In|
00002b30  20 61 20 77 6f 72 64 0d  0a 70 72 6f 63 65 73 73  | a word..process|
00002b40  6f 72 2c 20 66 6f 72 20  65 78 61 6d 70 6c 65 2c  |or, for example,|
00002b50  20 79 6f 75 20 6f 6e 6c  79 20 6e 65 65 64 20 74  | you only need t|
00002b60  68 65 20 6c 65 74 74 65  72 73 20 6f 66 20 74 68  |he letters of th|
00002b70  65 20 61 6c 70 68 61 62  65 74 20 74 6f 20 61 70  |e alphabet to ap|
00002b80  70 65 61 72 0d 0a 6f 6e  20 74 68 65 20 73 63 72  |pear..on the scr|
00002b90  65 65 6e 2e 20 54 68 65  73 65 20 6c 65 74 74 65  |een. These lette|
00002ba0  72 73 20 61 72 65 20 73  6d 61 6c 6c 20 62 6c 6f  |rs are small blo|
00002bb0  63 6b 73 20 6f 66 20 67  72 61 70 68 69 63 73 20  |cks of graphics |
00002bc0  77 68 69 63 68 20 61 70  70 65 61 72 20 6f 6e 0d  |which appear on.|
00002bd0  0a 79 6f 75 72 20 73 63  72 65 65 6e 20 28 63 61  |.your screen (ca|
00002be0  6c 6c 65 64 20 63 68 61  72 61 63 74 65 72 73 29  |lled characters)|
00002bf0  2e 20 42 65 63 61 75 73  65 20 6f 6e 6c 79 20 74  |. Because only t|
00002c00  68 65 73 65 20 32 36 20  62 6c 6f 63 6b 73 20 61  |hese 26 blocks a|
00002c10  72 65 20 72 65 71 75 69  72 65 64 2c 0d 0a 74 68  |re required,..th|
00002c20  65 20 77 6f 72 64 20 70  72 6f 63 65 73 73 6f 72  |e word processor|
00002c30  20 64 6f 65 73 20 6e 6f  74 20 6e 65 65 64 20 74  | does not need t|
00002c40  6f 20 73 74 6f 72 65 20  65 76 65 72 79 20 6c 65  |o store every le|
00002c50  74 74 65 72 20 61 73 20  61 6c 6c 20 6f 66 20 74  |tter as all of t|
00002c60  68 65 20 70 69 78 65 6c  73 0d 0a 77 68 69 63 68  |he pixels..which|
00002c70  20 6d 61 6b 65 20 69 74  20 75 70 20 28 69 65 2e  | make it up (ie.|
00002c80  20 61 73 20 61 20 62 69  74 6d 61 70 29 2c 20 62  | as a bitmap), b|
00002c90  75 74 20 6a 75 73 74 20  61 73 20 61 20 63 6f 64  |ut just as a cod|
00002ca0  65 20 66 6f 72 20 74 68  61 74 20 70 61 72 74 69  |e for that parti|
00002cb0  63 75 6c 61 72 0d 0a 6c  65 74 74 65 72 2e 20 57  |cular..letter. W|
00002cc0  68 65 6e 20 74 68 65 20  77 6f 72 64 20 70 72 6f  |hen the word pro|
00002cd0  63 65 73 73 6f 72 20 77  61 6e 74 73 20 74 6f 20  |cessor wants to |
00002ce0  64 69 73 70 6c 61 79 20  61 20 6c 65 74 74 65 72  |display a letter|
00002cf0  20 6f 6e 20 74 68 65 20  73 63 72 65 65 6e 2c 20  | on the screen, |
00002d00  69 74 0d 0a 6c 6f 6f 6b  73 20 75 70 20 74 68 65  |it..looks up the|
00002d10  20 6c 65 74 74 65 72 20  63 6f 64 65 2c 20 61 6e  | letter code, an|
00002d20  64 20 74 68 65 6e 20 63  6f 70 69 65 73 20 74 68  |d then copies th|
00002d30  65 20 67 72 61 70 68 69  63 20 64 61 74 61 20 66  |e graphic data f|
00002d40  6f 72 20 77 68 61 74 20  74 68 61 74 0d 0a 6c 65  |or what that..le|
00002d50  74 74 65 72 20 6c 6f 6f  6b 73 20 6c 69 6b 65 20  |tter looks like |
00002d60  6f 6e 74 6f 20 74 68 65  20 73 63 72 65 65 6e 2e  |onto the screen.|
00002d70  20 54 68 65 72 65 66 6f  72 65 2c 20 74 68 65 20  | Therefore, the |
00002d80  67 72 61 70 68 69 63 20  64 61 74 61 20 66 6f 72  |graphic data for|
00002d90  20 77 68 61 74 0d 0a 63  6f 6c 6f 75 72 20 61 6c  | what..colour al|
00002da0  6c 20 6f 66 20 74 68 65  20 70 69 78 65 6c 73 20  |l of the pixels |
00002db0  73 68 6f 75 6c 64 20 62  65 20 66 6f 72 20 74 68  |should be for th|
00002dc0  61 74 20 70 61 72 74 69  63 75 6c 61 72 20 6c 65  |at particular le|
00002dd0  74 74 65 72 20 28 77 68  69 63 68 20 6d 69 67 68  |tter (which migh|
00002de0  74 0d 0a 74 61 6b 65 20  73 65 76 65 72 61 6c 20  |t..take several |
00002df0  62 79 74 65 73 29 20 6e  65 65 64 20 6f 6e 6c 79  |bytes) need only|
00002e00  20 62 65 20 73 74 6f 72  65 64 20 6f 6e 63 65 2c  | be stored once,|
00002e10  20 61 6e 64 20 74 68 61  74 20 6c 65 74 74 65 72  | and that letter|
00002e20  20 63 61 6e 20 62 65 20  73 74 6f 72 65 64 0d 0a  | can be stored..|
00002e30  69 6e 20 79 6f 75 72 20  73 63 72 69 70 74 20 69  |in your script i|
00002e40  6e 20 6a 75 73 74 20 6f  6e 65 20 62 79 74 65 2c  |n just one byte,|
00002e50  20 66 6f 72 20 74 68 65  20 6c 65 74 74 65 72 20  | for the letter |
00002e60  63 6f 64 65 2e 20 54 68  75 73 2c 20 74 68 65 20  |code. Thus, the |
00002e70  6d 65 6d 6f 72 79 0d 0a  74 61 6b 65 6e 20 75 70  |memory..taken up|
00002e80  20 62 79 20 79 6f 75 72  20 73 63 72 69 70 74 20  | by your script |
00002e90  69 73 20 72 65 64 75 63  65 64 20 64 72 61 6d 61  |is reduced drama|
00002ea0  74 69 63 61 6c 6c 79 2e  0d 0a 0d 0a 54 68 65 20  |tically.....The |
00002eb0  73 61 6d 65 20 70 72 69  6e 63 69 70 61 6c 20 63  |same principal c|
00002ec0  61 6e 20 62 65 20 75 73  65 64 20 69 6e 20 67 72  |an be used in gr|
00002ed0  61 70 68 69 63 73 2e 20  4c 6f 6f 6b 20 61 74 20  |aphics. Look at |
00002ee0  74 77 6f 20 62 72 69 63  6b 20 77 61 6c 6c 73 20  |two brick walls |
00002ef0  69 6e 0d 0a 61 6e 20 61  72 63 61 64 65 20 61 64  |in..an arcade ad|
00002f00  76 65 6e 74 75 72 65 20  73 75 63 68 20 61 73 20  |venture such as |
00002f10  53 68 69 70 77 72 65 63  6b 65 64 20 2d 20 63 61  |Shipwrecked - ca|
00002f20  6e 20 79 6f 75 20 73 65  65 20 74 68 65 20 64 69  |n you see the di|
00002f30  66 66 65 72 65 6e 63 65  0d 0a 62 65 74 77 65 65  |fference..betwee|
00002f40  6e 20 74 68 65 6d 3f 20  49 66 20 74 68 65 79 20  |n them? If they |
00002f50  61 72 65 20 74 68 65 20  73 61 6d 65 2c 20 73 75  |are the same, su|
00002f60  72 65 6c 79 20 79 6f 75  20 6f 6e 6c 79 20 6e 65  |rely you only ne|
00002f70  65 64 20 74 6f 20 73 74  6f 72 65 20 74 68 65 0d  |ed to store the.|
00002f80  0a 67 72 61 70 68 69 63  20 64 61 74 61 20 66 6f  |.graphic data fo|
00002f90  72 20 61 20 62 72 69 63  6b 20 77 61 6c 6c 20 6f  |r a brick wall o|
00002fa0  6e 63 65 2c 20 61 6e 64  20 74 68 65 6e 20 63 6f  |nce, and then co|
00002fb0  70 79 20 69 74 20 6f 6e  74 6f 20 74 68 65 20 73  |py it onto the s|
00002fc0  63 72 65 65 6e 0d 0a 77  68 65 6e 65 76 65 72 20  |creen..whenever |
00002fd0  79 6f 75 20 77 61 6e 74  20 61 20 62 72 69 63 6b  |you want a brick|
00002fe0  20 77 61 6c 6c 2e 20 49  6e 20 53 68 69 70 77 72  | wall. In Shipwr|
00002ff0  65 63 6b 65 64 2c 20 66  6f 72 20 65 78 61 6d 70  |ecked, for examp|
00003000  6c 65 2c 20 74 68 65 20  67 72 61 70 68 69 63 0d  |le, the graphic.|
00003010  0a 64 61 74 61 20 74 6f  20 64 65 73 63 72 69 62  |.data to describ|
00003020  65 20 77 68 61 74 20 61  20 62 72 69 63 6b 20 77  |e what a brick w|
00003030  61 6c 6c 20 6c 6f 6f 6b  73 20 6c 69 6b 65 20 74  |all looks like t|
00003040  6f 6f 6b 20 31 32 38 20  62 79 74 65 73 2e 20 59  |ook 128 bytes. Y|
00003050  65 74 20 65 76 65 72 79  0d 0a 74 69 6d 65 20 49  |et every..time I|
00003060  20 77 61 6e 74 65 64 20  74 68 61 74 20 62 72 69  | wanted that bri|
00003070  63 6b 20 77 61 6c 6c 20  28 77 68 69 63 68 20 77  |ck wall (which w|
00003080  61 73 20 6f 76 65 72 20  61 20 68 75 6e 64 72 65  |as over a hundre|
00003090  64 20 74 69 6d 65 73 29  20 49 20 63 6f 75 6c 64  |d times) I could|
000030a0  0d 0a 73 69 6d 70 6c 79  20 75 73 65 20 6f 6e 65  |..simply use one|
000030b0  20 62 79 74 65 20 74 6f  20 73 61 79 20 22 50 75  | byte to say "Pu|
000030c0  74 20 61 20 62 72 69 63  6b 20 77 61 6c 6c 20 68  |t a brick wall h|
000030d0  65 72 65 21 22 2e 0d 0a  0d 0a 54 68 65 20 65 61  |ere!".....The ea|
000030e0  73 69 65 73 74 20 77 61  79 20 74 6f 20 75 73 65  |siest way to use|
000030f0  20 74 68 69 73 20 62 6c  6f 63 6b 20 69 64 65 61  | this block idea|
00003100  2c 20 61 73 20 79 6f 75  20 6d 61 79 20 61 6c 72  |, as you may alr|
00003110  65 61 64 79 20 68 61 76  65 20 72 65 61 6c 69 73  |eady have realis|
00003120  65 64 2c 0d 0a 69 73 20  75 73 69 6e 67 20 75 73  |ed,..is using us|
00003130  65 72 20 64 65 66 69 6e  65 64 20 63 68 61 72 61  |er defined chara|
00003140  63 74 65 72 73 2e 20 59  6f 75 20 72 65 64 65 66  |cters. You redef|
00003150  69 6e 65 20 74 68 65 20  6c 65 74 74 65 72 73 20  |ine the letters |
00003160  6f 66 20 74 68 65 20 61  6c 70 68 61 62 65 74 0d  |of the alphabet.|
00003170  0a 61 73 20 64 69 66 66  65 72 65 6e 74 20 70 69  |.as different pi|
00003180  63 74 75 72 65 73 2c 20  61 6e 64 20 74 68 65 6e  |ctures, and then|
00003190  20 75 73 65 20 74 68 65  20 73 74 61 6e 64 61 72  | use the standar|
000031a0  64 20 42 41 53 49 43 20  50 52 49 4e 54 20 63 6f  |d BASIC PRINT co|
000031b0  6d 6d 61 6e 64 20 74 6f  0d 0a 6f 75 74 70 75 74  |mmand to..output|
000031c0  20 74 68 65 73 65 20 70  69 63 74 75 72 65 73 20  | these pictures |
000031d0  74 6f 20 74 68 65 20 73  63 72 65 65 6e 2c 20 61  |to the screen, a|
000031e0  73 20 61 6e 64 20 77 68  65 6e 20 74 68 65 79 20  |s and when they |
000031f0  61 72 65 20 72 65 71 75  69 72 65 64 2e 20 42 75  |are required. Bu|
00003200  74 2c 0d 0a 61 73 20 77  65 20 61 6c 72 65 61 64  |t,..as we alread|
00003210  79 20 72 65 61 6c 69 73  65 64 20 69 6e 20 74 68  |y realised in th|
00003220  65 20 6c 61 73 74 20 61  72 74 69 63 6c 65 2c 20  |e last article, |
00003230  74 68 69 73 20 6f 6e 6c  79 20 61 6c 6c 6f 77 73  |this only allows|
00003240  20 79 6f 75 20 74 6f 20  75 73 65 0d 0a 6f 6e 65  | you to use..one|
00003250  20 63 6f 6c 6f 75 72 20  69 6e 20 65 61 63 68 20  | colour in each |
00003260  63 68 61 72 61 63 74 65  72 2e 20 45 76 65 6e 20  |character. Even |
00003270  73 6f 2c 20 74 68 69 73  20 69 73 20 61 20 72 65  |so, this is a re|
00003280  61 73 6f 6e 61 62 6c 65  20 74 65 63 68 6e 69 71  |asonable techniq|
00003290  75 65 20 69 66 0d 0a 79  6f 75 20 64 6f 6e 27 74  |ue if..you don't|
000032a0  20 6d 69 6e 64 20 74 68  65 20 6c 61 63 6b 20 6f  | mind the lack o|
000032b0  66 20 63 6f 6c 6f 75 72  2e 20 4d 61 6e 79 20 63  |f colour. Many c|
000032c0  6f 6d 6d 65 72 63 69 61  6c 20 67 61 6d 65 73 20  |ommercial games |
000032d0  61 63 74 75 61 6c 6c 79  20 6e 65 76 65 72 0d 0a  |actually never..|
000032e0  61 64 64 72 65 73 73 65  64 20 74 68 69 73 20 70  |addressed this p|
000032f0  72 6f 62 6c 65 6d 2c 20  61 6e 64 20 68 61 64 20  |roblem, and had |
00003300  67 72 61 70 68 69 63 73  20 77 68 69 63 68 20 6c  |graphics which l|
00003310  61 63 6b 65 64 20 63 6f  6c 6f 75 72 20 73 6f 6d  |acked colour som|
00003320  65 77 68 61 74 2e 0d 0a  45 76 65 6e 20 44 69 7a  |ewhat...Even Diz|
00003330  7a 79 20 28 66 6f 72 20  74 68 6f 73 65 20 77 68  |zy (for those wh|
00003340  6f 20 68 61 76 65 20 6e  65 76 65 72 20 68 65 61  |o have never hea|
00003350  72 64 20 6f 66 20 69 74  2c 20 61 20 67 72 65 61  |rd of it, a grea|
00003360  74 20 61 72 63 61 64 65  20 61 64 76 65 6e 74 75  |t arcade adventu|
00003370  72 65 0d 0a 6f 66 20 74  68 65 20 31 39 38 30 73  |re..of the 1980s|
00003380  2c 20 77 68 69 63 68 20  63 61 75 73 65 64 20 71  |, which caused q|
00003390  75 69 74 65 20 61 20 63  75 6c 74 20 66 6f 6c 6c  |uite a cult foll|
000033a0  6f 77 69 6e 67 20 61 74  20 74 68 65 20 74 69 6d  |owing at the tim|
000033b0  65 20 6f 6e 20 74 68 65  0d 0a 53 70 65 63 74 72  |e on the..Spectr|
000033c0  75 6d 20 61 6e 64 20 43  36 34 2c 20 62 75 74 20  |um and C64, but |
000033d0  6e 65 76 65 72 20 71 75  69 74 65 20 72 65 61 63  |never quite reac|
000033e0  68 65 64 20 74 68 65 20  45 6c 6b 29 20 64 69 64  |hed the Elk) did|
000033f0  20 6e 6f 74 20 68 61 76  65 20 6d 6f 72 65 20 74  | not have more t|
00003400  68 61 6e 0d 0a 6f 6e 65  20 63 6f 6c 6f 75 72 20  |han..one colour |
00003410  28 6f 74 68 65 72 20 74  68 61 6e 20 62 6c 61 63  |(other than blac|
00003420  6b 29 20 70 65 72 20 62  6c 6f 63 6b 2e 20 44 69  |k) per block. Di|
00003430  66 66 65 72 65 6e 74 20  62 6c 6f 63 6b 73 20 77  |fferent blocks w|
00003440  65 72 65 2c 20 68 6f 77  65 76 65 72 2c 0d 0a 64  |ere, however,..d|
00003450  69 66 66 65 72 65 6e 74  20 63 6f 6c 6f 75 72 73  |ifferent colours|
00003460  20 2d 20 74 72 65 65 73  20 77 65 72 65 20 67 72  | - trees were gr|
00003470  65 65 6e 20 61 6e 64 20  74 68 65 20 67 72 6f 75  |een and the grou|
00003480  6e 64 20 77 61 73 20 72  65 64 20 2d 20 62 75 74  |nd was red - but|
00003490  20 74 68 65 72 65 0d 0a  77 61 73 20 6e 65 76 65  | there..was neve|
000034a0  72 20 61 6e 79 20 6f 76  65 72 6c 61 70 20 62 65  |r any overlap be|
000034b0  74 77 65 65 6e 20 74 68  65 20 74 77 6f 20 63 6f  |tween the two co|
000034c0  6c 6f 75 72 20 61 72 65  61 73 2e 0d 0a 0d 0a 54  |lour areas.....T|
000034d0  68 65 72 65 20 69 73 2c  20 68 6f 77 65 76 65 72  |here is, however|
000034e0  2c 20 61 20 77 61 79 20  6f 66 20 63 72 65 61 74  |, a way of creat|
000034f0  69 6e 67 20 61 6e 20 65  66 66 65 63 74 20 6a 75  |ing an effect ju|
00003500  73 74 20 6c 69 6b 65 20  75 73 65 72 20 64 65 66  |st like user def|
00003510  69 6e 65 64 0d 0a 63 68  61 72 61 63 74 65 72 73  |ined..characters|
00003520  2c 20 62 75 74 20 69 6e  20 66 75 6c 6c 20 63 6f  |, but in full co|
00003530  6c 6f 75 72 2c 20 61 6e  64 20 74 68 65 20 70 72  |lour, and the pr|
00003540  69 6e 63 69 70 61 6c 20  69 73 20 76 65 72 79 20  |incipal is very |
00003550  73 69 6d 69 6c 61 72 20  74 6f 0d 0a 74 68 61 74  |similar to..that|
00003560  20 75 73 65 64 20 62 65  66 6f 72 65 20 69 6e 20  | used before in |
00003570  73 61 76 69 6e 67 20 73  63 72 65 65 6e 20 6d 65  |saving screen me|
00003580  6d 6f 72 79 2e 20 42 61  73 69 63 61 6c 6c 79 2c  |mory. Basically,|
00003590  20 79 6f 75 20 64 65 73  69 67 6e 20 79 6f 75 20  | you design you |
000035a0  73 6d 61 6c 6c 0d 0a 62  6c 6f 63 6b 20 6f 6e 20  |small..block on |
000035b0  74 68 65 20 73 63 72 65  65 6e 2c 20 75 73 69 6e  |the screen, usin|
000035c0  67 20 77 68 61 74 65 76  65 72 20 74 65 63 68 6e  |g whatever techn|
000035d0  69 71 75 65 20 79 6f 75  20 6c 69 6b 65 20 74 6f  |ique you like to|
000035e0  20 64 72 61 77 20 69 74  2c 20 61 6e 64 20 74 68  | draw it, and th|
000035f0  65 6e 0d 0a 73 61 76 65  20 74 68 65 20 73 6d 61  |en..save the sma|
00003600  6c 6c 20 70 61 72 74 20  6f 66 20 73 63 72 65 65  |ll part of scree|
00003610  6e 20 6d 65 6d 6f 72 79  20 77 68 69 63 68 20 63  |n memory which c|
00003620  6f 6e 74 61 69 6e 73 20  79 6f 75 72 20 64 65 73  |ontains your des|
00003630  69 67 6e 2e 20 54 68 69  73 20 74 69 6d 65 2c 0d  |ign. This time,.|
00003640  0a 68 6f 77 65 76 65 72  2c 20 79 6f 75 20 77 69  |.however, you wi|
00003650  6c 6c 20 6e 6f 74 20 73  61 76 65 20 69 74 20 74  |ll not save it t|
00003660  6f 20 66 6c 6f 70 70 79  20 64 69 73 63 2c 20 62  |o floppy disc, b|
00003670  75 74 20 74 6f 20 61 6e  6f 74 68 65 72 20 61 72  |ut to another ar|
00003680  65 61 20 6f 66 20 6d 65  6d 6f 72 79 2e 0d 0a 59  |ea of memory...Y|
00003690  6f 75 20 63 61 6e 20 74  68 65 6e 20 63 6f 70 79  |ou can then copy|
000036a0  20 74 68 69 73 20 62 6c  6f 63 6b 20 62 61 63 6b  | this block back|
000036b0  20 74 6f 20 73 63 72 65  65 6e 20 6d 65 6d 6f 72  | to screen memor|
000036c0  79 20 77 68 65 6e 65 76  65 72 20 61 6e 64 20 77  |y whenever and w|
000036d0  68 65 72 65 76 65 72 20  79 6f 75 0d 0a 77 61 6e  |herever you..wan|
000036e0  74 20 69 74 2e 20 49 66  20 79 6f 75 20 77 61 6e  |t it. If you wan|
000036f0  74 20 69 74 2c 20 73 61  79 2c 20 69 6e 20 74 68  |t it, say, in th|
00003700  65 20 66 69 66 74 68 20  72 6f 77 20 64 6f 77 6e  |e fifth row down|
00003710  2c 20 61 6e 64 20 74 77  65 6c 76 65 20 63 68 61  |, and twelve cha|
00003720  72 61 63 74 65 72 73 0d  0a 61 6c 6f 6e 67 2c 20  |racters..along, |
00003730  79 6f 75 20 63 61 6e 20  63 61 6c 63 75 6c 61 74  |you can calculat|
00003740  65 20 77 68 65 72 65 20  61 62 6f 75 74 73 20 74  |e where abouts t|
00003750  68 69 73 20 63 6f 72 72  65 73 70 6f 6e 64 73 20  |his corresponds |
00003760  74 6f 20 69 6e 20 73 63  72 65 65 6e 20 6d 65 6d  |to in screen mem|
00003770  6f 72 79 2c 0d 0a 61 6e  64 20 63 6f 70 79 20 74  |ory,..and copy t|
00003780  68 65 20 62 6c 6f 63 6b  20 74 6f 20 74 68 69 73  |he block to this|
00003790  20 6c 6f 63 61 74 69 6f  6e 2e 20 41 73 20 74 68  | location. As th|
000037a0  65 20 62 6c 6f 63 6b 20  69 73 20 73 74 6f 72 65  |e block is store|
000037b0  64 20 69 6e 20 79 6f 75  72 0d 0a 63 6f 6d 70 75  |d in your..compu|
000037c0  74 65 72 27 73 20 52 41  4d 2c 20 61 73 20 6f 70  |ter's RAM, as op|
000037d0  70 6f 73 65 64 20 74 6f  20 6f 6e 20 66 6c 6f 70  |posed to on flop|
000037e0  70 79 2c 20 74 68 69 73  20 74 72 61 6e 73 66 65  |py, this transfe|
000037f0  72 20 63 61 6e 20 62 65  20 64 6f 6e 65 20 62 79  |r can be done by|
00003800  0d 0a 6d 61 63 68 69 6e  65 20 63 6f 64 65 20 61  |..machine code a|
00003810  74 20 76 65 72 79 20 67  72 65 61 74 20 73 70 65  |t very great spe|
00003820  65 64 20 28 74 61 6b 69  6e 67 20 6f 6e 6c 79 20  |ed (taking only |
00003830  61 20 73 6d 61 6c 6c 20  66 72 61 63 74 69 6f 6e  |a small fraction|
00003840  20 6f 66 20 61 20 73 65  63 6f 6e 64 29 2e 0d 0a  | of a second)...|
00003850  46 6f 72 20 74 68 6f 73  65 20 70 72 6f 67 72 61  |For those progra|
00003860  6d 6d 65 72 73 20 77 68  6f 20 61 72 65 20 6e 6f  |mmers who are no|
00003870  74 20 66 61 6d 69 6c 69  61 72 20 77 69 74 68 20  |t familiar with |
00003880  6d 61 63 68 69 6e 65 20  63 6f 64 65 2c 20 61 20  |machine code, a |
00003890  6d 6f 64 75 6c 65 0d 0a  69 73 20 69 6e 63 6c 75  |module..is inclu|
000038a0  64 65 64 20 77 69 74 68  20 74 68 69 73 20 74 75  |ded with this tu|
000038b0  74 6f 72 69 61 6c 20 61  6c 6c 6f 77 69 6e 67 20  |torial allowing |
000038c0  79 6f 75 20 74 6f 20 64  6f 20 74 68 69 73 2e 20  |you to do this. |
000038d0  54 68 65 20 70 72 6f 67  72 61 6d 20 63 6f 64 65  |The program code|
000038e0  0d 0a 66 6f 72 20 74 68  69 73 20 6d 6f 64 75 6c  |..for this modul|
000038f0  65 20 69 73 20 61 63 74  75 61 6c 6c 79 20 74 61  |e is actually ta|
00003900  6b 65 6e 20 64 69 72 65  63 74 6c 79 20 66 72 6f  |ken directly fro|
00003910  6d 20 53 68 69 70 77 72  65 63 6b 65 64 2e 0d 0a  |m Shipwrecked...|
00003920  0d 0a 49 66 20 79 6f 75  20 61 72 65 20 6e 6f 74  |..If you are not|
00003930  20 66 61 6d 69 6c 69 61  72 20 77 69 74 68 20 6d  | familiar with m|
00003940  61 63 68 69 6e 65 20 63  6f 64 65 2c 20 74 68 65  |achine code, the|
00003950  6e 20 79 6f 75 20 63 61  6e 20 70 72 6f 62 61 62  |n you can probab|
00003960  6c 79 20 73 6b 69 70 20  74 68 65 20 6e 65 78 74  |ly skip the next|
00003970  0d 0a 73 65 63 74 69 6f  6e 20 6f 6e 20 68 6f 77  |..section on how|
00003980  20 74 6f 20 64 69 72 65  63 74 6c 79 20 61 63 63  | to directly acc|
00003990  65 73 73 20 73 63 72 65  65 6e 20 6d 65 6d 6f 72  |ess screen memor|
000039a0  79 2c 20 61 73 20 69 74  20 69 73 20 69 6d 70 6f  |y, as it is impo|
000039b0  73 73 69 62 6c 65 0d 0a  74 6f 20 61 63 68 69 65  |ssible..to achie|
000039c0  76 65 20 61 6e 79 20 73  70 65 65 64 20 62 79 20  |ve any speed by |
000039d0  61 63 63 65 73 73 69 6e  67 20 73 63 72 65 65 6e  |accessing screen|
000039e0  20 6d 65 6d 6f 72 79 20  64 69 72 65 63 74 6c 79  | memory directly|
000039f0  20 69 6e 20 42 41 53 49  43 20 2d 20 79 6f 75 72  | in BASIC - your|
00003a00  0d 0a 70 72 6f 67 72 61  6d 20 77 69 6c 6c 20 63  |..program will c|
00003a10  72 61 77 6c 20 61 6c 6f  6e 67 20 69 6e 63 72 65  |rawl along incre|
00003a20  64 69 62 6c 79 20 73 6c  6f 77 6c 79 2e 20 59 6f  |dibly slowly. Yo|
00003a30  75 20 63 6f 75 6c 64 20  73 74 69 6c 6c 20 75 73  |u could still us|
00003a40  65 20 73 75 63 68 20 61  0d 0a 74 65 63 68 6e 69  |e such a..techni|
00003a50  71 75 65 20 69 6e 20 70  72 65 70 61 72 69 6e 67  |que in preparing|
00003a60  20 61 20 73 63 72 65 65  6e 20 77 68 69 63 68 20  | a screen which |
00003a70  79 6f 75 20 69 6e 74 65  6e 64 20 74 6f 20 73 61  |you intend to sa|
00003a80  76 65 20 74 6f 20 66 6c  6f 70 70 79 20 75 73 69  |ve to floppy usi|
00003a90  6e 67 0d 0a 74 68 65 20  74 65 63 68 6e 69 71 75  |ng..the techniqu|
00003aa0  65 20 64 65 73 63 72 69  62 65 64 20 62 65 66 6f  |e described befo|
00003ab0  72 65 20 77 69 74 68 20  2a 53 41 56 45 20 61 6e  |re with *SAVE an|
00003ac0  64 20 2a 4c 4f 41 44 2e  0d 0a 0d 0a 46 69 72 73  |d *LOAD.....Firs|
00003ad0  74 6c 79 2c 20 69 74 20  69 73 20 69 6d 70 6f 72  |tly, it is impor|
00003ae0  74 61 6e 74 20 74 6f 20  6b 6e 6f 77 20 68 6f 77  |tant to know how|
00003af0  20 73 63 72 65 65 6e 20  6d 65 6d 6f 72 79 20 69  | screen memory i|
00003b00  73 20 6c 61 69 64 20 6f  75 74 20 69 6e 20 6d 65  |s laid out in me|
00003b10  6d 6f 72 79 2e 0d 0a 54  68 65 20 65 78 61 63 74  |mory...The exact|
00003b20  20 70 6f 73 69 74 69 6f  6e 20 6f 66 20 65 61 63  | position of eac|
00003b30  68 20 63 68 61 72 61 63  74 65 72 20 77 69 74 68  |h character with|
00003b40  69 6e 20 74 68 65 20 6d  65 6d 6f 72 79 20 6f 66  |in the memory of|
00003b50  20 79 6f 75 72 20 63 6f  6d 70 75 74 65 72 0d 0a  | your computer..|
00003b60  76 61 72 69 65 73 20 66  72 6f 6d 20 6f 6e 65 20  |varies from one |
00003b70  67 72 61 70 68 69 63 73  20 6d 6f 64 65 20 74 6f  |graphics mode to|
00003b80  20 61 6e 6f 74 68 65 72  2c 20 62 75 74 20 74 68  | another, but th|
00003b90  65 20 62 61 73 69 63 20  70 72 69 6e 63 69 70 61  |e basic principa|
00003ba0  6c 73 20 61 72 65 20 74  68 65 0d 0a 73 61 6d 65  |ls are the..same|
00003bb0  3a 0d 0a 0d 0a 2d 20 54  68 65 20 73 63 72 65 65  |:....- The scree|
00003bc0  6e 20 61 72 65 61 20 69  73 20 64 69 76 69 64 65  |n area is divide|
00003bd0  64 20 75 70 20 69 6e 74  6f 20 63 68 61 72 61 63  |d up into charac|
00003be0  74 65 72 73 2e 20 54 68  65 73 65 20 61 72 65 20  |ters. These are |
00003bf0  62 6c 6f 63 6b 73 20 6f  66 20 65 69 67 68 74 20  |blocks of eight |
00003c00  0d 0a 20 20 70 69 78 65  6c 73 20 62 79 20 65 69  |..  pixels by ei|
00003c10  67 68 74 20 70 69 78 65  6c 73 2c 20 61 6e 64 20  |ght pixels, and |
00003c20  61 72 65 20 74 68 65 20  73 61 6d 65 20 73 69 7a  |are the same siz|
00003c30  65 20 61 73 20 74 68 65  20 72 65 63 74 61 6e 67  |e as the rectang|
00003c40  75 6c 61 72 20 62 6c 6f  63 6b 0d 0a 20 20 6f 66  |ular block..  of|
00003c50  20 73 70 61 63 65 20 74  61 6b 65 6e 20 75 70 20  | space taken up |
00003c60  62 79 20 6f 6e 65 20 6c  65 74 74 65 72 20 77 68  |by one letter wh|
00003c70  65 6e 20 79 6f 75 20 70  72 69 6e 74 20 74 65 78  |en you print tex|
00003c80  74 20 74 6f 20 74 68 65  20 73 63 72 65 65 6e 2e  |t to the screen.|
00003c90  20 53 63 72 65 65 6e 0d  0a 20 20 6d 65 6d 6f 72  | Screen..  memor|
00003ca0  79 20 69 73 20 64 69 76  69 64 65 64 20 75 70 20  |y is divided up |
00003cb0  69 6e 74 6f 20 62 6c 6f  63 6b 73 2c 20 77 69 74  |into blocks, wit|
00003cc0  68 20 65 61 63 68 20 74  68 65 20 63 68 61 72 61  |h each the chara|
00003cd0  63 74 65 72 73 20 62 65  69 6e 67 20 64 65 66 69  |cters being defi|
00003ce0  6e 65 64 0d 0a 20 20 62  79 20 6f 6e 65 20 6f 66  |ned..  by one of|
00003cf0  20 74 68 65 73 65 20 62  6c 6f 63 6b 73 2e 0d 0a  | these blocks...|
00003d00  2d 20 54 68 65 20 73 63  72 65 65 6e 20 69 73 20  |- The screen is |
00003d10  73 74 6f 72 65 64 20 72  6f 77 20 62 79 20 72 6f  |stored row by ro|
00003d20  77 2c 20 77 69 74 68 20  74 68 65 20 74 6f 70 20  |w, with the top |
00003d30  72 6f 77 20 66 69 72 73  74 20 61 6e 64 20 74 68  |row first and th|
00003d40  65 20 62 6f 74 74 6f 6d  0d 0a 20 20 72 6f 77 20  |e bottom..  row |
00003d50  6c 61 73 74 2e 0d 0a 2d  20 57 69 74 68 69 6e 20  |last...- Within |
00003d60  65 61 63 68 20 6f 66 20  74 68 65 73 65 20 72 6f  |each of these ro|
00003d70  77 73 2c 20 63 68 61 72  61 63 74 65 72 73 20 61  |ws, characters a|
00003d80  72 65 20 73 74 6f 72 65  64 20 6f 6e 65 20 62 79  |re stored one by|
00003d90  20 6f 6e 65 2c 20 66 72  6f 6d 20 6c 65 66 74 20  | one, from left |
00003da0  74 6f 0d 0a 20 20 72 69  67 68 74 2e 0d 0a 2d 20  |to..  right...- |
00003db0  49 6e 20 61 6c 6c 20 6d  6f 64 65 73 2c 20 73 63  |In all modes, sc|
00003dc0  72 65 65 6e 20 6d 65 6d  6f 72 79 20 65 6e 64 73  |reen memory ends|
00003dd0  20 61 74 20 26 37 46 46  46 20 28 69 65 2e 20 61  | at &7FFF (ie. a|
00003de0  74 20 74 68 65 20 65 6e  64 20 6f 66 20 52 41 4d  |t the end of RAM|
00003df0  29 0d 0a 0d 0a 46 6f 6f  74 6e 6f 74 65 3a 20 42  |)....Footnote: B|
00003e00  79 20 63 6f 6e 76 65 6e  74 69 6f 6e 2c 20 6d 65  |y convention, me|
00003e10  6d 6f 72 79 20 61 64 64  72 65 73 73 65 73 20 61  |mory addresses a|
00003e20  72 65 20 73 70 65 63 69  66 69 65 64 20 69 6e 20  |re specified in |
00003e30  68 65 78 69 64 65 63 69  6d 61 6c 2e 20 49 0d 0a  |hexidecimal. I..|
00003e40  20 20 20 20 20 20 20 20  20 20 75 73 65 20 74 68  |          use th|
00003e50  65 20 73 74 61 6e 64 61  72 64 20 41 63 6f 72 6e  |e standard Acorn|
00003e60  20 27 26 27 20 70 72 65  66 69 78 20 74 6f 20 69  | '&' prefix to i|
00003e70  6e 64 69 63 61 74 65 20  68 65 78 69 64 65 63 69  |ndicate hexideci|
00003e80  6d 61 6c 20 76 61 6c 75  65 73 2e 0d 0a 20 20 20  |mal values...   |
00003e90  20 20 20 20 20 20 20 54  68 6f 73 65 20 75 73 65  |       Those use|
00003ea0  64 20 74 6f 20 64 65 61  6c 69 6e 67 20 77 69 74  |d to dealing wit|
00003eb0  68 20 50 43 73 20 61 72  65 20 61 6e 79 20 6f 74  |h PCs are any ot|
00003ec0  68 65 72 20 63 6f 6d 70  75 74 65 72 73 20 6d 61  |her computers ma|
00003ed0  79 20 62 65 20 75 73 65  64 0d 0a 20 20 20 20 20  |y be used..     |
00003ee0  20 20 20 20 20 74 6f 20  74 68 65 20 41 6d 65 72  |     to the Amer|
00003ef0  69 63 61 6e 20 63 6f 6e  76 65 6e 74 69 6f 6e 20  |ican convention |
00003f00  6f 66 20 75 73 69 6e 67  20 61 20 64 6f 6c 6c 61  |of using a dolla|
00003f10  72 20 70 72 65 66 69 78  20 69 6e 20 69 74 73 20  |r prefix in its |
00003f20  70 6c 61 63 65 2e 0d 0a  20 20 20 20 20 20 20 20  |place...        |
00003f30  20 20 49 74 20 73 68 6f  75 6c 64 20 62 65 20 6e  |  It should be n|
00003f40  6f 74 65 64 20 74 68 61  74 20 74 68 65 20 45 6c  |oted that the El|
00003f50  6b 20 65 78 70 65 63 74  73 20 26 20 61 6e 64 20  |k expects & and |
00003f60  77 69 6c 6c 20 6e 6f 74  20 61 63 63 65 70 74 20  |will not accept |
00003f70  24 2e 0d 0a 0d 0a 45 78  61 6d 70 6c 65 3a 0d 0a  |$.....Example:..|
00003f80  0d 0a 53 75 70 70 6f 73  65 20 49 20 77 61 6e 74  |..Suppose I want|
00003f90  20 74 6f 20 64 72 61 77  20 61 20 62 6c 6f 62 20  | to draw a blob |
00003fa0  69 6e 20 63 68 61 72 61  63 74 65 72 20 73 71 75  |in character squ|
00003fb0  61 72 65 20 28 36 2c 37  29 2c 20 69 6e 20 6d 6f  |are (6,7), in mo|
00003fc0  64 65 20 31 2e 20 57 68  61 74 20 69 73 20 0d 0a  |de 1. What is ..|
00003fd0  74 68 65 20 61 64 64 72  65 73 73 20 6f 66 20 74  |the address of t|
00003fe0  68 69 73 20 73 71 75 61  72 65 3f 20 28 67 69 76  |his square? (giv|
00003ff0  65 6e 20 74 68 61 74 20  65 61 63 68 20 63 68 61  |en that each cha|
00004000  72 61 63 74 65 72 20 74  61 6b 65 73 20 31 36 20  |racter takes 16 |
00004010  62 79 74 65 73 20 6f 66  0d 0a 73 63 72 65 65 6e  |bytes of..screen|
00004020  20 6d 65 6d 6f 72 79 20  74 6f 20 64 65 66 69 6e  | memory to defin|
00004030  65 20 69 6e 20 6d 6f 64  65 20 31 20 2d 20 77 65  |e in mode 1 - we|
00004040  27 6c 6c 20 63 6f 6d 65  20 74 6f 20 68 6f 77 20  |'ll come to how |
00004050  74 6f 20 63 61 6c 63 75  6c 61 74 65 20 74 68 69  |to calculate thi|
00004060  73 20 69 6e 0d 0a 61 20  6d 69 6e 75 74 65 29 2e  |s in..a minute).|
00004070  0d 0a 0d 0a 57 65 6c 6c  20 2d 20 6c 6f 6f 6b 69  |....Well - looki|
00004080  6e 67 20 61 74 20 74 68  65 20 74 61 62 6c 65 20  |ng at the table |
00004090  65 61 72 6c 69 65 72 2c  20 73 63 72 65 65 6e 20  |earlier, screen |
000040a0  6d 65 6d 6f 72 79 20 73  74 61 72 74 73 20 61 74  |memory starts at|
000040b0  20 26 33 30 30 30 20 69  6e 20 6d 6f 64 65 20 31  | &3000 in mode 1|
000040c0  2e 0d 0a 57 65 20 77 61  6e 74 20 74 6f 20 66 69  |...We want to fi|
000040d0  6e 64 20 74 68 65 20 73  74 61 72 74 20 6f 66 20  |nd the start of |
000040e0  72 6f 77 20 37 20 69 6e  20 73 63 72 65 65 6e 20  |row 7 in screen |
000040f0  6d 65 6d 6f 72 79 2e 20  54 68 69 73 20 72 6f 77  |memory. This row|
00004100  20 68 61 73 20 37 20 72  6f 77 73 20 6f 66 0d 0a  | has 7 rows of..|
00004110  63 68 61 72 61 63 74 65  72 73 20 61 62 6f 76 65  |characters above|
00004120  20 69 74 2c 20 61 6e 64  20 77 68 69 63 68 20 77  | it, and which w|
00004130  69 6c 6c 20 62 65 20 73  74 6f 72 65 64 20 62 65  |ill be stored be|
00004140  66 6f 72 65 20 69 74 2e  20 45 61 63 68 20 6f 66  |fore it. Each of|
00004150  20 74 68 65 73 65 20 72  6f 77 73 0d 0a 63 6f 6e  | these rows..con|
00004160  73 69 73 74 73 20 6f 66  20 34 30 20 63 68 61 72  |sists of 40 char|
00004170  61 63 74 65 72 73 2c 20  77 68 69 63 68 20 74 61  |acters, which ta|
00004180  6b 65 20 75 70 20 31 36  20 62 79 74 65 73 20 65  |ke up 16 bytes e|
00004190  61 63 68 2e 20 54 68 65  72 65 66 6f 72 65 20 74  |ach. Therefore t|
000041a0  68 65 20 74 6f 74 61 6c  0d 0a 6d 65 6d 6f 72 79  |he total..memory|
000041b0  20 74 61 6b 65 6e 20 75  70 20 62 79 20 74 68 65  | taken up by the|
000041c0  73 65 20 72 6f 77 73 20  69 73 20 37 20 2a 20 34  |se rows is 7 * 4|
000041d0  30 20 2a 20 31 36 20 3d  20 34 34 38 30 20 62 79  |0 * 16 = 4480 by|
000041e0  74 65 73 2e 20 5b 45 61  63 68 20 63 68 61 72 61  |tes. [Each chara|
000041f0  63 74 65 72 0d 0a 69 73  20 31 36 20 62 79 74 65  |cter..is 16 byte|
00004200  73 2c 20 65 61 63 68 20  72 6f 77 20 63 6f 6e 73  |s, each row cons|
00004210  69 73 74 73 20 6f 66 20  34 30 20 6f 66 20 74 68  |ists of 40 of th|
00004220  65 73 65 20 63 68 61 72  61 63 74 65 72 73 2c 20  |ese characters, |
00004230  74 68 65 72 65 66 6f 72  65 20 77 65 0d 0a 6d 75  |therefore we..mu|
00004240  6c 74 69 70 6c 79 20 62  79 20 34 30 2c 20 61 6e  |ltiply by 40, an|
00004250  64 20 61 73 20 74 68 65  72 65 20 61 72 65 20 37  |d as there are 7|
00004260  20 6f 66 20 74 68 65 73  65 20 63 6f 6d 70 6c 65  | of these comple|
00004270  74 65 20 72 6f 77 73 2c  20 77 65 20 6d 75 6c 74  |te rows, we mult|
00004280  69 70 6c 79 20 62 79 0d  0a 37 20 74 6f 20 67 65  |iply by..7 to ge|
00004290  74 20 74 68 65 20 76 61  6c 75 65 20 66 6f 72 20  |t the value for |
000042a0  73 65 76 65 6e 20 6f 66  20 74 68 65 73 65 20 72  |seven of these r|
000042b0  6f 77 73 5d 0d 0a 0d 0a  4e 6f 77 20 77 65 20 68  |ows]....Now we h|
000042c0  61 76 65 20 74 68 61 74  20 74 68 65 20 73 74 61  |ave that the sta|
000042d0  72 74 69 6e 67 20 61 64  64 72 65 73 73 20 6f 66  |rting address of|
000042e0  20 72 6f 77 20 37 20 69  73 20 61 74 3a 0d 0a 0d  | row 7 is at:...|
000042f0  0a 26 33 30 30 30 20 2b  20 34 34 38 30 20 3d 20  |.&3000 + 4480 = |
00004300  26 34 31 38 30 0d 0a 0d  0a 4e 6f 77 20 74 68 61  |&4180....Now tha|
00004310  74 20 77 65 20 68 61 76  65 20 66 6f 75 6e 64 20  |t we have found |
00004320  77 68 65 72 65 20 61 62  6f 75 74 73 20 69 6e 20  |where abouts in |
00004330  6d 65 6d 6f 72 79 20 74  68 69 73 20 72 6f 77 20  |memory this row |
00004340  73 74 61 72 74 73 2c 20  77 65 20 6e 65 65 64 20  |starts, we need |
00004350  74 6f 0d 0a 6c 6f 63 61  74 65 20 63 68 61 72 61  |to..locate chara|
00004360  63 74 65 72 20 36 2e 20  54 68 69 73 20 73 68 6f  |cter 6. This sho|
00004370  75 6c 64 20 62 65 20 66  61 69 72 6c 79 20 65 61  |uld be fairly ea|
00004380  73 79 20 2d 20 77 65 20  6b 6e 6f 77 20 74 68 61  |sy - we know tha|
00004390  74 20 63 68 61 72 61 63  74 65 72 73 20 61 72 65  |t characters are|
000043a0  0d 0a 73 74 6f 72 65 64  20 66 72 6f 6d 20 6c 65  |..stored from le|
000043b0  66 74 20 74 6f 20 72 69  67 68 74 2c 20 73 6f 20  |ft to right, so |
000043c0  6a 75 73 74 20 61 64 64  20 6f 6e 20 74 68 65 20  |just add on the |
000043d0  6d 65 6d 6f 72 79 20 72  65 71 75 69 72 65 64 20  |memory required |
000043e0  74 6f 20 73 74 6f 72 65  20 73 69 78 0d 0a 63 68  |to store six..ch|
000043f0  61 72 61 63 74 65 72 73  20 74 6f 20 74 68 65 20  |aracters to the |
00004400  6c 65 66 74 20 6f 66 20  74 68 65 20 6f 6e 65 20  |left of the one |
00004410  77 65 20 77 61 6e 74 2c  20 69 2e 65 2e 20 31 36  |we want, i.e. 16|
00004420  20 2a 20 36 20 3d 20 39  36 20 62 79 74 65 73 20  | * 6 = 96 bytes |
00004430  5b 53 69 78 0d 0a 63 68  61 72 61 63 74 65 72 73  |[Six..characters|
00004440  2c 20 65 61 63 68 20 74  61 6b 69 6e 67 20 31 36  |, each taking 16|
00004450  20 62 79 74 65 73 20 74  6f 20 73 74 6f 72 65 5d  | bytes to store]|
00004460  2e 0d 0a 0d 0a 54 68 65  72 65 66 6f 72 65 20 74  |.....Therefore t|
00004470  68 65 20 61 64 64 72 65  73 73 20 6f 66 20 63 68  |he address of ch|
00004480  61 72 61 63 74 65 72 20  28 36 2c 37 29 20 77 69  |aracter (6,7) wi|
00004490  6c 6c 20 62 65 3a 0d 0a  0d 0a 26 34 31 38 30 20  |ll be:....&4180 |
000044a0  2b 20 39 36 20 3d 20 26  34 31 45 30 0d 0a 0d 0a  |+ 96 = &41E0....|
000044b0  41 6e 73 77 65 72 3a 20  43 68 61 72 61 63 74 65  |Answer: Characte|
000044c0  72 20 28 36 2c 37 29 20  69 73 20 73 74 6f 72 65  |r (6,7) is store|
000044d0  64 20 66 72 6f 6d 20 26  34 31 45 30 20 74 6f 20  |d from &41E0 to |
000044e0  26 34 31 45 46 0d 0a 0d  0a 4a 75 73 74 20 74 6f  |&41EF....Just to|
000044f0  20 63 68 65 63 6b 20 74  68 65 20 61 6e 73 77 65  | check the answe|
00004500  72 20 69 73 20 63 6f 72  72 65 63 74 2c 20 74 79  |r is correct, ty|
00004510  70 65 20 74 68 69 73 20  73 69 6d 70 6c 65 20 6c  |pe this simple l|
00004520  6f 6f 70 3a 0d 0a 0d 0a  31 30 20 4d 4f 44 45 20  |oop:....10 MODE |
00004530  31 0d 0a 32 30 20 46 4f  52 20 61 64 3d 26 34 31  |1..20 FOR ad=&41|
00004540  45 30 20 54 4f 20 26 34  31 45 46 0d 0a 33 30 20  |E0 TO &41EF..30 |
00004550  3f 61 64 3d 32 35 35 0d  0a 34 30 20 4e 45 58 54  |?ad=255..40 NEXT|
00004560  0d 0a 0d 0a 41 6e 64 20  79 65 73 2c 20 61 20 77  |....And yes, a w|
00004570  68 69 74 65 20 73 70 6c  6f 64 67 65 20 64 6f 65  |hite splodge doe|
00004580  73 20 61 70 70 65 61 72  20 69 6e 20 73 71 75 61  |s appear in squa|
00004590  72 65 20 28 36 2c 37 29  2e 0d 0a 0d 0a 54 68 69  |re (6,7).....Thi|
000045a0  73 20 77 68 6f 6c 65 20  70 72 6f 63 65 64 75 72  |s whole procedur|
000045b0  65 20 63 61 6e 20 61 63  74 75 61 6c 6c 79 20 62  |e can actually b|
000045c0  65 20 72 65 66 69 6e 65  64 20 64 6f 77 6e 2c 20  |e refined down, |
000045d0  61 6e 64 20 65 78 70 72  65 73 73 65 64 20 61 73  |and expressed as|
000045e0  20 61 20 73 69 6d 70 6c  65 0d 0a 66 6f 72 6d 75  | a simple..formu|
000045f0  6c 61 3a 0d 0a 0d 0a 41  64 64 72 65 73 73 20 3d  |la:....Address =|
00004600  20 42 61 73 65 20 2b 20  28 20 79 20 2a 20 4e 6f  | Base + ( y * No|
00004610  2e 20 63 68 61 72 61 63  74 65 72 73 20 70 65 72  |. characters per|
00004620  20 6c 69 6e 65 20 2b 20  78 20 29 20 2a 20 4d 65  | line + x ) * Me|
00004630  6d 6f 72 79 20 70 65 72  20 63 68 61 72 61 63 74  |mory per charact|
00004640  65 72 0d 0a 0d 0a 57 68  65 72 65 3a 20 41 64 64  |er....Where: Add|
00004650  72 65 73 73 3d 20 54 68  65 20 6d 65 6d 6f 72 79  |ress= The memory|
00004660  20 6c 6f 63 61 74 69 6f  6e 20 6f 66 20 74 68 65  | location of the|
00004670  20 73 74 61 72 74 20 6f  66 20 74 68 65 20 63 68  | start of the ch|
00004680  61 72 61 63 74 65 72 20  79 6f 75 20 77 61 6e 74  |aracter you want|
00004690  2e 0d 0a 20 20 20 20 20  20 20 42 61 73 65 20 20  |...       Base  |
000046a0  20 3d 20 53 74 61 72 74  20 6f 66 20 73 63 72 65  | = Start of scre|
000046b0  65 6e 20 6d 65 6d 6f 72  79 20 69 6e 20 63 75 72  |en memory in cur|
000046c0  72 65 6e 74 20 67 72 61  70 68 69 63 73 20 6d 6f  |rent graphics mo|
000046d0  64 65 2e 0d 0a 20 20 20  20 20 20 20 28 78 2c 79  |de...       (x,y|
000046e0  29 20 20 3d 20 43 6f 2d  6f 72 64 69 6e 61 74 65  |)  = Co-ordinate|
000046f0  20 6f 66 20 73 71 75 61  72 65 20 79 6f 75 20 77  | of square you w|
00004700  61 6e 74 20 74 6f 20 61  63 63 65 73 73 20 28 73  |ant to access (s|
00004710  61 6d 65 20 61 73 20 50  52 49 4e 54 20 54 41 42  |ame as PRINT TAB|
00004720  29 0d 0a 0d 0a 53 69 6e  63 65 20 74 68 65 20 6e  |)....Since the n|
00004730  75 6d 62 65 72 20 6f 66  20 63 68 61 72 61 63 74  |umber of charact|
00004740  65 72 73 20 70 65 72 20  6c 69 6e 65 2c 20 74 68  |ers per line, th|
00004750  65 20 6e 75 6d 62 65 72  20 6f 66 20 62 79 74 65  |e number of byte|
00004760  73 20 70 65 72 20 63 68  61 72 61 63 74 65 72 2c  |s per character,|
00004770  0d 0a 61 6e 64 20 74 68  65 20 62 61 73 65 20 61  |..and the base a|
00004780  64 64 72 65 73 73 20 6f  66 20 73 63 72 65 65 6e  |ddress of screen|
00004790  20 6d 65 6d 6f 72 79 20  61 72 65 20 61 6c 6c 20  | memory are all |
000047a0  63 6f 6e 73 74 61 6e 74  20 66 6f 72 20 61 6e 79  |constant for any|
000047b0  20 70 61 72 74 69 63 75  6c 61 72 0d 0a 67 72 61  | particular..gra|
000047c0  70 68 69 63 73 20 6d 6f  64 65 2c 20 74 68 65 20  |phics mode, the |
000047d0  76 61 6c 75 65 73 20 66  6f 72 20 74 68 65 20 67  |values for the g|
000047e0  72 61 70 68 69 63 73 20  6d 6f 64 65 20 79 6f 75  |raphics mode you|
000047f0  20 61 72 65 20 75 73 69  6e 67 20 63 61 6e 20 62  | are using can b|
00004800  65 0d 0a 73 75 62 73 74  69 74 75 74 65 64 20 69  |e..substituted i|
00004810  6e 74 6f 20 74 68 65 20  65 71 75 61 74 69 6f 6e  |nto the equation|
00004820  20 69 6e 20 79 6f 75 72  20 70 72 6f 67 72 61 6d  | in your program|
00004830  2e 20 46 6f 72 20 6d 6f  64 65 20 31 2c 20 66 6f  |. For mode 1, fo|
00004840  72 20 65 78 61 6d 70 6c  65 2c 20 79 6f 75 0d 0a  |r example, you..|
00004850  77 6f 75 6c 64 20 75 73  65 3a 0d 0a 0d 0a 41 64  |would use:....Ad|
00004860  64 72 65 73 73 20 3d 20  26 33 30 30 30 20 2b 20  |dress = &3000 + |
00004870  28 34 30 20 2a 20 79 20  2b 20 78 29 20 2a 20 31  |(40 * y + x) * 1|
00004880  36 0d 0a 0d 0a 42 65 66  6f 72 65 20 63 6f 6e 74  |6....Before cont|
00004890  69 6e 75 69 6e 67 2c 20  6f 6e 65 20 6e 6f 74 65  |inuing, one note|
000048a0  20 73 68 6f 75 6c 64 20  62 65 20 62 6f 72 6e 65  | should be borne|
000048b0  20 69 6e 20 6d 69 6e 64  2e 20 59 6f 75 20 6d 61  | in mind. You ma|
000048c0  79 20 72 65 6d 65 6d 62  65 72 20 74 68 61 74 0d  |y remember that.|
000048d0  0a 61 20 77 68 69 6c 65  20 62 61 63 6b 20 49 20  |.a while back I |
000048e0  6d 65 6e 74 69 6f 6e 65  64 20 74 68 61 74 20 77  |mentioned that w|
000048f0  68 65 6e 20 79 6f 75 20  74 79 70 65 20 74 65 78  |hen you type tex|
00004900  74 20 77 68 69 63 68 20  6f 76 65 72 66 6c 6f 77  |t which overflow|
00004910  73 20 6f 66 66 20 74 68  65 0d 0a 62 6f 74 74 6f  |s off the..botto|
00004920  6d 20 6f 66 20 74 68 65  20 73 63 72 65 65 6e 2c  |m of the screen,|
00004930  20 74 68 65 20 63 6f 6d  70 75 74 65 72 20 6d 61  | the computer ma|
00004940  6b 65 73 20 61 20 6e 6f  74 65 20 74 68 61 74 20  |kes a note that |
00004950  65 61 63 68 20 6c 69 6e  65 20 69 73 20 73 74 6f  |each line is sto|
00004960  72 65 64 0d 0a 69 6e 20  6d 65 6d 6f 72 79 20 6f  |red..in memory o|
00004970  6e 65 20 6c 69 6e 65 20  6c 6f 77 65 72 20 74 68  |ne line lower th|
00004980  61 6e 20 69 74 20 73 68  6f 75 6c 64 20 62 65 2c  |an it should be,|
00004990  20 62 75 74 20 64 6f 65  73 20 6e 6f 74 20 61 63  | but does not ac|
000049a0  74 75 61 6c 6c 79 20 6d  6f 76 65 0d 0a 61 6e 79  |tually move..any|
000049b0  74 68 69 6e 67 20 61 72  6f 75 6e 64 20 69 6e 20  |thing around in |
000049c0  73 63 72 65 65 6e 20 6d  65 6d 6f 72 79 2e 20 54  |screen memory. T|
000049d0  68 65 20 73 61 6d 65 20  65 66 66 65 63 74 20 63  |he same effect c|
000049e0  61 6e 20 63 61 75 73 65  20 70 72 6f 62 6c 65 6d  |an cause problem|
000049f0  73 20 77 69 74 68 0d 0a  64 69 72 65 63 74 20 61  |s with..direct a|
00004a00  63 63 65 73 73 20 74 6f  20 73 63 72 65 65 6e 20  |ccess to screen |
00004a10  6d 65 6d 6f 72 79 20 61  73 20 77 65 6c 6c 2e 20  |memory as well. |
00004a20  54 68 65 20 73 69 6d 70  6c 65 20 72 75 6c 65 20  |The simple rule |
00004a30  66 6f 72 20 62 65 67 69  6e 6e 65 72 73 20 69 73  |for beginners is|
00004a40  2c 0d 0a 4e 45 56 45 52  20 61 74 74 65 6d 70 74  |,..NEVER attempt|
00004a50  20 74 6f 20 75 73 65 20  64 69 72 65 63 74 20 73  | to use direct s|
00004a60  63 72 65 65 6e 20 6d 65  6d 6f 72 79 20 61 63 63  |creen memory acc|
00004a70  65 73 73 20 77 68 65 6e  20 74 68 65 72 65 20 69  |ess when there i|
00004a80  73 20 65 76 65 6e 20 74  68 65 0d 0a 73 6c 69 67  |s even the..slig|
00004a90  68 74 65 73 74 20 70 6f  73 73 69 62 69 6c 69 74  |htest possibilit|
00004aa0  79 20 74 68 61 74 20 74  68 65 20 73 63 72 65 65  |y that the scree|
00004ab0  6e 20 6d 69 67 68 74 20  68 61 76 65 20 62 65 65  |n might have bee|
00004ac0  6e 20 61 6c 6c 6f 77 65  64 20 74 6f 20 73 63 72  |n allowed to scr|
00004ad0  6f 6c 6c 20 75 70 0d 0a  61 74 20 61 6c 6c 20 28  |oll up..at all (|
00004ae0  65 2e 67 2e 20 61 66 74  65 72 20 75 73 69 6e 67  |e.g. after using|
00004af0  20 49 4e 50 55 54 20 74  6f 20 67 65 74 20 69 6e  | INPUT to get in|
00004b00  70 75 74 20 66 72 6f 6d  20 74 68 65 20 75 73 65  |put from the use|
00004b10  72 20 2d 20 68 6f 77 20  64 6f 20 79 6f 75 0d 0a  |r - how do you..|
00004b20  6b 6e 6f 77 20 74 68 61  74 20 74 68 65 79 20 64  |know that they d|
00004b30  69 64 6e 27 74 20 74 79  70 65 20 73 6f 20 6d 75  |idn't type so mu|
00004b40  63 68 20 74 68 61 74 20  69 74 20 77 65 6e 74 20  |ch that it went |
00004b50  6f 66 20 74 68 65 20 62  6f 74 74 6f 6d 20 6f 66  |of the bottom of|
00004b60  20 74 68 65 20 73 63 72  65 65 6e 3f 29 0d 0a 49  | the screen?)..I|
00004b70  66 20 79 6f 75 20 6b 6e  6f 77 20 77 68 61 74 20  |f you know what |
00004b80  79 6f 75 20 61 72 65 20  64 6f 69 6e 67 2c 20 74  |you are doing, t|
00004b90  68 69 73 20 72 75 6c 65  20 63 61 6e 20 62 65 20  |his rule can be |
00004ba0  69 67 6e 6f 72 65 64 2c  20 61 6e 64 20 68 69 67  |ignored, and hig|
00004bb0  68 2d 73 70 65 65 64 0d  0a 73 63 72 6f 6c 6c 69  |h-speed..scrolli|
00004bc0  6e 67 20 63 61 6e 20 62  65 20 61 63 68 69 65 76  |ng can be achiev|
00004bd0  65 64 20 61 73 20 61 20  72 65 73 75 6c 74 2c 20  |ed as a result, |
00004be0  62 75 74 20 74 68 61 74  20 69 73 20 6e 6f 74 20  |but that is not |
00004bf0  66 6f 72 20 74 68 65 20  62 65 67 69 6e 6e 65 72  |for the beginner|
00004c00  21 20 49 0d 0a 63 61 6e  20 74 65 6c 6c 20 79 6f  |! I..can tell yo|
00004c10  75 20 66 72 6f 6d 20 66  69 72 73 74 20 68 61 6e  |u from first han|
00004c20  64 20 65 78 70 65 72 69  65 6e 63 65 2c 20 74 68  |d experience, th|
00004c30  61 74 20 63 72 65 61 74  69 6e 67 20 73 63 72 6f  |at creating scro|
00004c40  6c 6c 69 6e 67 20 69 6e  20 4a 75 70 69 74 65 72  |lling in Jupiter|
00004c50  0d 0a 33 20 62 79 20 74  68 69 73 20 74 65 63 68  |..3 by this tech|
00004c60  6e 69 71 75 65 20 77 61  73 20 61 20 6e 69 67 68  |nique was a nigh|
00004c70  74 6d 61 72 65 20 2d 20  65 73 70 65 63 69 61 6c  |tmare - especial|
00004c80  6c 79 20 77 68 65 6e 20  74 68 65 20 6f 70 65 72  |ly when the oper|
00004c90  61 74 69 6e 67 20 73 79  73 74 65 6d 0d 0a 63 61  |ating system..ca|
00004ca0  6c 6c 73 20 79 6f 75 20  6e 65 65 64 20 74 6f 20  |lls you need to |
00004cb0  6d 61 6b 65 20 74 6f 20  61 63 68 69 65 76 65 20  |make to achieve |
00004cc0  74 68 69 73 20 61 72 65  20 63 6f 6d 70 6c 65 74  |this are complet|
00004cd0  65 6c 79 20 64 69 66 66  65 72 65 6e 74 20 6f 6e  |ely different on|
00004ce0  20 74 68 65 20 42 42 43  0d 0a 74 6f 20 74 68 65  | the BBC..to the|
00004cf0  20 45 6c 6b 2c 20 73 6f  20 79 6f 75 20 6e 65 65  | Elk, so you nee|
00004d00  64 20 74 6f 20 66 69 6e  64 20 6f 75 74 20 77 68  |d to find out wh|
00004d10  69 63 68 20 70 6c 61 74  66 6f 72 6d 20 79 6f 75  |ich platform you|
00004d20  20 61 72 65 20 6f 70 65  72 61 74 69 6e 67 20 6f  | are operating o|
00004d30  6e 2c 0d 0a 61 6e 64 20  74 68 65 6e 20 6d 61 6b  |n,..and then mak|
00004d40  65 20 74 68 65 20 72 65  6c 61 76 61 6e 74 20 63  |e the relavant c|
00004d50  61 6c 6c 73 20 66 6f 72  20 74 68 61 74 20 70 6c  |alls for that pl|
00004d60  61 74 66 6f 72 6d 21 0d  0a 0d 0a 4e 6f 77 20 74  |atform!....Now t|
00004d70  68 61 74 20 79 6f 75 20  63 61 6e 20 6c 6f 63 61  |hat you can loca|
00004d80  74 65 20 61 20 74 68 65  20 6d 65 6d 6f 72 79 20  |te a the memory |
00004d90  6f 63 63 75 70 69 65 64  20 62 79 20 61 20 63 68  |occupied by a ch|
00004da0  61 72 61 63 74 65 72 20  69 6e 20 73 63 72 65 65  |aracter in scree|
00004db0  6e 0d 0a 6d 65 6d 6f 72  79 2c 20 79 6f 75 20 6e  |n..memory, you n|
00004dc0  65 65 64 20 74 6f 20 6b  6e 6f 77 20 68 6f 77 20  |eed to know how |
00004dd0  74 68 65 20 62 79 74 65  73 20 77 69 74 68 69 6e  |the bytes within|
00004de0  20 74 68 69 73 20 62 6c  6f 63 6b 20 61 72 65 20  | this block are |
00004df0  6c 61 69 64 20 6f 75 74  2c 20 73 6f 20 74 68 61  |laid out, so tha|
00004e00  74 0d 0a 79 6f 75 20 63  61 6e 20 68 61 76 65 20  |t..you can have |
00004e10  70 69 78 65 6c 20 62 79  20 70 69 78 65 6c 20 63  |pixel by pixel c|
00004e20  6f 6e 74 72 6f 6c 20 6f  76 65 72 20 79 6f 75 72  |ontrol over your|
00004e30  20 6d 6f 6e 69 74 6f 72  20 73 63 72 65 65 6e 2e  | monitor screen.|
00004e40  20 54 68 69 73 20 69 73  20 61 6c 73 6f 0d 0a 72  | This is also..r|
00004e50  65 71 75 69 72 65 64 20  69 66 20 79 6f 75 20 61  |equired if you a|
00004e60  72 65 20 74 6f 20 62 65  20 61 62 6c 65 20 74 6f  |re to be able to|
00004e70  20 63 61 6c 63 75 6c 61  74 65 20 74 68 65 20 61  | calculate the a|
00004e80  6d 6f 75 6e 74 20 6f 66  20 6d 65 6d 6f 72 79 20  |mount of memory |
00004e90  74 61 6b 65 6e 20 75 70  0d 0a 62 79 20 65 61 63  |taken up..by eac|
00004ea0  68 20 63 68 61 72 61 63  74 65 72 27 73 20 64 65  |h character's de|
00004eb0  66 69 6e 69 74 69 6f 6e  20 69 6e 20 61 20 70 61  |finition in a pa|
00004ec0  72 74 69 63 75 6c 61 72  20 6d 6f 64 65 2e 0d 0a  |rticular mode...|
00004ed0  0d 0a 54 68 65 20 67 72  61 70 68 69 63 73 20 6d  |..The graphics m|
00004ee0  6f 64 65 73 20 63 61 6e  20 62 65 20 64 69 76 69  |odes can be divi|
00004ef0  64 65 64 20 69 6e 74 6f  20 74 68 72 65 65 20 63  |ded into three c|
00004f00  61 74 65 67 6f 72 69 65  73 3a 20 6d 6f 6e 6f 63  |ategories: monoc|
00004f10  68 72 6f 6d 65 20 6d 6f  64 65 73 0d 0a 28 69 65  |hrome modes..(ie|
00004f20  2e 20 74 77 6f 20 63 6f  6c 6f 75 72 73 29 2c 20  |. two colours), |
00004f30  66 6f 75 72 20 63 6f 6c  6f 75 72 20 6d 6f 64 65  |four colour mode|
00004f40  73 2c 20 61 6e 64 20 73  69 78 74 65 65 6e 20 63  |s, and sixteen c|
00004f50  6f 6c 6f 75 72 20 6d 6f  64 65 73 2e 20 41 6c 6c  |olour modes. All|
00004f60  20 6f 66 20 74 68 65 0d  0a 45 6c 6b 27 73 20 6d  | of the..Elk's m|
00004f70  6f 64 65 73 20 66 61 6c  6c 20 69 6e 74 6f 20 74  |odes fall into t|
00004f80  68 65 73 65 20 74 68 72  65 65 20 67 72 6f 75 70  |hese three group|
00004f90  69 6e 67 73 2e 20 57 68  69 63 68 20 6f 66 20 74  |ings. Which of t|
00004fa0  68 65 73 65 20 63 6f 6c  6f 75 72 73 20 65 61 63  |hese colours eac|
00004fb0  68 0d 0a 70 69 78 65 6c  20 6f 66 20 74 68 65 20  |h..pixel of the |
00004fc0  73 63 72 65 65 6e 20 69  73 20 64 65 70 65 6e 64  |screen is depend|
00004fd0  73 20 75 70 6f 6e 20 74  68 65 20 73 74 61 74 75  |s upon the statu|
00004fe0  73 20 6f 66 20 61 20 6e  75 6d 62 65 72 20 6f 66  |s of a number of|
00004ff0  20 62 69 6e 61 72 79 20  62 69 74 73 2e 0d 0a 54  | binary bits...T|
00005000  68 65 73 65 20 68 61 76  65 20 74 77 6f 20 73 74  |hese have two st|
00005010  61 74 65 73 2c 20 30 20  6f 72 20 31 2e 20 4e 6f  |ates, 0 or 1. No|
00005020  77 2c 20 69 6e 20 61 20  6d 6f 6e 6f 63 68 72 6f  |w, in a monochro|
00005030  6d 65 20 6d 6f 64 65 2c  20 6f 6e 65 20 62 69 74  |me mode, one bit|
00005040  20 69 73 0d 0a 73 75 66  66 69 63 69 65 6e 74 20  | is..sufficient |
00005050  74 6f 20 64 65 66 69 6e  65 20 74 68 65 20 63 6f  |to define the co|
00005060  6c 6f 75 72 20 6f 66 20  6f 6e 65 20 70 69 78 65  |lour of one pixe|
00005070  6c 20 28 62 69 74 73 20  68 61 76 65 20 74 77 6f  |l (bits have two|
00005080  20 73 74 61 74 65 73 2c  20 30 20 6f 72 20 31 2c  | states, 0 or 1,|
00005090  0d 0a 61 6e 64 20 74 68  65 20 70 69 78 65 6c 73  |..and the pixels|
000050a0  20 68 61 76 65 20 74 77  6f 20 73 74 61 74 65 73  | have two states|
000050b0  2c 20 63 6f 6c 6f 75 72  20 30 20 6f 72 20 63 6f  |, colour 0 or co|
000050c0  6c 6f 75 72 20 31 29 2e  20 49 6e 20 61 20 66 6f  |lour 1). In a fo|
000050d0  75 72 20 63 6f 6c 6f 75  72 20 6d 6f 64 65 2c 0d  |ur colour mode,.|
000050e0  0a 6f 6e 20 74 68 65 20  6f 74 68 65 72 20 68 61  |.on the other ha|
000050f0  6e 64 2c 20 6f 6e 65 20  62 69 74 20 77 69 6c 6c  |nd, one bit will|
00005100  20 6e 6f 74 20 62 65 20  73 75 66 66 69 63 69 65  | not be sufficie|
00005110  6e 74 2c 20 61 73 20 66  6f 75 72 20 64 69 66 66  |nt, as four diff|
00005120  65 72 65 6e 74 20 73 74  61 74 65 73 0d 0a 61 72  |erent states..ar|
00005130  65 20 72 65 71 75 69 72  65 64 2e 20 54 77 6f 20  |e required. Two |
00005140  62 69 74 73 20 77 69 6c  6c 20 62 65 20 65 6e 6f  |bits will be eno|
00005150  75 67 68 20 74 6f 20 73  74 6f 72 65 20 74 68 65  |ugh to store the|
00005160  20 63 6f 6c 6f 75 72 20  6f 66 20 6f 6e 65 20 70  | colour of one p|
00005170  69 78 65 6c 2c 0d 0a 68  6f 77 65 76 65 72 3a 0d  |ixel,..however:.|
00005180  0a 0d 0a 42 69 74 20 31  20 73 74 61 74 65 20 20  |...Bit 1 state  |
00005190  20 20 20 42 69 74 20 32  20 73 74 61 74 65 20 20  |   Bit 2 state  |
000051a0  20 20 20 43 6f 6c 6f 75  72 0d 0a 20 20 30 20 20  |   Colour..  0  |
000051b0  20 20 20 20 20 20 20 20  20 20 20 20 20 30 20 20  |             0  |
000051c0  20 20 20 20 20 20 20 20  20 20 20 20 20 30 0d 0a  |             0..|
000051d0  20 20 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |  0             |
000051e0  20 20 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |  1             |
000051f0  20 20 31 0d 0a 20 20 31  20 20 20 20 20 20 20 20  |  1..  1        |
00005200  20 20 20 20 20 20 20 30  20 20 20 20 20 20 20 20  |       0        |
00005210  20 20 20 20 20 20 20 32  0d 0a 20 20 31 20 20 20  |       2..  1   |
00005220  20 20 20 20 20 20 20 20  20 20 20 20 31 20 20 20  |            1   |
00005230  20 20 20 20 20 20 20 20  20 20 20 20 33 0d 0a 0d  |            3...|
00005240  0a 54 68 6f 73 65 20 66  61 6d 69 6c 69 61 72 20  |.Those familiar |
00005250  77 69 74 68 20 62 69 6e  61 72 79 20 77 69 6c 6c  |with binary will|
00005260  20 73 70 6f 74 20 74 68  65 20 70 61 74 74 65 72  | spot the patter|
00005270  6e 20 73 74 72 61 69 67  68 74 20 61 77 61 79 20  |n straight away |
00005280  2d 20 73 69 6d 70 6c 79  0d 0a 63 6f 6e 76 65 72  |- simply..conver|
00005290  74 20 74 68 65 20 62 69  6e 61 72 79 20 76 61 6c  |t the binary val|
000052a0  75 65 20 6f 66 20 74 68  65 20 74 77 6f 20 62 69  |ue of the two bi|
000052b0  74 73 20 69 6e 74 6f 20  64 65 63 69 6d 61 6c 2c  |ts into decimal,|
000052c0  20 61 6e 64 20 79 6f 75  20 68 61 76 65 20 74 68  | and you have th|
000052d0  65 0d 0a 6c 6f 67 69 63  61 6c 20 63 6f 6c 6f 75  |e..logical colou|
000052e0  72 20 6e 75 6d 62 65 72  2e 20 41 20 76 65 72 79  |r number. A very|
000052f0  20 73 69 6d 69 6c 61 72  20 70 61 74 74 65 72 6e  | similar pattern|
00005300  20 61 70 70 6c 69 65 73  20 74 6f 20 4d 4f 44 45  | applies to MODE|
00005310  20 32 20 2d 20 74 68 65  20 45 6c 6b 27 73 0d 0a  | 2 - the Elk's..|
00005320  31 36 20 63 6f 6c 6f 75  72 20 6d 6f 64 65 2e 20  |16 colour mode. |
00005330  45 61 63 68 20 70 69 78  65 6c 20 72 65 71 75 69  |Each pixel requi|
00005340  72 65 73 20 34 20 62 69  74 73 20 74 6f 20 73 74  |res 4 bits to st|
00005350  6f 72 65 20 69 74 73 20  63 6f 6c 6f 75 72 20 28  |ore its colour (|
00005360  32 5e 34 3d 31 36 29 2e  0d 0a 4f 6e 63 65 20 61  |2^4=16)...Once a|
00005370  67 61 69 6e 2c 20 74 68  65 20 63 6f 6c 6f 75 72  |gain, the colour|
00005380  20 6f 66 20 74 68 65 20  70 69 78 65 6c 20 69 73  | of the pixel is|
00005390  20 74 68 65 20 6c 6f 67  69 63 61 6c 20 63 6f 6c  | the logical col|
000053a0  6f 75 72 20 77 68 6f 73  65 20 6e 75 6d 62 65 72  |our whose number|
000053b0  20 69 73 0d 0a 67 69 76  65 6e 20 77 68 65 6e 20  | is..given when |
000053c0  74 68 65 20 66 6f 75 72  20 62 69 74 73 20 61 72  |the four bits ar|
000053d0  65 20 70 75 74 20 74 6f  67 65 74 68 65 72 20 74  |e put together t|
000053e0  6f 20 66 6f 72 6d 20 61  20 62 69 6e 61 72 79 20  |o form a binary |
000053f0  76 61 6c 75 65 3a 0d 0a  0d 0a 42 69 74 20 31 20  |value:....Bit 1 |
00005400  73 74 61 74 65 20 20 42  69 74 20 32 20 73 74 61  |state  Bit 2 sta|
00005410  74 65 20 20 42 69 74 20  33 20 73 74 61 74 65 20  |te  Bit 3 state |
00005420  20 42 69 74 20 34 20 73  74 61 74 65 20 20 43 6f  | Bit 4 state  Co|
00005430  6c 6f 75 72 20 20 44 65  66 61 75 6c 74 0d 0a 20  |lour  Default.. |
00005440  20 30 20 20 20 20 20 20  20 20 20 20 20 20 30 20  | 0            0 |
00005450  20 20 20 20 20 20 20 20  20 20 20 30 20 20 20 20  |           0    |
00005460  20 20 20 20 20 20 20 20  30 20 20 20 20 20 20 20  |        0       |
00005470  20 20 20 20 20 30 20 20  20 20 20 20 20 42 4c 4b  |     0       BLK|
00005480  0d 0a 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |..  0           |
00005490  20 30 20 20 20 20 20 20  20 20 20 20 20 20 30 20  | 0            0 |
000054a0  20 20 20 20 20 20 20 20  20 20 20 31 20 20 20 20  |           1    |
000054b0  20 20 20 20 20 20 20 20  31 20 20 20 20 20 20 20  |        1       |
000054c0  52 45 44 0d 0a 20 20 30  20 20 20 20 20 20 20 20  |RED..  0        |
000054d0  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
000054e0  20 31 20 20 20 20 20 20  20 20 20 20 20 20 30 20  | 1            0 |
000054f0  20 20 20 20 20 20 20 20  20 20 20 32 20 20 20 20  |           2    |
00005500  20 20 20 47 52 4e 0d 0a  20 20 30 20 20 20 20 20  |   GRN..  0     |
00005510  20 20 20 20 20 20 20 30  20 20 20 20 20 20 20 20  |       0        |
00005520  20 20 20 20 31 20 20 20  20 20 20 20 20 20 20 20  |    1           |
00005530  20 31 20 20 20 20 20 20  20 20 20 20 20 20 33 20  | 1            3 |
00005540  20 20 20 20 20 20 59 45  4c 0d 0a 20 20 30 20 20  |      YEL..  0  |
00005550  20 20 20 20 20 20 20 20  20 20 31 20 20 20 20 20  |          1     |
00005560  20 20 20 20 20 20 20 30  20 20 20 20 20 20 20 20  |       0        |
00005570  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
00005580  20 34 20 20 20 20 20 20  20 42 4c 45 0d 0a 20 20  | 4       BLE..  |
00005590  30 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |0            1  |
000055a0  20 20 20 20 20 20 20 20  20 20 30 20 20 20 20 20  |          0     |
000055b0  20 20 20 20 20 20 20 31  20 20 20 20 20 20 20 20  |       1        |
000055c0  20 20 20 20 35 20 20 20  20 20 20 20 4d 47 54 0d  |    5       MGT.|
000055d0  0a 20 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |.  0            |
000055e0  31 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |1            1  |
000055f0  20 20 20 20 20 20 20 20  20 20 30 20 20 20 20 20  |          0     |
00005600  20 20 20 20 20 20 20 36  20 20 20 20 20 20 20 43  |       6       C|
00005610  59 4e 0d 0a 20 20 30 20  20 20 20 20 20 20 20 20  |YN..  0         |
00005620  20 20 20 31 20 20 20 20  20 20 20 20 20 20 20 20  |   1            |
00005630  31 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |1            1  |
00005640  20 20 20 20 20 20 20 20  20 20 37 20 20 20 20 20  |          7     |
00005650  20 20 57 48 54 0d 0a 20  20 31 20 20 20 20 20 20  |  WHT..  1      |
00005660  20 20 20 20 20 20 30 20  20 20 20 20 20 20 20 20  |      0         |
00005670  20 20 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |   0            |
00005680  30 20 20 20 20 20 20 20  20 20 20 20 20 38 20 20  |0            8  |
00005690  20 20 20 42 4c 4b 2f 57  48 54 0d 0a 20 20 31 20  |   BLK/WHT..  1 |
000056a0  20 20 20 20 20 20 20 20  20 20 20 30 20 20 20 20  |           0    |
000056b0  20 20 20 20 20 20 20 20  30 20 20 20 20 20 20 20  |        0       |
000056c0  20 20 20 20 20 31 20 20  20 20 20 20 20 20 20 20  |     1          |
000056d0  20 20 39 20 20 20 20 20  52 45 44 2f 43 59 4e 0d  |  9     RED/CYN.|
000056e0  0a 20 20 31 20 20 20 20  20 20 20 20 20 20 20 20  |.  1            |
000056f0  30 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |0            1  |
00005700  20 20 20 20 20 20 20 20  20 20 30 20 20 20 20 20  |          0     |
00005710  20 20 20 20 20 20 20 31  30 20 20 20 20 47 52 4e  |       10    GRN|
00005720  2f 4d 47 54 0d 0a 20 20  31 20 20 20 20 20 20 20  |/MGT..  1       |
00005730  20 20 20 20 20 30 20 20  20 20 20 20 20 20 20 20  |     0          |
00005740  20 20 31 20 20 20 20 20  20 20 20 20 20 20 20 31  |  1            1|
00005750  20 20 20 20 20 20 20 20  20 20 20 20 31 31 20 20  |            11  |
00005760  20 20 59 45 4c 2f 42 4c  45 0d 0a 20 20 31 20 20  |  YEL/BLE..  1  |
00005770  20 20 20 20 20 20 20 20  20 20 31 20 20 20 20 20  |          1     |
00005780  20 20 20 20 20 20 20 30  20 20 20 20 20 20 20 20  |       0        |
00005790  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
000057a0  20 31 32 20 20 20 20 42  4c 45 2f 59 45 4c 0d 0a  | 12    BLE/YEL..|
000057b0  20 20 31 20 20 20 20 20  20 20 20 20 20 20 20 31  |  1            1|
000057c0  20 20 20 20 20 20 20 20  20 20 20 20 30 20 20 20  |            0   |
000057d0  20 20 20 20 20 20 20 20  20 31 20 20 20 20 20 20  |         1      |
000057e0  20 20 20 20 20 20 31 33  20 20 20 20 4d 47 54 2f  |      13    MGT/|
000057f0  47 52 4e 0d 0a 20 20 31  20 20 20 20 20 20 20 20  |GRN..  1        |
00005800  20 20 20 20 31 20 20 20  20 20 20 20 20 20 20 20  |    1           |
00005810  20 31 20 20 20 20 20 20  20 20 20 20 20 20 30 20  | 1            0 |
00005820  20 20 20 20 20 20 20 20  20 20 20 31 34 20 20 20  |           14   |
00005830  20 43 59 4e 2f 52 45 44  0d 0a 20 20 31 20 20 20  | CYN/RED..  1   |
00005840  20 20 20 20 20 20 20 20  20 31 20 20 20 20 20 20  |         1      |
00005850  20 20 20 20 20 20 31 20  20 20 20 20 20 20 20 20  |      1         |
00005860  20 20 20 31 20 20 20 20  20 20 20 20 20 20 20 20  |   1            |
00005870  31 35 20 20 20 20 57 48  54 2f 42 4c 4b 0d 0a 0d  |15    WHT/BLK...|
00005880  0a 5b 44 65 66 61 75 6c  74 3a 20 44 65 66 61 75  |.[Default: Defau|
00005890  6c 74 20 73 65 74 74 69  6e 67 20 6f 66 20 74 68  |lt setting of th|
000058a0  69 73 20 6c 6f 67 69 63  61 6c 20 63 6f 6c 6f 75  |is logical colou|
000058b0  72 20 77 68 65 6e 20 4d  4f 44 45 20 32 20 69 73  |r when MODE 2 is|
000058c0  20 66 69 72 73 74 0d 0a  65 6e 74 65 72 65 64 5d  | first..entered]|
000058d0  0d 0a 0d 0a 53 6f 2e 2e  2e 20 74 68 65 20 45 6c  |....So... the El|
000058e0  65 63 74 72 6f 6e 20 68  61 73 20 6d 6f 64 65 73  |ectron has modes|
000058f0  20 77 68 65 72 65 20 74  68 65 20 64 65 66 69 6e  | where the defin|
00005900  69 74 69 6f 6e 20 6f 66  20 74 68 65 20 63 6f 6c  |ition of the col|
00005910  6f 75 72 20 6f 66 20 61  0d 0a 63 65 72 74 61 69  |our of a..certai|
00005920  6e 20 70 69 78 65 6c 20  63 61 6e 20 74 61 6b 65  |n pixel can take|
00005930  20 31 2c 20 32 20 6f 72  20 34 20 62 69 74 73 2e  | 1, 2 or 4 bits.|
00005940  20 41 73 20 65 61 63 68  20 62 79 74 65 20 6f 66  | As each byte of|
00005950  20 74 68 65 20 65 6c 65  63 74 72 6f 6e 27 73 0d  | the electron's.|
00005960  0a 6d 65 6d 6f 72 79 20  63 6f 6e 73 69 73 74 73  |.memory consists|
00005970  20 6f 66 20 38 20 73 65  70 65 72 61 74 65 20 62  | of 8 seperate b|
00005980  69 74 73 2c 20 74 68 69  73 20 6d 65 61 6e 73 20  |its, this means |
00005990  74 68 61 74 20 69 6e 20  6d 6f 6e 6f 63 68 72 6f  |that in monochro|
000059a0  6d 65 20 6d 6f 64 65 73  0d 0a 77 65 20 63 61 6e  |me modes..we can|
000059b0  20 66 69 74 20 38 20 70  69 78 65 6c 73 20 69 6e  | fit 8 pixels in|
000059c0  74 6f 20 65 61 63 68 20  62 79 74 65 20 28 38 2f  |to each byte (8/|
000059d0  31 3d 38 29 2e 20 49 6e  20 66 6f 75 72 20 63 6f  |1=8). In four co|
000059e0  6c 6f 75 72 20 6d 6f 64  65 73 20 28 77 68 65 72  |lour modes (wher|
000059f0  65 0d 0a 65 61 63 68 20  70 69 78 65 6c 20 72 65  |e..each pixel re|
00005a00  71 75 69 72 65 73 20 74  77 6f 20 62 69 74 73 29  |quires two bits)|
00005a10  20 77 65 20 63 61 6e 20  66 69 74 20 34 20 70 69  | we can fit 4 pi|
00005a20  78 65 6c 73 20 69 6e 74  6f 20 65 61 63 68 20 62  |xels into each b|
00005a30  79 74 65 20 28 38 2f 32  3d 34 29 2e 0d 0a 46 69  |yte (8/2=4)...Fi|
00005a40  6e 61 6c 6c 79 20 69 6e  20 4d 4f 44 45 20 32 20  |nally in MODE 2 |
00005a50  28 74 68 65 20 73 69 78  74 65 65 6e 20 63 6f 6c  |(the sixteen col|
00005a60  6f 75 72 20 6d 6f 64 65  20 77 68 65 72 65 20 65  |our mode where e|
00005a70  61 63 68 20 70 69 78 65  6c 20 72 65 71 75 69 72  |ach pixel requir|
00005a80  65 73 20 34 0d 0a 62 69  74 73 29 20 77 65 20 63  |es 4..bits) we c|
00005a90  61 6e 20 66 69 74 20 74  77 6f 20 70 69 78 65 6c  |an fit two pixel|
00005aa0  73 20 69 6e 74 6f 20 65  61 63 68 20 62 79 74 65  |s into each byte|
00005ab0  2e 20 4c 65 74 27 73 20  6e 6f 77 20 6c 6f 6f 6b  |. Let's now look|
00005ac0  20 61 74 20 68 6f 77 20  65 61 63 68 20 69 73 0d  | at how each is.|
00005ad0  0a 6c 61 69 64 20 6f 75  74 20 69 6e 20 6d 6f 72  |.laid out in mor|
00005ae0  65 20 64 65 70 74 68 3a  0d 0a 0d 0a 4d 4f 4e 4f  |e depth:....MONO|
00005af0  43 48 52 4f 4d 45 20 4d  4f 44 45 53 3a 0d 0a 0d  |CHROME MODES:...|
00005b00  0a 54 68 65 73 65 20 61  72 65 20 6c 61 69 64 20  |.These are laid |
00005b10  6f 75 74 20 69 6e 20 74  68 65 20 73 69 6d 70 6c  |out in the simpl|
00005b20  65 73 74 20 77 61 79 2c  20 61 73 20 65 69 67 68  |est way, as eigh|
00005b30  74 20 70 69 78 65 6c 73  20 66 69 74 20 69 6e 74  |t pixels fit int|
00005b40  6f 20 65 61 63 68 20 62  79 74 65 2e 0d 0a 54 68  |o each byte...Th|
00005b50  65 20 63 68 61 72 61 63  74 65 72 2c 20 72 65 6d  |e character, rem|
00005b60  65 6d 62 65 72 2c 20 63  6f 6e 73 69 73 74 73 20  |ember, consists |
00005b70  6f 66 20 61 6e 20 38 20  62 79 20 38 20 73 71 75  |of an 8 by 8 squ|
00005b80  61 72 65 20 6f 66 20 70  69 78 65 6c 73 2e 20 54  |are of pixels. T|
00005b90  68 65 20 64 61 74 61 0d  0a 69 73 20 73 74 6f 72  |he data..is stor|
00005ba0  65 64 20 69 6e 20 74 68  65 20 73 61 6d 65 20 77  |ed in the same w|
00005bb0  61 79 20 61 73 20 75 73  65 72 20 64 65 66 69 6e  |ay as user defin|
00005bc0  65 64 20 63 68 61 72 61  63 74 65 72 73 20 61 72  |ed characters ar|
00005bd0  65 20 64 65 66 69 6e 65  64 20 75 73 69 6e 67 0d  |e defined using.|
00005be0  0a 56 44 55 32 33 2e 20  54 68 65 20 66 69 72 73  |.VDU23. The firs|
00005bf0  74 20 62 79 74 65 20 6f  66 20 74 68 65 20 64 65  |t byte of the de|
00005c00  66 69 6e 69 74 69 6f 6e  20 64 65 66 69 6e 65 73  |finition defines|
00005c10  20 74 68 65 20 74 6f 70  20 72 6f 77 20 6f 66 20  | the top row of |
00005c20  65 69 67 68 74 20 70 69  78 65 6c 73 3b 0d 0a 74  |eight pixels;..t|
00005c30  68 65 20 73 65 63 6f 6e  64 20 64 65 66 69 6e 65  |he second define|
00005c40  73 20 74 68 65 20 73 65  63 6f 6e 64 20 72 6f 77  |s the second row|
00005c50  20 64 6f 77 6e 2c 20 65  74 63 2e 20 54 68 75 73  | down, etc. Thus|
00005c60  20 74 68 65 20 65 6e 74  69 72 65 20 63 68 61 72  | the entire char|
00005c70  61 63 74 65 72 20 63 61  6e 0d 0a 62 65 20 64 65  |acter can..be de|
00005c80  66 69 6e 65 64 20 69 6e  20 65 69 67 68 74 20 62  |fined in eight b|
00005c90  79 74 65 73 2c 20 61 6e  64 20 74 68 69 73 20 69  |ytes, and this i|
00005ca0  73 20 74 68 65 20 6e 75  6d 62 65 72 20 6f 66 20  |s the number of |
00005cb0  62 79 74 65 73 20 6f 66  20 74 68 65 20 45 6c 6b  |bytes of the Elk|
00005cc0  27 73 0d 0a 6d 65 6d 6f  72 79 20 77 68 69 63 68  |'s..memory which|
00005cd0  20 69 73 20 75 73 65 64  20 62 79 20 65 61 63 68  | is used by each|
00005ce0  20 63 68 61 72 61 63 74  65 72 2e 20 4e 6f 74 65  | character. Note|
00005cf0  20 2d 20 74 68 65 20 6d  6f 73 74 20 73 69 67 6e  | - the most sign|
00005d00  69 66 69 63 61 6e 74 20  62 69 74 20 6f 66 0d 0a  |ificant bit of..|
00005d10  65 61 63 68 20 62 79 74  65 20 64 65 66 69 6e 65  |each byte define|
00005d20  73 20 74 68 65 20 6c 65  66 74 2d 6d 6f 73 74 20  |s the left-most |
00005d30  70 69 78 65 6c 20 6f 66  20 74 68 65 20 72 6f 77  |pixel of the row|
00005d40  2c 20 61 6e 64 20 74 68  65 20 6c 65 61 73 74 20  |, and the least |
00005d50  73 69 67 6e 69 66 69 63  61 6e 74 0d 0a 62 69 74  |significant..bit|
00005d60  20 64 65 66 69 6e 65 73  20 74 68 65 20 72 69 67  | defines the rig|
00005d70  68 74 2d 6d 6f 73 74 20  70 69 78 65 6c 20 28 6a  |ht-most pixel (j|
00005d80  75 73 74 20 61 73 20 77  69 74 68 20 56 44 55 20  |ust as with VDU |
00005d90  32 33 20 64 65 66 69 6e  69 74 69 6f 6e 73 29 0d  |23 definitions).|
00005da0  0a 0d 0a 46 4f 55 52 20  43 4f 4c 4f 55 52 20 4d  |...FOUR COLOUR M|
00005db0  4f 44 45 53 3a 0d 0a 0d  0a 54 68 69 73 20 74 69  |ODES:....This ti|
00005dc0  6d 65 20 65 61 63 68 20  62 79 74 65 20 63 61 6e  |me each byte can|
00005dd0  20 6f 6e 6c 79 20 68 6f  6c 64 20 66 6f 75 72 20  | only hold four |
00005de0  70 69 78 65 6c 73 2e 20  4f 6e 63 65 20 61 67 61  |pixels. Once aga|
00005df0  69 6e 2c 20 65 61 63 68  20 62 79 74 65 20 68 6f  |in, each byte ho|
00005e00  6c 64 73 0d 0a 61 20 6e  75 6d 62 65 72 20 6f 66  |lds..a number of|
00005e10  20 70 69 78 65 6c 73 20  77 68 69 63 68 20 61 72  | pixels which ar|
00005e20  65 20 69 6e 20 61 20 68  6f 72 69 7a 6f 6e 74 61  |e in a horizonta|
00005e30  6c 20 6c 69 6e 65 2e 20  54 68 69 73 20 74 69 6d  |l line. This tim|
00005e40  65 2c 20 61 73 20 62 65  66 6f 72 65 2c 0d 0a 74  |e, as before,..t|
00005e50  68 65 20 66 69 72 73 74  20 65 69 67 68 74 20 62  |he first eight b|
00005e60  79 74 65 73 20 72 75 6e  20 64 6f 77 6e 20 69 6e  |ytes run down in|
00005e70  20 61 20 76 65 72 74 69  63 61 6c 20 6c 69 6e 65  | a vertical line|
00005e80  2e 20 54 68 69 73 20 74  69 6d 65 2c 20 74 68 6f  |. This time, tho|
00005e90  75 67 68 2c 20 6e 6f 74  0d 0a 61 6c 6c 20 6f 66  |ugh, not..all of|
00005ea0  20 74 68 65 20 70 69 78  65 6c 73 20 69 6e 20 74  | the pixels in t|
00005eb0  68 65 20 63 68 61 72 61  63 74 65 72 20 61 72 65  |he character are|
00005ec0  20 62 65 69 6e 67 20 64  65 66 69 6e 65 64 2c 20  | being defined, |
00005ed0  61 6e 64 20 6f 6e 6c 79  20 74 68 65 20 6c 65 66  |and only the lef|
00005ee0  74 0d 0a 6d 6f 73 74 20  34 20 70 69 78 65 6c 73  |t..most 4 pixels|
00005ef0  2e 20 54 68 65 20 72 69  67 68 74 2d 6d 6f 73 74  |. The right-most|
00005f00  20 66 6f 75 72 20 70 69  78 65 6c 73 20 61 72 65  | four pixels are|
00005f10  20 64 65 66 69 6e 65 64  20 69 6e 20 61 20 73 65  | defined in a se|
00005f20  63 6f 6e 64 20 64 6f 77  6e 77 61 72 64 0d 0a 76  |cond downward..v|
00005f30  65 72 74 69 63 61 6c 20  73 77 65 65 70 2e 20 54  |ertical sweep. T|
00005f40  68 75 73 20 74 68 65 20  74 6f 74 61 6c 20 6d 65  |hus the total me|
00005f50  6d 6f 72 79 20 61 6c 6c  6f 63 61 74 69 6f 6e 20  |mory allocation |
00005f60  66 6f 72 20 65 61 63 68  20 63 68 61 72 61 63 74  |for each charact|
00005f70  65 72 20 69 73 0d 0a 73  69 78 74 65 65 6e 20 62  |er is..sixteen b|
00005f80  79 74 65 73 2e 20 54 68  65 20 6c 61 79 6f 75 74  |ytes. The layout|
00005f90  20 69 73 20 73 68 6f 77  6e 20 6d 6f 72 65 20 63  | is shown more c|
00005fa0  6c 65 61 72 6c 79 20 75  73 69 6e 67 20 61 20 64  |learly using a d|
00005fb0  69 61 67 72 61 6d 2e 20  54 68 69 73 0d 0a 73 68  |iagram. This..sh|
00005fc0  6f 77 73 20 74 68 65 20  65 69 67 68 74 20 62 79  |ows the eight by|
00005fd0  20 65 69 67 68 74 20 62  6c 6f 63 6b 20 6f 66 20  | eight block of |
00005fe0  70 69 78 65 6c 73 20 69  6e 20 61 20 63 68 61 72  |pixels in a char|
00005ff0  61 63 74 65 72 2c 20 61  6e 64 20 65 61 63 68 20  |acter, and each |
00006000  68 61 73 0d 0a 74 68 65  20 6f 66 66 73 65 74 20  |has..the offset |
00006010  6f 66 20 74 68 65 20 6d  65 6d 6f 72 79 20 6c 6f  |of the memory lo|
00006020  63 61 74 69 6f 6e 20 77  68 65 72 65 20 74 68 69  |cation where thi|
00006030  73 20 70 69 78 65 6c 20  69 73 20 73 74 6f 72 65  |s pixel is store|
00006040  64 20 66 72 6f 6d 20 74  68 65 0d 0a 73 74 61 72  |d from the..star|
00006050  74 20 6f 66 20 74 68 65  20 63 68 61 72 61 63 74  |t of the charact|
00006060  65 72 20 64 65 66 69 6e  69 74 69 6f 6e 2e 20 4f  |er definition. O|
00006070  66 66 73 65 74 73 20 61  72 65 20 67 69 76 65 6e  |ffsets are given|
00006080  20 69 6e 20 68 65 78 69  64 65 63 69 6d 61 6c 3a  | in hexidecimal:|
00006090  0d 0a 0d 0a 50 49 58 45  4c 2d 42 59 20 50 49 58  |....PIXEL-BY PIX|
000060a0  45 4c 20 4c 41 59 4f 55  54 20 20 20 20 4d 45 4d  |EL LAYOUT    MEM|
000060b0  4f 52 59 20 46 4c 4f 57  0d 0a 0d 0a 30 30 30 30  |ORY FLOW....0000|
000060c0  38 38 38 38 20 20 20 20  20 20 20 20 20 20 20 20  |8888            |
000060d0  20 20 20 20 20 20 20 30  20 20 20 20 20 20 38 0d  |       0      8.|
000060e0  0a 31 31 31 31 39 39 39  39 20 20 20 20 20 20 20  |.11119999       |
000060f0  20 20 20 20 20 20 20 20  20 20 20 20 dd 20 20 20  |            .   |
00006100  20 20 20 dd 0d 0a 32 32  32 32 41 41 41 41 20 20  |   ...2222AAAA  |
00006110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006120  20 dd 20 20 20 20 20 20  dd 0d 0a 33 33 33 33 42  | .      ...3333B|
00006130  42 42 42 20 20 20 20 20  20 20 20 20 20 20 20 20  |BBB             |
00006140  20 20 20 20 20 20 dd 20  20 20 20 20 20 dd 0d 0a  |      .      ...|
00006150  34 34 34 34 43 43 43 43  20 20 20 20 20 20 20 20  |4444CCCC        |
00006160  20 20 20 20 20 20 20 20  20 20 20 dd 20 20 20 20  |           .    |
00006170  20 20 dd 0d 0a 35 35 35  35 44 44 44 44 20 20 20  |  ...5555DDDD   |
00006180  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006190  dd 20 20 20 20 20 20 dd  0d 0a 36 36 36 36 45 45  |.      ...6666EE|
000061a0  45 45 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |EE              |
000061b0  20 20 20 20 5c 20 2f 20  20 20 20 5c 20 2f 0d 0a  |    \ /    \ /..|
000061c0  37 37 37 37 46 46 46 46  20 20 20 20 20 20 20 20  |7777FFFF        |
000061d0  20 20 20 20 20 20 20 20  20 20 20 37 20 20 20 20  |           7    |
000061e0  20 20 46 0d 0a 0d 0a 45  61 63 68 20 6f 66 20 74  |  F....Each of t|
000061f0  68 65 73 65 20 73 69 78  74 65 65 6e 20 62 79 74  |hese sixteen byt|
00006200  65 73 2c 20 61 73 20 61  6c 72 65 61 64 79 20 64  |es, as already d|
00006210  69 73 63 75 73 73 65 64  2c 20 63 6f 6e 74 61 69  |iscussed, contai|
00006220  6e 73 20 66 6f 75 72 20  70 69 78 65 6c 0d 0a 64  |ns four pixel..d|
00006230  65 66 69 6e 69 74 69 6f  6e 73 2e 20 42 75 74 20  |efinitions. But |
00006240  77 69 74 68 69 6e 20 74  68 65 20 62 79 74 65 27  |within the byte'|
00006250  73 20 65 69 67 68 74 20  62 69 74 73 2c 20 74 68  |s eight bits, th|
00006260  65 79 20 61 72 65 20 6e  6f 74 20 6c 61 69 64 20  |ey are not laid |
00006270  6f 75 74 20 61 73 0d 0a  79 6f 75 20 6d 69 67 68  |out as..you migh|
00006280  74 20 61 74 20 66 69 72  73 74 20 69 6d 61 67 69  |t at first imagi|
00006290  6e 65 2e 20 49 66 20 77  65 20 63 61 6c 6c 20 74  |ne. If we call t|
000062a0  68 65 20 66 6f 75 72 20  70 69 78 65 6c 73 20 41  |he four pixels A|
000062b0  2c 20 42 2c 20 43 20 61  6e 64 20 44 20 28 41 20  |, B, C and D (A |
000062c0  69 73 0d 0a 6c 65 66 74  2d 6d 6f 73 74 2c 20 44  |is..left-most, D|
000062d0  20 69 73 20 72 69 67 68  74 2d 6d 6f 73 74 29 2c  | is right-most),|
000062e0  20 74 68 65 20 6c 61 79  20 6f 75 74 20 69 73 3a  | the lay out is:|
000062f0  0d 0a 0d 0a 5b 4d 4f 53  54 20 53 49 47 4e 49 46  |....[MOST SIGNIF|
00006300  49 43 41 4e 54 5d 20 20  20 20 41 31 20 42 31 20  |ICANT]    A1 B1 |
00006310  43 31 20 44 31 20 41 30  20 42 30 20 43 30 20 44  |C1 D1 A0 B0 C0 D|
00006320  30 20 20 20 20 5b 4c 45  41 53 54 20 53 49 47 4e  |0    [LEAST SIGN|
00006330  49 46 49 43 41 4e 54 5d  0d 0a 0d 0a 57 68 65 72  |IFICANT]....Wher|
00006340  65 3a 20 41 31 3a 20 4d  6f 73 74 20 73 69 67 6e  |e: A1: Most sign|
00006350  69 66 69 63 61 6e 74 20  62 69 74 20 6f 66 20 41  |ificant bit of A|
00006360  27 73 20 64 65 66 69 6e  69 74 69 6f 6e 20 20 dd  |'s definition  .|
00006370  20 54 77 6f 20 62 69 74  20 64 65 66 69 6e 69 74  | Two bit definit|
00006380  69 6f 6e 0d 0a 20 20 20  20 20 20 20 41 30 3a 20  |ion..       A0: |
00006390  4c 65 61 73 74 20 73 69  67 6e 69 66 69 63 61 6e  |Least significan|
000063a0  74 20 62 69 74 20 6f 66  20 41 27 73 20 64 65 66  |t bit of A's def|
000063b0  69 6e 69 74 69 6f 6e 20  dd 20 20 6f 66 20 70 69  |inition .  of pi|
000063c0  78 65 6c 20 41 2e 0d 0a  0d 0a 54 68 65 20 73 61  |xel A.....The sa|
000063d0  6d 65 20 70 61 74 74 65  72 6e 20 68 6f 6c 64 73  |me pattern holds|
000063e0  20 66 6f 72 20 42 2c 20  43 20 61 6e 64 20 44 2e  | for B, C and D.|
000063f0  0d 0a 0d 0a 45 78 61 6d  70 6c 65 3a 0d 0a 0d 0a  |....Example:....|
00006400  4c 65 74 27 73 20 73 75  70 70 6f 73 65 20 77 65  |Let's suppose we|
00006410  20 77 61 6e 74 20 74 6f  20 73 65 74 20 74 68 65  | want to set the|
00006420  20 63 6f 6c 6f 75 72 20  6f 66 20 74 68 65 20 6c  | colour of the l|
00006430  65 66 74 2d 6d 6f 73 74  20 70 69 78 65 6c 20 69  |eft-most pixel i|
00006440  6e 20 61 20 62 79 74 65  0d 0a 6f 66 20 61 20 66  |n a byte..of a f|
00006450  6f 75 72 20 63 6f 6c 6f  75 72 20 6d 6f 64 65 20  |our colour mode |
00006460  74 6f 20 62 65 20 63 6f  6c 6f 75 72 20 33 2e 20  |to be colour 3. |
00006470  57 65 20 77 6f 75 6c 64  20 75 73 65 3a 0d 0a 0d  |We would use:...|
00006480  0a 3f 61 64 64 72 65 73  73 3d 28 3f 61 64 64 72  |.?address=(?addr|
00006490  65 73 73 20 41 4e 44 20  26 37 37 29 20 4f 52 20  |ess AND &77) OR |
000064a0  26 38 38 0d 0a 0d 0a 45  78 70 6c 61 6e 61 74 69  |&88....Explanati|
000064b0  6f 6e 20 2d 20 54 68 65  20 28 3f 61 64 64 72 65  |on - The (?addre|
000064c0  73 73 20 41 4e 44 20 26  37 37 29 20 62 69 74 20  |ss AND &77) bit |
000064d0  63 6c 65 61 72 73 20 74  68 65 20 74 77 6f 20 62  |clears the two b|
000064e0  69 74 73 20 64 65 66 69  6e 69 6e 67 20 74 68 65  |its defining the|
000064f0  0d 0a 70 69 78 65 6c 20  74 68 61 74 20 77 65 20  |..pixel that we |
00006500  77 61 6e 74 20 74 6f 20  63 68 61 6e 67 65 2e 20  |want to change. |
00006510  54 68 65 20 4f 52 20 26  38 38 20 74 68 65 6e 20  |The OR &88 then |
00006520  73 65 74 73 20 74 68 65  20 74 77 6f 20 62 69 74  |sets the two bit|
00006530  73 20 74 68 61 74 20 77  65 0d 0a 77 61 6e 74 20  |s that we..want |
00006540  73 65 74 2e 20 54 68 69  73 20 77 61 79 20 77 65  |set. This way we|
00006550  20 65 6e 73 75 72 65 20  74 68 61 74 20 77 68 65  | ensure that whe|
00006560  6e 20 77 65 20 61 72 65  20 67 6f 69 6e 67 20 77  |n we are going w|
00006570  61 79 20 66 72 6f 6d 20  63 6f 6c 6f 75 72 20 31  |ay from colour 1|
00006580  20 74 6f 0d 0a 63 6f 6c  6f 75 72 20 32 2c 20 74  | to..colour 2, t|
00006590  68 65 20 6c 65 61 73 74  20 73 69 67 6e 69 66 69  |he least signifi|
000065a0  63 61 6e 74 20 62 69 74  20 6f 66 20 74 68 65 20  |cant bit of the |
000065b0  64 65 66 69 6e 69 74 69  6f 6e 20 69 73 20 63 6c  |definition is cl|
000065c0  65 61 72 65 64 20 61 73  20 77 65 6c 6c 0d 0a 61  |eared as well..a|
000065d0  73 20 74 68 65 20 6d 6f  73 74 20 73 69 67 6e 69  |s the most signi|
000065e0  66 69 63 61 6e 74 20 62  69 74 20 62 65 69 6e 67  |ficant bit being|
000065f0  20 73 65 74 2e 0d 0a 0d  0a 49 74 20 69 73 20 69  | set.....It is i|
00006600  6d 70 6f 72 74 61 6e 74  20 74 6f 20 6e 6f 74 69  |mportant to noti|
00006610  63 65 20 74 68 65 20 70  61 74 74 65 72 6e 20 69  |ce the pattern i|
00006620  6e 20 74 68 65 73 65 20  62 69 74 73 20 2d 20 65  |n these bits - e|
00006630  61 63 68 20 70 69 78 65  6c 20 72 65 71 75 69 72  |ach pixel requir|
00006640  65 73 0d 0a 61 20 74 77  6f 20 62 69 74 20 64 65  |es..a two bit de|
00006650  66 69 6e 69 74 69 6f 6e  2c 20 62 75 74 20 74 68  |finition, but th|
00006660  65 73 65 20 74 77 6f 20  62 69 74 73 20 61 72 65  |ese two bits are|
00006670  20 6e 6f 74 20 6e 65 78  74 20 74 6f 20 65 61 63  | not next to eac|
00006680  68 20 6f 74 68 65 72 20  69 6e 0d 0a 74 68 65 20  |h other in..the |
00006690  62 79 74 65 20 2d 20 69  6e 73 74 65 61 64 20 61  |byte - instead a|
000066a0  6c 6c 20 6f 66 20 74 68  65 20 68 69 67 68 2d 62  |ll of the high-b|
000066b0  79 74 65 73 20 61 72 65  20 73 74 6f 72 65 64 20  |ytes are stored |
000066c0  74 6f 67 65 74 68 65 72  2c 20 61 6e 64 20 61 6c  |together, and al|
000066d0  6c 20 6f 66 0d 0a 74 68  65 20 6c 6f 77 2d 62 79  |l of..the low-by|
000066e0  74 65 73 20 61 72 65 20  73 74 6f 72 65 64 20 74  |tes are stored t|
000066f0  6f 67 65 74 68 65 72 2e  0d 0a 0d 0a 53 49 58 54  |ogether.....SIXT|
00006700  45 45 4e 20 43 4f 4c 4f  55 52 20 4d 4f 44 45 53  |EEN COLOUR MODES|
00006710  0d 0a 0d 0a 54 68 65 20  70 61 74 74 65 72 6e 20  |....The pattern |
00006720  66 6f 72 20 73 69 78 74  65 65 6e 20 63 6f 6c 6f  |for sixteen colo|
00006730  75 72 20 6d 6f 64 65 73  20 69 73 20 73 69 6d 69  |ur modes is simi|
00006740  6c 61 72 20 74 6f 20 74  68 61 74 20 66 6f 75 6e  |lar to that foun|
00006750  64 20 69 6e 20 66 6f 75  72 0d 0a 63 6f 6c 6f 75  |d in four..colou|
00006760  72 20 6d 6f 64 65 73 2c  20 65 78 63 65 70 74 20  |r modes, except |
00006770  74 68 61 74 20 65 61 63  68 20 62 79 74 65 20 63  |that each byte c|
00006780  61 6e 20 6f 6e 6c 79 20  73 74 6f 72 65 20 74 77  |an only store tw|
00006790  6f 20 70 69 78 65 6c 73  20 28 65 61 63 68 0d 0a  |o pixels (each..|
000067a0  6f 63 63 75 70 69 65 73  20 66 6f 75 72 20 62 69  |occupies four bi|
000067b0  74 73 29 2e 20 41 73 20  77 69 74 68 20 70 72 65  |ts). As with pre|
000067c0  76 69 6f 75 73 20 63 61  73 65 73 2c 20 74 68 65  |vious cases, the|
000067d0  20 70 69 78 65 6c 73 20  61 72 65 20 73 74 6f 72  | pixels are stor|
000067e0  65 64 0d 0a 69 6e 20 61  20 6e 75 6d 62 65 72 20  |ed..in a number |
000067f0  6f 66 20 76 65 72 74 69  63 61 6c 20 73 77 65 65  |of vertical swee|
00006800  70 73 20 73 74 61 72 74  69 6e 67 20 61 74 20 74  |ps starting at t|
00006810  68 65 20 6c 65 66 74 20  6f 66 20 74 68 65 20 63  |he left of the c|
00006820  68 61 72 61 63 74 65 72  2c 0d 0a 61 6e 64 20 6d  |haracter,..and m|
00006830  6f 76 69 6e 67 20 74 6f  20 74 68 65 20 72 69 67  |oving to the rig|
00006840  68 74 2e 20 54 68 69 73  20 74 69 6d 65 2c 20 74  |ht. This time, t|
00006850  68 6f 75 67 68 2c 20 66  6f 75 72 20 76 65 72 74  |hough, four vert|
00006860  69 63 61 6c 20 73 77 65  65 70 73 20 61 72 65 0d  |ical sweeps are.|
00006870  0a 72 65 71 75 69 72 65  64 20 74 6f 20 63 6f 76  |.required to cov|
00006880  65 72 20 74 68 65 20 65  6e 74 69 72 65 20 63 68  |er the entire ch|
00006890  61 72 61 63 74 65 72 2c  20 6e 6f 74 20 74 77 6f  |aracter, not two|
000068a0  20 61 73 20 77 69 74 68  20 66 6f 75 72 20 63 6f  | as with four co|
000068b0  6c 6f 75 72 0d 0a 6d 6f  64 65 73 3a 0d 0a 0d 0a  |lour..modes:....|
000068c0  50 49 58 45 4c 2d 42 59  20 50 49 58 45 4c 20 4c  |PIXEL-BY PIXEL L|
000068d0  41 59 4f 55 54 20 20 20  20 4d 45 4d 4f 52 59 20  |AYOUT    MEMORY |
000068e0  46 4c 4f 57 0d 0a 0d 0a  30 30 38 38 30 30 38 38  |FLOW....00880088|
000068f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006900  20 20 20 30 20 20 20 20  20 20 38 20 20 20 20 31  |   0      8    1|
00006910  30 20 20 20 20 31 38 0d  0a 31 31 39 39 31 31 39  |0    18..1199119|
00006920  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
00006930  20 20 20 20 dd 20 20 20  20 20 20 dd 20 20 20 20  |    .      .    |
00006940  20 dd 20 20 20 20 20 dd  0d 0a 32 32 41 41 32 32  | .     ...22AA22|
00006950  41 41 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |AA              |
00006960  20 20 20 20 20 dd 20 20  20 20 20 20 dd 20 20 20  |     .      .   |
00006970  20 20 dd 20 20 20 20 20  dd 0d 0a 33 33 42 42 33  |  .     ...33BB3|
00006980  33 42 42 20 20 20 20 20  20 20 20 20 20 20 20 20  |3BB             |
00006990  20 20 20 20 20 20 dd 20  20 20 20 20 20 dd 20 20  |      .      .  |
000069a0  20 20 20 dd 20 20 20 20  20 dd 0d 0a 34 34 43 43  |   .     ...44CC|
000069b0  34 34 43 43 20 20 20 20  20 20 20 20 20 20 20 20  |44CC            |
000069c0  20 20 20 20 20 20 20 dd  20 20 20 20 20 20 dd 20  |       .      . |
000069d0  20 20 20 20 dd 20 20 20  20 20 dd 0d 0a 35 35 44  |    .     ...55D|
000069e0  44 35 35 44 44 20 20 20  20 20 20 20 20 20 20 20  |D55DD           |
000069f0  20 20 20 20 20 20 20 20  dd 20 20 20 20 20 20 dd  |        .      .|
00006a00  20 20 20 20 20 dd 20 20  20 20 20 dd 0d 0a 36 36  |     .     ...66|
00006a10  45 45 36 36 45 45 20 20  20 20 20 20 20 20 20 20  |EE66EE          |
00006a20  20 20 20 20 20 20 20 20  5c 20 2f 20 20 20 20 5c  |        \ /    \|
00006a30  20 2f 20 20 20 5c 20 2f  20 20 20 5c 20 2f 0d 0a  | /   \ /   \ /..|
00006a40  37 37 46 46 37 37 46 46  20 20 20 20 20 20 20 20  |77FF77FF        |
00006a50  20 20 20 20 20 20 20 20  20 20 20 37 20 20 20 20  |           7    |
00006a60  20 20 46 20 20 20 20 31  37 20 20 20 20 31 46 0d  |  F    17    1F.|
00006a70  0a 0d 0a 4e 42 3a 20 4f  66 66 73 65 74 73 20 67  |...NB: Offsets g|
00006a80  69 76 65 6e 20 69 6e 20  68 65 78 61 64 65 63 69  |iven in hexadeci|
00006a90  6d 61 6c 2e 20 56 61 6c  75 65 73 20 69 6e 20 72  |mal. Values in r|
00006aa0  69 67 68 74 20 68 61 6c  66 20 6f 66 20 6c 65 66  |ight half of lef|
00006ab0  74 20 64 69 61 67 72 61  6d 0d 0a 73 68 6f 75 6c  |t diagram..shoul|
00006ac0  64 20 68 61 76 65 20 26  31 30 20 61 64 64 65 64  |d have &10 added|
00006ad0  20 74 6f 20 74 68 65 6d  20 28 6f 6e 6c 79 20 6c  | to them (only l|
00006ae0  65 61 73 74 20 73 69 67  6e 69 66 69 63 61 6e 74  |east significant|
00006af0  20 63 68 61 72 61 63 74  65 72 20 67 69 76 65 6e  | character given|
00006b00  29 0d 0a 0d 0a 54 68 65  20 70 61 74 74 65 72 6e  |)....The pattern|
00006b10  20 6f 66 20 74 68 65 20  6c 61 79 6f 75 74 20 6f  | of the layout o|
00006b20  66 20 74 68 65 20 70 69  78 65 6c 20 64 61 74 61  |f the pixel data|
00006b30  20 69 6e 20 65 61 63 68  20 6f 66 20 74 68 65 20  | in each of the |
00006b40  62 79 74 65 73 0d 0a 69  73 20 61 6c 73 6f 20 73  |bytes..is also s|
00006b50  69 6d 69 6c 61 72 20 74  6f 20 74 68 61 74 20 66  |imilar to that f|
00006b60  6f 72 20 74 68 65 20 66  6f 75 72 20 63 6f 6c 6f  |or the four colo|
00006b70  75 72 20 6d 6f 64 65 73  20 28 74 68 65 20 74 77  |ur modes (the tw|
00006b80  6f 20 70 69 78 65 6c 73  0d 0a 61 72 65 20 41 20  |o pixels..are A |
00006b90  61 6e 64 20 42 2c 20 61  6e 64 20 65 61 63 68 20  |and B, and each |
00006ba0  63 6f 6d 70 72 69 73 65  73 20 6f 66 20 66 6f 75  |comprises of fou|
00006bb0  72 20 62 69 74 73 20 30  2d 33 2c 20 77 68 65 72  |r bits 0-3, wher|
00006bc0  65 20 30 20 69 73 20 6c  65 61 73 74 0d 0a 73 69  |e 0 is least..si|
00006bd0  67 6e 69 66 69 63 61 6e  74 20 61 6e 64 20 33 20  |gnificant and 3 |
00006be0  69 73 20 6d 6f 73 74 20  73 69 67 6e 69 66 69 63  |is most signific|
00006bf0  61 6e 74 29 2e 0d 0a 0d  0a 5b 4d 4f 53 54 20 53  |ant).....[MOST S|
00006c00  49 47 4e 49 46 49 43 41  4e 54 5d 20 20 20 20 41  |IGNIFICANT]    A|
00006c10  33 20 42 33 20 41 32 20  42 32 20 41 31 20 42 31  |3 B3 A2 B2 A1 B1|
00006c20  20 41 30 20 42 30 20 20  20 20 5b 4c 45 41 53 54  | A0 B0    [LEAST|
00006c30  20 53 49 47 4e 49 46 49  43 41 4e 54 5d 0d 0a 0d  | SIGNIFICANT]...|
00006c40  0a 4e 6f 74 69 63 65 20  74 68 61 74 20 6f 6e 63  |.Notice that onc|
00006c50  65 20 61 67 61 69 6e 20  62 69 74 73 20 64 65 66  |e again bits def|
00006c60  69 6e 69 6e 67 20 74 68  65 20 70 69 78 65 6c 73  |ining the pixels|
00006c70  20 41 20 61 6e 64 20 42  20 61 72 65 20 6e 6f 74  | A and B are not|
00006c80  0d 0a 73 74 6f 72 65 64  20 74 6f 67 65 74 68 65  |..stored togethe|
00006c90  72 2c 20 62 75 74 20 74  68 6f 73 65 20 64 65 66  |r, but those def|
00006ca0  69 6e 69 6e 67 20 74 68  65 20 6c 65 61 73 74 2f  |ining the least/|
00006cb0  6d 6f 73 74 20 73 69 67  6e 69 66 69 63 61 6e 74  |most significant|
00006cc0  0d 0a 62 69 74 73 20 61  72 65 20 73 74 6f 72 65  |..bits are store|
00006cd0  64 20 74 6f 67 65 74 68  65 72 2e 0d 0a           |d together...|
00006cdd
PT3P1\TXT.m0
PT3P1\TXT.m1
PT3P1\TXT.m2
PT3P1\TXT.m4
PT3P1\TXT.m5