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

Turnbull/!Pyramid/Library/PlotCode5

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/PlotCode5
Read OK:
File size: 038F bytes
Load address: 0000
Exec address: 0000
File contents
   10DEFPROCplotcode32
   20LOCALerr$:err$="PlotCode32"
   30[OPT T%
   40; Code to plot a 32x32 sprite onto a 64x64 sprite
   50:
   60.plot32routines%
   70]:FORU%=0TO15:[OPT T%
   80EQUD endplot32-plot32routines%
   90]:NEXT:[OPT T%
  100:
  110]:plot32routines%!0=P%-plot32routines%:[OPT T%
  120OPT FNadr(11,sp5%,2):; Sprite address
  130MOV R10,#32:; Y Counter
  140.yloop
  150LDMIA R14,{R0-R1}
  160LDMIA R11!,{R5-R6}
  170ORR R0,R0,R5
  180ORR R1,R1,R6
  190STMIA R14,{R0-R1}
  200ADD R14,R14,#16
  210SUBS R10,R10,#1
  220BGT yloop
  230B endplot32
  240:
  250]:FORV%=1TO15:W%=V%<<1:[OPT T%
  260]:plot32routines%!(V%<<2)=P%-plot32routines%:[OPT T%
  270OPT FNadr(11,sp5%,2):; Sprite address
  280MOV R10,#32:; Y Counter
  290.yloop
  300LDMIA R14,{R0-R2}
  310LDMIA R11!,{R5-R6}
  320ORR R0,R0,R5,LSL#W%:ORR R1,R1,R5,LSR#32-W%
  330ORR R1,R1,R6,LSL#W%:ORR R2,R2,R6,LSR#32-W%
  340STMIA R14,{R0-R2}
  350ADD R14,R14,#16
  360SUBS R10,R10,#1
  370BGT yloop
  380B endplot32
  390]:NEXT:[OPT T%
  400:
  410]:ENDPROC

