Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Regulars » StarInfo/Cohn/!ARMovie/Tools/Reflect/Flip-in-X

StarInfo/Cohn/!ARMovie/Tools/Reflect/Flip-in-X

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-03 B.adf » Regulars
Filename: StarInfo/Cohn/!ARMovie/Tools/Reflect/Flip-in-X
Read OK:
File size: 05AA bytes
Load address: 0000
Exec address: 0000
File contents
   10REM Flip-in-X
   20REM Acts on 192CHAIN144 size ERLlms. (4:3 ratio ERLlms).
   30ONERROR CLOSE#A%:PRINTREPORT$;" at line ";ERL:END
   40A%=OPENOUT"<ARMovie$Dir>.Shapes.Reflection.Flip-in-X":REM Create and open Shape file called Flip-in-X.
   50BPUT#A%,"ARMovie Shape 1":REM Shape type version
   60BPUT#A%,"Reflection of Film (left to right)":REM Comment line
   70BPUT#A%,"768 576":REM Rectangular size of shape in OS units.
   80
   90FORY%=0TO143:REM There are 143 horizontal lines in film and new shape.
  100destx%=0:REM new location (x) of part of the line to move; measured to left edge of new shape in OS units.
  110desty%=(143-Y%)*4:REM new location (y) of part of the line to move; measured from top left of new shape.
  120
  130q%=destx% OR desty%<<12 OR 192<<24: REM 192 is number of pixels (0-255) to copy to a line to the right of this dest.
  140BPUT#A%,q%:BPUT#A%,q%>>8:BPUT#A%,q%>>16:BPUT#A%,q%>>24: REM destx%, desty% and the NUSR of pixels are written to the shape file in a special format.
  150
  160REM N entries now follow in a loop. Each one moves a replay source (x%,y%) pixel to the destination defined above.
  170FORI%=0TO191
  180y%=Y%:REM This line calculates the source y position of each pixel to be moved.
  190x%=(191-I%):REM This line calculates the source x position of each pixel to be moved.
  200q%=y%<<16 OR x%:REM This line calculates the source position of each pixel; they are then placed in a linear line to the right of destx%,desty%.
  210BPUT#A%,q%:BPUT#A%,q%>>8:BPUT#A%,q%>>16:BPUT#A%,q%>>24
  220NEXT
  230
  240PRINT"Line N� ";Y%;" done."
  250NEXT
  260
  270CLOSE#A%

