home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 October / 1991-10.d64 / worldmap64 (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  12KB  |  259 lines

  1. 10 rem copyright 1991 - compute publications intl ltd - all rights reserved
  2. 20 if dk=0 then dk=1:load"world.ml",8,1
  3. 30 y=int(32768/256):x=int((32768/256-y)*256+.5):poke55,x:poke56,y:clr:md=0
  4. 40 poke53280,6:poke53281,6:ox=0:oy=0:sk=200/180:restore
  5. 50 if md=1 then md=0:sys 49152+6:rem text mode
  6. 60 print"[147]":a$="[215]orld[205]ap 64":gosub 870:print
  7. 70 print"[159]":a$="[195]opyright 1991":gosub 870
  8. 80 a$="[195]ompute [208]ublications [201]ntl, [204]td":gosub 870
  9. 90 a$="[193]ll [210]ights [210]eserved":gosub 870:print:print:print"[158]"
  10. 100 ss=90:a$="[208]lease [195]hoose:":gosub 870:print
  11. 110 a$="([205])ercator [208]rojection":gosub 870
  12. 120 a$="([197])quatorial [207]rthographic [208]rojection":gosub 870
  13. 130 a$="([208])olar [207]rthographic [208]rojection":gosub 870
  14. 140 a$="([199])raphic [211]creen":gosub 870
  15. 150 a$="([211])ave [199]raphic":gosub 870:a$="([204])oad [199]raphic":gosub 870
  16. 160 get a$:if a$="" then 160
  17. 170 fl=0:b$="mepgsl"
  18. 180 for x=1 to len(b$):if a$=mid$(b$,x,1) then fl=x
  19. 190 next:if fl=0 then 160
  20. 200 on fl goto 450,230,560,900,770,810
  21. 210 rem -------------------------------
  22. 220 rem equatorial orthographic
  23. 230 print:a$="[195]enter (0-360)?":gosub 870:input cc
  24. 240 if md=0 then md=1:sys 49152+3:rem switch to the graphics screen
  25. 250 sys 49152+12:rem clear screen
  26. 260 r1=ss+127:s1=96
  27. 270 for rs=(NULL)/100 to 2*(NULL) step (NULL)/100
  28. 280 wx=r1:wy=s1:r1=127+ss*cos(rs):s1=96+ss*sin(rs)
  29. 290 x1=wx*sk+ox:y1=(wy*sk+oy)*5/6
  30. 300 x2=r1*sk+ox:y2=(s1*sk+oy)*5/6
  31. 310 gosub 960:next:r1=0:s1=0
  32. 320 read wx,wy:if wx=-1 and wy=-1 then 40
  33. 330 if wx=99 and wy=99 then n3=0:n4=0:goto 320
  34. 340 wx=wx*15-30-cc:if wx>180 then wx=wx-360
  35. 350 if wx<-180 then wx=wx+360
  36. 360 if wx>0 or wx<-180 then n3=0:n4=0:goto 320
  37. 370 gosub 410:if n3=0 and n4=0 then 400
  38. 380 x1=n1*sk+ox:y1=(n2*sk+oy)*5/6
  39. 390 x2=n3*sk+ox:y2=(n4*sk+oy)*5/6:gosub 960
  40. 400 n3=n1:n4=n2:goto320
  41. 410 ir=wx*(NULL)/180:is=wy*(NULL)/180
  42. 420 n1=cos(is)*ss*cos(ir)+127:n2=192-(ss*sin(is)+96):return
  43. 430 rem -------------------------------
  44. 440 rem mercator projection
  45. 450 ss=255/360:if md=0 then md=1:sys 49152+3
  46. 460 sys 49152+12:rem clear screen
  47. 470 read wx,wy:if wx=-1 and wy=-1 then 40
  48. 480 if wx=99 and wy=99 then r1=0:s1=0:goto 470
  49. 490 wy=192-((wy+sgn(wy)*(abs(wy/8)+abs(wy*wy/150)))/1.1*ss+96):wx=wx*15*ss
  50. 500 if r1=0 and s1=0 then 530
  51. 510 x1=r1*sk+ox:y1=(s1*sk+oy)*5/6
  52. 520 x2=wx*sk+ox:y2=(wy*sk+oy)*5/6:gosub 960
  53. 530 r1=wx:s1=wy:goto 470
  54. 540 rem -------------------------------
  55. 550 rem polar orthographic
  56. 560 print:a$="([206])orth or ([211])outh [208]ole?":gosub 870
  57. 570 gosub 1080:if a$="n" then hh=1
  58. 580 r1=ss+127:s1=96:if md=0 then md=1:sys 49152+3
  59. 590 sys 49152+12:rem clear screen
  60. 600 for rs=(NULL)/100 to 2*(NULL) step (NULL)/100
  61. 610 wx=r1:wy=s1:r1=127+ss*cos(rs):s1=96+ss*sin(rs)
  62. 620 x1=wx*sk+ox:y1=(wy*sk+oy)*5/6
  63. 630 x2=r1*sk+ox:y2=(s1*sk+oy)*5/6
  64. 640 gosub 960:next:r1=0:s1=0
  65. 650 read wx,wy:if wx=-1 and wy=-1 then 40
  66. 660 if wx=99 and wy=99 then r1=0:s1=0:goto 650
  67. 670 if hh=1 and wy<0 then r1=0:s1=0:goto 650
  68. 680 if hh=0 and wy>0 then r1=0:s1=0:goto 650
  69. 690 ri=wx*15*(NULL)/180:si=wy*(NULL)/180
  70. 700 wx=127+cos(si)*ss*sin(ri):wy=96+cos(si)*ss*cos(ri):if hh=0 then wy=191-wy
  71. 710 if r1=0 and s1=0 then 740
  72. 720 x1=r1*sk+ox:y1=(s1*sk+oy)*5/6
  73. 730 x2=wx*sk+ox:y2=(wy*sk+oy)*5/6:gosub 960
  74. 740 r1=wx:s1=wy:goto650
  75. 750 rem -------------------------------
  76. 760 rem save routine
  77. 770 if md=0 then md=1:sys 49152+3
  78. 780 sys 49152+15:goto 40
  79. 790 rem -------------------------------
  80. 800 rem load routine
  81. 810 print"[147][215]hat is the name of the picture?":input a$
  82. 820 x=len(a$):poke 53050,x:for y=1 to x:poke 53050+y,asc(mid$(a$,y,1)):next
  83. 830 if md=0 then md=1:sys 49152+3
  84. 840 sys 49152+18:goto 900
  85. 850 rem -------------------------------
  86. 860 rem center text
  87. 870 for x=1 to 20-len(a$)/2:printchr$(32);:next:printa$:return
  88. 880 rem -------------------------------
  89. 890 rem show bitmap
  90. 900 if md=0 then md=1:sys 49152+3
  91. 910 gosub 1080
  92. 920 if md=1 then md=0:print"[147]":sys 49152+6:rem text mode
  93. 930 goto 40
  94. 940 rem -------------------------------
  95. 950 rem draw line
  96. 960 x1=int(x1+.5):y1=199-int(y1+.5)
  97. 970 x2=int(x2+.5):y2=199-int(y2+.5)
  98. 980 if x1>319 or x2>319 or y1>199 or y2>199 then return
  99. 990 v(2)=int(x1/256):v(1)=int((x1/256-v(2))*256+.5)
  100. 1000 v(4)=int(y1/256):v(3)=int((y1/256-v(4))*256+.5)
  101. 1010 v(6)=int(x2/256):v(5)=int((x2/256-v(6))*256+.5)
  102. 1020 v(8)=int(y2/256):v(7)=int((y2/256-v(8))*256+.5)
  103. 1030 for y=0 to 7:poke 53000+y,v(y+1):next
  104. 1040 sys 49152+9:rem draw the line
  105. 1050 return
  106. 1060 rem -------------------------------
  107. 1070 rem wait for key
  108. 1080 get a$:if a$="" then 1080
  109. 1090 return
  110. 1100 rem geographical data
  111. 1110 data 0,25,.5,25,.75,21,.83,22,1.15,8,1.4,10,1.4,15.5,1.9,22,2
  112. 1120 data 22,2.1,23,2.16,20,2.3,19
  113. 1130 data 2.3,15.2,2.5,15.8,2.6,11,2.56,8.5,2.65,8.7,2.74
  114. 1140 data 3,2.95,1.5,2.9,6,2.7,7,2.65,11
  115. 1150 data 2.7,14,2.74,13,2.83,12.5,2.83,11,3,10.5,3,8,3.3,11.5,3.32,14,3.15,18
  116. 1160 data 3.1,20.5,3.23,22,3.38,22,3.56,23,3.65,23.5,4,25.5,4,26.5,4.13,29
  117. 1170 data 4.11,31.5,3.95,36,4.2,37.5,4.05,38,3.9,37.2,3.77,40,3.87,40,4.1,41
  118. 1180 data 4.1,39.5,4.35,40,4.35,38,4.5,38,4.44,35,4.6,36,4.6,37.5,4.54,38.5
  119. 1190 data 4.8,43,4.95,42.8,5.4,49,5.47,52,5.47,53,5.4,54,5.15,53.5,5.57
  120. 1200 data 59.7,5.95,59.5,5.97,60,6.15,59,6.32,59.7,6.3,60
  121. 1210 data 6.5,62,6.75,62.3,6.75,60.5,6.9,62
  122. 1220 data 6.9,61,6.45,56,6.5,51,6.6,52,6.67,53,6.8
  123. 1230 data 53,6.8,58,6.9,60,7.45,60,8,62.5
  124. 1240 data 7.72,65,7.9,64.6,8.05,65.5,8.25,65.8,8.5,64.8,8.5
  125. 1250 data 65.3,8.65,65.3,8.5,66.7,8.4,66.6,8.38,67.2,8.13
  126. 1260 data 68,7.4,70,7.5,68.5,7.35,68,7.28,69.5,6.7
  127. 1270 data 69.5,6.7,71,6.2,71,6,71.5,5.35,72,5.37,70,4.9,70,4.85,69,4.6
  128. 1280 data 71.5,3.5,73.5,3,72,3.5,75,3.48,76.5,3.15
  129. 1290 data 76.5,3,77.5,2.73,77,2.75,76.5,2,75.5
  130. 1300 data 1.7,74.5,1.7,74,1.47,74,1.47,73,.6,73.3,.5,71.5,.5,69,0,70,99
  131. 1310 data 99,11,69,10.45,70,9.55,71,9.15,70,9.1,69
  132. 1320 data 8.95,69,8.9,68.5,9.1,67.5,9.2,67.5,9.2
  133. 1330 data 66.5,9.07,66.5,9.05,67,8.85,66.3,8.8,66.2,8.9,65.5,9.2,65.7,9.3,66
  134. 1340 data 9.35,64.5,9.27,64.5,8.9,62,9,60.5,9.2,60
  135. 1350 data 9.25,60,9.3,60.5,9.3,58.5,9.4,59
  136. 1360 data 9.55,58.5,9.5,57,9.2,55,9,54,9.48,56,9.75,59,9.75,60,9.95,61.5,9.8
  137. 1370 data 60.5,9.8,59.3,10.2,61,10.35,61,10.4,60,10.65,59.5,10.9,58.5,11,59,11.1
  138. 1380 data 59,11.45,51.5,11.8,50.5,11.85,49.5,11.7,49.5,11.75,47,11.7,42.5
  139. 1390 data 11.77,38.5,11.85,37.5,12,35,12.2,34,12.35
  140. 1400 data 29,12.4,28.5,12.45,27,12.42,27,12.42
  141. 1410 data 27.5,12.5,25,12.55,24,12.6,22.5,12.67,23,12.55,25.5,12.4,30,12.38,32
  142. 1420 data 12.48,32,12.51,30,12.75,26,12.75,25
  143. 1430 data 12.92,22,13,19,13.3,16.5,13.6,16,13.7
  144. 1440 data 16.5,13.97,14,14,14,14.5,13,14.25,11,14.25,10.5,14.47,9,14.65,8.5
  145. 1450 data 14.77,9,14.77,8,14.8,7.5,14.82,5,14.8
  146. 1460 data 4,14.7,1,14.6,-1.5,14.7,-2,14.6,-4
  147. 1470 data 14.65,-5,14.7,-7,14.75,-9.5,14.87,-14,15.37,-17,15.3,-25,15.25,-30
  148. 1480 data 15.2,-33,15.2,-37,15.1,-38,15.05,-40.5,15.2,-40,15.1,-46,15,-46.6,15.1
  149. 1490 data -47,15.02,-48,15.06,-51.5,15.1,-51,15.15,-51.8,15.15,-52,15.4,-51
  150. 1500 data 15.35,-50.5,15.55,-48,15.6,-47.3,15.5
  151. 1510 data -46,15.5,-45.4,15.53,-45,15.6,-45,15.65
  152. 1520 data -42.5,15.7,-42.5,15.65,-43,15.62,-41.5,15.75,-41,15.8,-40.5,16.1
  153. 1530 data -39.5,16.2,-37,16.1,-36,16.05,-35,16.45
  154. 1540 data -35.5,16.55,-33,16.65,-30.5,16.75
  155. 1550 data -28,16.77,-24.5,17.1,-23,17.25,-22.5,17.4,-19,17.45,-16,17.46
  156. 1560 data -13,17.65,-7,17.6,-5.5,17.5,-3,17.1,-2.5,16.7,0
  157. 1570 data 16.6,0,16.66,1.5,16.62,1.5,16.6
  158. 1580 data 5,16.55,5.5,16.2,6,15.8,11,15.5,10.5,15.45,11.5,15.3,11.5,15.3,12.5
  159. 1590 data 14.95,11.5,14.8,9,14.77,10,14.5,10
  160. 1600 data 14.45,11,14.47,15,14.45,16,14.1,16,14.2
  161. 1610 data 17,14.25,21.5,14,21.5,13.95,19.5,13.7,19,13.6,20,13.5,23,13.55,28
  162. 1620 data 13.6,30,13.9,30,14,29,14.1,29,14,31,14.35
  163. 1630 data 31,14.4,30,14.45,30,14.47,27,14.55
  164. 1640 data 25,14.6,25,14.6,27.5,14.55,31,14.9,37.5,14.9,38.5,15.1,40,15.4,41
  165. 1650 data 15.37,41,15.34,42,15.5,44.5,15.6,46
  166. 1660 data 15.53,44.5,15.45,44,15.8,46,15.65,46,15.6
  167. 1670 data 49,15.5,48.5,15.55,49,16,49,16.1,50,16.3,50.3,16.3,52,16.2,52,16.2
  168. 1680 data 53,16,53,15.7,60,15.6,59.7,15.6,59,15.45
  169. 1690 data 59,15.45,61,15.3,61.5,14.8,62,14.8,60
  170. 1700 data 14.75,59,14.8,58,14.85,56.5,14.75,55,14.8,51.5,14.7,51.5,14.65,52.5
  171. 1710 data 14.65,55,14.3,