Home » Archimedes archive » Acorn User » AU 1994-03.adf » !StarInfo_StarInfo » Turnbull/!Pyramid/Library/PlotCodeS

Turnbull/!Pyramid/Library/PlotCodeS

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 1994-03.adf » !StarInfo_StarInfo
Filename: Turnbull/!Pyramid/Library/PlotCodeS
Read OK:
File size: 0305 bytes
Load address: 0000
Exec address: 0000
File contents
   10DEFPROCplotcode8421
   20LOCALerr$:err$="PlotCodeS"
   30[OPT T%
   40; Code to plot a small sprite onto a small sprite
   50; R11 is smaller sprite address
   60; R14 is bigger sprite address
   70; R10 is small sprite height
   80; R9 is return address
   90:
  100.plot8421routines%
  110]:FORU%=0TO15:[OPT T%
  120EQUD endplot8-plot8421routines%
  130]:NEXT:[OPT T%
  140:
  150]:plot8421routines%!0=P%-plot8421routines%:[OPT T%
  160.yloop
  170LDR R0,[R14]
  180LDR R5,[R11],#4
  190ORR R0,R0,R5
  200STR R0,[R14],#4
  210SUBS R10,R10,#1
  220BGT yloop
  230MOV PC,R9
  240:
  250]:FORV%=1TO15:W%=V%<<1:[OPT T%
  260]:plot8421routines%!(V%<<2)=P%-plot8421routines%:[OPT T%
  270.yloop
  280LDR R0,[R14]
  290LDR R5,[R11],#4
  300ORR R0,R0,R5,LSL#W%
  310STR R0,[R14],#4
  320SUBS R10,R10,#1
  330BGT yloop
  340MOV PC,R9
  350]:NEXT:[OPT T%
  360:
  370]:ENDPROC

