Home » Archimedes archive » Archimedes World » AW-1996-09.adf » !AcornAns_AcornAns » Whizzy

Whizzy

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 » Archimedes World » AW-1996-09.adf » !AcornAns_AcornAns
Filename: Whizzy
Read OK:
File size: 18B4 bytes
Load address: 0000
Exec address: 0000
File contents
   10MODE 0
   20PROCinit
   30PROCass
   40:
   50ON ERROR SYS 6,112,1:SYS 6,113,1:PRINT REPORT$;" at line ";ERL:END
   60MODE 13+128:MODE 13:OFF
   70SYS 6,112,1:SYS 6,113,1
   80REPEAT
   90 CALL swim%
  100UNTIL FALSE
  110END
  120:
  130DEF PROCinit
  140mnp%=4000
  150np%=2
  160:
  170ds%=20
  180DIM code% 1024, data% ds%*mnp%, trig% 16384*4
  190:
  200FOR i%=0 TO np%-1
  210p% = data%+ds%*i%
  220p%!0  = (RND(320)-1)*256       :REM x coord in 1/256ths of a pixel
  230p%!4  = (RND(256)-1)*256       :REM y coord
  240p%!8  = (RND(16384)-1)         :REM direction (an index into trig)
  250p%!12 = (2*RND(2)-3)*2608/(RND(100)) :REM angular velocity
  260p%!16 = RND(21)-11                   :REM angular acceleration
  270NEXT
  280ENDPROC
  290:
  300DEF PROCass
  310!code%=148:code%!4=-1
  320SYS "OS_ReadVduVariables",code%,code%
  330scrst%=!code%
  340s%=0:c%=256
  350trig%!0              = ((  s% AND65535)<<16) + (  c% AND65535)
  360trig%!(4*8192)       = ((  s% AND65535)<<16) + ((-c%)AND65535)
  370FOR i%=1 TO 4096
  380s%=-256*SIN(i%*PI/8192):c%=256*COS(i%*PI/8192)
  390trig%!(4*i%)         = ((  s% AND65535)<<16) + (  c% AND65535)
  400trig%!(4*(8192-i%))  = ((  s% AND65535)<<16) + ((-c%)AND65535)
  410trig%!(4*(8192+i%))  = (((-s%)AND65535)<<16) + ((-c%)AND65535)
  420trig%!(4*(16384-i%)) = (((-s%)AND65535)<<16) + (  c% AND65535)
  430NEXT
  440:
  450b%=4 : REM Plotting code requires objects lie fully within screen.
  460       REM b% ensures object centres leave border of this many
  470       REM pixels from edge giving room to plot object.
  480:
  490FOR pass%=0 TO 2 STEP 2
  500P%=code%
  510[OPT pass%
  520.ascrstsum%         EQUD scrst%*2+81920
  530.ascrst%  EQUD scrst%
  540.abank%   EQUD 1
  550.adata%   EQUD data%:EQUD data%+ds%*np%:EQUD data%+ds%*mnp%
  560.atrig%   EQUD trig%
  570.seed%    EQUD -1:EQUD -1
  580.swim%                        ;purpose - to move all objects one
  590STMFD     13!, {14}           ; frame forward and display this
  600:                             ; new frame
  610MOV      0, #19
  620SWI      "OS_Byte"            ;wait for vsync
  630MOV      0, #113
  640LDR      1, abank%
  650RSB      3, 1, #3
  660STR      3, abank%
  670SWI      "OS_Byte"            ;swap displayed screen banks
  680LDR      0, ascrstsum%
  690LDR      1, ascrst%
  700SUB      1, 0, 1
  710STR      1, ascrst%           ;swap ptr to other bank
  720:                             ; (to be written to)
  730BL       cls%                 ;cls that bank
  740:
  750ADR       14, adata%
  760LDMIA     14, {0,1}           ;get ptrs to start & end of objects
  770LDR       2, ascrst%          ;get ptr to screen memory
  780ADR       14, seed%
  790LDMIA     14, {3,4}           ;get low and high words of ran# seed
  800LDR       12, atrig%          ;get ptr to trig table
  810:
  820.swimloop%                    ;scan each object in our list -
  830:
  840LDMIA     0, {5,6,7,8,9}      ;get next object's details
  850:
  860MOVS      4, 4, LSR #1        ;generate random 32-bit number
  870MOVS      14, 3, RRX
  880ADC       4, 4, 4
  890EOR       14, 14, 3, LSL #12
  900EOR       3, 14, 14, LSR #20
  910ANDS      14, 3, #127         ;look at low 7 bits
  920RSBEQ     8, 8, #0            ;if zero (1 in 128 chance) reverse
  930:                             ;angular velocity
  940:
  950ADD       8, 8, 9             ;modify ang velocity by ang acc
  960ADD       7, 7, 8             ;modify direction by ang vel
  970MOV       7, 7, LSL #18
  980MOV       7, 7, LSR #18
  990LDR       14, [12, 7, LSL #2] ;look up new dir from trig table
 1000MOV       10, 14, ASR #16     ;split it into x and
 1010MOV       11, 14, ASL #16     ;y components
 1020MOV       11, 11, ASR #16
 1030:
 1040ADD       5, 5, 10            ;modify position via direction
 1050CMP       5, #b%*256          ;vector and apply wrap-around
 1060ADDLT     5, 5, #(320-2*b%)*256 ;if object moves off screen
 1070CMP       5, #(320-b%)*256
 1080SUBGE     5, 5, #(320-2*b%)*256
 1090ADD       6, 6, 11
 1100CMP       6, #b%*256
 1110ADDLT     6, 6, #(256-2*b%)*256
 1120CMP       6, #(256-b%)*256
 1130SUBGE     6, 6, #(256-2*b%)*256
 1140:
 1150MOV       14, 6, LSR #8       ;get address on screen of object
 1160ADD       14, 14, 14, LSL #2  ;centre (remember first to convert
 1170ADD       14, 2, 14, LSL #6   ;coords in 1/256'ths of a pixel
 1180STRB      0, [14, 5, LSR #8]! ;to integer pixel coords via LSR #8)
 1190STRB      0, [14, #320]
 1200STRB      0, [14, #-320]      ;write to object centre and the
 1210STRB      0, [14, #-1]        ;four surrounding pixels, giving a
 1220STRB      0, [14, #1]         ;small + shape
 1230:
 1240CMP       8, #2048*1.125      ;if object has very high ang vel
 1250BLT       noswimadd%          ;let it reproduce!
 1260LDR       14, adata%+8
 1270CMP       14, 1               ;(if there is room to add another
 1280BLS       noswimadd%          ; object to our list)
 1290MOV       8, 8, ASR #11       ;give new objects lower ang vel
 1300STMIA     1, {5,6,7,8,9}      ;(else get rapid chain reaction)
 1310ADD       1, 1, #ds%
 1320STR       1, adata%+4
 1330RSB       8, 8, #0            ;and alter direction of one so they
 1340ADD       7, 7, #8192         ;head off in different directions
 1350MOV       7, 7, LSL #18
 1360MOV       7, 7, LSR #18
 1370SWI       256+7               ;make a beep to mark birth!
 1380:
 1390.noswimadd%
 1400:
 1410STMIA     0, {5,6,7,8}        ;resave object's modified details
 1420ADD       0, 0, #ds%
 1430CMP       0, 1
 1440BLO       swimloop%           ;repeat for next if any more exist
 1450ADR       14, seed%
 1460STMIA     14, {3,4}
 1470LDMFD 13!, {PC}               ;all objects moved so EXIT!
 1480:
 1490.alrcls% EQUD 0
 1500.aspcls% EQUD 0
 1510.cls%                        ;simple routine to clear screen
 1520STR      14, alrcls%         ;as rapidly as possible -
 1530STR      13, aspcls%         ;note the heavy use of STM.
 1540LDR      0, ascrst%
 1550MOV      1, #105
 1560MOV      2, #0
 1570ORR      2, 2, 2, LSL #8
 1580ORR      2, 2, 2, LSL #16
 1590MOV      3, 2
 1600MOV      4, 2
 1610MOV      5, 2
 1620MOV      6, 2
 1630MOV      7, 2
 1640MOV      8, 2
 1650MOV      9, 2
 1660MOV      10, 2
 1670MOV      11, 2
 1680MOV      12, 2
 1690MOV      13, 2
 1700MOV      14, 2
 1710.clsloop%
 1720STMIA    0!, {2-14}
 1730STMIA    0!, {2-14}
 1740STMIA    0!, {2-14}
 1750STMIA    0!, {2-14}
 1760STMIA    0!, {2-14}
 1770STMIA    0!, {2-14}
 1780STMIA    0!, {2-14}
 1790STMIA    0!, {2-14}
 1800STMIA    0!, {2-14}
 1810STMIA    0!, {2-14}
 1820STMIA    0!, {2-14}
 1830STMIA    0!, {2-14}
 1840STMIA    0!, {2-14}
 1850STMIA    0!, {2-14}
 1860STMIA    0!, {2-14}
 1870SUBS     1, 1, #1
 1880BNE      clsloop%
 1890STMIA    0!, {2-6}
 1900LDR      13, aspcls%
 1910LDR      PC, alrcls%
 1920]
 1930NEXT
 1940ENDPROC

� 0
	�init
�ass
(:
22� � ș 6,112,1:ș 6,113,1:� �$;" at line ";�:�
<� 13+128:� 13:�
Fș 6,112,1:ș 6,113,1
P�
Z � swim%
d� �
n�
x:
�� �init
�
mnp%=4000
�	np%=2
�:
�
ds%=20
�/� code% 1024, data% ds%*mnp%, trig% 16384*4
�:
�� i%=0 � np%-1
�p% = data%+ds%*i%
�Bp%!0  = (�(320)-1)*256       :� x coord in 1/256ths of a pixel
�+p%!4  = (�(256)-1)*256       :� y coord
�Bp%!8  = (�(16384)-1)         :� direction (an index into trig)
�8p%!12 = (2*�(2)-3)*2608/(�(100)) :� angular velocity
>p%!16 = �(21)-11                   :� angular acceleration
�
�
":
,
� �ass
6!code%=148:code%!4=-1
@(ș "OS_ReadVduVariables",code%,code%
Jscrst%=!code%
Ts%=0:c%=256
^>trig%!0              = ((  s% �65535)<<16) + (  c% �65535)
h>trig%!(4*8192)       = ((  s% �65535)<<16) + ((-c%)�65535)
r� i%=1 � 4096
|,s%=-256*�(i%*�/8192):c%=256*�(i%*�/8192)
�>trig%!(4*i%)         = ((  s% �65535)<<16) + (  c% �65535)
�>trig%!(4*(8192-i%))  = ((  s% �65535)<<16) + ((-c%)�65535)
�>trig%!(4*(8192+i%))  = (((-s%)�65535)<<16) + ((-c%)�65535)
�>trig%!(4*(16384-i%)) = (((-s%)�65535)<<16) + (  c% �65535)
��
�:
�Db%=4 : � Plotting code requires objects lie fully within screen.
�@       � b% ensures object centres leave border of this many
�9       � pixels from edge giving room to plot object.
�:
�� pass%=0 � 2 � 2
�P%=code%
�[OPT pass%
+.ascrstsum%         EQUD scrst%*2+81920
.ascrst%  EQUD scrst%
.abank%   EQUD 1
&?.adata%   EQUD data%:EQUD data%+ds%*np%:EQUD data%+ds%*mnp%
0.atrig%   EQUD trig%
:.seed%    EQUD -1:EQUD -1
DD.swim%                        ;purpose - to move all objects one
NBSTMFD     13!, {14}           ; frame forward and display this
X-:                             ; new frame
bMOV      0, #19
l1SWI      "OS_Byte"            ;wait for vsync
vMOV      0, #113
�LDR      1, abank%
�RSB      3, 1, #3
�STR      3, abank%
�>SWI      "OS_Byte"            ;swap displayed screen banks
�LDR      0, ascrstsum%
�LDR      1, ascrst%
�SUB      1, 0, 1
�9STR      1, ascrst%           ;swap ptr to other bank
�6:                             ; (to be written to)
�0BL       cls%                 ;cls that bank
�:
�ADR       14, adata%
�ELDMIA     14, {0,1}           ;get ptrs to start & end of objects
;LDR       2, ascrst%          ;get ptr to screen memory
ADR       14, seed%
FLDMIA     14, {3,4}           ;get low and high words of ran# seed
 8LDR       12, atrig%          ;get ptr to trig table
*:
4A.swimloop%                    ;scan each object in our list -
>:
H<LDMIA     0, {5,6,7,8,9}      ;get next object's details
R:
\@MOVS      4, 4, LSR #1        ;generate random 32-bit number
fMOVS      14, 3, RRX
pADC       4, 4, 4
z�       14, 14, 3, LSL #12
��       3, 14, 14, LSR #20
�3�S      14, 3, #127         ;look at low 7 bits
�DRSBEQ     8, 8, #0            ;if zero (1 in 128 chance) reverse
�3:                             ;angular velocity
�:
�AADD       8, 8, 9             ;modify ang velocity by ang acc
�>ADD       7, 7, 8             ;modify direction by ang vel
�MOV       7, 7, LSL #18
�MOV       7, 7, LSR #18
�BLDR       14, [12, 7, LSL #2] ;look up new dir from trig table
�6MOV       10, 14, ASR #16     ;split it into x and
�/MOV       11, 14, ASL #16     ;y components
�MOV       11, 11, ASR #16
:
@ADD       5, 5, 10            ;modify position via direction
?CMP       5, #b%*256          ;vector and apply wrap-around
$?ADDLT     5, 5, #(320-2*b%)*256 ;if object moves off screen
.CMP       5, #(320-b%)*256
8#SUBGE     5, 5, #(320-2*b%)*256
BADD       6, 6, 11
LCMP       6, #b%*256
V#ADDLT     6, 6, #(256-2*b%)*256
`CMP       6, #(256-b%)*256
j#SUBGE     6, 6, #(256-2*b%)*256
t:
~BMOV       14, 6, LSR #8       ;get address on screen of object
�DADD       14, 14, 14, LSL #2  ;centre (remember first to convert
�AADD       14, 2, 14, LSL #6   ;coords in 1/256'ths of a pixel
�FSTRB      0, [14, 5, LSR #8]! ;to integer pixel coords via LSR #8)
�STRB      0, [14, #320]
�ASTRB      0, [14, #-320]      ;write to object centre and the
�DSTRB      0, [14, #-1]        ;four surrounding pixels, giving a
�0STRB      0, [14, #1]         ;small + shape
�:
�BCMP       8, #2048*1.125      ;if object has very high ang vel
�4BLT       noswimadd%          ;let it reproduce!
�LDR       14, adata%+8
�CCMP       14, 1               ;(if there is room to add another
7BLS       noswimadd%          ; object to our list)

AMOV       8, 8, ASR #11       ;give new objects lower ang vel
BSTMIA     1, {5,6,7,8,9}      ;(else get rapid chain reaction)
ADD       1, 1, #ds%
(STR       1, adata%+4
2ERSB       8, 8, #0            ;and alter direction of one so they
<CADD       7, 7, #8192         ;head off in different directions
FMOV       7, 7, LSL #18
PMOV       7, 7, LSR #18
Z=SWI       256+7               ;make a beep to mark birth!
d:
n.noswimadd%
x:
�CSTMIA     0, {5,6,7,8}        ;resave object's modified details
�ADD       0, 0, #ds%
�CMP       0, 1
�DBLO       swimloop%           ;repeat for next if any more exist
�ADR       14, seed%
�STMIA     14, {3,4}
�=LDMFD 13!, {PC}               ;all objects moved so EXIT!
�:
�.alrcls% EQUD 0
�.aspcls% EQUD 0
�@.cls%                        ;simple routine to clear screen
�:STR      14, alrcls%         ;as rapidly as possible -
�<STR      13, aspcls%         ;note the heavy use of STM.
LDR      0, ascrst%
MOV      1, #105
MOV      2, #0
"�R      2, 2, 2, LSL #8
,�R      2, 2, 2, LSL #16
6MOV      3, 2
@MOV      4, 2
JMOV      5, 2
TMOV      6, 2
^MOV      7, 2
hMOV      8, 2
rMOV      9, 2
|MOV      10, 2
�MOV      11, 2
�MOV      12, 2
�MOV      13, 2
�MOV      14, 2
�
.clsloop%
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
�STMIA    0!, {2-14}
STMIA    0!, {2-14}
STMIA    0!, {2-14}
STMIA    0!, {2-14}
&STMIA    0!, {2-14}
0STMIA    0!, {2-14}
:STMIA    0!, {2-14}
DSTMIA    0!, {2-14}
NSUBS     1, 1, #1
XBNE      clsloop%
bSTMIA    0!, {2-6}
lLDR      13, aspcls%
vLDR      PC, alrcls%
�]
��
��
�
00000000  0d 00 0a 07 eb 20 30 0d  00 14 09 f2 69 6e 69 74  |..... 0.....init|
00000010  0d 00 1e 08 f2 61 73 73  0d 00 28 05 3a 0d 00 32  |.....ass..(.:..2|
00000020  32 ee 20 85 20 c8 99 20  36 2c 31 31 32 2c 31 3a  |2. . .. 6,112,1:|
00000030  c8 99 20 36 2c 31 31 33  2c 31 3a f1 20 f6 24 3b  |.. 6,113,1:. .$;|
00000040  22 20 61 74 20 6c 69 6e  65 20 22 3b 9e 3a e0 0d  |" at line ";.:..|
00000050  00 3c 13 eb 20 31 33 2b  31 32 38 3a eb 20 31 33  |.<.. 13+128:. 13|
00000060  3a 87 0d 00 46 19 c8 99  20 36 2c 31 31 32 2c 31  |:...F... 6,112,1|
00000070  3a c8 99 20 36 2c 31 31  33 2c 31 0d 00 50 05 f5  |:.. 6,113,1..P..|
00000080  0d 00 5a 0c 20 d6 20 73  77 69 6d 25 0d 00 64 07  |..Z. . swim%..d.|
00000090  fd 20 a3 0d 00 6e 05 e0  0d 00 78 05 3a 0d 00 82  |. ...n....x.:...|
000000a0  0b dd 20 f2 69 6e 69 74  0d 00 8c 0d 6d 6e 70 25  |.. .init....mnp%|
000000b0  3d 34 30 30 30 0d 00 96  09 6e 70 25 3d 32 0d 00  |=4000....np%=2..|
000000c0  a0 05 3a 0d 00 aa 0a 64  73 25 3d 32 30 0d 00 b4  |..:....ds%=20...|
000000d0  2f de 20 63 6f 64 65 25  20 31 30 32 34 2c 20 64  |/. code% 1024, d|
000000e0  61 74 61 25 20 64 73 25  2a 6d 6e 70 25 2c 20 74  |ata% ds%*mnp%, t|
000000f0  72 69 67 25 20 31 36 33  38 34 2a 34 0d 00 be 05  |rig% 16384*4....|
00000100  3a 0d 00 c8 12 e3 20 69  25 3d 30 20 b8 20 6e 70  |:..... i%=0 . np|
00000110  25 2d 31 0d 00 d2 15 70  25 20 3d 20 64 61 74 61  |%-1....p% = data|
00000120  25 2b 64 73 25 2a 69 25  0d 00 dc 42 70 25 21 30  |%+ds%*i%...Bp%!0|
00000130  20 20 3d 20 28 b3 28 33  32 30 29 2d 31 29 2a 32  |  = (.(320)-1)*2|
00000140  35 36 20 20 20 20 20 20  20 3a f4 20 78 20 63 6f  |56       :. x co|
00000150  6f 72 64 20 69 6e 20 31  2f 32 35 36 74 68 73 20  |ord in 1/256ths |
00000160  6f 66 20 61 20 70 69 78  65 6c 0d 00 e6 2b 70 25  |of a pixel...+p%|
00000170  21 34 20 20 3d 20 28 b3  28 32 35 36 29 2d 31 29  |!4  = (.(256)-1)|
00000180  2a 32 35 36 20 20 20 20  20 20 20 3a f4 20 79 20  |*256       :. y |
00000190  63 6f 6f 72 64 0d 00 f0  42 70 25 21 38 20 20 3d  |coord...Bp%!8  =|
000001a0  20 28 b3 28 31 36 33 38  34 29 2d 31 29 20 20 20  | (.(16384)-1)   |
000001b0  20 20 20 20 20 20 3a f4  20 64 69 72 65 63 74 69  |      :. directi|
000001c0  6f 6e 20 28 61 6e 20 69  6e 64 65 78 20 69 6e 74  |on (an index int|
000001d0  6f 20 74 72 69 67 29 0d  00 fa 38 70 25 21 31 32  |o trig)...8p%!12|
000001e0  20 3d 20 28 32 2a b3 28  32 29 2d 33 29 2a 32 36  | = (2*.(2)-3)*26|
000001f0  30 38 2f 28 b3 28 31 30  30 29 29 20 3a f4 20 61  |08/(.(100)) :. a|
00000200  6e 67 75 6c 61 72 20 76  65 6c 6f 63 69 74 79 0d  |ngular velocity.|
00000210  01 04 3e 70 25 21 31 36  20 3d 20 b3 28 32 31 29  |..>p%!16 = .(21)|
00000220  2d 31 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |-11             |
00000230  20 20 20 20 20 20 3a f4  20 61 6e 67 75 6c 61 72  |      :. angular|
00000240  20 61 63 63 65 6c 65 72  61 74 69 6f 6e 0d 01 0e  | acceleration...|
00000250  05 ed 0d 01 18 05 e1 0d  01 22 05 3a 0d 01 2c 0a  |.........".:..,.|
00000260  dd 20 f2 61 73 73 0d 01  36 19 21 63 6f 64 65 25  |. .ass..6.!code%|
00000270  3d 31 34 38 3a 63 6f 64  65 25 21 34 3d 2d 31 0d  |=148:code%!4=-1.|
00000280  01 40 28 c8 99 20 22 4f  53 5f 52 65 61 64 56 64  |.@(.. "OS_ReadVd|
00000290  75 56 61 72 69 61 62 6c  65 73 22 2c 63 6f 64 65  |uVariables",code|
000002a0  25 2c 63 6f 64 65 25 0d  01 4a 11 73 63 72 73 74  |%,code%..J.scrst|
000002b0  25 3d 21 63 6f 64 65 25  0d 01 54 0f 73 25 3d 30  |%=!code%..T.s%=0|
000002c0  3a 63 25 3d 32 35 36 0d  01 5e 3e 74 72 69 67 25  |:c%=256..^>trig%|
000002d0  21 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!0              |
000002e0  3d 20 28 28 20 20 73 25  20 80 36 35 35 33 35 29  |= ((  s% .65535)|
000002f0  3c 3c 31 36 29 20 2b 20  28 20 20 63 25 20 80 36  |<<16) + (  c% .6|
00000300  35 35 33 35 29 0d 01 68  3e 74 72 69 67 25 21 28  |5535)..h>trig%!(|
00000310  34 2a 38 31 39 32 29 20  20 20 20 20 20 20 3d 20  |4*8192)       = |
00000320  28 28 20 20 73 25 20 80  36 35 35 33 35 29 3c 3c  |((  s% .65535)<<|
00000330  31 36 29 20 2b 20 28 28  2d 63 25 29 80 36 35 35  |16) + ((-c%).655|
00000340  33 35 29 0d 01 72 11 e3  20 69 25 3d 31 20 b8 20  |35)..r.. i%=1 . |
00000350  34 30 39 36 0d 01 7c 2c  73 25 3d 2d 32 35 36 2a  |4096..|,s%=-256*|
00000360  b5 28 69 25 2a af 2f 38  31 39 32 29 3a 63 25 3d  |.(i%*./8192):c%=|
00000370  32 35 36 2a 9b 28 69 25  2a af 2f 38 31 39 32 29  |256*.(i%*./8192)|
00000380  0d 01 86 3e 74 72 69 67  25 21 28 34 2a 69 25 29  |...>trig%!(4*i%)|
00000390  20 20 20 20 20 20 20 20  20 3d 20 28 28 20 20 73  |         = ((  s|
000003a0  25 20 80 36 35 35 33 35  29 3c 3c 31 36 29 20 2b  |% .65535)<<16) +|
000003b0  20 28 20 20 63 25 20 80  36 35 35 33 35 29 0d 01  | (  c% .65535)..|
000003c0  90 3e 74 72 69 67 25 21  28 34 2a 28 38 31 39 32  |.>trig%!(4*(8192|
000003d0  2d 69 25 29 29 20 20 3d  20 28 28 20 20 73 25 20  |-i%))  = ((  s% |
000003e0  80 36 35 35 33 35 29 3c  3c 31 36 29 20 2b 20 28  |.65535)<<16) + (|
000003f0  28 2d 63 25 29 80 36 35  35 33 35 29 0d 01 9a 3e  |(-c%).65535)...>|
00000400  74 72 69 67 25 21 28 34  2a 28 38 31 39 32 2b 69  |trig%!(4*(8192+i|
00000410  25 29 29 20 20 3d 20 28  28 28 2d 73 25 29 80 36  |%))  = (((-s%).6|
00000420  35 35 33 35 29 3c 3c 31  36 29 20 2b 20 28 28 2d  |5535)<<16) + ((-|
00000430  63 25 29 80 36 35 35 33  35 29 0d 01 a4 3e 74 72  |c%).65535)...>tr|
00000440  69 67 25 21 28 34 2a 28  31 36 33 38 34 2d 69 25  |ig%!(4*(16384-i%|
00000450  29 29 20 3d 20 28 28 28  2d 73 25 29 80 36 35 35  |)) = (((-s%).655|
00000460  33 35 29 3c 3c 31 36 29  20 2b 20 28 20 20 63 25  |35)<<16) + (  c%|
00000470  20 80 36 35 35 33 35 29  0d 01 ae 05 ed 0d 01 b8  | .65535)........|
00000480  05 3a 0d 01 c2 44 62 25  3d 34 20 3a 20 f4 20 50  |.:...Db%=4 : . P|
00000490  6c 6f 74 74 69 6e 67 20  63 6f 64 65 20 72 65 71  |lotting code req|
000004a0  75 69 72 65 73 20 6f 62  6a 65 63 74 73 20 6c 69  |uires objects li|
000004b0  65 20 66 75 6c 6c 79 20  77 69 74 68 69 6e 20 73  |e fully within s|
000004c0  63 72 65 65 6e 2e 0d 01  cc 40 20 20 20 20 20 20  |creen....@      |
000004d0  20 f4 20 62 25 20 65 6e  73 75 72 65 73 20 6f 62  | . b% ensures ob|
000004e0  6a 65 63 74 20 63 65 6e  74 72 65 73 20 6c 65 61  |ject centres lea|
000004f0  76 65 20 62 6f 72 64 65  72 20 6f 66 20 74 68 69  |ve border of thi|
00000500  73 20 6d 61 6e 79 0d 01  d6 39 20 20 20 20 20 20  |s many...9      |
00000510  20 f4 20 70 69 78 65 6c  73 20 66 72 6f 6d 20 65  | . pixels from e|
00000520  64 67 65 20 67 69 76 69  6e 67 20 72 6f 6f 6d 20  |dge giving room |
00000530  74 6f 20 70 6c 6f 74 20  6f 62 6a 65 63 74 2e 0d  |to plot object..|
00000540  01 e0 05 3a 0d 01 ea 15  e3 20 70 61 73 73 25 3d  |...:..... pass%=|
00000550  30 20 b8 20 32 20 88 20  32 0d 01 f4 0c 50 25 3d  |0 . 2 . 2....P%=|
00000560  63 6f 64 65 25 0d 01 fe  0e 5b 4f 50 54 20 70 61  |code%....[OPT pa|
00000570  73 73 25 0d 02 08 2b 2e  61 73 63 72 73 74 73 75  |ss%...+.ascrstsu|
00000580  6d 25 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |m%         EQUD |
00000590  73 63 72 73 74 25 2a 32  2b 38 31 39 32 30 0d 02  |scrst%*2+81920..|
000005a0  12 19 2e 61 73 63 72 73  74 25 20 20 45 51 55 44  |...ascrst%  EQUD|
000005b0  20 73 63 72 73 74 25 0d  02 1c 14 2e 61 62 61 6e  | scrst%.....aban|
000005c0  6b 25 20 20 20 45 51 55  44 20 31 0d 02 26 3f 2e  |k%   EQUD 1..&?.|
000005d0  61 64 61 74 61 25 20 20  20 45 51 55 44 20 64 61  |adata%   EQUD da|
000005e0  74 61 25 3a 45 51 55 44  20 64 61 74 61 25 2b 64  |ta%:EQUD data%+d|
000005f0  73 25 2a 6e 70 25 3a 45  51 55 44 20 64 61 74 61  |s%*np%:EQUD data|
00000600  25 2b 64 73 25 2a 6d 6e  70 25 0d 02 30 18 2e 61  |%+ds%*mnp%..0..a|
00000610  74 72 69 67 25 20 20 20  45 51 55 44 20 74 72 69  |trig%   EQUD tri|
00000620  67 25 0d 02 3a 1d 2e 73  65 65 64 25 20 20 20 20  |g%..:..seed%    |
00000630  45 51 55 44 20 2d 31 3a  45 51 55 44 20 2d 31 0d  |EQUD -1:EQUD -1.|
00000640  02 44 44 2e 73 77 69 6d  25 20 20 20 20 20 20 20  |.DD.swim%       |
00000650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000660  20 3b 70 75 72 70 6f 73  65 20 2d 20 74 6f 20 6d  | ;purpose - to m|
00000670  6f 76 65 20 61 6c 6c 20  6f 62 6a 65 63 74 73 20  |ove all objects |
00000680  6f 6e 65 0d 02 4e 42 53  54 4d 46 44 20 20 20 20  |one..NBSTMFD    |
00000690  20 31 33 21 2c 20 7b 31  34 7d 20 20 20 20 20 20  | 13!, {14}      |
000006a0  20 20 20 20 20 3b 20 66  72 61 6d 65 20 66 6f 72  |     ; frame for|
000006b0  77 61 72 64 20 61 6e 64  20 64 69 73 70 6c 61 79  |ward and display|
000006c0  20 74 68 69 73 0d 02 58  2d 3a 20 20 20 20 20 20  | this..X-:      |
000006d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000006e0  20 20 20 20 20 20 20 3b  20 6e 65 77 20 66 72 61  |       ; new fra|
000006f0  6d 65 0d 02 62 13 4d 4f  56 20 20 20 20 20 20 30  |me..b.MOV      0|
00000700  2c 20 23 31 39 0d 02 6c  31 53 57 49 20 20 20 20  |, #19..l1SWI    |
00000710  20 20 22 4f 53 5f 42 79  74 65 22 20 20 20 20 20  |  "OS_Byte"     |
00000720  20 20 20 20 20 20 20 3b  77 61 69 74 20 66 6f 72  |       ;wait for|
00000730  20 76 73 79 6e 63 0d 02  76 14 4d 4f 56 20 20 20  | vsync..v.MOV   |
00000740  20 20 20 30 2c 20 23 31  31 33 0d 02 80 16 4c 44  |   0, #113....LD|
00000750  52 20 20 20 20 20 20 31  2c 20 61 62 61 6e 6b 25  |R      1, abank%|
00000760  0d 02 8a 15 52 53 42 20  20 20 20 20 20 33 2c 20  |....RSB      3, |
00000770  31 2c 20 23 33 0d 02 94  16 53 54 52 20 20 20 20  |1, #3....STR    |
00000780  20 20 33 2c 20 61 62 61  6e 6b 25 0d 02 9e 3e 53  |  3, abank%...>S|
00000790  57 49 20 20 20 20 20 20  22 4f 53 5f 42 79 74 65  |WI      "OS_Byte|
000007a0  22 20 20 20 20 20 20 20  20 20 20 20 20 3b 73 77  |"            ;sw|
000007b0  61 70 20 64 69 73 70 6c  61 79 65 64 20 73 63 72  |ap displayed scr|
000007c0  65 65 6e 20 62 61 6e 6b  73 0d 02 a8 1a 4c 44 52  |een banks....LDR|
000007d0  20 20 20 20 20 20 30 2c  20 61 73 63 72 73 74 73  |      0, ascrsts|
000007e0  75 6d 25 0d 02 b2 17 4c  44 52 20 20 20 20 20 20  |um%....LDR      |
000007f0  31 2c 20 61 73 63 72 73  74 25 0d 02 bc 14 53 55  |1, ascrst%....SU|
00000800  42 20 20 20 20 20 20 31  2c 20 30 2c 20 31 0d 02  |B      1, 0, 1..|
00000810  c6 39 53 54 52 20 20 20  20 20 20 31 2c 20 61 73  |.9STR      1, as|
00000820  63 72 73 74 25 20 20 20  20 20 20 20 20 20 20 20  |crst%           |
00000830  3b 73 77 61 70 20 70 74  72 20 74 6f 20 6f 74 68  |;swap ptr to oth|
00000840  65 72 20 62 61 6e 6b 0d  02 d0 36 3a 20 20 20 20  |er bank...6:    |
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000860  20 20 20 20 20 20 20 20  20 3b 20 28 74 6f 20 62  |         ; (to b|
00000870  65 20 77 72 69 74 74 65  6e 20 74 6f 29 0d 02 da  |e written to)...|
00000880  30 42 4c 20 20 20 20 20  20 20 63 6c 73 25 20 20  |0BL       cls%  |
00000890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000008a0  63 6c 73 20 74 68 61 74  20 62 61 6e 6b 0d 02 e4  |cls that bank...|
000008b0  05 3a 0d 02 ee 18 41 44  52 20 20 20 20 20 20 20  |.:....ADR       |
000008c0  31 34 2c 20 61 64 61 74  61 25 0d 02 f8 45 4c 44  |14, adata%...ELD|
000008d0  4d 49 41 20 20 20 20 20  31 34 2c 20 7b 30 2c 31  |MIA     14, {0,1|
000008e0  7d 20 20 20 20 20 20 20  20 20 20 20 3b 67 65 74  |}           ;get|
000008f0  20 70 74 72 73 20 74 6f  20 73 74 61 72 74 20 26  | ptrs to start &|
00000900  20 65 6e 64 20 6f 66 20  6f 62 6a 65 63 74 73 0d  | end of objects.|
00000910  03 02 3b 4c 44 52 20 20  20 20 20 20 20 32 2c 20  |..;LDR       2, |
00000920  61 73 63 72 73 74 25 20  20 20 20 20 20 20 20 20  |ascrst%         |
00000930  20 3b 67 65 74 20 70 74  72 20 74 6f 20 73 63 72  | ;get ptr to scr|
00000940  65 65 6e 20 6d 65 6d 6f  72 79 0d 03 0c 17 41 44  |een memory....AD|
00000950  52 20 20 20 20 20 20 20  31 34 2c 20 73 65 65 64  |R       14, seed|
00000960  25 0d 03 16 46 4c 44 4d  49 41 20 20 20 20 20 31  |%...FLDMIA     1|
00000970  34 2c 20 7b 33 2c 34 7d  20 20 20 20 20 20 20 20  |4, {3,4}        |
00000980  20 20 20 3b 67 65 74 20  6c 6f 77 20 61 6e 64 20  |   ;get low and |
00000990  68 69 67 68 20 77 6f 72  64 73 20 6f 66 20 72 61  |high words of ra|
000009a0  6e 23 20 73 65 65 64 0d  03 20 38 4c 44 52 20 20  |n# seed.. 8LDR  |
000009b0  20 20 20 20 20 31 32 2c  20 61 74 72 69 67 25 20  |     12, atrig% |
000009c0  20 20 20 20 20 20 20 20  20 3b 67 65 74 20 70 74  |         ;get pt|
000009d0  72 20 74 6f 20 74 72 69  67 20 74 61 62 6c 65 0d  |r to trig table.|
000009e0  03 2a 05 3a 0d 03 34 41  2e 73 77 69 6d 6c 6f 6f  |.*.:..4A.swimloo|
000009f0  70 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p%              |
00000a00  20 20 20 20 20 20 3b 73  63 61 6e 20 65 61 63 68  |      ;scan each|
00000a10  20 6f 62 6a 65 63 74 20  69 6e 20 6f 75 72 20 6c  | object in our l|
00000a20  69 73 74 20 2d 0d 03 3e  05 3a 0d 03 48 3c 4c 44  |ist -..>.:..H<LD|
00000a30  4d 49 41 20 20 20 20 20  30 2c 20 7b 35 2c 36 2c  |MIA     0, {5,6,|
00000a40  37 2c 38 2c 39 7d 20 20  20 20 20 20 3b 67 65 74  |7,8,9}      ;get|
00000a50  20 6e 65 78 74 20 6f 62  6a 65 63 74 27 73 20 64  | next object's d|
00000a60  65 74 61 69 6c 73 0d 03  52 05 3a 0d 03 5c 40 4d  |etails..R.:..\@M|
00000a70  4f 56 53 20 20 20 20 20  20 34 2c 20 34 2c 20 4c  |OVS      4, 4, L|
00000a80  53 52 20 23 31 20 20 20  20 20 20 20 20 3b 67 65  |SR #1        ;ge|
00000a90  6e 65 72 61 74 65 20 72  61 6e 64 6f 6d 20 33 32  |nerate random 32|
00000aa0  2d 62 69 74 20 6e 75 6d  62 65 72 0d 03 66 18 4d  |-bit number..f.M|
00000ab0  4f 56 53 20 20 20 20 20  20 31 34 2c 20 33 2c 20  |OVS      14, 3, |
00000ac0  52 52 58 0d 03 70 15 41  44 43 20 20 20 20 20 20  |RRX..p.ADC      |
00000ad0  20 34 2c 20 34 2c 20 34  0d 03 7a 1e 82 20 20 20  | 4, 4, 4..z..   |
00000ae0  20 20 20 20 31 34 2c 20  31 34 2c 20 33 2c 20 4c  |    14, 14, 3, L|
00000af0  53 4c 20 23 31 32 0d 03  84 1e 82 20 20 20 20 20  |SL #12.....     |
00000b00  20 20 33 2c 20 31 34 2c  20 31 34 2c 20 4c 53 52  |  3, 14, 14, LSR|
00000b10  20 23 32 30 0d 03 8e 33  80 53 20 20 20 20 20 20  | #20...3.S      |
00000b20  31 34 2c 20 33 2c 20 23  31 32 37 20 20 20 20 20  |14, 3, #127     |
00000b30  20 20 20 20 3b 6c 6f 6f  6b 20 61 74 20 6c 6f 77  |    ;look at low|
00000b40  20 37 20 62 69 74 73 0d  03 98 44 52 53 42 45 51  | 7 bits...DRSBEQ|
00000b50  20 20 20 20 20 38 2c 20  38 2c 20 23 30 20 20 20  |     8, 8, #0   |
00000b60  20 20 20 20 20 20 20 20  20 3b 69 66 20 7a 65 72  |         ;if zer|
00000b70  6f 20 28 31 20 69 6e 20  31 32 38 20 63 68 61 6e  |o (1 in 128 chan|
00000b80  63 65 29 20 72 65 76 65  72 73 65 0d 03 a2 33 3a  |ce) reverse...3:|
00000b90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 61 6e  |             ;an|
00000bb0  67 75 6c 61 72 20 76 65  6c 6f 63 69 74 79 0d 03  |gular velocity..|
00000bc0  ac 05 3a 0d 03 b6 41 41  44 44 20 20 20 20 20 20  |..:...AADD      |
00000bd0  20 38 2c 20 38 2c 20 39  20 20 20 20 20 20 20 20  | 8, 8, 9        |
00000be0  20 20 20 20 20 3b 6d 6f  64 69 66 79 20 61 6e 67  |     ;modify ang|
00000bf0  20 76 65 6c 6f 63 69 74  79 20 62 79 20 61 6e 67  | velocity by ang|
00000c00  20 61 63 63 0d 03 c0 3e  41 44 44 20 20 20 20 20  | acc...>ADD     |
00000c10  20 20 37 2c 20 37 2c 20  38 20 20 20 20 20 20 20  |  7, 7, 8       |
00000c20  20 20 20 20 20 20 3b 6d  6f 64 69 66 79 20 64 69  |      ;modify di|
00000c30  72 65 63 74 69 6f 6e 20  62 79 20 61 6e 67 20 76  |rection by ang v|
00000c40  65 6c 0d 03 ca 1b 4d 4f  56 20 20 20 20 20 20 20  |el....MOV       |
00000c50  37 2c 20 37 2c 20 4c 53  4c 20 23 31 38 0d 03 d4  |7, 7, LSL #18...|
00000c60  1b 4d 4f 56 20 20 20 20  20 20 20 37 2c 20 37 2c  |.MOV       7, 7,|
00000c70  20 4c 53 52 20 23 31 38  0d 03 de 42 4c 44 52 20  | LSR #18...BLDR |
00000c80  20 20 20 20 20 20 31 34  2c 20 5b 31 32 2c 20 37  |      14, [12, 7|
00000c90  2c 20 4c 53 4c 20 23 32  5d 20 3b 6c 6f 6f 6b 20  |, LSL #2] ;look |
00000ca0  75 70 20 6e 65 77 20 64  69 72 20 66 72 6f 6d 20  |up new dir from |
00000cb0  74 72 69 67 20 74 61 62  6c 65 0d 03 e8 36 4d 4f  |trig table...6MO|
00000cc0  56 20 20 20 20 20 20 20  31 30 2c 20 31 34 2c 20  |V       10, 14, |
00000cd0  41 53 52 20 23 31 36 20  20 20 20 20 3b 73 70 6c  |ASR #16     ;spl|
00000ce0  69 74 20 69 74 20 69 6e  74 6f 20 78 20 61 6e 64  |it it into x and|
00000cf0  0d 03 f2 2f 4d 4f 56 20  20 20 20 20 20 20 31 31  |.../MOV       11|
00000d00  2c 20 31 34 2c 20 41 53  4c 20 23 31 36 20 20 20  |, 14, ASL #16   |
00000d10  20 20 3b 79 20 63 6f 6d  70 6f 6e 65 6e 74 73 0d  |  ;y components.|
00000d20  03 fc 1d 4d 4f 56 20 20  20 20 20 20 20 31 31 2c  |...MOV       11,|
00000d30  20 31 31 2c 20 41 53 52  20 23 31 36 0d 04 06 05  | 11, ASR #16....|
00000d40  3a 0d 04 10 40 41 44 44  20 20 20 20 20 20 20 35  |:...@ADD       5|
00000d50  2c 20 35 2c 20 31 30 20  20 20 20 20 20 20 20 20  |, 5, 10         |
00000d60  20 20 20 3b 6d 6f 64 69  66 79 20 70 6f 73 69 74  |   ;modify posit|
00000d70  69 6f 6e 20 76 69 61 20  64 69 72 65 63 74 69 6f  |ion via directio|
00000d80  6e 0d 04 1a 3f 43 4d 50  20 20 20 20 20 20 20 35  |n...?CMP       5|
00000d90  2c 20 23 62 25 2a 32 35  36 20 20 20 20 20 20 20  |, #b%*256       |
00000da0  20 20 20 3b 76 65 63 74  6f 72 20 61 6e 64 20 61  |   ;vector and a|
00000db0  70 70 6c 79 20 77 72 61  70 2d 61 72 6f 75 6e 64  |pply wrap-around|
00000dc0  0d 04 24 3f 41 44 44 4c  54 20 20 20 20 20 35 2c  |..$?ADDLT     5,|
00000dd0  20 35 2c 20 23 28 33 32  30 2d 32 2a 62 25 29 2a  | 5, #(320-2*b%)*|
00000de0  32 35 36 20 3b 69 66 20  6f 62 6a 65 63 74 20 6d  |256 ;if object m|
00000df0  6f 76 65 73 20 6f 66 66  20 73 63 72 65 65 6e 0d  |oves off screen.|
00000e00  04 2e 1e 43 4d 50 20 20  20 20 20 20 20 35 2c 20  |...CMP       5, |
00000e10  23 28 33 32 30 2d 62 25  29 2a 32 35 36 0d 04 38  |#(320-b%)*256..8|
00000e20  23 53 55 42 47 45 20 20  20 20 20 35 2c 20 35 2c  |#SUBGE     5, 5,|
00000e30  20 23 28 33 32 30 2d 32  2a 62 25 29 2a 32 35 36  | #(320-2*b%)*256|
00000e40  0d 04 42 16 41 44 44 20  20 20 20 20 20 20 36 2c  |..B.ADD       6,|
00000e50  20 36 2c 20 31 31 0d 04  4c 18 43 4d 50 20 20 20  | 6, 11..L.CMP   |
00000e60  20 20 20 20 36 2c 20 23  62 25 2a 32 35 36 0d 04  |    6, #b%*256..|
00000e70  56 23 41 44 44 4c 54 20  20 20 20 20 36 2c 20 36  |V#ADDLT     6, 6|
00000e80  2c 20 23 28 32 35 36 2d  32 2a 62 25 29 2a 32 35  |, #(256-2*b%)*25|
00000e90  36 0d 04 60 1e 43 4d 50  20 20 20 20 20 20 20 36  |6..`.CMP       6|
00000ea0  2c 20 23 28 32 35 36 2d  62 25 29 2a 32 35 36 0d  |, #(256-b%)*256.|
00000eb0  04 6a 23 53 55 42 47 45  20 20 20 20 20 36 2c 20  |.j#SUBGE     6, |
00000ec0  36 2c 20 23 28 32 35 36  2d 32 2a 62 25 29 2a 32  |6, #(256-2*b%)*2|
00000ed0  35 36 0d 04 74 05 3a 0d  04 7e 42 4d 4f 56 20 20  |56..t.:..~BMOV  |
00000ee0  20 20 20 20 20 31 34 2c  20 36 2c 20 4c 53 52 20  |     14, 6, LSR |
00000ef0  23 38 20 20 20 20 20 20  20 3b 67 65 74 20 61 64  |#8       ;get ad|
00000f00  64 72 65 73 73 20 6f 6e  20 73 63 72 65 65 6e 20  |dress on screen |
00000f10  6f 66 20 6f 62 6a 65 63  74 0d 04 88 44 41 44 44  |of object...DADD|
00000f20  20 20 20 20 20 20 20 31  34 2c 20 31 34 2c 20 31  |       14, 14, 1|
00000f30  34 2c 20 4c 53 4c 20 23  32 20 20 3b 63 65 6e 74  |4, LSL #2  ;cent|
00000f40  72 65 20 28 72 65 6d 65  6d 62 65 72 20 66 69 72  |re (remember fir|
00000f50  73 74 20 74 6f 20 63 6f  6e 76 65 72 74 0d 04 92  |st to convert...|
00000f60  41 41 44 44 20 20 20 20  20 20 20 31 34 2c 20 32  |AADD       14, 2|
00000f70  2c 20 31 34 2c 20 4c 53  4c 20 23 36 20 20 20 3b  |, 14, LSL #6   ;|
00000f80  63 6f 6f 72 64 73 20 69  6e 20 31 2f 32 35 36 27  |coords in 1/256'|
00000f90  74 68 73 20 6f 66 20 61  20 70 69 78 65 6c 0d 04  |ths of a pixel..|
00000fa0  9c 46 53 54 52 42 20 20  20 20 20 20 30 2c 20 5b  |.FSTRB      0, [|
00000fb0  31 34 2c 20 35 2c 20 4c  53 52 20 23 38 5d 21 20  |14, 5, LSR #8]! |
00000fc0  3b 74 6f 20 69 6e 74 65  67 65 72 20 70 69 78 65  |;to integer pixe|
00000fd0  6c 20 63 6f 6f 72 64 73  20 76 69 61 20 4c 53 52  |l coords via LSR|
00000fe0  20 23 38 29 0d 04 a6 1b  53 54 52 42 20 20 20 20  | #8)....STRB    |
00000ff0  20 20 30 2c 20 5b 31 34  2c 20 23 33 32 30 5d 0d  |  0, [14, #320].|
00001000  04 b0 41 53 54 52 42 20  20 20 20 20 20 30 2c 20  |..ASTRB      0, |
00001010  5b 31 34 2c 20 23 2d 33  32 30 5d 20 20 20 20 20  |[14, #-320]     |
00001020  20 3b 77 72 69 74 65 20  74 6f 20 6f 62 6a 65 63  | ;write to objec|
00001030  74 20 63 65 6e 74 72 65  20 61 6e 64 20 74 68 65  |t centre and the|
00001040  0d 04 ba 44 53 54 52 42  20 20 20 20 20 20 30 2c  |...DSTRB      0,|
00001050  20 5b 31 34 2c 20 23 2d  31 5d 20 20 20 20 20 20  | [14, #-1]      |
00001060  20 20 3b 66 6f 75 72 20  73 75 72 72 6f 75 6e 64  |  ;four surround|
00001070  69 6e 67 20 70 69 78 65  6c 73 2c 20 67 69 76 69  |ing pixels, givi|
00001080  6e 67 20 61 0d 04 c4 30  53 54 52 42 20 20 20 20  |ng a...0STRB    |
00001090  20 20 30 2c 20 5b 31 34  2c 20 23 31 5d 20 20 20  |  0, [14, #1]   |
000010a0  20 20 20 20 20 20 3b 73  6d 61 6c 6c 20 2b 20 73  |      ;small + s|
000010b0  68 61 70 65 0d 04 ce 05  3a 0d 04 d8 42 43 4d 50  |hape....:...BCMP|
000010c0  20 20 20 20 20 20 20 38  2c 20 23 32 30 34 38 2a  |       8, #2048*|
000010d0  31 2e 31 32 35 20 20 20  20 20 20 3b 69 66 20 6f  |1.125      ;if o|
000010e0  62 6a 65 63 74 20 68 61  73 20 76 65 72 79 20 68  |bject has very h|
000010f0  69 67 68 20 61 6e 67 20  76 65 6c 0d 04 e2 34 42  |igh ang vel...4B|
00001100  4c 54 20 20 20 20 20 20  20 6e 6f 73 77 69 6d 61  |LT       noswima|
00001110  64 64 25 20 20 20 20 20  20 20 20 20 20 3b 6c 65  |dd%          ;le|
00001120  74 20 69 74 20 72 65 70  72 6f 64 75 63 65 21 0d  |t it reproduce!.|
00001130  04 ec 1a 4c 44 52 20 20  20 20 20 20 20 31 34 2c  |...LDR       14,|
00001140  20 61 64 61 74 61 25 2b  38 0d 04 f6 43 43 4d 50  | adata%+8...CCMP|
00001150  20 20 20 20 20 20 20 31  34 2c 20 31 20 20 20 20  |       14, 1    |
00001160  20 20 20 20 20 20 20 20  20 20 20 3b 28 69 66 20  |           ;(if |
00001170  74 68 65 72 65 20 69 73  20 72 6f 6f 6d 20 74 6f  |there is room to|
00001180  20 61 64 64 20 61 6e 6f  74 68 65 72 0d 05 00 37  | add another...7|
00001190  42 4c 53 20 20 20 20 20  20 20 6e 6f 73 77 69 6d  |BLS       noswim|
000011a0  61 64 64 25 20 20 20 20  20 20 20 20 20 20 3b 20  |add%          ; |
000011b0  6f 62 6a 65 63 74 20 74  6f 20 6f 75 72 20 6c 69  |object to our li|
000011c0  73 74 29 0d 05 0a 41 4d  4f 56 20 20 20 20 20 20  |st)...AMOV      |
000011d0  20 38 2c 20 38 2c 20 41  53 52 20 23 31 31 20 20  | 8, 8, ASR #11  |
000011e0  20 20 20 20 20 3b 67 69  76 65 20 6e 65 77 20 6f  |     ;give new o|
000011f0  62 6a 65 63 74 73 20 6c  6f 77 65 72 20 61 6e 67  |bjects lower ang|
00001200  20 76 65 6c 0d 05 14 42  53 54 4d 49 41 20 20 20  | vel...BSTMIA   |
00001210  20 20 31 2c 20 7b 35 2c  36 2c 37 2c 38 2c 39 7d  |  1, {5,6,7,8,9}|
00001220  20 20 20 20 20 20 3b 28  65 6c 73 65 20 67 65 74  |      ;(else get|
00001230  20 72 61 70 69 64 20 63  68 61 69 6e 20 72 65 61  | rapid chain rea|
00001240  63 74 69 6f 6e 29 0d 05  1e 18 41 44 44 20 20 20  |ction)....ADD   |
00001250  20 20 20 20 31 2c 20 31  2c 20 23 64 73 25 0d 05  |    1, 1, #ds%..|
00001260  28 19 53 54 52 20 20 20  20 20 20 20 31 2c 20 61  |(.STR       1, a|
00001270  64 61 74 61 25 2b 34 0d  05 32 45 52 53 42 20 20  |data%+4..2ERSB  |
00001280  20 20 20 20 20 38 2c 20  38 2c 20 23 30 20 20 20  |     8, 8, #0   |
00001290  20 20 20 20 20 20 20 20  20 3b 61 6e 64 20 61 6c  |         ;and al|
000012a0  74 65 72 20 64 69 72 65  63 74 69 6f 6e 20 6f 66  |ter direction of|
000012b0  20 6f 6e 65 20 73 6f 20  74 68 65 79 0d 05 3c 43  | one so they..<C|
000012c0  41 44 44 20 20 20 20 20  20 20 37 2c 20 37 2c 20  |ADD       7, 7, |
000012d0  23 38 31 39 32 20 20 20  20 20 20 20 20 20 3b 68  |#8192         ;h|
000012e0  65 61 64 20 6f 66 66 20  69 6e 20 64 69 66 66 65  |ead off in diffe|
000012f0  72 65 6e 74 20 64 69 72  65 63 74 69 6f 6e 73 0d  |rent directions.|
00001300  05 46 1b 4d 4f 56 20 20  20 20 20 20 20 37 2c 20  |.F.MOV       7, |
00001310  37 2c 20 4c 53 4c 20 23  31 38 0d 05 50 1b 4d 4f  |7, LSL #18..P.MO|
00001320  56 20 20 20 20 20 20 20  37 2c 20 37 2c 20 4c 53  |V       7, 7, LS|
00001330  52 20 23 31 38 0d 05 5a  3d 53 57 49 20 20 20 20  |R #18..Z=SWI    |
00001340  20 20 20 32 35 36 2b 37  20 20 20 20 20 20 20 20  |   256+7        |
00001350  20 20 20 20 20 20 20 3b  6d 61 6b 65 20 61 20 62  |       ;make a b|
00001360  65 65 70 20 74 6f 20 6d  61 72 6b 20 62 69 72 74  |eep to mark birt|
00001370  68 21 0d 05 64 05 3a 0d  05 6e 0f 2e 6e 6f 73 77  |h!..d.:..n..nosw|
00001380  69 6d 61 64 64 25 0d 05  78 05 3a 0d 05 82 43 53  |imadd%..x.:...CS|
00001390  54 4d 49 41 20 20 20 20  20 30 2c 20 7b 35 2c 36  |TMIA     0, {5,6|
000013a0  2c 37 2c 38 7d 20 20 20  20 20 20 20 20 3b 72 65  |,7,8}        ;re|
000013b0  73 61 76 65 20 6f 62 6a  65 63 74 27 73 20 6d 6f  |save object's mo|
000013c0  64 69 66 69 65 64 20 64  65 74 61 69 6c 73 0d 05  |dified details..|
000013d0  8c 18 41 44 44 20 20 20  20 20 20 20 30 2c 20 30  |..ADD       0, 0|
000013e0  2c 20 23 64 73 25 0d 05  96 12 43 4d 50 20 20 20  |, #ds%....CMP   |
000013f0  20 20 20 20 30 2c 20 31  0d 05 a0 44 42 4c 4f 20  |    0, 1...DBLO |
00001400  20 20 20 20 20 20 73 77  69 6d 6c 6f 6f 70 25 20  |      swimloop% |
00001410  20 20 20 20 20 20 20 20  20 20 3b 72 65 70 65 61  |          ;repea|
00001420  74 20 66 6f 72 20 6e 65  78 74 20 69 66 20 61 6e  |t for next if an|
00001430  79 20 6d 6f 72 65 20 65  78 69 73 74 0d 05 aa 17  |y more exist....|
00001440  41 44 52 20 20 20 20 20  20 20 31 34 2c 20 73 65  |ADR       14, se|
00001450  65 64 25 0d 05 b4 17 53  54 4d 49 41 20 20 20 20  |ed%....STMIA    |
00001460  20 31 34 2c 20 7b 33 2c  34 7d 0d 05 be 3d 4c 44  | 14, {3,4}...=LD|
00001470  4d 46 44 20 31 33 21 2c  20 7b 50 43 7d 20 20 20  |MFD 13!, {PC}   |
00001480  20 20 20 20 20 20 20 20  20 20 20 20 3b 61 6c 6c  |            ;all|
00001490  20 6f 62 6a 65 63 74 73  20 6d 6f 76 65 64 20 73  | objects moved s|
000014a0  6f 20 45 58 49 54 21 0d  05 c8 05 3a 0d 05 d2 13  |o EXIT!....:....|
000014b0  2e 61 6c 72 63 6c 73 25  20 45 51 55 44 20 30 0d  |.alrcls% EQUD 0.|
000014c0  05 dc 13 2e 61 73 70 63  6c 73 25 20 45 51 55 44  |....aspcls% EQUD|
000014d0  20 30 0d 05 e6 40 2e 63  6c 73 25 20 20 20 20 20  | 0...@.cls%     |
000014e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000014f0  20 20 20 3b 73 69 6d 70  6c 65 20 72 6f 75 74 69  |   ;simple routi|
00001500  6e 65 20 74 6f 20 63 6c  65 61 72 20 73 63 72 65  |ne to clear scre|
00001510  65 6e 0d 05 f0 3a 53 54  52 20 20 20 20 20 20 31  |en...:STR      1|
00001520  34 2c 20 61 6c 72 63 6c  73 25 20 20 20 20 20 20  |4, alrcls%      |
00001530  20 20 20 3b 61 73 20 72  61 70 69 64 6c 79 20 61  |   ;as rapidly a|
00001540  73 20 70 6f 73 73 69 62  6c 65 20 2d 0d 05 fa 3c  |s possible -...<|
00001550  53 54 52 20 20 20 20 20  20 31 33 2c 20 61 73 70  |STR      13, asp|
00001560  63 6c 73 25 20 20 20 20  20 20 20 20 20 3b 6e 6f  |cls%         ;no|
00001570  74 65 20 74 68 65 20 68  65 61 76 79 20 75 73 65  |te the heavy use|
00001580  20 6f 66 20 53 54 4d 2e  0d 06 04 17 4c 44 52 20  | of STM.....LDR |
00001590  20 20 20 20 20 30 2c 20  61 73 63 72 73 74 25 0d  |     0, ascrst%.|
000015a0  06 0e 14 4d 4f 56 20 20  20 20 20 20 31 2c 20 23  |...MOV      1, #|
000015b0  31 30 35 0d 06 18 12 4d  4f 56 20 20 20 20 20 20  |105....MOV      |
000015c0  32 2c 20 23 30 0d 06 22  1b 84 52 20 20 20 20 20  |2, #0.."..R     |
000015d0  20 32 2c 20 32 2c 20 32  2c 20 4c 53 4c 20 23 38  | 2, 2, 2, LSL #8|
000015e0  0d 06 2c 1c 84 52 20 20  20 20 20 20 32 2c 20 32  |..,..R      2, 2|
000015f0  2c 20 32 2c 20 4c 53 4c  20 23 31 36 0d 06 36 11  |, 2, LSL #16..6.|
00001600  4d 4f 56 20 20 20 20 20  20 33 2c 20 32 0d 06 40  |MOV      3, 2..@|
00001610  11 4d 4f 56 20 20 20 20  20 20 34 2c 20 32 0d 06  |.MOV      4, 2..|
00001620  4a 11 4d 4f 56 20 20 20  20 20 20 35 2c 20 32 0d  |J.MOV      5, 2.|
00001630  06 54 11 4d 4f 56 20 20  20 20 20 20 36 2c 20 32  |.T.MOV      6, 2|
00001640  0d 06 5e 11 4d 4f 56 20  20 20 20 20 20 37 2c 20  |..^.MOV      7, |
00001650  32 0d 06 68 11 4d 4f 56  20 20 20 20 20 20 38 2c  |2..h.MOV      8,|
00001660  20 32 0d 06 72 11 4d 4f  56 20 20 20 20 20 20 39  | 2..r.MOV      9|
00001670  2c 20 32 0d 06 7c 12 4d  4f 56 20 20 20 20 20 20  |, 2..|.MOV      |
00001680  31 30 2c 20 32 0d 06 86  12 4d 4f 56 20 20 20 20  |10, 2....MOV    |
00001690  20 20 31 31 2c 20 32 0d  06 90 12 4d 4f 56 20 20  |  11, 2....MOV  |
000016a0  20 20 20 20 31 32 2c 20  32 0d 06 9a 12 4d 4f 56  |    12, 2....MOV|
000016b0  20 20 20 20 20 20 31 33  2c 20 32 0d 06 a4 12 4d  |      13, 2....M|
000016c0  4f 56 20 20 20 20 20 20  31 34 2c 20 32 0d 06 ae  |OV      14, 2...|
000016d0  0d 2e 63 6c 73 6c 6f 6f  70 25 0d 06 b8 17 53 54  |..clsloop%....ST|
000016e0  4d 49 41 20 20 20 20 30  21 2c 20 7b 32 2d 31 34  |MIA    0!, {2-14|
000016f0  7d 0d 06 c2 17 53 54 4d  49 41 20 20 20 20 30 21  |}....STMIA    0!|
00001700  2c 20 7b 32 2d 31 34 7d  0d 06 cc 17 53 54 4d 49  |, {2-14}....STMI|
00001710  41 20 20 20 20 30 21 2c  20 7b 32 2d 31 34 7d 0d  |A    0!, {2-14}.|
00001720  06 d6 17 53 54 4d 49 41  20 20 20 20 30 21 2c 20  |...STMIA    0!, |
00001730  7b 32 2d 31 34 7d 0d 06  e0 17 53 54 4d 49 41 20  |{2-14}....STMIA |
00001740  20 20 20 30 21 2c 20 7b  32 2d 31 34 7d 0d 06 ea  |   0!, {2-14}...|
00001750  17 53 54 4d 49 41 20 20  20 20 30 21 2c 20 7b 32  |.STMIA    0!, {2|
00001760  2d 31 34 7d 0d 06 f4 17  53 54 4d 49 41 20 20 20  |-14}....STMIA   |
00001770  20 30 21 2c 20 7b 32 2d  31 34 7d 0d 06 fe 17 53  | 0!, {2-14}....S|
00001780  54 4d 49 41 20 20 20 20  30 21 2c 20 7b 32 2d 31  |TMIA    0!, {2-1|
00001790  34 7d 0d 07 08 17 53 54  4d 49 41 20 20 20 20 30  |4}....STMIA    0|
000017a0  21 2c 20 7b 32 2d 31 34  7d 0d 07 12 17 53 54 4d  |!, {2-14}....STM|
000017b0  49 41 20 20 20 20 30 21  2c 20 7b 32 2d 31 34 7d  |IA    0!, {2-14}|
000017c0  0d 07 1c 17 53 54 4d 49  41 20 20 20 20 30 21 2c  |....STMIA    0!,|
000017d0  20 7b 32 2d 31 34 7d 0d  07 26 17 53 54 4d 49 41  | {2-14}..&.STMIA|
000017e0  20 20 20 20 30 21 2c 20  7b 32 2d 31 34 7d 0d 07  |    0!, {2-14}..|
000017f0  30 17 53 54 4d 49 41 20  20 20 20 30 21 2c 20 7b  |0.STMIA    0!, {|
00001800  32 2d 31 34 7d 0d 07 3a  17 53 54 4d 49 41 20 20  |2-14}..:.STMIA  |
00001810  20 20 30 21 2c 20 7b 32  2d 31 34 7d 0d 07 44 17  |  0!, {2-14}..D.|
00001820  53 54 4d 49 41 20 20 20  20 30 21 2c 20 7b 32 2d  |STMIA    0!, {2-|
00001830  31 34 7d 0d 07 4e 15 53  55 42 53 20 20 20 20 20  |14}..N.SUBS     |
00001840  31 2c 20 31 2c 20 23 31  0d 07 58 15 42 4e 45 20  |1, 1, #1..X.BNE |
00001850  20 20 20 20 20 63 6c 73  6c 6f 6f 70 25 0d 07 62  |     clsloop%..b|
00001860  16 53 54 4d 49 41 20 20  20 20 30 21 2c 20 7b 32  |.STMIA    0!, {2|
00001870  2d 36 7d 0d 07 6c 18 4c  44 52 20 20 20 20 20 20  |-6}..l.LDR      |
00001880  31 33 2c 20 61 73 70 63  6c 73 25 0d 07 76 18 4c  |13, aspcls%..v.L|
00001890  44 52 20 20 20 20 20 20  50 43 2c 20 61 6c 72 63  |DR      PC, alrc|
000018a0  6c 73 25 0d 07 80 05 5d  0d 07 8a 05 ed 0d 07 94  |ls%....]........|
000018b0  05 e1 0d ff                                       |....|
000018b4