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

Turnbull/!Pyramid/Library/PlotCode4

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

��plotcode16
�err$:err$="PlotCode16"
[OPT T%
(5; Code to plot a 16x16 sprite onto a 32x32 sprite
2:
<.plot16routines%
F]:�U%=0�15:[OPT T%
P"EQUD endplot16-plot16routines%
Z]:�:[OPT T%
d:
n2]:plot16routines%!0=P%-plot16routines%:[OPT T%
x(OPT �adr(11,sp4%,2):; Sprite address
�MOV R10,#16:; Y Counter
�
.yloop
�LDMIA R14,{R0}
�LDMIA R11!,{R5}
��R R0,R0,R5
�STMIA R14,{R0}
�ADD R14,R14,#8
�SUBS R10,R10,#1
�
BGT yloop
�B endplot16
�:
�]:�V%=1�15:W%=V%<<1:[OPT T%
�8]:plot16routines%!(V%<<2)=P%-plot16routines%:[OPT T%
(OPT �adr(11,sp4%,2):; Sprite address
MOV R10,#16:; Y Counter

.yloop
"LDMIA R14,{R0-R1}
,LDMIA R11!,{R5}
6,�R R0,R0,R5,LSL#W%:�R R1,R1,R5,LSR#32-W%
@STMIA R14,{R0-R1}
JADD R14,R14,#8
TSUBS R10,R10,#1
^
BGT yloop
hB endplot16
r]:�:[OPT T%
|:
�]:�
�
00000000  0d 00 0a 10 dd f2 70 6c  6f 74 63 6f 64 65 31 36  |......plotcode16|
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  31 36 22 0d 00 1e 0b 5b  |PlotCode16"....[|
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 31 36 78 31 36  | to plot a 16x16|
00000050  20 73 70 72 69 74 65 20  6f 6e 74 6f 20 61 20 33  | sprite onto a 3|
00000060  32 78 33 32 20 73 70 72  69 74 65 0d 00 32 05 3a  |2x32 sprite..2.:|
00000070  0d 00 3c 14 2e 70 6c 6f  74 31 36 72 6f 75 74 69  |..<..plot16routi|
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 31 36 2d 70 6c 6f  |UD endplot16-plo|
000000b0  74 31 36 72 6f 75 74 69  6e 65 73 25 0d 00 5a 0f  |t16routines%..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 31 36 72 6f 75 74  |..n2]:plot16rout|
000000e0  69 6e 65 73 25 21 30 3d  50 25 2d 70 6c 6f 74 31  |ines%!0=P%-plot1|
000000f0  36 72 6f 75 74 69 6e 65  73 25 3a 5b 4f 50 54 20  |6routines%:[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 34 25 2c 32  29 3a 3b 20 53 70 72 69  |1,sp4%,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 31  36 3a 3b 20 59 20 43 6f  |V R10,#16:; Y Co|
00000140  75 6e 74 65 72 0d 00 8c  0a 2e 79 6c 6f 6f 70 0d  |unter.....yloop.|
00000150  00 96 12 4c 44 4d 49 41  20 52 31 34 2c 7b 52 30  |...LDMIA R14,{R0|
00000160  7d 0d 00 a0 13 4c 44 4d  49 41 20 52 31 31 21 2c  |}....LDMIA R11!,|
00000170  7b 52 35 7d 0d 00 aa 0f  84 52 20 52 30 2c 52 30  |{R5}.....R R0,R0|
00000180  2c 52 35 0d 00 b4 12 53  54 4d 49 41 20 52 31 34  |,R5....STMIA R14|
00000190  2c 7b 52 30 7d 0d 00 be  12 41 44 44 20 52 31 34  |,{R0}....ADD R14|
000001a0  2c 52 31 34 2c 23 38 0d  00 c8 13 53 55 42 53 20  |,R14,#8....SUBS |
000001b0  52 31 30 2c 52 31 30 2c  23 31 0d 00 d2 0d 42 47  |R10,R10,#1....BG|
000001c0  54 20 79 6c 6f 6f 70 0d  00 dc 0f 42 20 65 6e 64  |T yloop....B end|
000001d0  70 6c 6f 74 31 36 0d 00  e6 05 3a 0d 00 f0 1f 5d  |plot16....:....]|
000001e0  3a e3 56 25 3d 31 b8 31  35 3a 57 25 3d 56 25 3c  |:.V%=1.15:W%=V%<|
000001f0  3c 31 3a 5b 4f 50 54 20  54 25 0d 00 fa 38 5d 3a  |<1:[OPT T%...8]:|
00000200  70 6c 6f 74 31 36 72 6f  75 74 69 6e 65 73 25 21  |plot16routines%!|
00000210  28 56 25 3c 3c 32 29 3d  50 25 2d 70 6c 6f 74 31  |(V%<<2)=P%-plot1|
00000220  36 72 6f 75 74 69 6e 65  73 25 3a 5b 4f 50 54 20  |6routines%:[OPT |
00000230  54 25 0d 01 04 28 4f 50  54 20 a4 61 64 72 28 31  |T%...(OPT .adr(1|
00000240  31 2c 73 70 34 25 2c 32  29 3a 3b 20 53 70 72 69  |1,sp4%,2):; Spri|
00000250  74 65 20 61 64 64 72 65  73 73 0d 01 0e 1b 4d 4f  |te address....MO|
00000260  56 20 52 31 30 2c 23 31  36 3a 3b 20 59 20 43 6f  |V R10,#16:; Y Co|
00000270  75 6e 74 65 72 0d 01 18  0a 2e 79 6c 6f 6f 70 0d  |unter.....yloop.|
00000280  01 22 15 4c 44 4d 49 41  20 52 31 34 2c 7b 52 30  |.".LDMIA R14,{R0|
00000290  2d 52 31 7d 0d 01 2c 13  4c 44 4d 49 41 20 52 31  |-R1}..,.LDMIA R1|
000002a0  31 21 2c 7b 52 35 7d 0d  01 36 2c 84 52 20 52 30  |1!,{R5}..6,.R R0|
000002b0  2c 52 30 2c 52 35 2c 4c  53 4c 23 57 25 3a 84 52  |,R0,R5,LSL#W%:.R|
000002c0  20 52 31 2c 52 31 2c 52  35 2c 4c 53 52 23 33 32  | R1,R1,R5,LSR#32|
000002d0  2d 57 25 0d 01 40 15 53  54 4d 49 41 20 52 31 34  |-W%..@.STMIA R14|
000002e0  2c 7b 52 30 2d 52 31 7d  0d 01 4a 12 41 44 44 20  |,{R0-R1}..J.ADD |
000002f0  52 31 34 2c 52 31 34 2c  23 38 0d 01 54 13 53 55  |R14,R14,#8..T.SU|
00000300  42 53 20 52 31 30 2c 52  31 30 2c 23 31 0d 01 5e  |BS R10,R10,#1..^|
00000310  0d 42 47 54 20 79 6c 6f  6f 70 0d 01 68 0f 42 20  |.BGT yloop..h.B |
00000320  65 6e 64 70 6c 6f 74 31  36 0d 01 72 0f 5d 3a ed  |endplot16..r.]:.|
00000330  3a 5b 4f 50 54 20 54 25  0d 01 7c 05 3a 0d 01 86  |:[OPT T%..|.:...|
00000340  07 5d 3a e1 0d ff                                 |.]:...|
00000346