Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_38.ADF » +P5

+P5

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 » Electron_User_Group » EUG_38.ADF
Filename: +P5
Read OK:
File size: 1341 bytes
Load address: 2B204556
Exec address: D3550
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
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 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
  1            0            0            0            1       RED
  0            1            0            0            2       GRN
  1            1            0            0            3       YEL
  0            0            1            0            4       BLE
  1            0            1            0            5       MGN
  0            1            1            0            6       CYN
  1            1            1            0            7       WHT
  0            0            0            1            8     BLK/WHT
  1            0            0            1            9     RED/CYN
  0            1            0            1           10     GRN/MGN
  1            1            0            1           11     YEL/BLE
  0            0            1            1           12     BLE/YEL
  1            0            1            1           13     MGN/GRN
  0            1            1            1           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 VDU 23. 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's definition. 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. The difference this
time, though, is that not all of the pixels in the character are being
defined by the one sweep, and instead only the left-most four pixels can
be defined. The right-most four pixels are defined in a second downward
vertical sweep. Thus the total memory allocation for the definition of
each character is sixteen bytes. The layout of these is shown more clearly
by the diagram below. 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
hexadecimal:

00000000  0d 4e 6f 77 20 74 68 61  74 20 79 6f 75 20 63 61  |.Now that you ca|
00000010  6e 20 6c 6f 63 61 74 65  20 61 20 74 68 65 20 6d  |n locate a the m|
00000020  65 6d 6f 72 79 20 6f 63  63 75 70 69 65 64 20 62  |emory occupied b|
00000030  79 20 61 20 63 68 61 72  61 63 74 65 72 20 69 6e  |y a character in|
00000040  20 73 63 72 65 65 6e 0d  6d 65 6d 6f 72 79 2c 20  | screen.memory, |
00000050  79 6f 75 20 6e 65 65 64  20 74 6f 20 6b 6e 6f 77  |you need to know|
00000060  20 68 6f 77 20 74 68 65  20 62 79 74 65 73 20 77  | how the bytes w|
00000070  69 74 68 69 6e 20 74 68  69 73 20 62 6c 6f 63 6b  |ithin this block|
00000080  20 61 72 65 20 6c 61 69  64 20 6f 75 74 2c 20 73  | are laid out, s|
00000090  6f 0d 74 68 61 74 20 79  6f 75 20 63 61 6e 20 68  |o.that you can h|
000000a0  61 76 65 20 70 69 78 65  6c 20 62 79 20 70 69 78  |ave pixel by pix|
000000b0  65 6c 20 63 6f 6e 74 72  6f 6c 20 6f 76 65 72 20  |el control over |
000000c0  79 6f 75 72 20 6d 6f 6e  69 74 6f 72 20 73 63 72  |your monitor scr|
000000d0  65 65 6e 2e 20 54 68 69  73 20 69 73 0d 61 6c 73  |een. This is.als|
000000e0  6f 20 72 65 71 75 69 72  65 64 20 69 66 20 79 6f  |o required if yo|
000000f0  75 20 61 72 65 20 74 6f  20 62 65 20 61 62 6c 65  |u are to be able|
00000100  20 74 6f 20 63 61 6c 63  75 6c 61 74 65 20 74 68  | to calculate th|
00000110  65 20 61 6d 6f 75 6e 74  20 6f 66 20 6d 65 6d 6f  |e amount of memo|
00000120  72 79 0d 74 61 6b 65 6e  20 75 70 20 62 79 20 65  |ry.taken up by e|
00000130  61 63 68 20 63 68 61 72  61 63 74 65 72 27 73 20  |ach character's |
00000140  64 65 66 69 6e 69 74 69  6f 6e 20 69 6e 20 61 20  |definition in a |
00000150  70 61 72 74 69 63 75 6c  61 72 20 6d 6f 64 65 2e  |particular mode.|
00000160  0d 0d 54 68 65 20 67 72  61 70 68 69 63 73 20 6d  |..The graphics m|
00000170  6f 64 65 73 20 63 61 6e  20 62 65 20 64 69 76 69  |odes can be divi|
00000180  64 65 64 20 69 6e 74 6f  20 74 68 72 65 65 20 63  |ded into three c|
00000190  61 74 65 67 6f 72 69 65  73 3a 20 6d 6f 6e 6f 63  |ategories: monoc|
000001a0  68 72 6f 6d 65 20 6d 6f  64 65 73 0d 28 69 65 2e  |hrome modes.(ie.|
000001b0  20 74 77 6f 20 63 6f 6c  6f 75 72 73 29 2c 20 66  | two colours), f|
000001c0  6f 75 72 20 63 6f 6c 6f  75 72 20 6d 6f 64 65 73  |our colour modes|
000001d0  2c 20 61 6e 64 20 73 69  78 74 65 65 6e 20 63 6f  |, and sixteen co|
000001e0  6c 6f 75 72 20 6d 6f 64  65 73 2e 20 41 6c 6c 20  |lour modes. All |
000001f0  6f 66 20 74 68 65 0d 45  6c 6b 27 73 20 6d 6f 64  |of the.Elk's mod|
00000200  65 73 20 66 61 6c 6c 20  69 6e 74 6f 20 74 68 65  |es fall into the|
00000210  73 65 20 74 68 72 65 65  20 67 72 6f 75 70 69 6e  |se three groupin|
00000220  67 73 2e 20 57 68 69 63  68 20 6f 66 20 74 68 65  |gs. Which of the|
00000230  73 65 20 63 6f 6c 6f 75  72 73 20 65 61 63 68 0d  |se colours each.|
00000240  70 69 78 65 6c 20 6f 66  20 74 68 65 20 73 63 72  |pixel of the scr|
00000250  65 65 6e 20 69 73 20 64  65 70 65 6e 64 73 20 75  |een is depends u|
00000260  70 6f 6e 20 74 68 65 20  73 74 61 74 75 73 20 6f  |pon the status o|
00000270  66 20 61 20 6e 75 6d 62  65 72 20 6f 66 20 62 69  |f a number of bi|
00000280  6e 61 72 79 20 62 69 74  73 2e 0d 54 68 65 73 65  |nary bits..These|
00000290  20 68 61 76 65 20 74 77  6f 20 73 74 61 74 65 73  | have two states|
000002a0  2c 20 30 20 6f 72 20 31  2e 20 4e 6f 77 2c 20 69  |, 0 or 1. Now, i|
000002b0  6e 20 61 20 6d 6f 6e 6f  63 68 72 6f 6d 65 20 6d  |n a monochrome m|
000002c0  6f 64 65 2c 20 6f 6e 65  20 62 69 74 20 69 73 0d  |ode, one bit is.|
000002d0  73 75 66 66 69 63 69 65  6e 74 20 74 6f 20 64 65  |sufficient to de|
000002e0  66 69 6e 65 20 74 68 65  20 63 6f 6c 6f 75 72 20  |fine the colour |
000002f0  6f 66 20 6f 6e 65 20 70  69 78 65 6c 20 28 62 69  |of one pixel (bi|
00000300  74 73 20 68 61 76 65 20  74 77 6f 20 73 74 61 74  |ts have two stat|
00000310  65 73 2c 20 30 20 6f 72  20 31 2c 0d 61 6e 64 20  |es, 0 or 1,.and |
00000320  74 68 65 20 70 69 78 65  6c 73 20 68 61 76 65 20  |the pixels have |
00000330  74 77 6f 20 73 74 61 74  65 73 2c 20 63 6f 6c 6f  |two states, colo|
00000340  75 72 20 30 20 6f 72 20  63 6f 6c 6f 75 72 20 31  |ur 0 or colour 1|
00000350  29 2e 20 49 6e 20 61 20  66 6f 75 72 20 63 6f 6c  |). In a four col|
00000360  6f 75 72 20 6d 6f 64 65  2c 0d 6f 6e 20 74 68 65  |our mode,.on the|
00000370  20 6f 74 68 65 72 20 68  61 6e 64 2c 20 6f 6e 65  | other hand, one|
00000380  20 62 69 74 20 77 69 6c  6c 20 6e 6f 74 20 62 65  | bit will not be|
00000390  20 73 75 66 66 69 63 69  65 6e 74 2c 20 61 73 20  | sufficient, as |
000003a0  66 6f 75 72 20 64 69 66  66 65 72 65 6e 74 20 73  |four different s|
000003b0  74 61 74 65 73 0d 61 72  65 20 72 65 71 75 69 72  |tates.are requir|
000003c0  65 64 2e 20 54 77 6f 20  62 69 74 73 20 77 69 6c  |ed. Two bits wil|
000003d0  6c 20 62 65 20 65 6e 6f  75 67 68 20 74 6f 20 73  |l be enough to s|
000003e0  74 6f 72 65 20 74 68 65  20 63 6f 6c 6f 75 72 20  |tore the colour |
000003f0  6f 66 20 6f 6e 65 20 70  69 78 65 6c 2c 0d 68 6f  |of one pixel,.ho|
00000400  77 65 76 65 72 3a 0d 0d  42 69 74 20 31 20 73 74  |wever:..Bit 1 st|
00000410  61 74 65 20 20 20 20 20  42 69 74 20 32 20 73 74  |ate     Bit 2 st|
00000420  61 74 65 20 20 20 20 20  43 6f 6c 6f 75 72 0d 20  |ate     Colour. |
00000430  20 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 0              |
*
00000450  20 30 0d 20 20 30 20 20  20 20 20 20 20 20 20 20  | 0.  0          |
00000460  20 20 20 20 20 31 20 20  20 20 20 20 20 20 20 20  |     1          |
00000470  20 20 20 20 20 31 0d 20  20 31 20 20 20 20 20 20  |     1.  1      |
00000480  20 20 20 20 20 20 20 20  20 30 20 20 20 20 20 20  |         0      |
00000490  20 20 20 20 20 20 20 20  20 32 0d 20 20 31 20 20  |         2.  1  |
000004a0  20 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |             1  |
000004b0  20 20 20 20 20 20 20 20  20 20 20 20 20 33 0d 0d  |             3..|
000004c0  54 68 6f 73 65 20 66 61  6d 69 6c 69 61 72 20 77  |Those familiar w|
000004d0  69 74 68 20 62 69 6e 61  72 79 20 77 69 6c 6c 20  |ith binary will |
000004e0  73 70 6f 74 20 74 68 65  20 70 61 74 74 65 72 6e  |spot the pattern|
000004f0  20 73 74 72 61 69 67 68  74 20 61 77 61 79 20 2d  | straight away -|
00000500  20 73 69 6d 70 6c 79 0d  63 6f 6e 76 65 72 74 20  | simply.convert |
00000510  74 68 65 20 62 69 6e 61  72 79 20 76 61 6c 75 65  |the binary value|
00000520  20 6f 66 20 74 68 65 20  74 77 6f 20 62 69 74 73  | of the two bits|
00000530  20 69 6e 74 6f 20 64 65  63 69 6d 61 6c 2c 20 61  | into decimal, a|
00000540  6e 64 20 79 6f 75 20 68  61 76 65 20 74 68 65 0d  |nd you have the.|
00000550  6c 6f 67 69 63 61 6c 20  63 6f 6c 6f 75 72 20 6e  |logical colour n|
00000560  75 6d 62 65 72 2e 20 41  20 76 65 72 79 20 73 69  |umber. A very si|
00000570  6d 69 6c 61 72 20 70 61  74 74 65 72 6e 20 61 70  |milar pattern ap|
00000580  70 6c 69 65 73 20 74 6f  20 4d 4f 44 45 20 32 20  |plies to MODE 2 |
00000590  2d 20 74 68 65 20 45 6c  6b 27 73 0d 31 36 20 63  |- the Elk's.16 c|
000005a0  6f 6c 6f 75 72 20 6d 6f  64 65 2e 20 45 61 63 68  |olour mode. Each|
000005b0  20 70 69 78 65 6c 20 72  65 71 75 69 72 65 73 20  | pixel requires |
000005c0  34 20 62 69 74 73 20 74  6f 20 73 74 6f 72 65 20  |4 bits to store |
000005d0  69 74 73 20 63 6f 6c 6f  75 72 20 28 32 5e 34 3d  |its colour (2^4=|
000005e0  31 36 29 2e 0d 4f 6e 63  65 20 61 67 61 69 6e 2c  |16)..Once again,|
000005f0  20 74 68 65 20 63 6f 6c  6f 75 72 20 6f 66 20 74  | the colour of t|
00000600  68 65 20 70 69 78 65 6c  20 69 73 20 74 68 65 20  |he pixel is the |
00000610  6c 6f 67 69 63 61 6c 20  63 6f 6c 6f 75 72 20 77  |logical colour w|
00000620  68 6f 73 65 20 6e 75 6d  62 65 72 20 69 73 0d 67  |hose number is.g|
00000630  69 76 65 6e 20 77 68 65  6e 20 66 6f 75 72 20 62  |iven when four b|
00000640  69 74 73 20 61 72 65 20  70 75 74 20 74 6f 67 65  |its are put toge|
00000650  74 68 65 72 20 74 6f 20  66 6f 72 6d 20 61 20 62  |ther to form a b|
00000660  69 6e 61 72 79 20 76 61  6c 75 65 3a 0d 0d 42 69  |inary value:..Bi|
00000670  74 20 31 20 73 74 61 74  65 20 20 42 69 74 20 32  |t 1 state  Bit 2|
00000680  20 73 74 61 74 65 20 20  42 69 74 20 33 20 73 74  | state  Bit 3 st|
00000690  61 74 65 20 20 42 69 74  20 34 20 73 74 61 74 65  |ate  Bit 4 state|
000006a0  20 20 43 6f 6c 6f 75 72  20 20 44 65 66 61 75 6c  |  Colour  Defaul|
000006b0  74 0d 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |t.  0           |
000006c0  20 30 20 20 20 20 20 20  20 20 20 20 20 20 30 20  | 0            0 |
000006d0  20 20 20 20 20 20 20 20  20 20 20 30 20 20 20 20  |           0    |
000006e0  20 20 20 20 20 20 20 20  30 20 20 20 20 20 20 20  |        0       |
000006f0  42 4c 4b 0d 20 20 31 20  20 20 20 20 20 20 20 20  |BLK.  1         |
00000700  20 20 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |   0            |
00000710  30 20 20 20 20 20 20 20  20 20 20 20 20 30 20 20  |0            0  |
00000720  20 20 20 20 20 20 20 20  20 20 31 20 20 20 20 20  |          1     |
00000730  20 20 52 45 44 0d 20 20  30 20 20 20 20 20 20 20  |  RED.  0       |
00000740  20 20 20 20 20 31 20 20  20 20 20 20 20 20 20 20  |     1          |
00000750  20 20 30 20 20 20 20 20  20 20 20 20 20 20 20 30  |  0            0|
00000760  20 20 20 20 20 20 20 20  20 20 20 20 32 20 20 20  |            2   |
00000770  20 20 20 20 47 52 4e 0d  20 20 31 20 20 20 20 20  |    GRN.  1     |
00000780  20 20 20 20 20 20 20 31  20 20 20 20 20 20 20 20  |       1        |
00000790  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
000007a0  20 30 20 20 20 20 20 20  20 20 20 20 20 20 33 20  | 0            3 |
000007b0  20 20 20 20 20 20 59 45  4c 0d 20 20 30 20 20 20  |      YEL.  0   |
000007c0  20 20 20 20 20 20 20 20  20 30 20 20 20 20 20 20  |         0      |
000007d0  20 20 20 20 20 20 31 20  20 20 20 20 20 20 20 20  |      1         |
000007e0  20 20 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |   0            |
000007f0  34 20 20 20 20 20 20 20  42 4c 45 0d 20 20 31 20  |4       BLE.  1 |
00000800  20 20 20 20 20 20 20 20  20 20 20 30 20 20 20 20  |           0    |
00000810  20 20 20 20 20 20 20 20  31 20 20 20 20 20 20 20  |        1       |
00000820  20 20 20 20 20 30 20 20  20 20 20 20 20 20 20 20  |     0          |
00000830  20 20 35 20 20 20 20 20  20 20 4d 47 4e 0d 20 20  |  5       MGN.  |
00000840  30 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |0            1  |
00000850  20 20 20 20 20 20 20 20  20 20 31 20 20 20 20 20  |          1     |
00000860  20 20 20 20 20 20 20 30  20 20 20 20 20 20 20 20  |       0        |
00000870  20 20 20 20 36 20 20 20  20 20 20 20 43 59 4e 0d  |    6       CYN.|
00000880  20 20 31 20 20 20 20 20  20 20 20 20 20 20 20 31  |  1            1|
00000890  20 20 20 20 20 20 20 20  20 20 20 20 31 20 20 20  |            1   |
000008a0  20 20 20 20 20 20 20 20  20 30 20 20 20 20 20 20  |         0      |
000008b0  20 20 20 20 20 20 37 20  20 20 20 20 20 20 57 48  |      7       WH|
000008c0  54 0d 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |T.  0           |
000008d0  20 30 20 20 20 20 20 20  20 20 20 20 20 20 30 20  | 0            0 |
000008e0  20 20 20 20 20 20 20 20  20 20 20 31 20 20 20 20  |           1    |
000008f0  20 20 20 20 20 20 20 20  38 20 20 20 20 20 42 4c  |        8     BL|
00000900  4b 2f 57 48 54 0d 20 20  31 20 20 20 20 20 20 20  |K/WHT.  1       |
00000910  20 20 20 20 20 30 20 20  20 20 20 20 20 20 20 20  |     0          |
00000920  20 20 30 20 20 20 20 20  20 20 20 20 20 20 20 31  |  0            1|
00000930  20 20 20 20 20 20 20 20  20 20 20 20 39 20 20 20  |            9   |
00000940  20 20 52 45 44 2f 43 59  4e 0d 20 20 30 20 20 20  |  RED/CYN.  0   |
00000950  20 20 20 20 20 20 20 20  20 31 20 20 20 20 20 20  |         1      |
00000960  20 20 20 20 20 20 30 20  20 20 20 20 20 20 20 20  |      0         |
00000970  20 20 20 31 20 20 20 20  20 20 20 20 20 20 20 31  |   1           1|
00000980  30 20 20 20 20 20 47 52  4e 2f 4d 47 4e 0d 20 20  |0     GRN/MGN.  |
00000990  31 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |1            1  |
000009a0  20 20 20 20 20 20 20 20  20 20 30 20 20 20 20 20  |          0     |
000009b0  20 20 20 20 20 20 20 31  20 20 20 20 20 20 20 20  |       1        |
000009c0  20 20 20 31 31 20 20 20  20 20 59 45 4c 2f 42 4c  |   11     YEL/BL|
000009d0  45 0d 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |E.  0           |
000009e0  20 30 20 20 20 20 20 20  20 20 20 20 20 20 31 20  | 0            1 |
000009f0  20 20 20 20 20 20 20 20  20 20 20 31 20 20 20 20  |           1    |
00000a00  20 20 20 20 20 20 20 31  32 20 20 20 20 20 42 4c  |       12     BL|
00000a10  45 2f 59 45 4c 0d 20 20  31 20 20 20 20 20 20 20  |E/YEL.  1       |
00000a20  20 20 20 20 20 30 20 20  20 20 20 20 20 20 20 20  |     0          |
00000a30  20 20 31 20 20 20 20 20  20 20 20 20 20 20 20 31  |  1            1|
00000a40  20 20 20 20 20 20 20 20  20 20 20 31 33 20 20 20  |           13   |
00000a50  20 20 4d 47 4e 2f 47 52  4e 0d 20 20 30 20 20 20  |  MGN/GRN.  0   |
00000a60  20 20 20 20 20 20 20 20  20 31 20 20 20 20 20 20  |         1      |
00000a70  20 20 20 20 20 20 31 20  20 20 20 20 20 20 20 20  |      1         |
00000a80  20 20 20 31 20 20 20 20  20 20 20 20 20 20 20 31  |   1           1|
00000a90  34 20 20 20 20 20 43 59  4e 2f 52 45 44 0d 20 20  |4     CYN/RED.  |
00000aa0  31 20 20 20 20 20 20 20  20 20 20 20 20 31 20 20  |1            1  |
00000ab0  20 20 20 20 20 20 20 20  20 20 31 20 20 20 20 20  |          1     |
00000ac0  20 20 20 20 20 20 20 31  20 20 20 20 20 20 20 20  |       1        |
00000ad0  20 20 20 31 35 20 20 20  20 20 57 48 54 2f 42 4c  |   15     WHT/BL|
00000ae0  4b 0d 0d 5b 44 65 66 61  75 6c 74 3a 20 44 65 66  |K..[Default: Def|
00000af0  61 75 6c 74 20 73 65 74  74 69 6e 67 20 6f 66 20  |ault setting of |
00000b00  74 68 69 73 20 6c 6f 67  69 63 61 6c 20 63 6f 6c  |this logical col|
00000b10  6f 75 72 20 77 68 65 6e  20 4d 4f 44 45 20 32 20  |our when MODE 2 |
00000b20  69 73 20 66 69 72 73 74  0d 65 6e 74 65 72 65 64  |is first.entered|
00000b30  5d 0d 53 6f 2e 2e 2e 20  74 68 65 20 45 6c 65 63  |].So... the Elec|
00000b40  74 72 6f 6e 20 68 61 73  20 6d 6f 64 65 73 20 77  |tron has modes w|
00000b50  68 65 72 65 20 74 68 65  20 64 65 66 69 6e 69 74  |here the definit|
00000b60  69 6f 6e 20 6f 66 20 74  68 65 20 63 6f 6c 6f 75  |ion of the colou|
00000b70  72 20 6f 66 20 61 0d 63  65 72 74 61 69 6e 20 70  |r of a.certain p|
00000b80  69 78 65 6c 20 63 61 6e  20 74 61 6b 65 20 31 2c  |ixel can take 1,|
00000b90  20 32 20 6f 72 20 34 20  62 69 74 73 2e 20 41 73  | 2 or 4 bits. As|
00000ba0  20 65 61 63 68 20 62 79  74 65 20 6f 66 20 74 68  | each byte of th|
00000bb0  65 20 65 6c 65 63 74 72  6f 6e 27 73 0d 6d 65 6d  |e electron's.mem|
00000bc0  6f 72 79 20 63 6f 6e 73  69 73 74 73 20 6f 66 20  |ory consists of |
00000bd0  38 20 73 65 70 65 72 61  74 65 20 62 69 74 73 2c  |8 seperate bits,|
00000be0  20 74 68 69 73 20 6d 65  61 6e 73 20 74 68 61 74  | this means that|
00000bf0  20 69 6e 20 6d 6f 6e 6f  63 68 72 6f 6d 65 20 6d  | in monochrome m|
00000c00  6f 64 65 73 0d 77 65 20  63 61 6e 20 66 69 74 20  |odes.we can fit |
00000c10  38 20 70 69 78 65 6c 73  20 69 6e 74 6f 20 65 61  |8 pixels into ea|
00000c20  63 68 20 62 79 74 65 20  28 38 2f 31 3d 38 29 2e  |ch byte (8/1=8).|
00000c30  20 49 6e 20 66 6f 75 72  20 63 6f 6c 6f 75 72 20  | In four colour |
00000c40  6d 6f 64 65 73 20 28 77  68 65 72 65 0d 65 61 63  |modes (where.eac|
00000c50  68 20 70 69 78 65 6c 20  72 65 71 75 69 72 65 73  |h pixel requires|
00000c60  20 74 77 6f 20 62 69 74  73 29 20 77 65 20 63 61  | two bits) we ca|
00000c70  6e 20 66 69 74 20 34 20  70 69 78 65 6c 73 20 69  |n fit 4 pixels i|
00000c80  6e 74 6f 20 65 61 63 68  20 62 79 74 65 20 28 38  |nto each byte (8|
00000c90  2f 32 3d 34 29 2e 0d 46  69 6e 61 6c 6c 79 20 69  |/2=4)..Finally i|
00000ca0  6e 20 4d 4f 44 45 20 32  20 28 74 68 65 20 73 69  |n MODE 2 (the si|
00000cb0  78 74 65 65 6e 20 63 6f  6c 6f 75 72 20 6d 6f 64  |xteen colour mod|
00000cc0  65 20 77 68 65 72 65 20  65 61 63 68 20 70 69 78  |e where each pix|
00000cd0  65 6c 20 72 65 71 75 69  72 65 73 20 34 0d 62 69  |el requires 4.bi|
00000ce0  74 73 29 20 77 65 20 63  61 6e 20 66 69 74 20 74  |ts) we can fit t|
00000cf0  77 6f 20 70 69 78 65 6c  73 20 69 6e 74 6f 20 65  |wo pixels into e|
00000d00  61 63 68 20 62 79 74 65  2e 20 4c 65 74 27 73 20  |ach byte. Let's |
00000d10  6e 6f 77 20 6c 6f 6f 6b  20 61 74 20 68 6f 77 20  |now look at how |
00000d20  65 61 63 68 20 69 73 0d  6c 61 69 64 20 6f 75 74  |each is.laid out|
00000d30  20 69 6e 20 6d 6f 72 65  20 64 65 70 74 68 3a 0d  | in more depth:.|
00000d40  0d 4d 4f 4e 4f 43 48 52  4f 4d 45 20 4d 4f 44 45  |.MONOCHROME MODE|
00000d50  53 3a 0d 0d 54 68 65 73  65 20 61 72 65 20 6c 61  |S:..These are la|
00000d60  69 64 20 6f 75 74 20 69  6e 20 74 68 65 20 73 69  |id out in the si|
00000d70  6d 70 6c 65 73 74 20 77  61 79 2c 20 61 73 20 65  |mplest way, as e|
00000d80  69 67 68 74 20 70 69 78  65 6c 73 20 66 69 74 20  |ight pixels fit |
00000d90  69 6e 74 6f 20 65 61 63  68 0d 62 79 74 65 2e 20  |into each.byte. |
00000da0  54 68 65 20 63 68 61 72  61 63 74 65 72 2c 20 72  |The character, r|
00000db0  65 6d 65 6d 62 65 72 2c  20 63 6f 6e 73 69 73 74  |emember, consist|
00000dc0  73 20 6f 66 20 61 6e 20  38 2d 62 79 2d 38 20 73  |s of an 8-by-8 s|
00000dd0  71 75 61 72 65 20 6f 66  20 70 69 78 65 6c 73 2e  |quare of pixels.|
00000de0  20 54 68 65 0d 64 61 74  61 20 69 73 20 73 74 6f  | The.data is sto|
00000df0  72 65 64 20 69 6e 20 74  68 65 20 73 61 6d 65 20  |red in the same |
00000e00  77 61 79 20 61 73 20 75  73 65 72 20 64 65 66 69  |way as user defi|
00000e10  6e 65 64 20 63 68 61 72  61 63 74 65 72 73 20 61  |ned characters a|
00000e20  72 65 20 64 65 66 69 6e  65 64 0d 75 73 69 6e 67  |re defined.using|
00000e30  20 56 44 55 20 32 33 2e  20 54 68 65 20 66 69 72  | VDU 23. The fir|
00000e40  73 74 20 62 79 74 65 20  6f 66 20 74 68 65 20 64  |st byte of the d|
00000e50  65 66 69 6e 69 74 69 6f  6e 20 64 65 66 69 6e 65  |efinition define|
00000e60  73 20 74 68 65 20 74 6f  70 20 72 6f 77 20 6f 66  |s the top row of|
00000e70  0d 65 69 67 68 74 20 70  69 78 65 6c 73 3b 20 74  |.eight pixels; t|
00000e80  68 65 20 73 65 63 6f 6e  64 20 64 65 66 69 6e 65  |he second define|
00000e90  73 20 74 68 65 20 73 65  63 6f 6e 64 20 72 6f 77  |s the second row|
00000ea0  20 64 6f 77 6e 2c 20 65  74 63 2e 20 54 68 75 73  | down, etc. Thus|
00000eb0  20 74 68 65 20 65 6e 74  69 72 65 0d 63 68 61 72  | the entire.char|
00000ec0  61 63 74 65 72 20 63 61  6e 20 62 65 20 64 65 66  |acter can be def|
00000ed0  69 6e 65 64 20 69 6e 20  65 69 67 68 74 20 62 79  |ined in eight by|
00000ee0  74 65 73 2c 20 61 6e 64  20 74 68 69 73 20 69 73  |tes, and this is|
00000ef0  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 62  | the number of b|
00000f00  79 74 65 73 0d 6f 66 20  74 68 65 20 45 6c 6b 27  |ytes.of the Elk'|
00000f10  73 20 6d 65 6d 6f 72 79  20 77 68 69 63 68 20 69  |s memory which i|
00000f20  73 20 75 73 65 64 20 62  79 20 65 61 63 68 20 63  |s used by each c|
00000f30  68 61 72 61 63 74 65 72  27 73 20 64 65 66 69 6e  |haracter's defin|
00000f40  69 74 69 6f 6e 2e 20 4e  6f 74 65 20 2d 0d 74 68  |ition. Note -.th|
00000f50  65 20 6d 6f 73 74 20 73  69 67 6e 69 66 69 63 61  |e most significa|
00000f60  6e 74 20 62 69 74 20 6f  66 20 65 61 63 68 20 62  |nt bit of each b|
00000f70  79 74 65 20 64 65 66 69  6e 65 73 20 74 68 65 20  |yte defines the |
00000f80  6c 65 66 74 2d 6d 6f 73  74 20 70 69 78 65 6c 20  |left-most pixel |
00000f90  6f 66 20 74 68 65 0d 72  6f 77 2c 20 61 6e 64 20  |of the.row, and |
00000fa0  74 68 65 20 6c 65 61 73  74 20 73 69 67 6e 69 66  |the least signif|
00000fb0  69 63 61 6e 74 20 62 69  74 20 64 65 66 69 6e 65  |icant bit define|
00000fc0  73 20 74 68 65 20 72 69  67 68 74 2d 6d 6f 73 74  |s the right-most|
00000fd0  20 70 69 78 65 6c 20 28  6a 75 73 74 20 61 73 0d  | pixel (just as.|
00000fe0  77 69 74 68 20 56 44 55  20 32 33 20 64 65 66 69  |with VDU 23 defi|
00000ff0  6e 69 74 69 6f 6e 73 29  2e 0d 0d 46 4f 55 52 20  |nitions)...FOUR |
00001000  43 4f 4c 4f 55 52 20 4d  4f 44 45 53 3a 0d 0d 54  |COLOUR MODES:..T|
00001010  68 69 73 20 74 69 6d 65  20 65 61 63 68 20 62 79  |his time each by|
00001020  74 65 20 63 61 6e 20 6f  6e 6c 79 20 68 6f 6c 64  |te can only hold|
00001030  20 66 6f 75 72 20 70 69  78 65 6c 73 2e 20 4f 6e  | four pixels. On|
00001040  63 65 20 61 67 61 69 6e  2c 20 65 61 63 68 20 62  |ce again, each b|
00001050  79 74 65 20 68 6f 6c 64  73 0d 61 20 6e 75 6d 62  |yte holds.a numb|
00001060  65 72 20 6f 66 20 70 69  78 65 6c 73 20 77 68 69  |er of pixels whi|
00001070  63 68 20 61 72 65 20 69  6e 20 61 20 68 6f 72 69  |ch are in a hori|
00001080  7a 6f 6e 74 61 6c 20 6c  69 6e 65 2e 20 54 68 69  |zontal line. Thi|
00001090  73 20 74 69 6d 65 2c 20  61 73 20 62 65 66 6f 72  |s time, as befor|
000010a0  65 2c 0d 74 68 65 20 66  69 72 73 74 20 65 69 67  |e,.the first eig|
000010b0  68 74 20 62 79 74 65 73  20 72 75 6e 20 64 6f 77  |ht bytes run dow|
000010c0  6e 20 69 6e 20 61 20 76  65 72 74 69 63 61 6c 20  |n in a vertical |
000010d0  6c 69 6e 65 2e 20 54 68  65 20 64 69 66 66 65 72  |line. The differ|
000010e0  65 6e 63 65 20 74 68 69  73 0d 74 69 6d 65 2c 20  |ence this.time, |
000010f0  74 68 6f 75 67 68 2c 20  69 73 20 74 68 61 74 20  |though, is that |
00001100  6e 6f 74 20 61 6c 6c 20  6f 66 20 74 68 65 20 70  |not all of the p|
00001110  69 78 65 6c 73 20 69 6e  20 74 68 65 20 63 68 61  |ixels in the cha|
00001120  72 61 63 74 65 72 20 61  72 65 20 62 65 69 6e 67  |racter are being|
00001130  0d 64 65 66 69 6e 65 64  20 62 79 20 74 68 65 20  |.defined by the |
00001140  6f 6e 65 20 73 77 65 65  70 2c 20 61 6e 64 20 69  |one sweep, and i|
00001150  6e 73 74 65 61 64 20 6f  6e 6c 79 20 74 68 65 20  |nstead only the |
00001160  6c 65 66 74 2d 6d 6f 73  74 20 66 6f 75 72 20 70  |left-most four p|
00001170  69 78 65 6c 73 20 63 61  6e 0d 62 65 20 64 65 66  |ixels can.be def|
00001180  69 6e 65 64 2e 20 54 68  65 20 72 69 67 68 74 2d  |ined. The right-|
00001190  6d 6f 73 74 20 66 6f 75  72 20 70 69 78 65 6c 73  |most four pixels|
000011a0  20 61 72 65 20 64 65 66  69 6e 65 64 20 69 6e 20  | are defined in |
000011b0  61 20 73 65 63 6f 6e 64  20 64 6f 77 6e 77 61 72  |a second downwar|
000011c0  64 0d 76 65 72 74 69 63  61 6c 20 73 77 65 65 70  |d.vertical sweep|
000011d0  2e 20 54 68 75 73 20 74  68 65 20 74 6f 74 61 6c  |. Thus the total|
000011e0  20 6d 65 6d 6f 72 79 20  61 6c 6c 6f 63 61 74 69  | memory allocati|
000011f0  6f 6e 20 66 6f 72 20 74  68 65 20 64 65 66 69 6e  |on for the defin|
00001200  69 74 69 6f 6e 20 6f 66  0d 65 61 63 68 20 63 68  |ition of.each ch|
00001210  61 72 61 63 74 65 72 20  69 73 20 73 69 78 74 65  |aracter is sixte|
00001220  65 6e 20 62 79 74 65 73  2e 20 54 68 65 20 6c 61  |en bytes. The la|
00001230  79 6f 75 74 20 6f 66 20  74 68 65 73 65 20 69 73  |yout of these is|
00001240  20 73 68 6f 77 6e 20 6d  6f 72 65 20 63 6c 65 61  | shown more clea|
00001250  72 6c 79 0d 62 79 20 74  68 65 20 64 69 61 67 72  |rly.by the diagr|
00001260  61 6d 20 62 65 6c 6f 77  2e 20 54 68 69 73 20 73  |am below. This s|
00001270  68 6f 77 73 20 74 68 65  20 65 69 67 68 74 2d 62  |hows the eight-b|
00001280  79 2d 65 69 67 68 74 20  62 6c 6f 63 6b 20 6f 66  |y-eight block of|
00001290  20 70 69 78 65 6c 73 20  69 6e 20 61 0d 63 68 61  | pixels in a.cha|
000012a0  72 61 63 74 65 72 2c 20  61 6e 64 20 65 61 63 68  |racter, and each|
000012b0  20 68 61 73 20 74 68 65  20 6f 66 66 73 65 74 20  | has the offset |
000012c0  6f 66 20 74 68 65 20 6d  65 6d 6f 72 79 20 6c 6f  |of the memory lo|
000012d0  63 61 74 69 6f 6e 20 77  68 65 72 65 20 74 68 69  |cation where thi|
000012e0  73 20 70 69 78 65 6c 0d  69 73 20 73 74 6f 72 65  |s pixel.is store|
000012f0  64 20 66 72 6f 6d 20 74  68 65 20 73 74 61 72 74  |d from the start|
00001300  20 6f 66 20 74 68 65 20  63 68 61 72 61 63 74 65  | of the characte|
00001310  72 20 64 65 66 69 6e 69  74 69 6f 6e 2e 20 4f 66  |r definition. Of|
00001320  66 73 65 74 73 20 61 72  65 20 67 69 76 65 6e 20  |fsets are given |
00001330  69 6e 0d 68 65 78 61 64  65 63 69 6d 61 6c 3a 0d  |in.hexadecimal:.|
00001340  0d                                                |.|
00001341
+P5.m0
+P5.m1
+P5.m2
+P5.m4
+P5.m5