Home » Archimedes archive » Acorn User » AU 1997-11 B.adf » Regulars » StarInfo/Holloway/!Shade/!Help

StarInfo/Holloway/!Shade/!Help

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 » Archimedes archive » Acorn User » AU 1997-11 B.adf » Regulars
Filename: StarInfo/Holloway/!Shade/!Help
Read OK:
File size: 1103 bytes
Load address: 0000
Exec address: 0000
File contents

                        
                               -------------------
                               |                 |
                               |  S  H  A  D  E  |
                               |                 |
                               -------------------
                               
                              by Alex Holloway, 1997
                              
                              
  Shade is a program which allows you to draw using the "shade bobs" effect seen in demos such as Xtreme. Shade is Risc PC only (24-bit colour), and requires at least 1Mb VRAM to work (a version for machines without VRAM is of course technically possible, but the display would be very small).
  
  Keys are as follows:
  
  - Draw using mouse (Select to draw)
  
  - Insert: shows menu
  - Delete: clears screen
  - Print: saves screen.
  
  The menu options are as follows:
  
  - Change colour shift: allows you to specify how much of each colour to be added to or removed from the screen while drawing, takes integer values between -10 and +10 (higher values are possible but don't give the effect).
  
  - Change brush type: allows you to select which sprite to use as a brush shape. Extra brushes can be created by adding sprites to the 'Brushes' sprite file inside !Shade. These should be 20x20 pixels in 2 colours, and will be recognised automatically by the program.
  
  - Change background colour: takes input of values between 0 and 255 for red, green and blue. Note - this clears the screen, all previous drawings are lost.
  
  - Change filename for screen save - allows you to specify a pathname to save to when 'Print' is pressed.
  
  The first three options are also gone through when the program is first loaded. For these options, a zero can be entered by pressing Enter on a blank line.
  
  
  HOW THE PROGRAM WORKS (a brief overview)
  ========================================
  N.B. Please excuse my totally uncommented and unreadable Basic.
  
  Lines up to 430 are for setting up and mainly involve getting the brush sprites sorted out, the main loop is lines 430 to 510.
  
  x% is the current x position of the mouse, x2% is the previous x position of the mouse. (Similarly for y% and y2%).
  
  When drawing, Shade takes points two at a time, and interpolates between them to create a continuous line - this is done by PROCdraw_across and PROCdraw_up. This is done with respect to either the horizontal or the vertical depending on whether the gradient of the line is greater or less than 1 (decided by PROCdraw).
  For each position on the line, the assembler plot routine is called. Registers at start are as follows:
  R0 - start address of screen memory
  R1 - x location of plot
  R2 - y location of plot
  R3 - width of plot
  R4 - height of plot
    (Originally different sized brushes were planned, however I never got round to implementing this)
  R5 - start address of mask, generated from sprite data when program is started up by PROCsetup_pixtable
  R6 - address of block containing colour information (cols%)
  R7 - brush type.
  Lines 900 to 1050 do setup, translate the co-ordinates information into addresses to start and end the plot; the remainder is the actual plot code. This section goes through each memory location to be changed, checks if it isn't masked out, and if it isn't, splits out the colour components and adds (or subtracts) in the colour shift.
  During the plotting process, registers are used as follows:
  (if I remember correctly!)
  R1 - shift for current colour (red/green/blue)
  R2 - 8-bit value of current colour component of pixel
  R6 - address of current position in colour info block
  R7 - bit offset from 0 of current colour in pixel data
  R8 - mask for current pixel loaded here
  R9 - start address of position in plot, incremented with each pixel
  R10 - end address of plot
  R11 - colour data of current pixel
  R12 - end address of current line to plot
  It's probably possible to code all of this much more simply, but I couldn't work out how!

  Lines 1490 onwards are the user interface, this should be fairly self-explanatory; a user sprite area, starting at sprite%, is used to store the current picture while the menu is being used. PROCsetcols makes sure that the text is in a readable colour no matter what the background colour is!
00000000  0a 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00000010  20 20 20 20 20 20 20 20  20 20 0a 20 20 20 20 20  |          .     |
00000020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000030  20 20 20 20 20 20 20 20  20 20 2d 2d 2d 2d 2d 2d  |          ------|
00000040  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0a 20 20  |-------------.  |
00000050  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000060  20 20 20 20 20 20 20 20  20 20 20 20 20 7c 20 20  |             |  |
00000070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 7c  |               ||
00000080  0a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000000a0  7c 20 20 53 20 20 48 20  20 41 20 20 44 20 20 45  ||  S  H  A  D  E|
000000b0  20 20 7c 0a 20 20 20 20  20 20 20 20 20 20 20 20  |  |.            |
000000c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000000d0  20 20 20 7c 20 20 20 20  20 20 20 20 20 20 20 20  |   |            |
000000e0  20 20 20 20 20 7c 0a 20  20 20 20 20 20 20 20 20  |     |.         |
000000f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000100  20 20 20 20 20 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |      ----------|
00000110  2d 2d 2d 2d 2d 2d 2d 2d  2d 0a 20 20 20 20 20 20  |---------.      |
00000120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000130  20 20 20 20 20 20 20 20  20 0a 20 20 20 20 20 20  |         .      |
00000140  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000150  20 20 20 20 20 20 20 20  62 79 20 41 6c 65 78 20  |        by Alex |
00000160  48 6f 6c 6c 6f 77 61 79  2c 20 31 39 39 37 0a 20  |Holloway, 1997. |
00000170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000180  20 20 20 20 20 20 20 20  20 20 20 20 20 0a 20 20  |             .  |
00000190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000001a0  20 20 20 20 20 20 20 20  20 20 20 20 0a 20 20 53  |            .  S|
000001b0  68 61 64 65 20 69 73 20  61 20 70 72 6f 67 72 61  |hade is a progra|
000001c0  6d 20 77 68 69 63 68 20  61 6c 6c 6f 77 73 20 79  |m which allows y|
000001d0  6f 75 20 74 6f 20 64 72  61 77 20 75 73 69 6e 67  |ou to draw using|
000001e0  20 74 68 65 20 22 73 68  61 64 65 20 62 6f 62 73  | the "shade bobs|
000001f0  22 20 65 66 66 65 63 74  20 73 65 65 6e 20 69 6e  |" effect seen in|
00000200  20 64 65 6d 6f 73 20 73  75 63 68 20 61 73 20 58  | demos such as X|
00000210  74 72 65 6d 65 2e 20 53  68 61 64 65 20 69 73 20  |treme. Shade is |
00000220  52 69 73 63 20 50 43 20  6f 6e 6c 79 20 28 32 34  |Risc PC only (24|
00000230  2d 62 69 74 20 63 6f 6c  6f 75 72 29 2c 20 61 6e  |-bit colour), an|
00000240  64 20 72 65 71 75 69 72  65 73 20 61 74 20 6c 65  |d requires at le|
00000250  61 73 74 20 31 4d 62 20  56 52 41 4d 20 74 6f 20  |ast 1Mb VRAM to |
00000260  77 6f 72 6b 20 28 61 20  76 65 72 73 69 6f 6e 20  |work (a version |
00000270  66 6f 72 20 6d 61 63 68  69 6e 65 73 20 77 69 74  |for machines wit|
00000280  68 6f 75 74 20 56 52 41  4d 20 69 73 20 6f 66 20  |hout VRAM is of |
00000290  63 6f 75 72 73 65 20 74  65 63 68 6e 69 63 61 6c  |course technical|
000002a0  6c 79 20 70 6f 73 73 69  62 6c 65 2c 20 62 75 74  |ly possible, but|
000002b0  20 74 68 65 20 64 69 73  70 6c 61 79 20 77 6f 75  | the display wou|
000002c0  6c 64 20 62 65 20 76 65  72 79 20 73 6d 61 6c 6c  |ld be very small|
000002d0  29 2e 0a 20 20 0a 20 20  4b 65 79 73 20 61 72 65  |)..  .  Keys are|
000002e0  20 61 73 20 66 6f 6c 6c  6f 77 73 3a 0a 20 20 0a  | as follows:.  .|
000002f0  20 20 2d 20 44 72 61 77  20 75 73 69 6e 67 20 6d  |  - Draw using m|
00000300  6f 75 73 65 20 28 53 65  6c 65 63 74 20 74 6f 20  |ouse (Select to |
00000310  64 72 61 77 29 0a 20 20  0a 20 20 2d 20 49 6e 73  |draw).  .  - Ins|
00000320  65 72 74 3a 20 73 68 6f  77 73 20 6d 65 6e 75 0a  |ert: shows menu.|
00000330  20 20 2d 20 44 65 6c 65  74 65 3a 20 63 6c 65 61  |  - Delete: clea|
00000340  72 73 20 73 63 72 65 65  6e 0a 20 20 2d 20 50 72  |rs screen.  - Pr|
00000350  69 6e 74 3a 20 73 61 76  65 73 20 73 63 72 65 65  |int: saves scree|
00000360  6e 2e 0a 20 20 0a 20 20  54 68 65 20 6d 65 6e 75  |n..  .  The menu|
00000370  20 6f 70 74 69 6f 6e 73  20 61 72 65 20 61 73 20  | options are as |
00000380  66 6f 6c 6c 6f 77 73 3a  0a 20 20 0a 20 20 2d 20  |follows:.  .  - |
00000390  43 68 61 6e 67 65 20 63  6f 6c 6f 75 72 20 73 68  |Change colour sh|
000003a0  69 66 74 3a 20 61 6c 6c  6f 77 73 20 79 6f 75 20  |ift: allows you |
000003b0  74 6f 20 73 70 65 63 69  66 79 20 68 6f 77 20 6d  |to specify how m|
000003c0  75 63 68 20 6f 66 20 65  61 63 68 20 63 6f 6c 6f  |uch of each colo|
000003d0  75 72 20 74 6f 20 62 65  20 61 64 64 65 64 20 74  |ur to be added t|
000003e0  6f 20 6f 72 20 72 65 6d  6f 76 65 64 20 66 72 6f  |o or removed fro|
000003f0  6d 20 74 68 65 20 73 63  72 65 65 6e 20 77 68 69  |m the screen whi|
00000400  6c 65 20 64 72 61 77 69  6e 67 2c 20 74 61 6b 65  |le drawing, take|
00000410  73 20 69 6e 74 65 67 65  72 20 76 61 6c 75 65 73  |s integer values|
00000420  20 62 65 74 77 65 65 6e  20 2d 31 30 20 61 6e 64  | between -10 and|
00000430  20 2b 31 30 20 28 68 69  67 68 65 72 20 76 61 6c  | +10 (higher val|
00000440  75 65 73 20 61 72 65 20  70 6f 73 73 69 62 6c 65  |ues are possible|
00000450  20 62 75 74 20 64 6f 6e  27 74 20 67 69 76 65 20  | but don't give |
00000460  74 68 65 20 65 66 66 65  63 74 29 2e 0a 20 20 0a  |the effect)..  .|
00000470  20 20 2d 20 43 68 61 6e  67 65 20 62 72 75 73 68  |  - Change brush|
00000480  20 74 79 70 65 3a 20 61  6c 6c 6f 77 73 20 79 6f  | type: allows yo|
00000490  75 20 74 6f 20 73 65 6c  65 63 74 20 77 68 69 63  |u to select whic|
000004a0  68 20 73 70 72 69 74 65  20 74 6f 20 75 73 65 20  |h sprite to use |
000004b0  61 73 20 61 20 62 72 75  73 68 20 73 68 61 70 65  |as a brush shape|
000004c0  2e 20 45 78 74 72 61 20  62 72 75 73 68 65 73 20  |. Extra brushes |
000004d0  63 61 6e 20 62 65 20 63  72 65 61 74 65 64 20 62  |can be created b|
000004e0  79 20 61 64 64 69 6e 67  20 73 70 72 69 74 65 73  |y adding sprites|
000004f0  20 74 6f 20 74 68 65 20  27 42 72 75 73 68 65 73  | to the 'Brushes|
00000500  27 20 73 70 72 69 74 65  20 66 69 6c 65 20 69 6e  |' sprite file in|
00000510  73 69 64 65 20 21 53 68  61 64 65 2e 20 54 68 65  |side !Shade. The|
00000520  73 65 20 73 68 6f 75 6c  64 20 62 65 20 32 30 78  |se should be 20x|
00000530  32 30 20 70 69 78 65 6c  73 20 69 6e 20 32 20 63  |20 pixels in 2 c|
00000540  6f 6c 6f 75 72 73 2c 20  61 6e 64 20 77 69 6c 6c  |olours, and will|
00000550  20 62 65 20 72 65 63 6f  67 6e 69 73 65 64 20 61  | be recognised a|
00000560  75 74 6f 6d 61 74 69 63  61 6c 6c 79 20 62 79 20  |utomatically by |
00000570  74 68 65 20 70 72 6f 67  72 61 6d 2e 0a 20 20 0a  |the program..  .|
00000580  20 20 2d 20 43 68 61 6e  67 65 20 62 61 63 6b 67  |  - Change backg|
00000590  72 6f 75 6e 64 20 63 6f  6c 6f 75 72 3a 20 74 61  |round colour: ta|
000005a0  6b 65 73 20 69 6e 70 75  74 20 6f 66 20 76 61 6c  |kes input of val|
000005b0  75 65 73 20 62 65 74 77  65 65 6e 20 30 20 61 6e  |ues between 0 an|
000005c0  64 20 32 35 35 20 66 6f  72 20 72 65 64 2c 20 67  |d 255 for red, g|
000005d0  72 65 65 6e 20 61 6e 64  20 62 6c 75 65 2e 20 4e  |reen and blue. N|
000005e0  6f 74 65 20 2d 20 74 68  69 73 20 63 6c 65 61 72  |ote - this clear|
000005f0  73 20 74 68 65 20 73 63  72 65 65 6e 2c 20 61 6c  |s the screen, al|
00000600  6c 20 70 72 65 76 69 6f  75 73 20 64 72 61 77 69  |l previous drawi|
00000610  6e 67 73 20 61 72 65 20  6c 6f 73 74 2e 0a 20 20  |ngs are lost..  |
00000620  0a 20 20 2d 20 43 68 61  6e 67 65 20 66 69 6c 65  |.  - Change file|
00000630  6e 61 6d 65 20 66 6f 72  20 73 63 72 65 65 6e 20  |name for screen |
00000640  73 61 76 65 20 2d 20 61  6c 6c 6f 77 73 20 79 6f  |save - allows yo|
00000650  75 20 74 6f 20 73 70 65  63 69 66 79 20 61 20 70  |u to specify a p|
00000660  61 74 68 6e 61 6d 65 20  74 6f 20 73 61 76 65 20  |athname to save |
00000670  74 6f 20 77 68 65 6e 20  27 50 72 69 6e 74 27 20  |to when 'Print' |
00000680  69 73 20 70 72 65 73 73  65 64 2e 0a 20 20 0a 20  |is pressed..  . |
00000690  20 54 68 65 20 66 69 72  73 74 20 74 68 72 65 65  | The first three|
000006a0  20 6f 70 74 69 6f 6e 73  20 61 72 65 20 61 6c 73  | options are als|
000006b0  6f 20 67 6f 6e 65 20 74  68 72 6f 75 67 68 20 77  |o gone through w|
000006c0  68 65 6e 20 74 68 65 20  70 72 6f 67 72 61 6d 20  |hen the program |
000006d0  69 73 20 66 69 72 73 74  20 6c 6f 61 64 65 64 2e  |is first loaded.|
000006e0  20 46 6f 72 20 74 68 65  73 65 20 6f 70 74 69 6f  | For these optio|
000006f0  6e 73 2c 20 61 20 7a 65  72 6f 20 63 61 6e 20 62  |ns, a zero can b|
00000700  65 20 65 6e 74 65 72 65  64 20 62 79 20 70 72 65  |e entered by pre|
00000710  73 73 69 6e 67 20 45 6e  74 65 72 20 6f 6e 20 61  |ssing Enter on a|
00000720  20 62 6c 61 6e 6b 20 6c  69 6e 65 2e 0a 20 20 0a  | blank line..  .|
00000730  20 20 0a 20 20 48 4f 57  20 54 48 45 20 50 52 4f  |  .  HOW THE PRO|
00000740  47 52 41 4d 20 57 4f 52  4b 53 20 28 61 20 62 72  |GRAM WORKS (a br|
00000750  69 65 66 20 6f 76 65 72  76 69 65 77 29 0a 20 20  |ief overview).  |
00000760  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000780  3d 3d 3d 3d 3d 3d 3d 3d  0a 20 20 4e 2e 42 2e 20  |========.  N.B. |
00000790  50 6c 65 61 73 65 20 65  78 63 75 73 65 20 6d 79  |Please excuse my|
000007a0  20 74 6f 74 61 6c 6c 79  20 75 6e 63 6f 6d 6d 65  | totally uncomme|
000007b0  6e 74 65 64 20 61 6e 64  20 75 6e 72 65 61 64 61  |nted and unreada|
000007c0  62 6c 65 20 42 61 73 69  63 2e 0a 20 20 0a 20 20  |ble Basic..  .  |
000007d0  4c 69 6e 65 73 20 75 70  20 74 6f 20 34 33 30 20  |Lines up to 430 |
000007e0  61 72 65 20 66 6f 72 20  73 65 74 74 69 6e 67 20  |are for setting |
000007f0  75 70 20 61 6e 64 20 6d  61 69 6e 6c 79 20 69 6e  |up and mainly in|
00000800  76 6f 6c 76 65 20 67 65  74 74 69 6e 67 20 74 68  |volve getting th|
00000810  65 20 62 72 75 73 68 20  73 70 72 69 74 65 73 20  |e brush sprites |
00000820  73 6f 72 74 65 64 20 6f  75 74 2c 20 74 68 65 20  |sorted out, the |
00000830  6d 61 69 6e 20 6c 6f 6f  70 20 69 73 20 6c 69 6e  |main loop is lin|
00000840  65 73 20 34 33 30 20 74  6f 20 35 31 30 2e 0a 20  |es 430 to 510.. |
00000850  20 0a 20 20 78 25 20 69  73 20 74 68 65 20 63 75  | .  x% is the cu|
00000860  72 72 65 6e 74 20 78 20  70 6f 73 69 74 69 6f 6e  |rrent x position|
00000870  20 6f 66 20 74 68 65 20  6d 6f 75 73 65 2c 20 78  | of the mouse, x|
00000880  32 25 20 69 73 20 74 68  65 20 70 72 65 76 69 6f  |2% is the previo|
00000890  75 73 20 78 20 70 6f 73  69 74 69 6f 6e 20 6f 66  |us x position of|
000008a0  20 74 68 65 20 6d 6f 75  73 65 2e 20 28 53 69 6d  | the mouse. (Sim|
000008b0  69 6c 61 72 6c 79 20 66  6f 72 20 79 25 20 61 6e  |ilarly for y% an|
000008c0  64 20 79 32 25 29 2e 0a  20 20 0a 20 20 57 68 65  |d y2%)..  .  Whe|
000008d0  6e 20 64 72 61 77 69 6e  67 2c 20 53 68 61 64 65  |n drawing, Shade|
000008e0  20 74 61 6b 65 73 20 70  6f 69 6e 74 73 20 74 77  | takes points tw|
000008f0  6f 20 61 74 20 61 20 74  69 6d 65 2c 20 61 6e 64  |o at a time, and|
00000900  20 69 6e 74 65 72 70 6f  6c 61 74 65 73 20 62 65  | interpolates be|
00000910  74 77 65 65 6e 20 74 68  65 6d 20 74 6f 20 63 72  |tween them to cr|
00000920  65 61 74 65 20 61 20 63  6f 6e 74 69 6e 75 6f 75  |eate a continuou|
00000930  73 20 6c 69 6e 65 20 2d  20 74 68 69 73 20 69 73  |s line - this is|
00000940  20 64 6f 6e 65 20 62 79  20 50 52 4f 43 64 72 61  | done by PROCdra|
00000950  77 5f 61 63 72 6f 73 73  20 61 6e 64 20 50 52 4f  |w_across and PRO|
00000960  43 64 72 61 77 5f 75 70  2e 20 54 68 69 73 20 69  |Cdraw_up. This i|
00000970  73 20 64 6f 6e 65 20 77  69 74 68 20 72 65 73 70  |s done with resp|
00000980  65 63 74 20 74 6f 20 65  69 74 68 65 72 20 74 68  |ect to either th|
00000990  65 20 68 6f 72 69 7a 6f  6e 74 61 6c 20 6f 72 20  |e horizontal or |
000009a0  74 68 65 20 76 65 72 74  69 63 61 6c 20 64 65 70  |the vertical dep|
000009b0  65 6e 64 69 6e 67 20 6f  6e 20 77 68 65 74 68 65  |ending on whethe|
000009c0  72 20 74 68 65 20 67 72  61 64 69 65 6e 74 20 6f  |r the gradient o|
000009d0  66 20 74 68 65 20 6c 69  6e 65 20 69 73 20 67 72  |f the line is gr|
000009e0  65 61 74 65 72 20 6f 72  20 6c 65 73 73 20 74 68  |eater or less th|
000009f0  61 6e 20 31 20 28 64 65  63 69 64 65 64 20 62 79  |an 1 (decided by|
00000a00  20 50 52 4f 43 64 72 61  77 29 2e 0a 20 20 46 6f  | PROCdraw)..  Fo|
00000a10  72 20 65 61 63 68 20 70  6f 73 69 74 69 6f 6e 20  |r each position |
00000a20  6f 6e 20 74 68 65 20 6c  69 6e 65 2c 20 74 68 65  |on the line, the|
00000a30  20 61 73 73 65 6d 62 6c  65 72 20 70 6c 6f 74 20  | assembler plot |
00000a40  72 6f 75 74 69 6e 65 20  69 73 20 63 61 6c 6c 65  |routine is calle|
00000a50  64 2e 20 52 65 67 69 73  74 65 72 73 20 61 74 20  |d. Registers at |
00000a60  73 74 61 72 74 20 61 72  65 20 61 73 20 66 6f 6c  |start are as fol|
00000a70  6c 6f 77 73 3a 0a 20 20  52 30 20 2d 20 73 74 61  |lows:.  R0 - sta|
00000a80  72 74 20 61 64 64 72 65  73 73 20 6f 66 20 73 63  |rt address of sc|
00000a90  72 65 65 6e 20 6d 65 6d  6f 72 79 0a 20 20 52 31  |reen memory.  R1|
00000aa0  20 2d 20 78 20 6c 6f 63  61 74 69 6f 6e 20 6f 66  | - x location of|
00000ab0  20 70 6c 6f 74 0a 20 20  52 32 20 2d 20 79 20 6c  | plot.  R2 - y l|
00000ac0  6f 63 61 74 69 6f 6e 20  6f 66 20 70 6c 6f 74 0a  |ocation of plot.|
00000ad0  20 20 52 33 20 2d 20 77  69 64 74 68 20 6f 66 20  |  R3 - width of |
00000ae0  70 6c 6f 74 0a 20 20 52  34 20 2d 20 68 65 69 67  |plot.  R4 - heig|
00000af0  68 74 20 6f 66 20 70 6c  6f 74 0a 20 20 20 20 28  |ht of plot.    (|
00000b00  4f 72 69 67 69 6e 61 6c  6c 79 20 64 69 66 66 65  |Originally diffe|
00000b10  72 65 6e 74 20 73 69 7a  65 64 20 62 72 75 73 68  |rent sized brush|
00000b20  65 73 20 77 65 72 65 20  70 6c 61 6e 6e 65 64 2c  |es were planned,|
00000b30  20 68 6f 77 65 76 65 72  20 49 20 6e 65 76 65 72  | however I never|
00000b40  20 67 6f 74 20 72 6f 75  6e 64 20 74 6f 20 69 6d  | got round to im|
00000b50  70 6c 65 6d 65 6e 74 69  6e 67 20 74 68 69 73 29  |plementing this)|
00000b60  0a 20 20 52 35 20 2d 20  73 74 61 72 74 20 61 64  |.  R5 - start ad|
00000b70  64 72 65 73 73 20 6f 66  20 6d 61 73 6b 2c 20 67  |dress of mask, g|
00000b80  65 6e 65 72 61 74 65 64  20 66 72 6f 6d 20 73 70  |enerated from sp|
00000b90  72 69 74 65 20 64 61 74  61 20 77 68 65 6e 20 70  |rite data when p|
00000ba0  72 6f 67 72 61 6d 20 69  73 20 73 74 61 72 74 65  |rogram is starte|
00000bb0  64 20 75 70 20 62 79 20  50 52 4f 43 73 65 74 75  |d up by PROCsetu|
00000bc0  70 5f 70 69 78 74 61 62  6c 65 0a 20 20 52 36 20  |p_pixtable.  R6 |
00000bd0  2d 20 61 64 64 72 65 73  73 20 6f 66 20 62 6c 6f  |- address of blo|
00000be0  63 6b 20 63 6f 6e 74 61  69 6e 69 6e 67 20 63 6f  |ck containing co|
00000bf0  6c 6f 75 72 20 69 6e 66  6f 72 6d 61 74 69 6f 6e  |lour information|
00000c00  20 28 63 6f 6c 73 25 29  0a 20 20 52 37 20 2d 20  | (cols%).  R7 - |
00000c10  62 72 75 73 68 20 74 79  70 65 2e 0a 20 20 4c 69  |brush type..  Li|
00000c20  6e 65 73 20 39 30 30 20  74 6f 20 31 30 35 30 20  |nes 900 to 1050 |
00000c30  64 6f 20 73 65 74 75 70  2c 20 74 72 61 6e 73 6c  |do setup, transl|
00000c40  61 74 65 20 74 68 65 20  63 6f 2d 6f 72 64 69 6e  |ate the co-ordin|
00000c50  61 74 65 73 20 69 6e 66  6f 72 6d 61 74 69 6f 6e  |ates information|
00000c60  20 69 6e 74 6f 20 61 64  64 72 65 73 73 65 73 20  | into addresses |
00000c70  74 6f 20 73 74 61 72 74  20 61 6e 64 20 65 6e 64  |to start and end|
00000c80  20 74 68 65 20 70 6c 6f  74 3b 20 74 68 65 20 72  | the plot; the r|
00000c90  65 6d 61 69 6e 64 65 72  20 69 73 20 74 68 65 20  |emainder is the |
00000ca0  61 63 74 75 61 6c 20 70  6c 6f 74 20 63 6f 64 65  |actual plot code|
00000cb0  2e 20 54 68 69 73 20 73  65 63 74 69 6f 6e 20 67  |. This section g|
00000cc0  6f 65 73 20 74 68 72 6f  75 67 68 20 65 61 63 68  |oes through each|
00000cd0  20 6d 65 6d 6f 72 79 20  6c 6f 63 61 74 69 6f 6e  | memory location|
00000ce0  20 74 6f 20 62 65 20 63  68 61 6e 67 65 64 2c 20  | to be changed, |
00000cf0  63 68 65 63 6b 73 20 69  66 20 69 74 20 69 73 6e  |checks if it isn|
00000d00  27 74 20 6d 61 73 6b 65  64 20 6f 75 74 2c 20 61  |'t masked out, a|
00000d10  6e 64 20 69 66 20 69 74  20 69 73 6e 27 74 2c 20  |nd if it isn't, |
00000d20  73 70 6c 69 74 73 20 6f  75 74 20 74 68 65 20 63  |splits out the c|
00000d30  6f 6c 6f 75 72 20 63 6f  6d 70 6f 6e 65 6e 74 73  |olour components|
00000d40  20 61 6e 64 20 61 64 64  73 20 28 6f 72 20 73 75  | and adds (or su|
00000d50  62 74 72 61 63 74 73 29  20 69 6e 20 74 68 65 20  |btracts) in the |
00000d60  63 6f 6c 6f 75 72 20 73  68 69 66 74 2e 0a 20 20  |colour shift..  |
00000d70  44 75 72 69 6e 67 20 74  68 65 20 70 6c 6f 74 74  |During the plott|
00000d80  69 6e 67 20 70 72 6f 63  65 73 73 2c 20 72 65 67  |ing process, reg|
00000d90  69 73 74 65 72 73 20 61  72 65 20 75 73 65 64 20  |isters are used |
00000da0  61 73 20 66 6f 6c 6c 6f  77 73 3a 0a 20 20 28 69  |as follows:.  (i|
00000db0  66 20 49 20 72 65 6d 65  6d 62 65 72 20 63 6f 72  |f I remember cor|
00000dc0  72 65 63 74 6c 79 21 29  0a 20 20 52 31 20 2d 20  |rectly!).  R1 - |
00000dd0  73 68 69 66 74 20 66 6f  72 20 63 75 72 72 65 6e  |shift for curren|
00000de0  74 20 63 6f 6c 6f 75 72  20 28 72 65 64 2f 67 72  |t colour (red/gr|
00000df0  65 65 6e 2f 62 6c 75 65  29 0a 20 20 52 32 20 2d  |een/blue).  R2 -|
00000e00  20 38 2d 62 69 74 20 76  61 6c 75 65 20 6f 66 20  | 8-bit value of |
00000e10  63 75 72 72 65 6e 74 20  63 6f 6c 6f 75 72 20 63  |current colour c|
00000e20  6f 6d 70 6f 6e 65 6e 74  20 6f 66 20 70 69 78 65  |omponent of pixe|
00000e30  6c 0a 20 20 52 36 20 2d  20 61 64 64 72 65 73 73  |l.  R6 - address|
00000e40  20 6f 66 20 63 75 72 72  65 6e 74 20 70 6f 73 69  | of current posi|
00000e50  74 69 6f 6e 20 69 6e 20  63 6f 6c 6f 75 72 20 69  |tion in colour i|
00000e60  6e 66 6f 20 62 6c 6f 63  6b 0a 20 20 52 37 20 2d  |nfo block.  R7 -|
00000e70  20 62 69 74 20 6f 66 66  73 65 74 20 66 72 6f 6d  | bit offset from|
00000e80  20 30 20 6f 66 20 63 75  72 72 65 6e 74 20 63 6f  | 0 of current co|
00000e90  6c 6f 75 72 20 69 6e 20  70 69 78 65 6c 20 64 61  |lour in pixel da|
00000ea0  74 61 0a 20 20 52 38 20  2d 20 6d 61 73 6b 20 66  |ta.  R8 - mask f|
00000eb0  6f 72 20 63 75 72 72 65  6e 74 20 70 69 78 65 6c  |or current pixel|
00000ec0  20 6c 6f 61 64 65 64 20  68 65 72 65 0a 20 20 52  | loaded here.  R|
00000ed0  39 20 2d 20 73 74 61 72  74 20 61 64 64 72 65 73  |9 - start addres|
00000ee0  73 20 6f 66 20 70 6f 73  69 74 69 6f 6e 20 69 6e  |s of position in|
00000ef0  20 70 6c 6f 74 2c 20 69  6e 63 72 65 6d 65 6e 74  | plot, increment|
00000f00  65 64 20 77 69 74 68 20  65 61 63 68 20 70 69 78  |ed with each pix|
00000f10  65 6c 0a 20 20 52 31 30  20 2d 20 65 6e 64 20 61  |el.  R10 - end a|
00000f20  64 64 72 65 73 73 20 6f  66 20 70 6c 6f 74 0a 20  |ddress of plot. |
00000f30  20 52 31 31 20 2d 20 63  6f 6c 6f 75 72 20 64 61  | R11 - colour da|
00000f40  74 61 20 6f 66 20 63 75  72 72 65 6e 74 20 70 69  |ta of current pi|
00000f50  78 65 6c 0a 20 20 52 31  32 20 2d 20 65 6e 64 20  |xel.  R12 - end |
00000f60  61 64 64 72 65 73 73 20  6f 66 20 63 75 72 72 65  |address of curre|
00000f70  6e 74 20 6c 69 6e 65 20  74 6f 20 70 6c 6f 74 0a  |nt line to plot.|
00000f80  20 20 49 74 27 73 20 70  72 6f 62 61 62 6c 79 20  |  It's probably |
00000f90  70 6f 73 73 69 62 6c 65  20 74 6f 20 63 6f 64 65  |possible to code|
00000fa0  20 61 6c 6c 20 6f 66 20  74 68 69 73 20 6d 75 63  | all of this muc|
00000fb0  68 20 6d 6f 72 65 20 73  69 6d 70 6c 79 2c 20 62  |h more simply, b|
00000fc0  75 74 20 49 20 63 6f 75  6c 64 6e 27 74 20 77 6f  |ut I couldn't wo|
00000fd0  72 6b 20 6f 75 74 20 68  6f 77 21 0a 0a 20 20 4c  |rk out how!..  L|
00000fe0  69 6e 65 73 20 31 34 39  30 20 6f 6e 77 61 72 64  |ines 1490 onward|
00000ff0  73 20 61 72 65 20 74 68  65 20 75 73 65 72 20 69  |s are the user i|
00001000  6e 74 65 72 66 61 63 65  2c 20 74 68 69 73 20 73  |nterface, this s|
00001010  68 6f 75 6c 64 20 62 65  20 66 61 69 72 6c 79 20  |hould be fairly |
00001020  73 65 6c 66 2d 65 78 70  6c 61 6e 61 74 6f 72 79  |self-explanatory|
00001030  3b 20 61 20 75 73 65 72  20 73 70 72 69 74 65 20  |; a user sprite |
00001040  61 72 65 61 2c 20 73 74  61 72 74 69 6e 67 20 61  |area, starting a|
00001050  74 20 73 70 72 69 74 65  25 2c 20 69 73 20 75 73  |t sprite%, is us|
00001060  65 64 20 74 6f 20 73 74  6f 72 65 20 74 68 65 20  |ed to store the |
00001070  63 75 72 72 65 6e 74 20  70 69 63 74 75 72 65 20  |current picture |
00001080  77 68 69 6c 65 20 74 68  65 20 6d 65 6e 75 20 69  |while the menu i|
00001090  73 20 62 65 69 6e 67 20  75 73 65 64 2e 20 50 52  |s being used. PR|
000010a0  4f 43 73 65 74 63 6f 6c  73 20 6d 61 6b 65 73 20  |OCsetcols makes |
000010b0  73 75 72 65 20 74 68 61  74 20 74 68 65 20 74 65  |sure that the te|
000010c0  78 74 20 69 73 20 69 6e  20 61 20 72 65 61 64 61  |xt is in a reada|
000010d0  62 6c 65 20 63 6f 6c 6f  75 72 20 6e 6f 20 6d 61  |ble colour no ma|
000010e0  74 74 65 72 20 77 68 61  74 20 74 68 65 20 62 61  |tter what the ba|
000010f0  63 6b 67 72 6f 75 6e 64  20 63 6f 6c 6f 75 72 20  |ckground colour |
00001100  69 73 21                                          |is!|
00001103