Home » Archimedes archive » Acorn User » AU 1998-07.adf » Regulars » StarInfo/Vibe/FLAG
StarInfo/Vibe/FLAG
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 1998-07.adf » Regulars |
Filename: | StarInfo/Vibe/FLAG |
Read OK: | ✔ |
File size: | 0711 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM > FLAG 20 30MODE28:*FX9,0 40PRINT'"Waving flag"' 50PRINT"This program takes a 16 Colour sprite with a standard" 60PRINT"16 colour palette and constructs a new spritefile where" 70PRINT"the sprite is rippled like a flag. The new sprite is a" 80PRINT"256 colour sprite and the spritefile consiste of 20" 90PRINT"sprites making up a animation sequence, suitable for" 100PRINT"making animated gifs." 110PRINT"The construction takes about 20 minutes on a A5000."'' 120 130INPUT"Spritefile="SPF$ 140CLS 150DIM SPR &10000,SPR2 &80000,BUF 16 160DIM R%(15),G%(15),B%(15) 170FORN%=0TO15:READ R%(N%),G%(N%),B%(N%):NEXT 180SPR!0=&FFFF:SPR!4=0:SPR!8=16:SPR!12=16 190SPR2!0=&7FFFF:SPR2!4=0:SPR2!8=16:SPR2!12=16 200SYS"OS_SpriteOp",256+10,SPR,SPF$ 210SYS"OS_SpriteOp",256+13,SPR,BUF,16,1 220N$="":P%=0:REPEAT 230T%=BUF?P%:IF T%<>0 N$+=CHR$T% 240P%+=1:UNTIL T%=0 250SYS"OS_SpriteOp",256+40,SPR,N$ TO ,,,W%,H% 260FX=W%/256:FY=H%/256 270 280FORN%=0TO19:W=RAD(18*(19-N%)):WN$=RIGHT$(STR$(100+N%),2) 290CLS:PRINTN% 300 310PX1%=32:PY1%=32-10 320PX2%=255+255/5+32:PY2%=32+255*.75+20 330FORY1%=255TO0STEP-2:Y%=Y1%-128 340FORX1%=0TO255STEP2:X%=X1%-128 350SX%=FX*X1%:SY%=FY*Y1% 360SYS"OS_SpriteOp",256+41,SPR,N$,SX%,SY% TO ,,,,,C% 370PX%=X1%+Y1%/5+32 380WH=(SIN(X1%/15+W)+SIN(Y1%/15+W)+2)/4 390PY%=32+Y1%*.75+WH*20 400R1%=R%(C%):G1%=G%(C%):B1%=B%(C%) 410R1%=R1%*(WH*.50+.50) 420G1%=G1%*(WH*.50+.50) 430B1%=B1%*(WH*.50+.50) 440PROCRGB(R1%,G1%,B1%) 450LINE PX%,PY%-4,PX%,PY% 460NEXT, 470SYS"OS_SpriteOp",256+16,SPR2,WN$,0,PX1%,PY1%,PX2%,PY2% 480NEXT 490SYS"OS_SpriteOp",256+12,SPR2,"WFLAG" 500END 510 520DEFPROCRGB(R%,G%,B%) 530LOCAL C%:C%=(R%<<8)+(G%<<16)+(B%<<24) 540SYS "ColourTrans_SetGCOL",C%,,,&100,0 550ENDPROC 560 570DATA 255,255,255 580DATA 221,221,221 590DATA 187,187,187 600DATA 153,153,153 610DATA 119,119,119 620DATA 85,85,85 630DATA 51,51,51 640DATA 0,0,0 650DATA 0,68,153 660DATA 238,238,0 670DATA 0,204,0 680DATA 221,0,0 690DATA 238,238,187 700DATA 85,136,0 710DATA 255,187,0 720DATA 0,187,255
� > FLAG �28:*FX9,0 (�'"Waving flag"' 2<�"This program takes a 16 Colour sprite with a standard" <>�"16 colour palette and constructs a new spritefile where" F=�"the sprite is rippled like a flag. The new sprite is a" P:�"256 colour sprite and the spritefile consiste of 20" Z;�"sprites making up a animation sequence, suitable for" d�"making animated gifs." n<�"The construction takes about 20 minutes on a A5000."'' x ��"Spritefile="SPF$ �� �#� SPR &10000,SPR2 &80000,BUF 16 �� R%(15),G%(15),B%(15) �%�N%=0�15:� R%(N%),G%(N%),B%(N%):� �*SPR!0=&FFFF:SPR!4=0:SPR!8=16:SPR!12=16 �/SPR2!0=&7FFFF:SPR2!4=0:SPR2!8=16:SPR2!12=16 �#ș"OS_SpriteOp",256+10,SPR,SPF$ �'ș"OS_SpriteOp",256+13,SPR,BUF,16,1 �N$="":P%=0:� �T%=BUF?P%:� T%<>0 N$+=�T% �P%+=1:� T%=0 �,ș"OS_SpriteOp",256+40,SPR,N$ � ,,,W%,H% FX=W%/256:FY=H%/256 .�N%=0�19:W=�(18*(19-N%)):WN$=��(100+N%),2) " �:�N% , 6PX1%=32:PY1%=32-10 @(PX2%=255+255/5+32:PY2%=32+255*.75+20 J�Y1%=255�0�-2:Y%=Y1%-128 T�X1%=0�255�2:X%=X1%-128 ^SX%=FX*X1%:SY%=FY*Y1% h3ș"OS_SpriteOp",256+41,SPR,N$,SX%,SY% � ,,,,,C% rPX%=X1%+Y1%/5+32 |$WH=(�(X1%/15+W)+�(Y1%/15+W)+2)/4 �PY%=32+Y1%*.75+WH*20 �$R1%=R%(C%):G1%=G%(C%):B1%=B%(C%) �R1%=R1%*(WH*.50+.50) �G1%=G1%*(WH*.50+.50) �B1%=B1%*(WH*.50+.50) ��RGB(R1%,G1%,B1%) �� PX%,PY%-4,PX%,PY% ��, �9ș"OS_SpriteOp",256+16,SPR2,WN$,0,PX1%,PY1%,PX2%,PY2% �� �'ș"OS_SpriteOp",256+12,SPR2,"WFLAG" �� � ��RGB(R%,G%,B%) %� C%:C%=(R%<<8)+(G%<<16)+(B%<<24) (ș "ColourTrans_SetGCOL",C%,,,&100,0 &� 0 :� 255,255,255 D� 221,221,221 N� 187,187,187 X� 153,153,153 b� 119,119,119 l� 85,85,85 v� 51,51,51 �� 0,0,0 �� 0,68,153 �� 238,238,0 � � 0,204,0 � � 221,0,0 �� 238,238,187 �� 85,136,0 �� 255,187,0 �� 0,187,255 �
00000000 0d 00 0a 0c f4 20 3e 20 46 4c 41 47 0d 00 14 04 |..... > FLAG....| 00000010 0d 00 1e 0e eb 32 38 3a 2a 46 58 39 2c 30 0d 00 |.....28:*FX9,0..| 00000020 28 14 f1 27 22 57 61 76 69 6e 67 20 66 6c 61 67 |(..'"Waving flag| 00000030 22 27 0d 00 32 3c f1 22 54 68 69 73 20 70 72 6f |"'..2<."This pro| 00000040 67 72 61 6d 20 74 61 6b 65 73 20 61 20 31 36 20 |gram takes a 16 | 00000050 43 6f 6c 6f 75 72 20 73 70 72 69 74 65 20 77 69 |Colour sprite wi| 00000060 74 68 20 61 20 73 74 61 6e 64 61 72 64 22 0d 00 |th a standard"..| 00000070 3c 3e f1 22 31 36 20 63 6f 6c 6f 75 72 20 70 61 |<>."16 colour pa| 00000080 6c 65 74 74 65 20 61 6e 64 20 63 6f 6e 73 74 72 |lette and constr| 00000090 75 63 74 73 20 61 20 6e 65 77 20 73 70 72 69 74 |ucts a new sprit| 000000a0 65 66 69 6c 65 20 77 68 65 72 65 22 0d 00 46 3d |efile where"..F=| 000000b0 f1 22 74 68 65 20 73 70 72 69 74 65 20 69 73 20 |."the sprite is | 000000c0 72 69 70 70 6c 65 64 20 6c 69 6b 65 20 61 20 66 |rippled like a f| 000000d0 6c 61 67 2e 20 54 68 65 20 6e 65 77 20 73 70 72 |lag. The new spr| 000000e0 69 74 65 20 69 73 20 61 22 0d 00 50 3a f1 22 32 |ite is a"..P:."2| 000000f0 35 36 20 63 6f 6c 6f 75 72 20 73 70 72 69 74 65 |56 colour sprite| 00000100 20 61 6e 64 20 74 68 65 20 73 70 72 69 74 65 66 | and the spritef| 00000110 69 6c 65 20 63 6f 6e 73 69 73 74 65 20 6f 66 20 |ile consiste of | 00000120 32 30 22 0d 00 5a 3b f1 22 73 70 72 69 74 65 73 |20"..Z;."sprites| 00000130 20 6d 61 6b 69 6e 67 20 75 70 20 61 20 61 6e 69 | making up a ani| 00000140 6d 61 74 69 6f 6e 20 73 65 71 75 65 6e 63 65 2c |mation sequence,| 00000150 20 73 75 69 74 61 62 6c 65 20 66 6f 72 22 0d 00 | suitable for"..| 00000160 64 1c f1 22 6d 61 6b 69 6e 67 20 61 6e 69 6d 61 |d.."making anima| 00000170 74 65 64 20 67 69 66 73 2e 22 0d 00 6e 3c f1 22 |ted gifs."..n<."| 00000180 54 68 65 20 63 6f 6e 73 74 72 75 63 74 69 6f 6e |The construction| 00000190 20 74 61 6b 65 73 20 61 62 6f 75 74 20 32 30 20 | takes about 20 | 000001a0 6d 69 6e 75 74 65 73 20 6f 6e 20 61 20 41 35 30 |minutes on a A50| 000001b0 30 30 2e 22 27 27 0d 00 78 04 0d 00 82 16 e8 22 |00."''..x......"| 000001c0 53 70 72 69 74 65 66 69 6c 65 3d 22 53 50 46 24 |Spritefile="SPF$| 000001d0 0d 00 8c 05 db 0d 00 96 23 de 20 53 50 52 20 26 |........#. SPR &| 000001e0 31 30 30 30 30 2c 53 50 52 32 20 26 38 30 30 30 |10000,SPR2 &8000| 000001f0 30 2c 42 55 46 20 31 36 0d 00 a0 1a de 20 52 25 |0,BUF 16..... R%| 00000200 28 31 35 29 2c 47 25 28 31 35 29 2c 42 25 28 31 |(15),G%(15),B%(1| 00000210 35 29 0d 00 aa 25 e3 4e 25 3d 30 b8 31 35 3a f3 |5)...%.N%=0.15:.| 00000220 20 52 25 28 4e 25 29 2c 47 25 28 4e 25 29 2c 42 | R%(N%),G%(N%),B| 00000230 25 28 4e 25 29 3a ed 0d 00 b4 2a 53 50 52 21 30 |%(N%):....*SPR!0| 00000240 3d 26 46 46 46 46 3a 53 50 52 21 34 3d 30 3a 53 |=&FFFF:SPR!4=0:S| 00000250 50 52 21 38 3d 31 36 3a 53 50 52 21 31 32 3d 31 |PR!8=16:SPR!12=1| 00000260 36 0d 00 be 2f 53 50 52 32 21 30 3d 26 37 46 46 |6.../SPR2!0=&7FF| 00000270 46 46 3a 53 50 52 32 21 34 3d 30 3a 53 50 52 32 |FF:SPR2!4=0:SPR2| 00000280 21 38 3d 31 36 3a 53 50 52 32 21 31 32 3d 31 36 |!8=16:SPR2!12=16| 00000290 0d 00 c8 23 c8 99 22 4f 53 5f 53 70 72 69 74 65 |...#.."OS_Sprite| 000002a0 4f 70 22 2c 32 35 36 2b 31 30 2c 53 50 52 2c 53 |Op",256+10,SPR,S| 000002b0 50 46 24 0d 00 d2 27 c8 99 22 4f 53 5f 53 70 72 |PF$...'.."OS_Spr| 000002c0 69 74 65 4f 70 22 2c 32 35 36 2b 31 33 2c 53 50 |iteOp",256+13,SP| 000002d0 52 2c 42 55 46 2c 31 36 2c 31 0d 00 dc 10 4e 24 |R,BUF,16,1....N$| 000002e0 3d 22 22 3a 50 25 3d 30 3a f5 0d 00 e6 1d 54 25 |="":P%=0:.....T%| 000002f0 3d 42 55 46 3f 50 25 3a e7 20 54 25 3c 3e 30 20 |=BUF?P%:. T%<>0 | 00000300 4e 24 2b 3d bd 54 25 0d 00 f0 10 50 25 2b 3d 31 |N$+=.T%....P%+=1| 00000310 3a fd 20 54 25 3d 30 0d 00 fa 2c c8 99 22 4f 53 |:. T%=0...,.."OS| 00000320 5f 53 70 72 69 74 65 4f 70 22 2c 32 35 36 2b 34 |_SpriteOp",256+4| 00000330 30 2c 53 50 52 2c 4e 24 20 b8 20 2c 2c 2c 57 25 |0,SPR,N$ . ,,,W%| 00000340 2c 48 25 0d 01 04 17 46 58 3d 57 25 2f 32 35 36 |,H%....FX=W%/256| 00000350 3a 46 59 3d 48 25 2f 32 35 36 0d 01 0e 04 0d 01 |:FY=H%/256......| 00000360 18 2e e3 4e 25 3d 30 b8 31 39 3a 57 3d b2 28 31 |...N%=0.19:W=.(1| 00000370 38 2a 28 31 39 2d 4e 25 29 29 3a 57 4e 24 3d c2 |8*(19-N%)):WN$=.| 00000380 c3 28 31 30 30 2b 4e 25 29 2c 32 29 0d 01 22 09 |.(100+N%),2)..".| 00000390 db 3a f1 4e 25 0d 01 2c 04 0d 01 36 16 50 58 31 |.:.N%..,...6.PX1| 000003a0 25 3d 33 32 3a 50 59 31 25 3d 33 32 2d 31 30 0d |%=32:PY1%=32-10.| 000003b0 01 40 28 50 58 32 25 3d 32 35 35 2b 32 35 35 2f |.@(PX2%=255+255/| 000003c0 35 2b 33 32 3a 50 59 32 25 3d 33 32 2b 32 35 35 |5+32:PY2%=32+255| 000003d0 2a 2e 37 35 2b 32 30 0d 01 4a 1c e3 59 31 25 3d |*.75+20..J..Y1%=| 000003e0 32 35 35 b8 30 88 2d 32 3a 59 25 3d 59 31 25 2d |255.0.-2:Y%=Y1%-| 000003f0 31 32 38 0d 01 54 1b e3 58 31 25 3d 30 b8 32 35 |128..T..X1%=0.25| 00000400 35 88 32 3a 58 25 3d 58 31 25 2d 31 32 38 0d 01 |5.2:X%=X1%-128..| 00000410 5e 19 53 58 25 3d 46 58 2a 58 31 25 3a 53 59 25 |^.SX%=FX*X1%:SY%| 00000420 3d 46 59 2a 59 31 25 0d 01 68 33 c8 99 22 4f 53 |=FY*Y1%..h3.."OS| 00000430 5f 53 70 72 69 74 65 4f 70 22 2c 32 35 36 2b 34 |_SpriteOp",256+4| 00000440 31 2c 53 50 52 2c 4e 24 2c 53 58 25 2c 53 59 25 |1,SPR,N$,SX%,SY%| 00000450 20 b8 20 2c 2c 2c 2c 2c 43 25 0d 01 72 14 50 58 | . ,,,,,C%..r.PX| 00000460 25 3d 58 31 25 2b 59 31 25 2f 35 2b 33 32 0d 01 |%=X1%+Y1%/5+32..| 00000470 7c 24 57 48 3d 28 b5 28 58 31 25 2f 31 35 2b 57 ||$WH=(.(X1%/15+W| 00000480 29 2b b5 28 59 31 25 2f 31 35 2b 57 29 2b 32 29 |)+.(Y1%/15+W)+2)| 00000490 2f 34 0d 01 86 18 50 59 25 3d 33 32 2b 59 31 25 |/4....PY%=32+Y1%| 000004a0 2a 2e 37 35 2b 57 48 2a 32 30 0d 01 90 24 52 31 |*.75+WH*20...$R1| 000004b0 25 3d 52 25 28 43 25 29 3a 47 31 25 3d 47 25 28 |%=R%(C%):G1%=G%(| 000004c0 43 25 29 3a 42 31 25 3d 42 25 28 43 25 29 0d 01 |C%):B1%=B%(C%)..| 000004d0 9a 18 52 31 25 3d 52 31 25 2a 28 57 48 2a 2e 35 |..R1%=R1%*(WH*.5| 000004e0 30 2b 2e 35 30 29 0d 01 a4 18 47 31 25 3d 47 31 |0+.50)....G1%=G1| 000004f0 25 2a 28 57 48 2a 2e 35 30 2b 2e 35 30 29 0d 01 |%*(WH*.50+.50)..| 00000500 ae 18 42 31 25 3d 42 31 25 2a 28 57 48 2a 2e 35 |..B1%=B1%*(WH*.5| 00000510 30 2b 2e 35 30 29 0d 01 b8 15 f2 52 47 42 28 52 |0+.50).....RGB(R| 00000520 31 25 2c 47 31 25 2c 42 31 25 29 0d 01 c2 17 86 |1%,G1%,B1%).....| 00000530 20 50 58 25 2c 50 59 25 2d 34 2c 50 58 25 2c 50 | PX%,PY%-4,PX%,P| 00000540 59 25 0d 01 cc 06 ed 2c 0d 01 d6 39 c8 99 22 4f |Y%.....,...9.."O| 00000550 53 5f 53 70 72 69 74 65 4f 70 22 2c 32 35 36 2b |S_SpriteOp",256+| 00000560 31 36 2c 53 50 52 32 2c 57 4e 24 2c 30 2c 50 58 |16,SPR2,WN$,0,PX| 00000570 31 25 2c 50 59 31 25 2c 50 58 32 25 2c 50 59 32 |1%,PY1%,PX2%,PY2| 00000580 25 0d 01 e0 05 ed 0d 01 ea 27 c8 99 22 4f 53 5f |%........'.."OS_| 00000590 53 70 72 69 74 65 4f 70 22 2c 32 35 36 2b 31 32 |SpriteOp",256+12| 000005a0 2c 53 50 52 32 2c 22 57 46 4c 41 47 22 0d 01 f4 |,SPR2,"WFLAG"...| 000005b0 05 e0 0d 01 fe 04 0d 02 08 13 dd f2 52 47 42 28 |............RGB(| 000005c0 52 25 2c 47 25 2c 42 25 29 0d 02 12 25 ea 20 43 |R%,G%,B%)...%. C| 000005d0 25 3a 43 25 3d 28 52 25 3c 3c 38 29 2b 28 47 25 |%:C%=(R%<<8)+(G%| 000005e0 3c 3c 31 36 29 2b 28 42 25 3c 3c 32 34 29 0d 02 |<<16)+(B%<<24)..| 000005f0 1c 28 c8 99 20 22 43 6f 6c 6f 75 72 54 72 61 6e |.(.. "ColourTran| 00000600 73 5f 53 65 74 47 43 4f 4c 22 2c 43 25 2c 2c 2c |s_SetGCOL",C%,,,| 00000610 26 31 30 30 2c 30 0d 02 26 05 e1 0d 02 30 04 0d |&100,0..&....0..| 00000620 02 3a 11 dc 20 32 35 35 2c 32 35 35 2c 32 35 35 |.:.. 255,255,255| 00000630 0d 02 44 11 dc 20 32 32 31 2c 32 32 31 2c 32 32 |..D.. 221,221,22| 00000640 31 0d 02 4e 11 dc 20 31 38 37 2c 31 38 37 2c 31 |1..N.. 187,187,1| 00000650 38 37 0d 02 58 11 dc 20 31 35 33 2c 31 35 33 2c |87..X.. 153,153,| 00000660 31 35 33 0d 02 62 11 dc 20 31 31 39 2c 31 31 39 |153..b.. 119,119| 00000670 2c 31 31 39 0d 02 6c 0e dc 20 38 35 2c 38 35 2c |,119..l.. 85,85,| 00000680 38 35 0d 02 76 0e dc 20 35 31 2c 35 31 2c 35 31 |85..v.. 51,51,51| 00000690 0d 02 80 0b dc 20 30 2c 30 2c 30 0d 02 8a 0e dc |..... 0,0,0.....| 000006a0 20 30 2c 36 38 2c 31 35 33 0d 02 94 0f dc 20 32 | 0,68,153..... 2| 000006b0 33 38 2c 32 33 38 2c 30 0d 02 9e 0d dc 20 30 2c |38,238,0..... 0,| 000006c0 32 30 34 2c 30 0d 02 a8 0d dc 20 32 32 31 2c 30 |204,0..... 221,0| 000006d0 2c 30 0d 02 b2 11 dc 20 32 33 38 2c 32 33 38 2c |,0..... 238,238,| 000006e0 31 38 37 0d 02 bc 0e dc 20 38 35 2c 31 33 36 2c |187..... 85,136,| 000006f0 30 0d 02 c6 0f dc 20 32 35 35 2c 31 38 37 2c 30 |0..... 255,187,0| 00000700 0d 02 d0 0f dc 20 30 2c 31 38 37 2c 32 35 35 0d |..... 0,187,255.| 00000710 ff |.| 00000711