Home » Archimedes archive » Acorn User » AU 1993-11.adf » !StarInfo_StarInfo » Blend

Blend

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 1993-11.adf » !StarInfo_StarInfo
Filename: Blend
Read OK:
File size: 163F bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >Blend
   20REM By  Chris Rijk
   30REM For 32-bit machines
   40REM (c) BAU November 1993
   50:
   60MODE 13
   70OFF
   80GCOL 3,63
   90power=8
  100zoomp=power-7
  110DIM scale 16,colour 256,tst(4),dir(4),spr 80*1024
  120!spr=80*1024
  130spr!4=0
  140spr!8=16
  150spr!12=16
  160FOR c=0 TO 255
  170 colour?c=c
  180NEXT
  190PROCassemble
  200FOR a=0 TO 255
  210 col=a<<24 OR a*&010101
  220 FOR b=base+a*320 TO base+a*320+252 STEP 4
  230  !b=col
  240 NEXT
  250NEXT
  260REPEAT
  270 PROCzoom
  280 FOR F%=power-zoomp TO 1 STEP-1
  290  !powerof2=F%
  300  CALL blendy
  310  A%=blend
  320  B%=base
  330  C%=0
  340  D%=64
  350  CALL move
  360 NEXT
  370UNTIL FALSE
  380END
  390:
  400DEF PROCassemble
  410SYS 6,112,1 TO ,,base
  420x1=0:x2=1:xstep=5:y1=2:y2=3
  430ystep=4:step=5:use=6:off=7
  440table=8:col=9:poi=9:range=9
  450min=10:max=11
  460rnd1=11:rnd2=12:rnd3=14
  470sp=13:link=14:pc=15
  480DIM program &400+8*2^(power-5)+&20000
  490FOR pass=0 TO 2 STEP 2
  500P%=program
  510[OPT pass
  520.safe   EQUD    0
  530        EQUD    0
  540.rand   EQUD    RND
  550        EQUD    RND
  560.powerof2
  570        EQUD    0
  580
  590.blendy
  600        STMFD   (sp)!,{link}
  610        ADR     table,blend
  620        MOV     r0,#1
  630        MOV     step,r0,LSL step
  640        MOV     use,#1
  650        RSB     x1,step,#2^power
  660        MOV     r12,#2^power
  670        MUL     y1,x1,r12
  680        MOV     y2,y1
  690        MUL     ystep,r12,step
  700.y_loop ORR     use,use,#8
  710        CMP     y2,#0
  720        ORREQ   use,use,#4
  730        MOV     x2,x1
  740.x_loop CMP     x2,#0
  750        ORREQ   use,use,#2
  760        FNl
  770        BIC     use,use,#8
  780        SUBS    x2,x2,xstep
  790        BPL     x_loop
  800        MOV     use,#0
  810        SUBS    y2,y2,ystep
  820        BPL     y_loop
  830        LDMFD   (sp)!,{pc}
  840
  850.choose STMFD   (sp)!,{link}
  860        ADD     max,max,step,LSR #1
  870        SUB     min,min,step,LSR #1
  880        CMP     min,max
  890        MOVEQ   col,min
  900        BEQ     plot
  910        SUBS    range,max,min
  920        RSBLT   range,range,#0
  930        MOVLT   min,max
  940        ADD     range,range,#2
  950        ADD     min,min,range,LSR #2
  960        MOV     range,range,LSR #1
  970        FNrndmod
  980        ADD     col,min,rnd1
  990        CMP     col,#255
 1000        MOVGT   col,#255
 1010        CMP     col,#0
 1020        MOVLT   col,#0
 1030.plot   STRB    col,[table,off]
 1040        LDMFD   (sp)!,{pc}
 1050
 1060.move   MOV     r8,r0
 1070        MOV     r9,r1
 1080        MOV     r10,r2
 1090        MOV     r11,r3
 1100        MOV     r12,#2^power
 1110.move_loop
 1120]
 1130FOR count=1 TO 2^power/32
 1140 [OPT pass
 1150        LDMIA   r8!,{r0-R7}
 1160        STMIA   r9!,{r0-R7}
 1170 ]
 1180NEXT
 1190[OPT pass
 1200        ADD     r9,r9,r11
 1210        ADD     r8,r8,r10
 1220        SUBS    r12,r12,#1
 1230        BGT     move_loop
 1240        MOV     pc,link
 1250
 1260.blend
 1270]
 1280NEXT
 1290ENDPROC
 1300:
 1310DEF FNl
 1320[OPT pass
 1330        ADD     off,x1,y1
 1340        SUB     off,off,x2
 1350        SUB     off,off,y2
 1360        FNways(2,1,1,2,2,0,8)
 1370        FNways(12,0,1,4,4,8,8)
 1380        FNways(2,0,1,0,8,-1,-1)
 1390        CMP     use,#0
 1400        BNE     jmp
 1410        ADD     poi,off,step,LSR #1
 1420        SUB     poi,poi,ystep,LSR #1
 1430        LDRB    r12,[table,poi]
 1440        ADD     poi,poi,ystep
 1450        LDRB    r14,[table,poi]
 1460        ADD     r12,r12,r14
 1470        MOV     r12,r12,LSR #1
 1480        FNcols(12)
 1490        SUB     poi,poi,xstep
 1500        LDRB    r12,[table,poi]
 1510        ADD     r12,r12,r14
 1520        MOV     r12,r12,LSR #1
 1530        FNcols(12)
 1540.jmp    BL      choose
 1550]:=""
 1560:
 1570DEF FNrndmod
 1580[OPT pass
 1590        LDR     rnd1,rand
 1600        LDR     rnd2,rand+4
 1610        TST     rnd2,rnd2,LSR #1
 1620        MOVS    rnd3,rnd1,RRX
 1630        ADC     rnd2,rnd2,rnd2
 1640        EOR     rnd3,rnd3,rnd1,LSL #12
 1650        EOR     rnd1,rnd3,rnd3,LSR #20
 1660        STR     rnd1,rand
 1670        STR     rnd2,rand+4
 1680        LDR     r14,powerof2
 1690        MVN     r12,#0
 1700        BIC     rnd1,rnd1,r12,LSL r14
 1710        CMP     rnd1,range
 1720        BLT     end
 1730.mod_loop
 1740        SUBS    rnd1,rnd1,range
 1750        BGE     mod_loop
 1760        ADD     rnd1,rnd1,range
 1770.end
 1780]
 1790=0
 1800:
 1810DEF FNways(dir,tst(1),dir(1),tst(2),dir(2),tst(3),dir(3))
 1820[OPT pass
 1830        MVN     min,#0
 1840        MOV     max,#256
 1850]
 1860IF (dir AND 2)=2 [OPT pass:ADD off,off,step,LSR #1:]
 1870IF (dir AND 4)=4 [OPT pass:ADD off,off,ystep,LSR #1:]
 1880IF (dir AND 8)=8 [OPT pass:SUB off,off,step,LSR #1:]
 1890FOR c=1 TO 3
 1900 IF tst(c)>0 THEN
 1910  [OPT pass
 1920        TST     use,#tst(c)
 1930        ADDNE   pc,pc,#20
 1940  ]
 1950 ENDIF
 1960 CASE dir(c) OF
 1970  WHEN 1:[OPT pass:SUB poi,off,ystep,LSR #1:]
 1980  WHEN 2:[OPT pass:ADD poi,off,step,LSR #1:]
 1990  WHEN 4:[OPT pass:ADD poi,off,ystep,LSR #1:]
 2000  WHEN 8:[OPT pass:SUB poi,off,step,LSR #1:]
 2010 ENDCASE
 2020 [OPT pass
 2030       LDRB    col,[table,poi]
 2040       FNcols(col)
 2050 ]
 2060IF tst(c+1)<0 c=4
 2070NEXT
 2080IF c<5 THEN [OPT pass:BL choose:]
 2090=0
 2100:
 2110DEF FNcols(colr)
 2120[OPT pass
 2130        CMP     min,colr
 2140        MOVLT   min,colr
 2150        CMP     max,colr
 2160        MOVGT   max,colr
 2170]:=""
 2180
 2190DEF PROCzoom
 2200*FX 15,0
 2210ztime=TIME
 2220REPEAT
 2230 MOUSE x,y,b
 2240 IF b=2 AND TIME-ztime>10 zoomp+=1:ztime=TIME
 2250 IF b=1 AND TIME-ztime>10 zoomp-=1:ztime=TIME
 2260 IF zoomp<0 zoomp=power-1
 2270 IF zoomp>power-1 zoomp=0
 2280 val1=2^zoomp
 2290 val2=(2^power-val1)*4
 2300 val3=4*2^zoomp-4
 2310 IF x<0 x=0
 2320 IF x>val2 x=val2
 2330 IF y<0 y=0
 2340 IF y>val2 y=val2
 2350 MOUSE TO x,y
 2360 IF zoomp>0 THEN RECTANGLE x,y,val3,val3 ELSE POINT x,y
 2370 WAIT
 2380 IF zoomp>0 THENRECTANGLE x,y,val3,val3 ELSE POINT x,y
 2390UNTIL b=4
 2400MOVE x,y
 2410MOVE x+val3,y+val3
 2420SYS "OS_SpriteOp",&110,spr,"sprite",,x,y,x+val3,y+val3
 2430scale!0=2^(power-zoomp)
 2440scale!4=2^(power-zoomp)
 2450scale!8=1
 2460scale!12=1
 2470SYS "OS_SpriteOp",&134,spr,"sprite",0,0,0,scale,colour
 2480A%=base
 2490B%=blend
 2500C%=64
 2510D%=0
 2520CALL move
 2530ENDPROC

�     >Blend
� By  Chris Rijk
� For 32-bit machines
(� (c) BAU November 1993
2:
<� 13
F�
P
� 3,63
Zpower=8
dzoomp=power-7
n3� scale 16,colour 256,tst(4),dir(4),spr 80*1024
x!spr=80*1024
�spr!4=0
�spr!8=16
�
spr!12=16
�� c=0 � 255
� colour?c=c
��
�
�assemble
�� a=0 � 255
� col=a<<24 � a*&010101
�( � b=base+a*320 � base+a*320+252 � 4
�  !b=col
� �
��
�

 �zoom
 � F%=power-zoomp � 1 �-1
"  !powerof2=F%
,  � blendy
6  A%=blend
@
  B%=base
J
  C%=0
T  D%=64
^  � move
h �
r� �
|�
�:
�� �assemble
�ș 6,112,1 � ,,base
�x1=0:x2=1:xstep=5:y1=2:y2=3
�ystep=4:step=5:use=6:off=7
�table=8:col=9:poi=9:range=9
�min=10:max=11
�rnd1=11:rnd2=12:rnd3=14
�sp=13:link=14:pc=15
�'� program &400+8*2^(power-5)+&20000
�� pass=0 � 2 � 2
�P%=program
�
[OPT pass
.safe   EQUD    0
        EQUD    0
.rand   EQUD    �
&        EQUD    �
0
.powerof2
:        EQUD    0
D
N.blendy
X         STMFD   (sp)!,{link}
b        ADR     table,blend
l        MOV     r0,#1
v$        MOV     step,r0,LSL step
�        MOV     use,#1
�$        RSB     x1,step,#2^power
�         MOV     r12,#2^power
�        MUL     y1,x1,r12
�        MOV     y2,y1
�"        MUL     ystep,r12,step
�.y_loop �R     use,use,#8
�        CMP     y2,#0
�        �REQ   use,use,#4
�        MOV     x2,x1
�.x_loop CMP     x2,#0
�        �REQ   use,use,#2
�        �l
        BIC     use,use,#8
        SUBS    x2,x2,xstep
        BPL     x_loop
         MOV     use,#0
*        SUBS    y2,y2,ystep
4        BPL     y_loop
>        LDMFD   (sp)!,{pc}
H
R .choose STMFD   (sp)!,{link}
\'        ADD     max,max,step,LSR #1
f'        SUB     min,min,step,LSR #1
p        CMP     min,max
z        �Q   col,min
�        BEQ     plot
�!        SUBS    range,max,min
�"        RSBLT   range,range,#0
�        MOVLT   min,max
�"        ADD     range,range,#2
�(        ADD     min,min,range,LSR #2
�&        MOV     range,range,LSR #1
�        �rndmod
�         ADD     col,min,rnd1
�        CMP     col,#255
�        MOVGT   col,#255
�        CMP     col,#0
�        MOVLT   col,#0
#.plot   STRB    col,[table,off]
        LDMFD   (sp)!,{pc}

$.move   MOV     r8,r0
.        MOV     r9,r1
8        MOV     r10,r2
B        MOV     r11,r3
L         MOV     r12,#2^power
V.move_loop
`]
j� count=1 � 2^power/32
t [OPT pass
~        LDMIA   r8!,{r0-R7}
�        STMIA   r9!,{r0-R7}
� ]
��
�
[OPT pass
�        ADD     r9,r9,r11
�        ADD     r8,r8,r10
�        SUBS    r12,r12,#1
�        BGT     move_loop
�        MOV     pc,link
�
�
.blend
�]
�

�
:
� �l
(
[OPT pass
2        ADD     off,x1,y1
<        SUB     off,off,x2
F        SUB     off,off,y2
P         �ways(2,1,1,2,2,0,8)
Z!        �ways(12,0,1,4,4,8,8)
d"        �ways(2,0,1,0,8,-1,-1)
n        CMP     use,#0
x        BNE     jmp
�'        ADD     poi,off,step,LSR #1
�(        SUB     poi,poi,ystep,LSR #1
�#        LDRB    r12,[table,poi]
�!        ADD     poi,poi,ystep
�#        LDRB    r14,[table,poi]
�        ADD     r12,r12,r14
�"        MOV     r12,r12,LSR #1
�        �cols(12)
�!        SUB     poi,poi,xstep
�#        LDRB    r12,[table,poi]
�        ADD     r12,r12,r14
�"        MOV     r12,r12,LSR #1
�        �cols(12)
.jmp    BL      choose
	]:=""
:
"
� �rndmod
,
[OPT pass
6        LDR     rnd1,rand
@        LDR     rnd2,rand+4
J$        TST     rnd2,rnd2,LSR #1
T!        MOVS    rnd3,rnd1,RRX
^"        ADC     rnd2,rnd2,rnd2
h(        �     rnd3,rnd3,rnd1,LSL #12
r(        �     rnd1,rnd3,rnd3,LSR #20
|        STR     rnd1,rand
�        STR     rnd2,rand+4
�         LDR     r14,powerof2
�        MVN     r12,#0
�)        BIC     rnd1,rnd1,r12,LSL r14
�        CMP     rnd1,range
�        BLT     end
�
.mod_loop
�#        SUBS    rnd1,rnd1,range
�        BGE     mod_loop
�#        ADD     rnd1,rnd1,range
�.end
�]
�=0
:
:� �ways(dir,tst(1),dir(1),tst(2),dir(2),tst(3),dir(3))

[OPT pass
&        MVN     min,#0
0        MOV     max,#256
:]
D5� (dir � 2)=2 [OPT pass:ADD off,off,step,LSR #1:]
N6� (dir � 4)=4 [OPT pass:ADD off,off,ystep,LSR #1:]
X5� (dir � 8)=8 [OPT pass:SUB off,off,step,LSR #1:]
b
� c=1 � 3
l � tst(c)>0 �
v  [OPT pass
�        TST     use,#tst(c)
�        ADDNE   pc,pc,#20
�  ]
� �
� Ȏ dir(c) �
�.  � 1:[OPT pass:SUB poi,off,ystep,LSR #1:]
�-  � 2:[OPT pass:ADD poi,off,step,LSR #1:]
�.  � 4:[OPT pass:ADD poi,off,ystep,LSR #1:]
�-  � 8:[OPT pass:SUB poi,off,step,LSR #1:]
� �
� [OPT pass
�"       LDRB    col,[table,poi]
�       �cols(col)
 ]
� tst(c+1)<0 c=4
�
 !� c<5 � [OPT pass:BL choose:]
*=0
4:
>� �cols(colr)
H
[OPT pass
R        CMP     min,colr
\        MOVLT   min,colr
f        CMP     max,colr
p        MOVGT   max,colr
z	]:=""
�
�� �zoom
�*FX 15,0
�ztime=�
��
�
 ȗ x,y,b
�( � b=2 � �-ztime>10 zoomp+=1:ztime=�
�( � b=1 � �-ztime>10 zoomp-=1:ztime=�
� � zoomp<0 zoomp=power-1
� � zoomp>power-1 zoomp=0
� val1=2^zoomp
� val2=(2^power-val1)*4
� val3=4*2^zoomp-4
	 � x<0 x=0
	 � x>val2 x=val2
	 � y<0 y=0
	$ � y>val2 y=val2
	.
 ȗ � x,y
	8* � zoomp>0 � ȓ x,y,val3,val3 � Ȓ x,y
	B Ȗ
	L) � zoomp>0 �ȓ x,y,val3,val3 � Ȓ x,y
	V	� b=4
	`	� x,y
	j� x+val3,y+val3
	t9ș "OS_SpriteOp",&110,spr,"sprite",,x,y,x+val3,y+val3
	~scale!0=2^(power-zoomp)
	�scale!4=2^(power-zoomp)
	�
scale!8=1
	�scale!12=1
	�9ș "OS_SpriteOp",&134,spr,"sprite",0,0,0,scale,colour
	�A%=base
	�B%=blend
	�	C%=64
	�D%=0
	�
� move
	��
�
00000000  0d 00 0a 10 f4 20 20 20  20 20 3e 42 6c 65 6e 64  |.....     >Blend|
00000010  0d 00 14 14 f4 20 42 79  20 20 43 68 72 69 73 20  |..... By  Chris |
00000020  52 69 6a 6b 0d 00 1e 19  f4 20 46 6f 72 20 33 32  |Rijk..... For 32|
00000030  2d 62 69 74 20 6d 61 63  68 69 6e 65 73 0d 00 28  |-bit machines..(|
00000040  1b f4 20 28 63 29 20 42  41 55 20 4e 6f 76 65 6d  |.. (c) BAU Novem|
00000050  62 65 72 20 31 39 39 33  0d 00 32 05 3a 0d 00 3c  |ber 1993..2.:..<|
00000060  08 eb 20 31 33 0d 00 46  05 87 0d 00 50 0a e6 20  |.. 13..F....P.. |
00000070  33 2c 36 33 0d 00 5a 0b  70 6f 77 65 72 3d 38 0d  |3,63..Z.power=8.|
00000080  00 64 11 7a 6f 6f 6d 70  3d 70 6f 77 65 72 2d 37  |.d.zoomp=power-7|
00000090  0d 00 6e 33 de 20 73 63  61 6c 65 20 31 36 2c 63  |..n3. scale 16,c|
000000a0  6f 6c 6f 75 72 20 32 35  36 2c 74 73 74 28 34 29  |olour 256,tst(4)|
000000b0  2c 64 69 72 28 34 29 2c  73 70 72 20 38 30 2a 31  |,dir(4),spr 80*1|
000000c0  30 32 34 0d 00 78 10 21  73 70 72 3d 38 30 2a 31  |024..x.!spr=80*1|
000000d0  30 32 34 0d 00 82 0b 73  70 72 21 34 3d 30 0d 00  |024....spr!4=0..|
000000e0  8c 0c 73 70 72 21 38 3d  31 36 0d 00 96 0d 73 70  |..spr!8=16....sp|
000000f0  72 21 31 32 3d 31 36 0d  00 a0 0f e3 20 63 3d 30  |r!12=16..... c=0|
00000100  20 b8 20 32 35 35 0d 00  aa 0f 20 63 6f 6c 6f 75  | . 255.... colou|
00000110  72 3f 63 3d 63 0d 00 b4  05 ed 0d 00 be 0d f2 61  |r?c=c..........a|
00000120  73 73 65 6d 62 6c 65 0d  00 c8 0f e3 20 61 3d 30  |ssemble..... a=0|
00000130  20 b8 20 32 35 35 0d 00  d2 1a 20 63 6f 6c 3d 61  | . 255.... col=a|
00000140  3c 3c 32 34 20 84 20 61  2a 26 30 31 30 31 30 31  |<<24 . a*&010101|
00000150  0d 00 dc 28 20 e3 20 62  3d 62 61 73 65 2b 61 2a  |...( . b=base+a*|
00000160  33 32 30 20 b8 20 62 61  73 65 2b 61 2a 33 32 30  |320 . base+a*320|
00000170  2b 32 35 32 20 88 20 34  0d 00 e6 0c 20 20 21 62  |+252 . 4....  !b|
00000180  3d 63 6f 6c 0d 00 f0 06  20 ed 0d 00 fa 05 ed 0d  |=col.... .......|
00000190  01 04 05 f5 0d 01 0e 0a  20 f2 7a 6f 6f 6d 0d 01  |........ .zoom..|
000001a0  18 1d 20 e3 20 46 25 3d  70 6f 77 65 72 2d 7a 6f  |.. . F%=power-zo|
000001b0  6f 6d 70 20 b8 20 31 20  88 2d 31 0d 01 22 12 20  |omp . 1 .-1..". |
000001c0  20 21 70 6f 77 65 72 6f  66 32 3d 46 25 0d 01 2c  | !powerof2=F%..,|
000001d0  0e 20 20 d6 20 62 6c 65  6e 64 79 0d 01 36 0e 20  |.  . blendy..6. |
000001e0  20 41 25 3d 62 6c 65 6e  64 0d 01 40 0d 20 20 42  | A%=blend..@.  B|
000001f0  25 3d 62 61 73 65 0d 01  4a 0a 20 20 43 25 3d 30  |%=base..J.  C%=0|
00000200  0d 01 54 0b 20 20 44 25  3d 36 34 0d 01 5e 0c 20  |..T.  D%=64..^. |
00000210  20 d6 20 6d 6f 76 65 0d  01 68 06 20 ed 0d 01 72  | . move..h. ...r|
00000220  07 fd 20 a3 0d 01 7c 05  e0 0d 01 86 05 3a 0d 01  |.. ...|......:..|
00000230  90 0f dd 20 f2 61 73 73  65 6d 62 6c 65 0d 01 9a  |... .assemble...|
00000240  17 c8 99 20 36 2c 31 31  32 2c 31 20 b8 20 2c 2c  |... 6,112,1 . ,,|
00000250  62 61 73 65 0d 01 a4 1f  78 31 3d 30 3a 78 32 3d  |base....x1=0:x2=|
00000260  31 3a 78 73 74 65 70 3d  35 3a 79 31 3d 32 3a 79  |1:xstep=5:y1=2:y|
00000270  32 3d 33 0d 01 ae 1e 79  73 74 65 70 3d 34 3a 73  |2=3....ystep=4:s|
00000280  74 65 70 3d 35 3a 75 73  65 3d 36 3a 6f 66 66 3d  |tep=5:use=6:off=|
00000290  37 0d 01 b8 1f 74 61 62  6c 65 3d 38 3a 63 6f 6c  |7....table=8:col|
000002a0  3d 39 3a 70 6f 69 3d 39  3a 72 61 6e 67 65 3d 39  |=9:poi=9:range=9|
000002b0  0d 01 c2 11 6d 69 6e 3d  31 30 3a 6d 61 78 3d 31  |....min=10:max=1|
000002c0  31 0d 01 cc 1b 72 6e 64  31 3d 31 31 3a 72 6e 64  |1....rnd1=11:rnd|
000002d0  32 3d 31 32 3a 72 6e 64  33 3d 31 34 0d 01 d6 17  |2=12:rnd3=14....|
000002e0  73 70 3d 31 33 3a 6c 69  6e 6b 3d 31 34 3a 70 63  |sp=13:link=14:pc|
000002f0  3d 31 35 0d 01 e0 27 de  20 70 72 6f 67 72 61 6d  |=15...'. program|
00000300  20 26 34 30 30 2b 38 2a  32 5e 28 70 6f 77 65 72  | &400+8*2^(power|
00000310  2d 35 29 2b 26 32 30 30  30 30 0d 01 ea 14 e3 20  |-5)+&20000..... |
00000320  70 61 73 73 3d 30 20 b8  20 32 20 88 20 32 0d 01  |pass=0 . 2 . 2..|
00000330  f4 0e 50 25 3d 70 72 6f  67 72 61 6d 0d 01 fe 0d  |..P%=program....|
00000340  5b 4f 50 54 20 70 61 73  73 0d 02 08 15 2e 73 61  |[OPT pass.....sa|
00000350  66 65 20 20 20 45 51 55  44 20 20 20 20 30 0d 02  |fe   EQUD    0..|
00000360  12 15 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |..        EQUD  |
00000370  20 20 30 0d 02 1c 15 2e  72 61 6e 64 20 20 20 45  |  0.....rand   E|
00000380  51 55 44 20 20 20 20 b3  0d 02 26 15 20 20 20 20  |QUD    ...&.    |
00000390  20 20 20 20 45 51 55 44  20 20 20 20 b3 0d 02 30  |    EQUD    ...0|
000003a0  0d 2e 70 6f 77 65 72 6f  66 32 0d 02 3a 15 20 20  |..powerof2..:.  |
000003b0  20 20 20 20 20 20 45 51  55 44 20 20 20 20 30 0d  |      EQUD    0.|
000003c0  02 44 04 0d 02 4e 0b 2e  62 6c 65 6e 64 79 0d 02  |.D...N..blendy..|
000003d0  58 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |X         STMFD |
000003e0  20 20 28 73 70 29 21 2c  7b 6c 69 6e 6b 7d 0d 02  |  (sp)!,{link}..|
000003f0  62 1f 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |b.        ADR   |
00000400  20 20 74 61 62 6c 65 2c  62 6c 65 6e 64 0d 02 6c  |  table,blend..l|
00000410  19 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |.        MOV    |
00000420  20 72 30 2c 23 31 0d 02  76 24 20 20 20 20 20 20  | r0,#1..v$      |
00000430  20 20 4d 4f 56 20 20 20  20 20 73 74 65 70 2c 72  |  MOV     step,r|
00000440  30 2c 4c 53 4c 20 73 74  65 70 0d 02 80 1a 20 20  |0,LSL step....  |
00000450  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 75 73  |      MOV     us|
00000460  65 2c 23 31 0d 02 8a 24  20 20 20 20 20 20 20 20  |e,#1...$        |
00000470  52 53 42 20 20 20 20 20  78 31 2c 73 74 65 70 2c  |RSB     x1,step,|
00000480  23 32 5e 70 6f 77 65 72  0d 02 94 20 20 20 20 20  |#2^power...     |
00000490  20 20 20 20 4d 4f 56 20  20 20 20 20 72 31 32 2c  |    MOV     r12,|
000004a0  23 32 5e 70 6f 77 65 72  0d 02 9e 1d 20 20 20 20  |#2^power....    |
000004b0  20 20 20 20 4d 55 4c 20  20 20 20 20 79 31 2c 78  |    MUL     y1,x|
000004c0  31 2c 72 31 32 0d 02 a8  19 20 20 20 20 20 20 20  |1,r12....       |
000004d0  20 4d 4f 56 20 20 20 20  20 79 32 2c 79 31 0d 02  | MOV     y2,y1..|
000004e0  b2 22 20 20 20 20 20 20  20 20 4d 55 4c 20 20 20  |."        MUL   |
000004f0  20 20 79 73 74 65 70 2c  72 31 32 2c 73 74 65 70  |  ystep,r12,step|
00000500  0d 02 bc 1d 2e 79 5f 6c  6f 6f 70 20 84 52 20 20  |.....y_loop .R  |
00000510  20 20 20 75 73 65 2c 75  73 65 2c 23 38 0d 02 c6  |   use,use,#8...|
00000520  19 20 20 20 20 20 20 20  20 43 4d 50 20 20 20 20  |.        CMP    |
00000530  20 79 32 2c 23 30 0d 02  d0 1d 20 20 20 20 20 20  | y2,#0....      |
00000540  20 20 84 52 45 51 20 20  20 75 73 65 2c 75 73 65  |  .REQ   use,use|
00000550  2c 23 34 0d 02 da 19 20  20 20 20 20 20 20 20 4d  |,#4....        M|
00000560  4f 56 20 20 20 20 20 78  32 2c 78 31 0d 02 e4 19  |OV     x2,x1....|
00000570  2e 78 5f 6c 6f 6f 70 20  43 4d 50 20 20 20 20 20  |.x_loop CMP     |
00000580  78 32 2c 23 30 0d 02 ee  1d 20 20 20 20 20 20 20  |x2,#0....       |
00000590  20 84 52 45 51 20 20 20  75 73 65 2c 75 73 65 2c  | .REQ   use,use,|
000005a0  23 32 0d 02 f8 0e 20 20  20 20 20 20 20 20 a4 6c  |#2....        .l|
000005b0  0d 03 02 1e 20 20 20 20  20 20 20 20 42 49 43 20  |....        BIC |
000005c0  20 20 20 20 75 73 65 2c  75 73 65 2c 23 38 0d 03  |    use,use,#8..|
000005d0  0c 1f 20 20 20 20 20 20  20 20 53 55 42 53 20 20  |..        SUBS  |
000005e0  20 20 78 32 2c 78 32 2c  78 73 74 65 70 0d 03 16  |  x2,x2,xstep...|
000005f0  1a 20 20 20 20 20 20 20  20 42 50 4c 20 20 20 20  |.        BPL    |
00000600  20 78 5f 6c 6f 6f 70 0d  03 20 1a 20 20 20 20 20  | x_loop.. .     |
00000610  20 20 20 4d 4f 56 20 20  20 20 20 75 73 65 2c 23  |   MOV     use,#|
00000620  30 0d 03 2a 1f 20 20 20  20 20 20 20 20 53 55 42  |0..*.        SUB|
00000630  53 20 20 20 20 79 32 2c  79 32 2c 79 73 74 65 70  |S    y2,y2,ystep|
00000640  0d 03 34 1a 20 20 20 20  20 20 20 20 42 50 4c 20  |..4.        BPL |
00000650  20 20 20 20 79 5f 6c 6f  6f 70 0d 03 3e 1e 20 20  |    y_loop..>.  |
00000660  20 20 20 20 20 20 4c 44  4d 46 44 20 20 20 28 73  |      LDMFD   (s|
00000670  70 29 21 2c 7b 70 63 7d  0d 03 48 04 0d 03 52 20  |p)!,{pc}..H...R |
00000680  2e 63 68 6f 6f 73 65 20  53 54 4d 46 44 20 20 20  |.choose STMFD   |
00000690  28 73 70 29 21 2c 7b 6c  69 6e 6b 7d 0d 03 5c 27  |(sp)!,{link}..\'|
000006a0  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
000006b0  6d 61 78 2c 6d 61 78 2c  73 74 65 70 2c 4c 53 52  |max,max,step,LSR|
000006c0  20 23 31 0d 03 66 27 20  20 20 20 20 20 20 20 53  | #1..f'        S|
000006d0  55 42 20 20 20 20 20 6d  69 6e 2c 6d 69 6e 2c 73  |UB     min,min,s|
000006e0  74 65 70 2c 4c 53 52 20  23 31 0d 03 70 1b 20 20  |tep,LSR #1..p.  |
000006f0  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 6d 69  |      CMP     mi|
00000700  6e 2c 6d 61 78 0d 03 7a  18 20 20 20 20 20 20 20  |n,max..z.       |
00000710  20 ec 51 20 20 20 63 6f  6c 2c 6d 69 6e 0d 03 84  | .Q   col,min...|
00000720  18 20 20 20 20 20 20 20  20 42 45 51 20 20 20 20  |.        BEQ    |
00000730  20 70 6c 6f 74 0d 03 8e  21 20 20 20 20 20 20 20  | plot...!       |
00000740  20 53 55 42 53 20 20 20  20 72 61 6e 67 65 2c 6d  | SUBS    range,m|
00000750  61 78 2c 6d 69 6e 0d 03  98 22 20 20 20 20 20 20  |ax,min..."      |
00000760  20 20 52 53 42 4c 54 20  20 20 72 61 6e 67 65 2c  |  RSBLT   range,|
00000770  72 61 6e 67 65 2c 23 30  0d 03 a2 1b 20 20 20 20  |range,#0....    |
00000780  20 20 20 20 4d 4f 56 4c  54 20 20 20 6d 69 6e 2c  |    MOVLT   min,|
00000790  6d 61 78 0d 03 ac 22 20  20 20 20 20 20 20 20 41  |max..."        A|
000007a0  44 44 20 20 20 20 20 72  61 6e 67 65 2c 72 61 6e  |DD     range,ran|
000007b0  67 65 2c 23 32 0d 03 b6  28 20 20 20 20 20 20 20  |ge,#2...(       |
000007c0  20 41 44 44 20 20 20 20  20 6d 69 6e 2c 6d 69 6e  | ADD     min,min|
000007d0  2c 72 61 6e 67 65 2c 4c  53 52 20 23 32 0d 03 c0  |,range,LSR #2...|
000007e0  26 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |&        MOV    |
000007f0  20 72 61 6e 67 65 2c 72  61 6e 67 65 2c 4c 53 52  | range,range,LSR|
00000800  20 23 31 0d 03 ca 13 20  20 20 20 20 20 20 20 a4  | #1....        .|
00000810  72 6e 64 6d 6f 64 0d 03  d4 20 20 20 20 20 20 20  |rndmod...       |
00000820  20 20 41 44 44 20 20 20  20 20 63 6f 6c 2c 6d 69  |  ADD     col,mi|
00000830  6e 2c 72 6e 64 31 0d 03  de 1c 20 20 20 20 20 20  |n,rnd1....      |
00000840  20 20 43 4d 50 20 20 20  20 20 63 6f 6c 2c 23 32  |  CMP     col,#2|
00000850  35 35 0d 03 e8 1c 20 20  20 20 20 20 20 20 4d 4f  |55....        MO|
00000860  56 47 54 20 20 20 63 6f  6c 2c 23 32 35 35 0d 03  |VGT   col,#255..|
00000870  f2 1a 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |..        CMP   |
00000880  20 20 63 6f 6c 2c 23 30  0d 03 fc 1a 20 20 20 20  |  col,#0....    |
00000890  20 20 20 20 4d 4f 56 4c  54 20 20 20 63 6f 6c 2c  |    MOVLT   col,|
000008a0  23 30 0d 04 06 23 2e 70  6c 6f 74 20 20 20 53 54  |#0...#.plot   ST|
000008b0  52 42 20 20 20 20 63 6f  6c 2c 5b 74 61 62 6c 65  |RB    col,[table|
000008c0  2c 6f 66 66 5d 0d 04 10  1e 20 20 20 20 20 20 20  |,off]....       |
000008d0  20 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | LDMFD   (sp)!,{|
000008e0  70 63 7d 0d 04 1a 04 0d  04 24 19 2e 6d 6f 76 65  |pc}......$..move|
000008f0  20 20 20 4d 4f 56 20 20  20 20 20 72 38 2c 72 30  |   MOV     r8,r0|
00000900  0d 04 2e 19 20 20 20 20  20 20 20 20 4d 4f 56 20  |....        MOV |
00000910  20 20 20 20 72 39 2c 72  31 0d 04 38 1a 20 20 20  |    r9,r1..8.   |
00000920  20 20 20 20 20 4d 4f 56  20 20 20 20 20 72 31 30  |     MOV     r10|
00000930  2c 72 32 0d 04 42 1a 20  20 20 20 20 20 20 20 4d  |,r2..B.        M|
00000940  4f 56 20 20 20 20 20 72  31 31 2c 72 33 0d 04 4c  |OV     r11,r3..L|
00000950  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
00000960  20 72 31 32 2c 23 32 5e  70 6f 77 65 72 0d 04 56  | r12,#2^power..V|
00000970  0e 2e 6d 6f 76 65 5f 6c  6f 6f 70 0d 04 60 05 5d  |..move_loop..`.]|
00000980  0d 04 6a 1a e3 20 63 6f  75 6e 74 3d 31 20 b8 20  |..j.. count=1 . |
00000990  32 5e 70 6f 77 65 72 2f  33 32 0d 04 74 0e 20 5b  |2^power/32..t. [|
000009a0  4f 50 54 20 70 61 73 73  0d 04 7e 1f 20 20 20 20  |OPT pass..~.    |
000009b0  20 20 20 20 4c 44 4d 49  41 20 20 20 72 38 21 2c  |    LDMIA   r8!,|
000009c0  7b 72 30 2d 52 37 7d 0d  04 88 1f 20 20 20 20 20  |{r0-R7}....     |
000009d0  20 20 20 53 54 4d 49 41  20 20 20 72 39 21 2c 7b  |   STMIA   r9!,{|
000009e0  72 30 2d 52 37 7d 0d 04  92 06 20 5d 0d 04 9c 05  |r0-R7}.... ]....|
000009f0  ed 0d 04 a6 0d 5b 4f 50  54 20 70 61 73 73 0d 04  |.....[OPT pass..|
00000a00  b0 1d 20 20 20 20 20 20  20 20 41 44 44 20 20 20  |..        ADD   |
00000a10  20 20 72 39 2c 72 39 2c  72 31 31 0d 04 ba 1d 20  |  r9,r9,r11.... |
00000a20  20 20 20 20 20 20 20 41  44 44 20 20 20 20 20 72  |       ADD     r|
00000a30  38 2c 72 38 2c 72 31 30  0d 04 c4 1e 20 20 20 20  |8,r8,r10....    |
00000a40  20 20 20 20 53 55 42 53  20 20 20 20 72 31 32 2c  |    SUBS    r12,|
00000a50  72 31 32 2c 23 31 0d 04  ce 1d 20 20 20 20 20 20  |r12,#1....      |
00000a60  20 20 42 47 54 20 20 20  20 20 6d 6f 76 65 5f 6c  |  BGT     move_l|
00000a70  6f 6f 70 0d 04 d8 1b 20  20 20 20 20 20 20 20 4d  |oop....        M|
00000a80  4f 56 20 20 20 20 20 70  63 2c 6c 69 6e 6b 0d 04  |OV     pc,link..|
00000a90  e2 04 0d 04 ec 0a 2e 62  6c 65 6e 64 0d 04 f6 05  |.......blend....|
00000aa0  5d 0d 05 00 05 ed 0d 05  0a 05 e1 0d 05 14 05 3a  |]..............:|
00000ab0  0d 05 1e 08 dd 20 a4 6c  0d 05 28 0d 5b 4f 50 54  |..... .l..(.[OPT|
00000ac0  20 70 61 73 73 0d 05 32  1d 20 20 20 20 20 20 20  | pass..2.       |
00000ad0  20 41 44 44 20 20 20 20  20 6f 66 66 2c 78 31 2c  | ADD     off,x1,|
00000ae0  79 31 0d 05 3c 1e 20 20  20 20 20 20 20 20 53 55  |y1..<.        SU|
00000af0  42 20 20 20 20 20 6f 66  66 2c 6f 66 66 2c 78 32  |B     off,off,x2|
00000b00  0d 05 46 1e 20 20 20 20  20 20 20 20 53 55 42 20  |..F.        SUB |
00000b10  20 20 20 20 6f 66 66 2c  6f 66 66 2c 79 32 0d 05  |    off,off,y2..|
00000b20  50 20 20 20 20 20 20 20  20 20 a4 77 61 79 73 28  |P         .ways(|
00000b30  32 2c 31 2c 31 2c 32 2c  32 2c 30 2c 38 29 0d 05  |2,1,1,2,2,0,8)..|
00000b40  5a 21 20 20 20 20 20 20  20 20 a4 77 61 79 73 28  |Z!        .ways(|
00000b50  31 32 2c 30 2c 31 2c 34  2c 34 2c 38 2c 38 29 0d  |12,0,1,4,4,8,8).|
00000b60  05 64 22 20 20 20 20 20  20 20 20 a4 77 61 79 73  |.d"        .ways|
00000b70  28 32 2c 30 2c 31 2c 30  2c 38 2c 2d 31 2c 2d 31  |(2,0,1,0,8,-1,-1|
00000b80  29 0d 05 6e 1a 20 20 20  20 20 20 20 20 43 4d 50  |)..n.        CMP|
00000b90  20 20 20 20 20 75 73 65  2c 23 30 0d 05 78 17 20  |     use,#0..x. |
00000ba0  20 20 20 20 20 20 20 42  4e 45 20 20 20 20 20 6a  |       BNE     j|
00000bb0  6d 70 0d 05 82 27 20 20  20 20 20 20 20 20 41 44  |mp...'        AD|
00000bc0  44 20 20 20 20 20 70 6f  69 2c 6f 66 66 2c 73 74  |D     poi,off,st|
00000bd0  65 70 2c 4c 53 52 20 23  31 0d 05 8c 28 20 20 20  |ep,LSR #1...(   |
00000be0  20 20 20 20 20 53 55 42  20 20 20 20 20 70 6f 69  |     SUB     poi|
00000bf0  2c 70 6f 69 2c 79 73 74  65 70 2c 4c 53 52 20 23  |,poi,ystep,LSR #|
00000c00  31 0d 05 96 23 20 20 20  20 20 20 20 20 4c 44 52  |1...#        LDR|
00000c10  42 20 20 20 20 72 31 32  2c 5b 74 61 62 6c 65 2c  |B    r12,[table,|
00000c20  70 6f 69 5d 0d 05 a0 21  20 20 20 20 20 20 20 20  |poi]...!        |
00000c30  41 44 44 20 20 20 20 20  70 6f 69 2c 70 6f 69 2c  |ADD     poi,poi,|
00000c40  79 73 74 65 70 0d 05 aa  23 20 20 20 20 20 20 20  |ystep...#       |
00000c50  20 4c 44 52 42 20 20 20  20 72 31 34 2c 5b 74 61  | LDRB    r14,[ta|
00000c60  62 6c 65 2c 70 6f 69 5d  0d 05 b4 1f 20 20 20 20  |ble,poi]....    |
00000c70  20 20 20 20 41 44 44 20  20 20 20 20 72 31 32 2c  |    ADD     r12,|
00000c80  72 31 32 2c 72 31 34 0d  05 be 22 20 20 20 20 20  |r12,r14..."     |
00000c90  20 20 20 4d 4f 56 20 20  20 20 20 72 31 32 2c 72  |   MOV     r12,r|
00000ca0  31 32 2c 4c 53 52 20 23  31 0d 05 c8 15 20 20 20  |12,LSR #1....   |
00000cb0  20 20 20 20 20 a4 63 6f  6c 73 28 31 32 29 0d 05  |     .cols(12)..|
00000cc0  d2 21 20 20 20 20 20 20  20 20 53 55 42 20 20 20  |.!        SUB   |
00000cd0  20 20 70 6f 69 2c 70 6f  69 2c 78 73 74 65 70 0d  |  poi,poi,xstep.|
00000ce0  05 dc 23 20 20 20 20 20  20 20 20 4c 44 52 42 20  |..#        LDRB |
00000cf0  20 20 20 72 31 32 2c 5b  74 61 62 6c 65 2c 70 6f  |   r12,[table,po|
00000d00  69 5d 0d 05 e6 1f 20 20  20 20 20 20 20 20 41 44  |i]....        AD|
00000d10  44 20 20 20 20 20 72 31  32 2c 72 31 32 2c 72 31  |D     r12,r12,r1|
00000d20  34 0d 05 f0 22 20 20 20  20 20 20 20 20 4d 4f 56  |4..."        MOV|
00000d30  20 20 20 20 20 72 31 32  2c 72 31 32 2c 4c 53 52  |     r12,r12,LSR|
00000d40  20 23 31 0d 05 fa 15 20  20 20 20 20 20 20 20 a4  | #1....        .|
00000d50  63 6f 6c 73 28 31 32 29  0d 06 04 1a 2e 6a 6d 70  |cols(12).....jmp|
00000d60  20 20 20 20 42 4c 20 20  20 20 20 20 63 68 6f 6f  |    BL      choo|
00000d70  73 65 0d 06 0e 09 5d 3a  3d 22 22 0d 06 18 05 3a  |se....]:=""....:|
00000d80  0d 06 22 0d dd 20 a4 72  6e 64 6d 6f 64 0d 06 2c  |..".. .rndmod..,|
00000d90  0d 5b 4f 50 54 20 70 61  73 73 0d 06 36 1d 20 20  |.[OPT pass..6.  |
00000da0  20 20 20 20 20 20 4c 44  52 20 20 20 20 20 72 6e  |      LDR     rn|
00000db0  64 31 2c 72 61 6e 64 0d  06 40 1f 20 20 20 20 20  |d1,rand..@.     |
00000dc0  20 20 20 4c 44 52 20 20  20 20 20 72 6e 64 32 2c  |   LDR     rnd2,|
00000dd0  72 61 6e 64 2b 34 0d 06  4a 24 20 20 20 20 20 20  |rand+4..J$      |
00000de0  20 20 54 53 54 20 20 20  20 20 72 6e 64 32 2c 72  |  TST     rnd2,r|
00000df0  6e 64 32 2c 4c 53 52 20  23 31 0d 06 54 21 20 20  |nd2,LSR #1..T!  |
00000e00  20 20 20 20 20 20 4d 4f  56 53 20 20 20 20 72 6e  |      MOVS    rn|
00000e10  64 33 2c 72 6e 64 31 2c  52 52 58 0d 06 5e 22 20  |d3,rnd1,RRX..^" |
00000e20  20 20 20 20 20 20 20 41  44 43 20 20 20 20 20 72  |       ADC     r|
00000e30  6e 64 32 2c 72 6e 64 32  2c 72 6e 64 32 0d 06 68  |nd2,rnd2,rnd2..h|
00000e40  28 20 20 20 20 20 20 20  20 82 20 20 20 20 20 72  |(        .     r|
00000e50  6e 64 33 2c 72 6e 64 33  2c 72 6e 64 31 2c 4c 53  |nd3,rnd3,rnd1,LS|
00000e60  4c 20 23 31 32 0d 06 72  28 20 20 20 20 20 20 20  |L #12..r(       |
00000e70  20 82 20 20 20 20 20 72  6e 64 31 2c 72 6e 64 33  | .     rnd1,rnd3|
00000e80  2c 72 6e 64 33 2c 4c 53  52 20 23 32 30 0d 06 7c  |,rnd3,LSR #20..||
00000e90  1d 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |.        STR    |
00000ea0  20 72 6e 64 31 2c 72 61  6e 64 0d 06 86 1f 20 20  | rnd1,rand....  |
00000eb0  20 20 20 20 20 20 53 54  52 20 20 20 20 20 72 6e  |      STR     rn|
00000ec0  64 32 2c 72 61 6e 64 2b  34 0d 06 90 20 20 20 20  |d2,rand+4...    |
00000ed0  20 20 20 20 20 4c 44 52  20 20 20 20 20 72 31 34  |     LDR     r14|
00000ee0  2c 70 6f 77 65 72 6f 66  32 0d 06 9a 1a 20 20 20  |,powerof2....   |
00000ef0  20 20 20 20 20 4d 56 4e  20 20 20 20 20 72 31 32  |     MVN     r12|
00000f00  2c 23 30 0d 06 a4 29 20  20 20 20 20 20 20 20 42  |,#0...)        B|
00000f10  49 43 20 20 20 20 20 72  6e 64 31 2c 72 6e 64 31  |IC     rnd1,rnd1|
00000f20  2c 72 31 32 2c 4c 53 4c  20 72 31 34 0d 06 ae 1e  |,r12,LSL r14....|
00000f30  20 20 20 20 20 20 20 20  43 4d 50 20 20 20 20 20  |        CMP     |
00000f40  72 6e 64 31 2c 72 61 6e  67 65 0d 06 b8 17 20 20  |rnd1,range....  |
00000f50  20 20 20 20 20 20 42 4c  54 20 20 20 20 20 65 6e  |      BLT     en|
00000f60  64 0d 06 c2 0d 2e 6d 6f  64 5f 6c 6f 6f 70 0d 06  |d.....mod_loop..|
00000f70  cc 23 20 20 20 20 20 20  20 20 53 55 42 53 20 20  |.#        SUBS  |
00000f80  20 20 72 6e 64 31 2c 72  6e 64 31 2c 72 61 6e 67  |  rnd1,rnd1,rang|
00000f90  65 0d 06 d6 1c 20 20 20  20 20 20 20 20 42 47 45  |e....        BGE|
00000fa0  20 20 20 20 20 6d 6f 64  5f 6c 6f 6f 70 0d 06 e0  |     mod_loop...|
00000fb0  23 20 20 20 20 20 20 20  20 41 44 44 20 20 20 20  |#        ADD    |
00000fc0  20 72 6e 64 31 2c 72 6e  64 31 2c 72 61 6e 67 65  | rnd1,rnd1,range|
00000fd0  0d 06 ea 08 2e 65 6e 64  0d 06 f4 05 5d 0d 06 fe  |.....end....]...|
00000fe0  06 3d 30 0d 07 08 05 3a  0d 07 12 3a dd 20 a4 77  |.=0....:...:. .w|
00000ff0  61 79 73 28 64 69 72 2c  74 73 74 28 31 29 2c 64  |ays(dir,tst(1),d|
00001000  69 72 28 31 29 2c 74 73  74 28 32 29 2c 64 69 72  |ir(1),tst(2),dir|
00001010  28 32 29 2c 74 73 74 28  33 29 2c 64 69 72 28 33  |(2),tst(3),dir(3|
00001020  29 29 0d 07 1c 0d 5b 4f  50 54 20 70 61 73 73 0d  |))....[OPT pass.|
00001030  07 26 1a 20 20 20 20 20  20 20 20 4d 56 4e 20 20  |.&.        MVN  |
00001040  20 20 20 6d 69 6e 2c 23  30 0d 07 30 1c 20 20 20  |   min,#0..0.   |
00001050  20 20 20 20 20 4d 4f 56  20 20 20 20 20 6d 61 78  |     MOV     max|
00001060  2c 23 32 35 36 0d 07 3a  05 5d 0d 07 44 35 e7 20  |,#256..:.]..D5. |
00001070  28 64 69 72 20 80 20 32  29 3d 32 20 5b 4f 50 54  |(dir . 2)=2 [OPT|
00001080  20 70 61 73 73 3a 41 44  44 20 6f 66 66 2c 6f 66  | pass:ADD off,of|
00001090  66 2c 73 74 65 70 2c 4c  53 52 20 23 31 3a 5d 0d  |f,step,LSR #1:].|
000010a0  07 4e 36 e7 20 28 64 69  72 20 80 20 34 29 3d 34  |.N6. (dir . 4)=4|
000010b0  20 5b 4f 50 54 20 70 61  73 73 3a 41 44 44 20 6f  | [OPT pass:ADD o|
000010c0  66 66 2c 6f 66 66 2c 79  73 74 65 70 2c 4c 53 52  |ff,off,ystep,LSR|
000010d0  20 23 31 3a 5d 0d 07 58  35 e7 20 28 64 69 72 20  | #1:]..X5. (dir |
000010e0  80 20 38 29 3d 38 20 5b  4f 50 54 20 70 61 73 73  |. 8)=8 [OPT pass|
000010f0  3a 53 55 42 20 6f 66 66  2c 6f 66 66 2c 73 74 65  |:SUB off,off,ste|
00001100  70 2c 4c 53 52 20 23 31  3a 5d 0d 07 62 0d e3 20  |p,LSR #1:]..b.. |
00001110  63 3d 31 20 b8 20 33 0d  07 6c 11 20 e7 20 74 73  |c=1 . 3..l. . ts|
00001120  74 28 63 29 3e 30 20 8c  0d 07 76 0f 20 20 5b 4f  |t(c)>0 ...v.  [O|
00001130  50 54 20 70 61 73 73 0d  07 80 1f 20 20 20 20 20  |PT pass....     |
00001140  20 20 20 54 53 54 20 20  20 20 20 75 73 65 2c 23  |   TST     use,#|
00001150  74 73 74 28 63 29 0d 07  8a 1d 20 20 20 20 20 20  |tst(c)....      |
00001160  20 20 41 44 44 4e 45 20  20 20 70 63 2c 70 63 2c  |  ADDNE   pc,pc,|
00001170  23 32 30 0d 07 94 07 20  20 5d 0d 07 9e 06 20 cd  |#20....  ].... .|
00001180  0d 07 a8 10 20 c8 8e 20  64 69 72 28 63 29 20 ca  |.... .. dir(c) .|
00001190  0d 07 b2 2e 20 20 c9 20  31 3a 5b 4f 50 54 20 70  |....  . 1:[OPT p|
000011a0  61 73 73 3a 53 55 42 20  70 6f 69 2c 6f 66 66 2c  |ass:SUB poi,off,|
000011b0  79 73 74 65 70 2c 4c 53  52 20 23 31 3a 5d 0d 07  |ystep,LSR #1:]..|
000011c0  bc 2d 20 20 c9 20 32 3a  5b 4f 50 54 20 70 61 73  |.-  . 2:[OPT pas|
000011d0  73 3a 41 44 44 20 70 6f  69 2c 6f 66 66 2c 73 74  |s:ADD poi,off,st|
000011e0  65 70 2c 4c 53 52 20 23  31 3a 5d 0d 07 c6 2e 20  |ep,LSR #1:].... |
000011f0  20 c9 20 34 3a 5b 4f 50  54 20 70 61 73 73 3a 41  | . 4:[OPT pass:A|
00001200  44 44 20 70 6f 69 2c 6f  66 66 2c 79 73 74 65 70  |DD poi,off,ystep|
00001210  2c 4c 53 52 20 23 31 3a  5d 0d 07 d0 2d 20 20 c9  |,LSR #1:]...-  .|
00001220  20 38 3a 5b 4f 50 54 20  70 61 73 73 3a 53 55 42  | 8:[OPT pass:SUB|
00001230  20 70 6f 69 2c 6f 66 66  2c 73 74 65 70 2c 4c 53  | poi,off,step,LS|
00001240  52 20 23 31 3a 5d 0d 07  da 06 20 cb 0d 07 e4 0e  |R #1:].... .....|
00001250  20 5b 4f 50 54 20 70 61  73 73 0d 07 ee 22 20 20  | [OPT pass..."  |
00001260  20 20 20 20 20 4c 44 52  42 20 20 20 20 63 6f 6c  |     LDRB    col|
00001270  2c 5b 74 61 62 6c 65 2c  70 6f 69 5d 0d 07 f8 15  |,[table,poi]....|
00001280  20 20 20 20 20 20 20 a4  63 6f 6c 73 28 63 6f 6c  |       .cols(col|
00001290  29 0d 08 02 06 20 5d 0d  08 0c 14 e7 20 74 73 74  |).... ]..... tst|
000012a0  28 63 2b 31 29 3c 30 20  63 3d 34 0d 08 16 05 ed  |(c+1)<0 c=4.....|
000012b0  0d 08 20 21 e7 20 63 3c  35 20 8c 20 5b 4f 50 54  |.. !. c<5 . [OPT|
000012c0  20 70 61 73 73 3a 42 4c  20 63 68 6f 6f 73 65 3a  | pass:BL choose:|
000012d0  5d 0d 08 2a 06 3d 30 0d  08 34 05 3a 0d 08 3e 11  |]..*.=0..4.:..>.|
000012e0  dd 20 a4 63 6f 6c 73 28  63 6f 6c 72 29 0d 08 48  |. .cols(colr)..H|
000012f0  0d 5b 4f 50 54 20 70 61  73 73 0d 08 52 1c 20 20  |.[OPT pass..R.  |
00001300  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 6d 69  |      CMP     mi|
00001310  6e 2c 63 6f 6c 72 0d 08  5c 1c 20 20 20 20 20 20  |n,colr..\.      |
00001320  20 20 4d 4f 56 4c 54 20  20 20 6d 69 6e 2c 63 6f  |  MOVLT   min,co|
00001330  6c 72 0d 08 66 1c 20 20  20 20 20 20 20 20 43 4d  |lr..f.        CM|
00001340  50 20 20 20 20 20 6d 61  78 2c 63 6f 6c 72 0d 08  |P     max,colr..|
00001350  70 1c 20 20 20 20 20 20  20 20 4d 4f 56 47 54 20  |p.        MOVGT |
00001360  20 20 6d 61 78 2c 63 6f  6c 72 0d 08 7a 09 5d 3a  |  max,colr..z.]:|
00001370  3d 22 22 0d 08 84 04 0d  08 8e 0b dd 20 f2 7a 6f  |=""......... .zo|
00001380  6f 6d 0d 08 98 0c 2a 46  58 20 31 35 2c 30 0d 08  |om....*FX 15,0..|
00001390  a2 0b 7a 74 69 6d 65 3d  91 0d 08 ac 05 f5 0d 08  |..ztime=........|
000013a0  b6 0d 20 c8 97 20 78 2c  79 2c 62 0d 08 c0 28 20  |.. .. x,y,b...( |
000013b0  e7 20 62 3d 32 20 80 20  91 2d 7a 74 69 6d 65 3e  |. b=2 . .-ztime>|
000013c0  31 30 20 7a 6f 6f 6d 70  2b 3d 31 3a 7a 74 69 6d  |10 zoomp+=1:ztim|
000013d0  65 3d 91 0d 08 ca 28 20  e7 20 62 3d 31 20 80 20  |e=....( . b=1 . |
000013e0  91 2d 7a 74 69 6d 65 3e  31 30 20 7a 6f 6f 6d 70  |.-ztime>10 zoomp|
000013f0  2d 3d 31 3a 7a 74 69 6d  65 3d 91 0d 08 d4 1c 20  |-=1:ztime=..... |
00001400  e7 20 7a 6f 6f 6d 70 3c  30 20 7a 6f 6f 6d 70 3d  |. zoomp<0 zoomp=|
00001410  70 6f 77 65 72 2d 31 0d  08 de 1c 20 e7 20 7a 6f  |power-1.... . zo|
00001420  6f 6d 70 3e 70 6f 77 65  72 2d 31 20 7a 6f 6f 6d  |omp>power-1 zoom|
00001430  70 3d 30 0d 08 e8 11 20  76 61 6c 31 3d 32 5e 7a  |p=0.... val1=2^z|
00001440  6f 6f 6d 70 0d 08 f2 1a  20 76 61 6c 32 3d 28 32  |oomp.... val2=(2|
00001450  5e 70 6f 77 65 72 2d 76  61 6c 31 29 2a 34 0d 08  |^power-val1)*4..|
00001460  fc 15 20 76 61 6c 33 3d  34 2a 32 5e 7a 6f 6f 6d  |.. val3=4*2^zoom|
00001470  70 2d 34 0d 09 06 0e 20  e7 20 78 3c 30 20 78 3d  |p-4.... . x<0 x=|
00001480  30 0d 09 10 14 20 e7 20  78 3e 76 61 6c 32 20 78  |0.... . x>val2 x|
00001490  3d 76 61 6c 32 0d 09 1a  0e 20 e7 20 79 3c 30 20  |=val2.... . y<0 |
000014a0  79 3d 30 0d 09 24 14 20  e7 20 79 3e 76 61 6c 32  |y=0..$. . y>val2|
000014b0  20 79 3d 76 61 6c 32 0d  09 2e 0d 20 c8 97 20 b8  | y=val2.... .. .|
000014c0  20 78 2c 79 0d 09 38 2a  20 e7 20 7a 6f 6f 6d 70  | x,y..8* . zoomp|
000014d0  3e 30 20 8c 20 c8 93 20  78 2c 79 2c 76 61 6c 33  |>0 . .. x,y,val3|
000014e0  2c 76 61 6c 33 20 8b 20  c8 92 20 78 2c 79 0d 09  |,val3 . .. x,y..|
000014f0  42 07 20 c8 96 0d 09 4c  29 20 e7 20 7a 6f 6f 6d  |B. ....L) . zoom|
00001500  70 3e 30 20 8c c8 93 20  78 2c 79 2c 76 61 6c 33  |p>0 ... x,y,val3|
00001510  2c 76 61 6c 33 20 8b 20  c8 92 20 78 2c 79 0d 09  |,val3 . .. x,y..|
00001520  56 09 fd 20 62 3d 34 0d  09 60 09 ec 20 78 2c 79  |V.. b=4..`.. x,y|
00001530  0d 09 6a 13 ec 20 78 2b  76 61 6c 33 2c 79 2b 76  |..j.. x+val3,y+v|
00001540  61 6c 33 0d 09 74 39 c8  99 20 22 4f 53 5f 53 70  |al3..t9.. "OS_Sp|
00001550  72 69 74 65 4f 70 22 2c  26 31 31 30 2c 73 70 72  |riteOp",&110,spr|
00001560  2c 22 73 70 72 69 74 65  22 2c 2c 78 2c 79 2c 78  |,"sprite",,x,y,x|
00001570  2b 76 61 6c 33 2c 79 2b  76 61 6c 33 0d 09 7e 1b  |+val3,y+val3..~.|
00001580  73 63 61 6c 65 21 30 3d  32 5e 28 70 6f 77 65 72  |scale!0=2^(power|
00001590  2d 7a 6f 6f 6d 70 29 0d  09 88 1b 73 63 61 6c 65  |-zoomp)....scale|
000015a0  21 34 3d 32 5e 28 70 6f  77 65 72 2d 7a 6f 6f 6d  |!4=2^(power-zoom|
000015b0  70 29 0d 09 92 0d 73 63  61 6c 65 21 38 3d 31 0d  |p)....scale!8=1.|
000015c0  09 9c 0e 73 63 61 6c 65  21 31 32 3d 31 0d 09 a6  |...scale!12=1...|
000015d0  39 c8 99 20 22 4f 53 5f  53 70 72 69 74 65 4f 70  |9.. "OS_SpriteOp|
000015e0  22 2c 26 31 33 34 2c 73  70 72 2c 22 73 70 72 69  |",&134,spr,"spri|
000015f0  74 65 22 2c 30 2c 30 2c  30 2c 73 63 61 6c 65 2c  |te",0,0,0,scale,|
00001600  63 6f 6c 6f 75 72 0d 09  b0 0b 41 25 3d 62 61 73  |colour....A%=bas|
00001610  65 0d 09 ba 0c 42 25 3d  62 6c 65 6e 64 0d 09 c4  |e....B%=blend...|
00001620  09 43 25 3d 36 34 0d 09  ce 08 44 25 3d 30 0d 09  |.C%=64....D%=0..|
00001630  d8 0a d6 20 6d 6f 76 65  0d 09 e2 05 e1 0d ff     |... move.......|
0000163f