��plotcode8421
�err$:err$="PlotCodeS"
[OPT T%
(5; Code to plot a small sprite onto a small sprite
2#; R11 is smaller sprite address
<"; R14 is bigger sprite address
F ; R10 is small sprite height
P; R9 is return address
Z:
d.plot8421routines%
n]:�U%=0�15:[OPT T%
x#EQUD endplot8-plot8421routines%
�]:�:[OPT T%
�:
�6]:plot8421routines%!0=P%-plot8421routines%:[OPT T%
�
.yloop
�LDR R0,[R14]
�LDR R5,[R11],#4
��R R0,R0,R5
�STR R0,[R14],#4
�SUBS R10,R10,#1
�
BGT yloop
�
MOV PC,R9
�:
�]:�V%=1�15:W%=V%<<1:[OPT T%
<]:plot8421routines%!(V%<<2)=P%-plot8421routines%:[OPT T%

.yloop
LDR R0,[R14]
"LDR R5,[R11],#4
,�R R0,R0,R5,LSL#W%
6STR R0,[R14],#4
@SUBS R10,R10,#1
J
BGT yloop
T
MOV PC,R9
^]:�:[OPT T%
h:
r]:�
�
00000000  0d 00 0a 12 dd f2 70 6c  6f 74 63 6f 64 65 38 34  |......plotcode84|
00000010  32 31 0d 00 14 1a ea 65  72 72 24 3a 65 72 72 24  |21.....err$:err$|
00000020  3d 22 50 6c 6f 74 43 6f  64 65 53 22 0d 00 1e 0b  |="PlotCodeS"....|
00000030  5b 4f 50 54 20 54 25 0d  00 28 35 3b 20 43 6f 64  |[OPT T%..(5; Cod|
00000040  65 20 74 6f 20 70 6c 6f  74 20 61 20 73 6d 61 6c  |e to plot a smal|
00000050  6c 20 73 70 72 69 74 65  20 6f 6e 74 6f 20 61 20  |l sprite onto a |
00000060  73 6d 61 6c 6c 20 73 70  72 69 74 65 0d 00 32 23  |small sprite..2#|
00000070  3b 20 52 31 31 20 69 73  20 73 6d 61 6c 6c 65 72  |; R11 is smaller|
00000080  20 73 70 72 69 74 65 20  61 64 64 72 65 73 73 0d  | sprite address.|
00000090  00 3c 22 3b 20 52 31 34  20 69 73 20 62 69 67 67  |.<"; R14 is bigg|
000000a0  65 72 20 73 70 72 69 74  65 20 61 64 64 72 65 73  |er sprite addres|
000000b0  73 0d 00 46 20 3b 20 52  31 30 20 69 73 20 73 6d  |s..F ; R10 is sm|
000000c0  61 6c 6c 20 73 70 72 69  74 65 20 68 65 69 67 68  |all sprite heigh|
000000d0  74 0d 00 50 1a 3b 20 52  39 20 69 73 20 72 65 74  |t..P.; R9 is ret|
000000e0  75 72 6e 20 61 64 64 72  65 73 73 0d 00 5a 05 3a  |urn address..Z.:|
000000f0  0d 00 64 16 2e 70 6c 6f  74 38 34 32 31 72 6f 75  |..d..plot8421rou|
00000100  74 69 6e 65 73 25 0d 00  6e 16 5d 3a e3 55 25 3d  |tines%..n.]:.U%=|
00000110  30 b8 31 35 3a 5b 4f 50  54 20 54 25 0d 00 78 23  |0.15:[OPT T%..x#|
00000120  45 51 55 44 20 65 6e 64  70 6c 6f 74 38 2d 70 6c  |EQUD endplot8-pl|
00000130  6f 74 38 34 32 31 72 6f  75 74 69 6e 65 73 25 0d  |ot8421routines%.|
00000140  00 82 0f 5d 3a ed 3a 5b  4f 50 54 20 54 25 0d 00  |...]:.:[OPT T%..|
00000150  8c 05 3a 0d 00 96 36 5d  3a 70 6c 6f 74 38 34 32  |..:...6]:plot842|
00000160  31 72 6f 75 74 69 6e 65  73 25 21 30 3d 50 25 2d  |1routines%!0=P%-|
00000170  70 6c 6f 74 38 34 32 31  72 6f 75 74 69 6e 65 73  |plot8421routines|
00000180  25 3a 5b 4f 50 54 20 54  25 0d 00 a0 0a 2e 79 6c  |%:[OPT T%.....yl|
00000190  6f 6f 70 0d 00 aa 10 4c  44 52 20 52 30 2c 5b 52  |oop....LDR R0,[R|
000001a0  31 34 5d 0d 00 b4 13 4c  44 52 20 52 35 2c 5b 52  |14]....LDR R5,[R|
000001b0  31 31 5d 2c 23 34 0d 00  be 0f 84 52 20 52 30 2c  |11],#4.....R R0,|
000001c0  52 30 2c 52 35 0d 00 c8  13 53 54 52 20 52 30 2c  |R0,R5....STR R0,|
000001d0  5b 52 31 34 5d 2c 23 34  0d 00 d2 13 53 55 42 53  |[R14],#4....SUBS|
000001e0  20 52 31 30 2c 52 31 30  2c 23 31 0d 00 dc 0d 42  | R10,R10,#1....B|
000001f0  47 54 20 79 6c 6f 6f 70  0d 00 e6 0d 4d 4f 56 20  |GT yloop....MOV |
00000200  50 43 2c 52 39 0d 00 f0  05 3a 0d 00 fa 1f 5d 3a  |PC,R9....:....]:|
00000210  e3 56 25 3d 31 b8 31 35  3a 57 25 3d 56 25 3c 3c  |.V%=1.15:W%=V%<<|
00000220  31 3a 5b 4f 50 54 20 54  25 0d 01 04 3c 5d 3a 70  |1:[OPT T%...<]:p|
00000230  6c 6f 74 38 34 32 31 72  6f 75 74 69 6e 65 73 25  |lot8421routines%|
00000240  21 28 56 25 3c 3c 32 29  3d 50 25 2d 70 6c 6f 74  |!(V%<<2)=P%-plot|
00000250  38 34 32 31 72 6f 75 74  69 6e 65 73 25 3a 5b 4f  |8421routines%:[O|
00000260  50 54 20 54 25 0d 01 0e  0a 2e 79 6c 6f 6f 70 0d  |PT T%.....yloop.|
00000270  01 18 10 4c 44 52 20 52  30 2c 5b 52 31 34 5d 0d  |...LDR R0,[R14].|
00000280  01 22 13 4c 44 52 20 52  35 2c 5b 52 31 31 5d 2c  |.".LDR R5,[R11],|
00000290  23 34 0d 01 2c 16 84 52  20 52 30 2c 52 30 2c 52  |#4..,..R R0,R0,R|
000002a0  35 2c 4c 53 4c 23 57 25  0d 01 36 13 53 54 52 20  |5,LSL#W%..6.STR |
000002b0  52 30 2c 5b 52 31 34 5d  2c 23 34 0d 01 40 13 53  |R0,[R14],#4..@.S|
000002c0  55 42 53 20 52 31 30 2c  52 31 30 2c 23 31 0d 01  |UBS R10,R10,#1..|
000002d0  4a 0d 42 47 54 20 79 6c  6f 6f 70 0d 01 54 0d 4d  |J.BGT yloop..T.M|
000002e0  4f 56 20 50 43 2c 52 39  0d 01 5e 0f 5d 3a ed 3a  |OV PC,R9..^.]:.:|
000002f0  5b 4f 50 54 20 54 25 0d  01 68 05 3a 0d 01 72 07  |[OPT T%..h.:..r.|
00000300  5d 3a e1 0d ff                                    |]:...|
00000305