Home » Archimedes archive » Acorn User » AU 1997-03 B.adf » Regulars » StarInfo/circles/Taylor/AlienBlobs

StarInfo/circles/Taylor/AlienBlobs

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-03 B.adf » Regulars
Filename: StarInfo/circles/Taylor/AlienBlobs
Read OK:
File size: 186F bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > AlienBlobs (for Circle Challenge)
   20REM - R G Taylor 48 West Drive, Handsworth, Birmingham B20 3SU -
   30ON ERROR PROCerror: END
   40PROCinit
   50PROCasm
   60REPEAT
   70 CALL cycle
   80 CALL move
   90 CALL draw
  100 PROCswap_screen
  110UNTIL FALSE
  120END
  130
  140DEF PROCinit
  150LOCAL colour%,pt%,a%
  160MODE 28: MODE 27: OFF
  170COLOUR 0,0,80,0
  180REM --- Global consts ---
  190n_pts%=5              :REM number of points
  200rad%=128              :REM radius of sphere at each point (os units)
  210rad_step%=rad% DIV 15 :REM thickness of shaded rings
  220rt_limit%=1279-rad%*2 :REM bounce threshold, right of screen
  230top_limit%=959-rad%*2 :REM do. top
  240REM --- Global vars ---
  250pal_ptr%=1            :REM ptr to colour value of 1st ring in pal% array
  260screen%=1             :REM screen bank (used only by Basic)
  270REM --- Global arrays ---
  280DIM x% n_pts%<<2      :REM positions of bottom-left of spheres (os units)
  290DIM y% n_pts%<<2      :REM do.
  300DIM dx% n_pts%<<2     :REM velocity components (os units/frame)
  310DIM dy% n_pts%<<2     :REM do.
  320DIM pal% 16           :REM graduated colour values
  330REM --- Initialise arrays ---
  340FOR pt%=1 TO n_pts%
  350 a%=pt%*360 DIV n_pts%
  360 x%!(pt%<<2)=640-rad%+SINRAD(a%)*256
  370 y%!(pt%<<2)=480-rad%+COSRAD(a%)*256
  380 dx%!(pt%<<2)=(x%!(pt%<<2)-640+rad%) DIV 16
  390 dy%!(pt%<<2)=(y%!(pt%<<2)-480+rad%) DIV 16
  400NEXT pt%
  410FOR colour%=1 TO 15
  420 pal%?colour%=colour%*16
  430NEXT
  440ENDPROC
  450
  460DEF PROCswap_screen
  470OSCLI("FX113,"+STR$(screen%))
  480screen%=screen% EOR 3
  490WAIT
  500OSCLI("FX112,"+STR$(screen%))
  510ENDPROC
  520
  530DEF PROCerror
  540*FX112,0
  550*FX113,0
  560COLOUR 7,255,255,255
  570PRINT REPORT$;" at line ";ERL
  580ON
  590ENDPROC
  600
  610DEF PROCasm
  620DIM code% 1000
  630FOR pass%=0 TO 2 STEP 2
  640P%=code%
  650
  660REM --- Registers for .move ---
  670
  680REM r0,r1 used for intermediate results
  690REM - Global arrays -
  700rx=2
  710ry=3
  720rdx=4
  730rdy=5
  740REM - Local vars -
  750rpt=6
  760rpx=7
  770rpy=8
  780rpdx=9
  790rpdy=10
  800
  810rlink=14
  820
  830[
  840OPT pass%
  850.move                      \DEF PROCmove
  860                           \REM Move each point by dx,dy. Bounce off edges
  870                           \LOCAL pt%,px%,py%,pdx%,pdy%
  880SWI 256+12                 \CLS
  890LDR rx,x                   \Get array addresses into registers...
  900LDR ry,y                   \
  910LDR rdx,dx                 \
  920LDR rdy,dy                 \
  930MOV rpt,#1                 \FOR pt%=1 TO n_pts%
  940.move_loop1
  950LDR rpx,[rx,rpt,LSL#2]     \ px%=x%!(pt%<<2)
  960LDR rpy,[ry,rpt,LSL#2]     \ py%=y%!(pt%<<2)
  970LDR rpdx,[rdx,rpt,LSL#2]   \ pdx%=dx%!(pt%<<2)
  980LDR rpdy,[rdy,rpt,LSL#2]   \ pdy%=dy%!(pt%<<2)
  990CMP rpt,#n_pts%            \ IF pt%<=n_pts% DIV 2 OR pt%=n_pts% THEN
 1000BEQ move_skip1
 1010CMP rpt,#n_pts% DIV 2
 1020BGT move_else1
 1030.move_skip1
 1040ADD rpx,rpx,rpdx           \  px%+=pdx%
 1050ADD rpy,rpy,rpdy           \  py%+=pdy%
 1060CMP rpx,#0                 \  IF px%<0 OR px%>rt_limit% THEN
 1070RSBLT rpdx,rpdx,#0         \   pdx%=-pdx%
 1080LDR r0,rt_limit
 1090CMP rpx,r0
 1100RSBGT rpdx,rpdx,#0
 1110                           \  ENDIF  
 1120CMP rpy,#0                 \  IF py%<0 OR py%>top_limit% THEN
 1130RSBLT rpdy,rpdy,#0         \   pdy%=-pdy%
 1140LDR r0,top_limit
 1150CMP rpy,r0
 1160RSBGT rpdy,rpdy,#0
 1170                           \  ENDIF  
 1180B move_endif1               
 1190.move_else1                \ ELSE    
 1200LDR r0,rt_limit            \  px%=rt_limit%-x%!((n_pts%-pt%)<<2)
 1210RSB r1,rpt,#n_pts%
 1220LDR r1,[rx,r1,LSL#2]
 1230SUB rpx,r0,r1
 1240RSB r1,rpt,#n_pts%         \  py%=y%!((n_pts%-pt%)<<2)
 1250LDR rpy,[ry,r1,LSL#2]
 1260.move_endif1               \ ENDIF
 1270STR rpx,[rx,rpt,LSL#2]     \ x%!(pt%<<2)=px%
 1280STR rpy,[ry,rpt,LSL#2]     \ y%!(pt%<<2)=py%
 1290STR rpdx,[rdx,rpt,LSL#2]   \ dx%!(pt%<<2)=pdx%
 1300STR rpdy,[rdy,rpt,LSL#2]   \ dy%!(pt%<<2)=pdy%
 1310ADD rpt,rpt,#1             \NEXT pt%
 1320CMP rpt,#n_pts%
 1330BLE move_loop1
 1340MOV PC,rlink               \ENDPROC
 1350
 1360]
 1370
 1380REM --- Registers for .draw ---
 1390
 1400REM r0-r2 used by SWIs
 1410REM - Global arrays -
 1420rx=3
 1430ry=4
 1440REM - Local vars -
 1450rcol=5
 1460rr=6
 1470rpt=7
 1480rpx=8
 1490rpy=9
 1500
 1510[
 1520OPT pass%
 1530.draw                      \DEF PROCdraw :REM Draw sphere at each point
 1540                           \LOCAL col%,r%,pt%
 1550LDR rx,x                   \Get array addresses into registers...
 1560LDR ry,y                   \
 1570MOV rcol,#0                \col%=0
 1580MOV rr,#rad%               \FOR r%=rad% TO 0 STEP -rad_step%
 1590.draw_loop1
 1600SWI 256+18                 \ GCOL col%+1
 1610SWI 256+0
 1620ADD r0,rcol,#1
 1630SWI "OS_WriteC"
 1640MOV rcol,r0                \ col%=(col%+1) MOD 15
 1650CMP rcol,#15
 1660MOVGT rcol,#0
 1670MOV rpt,#1                 \ FOR pt%=1 TO n_pts%
 1680.draw_loop2
 1690LDR rpx,[rx,rpt,LSL#2]     \  px%=x%!(pt%<<2)
 1700LDR rpy,[ry,rpt,LSL#2]     \  py%=y%!(pt%<<2)
 1710MOV r0,#4                  \  CIRCLE FILL px%+rad%,py%+rad%,r%
 1720ADD r1,rpx,#rad%
 1730ADD r2,rpy,#rad%
 1740SWI "OS_Plot"
 1750MOV r0,#152+1
 1760MOV r1,#0
 1770MOV r2,rr
 1780SWI "OS_Plot"
 1790ADD rpt,rpt,#1             \ NEXT pt%
 1800CMP rpt,#n_pts%
 1810BLE draw_loop2
 1820SUBS rr,rr,#rad_step%      \NEXT r%
 1830BGE draw_loop1
 1840MOV PC,rlink               \ENDPROC
 1850]
 1860
 1870REM --- Registers for .cycle ---
 1880
 1890REM r0 used by SWI
 1900REM - Local vars -
 1910rcol=1
 1920rval=2
 1930rp=3
 1940
 1950[
 1960OPT pass%
 1970.cycle                     \DEF PROCcycle :REM Cycle the palette 1 step
 1980                           \LOCAL col%,val%,p%
 1990LDR rp,pal_ptr             \p%=pal_ptr%
 2000ADD rp,rp,#1               \p%+=1
 2010CMP rp,#15                 \IF p%>15 THEN p%=1
 2020MOVGT rp,#1
 2030STR rp,pal_ptr             \pal_ptr%=p%
 2040MOV rcol,#1                \FOR col%=1 TO 15
 2050.cycle_loop1
 2060LDR r0,pal                 \ val%=pal%?p%
 2070LDRB rval,[r0,rp]
 2080SWI 256+19                 \ COLOUR col%,val% DIV 2,val%,val% DIV 2
 2090MOV r0,rcol
 2100SWI "OS_WriteC"
 2110SWI 256+16
 2120MOV r0,rval,ASR#1
 2130SWI "OS_WriteC"
 2140MOV r0,rval
 2150SWI "OS_WriteC"
 2160MOV r0,rval,ASR#1
 2170SWI "OS_WriteC"
 2180ADD rp,rp,#1               \ p%+=1
 2190CMP rp,#15                 \ IF p%>=15 THEN p%=1
 2200MOVGE rp,#1
 2210ADD rcol,rcol,#1           \NEXT col%
 2220CMP rcol,#15
 2230BLE cycle_loop1
 2240MOV PC,rlink               \ENDPROC
 2250
 2260\\\ Global arrays \\\
 2270.x          EQUD x%
 2280.y          EQUD y%
 2290.dx         EQUD dx%
 2300.dy         EQUD dy%
 2310.pal        EQUD pal%
 2320\\\ Global var \\\
 2330.pal_ptr    EQUD pal_ptr%
 2340\\\ Global consts \\\
 2350.rt_limit   EQUD rt_limit%
 2360.top_limit  EQUD top_limit%
 2370\\\ (rad%, n_pts%, etc. are less than 256 so use directly eg #rad%) \\\
 2380]
 2390NEXT pass%
 2400ENDPROC

)� > AlienBlobs (for Circle Challenge)
B� - R G Taylor 48 West Drive, Handsworth, Birmingham B20 3SU -
� � �error: �
(	�init
2�asm
<�
F � cycle
P � move
Z � draw
d �swap_screen
n� �
x�
�
�� �init
�� colour%,pt%,a%
�� 28: � 27: �
�� 0,0,80,0
�� --- Global consts ---
�-n_pts%=5              :� number of points
�Frad%=128              :� radius of sphere at each point (os units)
�4rad_step%=rad% � 15 :� thickness of shaded rings
�>rt_limit%=1279-rad%*2 :� bounce threshold, right of screen
�$top_limit%=959-rad%*2 :� do. top
�� --- Global vars ---
�Jpal_ptr%=1            :� ptr to colour value of 1st ring in pal% array
=screen%=1             :� screen bank (used only by Basic)
� --- Global arrays ---
I� x% n_pts%<<2      :� positions of bottom-left of spheres (os units)
"� y% n_pts%<<2      :� do.
,?� dx% n_pts%<<2     :� velocity components (os units/frame)
6� dy% n_pts%<<2     :� do.
@2� pal% 16           :� graduated colour values
J� --- Initialise arrays ---
T� pt%=1 � n_pts%
^ a%=pt%*360 � n_pts%
h$ x%!(pt%<<2)=640-rad%+��(a%)*256
r$ y%!(pt%<<2)=480-rad%+��(a%)*256
|- dx%!(pt%<<2)=(x%!(pt%<<2)-640+rad%) � 16
�- dy%!(pt%<<2)=(y%!(pt%<<2)-480+rad%) � 16
�	� pt%
�� colour%=1 � 15
� pal%?colour%=colour%*16
��
��
�
�� �swap_screen
��("FX113,"+�(screen%))
�screen%=screen% � 3
�Ȗ
��("FX112,"+�(screen%))
��

� �error
*FX112,0
&*FX113,0
0� 7,255,255,255
:� �$;" at line ";�
D�
N�
X
b
� �asm
l� code% 1000
v� pass%=0 � 2 � 2
�P%=code%
�
�!� --- Registers for .move ---
�
�)� r0,r1 used for intermediate results
�� - Global arrays -
�rx=2
�ry=3
�	rdx=4
�	rdy=5
�� - Local vars -
�	rpt=6
�	rpx=7
	rpy=8

rpdx=9
rpdy=10
 
*rlink=14
4
>[
H
OPT pass%
R'.move                      \� �move
\L                           \� Move each point by dx,dy. Bounce off edges
f7                           \� pt%,px%,py%,pdx%,pdy%
p!SWI 256+12                 \�
zELDR rx,x                   \Get array addresses into registers...
� LDR ry,y                   \
� LDR rdx,dx                 \
� LDR rdy,dy                 \
�0MOV rpt,#1                 \� pt%=1 � n_pts%
�.move_loop1
�0LDR rpx,[rx,rpt,LSL#2]     \ px%=x%!(pt%<<2)
�0LDR rpy,[ry,rpt,LSL#2]     \ py%=y%!(pt%<<2)
�2LDR rpdx,[rdx,rpt,LSL#2]   \ pdx%=dx%!(pt%<<2)
�2LDR rpdy,[rdy,rpt,LSL#2]   \ pdy%=dy%!(pt%<<2)
�ACMP rpt,#n_pts%            \ � pt%<=n_pts% � 2 � pt%=n_pts% �
�BEQ move_skip1
�CMP rpt,#n_pts% � 2
�BGT move_else1
.move_skip1
+ADD rpx,rpx,rpdx           \  px%+=pdx%
+ADD rpy,rpy,rpdy           \  py%+=pdy%
$;CMP rpx,#0                 \  � px%<0 � px%>rt_limit% �
.-RSBLT rpdx,rpdx,#0         \   pdx%=-pdx%
8LDR r0,rt_limit
BCMP rpx,r0
LRSBGT rpdx,rpdx,#0
V%                           \  �  
`<CMP rpy,#0                 \  � py%<0 � py%>top_limit% �
j-RSBLT rpdy,rpdy,#0         \   pdy%=-pdy%
tLDR r0,top_limit
~CMP rpy,r0
�RSBGT rpdy,rpdy,#0
�%                           \  �  
� B move_endif1               
�&.move_else1                \ �    
�DLDR r0,rt_limit            \  px%=rt_limit%-x%!((n_pts%-pt%)<<2)
�RSB r1,rpt,#n_pts%
�LDR r1,[rx,r1,LSL#2]
�SUB rpx,r0,r1
�:RSB r1,rpt,#n_pts%         \  py%=y%!((n_pts%-pt%)<<2)
�LDR rpy,[ry,r1,LSL#2]
�".move_endif1               \ �
�0STR rpx,[rx,rpt,LSL#2]     \ x%!(pt%<<2)=px%
0STR rpy,[ry,rpt,LSL#2]     \ y%!(pt%<<2)=py%

2STR rpdx,[rdx,rpt,LSL#2]   \ dx%!(pt%<<2)=pdx%
2STR rpdy,[rdy,rpt,LSL#2]   \ dy%!(pt%<<2)=pdy%
%ADD rpt,rpt,#1             \� pt%
(CMP rpt,#n_pts%
2BLE move_loop1
<!MOV PC,rlink               \�
F
P]
Z
d!� --- Registers for .draw ---
n
x� r0-r2 used by SWIs
�� - Global arrays -
�rx=3
�ry=4
�� - Local vars -
�
rcol=5
�rr=6
�	rpt=7
�	rpx=8
�	rpy=9
�
�[
�
OPT pass%
�D.draw                      \� �draw :� Draw sphere at each point
-                           \� col%,r%,pt%
ELDR rx,x                   \Get array addresses into registers...
 LDR ry,y                   \
"&MOV rcol,#0                \col%=0
,:MOV rr,#rad%               \� r%=rad% � 0 � -rad_step%
6.draw_loop1
@)SWI 256+18                 \ � col%+1
J
SWI 256+0
TADD r0,rcol,#1
^SWI "OS_WriteC"
h3MOV rcol,r0                \ col%=(col%+1) � 15
rCMP rcol,#15
|MOVGT rcol,#0
�1MOV rpt,#1                 \ � pt%=1 � n_pts%
�.draw_loop2
�1LDR rpx,[rx,rpt,LSL#2]     \  px%=x%!(pt%<<2)
�1LDR rpy,[ry,rpt,LSL#2]     \  py%=y%!(pt%<<2)
�<MOV r0,#4                  \  ȏ Ȑ px%+rad%,py%+rad%,r%
�ADD r1,rpx,#rad%
�ADD r2,rpy,#rad%
�SWI "OS_Plot"
�MOV r0,#152+1
�
MOV r1,#0
�
MOV r2,rr
�SWI "OS_Plot"
�&ADD rpt,rpt,#1             \ � pt%
CMP rpt,#n_pts%
BLE draw_loop2
$SUBS rr,rr,#rad_step%      \� r%
&BGE draw_loop1
0!MOV PC,rlink               \�
:]
D
N"� --- Registers for .cycle ---
X
b� r0 used by SWI
l� - Local vars -
v
rcol=1
�
rval=2
�rp=3
�
�[
�
OPT pass%
�D.cycle                     \� �cycle :� Cycle the palette 1 step
�.                           \� col%,val%,p%
�+LDR rp,pal_ptr             \p%=pal_ptr%
�%ADD rp,rp,#1               \p%+=1
�.CMP rp,#15                 \� p%>15 � p%=1
�MOVGT rp,#1
�+STR rp,pal_ptr             \pal_ptr%=p%
�-MOV rcol,#1                \� col%=1 � 15
.cycle_loop1
-LDR r0,pal                 \ val%=pal%?p%
LDRB rval,[r0,rp]
 >SWI 256+19                 \ � col%,val% � 2,val%,val% � 2
*MOV r0,rcol
4SWI "OS_WriteC"
>SWI 256+16
HMOV r0,rval,ASR#1
RSWI "OS_WriteC"
\MOV r0,rval
fSWI "OS_WriteC"
pMOV r0,rval,ASR#1
zSWI "OS_WriteC"
�&ADD rp,rp,#1               \ p%+=1
�0CMP rp,#15                 \ � p%>=15 � p%=1
�MOVGE rp,#1
�&ADD rcol,rcol,#1           \� col%
�CMP rcol,#15
�BLE cycle_loop1
�!MOV PC,rlink               \�
�
�\\\ Global arrays \\\
�.x          EQUD x%
�.y          EQUD y%
�.dx         EQUD dx%
�.dy         EQUD dy%
	.pal        EQUD pal%
	\\\ Global var \\\
	.pal_ptr    EQUD pal_ptr%
	$\\\ Global consts \\\
	..rt_limit   EQUD rt_limit%
	8.top_limit  EQUD top_limit%
	BK\\\ (rad%, n_pts%, etc. are less than 256 so use directly eg #rad%) \\\
	L]
	V� pass%
	`�
�
00000000  0d 00 0a 29 f4 20 3e 20  41 6c 69 65 6e 42 6c 6f  |...). > AlienBlo|
00000010  62 73 20 28 66 6f 72 20  43 69 72 63 6c 65 20 43  |bs (for Circle C|
00000020  68 61 6c 6c 65 6e 67 65  29 0d 00 14 42 f4 20 2d  |hallenge)...B. -|
00000030  20 52 20 47 20 54 61 79  6c 6f 72 20 34 38 20 57  | R G Taylor 48 W|
00000040  65 73 74 20 44 72 69 76  65 2c 20 48 61 6e 64 73  |est Drive, Hands|
00000050  77 6f 72 74 68 2c 20 42  69 72 6d 69 6e 67 68 61  |worth, Birmingha|
00000060  6d 20 42 32 30 20 33 53  55 20 2d 0d 00 1e 11 ee  |m B20 3SU -.....|
00000070  20 85 20 f2 65 72 72 6f  72 3a 20 e0 0d 00 28 09  | . .error: ...(.|
00000080  f2 69 6e 69 74 0d 00 32  08 f2 61 73 6d 0d 00 3c  |.init..2..asm..<|
00000090  05 f5 0d 00 46 0c 20 d6  20 63 79 63 6c 65 0d 00  |....F. . cycle..|
000000a0  50 0b 20 d6 20 6d 6f 76  65 0d 00 5a 0b 20 d6 20  |P. . move..Z. . |
000000b0  64 72 61 77 0d 00 64 11  20 f2 73 77 61 70 5f 73  |draw..d. .swap_s|
000000c0  63 72 65 65 6e 0d 00 6e  07 fd 20 a3 0d 00 78 05  |creen..n.. ...x.|
000000d0  e0 0d 00 82 04 0d 00 8c  0b dd 20 f2 69 6e 69 74  |.......... .init|
000000e0  0d 00 96 14 ea 20 63 6f  6c 6f 75 72 25 2c 70 74  |..... colour%,pt|
000000f0  25 2c 61 25 0d 00 a0 11  eb 20 32 38 3a 20 eb 20  |%,a%..... 28: . |
00000100  32 37 3a 20 87 0d 00 aa  0e fb 20 30 2c 30 2c 38  |27: ...... 0,0,8|
00000110  30 2c 30 0d 00 b4 1b f4  20 2d 2d 2d 20 47 6c 6f  |0,0..... --- Glo|
00000120  62 61 6c 20 63 6f 6e 73  74 73 20 2d 2d 2d 0d 00  |bal consts ---..|
00000130  be 2d 6e 5f 70 74 73 25  3d 35 20 20 20 20 20 20  |.-n_pts%=5      |
00000140  20 20 20 20 20 20 20 20  3a f4 20 6e 75 6d 62 65  |        :. numbe|
00000150  72 20 6f 66 20 70 6f 69  6e 74 73 0d 00 c8 46 72  |r of points...Fr|
00000160  61 64 25 3d 31 32 38 20  20 20 20 20 20 20 20 20  |ad%=128         |
00000170  20 20 20 20 20 3a f4 20  72 61 64 69 75 73 20 6f  |     :. radius o|
00000180  66 20 73 70 68 65 72 65  20 61 74 20 65 61 63 68  |f sphere at each|
00000190  20 70 6f 69 6e 74 20 28  6f 73 20 75 6e 69 74 73  | point (os units|
000001a0  29 0d 00 d2 34 72 61 64  5f 73 74 65 70 25 3d 72  |)...4rad_step%=r|
000001b0  61 64 25 20 81 20 31 35  20 3a f4 20 74 68 69 63  |ad% . 15 :. thic|
000001c0  6b 6e 65 73 73 20 6f 66  20 73 68 61 64 65 64 20  |kness of shaded |
000001d0  72 69 6e 67 73 0d 00 dc  3e 72 74 5f 6c 69 6d 69  |rings...>rt_limi|
000001e0  74 25 3d 31 32 37 39 2d  72 61 64 25 2a 32 20 3a  |t%=1279-rad%*2 :|
000001f0  f4 20 62 6f 75 6e 63 65  20 74 68 72 65 73 68 6f  |. bounce thresho|
00000200  6c 64 2c 20 72 69 67 68  74 20 6f 66 20 73 63 72  |ld, right of scr|
00000210  65 65 6e 0d 00 e6 24 74  6f 70 5f 6c 69 6d 69 74  |een...$top_limit|
00000220  25 3d 39 35 39 2d 72 61  64 25 2a 32 20 3a f4 20  |%=959-rad%*2 :. |
00000230  64 6f 2e 20 74 6f 70 0d  00 f0 19 f4 20 2d 2d 2d  |do. top..... ---|
00000240  20 47 6c 6f 62 61 6c 20  76 61 72 73 20 2d 2d 2d  | Global vars ---|
00000250  0d 00 fa 4a 70 61 6c 5f  70 74 72 25 3d 31 20 20  |...Jpal_ptr%=1  |
00000260  20 20 20 20 20 20 20 20  20 20 3a f4 20 70 74 72  |          :. ptr|
00000270  20 74 6f 20 63 6f 6c 6f  75 72 20 76 61 6c 75 65  | to colour value|
00000280  20 6f 66 20 31 73 74 20  72 69 6e 67 20 69 6e 20  | of 1st ring in |
00000290  70 61 6c 25 20 61 72 72  61 79 0d 01 04 3d 73 63  |pal% array...=sc|
000002a0  72 65 65 6e 25 3d 31 20  20 20 20 20 20 20 20 20  |reen%=1         |
000002b0  20 20 20 20 3a f4 20 73  63 72 65 65 6e 20 62 61  |    :. screen ba|
000002c0  6e 6b 20 28 75 73 65 64  20 6f 6e 6c 79 20 62 79  |nk (used only by|
000002d0  20 42 61 73 69 63 29 0d  01 0e 1b f4 20 2d 2d 2d  | Basic)..... ---|
000002e0  20 47 6c 6f 62 61 6c 20  61 72 72 61 79 73 20 2d  | Global arrays -|
000002f0  2d 2d 0d 01 18 49 de 20  78 25 20 6e 5f 70 74 73  |--...I. x% n_pts|
00000300  25 3c 3c 32 20 20 20 20  20 20 3a f4 20 70 6f 73  |%<<2      :. pos|
00000310  69 74 69 6f 6e 73 20 6f  66 20 62 6f 74 74 6f 6d  |itions of bottom|
00000320  2d 6c 65 66 74 20 6f 66  20 73 70 68 65 72 65 73  |-left of spheres|
00000330  20 28 6f 73 20 75 6e 69  74 73 29 0d 01 22 1e de  | (os units).."..|
00000340  20 79 25 20 6e 5f 70 74  73 25 3c 3c 32 20 20 20  | y% n_pts%<<2   |
00000350  20 20 20 3a f4 20 64 6f  2e 0d 01 2c 3f de 20 64  |   :. do...,?. d|
00000360  78 25 20 6e 5f 70 74 73  25 3c 3c 32 20 20 20 20  |x% n_pts%<<2    |
00000370  20 3a f4 20 76 65 6c 6f  63 69 74 79 20 63 6f 6d  | :. velocity com|
00000380  70 6f 6e 65 6e 74 73 20  28 6f 73 20 75 6e 69 74  |ponents (os unit|
00000390  73 2f 66 72 61 6d 65 29  0d 01 36 1e de 20 64 79  |s/frame)..6.. dy|
000003a0  25 20 6e 5f 70 74 73 25  3c 3c 32 20 20 20 20 20  |% n_pts%<<2     |
000003b0  3a f4 20 64 6f 2e 0d 01  40 32 de 20 70 61 6c 25  |:. do...@2. pal%|
000003c0  20 31 36 20 20 20 20 20  20 20 20 20 20 20 3a f4  | 16           :.|
000003d0  20 67 72 61 64 75 61 74  65 64 20 63 6f 6c 6f 75  | graduated colou|
000003e0  72 20 76 61 6c 75 65 73  0d 01 4a 1f f4 20 2d 2d  |r values..J.. --|
000003f0  2d 20 49 6e 69 74 69 61  6c 69 73 65 20 61 72 72  |- Initialise arr|
00000400  61 79 73 20 2d 2d 2d 0d  01 54 14 e3 20 70 74 25  |ays ---..T.. pt%|
00000410  3d 31 20 b8 20 6e 5f 70  74 73 25 0d 01 5e 18 20  |=1 . n_pts%..^. |
00000420  61 25 3d 70 74 25 2a 33  36 30 20 81 20 6e 5f 70  |a%=pt%*360 . n_p|
00000430  74 73 25 0d 01 68 24 20  78 25 21 28 70 74 25 3c  |ts%..h$ x%!(pt%<|
00000440  3c 32 29 3d 36 34 30 2d  72 61 64 25 2b b5 b2 28  |<2)=640-rad%+..(|
00000450  61 25 29 2a 32 35 36 0d  01 72 24 20 79 25 21 28  |a%)*256..r$ y%!(|
00000460  70 74 25 3c 3c 32 29 3d  34 38 30 2d 72 61 64 25  |pt%<<2)=480-rad%|
00000470  2b 9b b2 28 61 25 29 2a  32 35 36 0d 01 7c 2d 20  |+..(a%)*256..|- |
00000480  64 78 25 21 28 70 74 25  3c 3c 32 29 3d 28 78 25  |dx%!(pt%<<2)=(x%|
00000490  21 28 70 74 25 3c 3c 32  29 2d 36 34 30 2b 72 61  |!(pt%<<2)-640+ra|
000004a0  64 25 29 20 81 20 31 36  0d 01 86 2d 20 64 79 25  |d%) . 16...- dy%|
000004b0  21 28 70 74 25 3c 3c 32  29 3d 28 79 25 21 28 70  |!(pt%<<2)=(y%!(p|
000004c0  74 25 3c 3c 32 29 2d 34  38 30 2b 72 61 64 25 29  |t%<<2)-480+rad%)|
000004d0  20 81 20 31 36 0d 01 90  09 ed 20 70 74 25 0d 01  | . 16..... pt%..|
000004e0  9a 14 e3 20 63 6f 6c 6f  75 72 25 3d 31 20 b8 20  |... colour%=1 . |
000004f0  31 35 0d 01 a4 1c 20 70  61 6c 25 3f 63 6f 6c 6f  |15.... pal%?colo|
00000500  75 72 25 3d 63 6f 6c 6f  75 72 25 2a 31 36 0d 01  |ur%=colour%*16..|
00000510  ae 05 ed 0d 01 b8 05 e1  0d 01 c2 04 0d 01 cc 12  |................|
00000520  dd 20 f2 73 77 61 70 5f  73 63 72 65 65 6e 0d 01  |. .swap_screen..|
00000530  d6 1a ff 28 22 46 58 31  31 33 2c 22 2b c3 28 73  |...("FX113,"+.(s|
00000540  63 72 65 65 6e 25 29 29  0d 01 e0 17 73 63 72 65  |creen%))....scre|
00000550  65 6e 25 3d 73 63 72 65  65 6e 25 20 82 20 33 0d  |en%=screen% . 3.|
00000560  01 ea 06 c8 96 0d 01 f4  1a ff 28 22 46 58 31 31  |..........("FX11|
00000570  32 2c 22 2b c3 28 73 63  72 65 65 6e 25 29 29 0d  |2,"+.(screen%)).|
00000580  01 fe 05 e1 0d 02 08 04  0d 02 12 0c dd 20 f2 65  |............. .e|
00000590  72 72 6f 72 0d 02 1c 0c  2a 46 58 31 31 32 2c 30  |rror....*FX112,0|
000005a0  0d 02 26 0c 2a 46 58 31  31 33 2c 30 0d 02 30 13  |..&.*FX113,0..0.|
000005b0  fb 20 37 2c 32 35 35 2c  32 35 35 2c 32 35 35 0d  |. 7,255,255,255.|
000005c0  02 3a 16 f1 20 f6 24 3b  22 20 61 74 20 6c 69 6e  |.:.. .$;" at lin|
000005d0  65 20 22 3b 9e 0d 02 44  05 ee 0d 02 4e 05 e1 0d  |e ";...D....N...|
000005e0  02 58 04 0d 02 62 0a dd  20 f2 61 73 6d 0d 02 6c  |.X...b.. .asm..l|
000005f0  10 de 20 63 6f 64 65 25  20 31 30 30 30 0d 02 76  |.. code% 1000..v|
00000600  15 e3 20 70 61 73 73 25  3d 30 20 b8 20 32 20 88  |.. pass%=0 . 2 .|
00000610  20 32 0d 02 80 0c 50 25  3d 63 6f 64 65 25 0d 02  | 2....P%=code%..|
00000620  8a 04 0d 02 94 21 f4 20  2d 2d 2d 20 52 65 67 69  |.....!. --- Regi|
00000630  73 74 65 72 73 20 66 6f  72 20 2e 6d 6f 76 65 20  |sters for .move |
00000640  2d 2d 2d 0d 02 9e 04 0d  02 a8 29 f4 20 72 30 2c  |---.......). r0,|
00000650  72 31 20 75 73 65 64 20  66 6f 72 20 69 6e 74 65  |r1 used for inte|
00000660  72 6d 65 64 69 61 74 65  20 72 65 73 75 6c 74 73  |rmediate results|
00000670  0d 02 b2 17 f4 20 2d 20  47 6c 6f 62 61 6c 20 61  |..... - Global a|
00000680  72 72 61 79 73 20 2d 0d  02 bc 08 72 78 3d 32 0d  |rrays -....rx=2.|
00000690  02 c6 08 72 79 3d 33 0d  02 d0 09 72 64 78 3d 34  |...ry=3....rdx=4|
000006a0  0d 02 da 09 72 64 79 3d  35 0d 02 e4 14 f4 20 2d  |....rdy=5..... -|
000006b0  20 4c 6f 63 61 6c 20 76  61 72 73 20 2d 0d 02 ee  | Local vars -...|
000006c0  09 72 70 74 3d 36 0d 02  f8 09 72 70 78 3d 37 0d  |.rpt=6....rpx=7.|
000006d0  03 02 09 72 70 79 3d 38  0d 03 0c 0a 72 70 64 78  |...rpy=8....rpdx|
000006e0  3d 39 0d 03 16 0b 72 70  64 79 3d 31 30 0d 03 20  |=9....rpdy=10.. |
000006f0  04 0d 03 2a 0c 72 6c 69  6e 6b 3d 31 34 0d 03 34  |...*.rlink=14..4|
00000700  04 0d 03 3e 05 5b 0d 03  48 0d 4f 50 54 20 70 61  |...>.[..H.OPT pa|
00000710  73 73 25 0d 03 52 27 2e  6d 6f 76 65 20 20 20 20  |ss%..R'.move    |
00000720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000730  20 20 5c dd 20 f2 6d 6f  76 65 0d 03 5c 4c 20 20  |  \. .move..\L  |
00000740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000750  20 20 20 20 20 20 20 20  20 5c f4 20 4d 6f 76 65  |         \. Move|
00000760  20 65 61 63 68 20 70 6f  69 6e 74 20 62 79 20 64  | each point by d|
00000770  78 2c 64 79 2e 20 42 6f  75 6e 63 65 20 6f 66 66  |x,dy. Bounce off|
00000780  20 65 64 67 65 73 0d 03  66 37 20 20 20 20 20 20  | edges..f7      |
00000790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000007a0  20 20 20 20 20 5c ea 20  70 74 25 2c 70 78 25 2c  |     \. pt%,px%,|
000007b0  70 79 25 2c 70 64 78 25  2c 70 64 79 25 0d 03 70  |py%,pdx%,pdy%..p|
000007c0  21 53 57 49 20 32 35 36  2b 31 32 20 20 20 20 20  |!SWI 256+12     |
000007d0  20 20 20 20 20 20 20 20  20 20 20 20 5c db 0d 03  |            \...|
000007e0  7a 45 4c 44 52 20 72 78  2c 78 20 20 20 20 20 20  |zELDR rx,x      |
000007f0  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 47 65  |             \Ge|
00000800  74 20 61 72 72 61 79 20  61 64 64 72 65 73 73 65  |t array addresse|
00000810  73 20 69 6e 74 6f 20 72  65 67 69 73 74 65 72 73  |s into registers|
00000820  2e 2e 2e 0d 03 84 20 4c  44 52 20 72 79 2c 79 20  |...... LDR ry,y |
00000830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000840  20 20 5c 0d 03 8e 20 4c  44 52 20 72 64 78 2c 64  |  \... LDR rdx,d|
00000850  78 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |x               |
00000860  20 20 5c 0d 03 98 20 4c  44 52 20 72 64 79 2c 64  |  \... LDR rdy,d|
00000870  79 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |y               |
00000880  20 20 5c 0d 03 a2 30 4d  4f 56 20 72 70 74 2c 23  |  \...0MOV rpt,#|
00000890  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
000008a0  20 20 5c e3 20 70 74 25  3d 31 20 b8 20 6e 5f 70  |  \. pt%=1 . n_p|
000008b0  74 73 25 0d 03 ac 0f 2e  6d 6f 76 65 5f 6c 6f 6f  |ts%.....move_loo|
000008c0  70 31 0d 03 b6 30 4c 44  52 20 72 70 78 2c 5b 72  |p1...0LDR rpx,[r|
000008d0  78 2c 72 70 74 2c 4c 53  4c 23 32 5d 20 20 20 20  |x,rpt,LSL#2]    |
000008e0  20 5c 20 70 78 25 3d 78  25 21 28 70 74 25 3c 3c  | \ px%=x%!(pt%<<|
000008f0  32 29 0d 03 c0 30 4c 44  52 20 72 70 79 2c 5b 72  |2)...0LDR rpy,[r|
00000900  79 2c 72 70 74 2c 4c 53  4c 23 32 5d 20 20 20 20  |y,rpt,LSL#2]    |
00000910  20 5c 20 70 79 25 3d 79  25 21 28 70 74 25 3c 3c  | \ py%=y%!(pt%<<|
00000920  32 29 0d 03 ca 32 4c 44  52 20 72 70 64 78 2c 5b  |2)...2LDR rpdx,[|
00000930  72 64 78 2c 72 70 74 2c  4c 53 4c 23 32 5d 20 20  |rdx,rpt,LSL#2]  |
00000940  20 5c 20 70 64 78 25 3d  64 78 25 21 28 70 74 25  | \ pdx%=dx%!(pt%|
00000950  3c 3c 32 29 0d 03 d4 32  4c 44 52 20 72 70 64 79  |<<2)...2LDR rpdy|
00000960  2c 5b 72 64 79 2c 72 70  74 2c 4c 53 4c 23 32 5d  |,[rdy,rpt,LSL#2]|
00000970  20 20 20 5c 20 70 64 79  25 3d 64 79 25 21 28 70  |   \ pdy%=dy%!(p|
00000980  74 25 3c 3c 32 29 0d 03  de 41 43 4d 50 20 72 70  |t%<<2)...ACMP rp|
00000990  74 2c 23 6e 5f 70 74 73  25 20 20 20 20 20 20 20  |t,#n_pts%       |
000009a0  20 20 20 20 20 5c 20 e7  20 70 74 25 3c 3d 6e 5f  |     \ . pt%<=n_|
000009b0  70 74 73 25 20 81 20 32  20 84 20 70 74 25 3d 6e  |pts% . 2 . pt%=n|
000009c0  5f 70 74 73 25 20 8c 0d  03 e8 12 42 45 51 20 6d  |_pts% .....BEQ m|
000009d0  6f 76 65 5f 73 6b 69 70  31 0d 03 f2 17 43 4d 50  |ove_skip1....CMP|
000009e0  20 72 70 74 2c 23 6e 5f  70 74 73 25 20 81 20 32  | rpt,#n_pts% . 2|
000009f0  0d 03 fc 12 42 47 54 20  6d 6f 76 65 5f 65 6c 73  |....BGT move_els|
00000a00  65 31 0d 04 06 0f 2e 6d  6f 76 65 5f 73 6b 69 70  |e1.....move_skip|
00000a10  31 0d 04 10 2b 41 44 44  20 72 70 78 2c 72 70 78  |1...+ADD rpx,rpx|
00000a20  2c 72 70 64 78 20 20 20  20 20 20 20 20 20 20 20  |,rpdx           |
00000a30  5c 20 20 70 78 25 2b 3d  70 64 78 25 0d 04 1a 2b  |\  px%+=pdx%...+|
00000a40  41 44 44 20 72 70 79 2c  72 70 79 2c 72 70 64 79  |ADD rpy,rpy,rpdy|
00000a50  20 20 20 20 20 20 20 20  20 20 20 5c 20 20 70 79  |           \  py|
00000a60  25 2b 3d 70 64 79 25 0d  04 24 3b 43 4d 50 20 72  |%+=pdy%..$;CMP r|
00000a70  70 78 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |px,#0           |
00000a80  20 20 20 20 20 20 5c 20  20 e7 20 70 78 25 3c 30  |      \  . px%<0|
00000a90  20 84 20 70 78 25 3e 72  74 5f 6c 69 6d 69 74 25  | . px%>rt_limit%|
00000aa0  20 8c 0d 04 2e 2d 52 53  42 4c 54 20 72 70 64 78  | ....-RSBLT rpdx|
00000ab0  2c 72 70 64 78 2c 23 30  20 20 20 20 20 20 20 20  |,rpdx,#0        |
00000ac0  20 5c 20 20 20 70 64 78  25 3d 2d 70 64 78 25 0d  | \   pdx%=-pdx%.|
00000ad0  04 38 13 4c 44 52 20 72  30 2c 72 74 5f 6c 69 6d  |.8.LDR r0,rt_lim|
00000ae0  69 74 0d 04 42 0e 43 4d  50 20 72 70 78 2c 72 30  |it..B.CMP rpx,r0|
00000af0  0d 04 4c 16 52 53 42 47  54 20 72 70 64 78 2c 72  |..L.RSBGT rpdx,r|
00000b00  70 64 78 2c 23 30 0d 04  56 25 20 20 20 20 20 20  |pdx,#0..V%      |
00000b10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000b20  20 20 20 20 20 5c 20 20  cd 20 20 0d 04 60 3c 43  |     \  .  ..`<C|
00000b30  4d 50 20 72 70 79 2c 23  30 20 20 20 20 20 20 20  |MP rpy,#0       |
00000b40  20 20 20 20 20 20 20 20  20 20 5c 20 20 e7 20 70  |          \  . p|
00000b50  79 25 3c 30 20 84 20 70  79 25 3e 74 6f 70 5f 6c  |y%<0 . py%>top_l|
00000b60  69 6d 69 74 25 20 8c 0d  04 6a 2d 52 53 42 4c 54  |imit% ...j-RSBLT|
00000b70  20 72 70 64 79 2c 72 70  64 79 2c 23 30 20 20 20  | rpdy,rpdy,#0   |
00000b80  20 20 20 20 20 20 5c 20  20 20 70 64 79 25 3d 2d  |      \   pdy%=-|
00000b90  70 64 79 25 0d 04 74 14  4c 44 52 20 72 30 2c 74  |pdy%..t.LDR r0,t|
00000ba0  6f 70 5f 6c 69 6d 69 74  0d 04 7e 0e 43 4d 50 20  |op_limit..~.CMP |
00000bb0  72 70 79 2c 72 30 0d 04  88 16 52 53 42 47 54 20  |rpy,r0....RSBGT |
00000bc0  72 70 64 79 2c 72 70 64  79 2c 23 30 0d 04 92 25  |rpdy,rpdy,#0...%|
00000bd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000be0  20 20 20 20 20 20 20 20  20 20 20 5c 20 20 cd 20  |           \  . |
00000bf0  20 0d 04 9c 20 42 20 6d  6f 76 65 5f 65 6e 64 69  | ... B move_endi|
00000c00  66 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |f1              |
00000c10  20 0d 04 a6 26 2e 6d 6f  76 65 5f 65 6c 73 65 31  | ...&.move_else1|
00000c20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000c30  5c 20 8b 20 20 20 20 0d  04 b0 44 4c 44 52 20 72  |\ .    ...DLDR r|
00000c40  30 2c 72 74 5f 6c 69 6d  69 74 20 20 20 20 20 20  |0,rt_limit      |
00000c50  20 20 20 20 20 20 5c 20  20 70 78 25 3d 72 74 5f  |      \  px%=rt_|
00000c60  6c 69 6d 69 74 25 2d 78  25 21 28 28 6e 5f 70 74  |limit%-x%!((n_pt|
00000c70  73 25 2d 70 74 25 29 3c  3c 32 29 0d 04 ba 16 52  |s%-pt%)<<2)....R|
00000c80  53 42 20 72 31 2c 72 70  74 2c 23 6e 5f 70 74 73  |SB r1,rpt,#n_pts|
00000c90  25 0d 04 c4 18 4c 44 52  20 72 31 2c 5b 72 78 2c  |%....LDR r1,[rx,|
00000ca0  72 31 2c 4c 53 4c 23 32  5d 0d 04 ce 11 53 55 42  |r1,LSL#2]....SUB|
00000cb0  20 72 70 78 2c 72 30 2c  72 31 0d 04 d8 3a 52 53  | rpx,r0,r1...:RS|
00000cc0  42 20 72 31 2c 72 70 74  2c 23 6e 5f 70 74 73 25  |B r1,rpt,#n_pts%|
00000cd0  20 20 20 20 20 20 20 20  20 5c 20 20 70 79 25 3d  |         \  py%=|
00000ce0  79 25 21 28 28 6e 5f 70  74 73 25 2d 70 74 25 29  |y%!((n_pts%-pt%)|
00000cf0  3c 3c 32 29 0d 04 e2 19  4c 44 52 20 72 70 79 2c  |<<2)....LDR rpy,|
00000d00  5b 72 79 2c 72 31 2c 4c  53 4c 23 32 5d 0d 04 ec  |[ry,r1,LSL#2]...|
00000d10  22 2e 6d 6f 76 65 5f 65  6e 64 69 66 31 20 20 20  |".move_endif1   |
00000d20  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 cd 0d  |            \ ..|
00000d30  04 f6 30 53 54 52 20 72  70 78 2c 5b 72 78 2c 72  |..0STR rpx,[rx,r|
00000d40  70 74 2c 4c 53 4c 23 32  5d 20 20 20 20 20 5c 20  |pt,LSL#2]     \ |
00000d50  78 25 21 28 70 74 25 3c  3c 32 29 3d 70 78 25 0d  |x%!(pt%<<2)=px%.|
00000d60  05 00 30 53 54 52 20 72  70 79 2c 5b 72 79 2c 72  |..0STR rpy,[ry,r|
00000d70  70 74 2c 4c 53 4c 23 32  5d 20 20 20 20 20 5c 20  |pt,LSL#2]     \ |
00000d80  79 25 21 28 70 74 25 3c  3c 32 29 3d 70 79 25 0d  |y%!(pt%<<2)=py%.|
00000d90  05 0a 32 53 54 52 20 72  70 64 78 2c 5b 72 64 78  |..2STR rpdx,[rdx|
00000da0  2c 72 70 74 2c 4c 53 4c  23 32 5d 20 20 20 5c 20  |,rpt,LSL#2]   \ |
00000db0  64 78 25 21 28 70 74 25  3c 3c 32 29 3d 70 64 78  |dx%!(pt%<<2)=pdx|
00000dc0  25 0d 05 14 32 53 54 52  20 72 70 64 79 2c 5b 72  |%...2STR rpdy,[r|
00000dd0  64 79 2c 72 70 74 2c 4c  53 4c 23 32 5d 20 20 20  |dy,rpt,LSL#2]   |
00000de0  5c 20 64 79 25 21 28 70  74 25 3c 3c 32 29 3d 70  |\ dy%!(pt%<<2)=p|
00000df0  64 79 25 0d 05 1e 25 41  44 44 20 72 70 74 2c 72  |dy%...%ADD rpt,r|
00000e00  70 74 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |pt,#1           |
00000e10  20 20 5c ed 20 70 74 25  0d 05 28 13 43 4d 50 20  |  \. pt%..(.CMP |
00000e20  72 70 74 2c 23 6e 5f 70  74 73 25 0d 05 32 12 42  |rpt,#n_pts%..2.B|
00000e30  4c 45 20 6d 6f 76 65 5f  6c 6f 6f 70 31 0d 05 3c  |LE move_loop1..<|
00000e40  21 4d 4f 56 20 50 43 2c  72 6c 69 6e 6b 20 20 20  |!MOV PC,rlink   |
00000e50  20 20 20 20 20 20 20 20  20 20 20 20 5c e1 0d 05  |            \...|
00000e60  46 04 0d 05 50 05 5d 0d  05 5a 04 0d 05 64 21 f4  |F...P.]..Z...d!.|
00000e70  20 2d 2d 2d 20 52 65 67  69 73 74 65 72 73 20 66  | --- Registers f|
00000e80  6f 72 20 2e 64 72 61 77  20 2d 2d 2d 0d 05 6e 04  |or .draw ---..n.|
00000e90  0d 05 78 18 f4 20 72 30  2d 72 32 20 75 73 65 64  |..x.. r0-r2 used|
00000ea0  20 62 79 20 53 57 49 73  0d 05 82 17 f4 20 2d 20  | by SWIs..... - |
00000eb0  47 6c 6f 62 61 6c 20 61  72 72 61 79 73 20 2d 0d  |Global arrays -.|
00000ec0  05 8c 08 72 78 3d 33 0d  05 96 08 72 79 3d 34 0d  |...rx=3....ry=4.|
00000ed0  05 a0 14 f4 20 2d 20 4c  6f 63 61 6c 20 76 61 72  |.... - Local var|
00000ee0  73 20 2d 0d 05 aa 0a 72  63 6f 6c 3d 35 0d 05 b4  |s -....rcol=5...|
00000ef0  08 72 72 3d 36 0d 05 be  09 72 70 74 3d 37 0d 05  |.rr=6....rpt=7..|
00000f00  c8 09 72 70 78 3d 38 0d  05 d2 09 72 70 79 3d 39  |..rpx=8....rpy=9|
00000f10  0d 05 dc 04 0d 05 e6 05  5b 0d 05 f0 0d 4f 50 54  |........[....OPT|
00000f20  20 70 61 73 73 25 0d 05  fa 44 2e 64 72 61 77 20  | pass%...D.draw |
00000f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000f40  20 20 20 20 20 5c dd 20  f2 64 72 61 77 20 3a f4  |     \. .draw :.|
00000f50  20 44 72 61 77 20 73 70  68 65 72 65 20 61 74 20  | Draw sphere at |
00000f60  65 61 63 68 20 70 6f 69  6e 74 0d 06 04 2d 20 20  |each point...-  |
00000f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000f80  20 20 20 20 20 20 20 20  20 5c ea 20 63 6f 6c 25  |         \. col%|
00000f90  2c 72 25 2c 70 74 25 0d  06 0e 45 4c 44 52 20 72  |,r%,pt%...ELDR r|
00000fa0  78 2c 78 20 20 20 20 20  20 20 20 20 20 20 20 20  |x,x             |
00000fb0  20 20 20 20 20 20 5c 47  65 74 20 61 72 72 61 79  |      \Get array|
00000fc0  20 61 64 64 72 65 73 73  65 73 20 69 6e 74 6f 20  | addresses into |
00000fd0  72 65 67 69 73 74 65 72  73 2e 2e 2e 0d 06 18 20  |registers...... |
00000fe0  4c 44 52 20 72 79 2c 79  20 20 20 20 20 20 20 20  |LDR ry,y        |
00000ff0  20 20 20 20 20 20 20 20  20 20 20 5c 0d 06 22 26  |           \.."&|
00001000  4d 4f 56 20 72 63 6f 6c  2c 23 30 20 20 20 20 20  |MOV rcol,#0     |
00001010  20 20 20 20 20 20 20 20  20 20 20 5c 63 6f 6c 25  |           \col%|
00001020  3d 30 0d 06 2c 3a 4d 4f  56 20 72 72 2c 23 72 61  |=0..,:MOV rr,#ra|
00001030  64 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |d%              |
00001040  20 5c e3 20 72 25 3d 72  61 64 25 20 b8 20 30 20  | \. r%=rad% . 0 |
00001050  88 20 2d 72 61 64 5f 73  74 65 70 25 0d 06 36 0f  |. -rad_step%..6.|
00001060  2e 64 72 61 77 5f 6c 6f  6f 70 31 0d 06 40 29 53  |.draw_loop1..@)S|
00001070  57 49 20 32 35 36 2b 31  38 20 20 20 20 20 20 20  |WI 256+18       |
00001080  20 20 20 20 20 20 20 20  20 20 5c 20 e6 20 63 6f  |          \ . co|
00001090  6c 25 2b 31 0d 06 4a 0d  53 57 49 20 32 35 36 2b  |l%+1..J.SWI 256+|
000010a0  30 0d 06 54 12 41 44 44  20 72 30 2c 72 63 6f 6c  |0..T.ADD r0,rcol|
000010b0  2c 23 31 0d 06 5e 13 53  57 49 20 22 4f 53 5f 57  |,#1..^.SWI "OS_W|
000010c0  72 69 74 65 43 22 0d 06  68 33 4d 4f 56 20 72 63  |riteC"..h3MOV rc|
000010d0  6f 6c 2c 72 30 20 20 20  20 20 20 20 20 20 20 20  |ol,r0           |
000010e0  20 20 20 20 20 5c 20 63  6f 6c 25 3d 28 63 6f 6c  |     \ col%=(col|
000010f0  25 2b 31 29 20 83 20 31  35 0d 06 72 10 43 4d 50  |%+1) . 15..r.CMP|
00001100  20 72 63 6f 6c 2c 23 31  35 0d 06 7c 11 4d 4f 56  | rcol,#15..|.MOV|
00001110  47 54 20 72 63 6f 6c 2c  23 30 0d 06 86 31 4d 4f  |GT rcol,#0...1MO|
00001120  56 20 72 70 74 2c 23 31  20 20 20 20 20 20 20 20  |V rpt,#1        |
00001130  20 20 20 20 20 20 20 20  20 5c 20 e3 20 70 74 25  |         \ . pt%|
00001140  3d 31 20 b8 20 6e 5f 70  74 73 25 0d 06 90 0f 2e  |=1 . n_pts%.....|
00001150  64 72 61 77 5f 6c 6f 6f  70 32 0d 06 9a 31 4c 44  |draw_loop2...1LD|
00001160  52 20 72 70 78 2c 5b 72  78 2c 72 70 74 2c 4c 53  |R rpx,[rx,rpt,LS|
00001170  4c 23 32 5d 20 20 20 20  20 5c 20 20 70 78 25 3d  |L#2]     \  px%=|
00001180  78 25 21 28 70 74 25 3c  3c 32 29 0d 06 a4 31 4c  |x%!(pt%<<2)...1L|
00001190  44 52 20 72 70 79 2c 5b  72 79 2c 72 70 74 2c 4c  |DR rpy,[ry,rpt,L|
000011a0  53 4c 23 32 5d 20 20 20  20 20 5c 20 20 70 79 25  |SL#2]     \  py%|
000011b0  3d 79 25 21 28 70 74 25  3c 3c 32 29 0d 06 ae 3c  |=y%!(pt%<<2)...<|
000011c0  4d 4f 56 20 72 30 2c 23  34 20 20 20 20 20 20 20  |MOV r0,#4       |
000011d0  20 20 20 20 20 20 20 20  20 20 20 5c 20 20 c8 8f  |           \  ..|
000011e0  20 c8 90 20 70 78 25 2b  72 61 64 25 2c 70 79 25  | .. px%+rad%,py%|
000011f0  2b 72 61 64 25 2c 72 25  0d 06 b8 14 41 44 44 20  |+rad%,r%....ADD |
00001200  72 31 2c 72 70 78 2c 23  72 61 64 25 0d 06 c2 14  |r1,rpx,#rad%....|
00001210  41 44 44 20 72 32 2c 72  70 79 2c 23 72 61 64 25  |ADD r2,rpy,#rad%|
00001220  0d 06 cc 11 53 57 49 20  22 4f 53 5f 50 6c 6f 74  |....SWI "OS_Plot|
00001230  22 0d 06 d6 11 4d 4f 56  20 72 30 2c 23 31 35 32  |"....MOV r0,#152|
00001240  2b 31 0d 06 e0 0d 4d 4f  56 20 72 31 2c 23 30 0d  |+1....MOV r1,#0.|
00001250  06 ea 0d 4d 4f 56 20 72  32 2c 72 72 0d 06 f4 11  |...MOV r2,rr....|
00001260  53 57 49 20 22 4f 53 5f  50 6c 6f 74 22 0d 06 fe  |SWI "OS_Plot"...|
00001270  26 41 44 44 20 72 70 74  2c 72 70 74 2c 23 31 20  |&ADD rpt,rpt,#1 |
00001280  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 ed 20  |            \ . |
00001290  70 74 25 0d 07 08 13 43  4d 50 20 72 70 74 2c 23  |pt%....CMP rpt,#|
000012a0  6e 5f 70 74 73 25 0d 07  12 12 42 4c 45 20 64 72  |n_pts%....BLE dr|
000012b0  61 77 5f 6c 6f 6f 70 32  0d 07 1c 24 53 55 42 53  |aw_loop2...$SUBS|
000012c0  20 72 72 2c 72 72 2c 23  72 61 64 5f 73 74 65 70  | rr,rr,#rad_step|
000012d0  25 20 20 20 20 20 20 5c  ed 20 72 25 0d 07 26 12  |%      \. r%..&.|
000012e0  42 47 45 20 64 72 61 77  5f 6c 6f 6f 70 31 0d 07  |BGE draw_loop1..|
000012f0  30 21 4d 4f 56 20 50 43  2c 72 6c 69 6e 6b 20 20  |0!MOV PC,rlink  |
00001300  20 20 20 20 20 20 20 20  20 20 20 20 20 5c e1 0d  |             \..|
00001310  07 3a 05 5d 0d 07 44 04  0d 07 4e 22 f4 20 2d 2d  |.:.]..D...N". --|
00001320  2d 20 52 65 67 69 73 74  65 72 73 20 66 6f 72 20  |- Registers for |
00001330  2e 63 79 63 6c 65 20 2d  2d 2d 0d 07 58 04 0d 07  |.cycle ---..X...|
00001340  62 14 f4 20 72 30 20 75  73 65 64 20 62 79 20 53  |b.. r0 used by S|
00001350  57 49 0d 07 6c 14 f4 20  2d 20 4c 6f 63 61 6c 20  |WI..l.. - Local |
00001360  76 61 72 73 20 2d 0d 07  76 0a 72 63 6f 6c 3d 31  |vars -..v.rcol=1|
00001370  0d 07 80 0a 72 76 61 6c  3d 32 0d 07 8a 08 72 70  |....rval=2....rp|
00001380  3d 33 0d 07 94 04 0d 07  9e 05 5b 0d 07 a8 0d 4f  |=3........[....O|
00001390  50 54 20 70 61 73 73 25  0d 07 b2 44 2e 63 79 63  |PT pass%...D.cyc|
000013a0  6c 65 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |le              |
000013b0  20 20 20 20 20 20 20 5c  dd 20 f2 63 79 63 6c 65  |       \. .cycle|
000013c0  20 3a f4 20 43 79 63 6c  65 20 74 68 65 20 70 61  | :. Cycle the pa|
000013d0  6c 65 74 74 65 20 31 20  73 74 65 70 0d 07 bc 2e  |lette 1 step....|
000013e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000013f0  20 20 20 20 20 20 20 20  20 20 20 5c ea 20 63 6f  |           \. co|
00001400  6c 25 2c 76 61 6c 25 2c  70 25 0d 07 c6 2b 4c 44  |l%,val%,p%...+LD|
00001410  52 20 72 70 2c 70 61 6c  5f 70 74 72 20 20 20 20  |R rp,pal_ptr    |
00001420  20 20 20 20 20 20 20 20  20 5c 70 25 3d 70 61 6c  |         \p%=pal|
00001430  5f 70 74 72 25 0d 07 d0  25 41 44 44 20 72 70 2c  |_ptr%...%ADD rp,|
00001440  72 70 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |rp,#1           |
00001450  20 20 20 20 5c 70 25 2b  3d 31 0d 07 da 2e 43 4d  |    \p%+=1....CM|
00001460  50 20 72 70 2c 23 31 35  20 20 20 20 20 20 20 20  |P rp,#15        |
00001470  20 20 20 20 20 20 20 20  20 5c e7 20 70 25 3e 31  |         \. p%>1|
00001480  35 20 8c 20 70 25 3d 31  0d 07 e4 0f 4d 4f 56 47  |5 . p%=1....MOVG|
00001490  54 20 72 70 2c 23 31 0d  07 ee 2b 53 54 52 20 72  |T rp,#1...+STR r|
000014a0  70 2c 70 61 6c 5f 70 74  72 20 20 20 20 20 20 20  |p,pal_ptr       |
000014b0  20 20 20 20 20 20 5c 70  61 6c 5f 70 74 72 25 3d  |      \pal_ptr%=|
000014c0  70 25 0d 07 f8 2d 4d 4f  56 20 72 63 6f 6c 2c 23  |p%...-MOV rcol,#|
000014d0  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
000014e0  20 5c e3 20 63 6f 6c 25  3d 31 20 b8 20 31 35 0d  | \. col%=1 . 15.|
000014f0  08 02 10 2e 63 79 63 6c  65 5f 6c 6f 6f 70 31 0d  |....cycle_loop1.|
00001500  08 0c 2d 4c 44 52 20 72  30 2c 70 61 6c 20 20 20  |..-LDR r0,pal   |
00001510  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00001520  76 61 6c 25 3d 70 61 6c  25 3f 70 25 0d 08 16 15  |val%=pal%?p%....|
00001530  4c 44 52 42 20 72 76 61  6c 2c 5b 72 30 2c 72 70  |LDRB rval,[r0,rp|
00001540  5d 0d 08 20 3e 53 57 49  20 32 35 36 2b 31 39 20  |].. >SWI 256+19 |
00001550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001560  5c 20 fb 20 63 6f 6c 25  2c 76 61 6c 25 20 81 20  |\ . col%,val% . |
00001570  32 2c 76 61 6c 25 2c 76  61 6c 25 20 81 20 32 0d  |2,val%,val% . 2.|
00001580  08 2a 0f 4d 4f 56 20 72  30 2c 72 63 6f 6c 0d 08  |.*.MOV r0,rcol..|
00001590  34 13 53 57 49 20 22 4f  53 5f 57 72 69 74 65 43  |4.SWI "OS_WriteC|
000015a0  22 0d 08 3e 0e 53 57 49  20 32 35 36 2b 31 36 0d  |"..>.SWI 256+16.|
000015b0  08 48 15 4d 4f 56 20 72  30 2c 72 76 61 6c 2c 41  |.H.MOV r0,rval,A|
000015c0  53 52 23 31 0d 08 52 13  53 57 49 20 22 4f 53 5f  |SR#1..R.SWI "OS_|
000015d0  57 72 69 74 65 43 22 0d  08 5c 0f 4d 4f 56 20 72  |WriteC"..\.MOV r|
000015e0  30 2c 72 76 61 6c 0d 08  66 13 53 57 49 20 22 4f  |0,rval..f.SWI "O|
000015f0  53 5f 57 72 69 74 65 43  22 0d 08 70 15 4d 4f 56  |S_WriteC"..p.MOV|
00001600  20 72 30 2c 72 76 61 6c  2c 41 53 52 23 31 0d 08  | r0,rval,ASR#1..|
00001610  7a 13 53 57 49 20 22 4f  53 5f 57 72 69 74 65 43  |z.SWI "OS_WriteC|
00001620  22 0d 08 84 26 41 44 44  20 72 70 2c 72 70 2c 23  |"...&ADD rp,rp,#|
00001630  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
00001640  5c 20 70 25 2b 3d 31 0d  08 8e 30 43 4d 50 20 72  |\ p%+=1...0CMP r|
00001650  70 2c 23 31 35 20 20 20  20 20 20 20 20 20 20 20  |p,#15           |
00001660  20 20 20 20 20 20 5c 20  e7 20 70 25 3e 3d 31 35  |      \ . p%>=15|
00001670  20 8c 20 70 25 3d 31 0d  08 98 0f 4d 4f 56 47 45  | . p%=1....MOVGE|
00001680  20 72 70 2c 23 31 0d 08  a2 26 41 44 44 20 72 63  | rp,#1...&ADD rc|
00001690  6f 6c 2c 72 63 6f 6c 2c  23 31 20 20 20 20 20 20  |ol,rcol,#1      |
000016a0  20 20 20 20 20 5c ed 20  63 6f 6c 25 0d 08 ac 10  |     \. col%....|
000016b0  43 4d 50 20 72 63 6f 6c  2c 23 31 35 0d 08 b6 13  |CMP rcol,#15....|
000016c0  42 4c 45 20 63 79 63 6c  65 5f 6c 6f 6f 70 31 0d  |BLE cycle_loop1.|
000016d0  08 c0 21 4d 4f 56 20 50  43 2c 72 6c 69 6e 6b 20  |..!MOV PC,rlink |
000016e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c e1  |              \.|
000016f0  0d 08 ca 04 0d 08 d4 19  5c 5c 5c 20 47 6c 6f 62  |........\\\ Glob|
00001700  61 6c 20 61 72 72 61 79  73 20 5c 5c 5c 0d 08 de  |al arrays \\\...|
00001710  17 2e 78 20 20 20 20 20  20 20 20 20 20 45 51 55  |..x          EQU|
00001720  44 20 78 25 0d 08 e8 17  2e 79 20 20 20 20 20 20  |D x%.....y      |
00001730  20 20 20 20 45 51 55 44  20 79 25 0d 08 f2 18 2e  |    EQUD y%.....|
00001740  64 78 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |dx         EQUD |
00001750  64 78 25 0d 08 fc 18 2e  64 79 20 20 20 20 20 20  |dx%.....dy      |
00001760  20 20 20 45 51 55 44 20  64 79 25 0d 09 06 19 2e  |   EQUD dy%.....|
00001770  70 61 6c 20 20 20 20 20  20 20 20 45 51 55 44 20  |pal        EQUD |
00001780  70 61 6c 25 0d 09 10 16  5c 5c 5c 20 47 6c 6f 62  |pal%....\\\ Glob|
00001790  61 6c 20 76 61 72 20 5c  5c 5c 0d 09 1a 1d 2e 70  |al var \\\.....p|
000017a0  61 6c 5f 70 74 72 20 20  20 20 45 51 55 44 20 70  |al_ptr    EQUD p|
000017b0  61 6c 5f 70 74 72 25 0d  09 24 19 5c 5c 5c 20 47  |al_ptr%..$.\\\ G|
000017c0  6c 6f 62 61 6c 20 63 6f  6e 73 74 73 20 5c 5c 5c  |lobal consts \\\|
000017d0  0d 09 2e 1e 2e 72 74 5f  6c 69 6d 69 74 20 20 20  |.....rt_limit   |
000017e0  45 51 55 44 20 72 74 5f  6c 69 6d 69 74 25 0d 09  |EQUD rt_limit%..|
000017f0  38 1f 2e 74 6f 70 5f 6c  69 6d 69 74 20 20 45 51  |8..top_limit  EQ|
00001800  55 44 20 74 6f 70 5f 6c  69 6d 69 74 25 0d 09 42  |UD top_limit%..B|
00001810  4b 5c 5c 5c 20 28 72 61  64 25 2c 20 6e 5f 70 74  |K\\\ (rad%, n_pt|
00001820  73 25 2c 20 65 74 63 2e  20 61 72 65 20 6c 65 73  |s%, etc. are les|
00001830  73 20 74 68 61 6e 20 32  35 36 20 73 6f 20 75 73  |s than 256 so us|
00001840  65 20 64 69 72 65 63 74  6c 79 20 65 67 20 23 72  |e directly eg #r|
00001850  61 64 25 29 20 5c 5c 5c  0d 09 4c 05 5d 0d 09 56  |ad%) \\\..L.]..V|
00001860  0b ed 20 70 61 73 73 25  0d 09 60 05 e1 0d ff     |.. pass%..`....|
0000186f