Home » Archimedes archive » Acorn User » AU 1996-02.adf » Regulars » StarInfo/Mossop/SpiMetal2
StarInfo/Mossop/SpiMetal2
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 1996-02.adf » Regulars |
| Filename: | StarInfo/Mossop/SpiMetal2 |
| Read OK: | ✔ |
| File size: | 05E4 bytes |
| Load address: | 0000 |
| Exec address: | 0000 |
File contents
10REM Spiral Metal... 20REM A nice little effect, a bit like a moulded piece of metal in a disco! 30REM By Phil Norman 40REM Thank you Acorn User for the MODE and palette-swap routines. 50 51REM 'Downgraded' by Daniel Mossop 60REM (Small mod by DA to use ColourTrans_SetGCOL) 70 110xres%=640 : yres%=512 120xmax%=xres%*2: ymax%=yres%*2 130MODE 12 140ON ERROR MODE 12:REPORT:PRINT ERL:STOP 150speed=0 160OFF 170 190DIM pal 256*4*2 200pal1=pal 210pal2=pal+256*4 220r=0 230FOR c=0 TO 255:COLOUR INT(c/16),INT(c/16)*16,INT(c/16)*16,INT(c/16)*16 240 pal1!(c*4)=(c<<24) OR (c<<16) OR (c<<8) 250 pal2!(c*4)=pal1!(c*4) 260NEXT 270 280gcol%=&40743 290 300ORIGIN xres%,yres% 310colnum%=0 320coldir%=1 330angle=0 340size=1 350dist=0 360REPEAT 370 size+=1/45 380 dist+=size/270 390 s%=size 400 colnum%+=coldir% 410 IF colnum%=255 coldir%=-1 420 IF colnum%=0 coldir%=1 430 angle+=1 440 IF angle=360 angle=0 450 xpos=COS RAD(angle)*dist 460 ypos=SIN RAD(angle)*dist 470 SYS gcol%,(colnum%<<8) OR (colnum%<<16) OR (colnum%<<24),,,&100 490 REM SYS "OS_SetColour",0,INT(colnum%/16) 500 CIRCLE FILL xpos,ypos,size 510UNTIL xpos>1300 520 530 540G$=GET$ 550 560rf=(RND(1)*2+1) 570gf=(RND(1)*2+1) 580bf=(RND(1)*2+1) 590SYS "OS_SWINumberFromString",,"ColourTrans_WritePalette" TO wp 600i=0 610REPEAT 620 WAIT:WAIT 630 SYS wp,-1,,pal+(i MOD 256)*4 640 r=127+127*COS RAD(rf*i) 650 g=127+127*COS RAD(gf*i) 660 b=127+127*COS RAD(bf*i) 670 w=(b<<24) OR (g<<16) OR (r<<8) 680 j=4*(i MOD 256) 690 pal1!j=w 700 pal2!j=w 710 i+=1 720time=TIME+speed 730REPEAT 740a$=INKEY$(0) 750IFa$="1"THENspeed-=1 760IFa$="2"THENspeed+=1:IFspeed<0THENspeed=0 770UNTIL TIME>time 780UNTIL 0 790 800 810
� Spiral Metal... L� A nice little effect, a bit like a moulded piece of metal in a disco! � By Phil Norman (C� Thank you Acorn User for the MODE and palette-swap routines. 2 3$� 'Downgraded' by Daniel Mossop <3� (Small mod by DA to use ColourTrans_SetGCOL) F nxres%=640 : yres%=512 x#xmax%=xres%*2: ymax%=yres%*2 �� 12 �� � � 12:�:� �:� �speed=0 �� � �� pal 256*4*2 �pal1=pal �pal2=pal+256*4 �r=0 �:� c=0 � 255:� �(c/16),�(c/16)*16,�(c/16)*16,�(c/16)*16 �* pal1!(c*4)=(c<<24) � (c<<16) � (c<<8) � pal2!(c*4)=pal1!(c*4) � gcol%=&40743 " ,ȑ xres%,yres% 6 colnum%=0 @ coldir%=1 Jangle=0 T size=1 ^ dist=0 h� r size+=1/45 | dist+=size/270 � s%=size � colnum%+=coldir% � � colnum%=255 coldir%=-1 � � colnum%=0 coldir%=1 � angle+=1 � � angle=360 angle=0 � xpos=� �(angle)*dist � ypos=� �(angle)*dist �A ș gcol%,(colnum%<<8) � (colnum%<<16) � (colnum%<<24),,,&100 �+ � SYS "OS_SetColour",0,INT(colnum%/16) � ȏ Ȑ xpos,ypos,size �� xpos>1300 G$=� & 0rf=(�(1)*2+1) :gf=(�(1)*2+1) Dbf=(�(1)*2+1) N@ș "OS_SWINumberFromString",,"ColourTrans_WritePalette" � wp Xi=0 b� l Ȗ:Ȗ v ș wp,-1,,pal+(i � 256)*4 � r=127+127*� �(rf*i) � g=127+127*� �(gf*i) � b=127+127*� �(bf*i) �! w=(b<<24) � (g<<16) � (r<<8) � j=4*(i � 256) � pal1!j=w � pal2!j=w � i+=1 �time=�+speed �� �a$=�(0) ��a$="1"�speed-=1 �%�a$="2"�speed+=1:�speed<0�speed=0 � �>time � 0 * �
00000000 0d 00 0a 16 f4 20 20 53 70 69 72 61 6c 20 4d 65 |..... Spiral Me| 00000010 74 61 6c 2e 2e 2e 0d 00 14 4c f4 20 20 41 20 6e |tal......L. A n| 00000020 69 63 65 20 6c 69 74 74 6c 65 20 65 66 66 65 63 |ice little effec| 00000030 74 2c 20 61 20 62 69 74 20 6c 69 6b 65 20 61 20 |t, a bit like a | 00000040 6d 6f 75 6c 64 65 64 20 70 69 65 63 65 20 6f 66 |moulded piece of| 00000050 20 6d 65 74 61 6c 20 69 6e 20 61 20 64 69 73 63 | metal in a disc| 00000060 6f 21 0d 00 1e 15 f4 20 20 42 79 20 50 68 69 6c |o!..... By Phil| 00000070 20 4e 6f 72 6d 61 6e 0d 00 28 43 f4 20 20 54 68 | Norman..(C. Th| 00000080 61 6e 6b 20 79 6f 75 20 41 63 6f 72 6e 20 55 73 |ank you Acorn Us| 00000090 65 72 20 66 6f 72 20 74 68 65 20 4d 4f 44 45 20 |er for the MODE | 000000a0 61 6e 64 20 70 61 6c 65 74 74 65 2d 73 77 61 70 |and palette-swap| 000000b0 20 72 6f 75 74 69 6e 65 73 2e 0d 00 32 04 0d 00 | routines...2...| 000000c0 33 24 f4 20 20 27 44 6f 77 6e 67 72 61 64 65 64 |3$. 'Downgraded| 000000d0 27 20 62 79 20 44 61 6e 69 65 6c 20 4d 6f 73 73 |' by Daniel Moss| 000000e0 6f 70 0d 00 3c 33 f4 20 20 28 53 6d 61 6c 6c 20 |op..<3. (Small | 000000f0 6d 6f 64 20 62 79 20 44 41 20 74 6f 20 75 73 65 |mod by DA to use| 00000100 20 43 6f 6c 6f 75 72 54 72 61 6e 73 5f 53 65 74 | ColourTrans_Set| 00000110 47 43 4f 4c 29 0d 00 46 04 0d 00 6e 1f 78 72 65 |GCOL)..F...n.xre| 00000120 73 25 3d 36 34 30 20 20 20 20 3a 20 20 20 20 79 |s%=640 : y| 00000130 72 65 73 25 3d 35 31 32 0d 00 78 23 78 6d 61 78 |res%=512..x#xmax| 00000140 25 3d 78 72 65 73 25 2a 32 3a 20 20 20 20 79 6d |%=xres%*2: ym| 00000150 61 78 25 3d 79 72 65 73 25 2a 32 0d 00 82 08 eb |ax%=yres%*2.....| 00000160 20 31 32 0d 00 8c 14 ee 20 85 20 eb 20 31 32 3a | 12..... . . 12:| 00000170 f6 3a f1 20 9e 3a fa 0d 00 96 0b 73 70 65 65 64 |.:. .:.....speed| 00000180 3d 30 0d 00 a0 05 87 0d 00 aa 04 0d 00 be 11 de |=0..............| 00000190 20 70 61 6c 20 32 35 36 2a 34 2a 32 0d 00 c8 0c | pal 256*4*2....| 000001a0 70 61 6c 31 3d 70 61 6c 0d 00 d2 12 70 61 6c 32 |pal1=pal....pal2| 000001b0 3d 70 61 6c 2b 32 35 36 2a 34 0d 00 dc 07 72 3d |=pal+256*4....r=| 000001c0 30 0d 00 e6 3a e3 20 63 3d 30 20 b8 20 32 35 35 |0...:. c=0 . 255| 000001d0 3a fb 20 a8 28 63 2f 31 36 29 2c a8 28 63 2f 31 |:. .(c/16),.(c/1| 000001e0 36 29 2a 31 36 2c a8 28 63 2f 31 36 29 2a 31 36 |6)*16,.(c/16)*16| 000001f0 2c a8 28 63 2f 31 36 29 2a 31 36 0d 00 f0 2a 20 |,.(c/16)*16...* | 00000200 70 61 6c 31 21 28 63 2a 34 29 3d 28 63 3c 3c 32 |pal1!(c*4)=(c<<2| 00000210 34 29 20 84 20 28 63 3c 3c 31 36 29 20 84 20 28 |4) . (c<<16) . (| 00000220 63 3c 3c 38 29 0d 00 fa 1a 20 70 61 6c 32 21 28 |c<<8).... pal2!(| 00000230 63 2a 34 29 3d 70 61 6c 31 21 28 63 2a 34 29 0d |c*4)=pal1!(c*4).| 00000240 01 04 05 ed 0d 01 0e 04 0d 01 18 10 67 63 6f 6c |............gcol| 00000250 25 3d 26 34 30 37 34 33 0d 01 22 04 0d 01 2c 12 |%=&40743.."...,.| 00000260 c8 91 20 78 72 65 73 25 2c 79 72 65 73 25 0d 01 |.. xres%,yres%..| 00000270 36 0d 63 6f 6c 6e 75 6d 25 3d 30 0d 01 40 0d 63 |6.colnum%=0..@.c| 00000280 6f 6c 64 69 72 25 3d 31 0d 01 4a 0b 61 6e 67 6c |oldir%=1..J.angl| 00000290 65 3d 30 0d 01 54 0a 73 69 7a 65 3d 31 0d 01 5e |e=0..T.size=1..^| 000002a0 0a 64 69 73 74 3d 30 0d 01 68 05 f5 0d 01 72 0f |.dist=0..h....r.| 000002b0 20 73 69 7a 65 2b 3d 31 2f 34 35 0d 01 7c 13 20 | size+=1/45..|. | 000002c0 64 69 73 74 2b 3d 73 69 7a 65 2f 32 37 30 0d 01 |dist+=size/270..| 000002d0 86 0c 20 73 25 3d 73 69 7a 65 0d 01 90 15 20 63 |.. s%=size.... c| 000002e0 6f 6c 6e 75 6d 25 2b 3d 63 6f 6c 64 69 72 25 0d |olnum%+=coldir%.| 000002f0 01 9a 1d 20 e7 20 63 6f 6c 6e 75 6d 25 3d 32 35 |... . colnum%=25| 00000300 35 20 63 6f 6c 64 69 72 25 3d 2d 31 0d 01 a4 1a |5 coldir%=-1....| 00000310 20 e7 20 63 6f 6c 6e 75 6d 25 3d 30 20 63 6f 6c | . colnum%=0 col| 00000320 64 69 72 25 3d 31 0d 01 ae 0d 20 61 6e 67 6c 65 |dir%=1.... angle| 00000330 2b 3d 31 0d 01 b8 18 20 e7 20 61 6e 67 6c 65 3d |+=1.... . angle=| 00000340 33 36 30 20 61 6e 67 6c 65 3d 30 0d 01 c2 19 20 |360 angle=0.... | 00000350 78 70 6f 73 3d 9b 20 b2 28 61 6e 67 6c 65 29 2a |xpos=. .(angle)*| 00000360 64 69 73 74 0d 01 cc 19 20 79 70 6f 73 3d b5 20 |dist.... ypos=. | 00000370 b2 28 61 6e 67 6c 65 29 2a 64 69 73 74 0d 01 d6 |.(angle)*dist...| 00000380 41 20 c8 99 20 67 63 6f 6c 25 2c 28 63 6f 6c 6e |A .. gcol%,(coln| 00000390 75 6d 25 3c 3c 38 29 20 84 20 28 63 6f 6c 6e 75 |um%<<8) . (colnu| 000003a0 6d 25 3c 3c 31 36 29 20 84 20 28 63 6f 6c 6e 75 |m%<<16) . (colnu| 000003b0 6d 25 3c 3c 32 34 29 2c 2c 2c 26 31 30 30 0d 01 |m%<<24),,,&100..| 000003c0 ea 2b 20 f4 20 53 59 53 20 22 4f 53 5f 53 65 74 |.+ . SYS "OS_Set| 000003d0 43 6f 6c 6f 75 72 22 2c 30 2c 49 4e 54 28 63 6f |Colour",0,INT(co| 000003e0 6c 6e 75 6d 25 2f 31 36 29 0d 01 f4 19 20 c8 8f |lnum%/16).... ..| 000003f0 20 c8 90 20 78 70 6f 73 2c 79 70 6f 73 2c 73 69 | .. xpos,ypos,si| 00000400 7a 65 0d 01 fe 0f fd 20 78 70 6f 73 3e 31 33 30 |ze..... xpos>130| 00000410 30 0d 02 08 04 0d 02 12 04 0d 02 1c 08 47 24 3d |0............G$=| 00000420 be 0d 02 26 04 0d 02 30 11 72 66 3d 28 b3 28 31 |...&...0.rf=(.(1| 00000430 29 2a 32 2b 31 29 0d 02 3a 11 67 66 3d 28 b3 28 |)*2+1)..:.gf=(.(| 00000440 31 29 2a 32 2b 31 29 0d 02 44 11 62 66 3d 28 b3 |1)*2+1)..D.bf=(.| 00000450 28 31 29 2a 32 2b 31 29 0d 02 4e 40 c8 99 20 22 |(1)*2+1)..N@.. "| 00000460 4f 53 5f 53 57 49 4e 75 6d 62 65 72 46 72 6f 6d |OS_SWINumberFrom| 00000470 53 74 72 69 6e 67 22 2c 2c 22 43 6f 6c 6f 75 72 |String",,"Colour| 00000480 54 72 61 6e 73 5f 57 72 69 74 65 50 61 6c 65 74 |Trans_WritePalet| 00000490 74 65 22 20 b8 20 77 70 0d 02 58 07 69 3d 30 0d |te" . wp..X.i=0.| 000004a0 02 62 05 f5 0d 02 6c 0a 20 c8 96 3a c8 96 0d 02 |.b....l. ..:....| 000004b0 76 1e 20 c8 99 20 77 70 2c 2d 31 2c 2c 70 61 6c |v. .. wp,-1,,pal| 000004c0 2b 28 69 20 83 20 32 35 36 29 2a 34 0d 02 80 18 |+(i . 256)*4....| 000004d0 20 72 3d 31 32 37 2b 31 32 37 2a 9b 20 b2 28 72 | r=127+127*. .(r| 000004e0 66 2a 69 29 0d 02 8a 18 20 67 3d 31 32 37 2b 31 |f*i).... g=127+1| 000004f0 32 37 2a 9b 20 b2 28 67 66 2a 69 29 0d 02 94 18 |27*. .(gf*i)....| 00000500 20 62 3d 31 32 37 2b 31 32 37 2a 9b 20 b2 28 62 | b=127+127*. .(b| 00000510 66 2a 69 29 0d 02 9e 21 20 77 3d 28 62 3c 3c 32 |f*i)...! w=(b<<2| 00000520 34 29 20 84 20 28 67 3c 3c 31 36 29 20 84 20 28 |4) . (g<<16) . (| 00000530 72 3c 3c 38 29 0d 02 a8 12 20 6a 3d 34 2a 28 69 |r<<8).... j=4*(i| 00000540 20 83 20 32 35 36 29 0d 02 b2 0d 20 70 61 6c 31 | . 256).... pal1| 00000550 21 6a 3d 77 0d 02 bc 0d 20 70 61 6c 32 21 6a 3d |!j=w.... pal2!j=| 00000560 77 0d 02 c6 09 20 69 2b 3d 31 0d 02 d0 10 74 69 |w.... i+=1....ti| 00000570 6d 65 3d 91 2b 73 70 65 65 64 0d 02 da 05 f5 0d |me=.+speed......| 00000580 02 e4 0b 61 24 3d bf 28 30 29 0d 02 ee 14 e7 61 |...a$=.(0).....a| 00000590 24 3d 22 31 22 8c 73 70 65 65 64 2d 3d 31 0d 02 |$="1".speed-=1..| 000005a0 f8 25 e7 61 24 3d 22 32 22 8c 73 70 65 65 64 2b |.%.a$="2".speed+| 000005b0 3d 31 3a e7 73 70 65 65 64 3c 30 8c 73 70 65 65 |=1:.speed<0.spee| 000005c0 64 3d 30 0d 03 02 0c fd 20 91 3e 74 69 6d 65 0d |d=0..... .>time.| 000005d0 03 0c 07 fd 20 30 0d 03 16 04 0d 03 20 04 0d 03 |.... 0...... ...| 000005e0 2a 04 0d ff |*...| 000005e4
.