Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2 » StarInfo/Cooke/HSVpetal28

StarInfo/Cooke/HSVpetal28

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2
Filename: StarInfo/Cooke/HSVpetal28
Read OK:
File size: 02D0 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >HSVpetal28
   20ON ERROR ERROR EXT ERR,REPORT$+" at line "+STR$ERL:END
   30MODE 28:OFF
   40max=100
   50size=80
   60rad=800
   70DIM a(max),r(max)
   80SYS "OS_SWINumberFromString",,"ColourTrans_ConvertHSVToRGB" TO hsv_rgb
   90SYS "OS_SWINumberFromString",,"ColourTrans_SetGCOL" TO gcol
  100r=size
  110FOR i=0 TO max-1
  120 REPEAT
  130  a(i)=RND(1)*360
  140  r(i)=RND(rad)
  150  x=640+SINRAD(a(i))*r(i)
  160  y=480+COSRAD(a(i))*r(i)
  170 UNTIL POINT(x,y)=0
  180 CIRCLE FILL x,y,r
  190NEXT
  200CLS
  210REPEAT
  220 FOR i=0 TO max-1
  230  H=a(i)*65536
  240  S=r(i)*65536/rad
  250  V=(size-r)*65536/size
  260  SYS hsv_rgb,H,S,V TO R,G,B
  270  x=640+SINRAD(a(i))*(r(i)-r*2)
  280  y=480+COSRAD(a(i))*(r(i)-r*2)
  281  R=R>>8
  282  G=G>>8
  283  B=B>>8
  300  SYS gcol,(B<<24) OR (G<<16) OR (R<<8),,,256
  320  CIRCLE FILL x,y,r
  330 NEXT
  340 r=r*.95
  350UNTIL r<1
  360IFGET

� >HSVpetal28
!� � � � �,�$+" at line "+Þ:�

� 28:�
(max=100
2size=80
<rad=800
F� a(max),r(max)
PHș "OS_SWINumberFromString",,"ColourTrans_ConvertHSVToRGB" � hsv_rgb
Z=ș "OS_SWINumberFromString",,"ColourTrans_SetGCOL" � gcol
d
r=size
n� i=0 � max-1
x �
�  a(i)=�(1)*360
�  r(i)=�(rad)
�  x=640+��(a(i))*r(i)
�  y=480+��(a(i))*r(i)
� � �x,y)=0
� ȏ Ȑ x,y,r
��
��
��
� � i=0 � max-1
�  H=a(i)*65536
�  S=r(i)*65536/rad
�  V=(size-r)*65536/size
  ș hsv_rgb,H,S,V � R,G,B
  x=640+��(a(i))*(r(i)-r*2)
  y=480+��(a(i))*(r(i)-r*2)
  R=R>>8
  G=G>>8
  B=B>>8