� Flip-in-X
2� Acts on 192�144 size �lms. (4:3 ratio �lms).
� �#A%:�$;" at line ";�:�
(bA%=�"<ARMovie$Dir>.Shapes.Reflection.Flip-in-X":� Create and open Shape file called Flip-in-X.
2/�#A%,"ARMovie Shape 1":� Shape type version
<<�#A%,"Reflection of Film (left to right)":� Comment line
F;�#A%,"768 576":� Rectangular size of shape in OS units.
P
ZE�Y%=0�143:� There are 143 horizontal lines in film and new shape.
dldestx%=0:� new location (x) of part of the line to move; measured to left edge of new shape in OS units.
njdesty%=(143-Y%)*4:� new location (y) of part of the line to move; measured from top left of new shape.
x
�tq%=destx% � desty%<<12 � 192<<24: � 192 is number of pixels (0-255) to copy to a line to the right of this dest.
���#A%,q%:�#A%,q%>>8:�#A%,q%>>16:�#A%,q%>>24: � destx%, desty% and the N� of pixels are written to the shape file in a special format.
�
�t� N entries now follow in a loop. Each one moves a replay source (x%,y%) pixel to the destination defined above.
�
�I%=0�191
�Qy%=Y%:� This line calculates the source y position of each pixel to be moved.
�Wx%=(191-I%):� This line calculates the source x position of each pixel to be moved.
ȑq%=y%<<16 � x%:� This line calculates the source position of each pixel; they are then placed in a linear line to the right of destx%,desty%.
�.�#A%,q%:�#A%,q%>>8:�#A%,q%>>16:�#A%,q%>>24
��
�
��"Line N� ";Y%;" done."
��

�#A%
�
00000000  0d 00 0a 0f f4 20 46 6c  69 70 2d 69 6e 2d 58 0d  |..... Flip-in-X.|
00000010  00 14 32 f4 20 41 63 74  73 20 6f 6e 20 31 39 32  |..2. Acts on 192|
00000020  d7 31 34 34 20 73 69 7a  65 20 9e 6c 6d 73 2e 20  |.144 size .lms. |
00000030  28 34 3a 33 20 72 61 74  69 6f 20 9e 6c 6d 73 29  |(4:3 ratio .lms)|
00000040  2e 0d 00 1e 1f ee 85 20  d9 23 41 25 3a f1 f6 24  |....... .#A%:..$|
00000050  3b 22 20 61 74 20 6c 69  6e 65 20 22 3b 9e 3a e0  |;" at line ";.:.|
00000060  0d 00 28 62 41 25 3d ae  22 3c 41 52 4d 6f 76 69  |..(bA%=."<ARMovi|
00000070  65 24 44 69 72 3e 2e 53  68 61 70 65 73 2e 52 65  |e$Dir>.Shapes.Re|
00000080  66 6c 65 63 74 69 6f 6e  2e 46 6c 69 70 2d 69 6e  |flection.Flip-in|
00000090  2d 58 22 3a f4 20 43 72  65 61 74 65 20 61 6e 64  |-X":. Create and|
000000a0  20 6f 70 65 6e 20 53 68  61 70 65 20 66 69 6c 65  | open Shape file|
000000b0  20 63 61 6c 6c 65 64 20  46 6c 69 70 2d 69 6e 2d  | called Flip-in-|
000000c0  58 2e 0d 00 32 2f d5 23  41 25 2c 22 41 52 4d 6f  |X...2/.#A%,"ARMo|
000000d0  76 69 65 20 53 68 61 70  65 20 31 22 3a f4 20 53  |vie Shape 1":. S|
000000e0  68 61 70 65 20 74 79 70  65 20 76 65 72 73 69 6f  |hape type versio|
000000f0  6e 0d 00 3c 3c d5 23 41  25 2c 22 52 65 66 6c 65  |n..<<.#A%,"Refle|
00000100  63 74 69 6f 6e 20 6f 66  20 46 69 6c 6d 20 28 6c  |ction of Film (l|
00000110  65 66 74 20 74 6f 20 72  69 67 68 74 29 22 3a f4  |eft to right)":.|
00000120  20 43 6f 6d 6d 65 6e 74  20 6c 69 6e 65 0d 00 46  | Comment line..F|
00000130  3b d5 23 41 25 2c 22 37  36 38 20 35 37 36 22 3a  |;.#A%,"768 576":|
00000140  f4 20 52 65 63 74 61 6e  67 75 6c 61 72 20 73 69  |. Rectangular si|
00000150  7a 65 20 6f 66 20 73 68  61 70 65 20 69 6e 20 4f  |ze of shape in O|
00000160  53 20 75 6e 69 74 73 2e  0d 00 50 04 0d 00 5a 45  |S units...P...ZE|
00000170  e3 59 25 3d 30 b8 31 34  33 3a f4 20 54 68 65 72  |.Y%=0.143:. Ther|
00000180  65 20 61 72 65 20 31 34  33 20 68 6f 72 69 7a 6f  |e are 143 horizo|
00000190  6e 74 61 6c 20 6c 69 6e  65 73 20 69 6e 20 66 69  |ntal lines in fi|
000001a0  6c 6d 20 61 6e 64 20 6e  65 77 20 73 68 61 70 65  |lm and new shape|
000001b0  2e 0d 00 64 6c 64 65 73  74 78 25 3d 30 3a f4 20  |...dldestx%=0:. |
000001c0  6e 65 77 20 6c 6f 63 61  74 69 6f 6e 20 28 78 29  |new location (x)|
000001d0  20 6f 66 20 70 61 72 74  20 6f 66 20 74 68 65 20  | of part of the |
000001e0  6c 69 6e 65 20 74 6f 20  6d 6f 76 65 3b 20 6d 65  |line to move; me|
000001f0  61 73 75 72 65 64 20 74  6f 20 6c 65 66 74 20 65  |asured to left e|
00000200  64 67 65 20 6f 66 20 6e  65 77 20 73 68 61 70 65  |dge of new shape|
00000210  20 69 6e 20 4f 53 20 75  6e 69 74 73 2e 0d 00 6e  | in OS units...n|
00000220  6a 64 65 73 74 79 25 3d  28 31 34 33 2d 59 25 29  |jdesty%=(143-Y%)|
00000230  2a 34 3a f4 20 6e 65 77  20 6c 6f 63 61 74 69 6f  |*4:. new locatio|
00000240  6e 20 28 79 29 20 6f 66  20 70 61 72 74 20 6f 66  |n (y) of part of|
00000250  20 74 68 65 20 6c 69 6e  65 20 74 6f 20 6d 6f 76  | the line to mov|
00000260  65 3b 20 6d 65 61 73 75  72 65 64 20 66 72 6f 6d  |e; measured from|
00000270  20 74 6f 70 20 6c 65 66  74 20 6f 66 20 6e 65 77  | top left of new|
00000280  20 73 68 61 70 65 2e 0d  00 78 04 0d 00 82 74 71  | shape...x....tq|
00000290  25 3d 64 65 73 74 78 25  20 84 20 64 65 73 74 79  |%=destx% . desty|
000002a0  25 3c 3c 31 32 20 84 20  31 39 32 3c 3c 32 34 3a  |%<<12 . 192<<24:|
000002b0  20 f4 20 31 39 32 20 69  73 20 6e 75 6d 62 65 72  | . 192 is number|
000002c0  20 6f 66 20 70 69 78 65  6c 73 20 28 30 2d 32 35  | of pixels (0-25|
000002d0  35 29 20 74 6f 20 63 6f  70 79 20 74 6f 20 61 20  |5) to copy to a |
000002e0  6c 69 6e 65 20 74 6f 20  74 68 65 20 72 69 67 68  |line to the righ|
000002f0  74 20 6f 66 20 74 68 69  73 20 64 65 73 74 2e 0d  |t of this dest..|
00000300  00 8c 88 d5 23 41 25 2c  71 25 3a d5 23 41 25 2c  |....#A%,q%:.#A%,|
00000310  71 25 3e 3e 38 3a d5 23  41 25 2c 71 25 3e 3e 31  |q%>>8:.#A%,q%>>1|
00000320  36 3a d5 23 41 25 2c 71  25 3e 3e 32 34 3a 20 f4  |6:.#A%,q%>>24: .|
00000330  20 64 65 73 74 78 25 2c  20 64 65 73 74 79 25 20  | destx%, desty% |
00000340  61 6e 64 20 74 68 65 20  4e ba 20 6f 66 20 70 69  |and the N. of pi|
00000350  78 65 6c 73 20 61 72 65  20 77 72 69 74 74 65 6e  |xels are written|
00000360  20 74 6f 20 74 68 65 20  73 68 61 70 65 20 66 69  | to the shape fi|
00000370  6c 65 20 69 6e 20 61 20  73 70 65 63 69 61 6c 20  |le in a special |
00000380  66 6f 72 6d 61 74 2e 0d  00 96 04 0d 00 a0 74 f4  |format........t.|
00000390  20 4e 20 65 6e 74 72 69  65 73 20 6e 6f 77 20 66  | N entries now f|
000003a0  6f 6c 6c 6f 77 20 69 6e  20 61 20 6c 6f 6f 70 2e  |ollow in a loop.|
000003b0  20 45 61 63 68 20 6f 6e  65 20 6d 6f 76 65 73 20  | Each one moves |
000003c0  61 20 72 65 70 6c 61 79  20 73 6f 75 72 63 65 20  |a replay source |
000003d0  28 78 25 2c 79 25 29 20  70 69 78 65 6c 20 74 6f  |(x%,y%) pixel to|
000003e0  20 74 68 65 20 64 65 73  74 69 6e 61 74 69 6f 6e  | the destination|
000003f0  20 64 65 66 69 6e 65 64  20 61 62 6f 76 65 2e 0d  | defined above..|
00000400  00 aa 0d e3 49 25 3d 30  b8 31 39 31 0d 00 b4 51  |....I%=0.191...Q|
00000410  79 25 3d 59 25 3a f4 20  54 68 69 73 20 6c 69 6e  |y%=Y%:. This lin|
00000420  65 20 63 61 6c 63 75 6c  61 74 65 73 20 74 68 65  |e calculates the|
00000430  20 73 6f 75 72 63 65 20  79 20 70 6f 73 69 74 69  | source y positi|
00000440  6f 6e 20 6f 66 20 65 61  63 68 20 70 69 78 65 6c  |on of each pixel|
00000450  20 74 6f 20 62 65 20 6d  6f 76 65 64 2e 0d 00 be  | to be moved....|
00000460  57 78 25 3d 28 31 39 31  2d 49 25 29 3a f4 20 54  |Wx%=(191-I%):. T|
00000470  68 69 73 20 6c 69 6e 65  20 63 61 6c 63 75 6c 61  |his line calcula|
00000480  74 65 73 20 74 68 65 20  73 6f 75 72 63 65 20 78  |tes the source x|
00000490  20 70 6f 73 69 74 69 6f  6e 20 6f 66 20 65 61 63  | position of eac|
000004a0  68 20 70 69 78 65 6c 20  74 6f 20 62 65 20 6d 6f  |h pixel to be mo|
000004b0  76 65 64 2e 0d 00 c8 91  71 25 3d 79 25 3c 3c 31  |ved.....q%=y%<<1|
000004c0  36 20 84 20 78 25 3a f4  20 54 68 69 73 20 6c 69  |6 . x%:. This li|
000004d0  6e 65 20 63 61 6c 63 75  6c 61 74 65 73 20 74 68  |ne calculates th|
000004e0  65 20 73 6f 75 72 63 65  20 70 6f 73 69 74 69 6f  |e source positio|
000004f0  6e 20 6f 66 20 65 61 63  68 20 70 69 78 65 6c 3b  |n of each pixel;|
00000500  20 74 68 65 79 20 61 72  65 20 74 68 65 6e 20 70  | they are then p|
00000510  6c 61 63 65 64 20 69 6e  20 61 20 6c 69 6e 65 61  |laced in a linea|
00000520  72 20 6c 69 6e 65 20 74  6f 20 74 68 65 20 72 69  |r line to the ri|
00000530  67 68 74 20 6f 66 20 64  65 73 74 78 25 2c 64 65  |ght of destx%,de|
00000540  73 74 79 25 2e 0d 00 d2  2e d5 23 41 25 2c 71 25  |sty%......#A%,q%|
00000550  3a d5 23 41 25 2c 71 25  3e 3e 38 3a d5 23 41 25  |:.#A%,q%>>8:.#A%|
00000560  2c 71 25 3e 3e 31 36 3a  d5 23 41 25 2c 71 25 3e  |,q%>>16:.#A%,q%>|
00000570  3e 32 34 0d 00 dc 05 ed  0d 00 e6 04 0d 00 f0 1b  |>24.............|
00000580  f1 22 4c 69 6e 65 20 4e  ba 20 22 3b 59 25 3b 22  |."Line N. ";Y%;"|
00000590  20 64 6f 6e 65 2e 22 0d  00 fa 05 ed 0d 01 04 04  | done.".........|
000005a0  0d 01 0e 08 d9 23 41 25  0d ff                    |.....#A%..|
000005aa