Home » Archimedes archive » Acorn User » AU 1995-10.adf » !Regulars » Regulars/StarInfo/Norman/SpiMetal
Regulars/StarInfo/Norman/SpiMetal
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 1995-10.adf » !Regulars |
Filename: | Regulars/StarInfo/Norman/SpiMetal |
Read OK: | ✔ |
File size: | 068C bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
1REM Spiral Metal... 2REM A nice little effect, a bit like a moulded piece of metal in a disco! 3REM By Phil Norman - NOTE - This version for RiscPC only. 4REM Thank you Acorn User for the MODE and palette-swap routines. 5 6 7 8 9xres%=800 : yres%=600 10xmax%=xres%*2: ymax%=yres%*2 11PROCselect_mode 12ON ERROR MODE 0:REPORT:PRINT ERL:STOP 13 14 15DIM pal 256*4*2 16pal1=pal 17pal2=pal+256*4 18FOR c=0 TO 255:COLOUR c,c,c,c 19 pal1!(c*4)=(c<<24) OR (c<<16) OR (c<<8) 20 pal2!(c*4)=pal1!(c*4) 21NEXT 22 23 24 25ORIGIN xres%,yres% 26colnum%=0 27coldir%=1 28angle=0 29size=1 30dist=0 31REPEAT 32 size+=1/45 33 dist+=size/270 34 s%=size 35 colnum%+=coldir% 36 IF colnum%=255 coldir%=-1 37 IF colnum%=0 coldir%=1 38 angle+=1 39 IF angle=360 angle=0 40 xpos=COS RAD(angle)*dist 41 ypos=SIN RAD(angle)*dist 42 SYS "OS_SetColour",0,colnum% 43 CIRCLE FILL xpos,ypos,size 44UNTIL xpos>1300 45 46 47G$=GET$ 48 49rf=(RND(1)*2+1) 50gf=(RND(1)*2+1) 51bf=(RND(1)*2+1) 52SYS "OS_SWINumberFromString",,"ColourTrans_WritePalette" TO wp 53i=0 54REPEAT 55 WAIT:WAIT 56 SYS wp,-1,,pal+(i MOD 256)*4 57 r=127+127*COS RAD(rf*i) 58 g=127+127*COS RAD(gf*i) 59 b=127+127*COS RAD(bf*i) 60 w=(b<<24) OR (g<<16) OR (r<<8) 61 j=4*(i MOD 256) 62 pal1!j=w 63 pal2!j=w 64 i+=1 65UNTIL 0 66 67 68 69DEF PROCselect_mode 70DIM mode% 32 71!mode%=1 72mode%!4=xres% 73mode%!8=yres% 74mode%!12=3 75mode%!16=-1 76mode%!20=3 77mode%!24=255 78mode%!28=-1 79MODE mode% 80OFF 81SYS "OS_ReadModeVariable",-1,11 TO ,,XWindLimit 82SYS "OS_ReadModeVariable",-1,12 TO ,,YWindLimit 83SYS "OS_ReadModeVariable",-1,4 TO ,,XEigFactor 84SYS "OS_ReadModeVariable",-1,5 TO ,,YEigFactor 85width=(XWindLimit+1)<<XEigFactor 86height=(YWindLimit+1)<<YEigFactor 87ENDPROC
� Spiral Metal... L� A nice little effect, a bit like a moulded piece of metal in a disco! <� By Phil Norman - NOTE - This version for RiscPC only. C� Thank you Acorn User for the MODE and palette-swap routines. xres%=800 : yres%=600 #xmax%=xres%*2: ymax%=yres%*2 �select_mode � � � 0:�:� �:� � pal 256*4*2 pal1=pal pal2=pal+256*4 � c=0 � 255:� c,c,c,c * pal1!(c*4)=(c<<24) � (c<<16) � (c<<8) pal2!(c*4)=pal1!(c*4) � ȑ xres%,yres% colnum%=0 coldir%=1 angle=0 size=1 dist=0 � 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 * ș "OS_SetColour",0,colnum% + ȏ Ȑ xpos,ypos,size ,� xpos>1300 - . /G$=� 0 1rf=(�(1)*2+1) 2gf=(�(1)*2+1) 3bf=(�(1)*2+1) 4@ș "OS_SWINumberFromString",,"ColourTrans_WritePalette" � wp 5i=0 6� 7 Ȗ:Ȗ 8 ș wp,-1,,pal+(i � 256)*4 9 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 A� 0 B C D E� �select_mode F� mode% 32 G!mode%=1 Hmode%!4=xres% Imode%!8=yres% Jmode%!12=3 Kmode%!16=-1 Lmode%!20=3 Mmode%!24=255 Nmode%!28=-1 O� mode% P� Q1ș "OS_ReadModeVariable",-1,11 � ,,XWindLimit R1ș "OS_ReadModeVariable",-1,12 � ,,YWindLimit S1ș "OS_ReadModeVariable",-1,4 � ,,XEigFactor T1ș "OS_ReadModeVariable",-1,5 � ,,YEigFactor U$width=(XWindLimit+1)<<XEigFactor V%height=(YWindLimit+1)<<YEigFactor W� �
00000000 0d 00 01 16 f4 20 20 53 70 69 72 61 6c 20 4d 65 |..... Spiral Me| 00000010 74 61 6c 2e 2e 2e 0d 00 02 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 03 3c f4 20 20 42 79 20 50 68 69 6c |o!...<. By Phil| 00000070 20 4e 6f 72 6d 61 6e 20 2d 20 4e 4f 54 45 20 2d | Norman - NOTE -| 00000080 20 54 68 69 73 20 76 65 72 73 69 6f 6e 20 66 6f | This version fo| 00000090 72 20 52 69 73 63 50 43 20 6f 6e 6c 79 2e 0d 00 |r RiscPC only...| 000000a0 04 43 f4 20 20 54 68 61 6e 6b 20 79 6f 75 20 41 |.C. Thank you A| 000000b0 63 6f 72 6e 20 55 73 65 72 20 66 6f 72 20 74 68 |corn User for th| 000000c0 65 20 4d 4f 44 45 20 61 6e 64 20 70 61 6c 65 74 |e MODE and palet| 000000d0 74 65 2d 73 77 61 70 20 72 6f 75 74 69 6e 65 73 |te-swap routines| 000000e0 2e 0d 00 05 04 0d 00 06 04 0d 00 07 04 0d 00 08 |................| 000000f0 04 0d 00 09 1f 78 72 65 73 25 3d 38 30 30 20 20 |.....xres%=800 | 00000100 20 20 3a 20 20 20 20 79 72 65 73 25 3d 36 30 30 | : yres%=600| 00000110 0d 00 0a 23 78 6d 61 78 25 3d 78 72 65 73 25 2a |...#xmax%=xres%*| 00000120 32 3a 20 20 20 20 79 6d 61 78 25 3d 79 72 65 73 |2: ymax%=yres| 00000130 25 2a 32 0d 00 0b 10 f2 73 65 6c 65 63 74 5f 6d |%*2.....select_m| 00000140 6f 64 65 0d 00 0c 13 ee 20 85 20 eb 20 30 3a f6 |ode..... . . 0:.| 00000150 3a f1 20 9e 3a fa 0d 00 0d 04 0d 00 0e 04 0d 00 |:. .:...........| 00000160 0f 11 de 20 70 61 6c 20 32 35 36 2a 34 2a 32 0d |... pal 256*4*2.| 00000170 00 10 0c 70 61 6c 31 3d 70 61 6c 0d 00 11 12 70 |...pal1=pal....p| 00000180 61 6c 32 3d 70 61 6c 2b 32 35 36 2a 34 0d 00 12 |al2=pal+256*4...| 00000190 19 e3 20 63 3d 30 20 b8 20 32 35 35 3a fb 20 63 |.. c=0 . 255:. c| 000001a0 2c 63 2c 63 2c 63 0d 00 13 2a 20 70 61 6c 31 21 |,c,c,c...* pal1!| 000001b0 28 63 2a 34 29 3d 28 63 3c 3c 32 34 29 20 84 20 |(c*4)=(c<<24) . | 000001c0 28 63 3c 3c 31 36 29 20 84 20 28 63 3c 3c 38 29 |(c<<16) . (c<<8)| 000001d0 0d 00 14 1a 20 70 61 6c 32 21 28 63 2a 34 29 3d |.... pal2!(c*4)=| 000001e0 70 61 6c 31 21 28 63 2a 34 29 0d 00 15 05 ed 0d |pal1!(c*4)......| 000001f0 00 16 04 0d 00 17 04 0d 00 18 04 0d 00 19 12 c8 |................| 00000200 91 20 78 72 65 73 25 2c 79 72 65 73 25 0d 00 1a |. xres%,yres%...| 00000210 0d 63 6f 6c 6e 75 6d 25 3d 30 0d 00 1b 0d 63 6f |.colnum%=0....co| 00000220 6c 64 69 72 25 3d 31 0d 00 1c 0b 61 6e 67 6c 65 |ldir%=1....angle| 00000230 3d 30 0d 00 1d 0a 73 69 7a 65 3d 31 0d 00 1e 0a |=0....size=1....| 00000240 64 69 73 74 3d 30 0d 00 1f 05 f5 0d 00 20 0f 20 |dist=0....... . | 00000250 73 69 7a 65 2b 3d 31 2f 34 35 0d 00 21 13 20 64 |size+=1/45..!. d| 00000260 69 73 74 2b 3d 73 69 7a 65 2f 32 37 30 0d 00 22 |ist+=size/270.."| 00000270 0c 20 73 25 3d 73 69 7a 65 0d 00 23 15 20 63 6f |. s%=size..#. co| 00000280 6c 6e 75 6d 25 2b 3d 63 6f 6c 64 69 72 25 0d 00 |lnum%+=coldir%..| 00000290 24 1d 20 e7 20 63 6f 6c 6e 75 6d 25 3d 32 35 35 |$. . colnum%=255| 000002a0 20 63 6f 6c 64 69 72 25 3d 2d 31 0d 00 25 1a 20 | coldir%=-1..%. | 000002b0 e7 20 63 6f 6c 6e 75 6d 25 3d 30 20 63 6f 6c 64 |. colnum%=0 cold| 000002c0 69 72 25 3d 31 0d 00 26 0d 20 61 6e 67 6c 65 2b |ir%=1..&. angle+| 000002d0 3d 31 0d 00 27 18 20 e7 20 61 6e 67 6c 65 3d 33 |=1..'. . angle=3| 000002e0 36 30 20 61 6e 67 6c 65 3d 30 0d 00 28 19 20 78 |60 angle=0..(. x| 000002f0 70 6f 73 3d 9b 20 b2 28 61 6e 67 6c 65 29 2a 64 |pos=. .(angle)*d| 00000300 69 73 74 0d 00 29 19 20 79 70 6f 73 3d b5 20 b2 |ist..). ypos=. .| 00000310 28 61 6e 67 6c 65 29 2a 64 69 73 74 0d 00 2a 20 |(angle)*dist..* | 00000320 20 c8 99 20 22 4f 53 5f 53 65 74 43 6f 6c 6f 75 | .. "OS_SetColou| 00000330 72 22 2c 30 2c 63 6f 6c 6e 75 6d 25 0d 00 2b 19 |r",0,colnum%..+.| 00000340 20 c8 8f 20 c8 90 20 78 70 6f 73 2c 79 70 6f 73 | .. .. xpos,ypos| 00000350 2c 73 69 7a 65 0d 00 2c 0f fd 20 78 70 6f 73 3e |,size..,.. xpos>| 00000360 31 33 30 30 0d 00 2d 04 0d 00 2e 04 0d 00 2f 08 |1300..-......./.| 00000370 47 24 3d be 0d 00 30 04 0d 00 31 11 72 66 3d 28 |G$=...0...1.rf=(| 00000380 b3 28 31 29 2a 32 2b 31 29 0d 00 32 11 67 66 3d |.(1)*2+1)..2.gf=| 00000390 28 b3 28 31 29 2a 32 2b 31 29 0d 00 33 11 62 66 |(.(1)*2+1)..3.bf| 000003a0 3d 28 b3 28 31 29 2a 32 2b 31 29 0d 00 34 40 c8 |=(.(1)*2+1)..4@.| 000003b0 99 20 22 4f 53 5f 53 57 49 4e 75 6d 62 65 72 46 |. "OS_SWINumberF| 000003c0 72 6f 6d 53 74 72 69 6e 67 22 2c 2c 22 43 6f 6c |romString",,"Col| 000003d0 6f 75 72 54 72 61 6e 73 5f 57 72 69 74 65 50 61 |ourTrans_WritePa| 000003e0 6c 65 74 74 65 22 20 b8 20 77 70 0d 00 35 07 69 |lette" . wp..5.i| 000003f0 3d 30 0d 00 36 05 f5 0d 00 37 0a 20 c8 96 3a c8 |=0..6....7. ..:.| 00000400 96 0d 00 38 1e 20 c8 99 20 77 70 2c 2d 31 2c 2c |...8. .. wp,-1,,| 00000410 70 61 6c 2b 28 69 20 83 20 32 35 36 29 2a 34 0d |pal+(i . 256)*4.| 00000420 00 39 18 20 72 3d 31 32 37 2b 31 32 37 2a 9b 20 |.9. r=127+127*. | 00000430 b2 28 72 66 2a 69 29 0d 00 3a 18 20 67 3d 31 32 |.(rf*i)..:. g=12| 00000440 37 2b 31 32 37 2a 9b 20 b2 28 67 66 2a 69 29 0d |7+127*. .(gf*i).| 00000450 00 3b 18 20 62 3d 31 32 37 2b 31 32 37 2a 9b 20 |.;. b=127+127*. | 00000460 b2 28 62 66 2a 69 29 0d 00 3c 21 20 77 3d 28 62 |.(bf*i)..<! w=(b| 00000470 3c 3c 32 34 29 20 84 20 28 67 3c 3c 31 36 29 20 |<<24) . (g<<16) | 00000480 84 20 28 72 3c 3c 38 29 0d 00 3d 12 20 6a 3d 34 |. (r<<8)..=. j=4| 00000490 2a 28 69 20 83 20 32 35 36 29 0d 00 3e 0d 20 70 |*(i . 256)..>. p| 000004a0 61 6c 31 21 6a 3d 77 0d 00 3f 0d 20 70 61 6c 32 |al1!j=w..?. pal2| 000004b0 21 6a 3d 77 0d 00 40 09 20 69 2b 3d 31 0d 00 41 |!j=w..@. i+=1..A| 000004c0 07 fd 20 30 0d 00 42 04 0d 00 43 04 0d 00 44 04 |.. 0..B...C...D.| 000004d0 0d 00 45 12 dd 20 f2 73 65 6c 65 63 74 5f 6d 6f |..E.. .select_mo| 000004e0 64 65 0d 00 46 0e de 20 6d 6f 64 65 25 20 33 32 |de..F.. mode% 32| 000004f0 0d 00 47 0c 21 6d 6f 64 65 25 3d 31 0d 00 48 11 |..G.!mode%=1..H.| 00000500 6d 6f 64 65 25 21 34 3d 78 72 65 73 25 0d 00 49 |mode%!4=xres%..I| 00000510 11 6d 6f 64 65 25 21 38 3d 79 72 65 73 25 0d 00 |.mode%!8=yres%..| 00000520 4a 0e 6d 6f 64 65 25 21 31 32 3d 33 0d 00 4b 0f |J.mode%!12=3..K.| 00000530 6d 6f 64 65 25 21 31 36 3d 2d 31 0d 00 4c 0e 6d |mode%!16=-1..L.m| 00000540 6f 64 65 25 21 32 30 3d 33 0d 00 4d 10 6d 6f 64 |ode%!20=3..M.mod| 00000550 65 25 21 32 34 3d 32 35 35 0d 00 4e 0f 6d 6f 64 |e%!24=255..N.mod| 00000560 65 25 21 32 38 3d 2d 31 0d 00 4f 0b eb 20 6d 6f |e%!28=-1..O.. mo| 00000570 64 65 25 0d 00 50 05 87 0d 00 51 31 c8 99 20 22 |de%..P....Q1.. "| 00000580 4f 53 5f 52 65 61 64 4d 6f 64 65 56 61 72 69 61 |OS_ReadModeVaria| 00000590 62 6c 65 22 2c 2d 31 2c 31 31 20 b8 20 2c 2c 58 |ble",-1,11 . ,,X| 000005a0 57 69 6e 64 4c 69 6d 69 74 0d 00 52 31 c8 99 20 |WindLimit..R1.. | 000005b0 22 4f 53 5f 52 65 61 64 4d 6f 64 65 56 61 72 69 |"OS_ReadModeVari| 000005c0 61 62 6c 65 22 2c 2d 31 2c 31 32 20 b8 20 2c 2c |able",-1,12 . ,,| 000005d0 59 57 69 6e 64 4c 69 6d 69 74 0d 00 53 31 c8 99 |YWindLimit..S1..| 000005e0 20 22 4f 53 5f 52 65 61 64 4d 6f 64 65 56 61 72 | "OS_ReadModeVar| 000005f0 69 61 62 6c 65 22 2c 2d 31 2c 34 20 20 b8 20 2c |iable",-1,4 . ,| 00000600 2c 58 45 69 67 46 61 63 74 6f 72 0d 00 54 31 c8 |,XEigFactor..T1.| 00000610 99 20 22 4f 53 5f 52 65 61 64 4d 6f 64 65 56 61 |. "OS_ReadModeVa| 00000620 72 69 61 62 6c 65 22 2c 2d 31 2c 35 20 20 b8 20 |riable",-1,5 . | 00000630 2c 2c 59 45 69 67 46 61 63 74 6f 72 0d 00 55 24 |,,YEigFactor..U$| 00000640 77 69 64 74 68 3d 28 58 57 69 6e 64 4c 69 6d 69 |width=(XWindLimi| 00000650 74 2b 31 29 3c 3c 58 45 69 67 46 61 63 74 6f 72 |t+1)<<XEigFactor| 00000660 0d 00 56 25 68 65 69 67 68 74 3d 28 59 57 69 6e |..V%height=(YWin| 00000670 64 4c 69 6d 69 74 2b 31 29 3c 3c 59 45 69 67 46 |dLimit+1)<<YEigF| 00000680 61 63 74 6f 72 0d 00 57 05 e1 0d ff |actor..W....| 0000068c