,.  ș gcol,(B<<24) � (G<<16) � (R<<8),,,256
@  ȏ Ȑ x,y,r
J �
T r=r*.95
^	� r<1
h�
�
00000000  0d 00 0a 11 f4 20 3e 48  53 56 70 65 74 61 6c 32  |..... >HSVpetal2|
00000010  38 0d 00 14 21 ee 20 85  20 85 20 a2 20 9f 2c f6  |8...!. . . . .,.|
00000020  24 2b 22 20 61 74 20 6c  69 6e 65 20 22 2b c3 9e  |$+" at line "+..|
00000030  3a e0 0d 00 1e 0a eb 20  32 38 3a 87 0d 00 28 0b  |:...... 28:...(.|
00000040  6d 61 78 3d 31 30 30 0d  00 32 0b 73 69 7a 65 3d  |max=100..2.size=|
00000050  38 30 0d 00 3c 0b 72 61  64 3d 38 30 30 0d 00 46  |80..<.rad=800..F|
00000060  13 de 20 61 28 6d 61 78  29 2c 72 28 6d 61 78 29  |.. a(max),r(max)|
00000070  0d 00 50 48 c8 99 20 22  4f 53 5f 53 57 49 4e 75  |..PH.. "OS_SWINu|
00000080  6d 62 65 72 46 72 6f 6d  53 74 72 69 6e 67 22 2c  |mberFromString",|
00000090  2c 22 43 6f 6c 6f 75 72  54 72 61 6e 73 5f 43 6f  |,"ColourTrans_Co|
000000a0  6e 76 65 72 74 48 53 56  54 6f 52 47 42 22 20 b8  |nvertHSVToRGB" .|
000000b0  20 68 73 76 5f 72 67 62  0d 00 5a 3d c8 99 20 22  | hsv_rgb..Z=.. "|
000000c0  4f 53 5f 53 57 49 4e 75  6d 62 65 72 46 72 6f 6d  |OS_SWINumberFrom|
000000d0  53 74 72 69 6e 67 22 2c  2c 22 43 6f 6c 6f 75 72  |String",,"Colour|
000000e0  54 72 61 6e 73 5f 53 65  74 47 43 4f 4c 22 20 b8  |Trans_SetGCOL" .|
000000f0  20 67 63 6f 6c 0d 00 64  0a 72 3d 73 69 7a 65 0d  | gcol..d.r=size.|
00000100  00 6e 11 e3 20 69 3d 30  20 b8 20 6d 61 78 2d 31  |.n.. i=0 . max-1|
00000110  0d 00 78 06 20 f5 0d 00  82 13 20 20 61 28 69 29  |..x. .....  a(i)|
00000120  3d b3 28 31 29 2a 33 36  30 0d 00 8c 11 20 20 72  |=.(1)*360....  r|
00000130  28 69 29 3d b3 28 72 61  64 29 0d 00 96 19 20 20  |(i)=.(rad)....  |
00000140  78 3d 36 34 30 2b b5 b2  28 61 28 69 29 29 2a 72  |x=640+..(a(i))*r|
00000150  28 69 29 0d 00 a0 19 20  20 79 3d 34 38 30 2b 9b  |(i)....  y=480+.|
00000160  b2 28 61 28 69 29 29 2a  72 28 69 29 0d 00 aa 0e  |.(a(i))*r(i)....|
00000170  20 fd 20 b0 78 2c 79 29  3d 30 0d 00 b4 10 20 c8  | . .x,y)=0.... .|
00000180  8f 20 c8 90 20 78 2c 79  2c 72 0d 00 be 05 ed 0d  |. .. x,y,r......|
00000190  00 c8 05 db 0d 00 d2 05  f5 0d 00 dc 12 20 e3 20  |............. . |
000001a0  69 3d 30 20 b8 20 6d 61  78 2d 31 0d 00 e6 12 20  |i=0 . max-1.... |
000001b0  20 48 3d 61 28 69 29 2a  36 35 35 33 36 0d 00 f0  | H=a(i)*65536...|
000001c0  16 20 20 53 3d 72 28 69  29 2a 36 35 35 33 36 2f  |.  S=r(i)*65536/|
000001d0  72 61 64 0d 00 fa 1b 20  20 56 3d 28 73 69 7a 65  |rad....  V=(size|
000001e0  2d 72 29 2a 36 35 35 33  36 2f 73 69 7a 65 0d 01  |-r)*65536/size..|
000001f0  04 1e 20 20 c8 99 20 68  73 76 5f 72 67 62 2c 48  |..  .. hsv_rgb,H|
00000200  2c 53 2c 56 20 b8 20 52  2c 47 2c 42 0d 01 0e 1f  |,S,V . R,G,B....|
00000210  20 20 78 3d 36 34 30 2b  b5 b2 28 61 28 69 29 29  |  x=640+..(a(i))|
00000220  2a 28 72 28 69 29 2d 72  2a 32 29 0d 01 18 1f 20  |*(r(i)-r*2).... |
00000230  20 79 3d 34 38 30 2b 9b  b2 28 61 28 69 29 29 2a  | y=480+..(a(i))*|
00000240  28 72 28 69 29 2d 72 2a  32 29 0d 01 19 0c 20 20  |(r(i)-r*2)....  |
00000250  52 3d 52 3e 3e 38 0d 01  1a 0c 20 20 47 3d 47 3e  |R=R>>8....  G=G>|
00000260  3e 38 0d 01 1b 0c 20 20  42 3d 42 3e 3e 38 0d 01  |>8....  B=B>>8..|
00000270  2c 2e 20 20 c8 99 20 67  63 6f 6c 2c 28 42 3c 3c  |,.  .. gcol,(B<<|
00000280  32 34 29 20 84 20 28 47  3c 3c 31 36 29 20 84 20  |24) . (G<<16) . |
00000290  28 52 3c 3c 38 29 2c 2c  2c 32 35 36 0d 01 40 11  |(R<<8),,,256..@.|
000002a0  20 20 c8 8f 20 c8 90 20  78 2c 79 2c 72 0d 01 4a  |  .. .. x,y,r..J|
000002b0  06 20 ed 0d 01 54 0c 20  72 3d 72 2a 2e 39 35 0d  |. ...T. r=r*.95.|
000002c0  01 5e 09 fd 20 72 3c 31  0d 01 68 06 e7 a5 0d ff  |.^.. r<1..h.....|
000002d0