Home » Archimedes archive » Acorn User » AU 1994-06.adf » !StarInfo_StarInfo » Marshall/!WorldTime/MakeMapXY
Marshall/!WorldTime/MakeMapXY
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 1994-06.adf » !StarInfo_StarInfo |
Filename: | Marshall/!WorldTime/MakeMapXY |
Read OK: | ✔ |
File size: | 03CA bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM >MakeFile 20REM Converts ascii latitude and longitude data into graphics units 30REM for !WorldTime. 40REM P.E.Marshall Jan 1993 50ONERROR : CLOSE#0 : REPORT : PRINTERL : END 60xoffset=4 : yoffset=308 70name$="<WorldTime$Dir>.MAPsource" 80ch%=OPENIN(name$) 90IF ch%=0 THEN PRINT"File ";name$;" not found." : K=INKEY(500) : END 100PRINT"Converting latitude and longitude data into graphics units" 110PRINT"for !WorldTime" 120DIM buf EXT#ch% 130P%=buf 140REPEAT 150 line$=FNread 160 PROCvalues 170 PROCcalc 180 REPEAT 190 line$=FNread 200 PROCvalues 210 IF lat<>0 AND long<>0 THEN PROCcalc 220 UNTIL lat=0 AND long=0 230 P%!0=&FFFF : P%!4=0 : P%+=8 240UNTIL EOF#ch% 250P%!0=&FFFF : P%!4=&FFFF : P%+=8 260OSCLI("SAVE <WorldTime$Dir>.MapXY "+STR$~(buf)+" "+STR$~(P%)) 270CLOSE#ch% 280*SETTYPE <WorldTime$Dir>.MapXY DATA 290END 300: 310DEFFNread 320 REPEAT 330 L$=GET$#ch% 340 UNTIL INSTR(L$,"|")=0 350= L$ 360: 370DEFPROCvalues 380 I%=INSTR(line$," ") 390 lat=VAL(line$) 400 long=VAL(MID$(line$,I%)) 410ENDPROC 420: 430DEFPROCcalc 440 Y%=lat*4+yoffset 450 X%=(180+long)*3.2+xoffset 460 P%!0=X% : P%!4=Y% : P%+=8 470ENDPROC
� >MakeFile D� Converts ascii latitude and longitude data into graphics units � for !WorldTime. (� P.E.Marshall Jan 1993 2� : �#0 : � : � : � <xoffset=4 : yoffset=308 F%name$="<WorldTime$Dir>.MAPsource" Pch%=�(name$) Z9� ch%=0 � �"File ";name$;" not found." : K=�(500) : � dA�"Converting latitude and longitude data into graphics units" n�"for !WorldTime" x� buf �#ch% � P%=buf �� � line$=�read � �values � �calc � � � line$=�read � �values �! � lat<>0 � long<>0 � �calc � � lat=0 � long=0 � P%!0=&FFFF : P%!4=0 : P%+=8 �� �#ch% �#P%!0=&FFFF : P%!4=&FFFF : P%+=8 7�("SAVE <WorldTime$Dir>.MapXY "+�~(buf)+" "+�~(P%)) �#ch% '*SETTYPE <WorldTime$Dir>.MapXY DATA "� ,: 6 ݤread @ � J L$=�#ch% T � �L$,"|")=0 ^= L$ h: r��values | I%=�line$," ") � lat=�(line$) � long=�(�line$,I%)) �� �: � ��calc � Y%=lat*4+yoffset � X%=(180+long)*3.2+xoffset � P%!0=X% : P%!4=Y% : P%+=8 �� �
00000000 0d 00 0a 0f f4 20 3e 4d 61 6b 65 46 69 6c 65 0d |..... >MakeFile.| 00000010 00 14 44 f4 20 43 6f 6e 76 65 72 74 73 20 61 73 |..D. Converts as| 00000020 63 69 69 20 6c 61 74 69 74 75 64 65 20 61 6e 64 |cii latitude and| 00000030 20 6c 6f 6e 67 69 74 75 64 65 20 64 61 74 61 20 | longitude data | 00000040 69 6e 74 6f 20 67 72 61 70 68 69 63 73 20 75 6e |into graphics un| 00000050 69 74 73 0d 00 1e 15 f4 20 66 6f 72 20 21 57 6f |its..... for !Wo| 00000060 72 6c 64 54 69 6d 65 2e 0d 00 28 1b f4 20 50 2e |rldTime...(.. P.| 00000070 45 2e 4d 61 72 73 68 61 6c 6c 20 4a 61 6e 20 31 |E.Marshall Jan 1| 00000080 39 39 33 0d 00 32 19 ee 85 20 3a 20 d9 23 30 20 |993..2... : .#0 | 00000090 3a 20 f6 20 3a 20 f1 9e 20 3a 20 e0 0d 00 3c 1b |: . : .. : ...<.| 000000a0 78 6f 66 66 73 65 74 3d 34 20 3a 20 79 6f 66 66 |xoffset=4 : yoff| 000000b0 73 65 74 3d 33 30 38 0d 00 46 25 6e 61 6d 65 24 |set=308..F%name$| 000000c0 3d 22 3c 57 6f 72 6c 64 54 69 6d 65 24 44 69 72 |="<WorldTime$Dir| 000000d0 3e 2e 4d 41 50 73 6f 75 72 63 65 22 0d 00 50 10 |>.MAPsource"..P.| 000000e0 63 68 25 3d 8e 28 6e 61 6d 65 24 29 0d 00 5a 39 |ch%=.(name$)..Z9| 000000f0 e7 20 63 68 25 3d 30 20 8c 20 f1 22 46 69 6c 65 |. ch%=0 . ."File| 00000100 20 22 3b 6e 61 6d 65 24 3b 22 20 6e 6f 74 20 66 | ";name$;" not f| 00000110 6f 75 6e 64 2e 22 20 3a 20 4b 3d a6 28 35 30 30 |ound." : K=.(500| 00000120 29 20 3a 20 e0 0d 00 64 41 f1 22 43 6f 6e 76 65 |) : ...dA."Conve| 00000130 72 74 69 6e 67 20 6c 61 74 69 74 75 64 65 20 61 |rting latitude a| 00000140 6e 64 20 6c 6f 6e 67 69 74 75 64 65 20 64 61 74 |nd longitude dat| 00000150 61 20 69 6e 74 6f 20 67 72 61 70 68 69 63 73 20 |a into graphics | 00000160 75 6e 69 74 73 22 0d 00 6e 15 f1 22 66 6f 72 20 |units"..n.."for | 00000170 21 57 6f 72 6c 64 54 69 6d 65 22 0d 00 78 0f de |!WorldTime"..x..| 00000180 20 62 75 66 20 a2 23 63 68 25 0d 00 82 0a 50 25 | buf .#ch%....P%| 00000190 3d 62 75 66 0d 00 8c 05 f5 0d 00 96 10 20 6c 69 |=buf......... li| 000001a0 6e 65 24 3d a4 72 65 61 64 0d 00 a0 0c 20 f2 76 |ne$=.read.... .v| 000001b0 61 6c 75 65 73 0d 00 aa 0a 20 f2 63 61 6c 63 0d |alues.... .calc.| 000001c0 00 b4 06 20 f5 0d 00 be 12 20 20 20 6c 69 6e 65 |... ..... line| 000001d0 24 3d a4 72 65 61 64 0d 00 c8 0e 20 20 20 f2 76 |$=.read.... .v| 000001e0 61 6c 75 65 73 0d 00 d2 21 20 20 20 e7 20 6c 61 |alues...! . la| 000001f0 74 3c 3e 30 20 80 20 6c 6f 6e 67 3c 3e 30 20 8c |t<>0 . long<>0 .| 00000200 20 f2 63 61 6c 63 0d 00 dc 15 20 fd 20 6c 61 74 | .calc.... . lat| 00000210 3d 30 20 80 20 6c 6f 6e 67 3d 30 0d 00 e6 20 20 |=0 . long=0... | 00000220 50 25 21 30 3d 26 46 46 46 46 20 3a 20 50 25 21 |P%!0=&FFFF : P%!| 00000230 34 3d 30 20 3a 20 50 25 2b 3d 38 0d 00 f0 0b fd |4=0 : P%+=8.....| 00000240 20 c5 23 63 68 25 0d 00 fa 23 50 25 21 30 3d 26 | .#ch%...#P%!0=&| 00000250 46 46 46 46 20 3a 20 50 25 21 34 3d 26 46 46 46 |FFFF : P%!4=&FFF| 00000260 46 20 3a 20 50 25 2b 3d 38 0d 01 04 37 ff 28 22 |F : P%+=8...7.("| 00000270 53 41 56 45 20 3c 57 6f 72 6c 64 54 69 6d 65 24 |SAVE <WorldTime$| 00000280 44 69 72 3e 2e 4d 61 70 58 59 20 22 2b c3 7e 28 |Dir>.MapXY "+.~(| 00000290 62 75 66 29 2b 22 20 22 2b c3 7e 28 50 25 29 29 |buf)+" "+.~(P%))| 000002a0 0d 01 0e 09 d9 23 63 68 25 0d 01 18 27 2a 53 45 |.....#ch%...'*SE| 000002b0 54 54 59 50 45 20 3c 57 6f 72 6c 64 54 69 6d 65 |TTYPE <WorldTime| 000002c0 24 44 69 72 3e 2e 4d 61 70 58 59 20 44 41 54 41 |$Dir>.MapXY DATA| 000002d0 0d 01 22 05 e0 0d 01 2c 05 3a 0d 01 36 0a dd a4 |.."....,.:..6...| 000002e0 72 65 61 64 0d 01 40 06 20 f5 0d 01 4a 0f 20 20 |read..@. ...J. | 000002f0 20 4c 24 3d be 23 63 68 25 0d 01 54 11 20 fd 20 | L$=.#ch%..T. . | 00000300 a7 4c 24 2c 22 7c 22 29 3d 30 0d 01 5e 08 3d 20 |.L$,"|")=0..^.= | 00000310 4c 24 0d 01 68 05 3a 0d 01 72 0c dd f2 76 61 6c |L$..h.:..r...val| 00000320 75 65 73 0d 01 7c 13 20 49 25 3d a7 6c 69 6e 65 |ues..|. I%=.line| 00000330 24 2c 22 20 22 29 0d 01 86 11 20 6c 61 74 3d bb |$," ").... lat=.| 00000340 28 6c 69 6e 65 24 29 0d 01 90 17 20 6c 6f 6e 67 |(line$).... long| 00000350 3d bb 28 c1 6c 69 6e 65 24 2c 49 25 29 29 0d 01 |=.(.line$,I%))..| 00000360 9a 05 e1 0d 01 a4 05 3a 0d 01 ae 0a dd f2 63 61 |.......:......ca| 00000370 6c 63 0d 01 b8 15 20 59 25 3d 6c 61 74 2a 34 2b |lc.... Y%=lat*4+| 00000380 79 6f 66 66 73 65 74 0d 01 c2 1e 20 58 25 3d 28 |yoffset.... X%=(| 00000390 31 38 30 2b 6c 6f 6e 67 29 2a 33 2e 32 2b 78 6f |180+long)*3.2+xo| 000003a0 66 66 73 65 74 0d 01 cc 1e 20 50 25 21 30 3d 58 |ffset.... P%!0=X| 000003b0 25 20 3a 20 50 25 21 34 3d 59 25 20 3a 20 50 25 |% : P%!4=Y% : P%| 000003c0 2b 3d 38 0d 01 d6 05 e1 0d ff |+=8.......| 000003ca