��plotcode32
�err$:err$="PlotCode32"
[OPT T%
(5; Code to plot a 32x32 sprite onto a 64x64 sprite
2:
<.plot32routines%
F]:�U%=0�15:[OPT T%
P"EQUD endplot32-plot32routines%
Z]:�:[OPT T%
d:
n2]:plot32routines%!0=P%-plot32routines%:[OPT T%
x(OPT �adr(11,sp5%,2):; Sprite address
�MOV R10,#32:; Y Counter
�
.yloop
�LDMIA R14,{R0-R1}
�LDMIA R11!,{R5-R6}
��R R0,R0,R5
��R R1,R1,R6
�STMIA R14,{R0-R1}
�ADD R14,R14,#16
�SUBS R10,R10,#1
�
BGT yloop
�B endplot32
�:
�]:�V%=1�15:W%=V%<<1:[OPT T%
8]:plot32routines%!(V%<<2)=P%-plot32routines%:[OPT T%
(OPT �adr(11,sp5%,2):; Sprite address
MOV R10,#32:; Y Counter
"
.yloop
,LDMIA R14,{R0-R2}
6LDMIA R11!,{R5-R6}
@,�R R0,R0,R5,LSL#W%:�R R1,R1,R5,LSR#32-W%
J,�R R1,R1,R6,LSL#W%:�R R2,R2,R6,LSR#32-W%
TSTMIA R14,{R0-R2}
^ADD R14,R14,#16
hSUBS R10,R10,#1
r
BGT yloop
|B endplot32
�]:�:[OPT T%
�:
�]:�
�
00000000  0d 00 0a 10 dd f2 70 6c  6f 74 63 6f 64 65 33 32  |......plotcode32|
00000010  0d 00 14 1b ea 65 72 72  24 3a 65 72 72 24 3d 22  |.....err$:err$="|
00000020  50 6c 6f 74 43 6f 64 65  33 32 22 0d 00 1e 0b 5b  |PlotCode32"....[|
00000030  4f 50 54 20 54 25 0d 00  28 35 3b 20 43 6f 64 65  |OPT T%..(5; Code|
00000040  20 74 6f 20 70 6c 6f 74  20 61 20 33 32 78 33 32  | to plot a 32x32|
00000050  20 73 70 72 69 74 65 20  6f 6e 74 6f 20 61 20 36  | sprite onto a 6|
00000060  34 78 36 34 20 73 70 72  69 74 65 0d 00 32 05 3a  |4x64 sprite..2.:|
00000070  0d 00 3c 14 2e 70 6c 6f  74 33 32 72 6f 75 74 69  |..<..plot32routi|
00000080  6e 65 73 25 0d 00 46 16  5d 3a e3 55 25 3d 30 b8  |nes%..F.]:.U%=0.|
00000090  31 35 3a 5b 4f 50 54 20  54 25 0d 00 50 22 45 51  |15:[OPT T%..P"EQ|
000000a0  55 44 20 65 6e 64 70 6c  6f 74 33 32 2d 70 6c 6f  |UD endplot32-plo|
000000b0  74 33 32 72 6f 75 74 69  6e 65 73 25 0d 00 5a 0f  |t32routines%..Z.|
000000c0  5d 3a ed 3a 5b 4f 50 54  20 54 25 0d 00 64 05 3a  |]:.:[OPT T%..d.:|
000000d0  0d 00 6e 32 5d 3a 70 6c  6f 74 33 32 72 6f 75 74  |..n2]:plot32rout|
000000e0  69 6e 65 73 25 21 30 3d  50 25 2d 70 6c 6f 74 33  |ines%!0=P%-plot3|
000000f0  32 72 6f 75 74 69 6e 65  73 25 3a 5b 4f 50 54 20  |2routines%:[OPT |
00000100  54 25 0d 00 78 28 4f 50  54 20 a4 61 64 72 28 31  |T%..x(OPT .adr(1|
00000110  31 2c 73 70 35 25 2c 32  29 3a 3b 20 53 70 72 69  |1,sp5%,2):; Spri|
00000120  74 65 20 61 64 64 72 65  73 73 0d 00 82 1b 4d 4f  |te address....MO|
00000130  56 20 52 31 30 2c 23 33  32 3a 3b 20 59 20 43 6f  |V R10,#32:; Y Co|
00000140  75 6e 74 65 72 0d 00 8c  0a 2e 79 6c 6f 6f 70 0d  |unter.....yloop.|
00000150  00 96 15 4c 44 4d 49 41  20 52 31 34 2c 7b 52 30  |...LDMIA R14,{R0|
00000160  2d 52 31 7d 0d 00 a0 16  4c 44 4d 49 41 20 52 31  |-R1}....LDMIA R1|
00000170  31 21 2c 7b 52 35 2d 52  36 7d 0d 00 aa 0f 84 52  |1!,{R5-R6}.....R|
00000180  20 52 30 2c 52 30 2c 52  35 0d 00 b4 0f 84 52 20  | R0,R0,R5.....R |
00000190  52 31 2c 52 31 2c 52 36  0d 00 be 15 53 54 4d 49  |R1,R1,R6....STMI|
000001a0  41 20 52 31 34 2c 7b 52  30 2d 52 31 7d 0d 00 c8  |A R14,{R0-R1}...|
000001b0  13 41 44 44 20 52 31 34  2c 52 31 34 2c 23 31 36  |.ADD R14,R14,#16|
000001c0  0d 00 d2 13 53 55 42 53  20 52 31 30 2c 52 31 30  |....SUBS R10,R10|
000001d0  2c 23 31 0d 00 dc 0d 42  47 54 20 79 6c 6f 6f 70  |,#1....BGT yloop|
000001e0  0d 00 e6 0f 42 20 65 6e  64 70 6c 6f 74 33 32 0d  |....B endplot32.|
000001f0  00 f0 05 3a 0d 00 fa 1f  5d 3a e3 56 25 3d 31 b8  |...:....]:.V%=1.|
00000200  31 35 3a 57 25 3d 56 25  3c 3c 31 3a 5b 4f 50 54  |15:W%=V%<<1:[OPT|
00000210  20 54 25 0d 01 04 38 5d  3a 70 6c 6f 74 33 32 72  | T%...8]:plot32r|
00000220  6f 75 74 69 6e 65 73 25  21 28 56 25 3c 3c 32 29  |outines%!(V%<<2)|
00000230  3d 50 25 2d 70 6c 6f 74  33 32 72 6f 75 74 69 6e  |=P%-plot32routin|
00000240  65 73 25 3a 5b 4f 50 54  20 54 25 0d 01 0e 28 4f  |es%:[OPT T%...(O|
00000250  50 54 20 a4 61 64 72 28  31 31 2c 73 70 35 25 2c  |PT .adr(11,sp5%,|
00000260  32 29 3a 3b 20 53 70 72  69 74 65 20 61 64 64 72  |2):; Sprite addr|
00000270  65 73 73 0d 01 18 1b 4d  4f 56 20 52 31 30 2c 23  |ess....MOV R10,#|
00000280  33 32 3a 3b 20 59 20 43  6f 75 6e 74 65 72 0d 01  |32:; Y Counter..|
00000290  22 0a 2e 79 6c 6f 6f 70  0d 01 2c 15 4c 44 4d 49  |"..yloop..,.LDMI|
000002a0  41 20 52 31 34 2c 7b 52  30 2d 52 32 7d 0d 01 36  |A R14,{R0-R2}..6|
000002b0  16 4c 44 4d 49 41 20 52  31 31 21 2c 7b 52 35 2d  |.LDMIA R11!,{R5-|
000002c0  52 36 7d 0d 01 40 2c 84  52 20 52 30 2c 52 30 2c  |R6}..@,.R R0,R0,|
000002d0  52 35 2c 4c 53 4c 23 57  25 3a 84 52 20 52 31 2c  |R5,LSL#W%:.R R1,|
000002e0  52 31 2c 52 35 2c 4c 53  52 23 33 32 2d 57 25 0d  |R1,R5,LSR#32-W%.|
000002f0  01 4a 2c 84 52 20 52 31  2c 52 31 2c 52 36 2c 4c  |.J,.R R1,R1,R6,L|
00000300  53 4c 23 57 25 3a 84 52  20 52 32 2c 52 32 2c 52  |SL#W%:.R R2,R2,R|
00000310  36 2c 4c 53 52 23 33 32  2d 57 25 0d 01 54 15 53  |6,LSR#32-W%..T.S|
00000320  54 4d 49 41 20 52 31 34  2c 7b 52 30 2d 52 32 7d  |TMIA R14,{R0-R2}|
00000330  0d 01 5e 13 41 44 44 20  52 31 34 2c 52 31 34 2c  |..^.ADD R14,R14,|
00000340  23 31 36 0d 01 68 13 53  55 42 53 20 52 31 30 2c  |#16..h.SUBS R10,|
00000350  52 31 30 2c 23 31 0d 01  72 0d 42 47 54 20 79 6c  |R10,#1..r.BGT yl|
00000360  6f 6f 70 0d 01 7c 0f 42  20 65 6e 64 70 6c 6f 74  |oop..|.B endplot|
00000370  33 32 0d 01 86 0f 5d 3a  ed 3a 5b 4f 50 54 20 54  |32....]:.:[OPT T|
00000380  25 0d 01 90 05 3a 0d 01  9a 07 5d 3a e1 0d ff     |%....:....]:...|
0000038f