Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » Regulars » StarInfo/Whitehouse/!Trees/WTrees

StarInfo/Whitehouse/!Trees/WTrees

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » Regulars
Filename: StarInfo/Whitehouse/!Trees/WTrees
Read OK:
File size: 3633 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM -wt-
   20STOP
   30
   40DEFPROCtrees_startup
   50PROCcodevars
   60PROCinit1
   70PROCcodesetup
   80PROCe_start
   90PROCe_claim(2000)
  100tree_done%=FALSE
  110ENDPROC
  120
  130DEFPROCtrees_draw
  140PROCreadvars
  150wimpmode%=MODE
  160SYS "Hourglass_On"
  170time%=TIME
  180
  190LOCAL ERROR
  200ON ERROR LOCAL:PROCrelease_screen:PROCerror(REPORT$):OSCLI("POINTER 1"):ENDPROC
  210MODE 15
  220b%!0=149:b%!4=-1
  230SYS "OS_ReadVduVariables",b%,b%:A%!vars_screenstart=b%!0
  240IF updates PRINTTAB(0,0);"Please wait..."
  250*FX 200,1
  260PROCcodesetup2
  270PROCterrain_start
  280PROCmake_branchtable
  290
  300PROCgrass
  310PROCforest
  320PROCsort
  330SYS "Hourglass_Off"
  340PROCdraw
  350secs=(TIME-time%)/100
  360IF updates PRINTTAB(0,0);"Total time ";secs DIV 60;" mins ";secs MOD 60;".";secs*100 MOD 100;" secs.         "
  370*FX 21,0
  380key$=GET$
  390SYS "OS_SpriteOp",256+16,display_buffer%,"treesprite",0,0,0,1279,1023
  400PROCrelease_screen
  410!pb%=display_H% : SYS "Tempest_ShowWindow",1,pb%,tb%
  420tree_done%=TRUE
  430ENDPROC
  440:
  450DEFPROCrelease_screen
  460MODE wimpmode%
  470SYS "Wimp_SetMode",wimpmode%
  480SYS "Wimp_ForceRedraw",-1,0,0,tb%!940,tb%!944
  490*POINTER 1
  500ENDPROC
  510:
  520DEFPROCfull_screen
  530wimpmode%=MODE
  540MODE15
  550SYS "OS_SpriteOp",34+256,display_buffer%,"treesprite",0,0,0
  560*FX 200,1
  570A$=GET$
  580PROCrelease_screen
  590tb%!0=0 : REM never allow menu to be reopened
  600ENDPROC
  610:
  620:
  630DEFPROCinit1
  640max_br=2000
  650DIM b_x(max_br),b_y(max_br),b_z(max_br),b_xa%(max_br),b_za%(max_br), b_sz(max_br)
  660DIM r_x%(10),r_z%(10), tree_x(10), tree_z(10)
  670ENDPROC
  680:
  690DEFPROCe_claim(size%)
  700SYS "Wimp_SlotSize",size%*1024,-1 TO mem%
  710mem%=mem%-(HIMEM-PAGE)-128
  720
  730max_recs=mem% DIV 24
  740IF max_recs>4*65536 THEN max_recs=65536*4
  750coderecs=HIMEM+4
  760sort=coderecs+max_recs*20
  770needval%=TRUE:PROCe_validate
  780
  790A%!vars_sortmem=sort
  800A%!vars_rectmem=coderecs
  810ENDPROC
  820:
  830:
  840DEFPROCforest
  850PROCdisperse(num_trees,TRUE) :REM allocate posns of trees
  860FOR tree%=1 TO num_trees
  870  b_sz(0)=t_len
  880  b_x(0)=(tree_x(tree%)-g_size/2)*g_gap
  890  b_z(0)=(tree_z(tree%)-g_size/2)*g_gap
  900  PROCrotatey2(b_x(0),b_z(0),g_ang)
  910  b_y(0)=0
  920  PROCtree
  930  t_shape+=17
  940  b_sides+=b_resred*(b_splits+1)
  950  b_sects+=b_resred*(b_splits+1)
  960NEXT
  970t_shape-=num_trees*17
  980IFupdates PRINTTAB(0,0);"Calculation time ";(TIME-time%)/100;" secs.        "
  990ENDPROC
 1000:
 1010DEFPROCrotatey2(RETURN XX,RETURN ZZ,yyy) :REM for PROCforest
 1020xx=XX*FNcos(yyy)-ZZ*FNsin(yyy)
 1030ZZ=ZZ*FNcos(yyy)+XX*FNsin(yyy)
 1040XX=xx
 1050ENDPROC
 1060:
 1070DEF PROCtree
 1080LOCAL xa,za,ok%,t1%,t2%,sm2%,split%
 1090sm2%=b_splitmin^2 :REM faster if this is pre-calculated
 1100
 1110PROCbranch(0)
 1120tree=RND(-t_shape)
 1130branch=0:branches=0
 1140REPEAT
 1150  PROCrotate(0,b_sz(branch),0,xp,yp,zp,b_xa%(branch),b_za%(branch))
 1160  REPEAT
 1170    FOR split%=0 TO b_sprout-1
 1180      r_x%(split%)=RND(b_splitmax*2)-b_splitmax
 1190      r_z%(split%)=RND(b_splitmax*2)-b_splitmax
 1200    NEXT
 1210    ok%=TRUE
 1220    IF b_sprout>1 THEN
 1230      FOR t1%=1 TO b_sprout-1:FOR t2%=0 TO t1%-1
 1240          IF (r_x%(t2%)-r_x%(t1%))^2 + (r_z%(t2%)-r_z%(t1%))^2<sm2% ok%=0
 1250      NEXT:NEXT
 1260    ENDIF
 1270  UNTIL ok%
 1280  FOR split%=0 TO b_sprout-1
 1290    PROCsprout(branch,r_x%(split%),r_z%(split%))
 1300  NEXT
 1310  branch+=1
 1320UNTIL branches+1=num_branches
 1330ENDPROC
 1340:
 1350DEF PROCsprout(nb%,xa%,za%)
 1360branches+=1
 1370b_x(branches)=b_x(nb%)+xp
 1380b_y(branches)=b_y(nb%)+yp
 1390b_z(branches)=b_z(nb%)+zp
 1400b_xa%(branches)=(b_xa%(nb%)+xa%+360) MOD 360
 1410b_za%(branches)=(b_za%(nb%)+za%+360) MOD 360
 1420b_sz(branches)=b_sz(nb%)*b_shrink
 1430PROCbranch(branches)
 1440ENDPROC
 1450:
 1460DEF PROCbranch(pb%)
 1470REM this info can be used by both leaves and branches code
 1480A%!lv_xdata=b_x(pb%)
 1490A%!lv_ydata=b_y(pb%)
 1500A%!lv_zdata=b_z(pb%)
 1510A%!lv_sizedata=b_sz(pb%) *256
 1520A%!lv_xa_data=b_xa%(pb%)
 1530A%!lv_za_data=b_za%(pb%)
 1540w=b_sz(pb%)/t_len*b_width *256
 1550A%!br_wdata=w :REM width rating, could be calc'ed by code but simpler here
 1560A%!vars_l_size=b_sz(pb%)/t_len*l_size*2
 1570
 1580IF b_splits-FNgen(pb%)<l_gens AND l_on THEN B%=vec_leaves:CALL entrypoint
 1590B%=vec_branch:CALL entrypoint
 1600
 1610IF newgen AND b_resred>0 THEN
 1620  b_sects-=b_resred
 1630  b_sides-=b_resred
 1640  PROCmake_branchtable
 1650ENDIF
 1660
 1670IF updates THEN
 1680  PRINTTAB(0,0);"Tree ";tree%;" : ";(pb%*100 DIV num_branches);"%      "
 1690ENDIF
 1700ENDPROC
 1710:
 1720:
 1730DEF PROCmake_branchtable  :REM controls positions of component parts of br.
 1740IF b_sects<4 THEN b_sects=4
 1750IF b_sides<6 THEN b_sides=6
 1760A%!vars_b_recs=b_sides*b_sects
 1770A%!vars_b_sides=b_sides
 1780
 1790LOCAL ang%,rad,rec%,y%
 1800FOR y%=0 TO b_sects+1
 1810  rad=1-y%*(1-b_shrink)/b_sects
 1820  FOR ang%=0 TO b_sides+1
 1830    rec%=y%*b_sides+ang%
 1840    ptr%=A%!vars_qmem+rec%*16
 1850    !ptr%=rad*!(A%!vars_cosmem+4*((ang%*360/b_sides+90) MOD 360)) DIV256
 1860    ptr%!4=y%/b_sects *256
 1870    ptr%!8=rad*!(A%!vars_sinmem+4*((ang%*360/b_sides+90) MOD 360)) DIV256
 1880    ptr%!12=ABS(180-ang%*360/b_sides)/180*2.99
 1890  NEXT
 1900NEXT
 1910ENDPROC
 1920:
 1930DEF FNgen(bb%)  :REM finds branch depth from serial number
 1940gen%=-1
 1950cnt%=0
 1960REPEAT
 1970  gen%+=1
 1980  cnt%+=b_sprout^gen%
 1990UNTIL cnt%>bb%
 2000newgen=(cnt%=bb%+1) :REM set only for LAST branch of each generation
 2010=gen%
 2020:
 2030DEF PROCsort
 2040t%=TIME
 2050B%=vec_sortcopy:CALL entrypoint
 2060SYS "OS_HeapSort",A%!vars_rects+1,sort,1
 2070IF updates PRINTTAB(0,0);"Sort time = ";(TIME-t%)/100;" secs.        "
 2080ENDPROC
 2090:
 2100DEF PROCdraw
 2110B%=vec_draw:CALL entrypoint
 2120ENDPROC
 2130:
 2140DEF FNbranches
 2150cnt%=0
 2160FOR gen%=0 TO b_splits
 2170  cnt%+=b_sprout^gen%
 2180NEXT
 2190=cnt%
 2200:
 2210DEF FNleaves
 2220cnt%=0
 2230FOR gen%=0 TO b_splits
 2240  IF gen%>b_splits-l_gens cnt%+=(b_sprout^gen%)
 2250NEXT
 2260=cnt%*l_num
 2270:
 2280DEF PROCrotate(XX,yy,ZZ,RETURN xx,RETURN yy,RETURN zz,xxx%,zzz%)
 2290YY=yy*FNcos(xxx%)-ZZ*FNsin(xxx%)
 2300zz=ZZ*FNcos(xxx%)+yy*FNsin(xxx%)
 2310xx=XX*FNcos(zzz%)-YY*FNsin(zzz%)
 2320yy=YY*FNcos(zzz%)+XX*FNsin(zzz%)
 2330ENDPROC
 2340:
 2350DEFFNsin(t%)
 2360=!(A%!vars_sinmem+4*t%)/65536
 2370DEFFNcos(t%)
 2380=!(A%!vars_cosmem+4*t%)/65536
 2390:
 2400:
 2410: REM ************ the next bits do the grass, terrain and the tree posns
 2420:
 2430DEFPROCgrass
 2440IF NOT g_on OR g_size<=0 ENDPROC
 2450
 2460A%!vars_g_max=g_size
 2470A%!vars_g_stop=(g_size-2)*g_gap/2 :REM highest coord TO USE
 2480A%!vars_g_width=g_gap
 2490A%!vars_g_start=-g_size*g_gap/2 :REM lowest coord TO USE (ie go inclusively)
 2500A%!vars_g_ang=g_ang
 2510
 2520B%=vec_grass:CALL entrypoint
 2530IF gr_on THEN PROCterrain
 2540ENDPROC
 2550:
 2560DEFPROCterrain
 2570B%=vec_advgrass:CALL entrypoint
 2580ENDPROC
 2590:
 2600DEFPROCterrain_start
 2610REM called at beginning of each forest to initialise the terrain
 2620gr_zoom=26/g_size :REM if grid small then increase peakiness per square
 2630A%!gr_attractors=3
 2640
 2650PROCdisperse(3,FALSE)
 2660
 2670ptr%=A%+gr_attractor1
 2680FOR w%=1 TO 3
 2690  !ptr%=tree_x(w%)
 2700  ptr%!4=tree_z(w%)
 2710  ptr%!8=3
 2720  ptr%!12=(RND(40)+50)/gr_zoom
 2730  ptr%+=16
 2740NEXT
 2750A%!gr_attbase=-256*(3.2+1.6*A%!gr_attractors)*gr_zoom
 2760ENDPROC
 2770:
 2780DEFPROCdisperse(max%,t%)
 2790LOCAL ok%,tries%
 2800REPEAT
 2810  tries%+=1
 2820  ok%=TRUE
 2830  FOR w%=1 TO max%
 2840    IF w%=1 AND gr_middle THEN
 2850      tree_x(1)=g_size DIV 2
 2860      tree_z(1)=g_size DIV 2
 2870    ELSE
 2880      tree_x(w%)=RND(g_size-3)
 2890      tree_z(w%)=RND(g_size-3) :REM keeps away from edge by 1
 2900    ENDIF
 2910    IF w%>1 THEN
 2920      FOR x%=1 TO w%-1
 2930        test%=2*ABS(tree_x(w%)-tree_x(x%))+ABS(tree_z(w%)-tree_z(x%))
 2940        IF test%*gr_zoom<gr_disp THEN ok%=FALSE
 2950      NEXT x%
 2960    ENDIF
 2970    IF t% THEN IF FNheight(tree_x(w%),tree_z(w%))=0 THEN ok%=FALSE
 2980  NEXT
 2990  IF tries% MOD 10=9 THEN gr_disp-=1
 3000UNTIL ok% OR tries%=200
 3010IF NOT ok% THEN ERROR 255,"Couldn't allocate terrain/tree positions.  Reduce separation."
 3020ENDPROC
 3030:
 3040DEFFNheight(x%,z%)
 3050=(!(A%!vars_rectmem+4+x%*20+z%*20*g_size) AND &1FF800)
 3060REM not actual height, just enough to test whether height=0
 3070:
 3080:
 3090:REM ***************** armcode things
 3100:
 3110:
 3120DEFPROCcodevars
 3130REM names of armcode global variables starting at addr in A%
 3140vars_sinmem=0:vars_cosmem=4:vars_rndRND=8:vars_rectmem=12
 3150vars_g_stop=16
 3160vars_rects=20
 3170vars_g_start=24:vars_g_max=28:vars_g_width=32:vars_g_ang=36
 3180vars_l_size=40
 3190vars_b_shrink=44:vars_b_width=48
 3200vars_l_num=52
 3210vars_test=56
 3220vars_qmem=60
 3230vars_b_recs=64:vars_b_sides=68
 3240vars_zoom=72:vars_sortmem=76
 3250lv_xdata=80:lv_ydata=84:lv_zdata=88:lv_sizedata=92:lv_xa_data=96
 3260lv_za_data=100:lv_wdata=104:br_wdata=104:br_za_data=100
 3270br_xdata=80:br_ydata=84:br_zdata=88:br_sizedata=92:br_xa_data=96
 3280gr_attractors=108:gr_attbase=112
 3290gr_attractor1=116
 3300vars_point1x=172:vars_point1y=176
 3310vars_point2x=180:vars_point2y=184
 3320vars_point3x=188:vars_point3y=192
 3330vars_vector1=196:vars_vector2=200:vars_vector3=204
 3340vars_colour=208
 3350vars_rect=212 :REM 4*2 words
 3360vars_water_basecolour=244:vars_ground_maxcolour=248
 3370vars_ground_minshift=252
 3380vars_screenstart=256
 3390
 3400vec_null=0:vec_random=1:vec_grass=2:vec_leaves=3:vec_branch=4:vec_draw=5
 3410vec_sortcopy=6:vec_advgrass=7
 3420ENDPROC
 3430:
 3440:
 3450DEFPROCcodesetup : REM happens only at beginning of program
 3460DIM codetables 3000
 3470DIM codeq 8000 :REM gives maximum b_recs+add=500
 3480
 3490DIM codemem 3500
 3500entry=codemem:entrypoint=codemem
 3510OSCLI("LOAD <Obey$Dir>.armcode "+STR$~(codemem))
 3520
 3530DIM A% 2048
 3540IF A% MOD 1024<>0 THEN A%+=1024-(A% MOD 1024)
 3550
 3560A%!vars_qmem=codeq
 3570A%!vars_sinmem=codetables
 3580A%!vars_cosmem=codetables+361*4
 3590FOR w%=0 TO 360
 3600  !(A%!vars_sinmem+w%*4)=SIN(RAD(w%))*65536
 3610  !(A%!vars_cosmem+w%*4)=COS(RAD(w%))*65536
 3620NEXT
 3630
 3640ENDPROC
 3650:
 3660:
 3670DEFPROCcodesetup2
 3680REM sets up variables for each tree
 3690A%!vars_rndRND=RND(TIME)
 3700w%=RND(-TIME)
 3710A%!vars_rects=-1
 3720A%!vars_b_width=b_width
 3730A%!vars_b_shrink=b_shrink
 3740A%!vars_l_size=l_size
 3750A%!vars_l_num=l_num
 3760A%!vars_zoom=zoom
 3770ENDPROC
 3780:
 3790:
 3800: REM ************* e_ - options editor ******************
 3810:
 3820:
 3830DEFPROCe_start
 3840RESTORE+0:READ e_nv%
 3850e_arm=1:e_limit%=TRUE
 3860DIM e_base%(e_nv%),e_val%(e_nv%),e_min%(e_nv%),e_max%(e_nv%),e_inc%(e_nv%)
 3870DIM e_name$(e_nv%), e_wind%(e_nv%),e_icon%(e_nv%)
 3880FOR w%=1 TO e_nv%
 3890  READ e_base%(w%),e_min%(w%),e_max%(w%),e_inc%(w%)
 3900  READ e_name$(w%),w$,x$
 3910  e_wind%(w%)=EVAL(w$)
 3920  e_icon%(w%)=EVAL(x$)
 3930NEXT
 3940e_val%()=e_base%()
 3950PROCe_writeall
 3960e_mark%=1:e_misc%=TRUE
 3970ENDPROC
 3980:
 3990:
 4000DEFPROCe_scroll
 4010LOCAL window%,icon%, vector%, index%, match%
 4020window%=b%!20
 4030icon%=b%!24
 4040vector%=b%!28
 4050FOR index%=1 TO e_nv%
 4060  IF window%=e_wind%(index%) AND icon%=e_icon%(index%) THEN match%=index%
 4070NEXT
 4080
 4090e_val%(match%)=FNrange(e_val%(match%)+e_inc%(match%)*vector%,e_min%(match%),e_max%(match%))
 4100PROCe_write(match%)
 4110needval%=TRUE:PROCe_validate
 4120ENDPROC
 4130:
 4140DEFPROCe_writeall
 4150LOCAL index%
 4160FOR index%=1 TO e_nv%
 4170  PROCe_write(index%)
 4180NEXT
 4190ENDPROC
 4200:
 4210DEFPROCe_write(index%)
 4220IF e_wind%(index%)=0 THEN ENDPROC
 4230LOCAL w$
 4240w$=STR$e_val%(index%)
 4250IF e_min%(index%)=-1 THEN
 4260  IF e_val%(index%)=-1 THEN w$="On" ELSE w$="Off"
 4270ENDIF
 4280SYS "Tempest_SetIconText",e_wind%(index%),e_icon%(index%),tb%,w$
 4290ENDPROC
 4300:
 4310:
 4320DEFPROCreadvars
 4330t_shape=e_val%(1)
 4340t_len=e_val%(2)
 4350gr_on=e_val%(3)
 4360g_size=e_val%(4)
 4370g_ang=e_val%(5)
 4380g_gap=e_val%(6)
 4390b_sides=e_val%(7)
 4400b_sects=e_val%(8)
 4410b_resred=e_val%(9)
 4420b_sprout=e_val%(10)
 4430b_splits=e_val%(11)
 4440b_shrink=e_val%(12)/100
 4450b_width=e_val%(13)
 4460b_splitmax=e_val%(14)
 4470b_splitmin=e_val%(15)
 4480l_on=e_val%(16)
 4490l_num=e_val%(17)
 4500l_size=e_val%(18)
 4510l_gens=e_val%(19)
 4520zoom=e_val%(20)
 4530num_trees=e_val%(21)
 4540IF num_trees>1 THEN gr_disp=e_val%(22) ELSE gr_disp=0
 4550gr_middle=e_val%(23)
 4560
 4570g_on=TRUE
 4580num_branches=FNbranches
 4590updates=TRUE
 4600A%!vars_water_basecolour=&00030000
 4610A%!vars_ground_maxcolour=&03000301
 4620A%!vars_ground_minshift=8
 4630peakiness=1
 4640ENDPROC
 4650:
 4660:
 4670DEFPROCe_validate :REM checks settings are possible, and prints misc info
 4680LOCAL nexterr%
 4690nexterr%=mainwindow_X1%
 4700PROCreadvars
 4710
 4720valid%=TRUE
 4730b_recs=b_sides*b_sects
 4740recs=FNe_branchparts :REM below, returns number of parts needed for branches
 4750IF l_on recs+=FNleaves
 4760recs=recs*num_trees
 4770IF g_on recs+=g_size^2
 4780numrecs=recs
 4790add=b_sides*2+1
 4800memneed%=recs*24
 4810
 4820IF (g_size*1.5-gr_disp*1.75)^2<3^(num_trees-1) THEN PROCe_err("Tree separation too high")
 4830IF memneed%>mem% THEN PROCe_err("Insufficient memory.")
 4840IF b_recs+add>500 THEN PROCe_err("Too many segments per branch.")
 4850IF FNbranches>max_br THEN PROCe_err("Too many branches.")
 4860IF b_splitmax*2-b_splitmin<(b_sprout^3) PROCe_err("Branch angles too restrictive.")
 4870
 4880SYS "Tempest_SetIconText",mainhandle%,mainwindow_mem%,tb%,STR$(mem% DIV 1024)+"k"
 4890SYS "Tempest_SetIconText",mainhandle%,mainwindow_memneed%,tb%,STR$(memneed% DIV 1024)+"k"
 4900
 4910REM s=INT(e_arm*recs/1000+2+num_trees*b_splits)
 4920
 4930WHILE nexterr%<mainwindow_Xmax%
 4940  SYS "Tempest_SetIconText",mainhandle%,nexterr%,tb%,""
 4950  nexterr%+=1
 4960ENDWHILE
 4970!pb%=mainhandle% : pb%!4=mainwindow_start%
 4980pb%!8=(1+valid%)<<22 : pb%!12=1<<22
 4990SYS "Tempest_EnsureIconState",,pb%,tb%
 5000
 5010needval%=FALSE
 5020ENDPROC
 5030:
 5040DEFPROCe_err(str$)
 5050SYS "Tempest_SetIconText",mainhandle%,nexterr%,tb%,str$
 5060valid%=FALSE
 5070nexterr%+=1
 5080ENDPROC
 5090:
 5100DEFFNe_branchparts
 5110cnt%=0
 5120FOR w%=0 TO b_splits
 5130  x%=b_sects-b_resred*w%:IF x%<4 x%=4
 5140  y%=b_sides-b_resred*w%:IF y%<6 y%=6
 5150  cnt%+=(b_sprout^w%)*x%*y%
 5160NEXT
 5170=cnt%
 5180:
 5190:
 5200DATA 23
 5210DATA 6,1,99,1,"Tree shape",general_H%,general_shape%
 5220DATA 100,50,200,5,"Length of tree trunk",trunk_H%,trunk_length%
 5230DATA -1,-1,0,-1,"Terrain on? *",0,0
 5240DATA 26,16,40,2,"Grass pattern size",greens_H%,greens_numsegs%
 5250DATA 30,0,90,5,"Grass display angle",greens_H%,greens_rotation%
 5260DATA 12,10,36,2,"Grass segment size",greens_H%,greens_segsize%
 5270DATA 15,7,25,1,"Branch sides",trunk_H%,trunk_segcirc%
 5280DATA 15,6,30,1,"Branch sections",trunk_H%,trunk_seglength%
 5290DATA 1,0,2,1,"Resolution reduction *",branching_H%,branching_resred%
 5300DATA 3,1,4,1,"Branch splits into...",branching_H%,branching_splits%
 5310DATA 3,1,7,1,"Number of branch splittings",branching_H%,branching_gens%
 5320DATA 80,50,96,2,"Branch shrink ratio (%)",branching_H%,branching_scale%
 5330DATA 10,5,30,1,"Branch width",trunk_H%,trunk_width%
 5340DATA 50,30,65,5,"Maximum split angle",branching_H%,branching_maxangle%
 5350DATA 45,20,70,5,"Minimum split separation",branching_H%,branching_minangle%
 5360DATA -1,-1,0,-1,"Leaves on?",greens_H%,greens_leaves%
 5370DATA 30,8,50,2,"Number leaves",greens_H%,greens_leafcount%
 5380DATA 12,5,25,1,"Leaf size",greens_H%,greens_leafsize%
 5390DATA 1,1,3,1,"Leaf generations",greens_H%,greens_leafgens%
 5400DATA 2000,1000,4000,100,"Zoom",general_H%,general_zoom%
 5410DATA 1,1,10,1,"Number of trees *",general_H%,general_numtrees%
 5420DATA 15,0,30,3,"Minumum dispersion *",general_H%,general_dispersion%
 5430DATA -1,-1,0,-1,"Central tree? *",general_H%,general_central%


� -wt-
�

(��trees_startup
2
�codevars
<
�init1
F�codesetup
P�e_start
Z�e_claim(2000)
dtree_done%=�
n�
x
���trees_draw
�
�readvars
�wimpmode%=�
�ș "Hourglass_On"
�time%=�
�
�� �
�5� � �:�release_screen:�error(�$):�("POINTER 1"):�
�� 15
�b%!0=149:b%!4=-1
�;ș "OS_ReadVduVariables",b%,b%:A%!vars_screenstart=b%!0
�%� updates �0,0);"Please wait..."
�
*FX 200,1
�codesetup2
�terrain_start
�make_branchtable
"
,
�grass
6�forest
@	�sort
Jș "Hourglass_Off"
T	�draw
^secs=(�-time%)/100
hd� updates �0,0);"Total time ";secs � 60;" mins ";secs � 60;".";secs*100 � 100;" secs.         "
r*FX 21,0
|
key$=�
�Hș "OS_SpriteOp",256+16,display_buffer%,"treesprite",0,0,0,1279,1023
��release_screen
�7!pb%=display_H% : ș "Tempest_ShowWindow",1,pb%,tb%
�tree_done%=�
��
�:
���release_screen
�� wimpmode%
�ș "Wimp_SetMode",wimpmode%
�0ș "Wimp_ForceRedraw",-1,0,0,tb%!940,tb%!944
�*POINTER 1
��
�:
��full_screen
wimpmode%=�
�15
&>ș "OS_SpriteOp",34+256,display_buffer%,"treesprite",0,0,0
0
*FX 200,1
:A$=�
D�release_screen
N/tb%!0=0 : � never allow menu to be reopened
X�
b:
l:
v��init1
�max_br=2000
�S� b_x(max_br),b_y(max_br),b_z(max_br),b_xa%(max_br),b_za%(max_br), b_sz(max_br)
�/� r_x%(10),r_z%(10), tree_x(10), tree_z(10)
��
�:
���e_claim(size%)
�+ș "Wimp_SlotSize",size%*1024,-1 � mem%
�mem%=mem%-(�-�)-128
�
�max_recs=mem% � 24
�)� max_recs>4*65536 � max_recs=65536*4
�coderecs=�+4
�sort=coderecs+max_recs*20
needval%=�:�e_validate

A%!vars_sortmem=sort
 A%!vars_rectmem=coderecs
*�
4:
>:
H��forest
R5�disperse(num_trees,�) :� allocate posns of trees
\� tree%=1 � num_trees
f  b_sz(0)=t_len
p+  b_x(0)=(tree_x(tree%)-g_size/2)*g_gap
z+  b_z(0)=(tree_z(tree%)-g_size/2)*g_gap
�$  �rotatey2(b_x(0),b_z(0),g_ang)
�  b_y(0)=0
�  �tree
�  t_shape+=17
�$  b_sides+=b_resred*(b_splits+1)
�$  b_sects+=b_resred*(b_splits+1)
��
�t_shape-=num_trees*17
�F�updates �0,0);"Calculation time ";(�-time%)/100;" secs.        "
��
�:
�/��rotatey2(� XX,� ZZ,yyy) :� for PROCforest
� xx=XX*�cos(yyy)-ZZ*�sin(yyy)
 ZZ=ZZ*�cos(yyy)+XX*�sin(yyy)
	XX=xx
�
$:
.� �tree
8#� xa,za,ok%,t1%,t2%,sm2%,split%
B9sm2%=b_splitmin^2 :� faster if this is pre-calculated
L
V�branch(0)
`tree=�(-t_shape)
jbranch=0:branches=0
t�
~D  �rotate(0,b_sz(branch),0,xp,yp,zp,b_xa%(branch),b_za%(branch))
�  �
�    � split%=0 � b_sprout-1
�1      r_x%(split%)=�(b_splitmax*2)-b_splitmax
�1      r_z%(split%)=�(b_splitmax*2)-b_splitmax
�	    �
�
    ok%=�
�    � b_sprout>1 �
�.      � t1%=1 � b_sprout-1:� t2%=0 � t1%-1
�L          � (r_x%(t2%)-r_x%(t1%))^2 + (r_z%(t2%)-r_z%(t1%))^2<sm2% ok%=0
�
      �:�
�	    �
�  � ok%
  � split%=0 � b_sprout-1

1    �sprout(branch,r_x%(split%),r_z%(split%))
  �
  branch+=1
(� branches+1=num_branches
2�
<:
F� �sprout(nb%,xa%,za%)
Pbranches+=1
Zb_x(branches)=b_x(nb%)+xp
db_y(branches)=b_y(nb%)+yp
nb_z(branches)=b_z(nb%)+zp
x.b_xa%(branches)=(b_xa%(nb%)+xa%+360) � 360
�.b_za%(branches)=(b_za%(nb%)+za%+360) � 360
�%b_sz(branches)=b_sz(nb%)*b_shrink
��branch(branches)
��
�:
�� �branch(pb%)
�<� this info can be used by both leaves and branches code
�A%!lv_xdata=b_x(pb%)
�A%!lv_ydata=b_y(pb%)
�A%!lv_zdata=b_z(pb%)
�!A%!lv_sizedata=b_sz(pb%) *256
�A%!lv_xa_data=b_xa%(pb%)
�A%!lv_za_data=b_za%(pb%)
"w=b_sz(pb%)/t_len*b_width *256
LA%!br_wdata=w :� width rating, could be calc'ed by code but simpler here
+A%!vars_l_size=b_sz(pb%)/t_len*l_size*2
"
,C� b_splits-�gen(pb%)<l_gens � l_on � B%=vec_leaves:� entrypoint
6B%=vec_branch:� entrypoint
@
J� newgen � b_resred>0 �
T  b_sects-=b_resred
^  b_sides-=b_resred
h  �make_branchtable
r�
|
�� updates �
�C  �0,0);"Tree ";tree%;" : ";(pb%*100 � num_branches);"%      "
��
��
�:
�:
�H� �make_branchtable  :� controls positions of component parts of br.
�� b_sects<4 � b_sects=4
�� b_sides<6 � b_sides=6
�"A%!vars_b_recs=b_sides*b_sects
�A%!vars_b_sides=b_sides
�
�� ang%,rad,rec%,y%
� y%=0 � b_sects+1
#  rad=1-y%*(1-b_shrink)/b_sects
  � ang%=0 � b_sides+1
&    rec%=y%*b_sides+ang%
0!    ptr%=A%!vars_qmem+rec%*16
:H    !ptr%=rad*!(A%!vars_cosmem+4*((ang%*360/b_sides+90) � 360)) �256
D    ptr%!4=y%/b_sects *256
NI    ptr%!8=rad*!(A%!vars_sinmem+4*((ang%*360/b_sides+90) � 360)) �256
X0    ptr%!12=�(180-ang%*360/b_sides)/180*2.99
b  �
l�
v�
�:
�9� �gen(bb%)  :� finds branch depth from serial number
�gen%=-1
�
cnt%=0
��
�
  gen%+=1
�  cnt%+=b_sprout^gen%
�� cnt%>bb%
�Fnewgen=(cnt%=bb%+1) :� set only for LAST branch of each generation
�	=gen%
�:
�� �sort
�t%=�
 B%=vec_sortcopy:� entrypoint
+ș "OS_HeapSort",A%!vars_rects+1,sort,1
?� updates �0,0);"Sort time = ";(�-t%)/100;" secs.        "
 �
*:
4� �draw
>B%=vec_draw:� entrypoint
H�
R:
\� �branches
f
cnt%=0
p� gen%=0 � b_splits
z  cnt%+=b_sprout^gen%
��
�	=cnt%
�:
�
� �leaves
�
cnt%=0
�� gen%=0 � b_splits
�2  � gen%>b_splits-l_gens cnt%+=(b_sprout^gen%)
��
�=cnt%*l_num
�:
�0� �rotate(XX,yy,ZZ,� xx,� yy,� zz,xxx%,zzz%)
�"YY=yy*�cos(xxx%)-ZZ*�sin(xxx%)
�"zz=ZZ*�cos(xxx%)+yy*�sin(xxx%)
	"xx=XX*�cos(zzz%)-YY*�sin(zzz%)
	"yy=YY*�cos(zzz%)+XX*�sin(zzz%)
	�
	$:
	.
ݤsin(t%)
	8!=!(A%!vars_sinmem+4*t%)/65536
	B
ݤcos(t%)
	L!=!(A%!vars_cosmem+4*t%)/65536
	V:
	`:
	jK: � ************ the next bits do the grass, terrain and the tree posns
	t:
	~��grass
	�� � g_on � g_size<=0 �
	�
	�A%!vars_g_max=g_size
	�=A%!vars_g_stop=(g_size-2)*g_gap/2 :� highest coord TO USE
	�A%!vars_g_width=g_gap
	�NA%!vars_g_start=-g_size*g_gap/2 :� lowest coord TO USE (ie go inclusively)
	�A%!vars_g_ang=g_ang
	�
	�B%=vec_grass:� entrypoint
	�� gr_on � �terrain
	��
	�:

��terrain

 B%=vec_advgrass:� entrypoint
�
:
(��terrain_start
2B� called at beginning of each forest to initialise the terrain
<Igr_zoom=26/g_size :� if grid small then increase peakiness per square
FA%!gr_attractors=3
P
Z�disperse(3,�)
d
nptr%=A%+gr_attractor1
x� w%=1 � 3
�  !ptr%=tree_x(w%)
�  ptr%!4=tree_z(w%)
�  ptr%!8=3
�   ptr%!12=(�(40)+50)/gr_zoom
�  ptr%+=16
��
�9A%!gr_attbase=-256*(3.2+1.6*A%!gr_attractors)*gr_zoom
��
�:
���disperse(max%,t%)
�� ok%,tries%
��
�  tries%+=1
  ok%=�
  � w%=1 � max%
    � w%=1 � gr_middle �
"      tree_x(1)=g_size � 2
,      tree_z(1)=g_size � 2
6	    �
@       tree_x(w%)=�(g_size-3)
J=      tree_z(w%)=�(g_size-3) :� keeps away from edge by 1
T	    �
^    � w%>1 �
h      � x%=1 � w%-1
rE        test%=2*�(tree_x(w%)-tree_x(x%))+�(tree_z(w%)-tree_z(x%))
|+        � test%*gr_zoom<gr_disp � ok%=�
�      � x%
�	    �
�9    � t% � � �height(tree_x(w%),tree_z(w%))=0 � ok%=�
�  �
�"  � tries% � 10=9 � gr_disp-=1
�� ok% � tries%=200
�S� � ok% � � 255,"Couldn't allocate terrain/tree positions.  Reduce separation."
��
�:
�ݤheight(x%,z%)
�8=(!(A%!vars_rectmem+4+x%*20+z%*20*g_size) � &1FF800)
�=� not actual height, just enough to test whether height=0
�:
:
':� ***************** armcode things
:
&:
0��codevars
:>� names of armcode global variables starting at addr in A%
D=vars_sinmem=0:vars_cosmem=4:vars_rndRND=8:vars_rectmem=12
Nvars_g_stop=16
Xvars_rects=20
b?vars_g_start=24:vars_g_max=28:vars_g_width=32:vars_g_ang=36
lvars_l_size=40
v$vars_b_shrink=44:vars_b_width=48
�vars_l_num=52
�vars_test=56
�vars_qmem=60
�"vars_b_recs=64:vars_b_sides=68
� vars_zoom=72:vars_sortmem=76
�Dlv_xdata=80:lv_ydata=84:lv_zdata=88:lv_sizedata=92:lv_xa_data=96
�;lv_za_data=100:lv_wdata=104:br_wdata=104:br_za_data=100
�Dbr_xdata=80:br_ydata=84:br_zdata=88:br_sizedata=92:br_xa_data=96
�$gr_attractors=108:gr_attbase=112
�gr_attractor1=116
�%vars_point1x=172:vars_point1y=176
�%vars_point2x=180:vars_point2y=184
�%vars_point3x=188:vars_point3y=192

6vars_vector1=196:vars_vector2=200:vars_vector3=204

vars_colour=208

vars_rect=212 :� 4*2 words

 7vars_water_basecolour=244:vars_ground_maxcolour=248

*vars_ground_minshift=252

4vars_screenstart=256

>

HLvec_null=0:vec_random=1:vec_grass=2:vec_leaves=3:vec_branch=4:vec_draw=5

R!vec_sortcopy=6:vec_advgrass=7

\�

f:

p:

z8��codesetup : � happens only at beginning of program

�� codetables 3000

�0� codeq 8000 :� gives maximum b_recs+add=500

�

�� codemem 3500

�$entry=codemem:entrypoint=codemem

�-�("LOAD <Obey$Dir>.armcode "+�~(codemem))

�

�
� A% 2048

�)� A% � 1024<>0 � A%+=1024-(A% � 1024)

�

�A%!vars_qmem=codeq

�A%!vars_sinmem=codetables

�#A%!vars_cosmem=codetables+361*4
� w%=0 � 360
+  !(A%!vars_sinmem+w%*4)=�(�(w%))*65536
+  !(A%!vars_cosmem+w%*4)=�(�(w%))*65536
$�
.
8�
B:
L:
V��codesetup2
`%� sets up variables for each tree
jA%!vars_rndRND=�(�)
tw%=�(-�)
~A%!vars_rects=-1
�A%!vars_b_width=b_width
�A%!vars_b_shrink=b_shrink
�A%!vars_l_size=l_size
�A%!vars_l_num=l_num
�A%!vars_zoom=zoom
��
�:
�:
�<: � ************* e_ - options editor ******************
�:
�:
�
��e_start
�+0:� e_nv%

e_arm=1:e_limit%=�
L� e_base%(e_nv%),e_val%(e_nv%),e_min%(e_nv%),e_max%(e_nv%),e_inc%(e_nv%)
3� e_name$(e_nv%), e_wind%(e_nv%),e_icon%(e_nv%)
(� w%=1 � e_nv%
24  � e_base%(w%),e_min%(w%),e_max%(w%),e_inc%(w%)
<  � e_name$(w%),w$,x$
F  e_wind%(w%)=�(w$)
P  e_icon%(w%)=�(x$)
Z�
de_val%()=e_base%()
n�e_writeall
xe_mark%=1:e_misc%=�
��
�:
�:
���e_scroll
�,� window%,icon%, vector%, index%, match%
�window%=b%!20
�icon%=b%!24
�vector%=b%!28
�� index%=1 � e_nv%
�G  � window%=e_wind%(index%) � icon%=e_icon%(index%) � match%=index%
��
�
�^e_val%(match%)=�range(e_val%(match%)+e_inc%(match%)*vector%,e_min%(match%),e_max%(match%))
�e_write(match%)
needval%=�:�e_validate
�
":
,��e_writeall
6� index%
@� index%=1 � e_nv%
J  �e_write(index%)
T�
^�
h:
r��e_write(index%)
|� e_wind%(index%)=0 � �
�� w$
�w$=�e_val%(index%)
�� e_min%(index%)=-1 �
�.  � e_val%(index%)=-1 � w$="On" � w$="Off"
��
�Cș "Tempest_SetIconText",e_wind%(index%),e_icon%(index%),tb%,w$
��
�:
�:
���readvars
�t_shape=e_val%(1)
�t_len=e_val%(2)
�gr_on=e_val%(3)
g_size=e_val%(4)
g_ang=e_val%(5)
g_gap=e_val%(6)
&b_sides=e_val%(7)
0b_sects=e_val%(8)
:b_resred=e_val%(9)
Db_sprout=e_val%(10)
Nb_splits=e_val%(11)
Xb_shrink=e_val%(12)/100
bb_width=e_val%(13)
lb_splitmax=e_val%(14)
vb_splitmin=e_val%(15)
�l_on=e_val%(16)
�l_num=e_val%(17)
�l_size=e_val%(18)
�l_gens=e_val%(19)
�zoom=e_val%(20)
�num_trees=e_val%(21)
�2� num_trees>1 � gr_disp=e_val%(22) � gr_disp=0
�gr_middle=e_val%(23)
�
�
g_on=�
�num_branches=�branches
�
updates=�
�&A%!vars_water_basecolour=&00030000
&A%!vars_ground_maxcolour=&03000301
A%!vars_ground_minshift=8
peakiness=1
 �
*:
4:
>F��e_validate :� checks settings are possible, and prints misc info
H� nexterr%
Rnexterr%=mainwindow_X1%
\
�readvars
f
pvalid%=�
zb_recs=b_sides*b_sects
�Mrecs=�e_branchparts :� below, returns number of parts needed for branches
�� l_on recs+=�leaves
�recs=recs*num_trees
�� g_on recs+=g_size^2
�numrecs=recs
�add=b_sides*2+1
�memneed%=recs*24
�
�V� (g_size*1.5-gr_disp*1.75)^2<3^(num_trees-1) � �e_err("Tree separation too high")
�4� memneed%>mem% � �e_err("Insufficient memory.")
�>� b_recs+add>500 � �e_err("Too many segments per branch.")
�5� �branches>max_br � �e_err("Too many branches.")
�S� b_splitmax*2-b_splitmin<(b_sprout^3) �e_err("Branch angles too restrictive.")

Oș "Tempest_SetIconText",mainhandle%,mainwindow_mem%,tb%,�(mem% � 1024)+"k"
Wș "Tempest_SetIconText",mainhandle%,mainwindow_memneed%,tb%,�(memneed% � 1024)+"k"
$
.1� s=INT(e_arm*recs/1000+2+num_trees*b_splits)
8
B ȕ nexterr%<mainwindow_Xmax%
L:  ș "Tempest_SetIconText",mainhandle%,nexterr%,tb%,""
V  nexterr%+=1
`�
j.!pb%=mainhandle% : pb%!4=mainwindow_start%
t'pb%!8=(1+valid%)<<22 : pb%!12=1<<22
~)ș "Tempest_EnsureIconState",,pb%,tb%
�
�needval%=�
��
�:
���e_err(str$)
�:ș "Tempest_SetIconText",mainhandle%,nexterr%,tb%,str$
�valid%=�
�nexterr%+=1
��
�:
�ݤe_branchparts
�
cnt%=0
� w%=0 � b_splits

(  x%=b_sects-b_resred*w%:� x%<4 x%=4
(  y%=b_sides-b_resred*w%:� y%<6 y%=6
  cnt%+=(b_sprout^w%)*x%*y%
(�
2	=cnt%
<:
F:
P� 23
Z5� 6,1,99,1,"Tree shape",general_H%,general_shape%
d@� 100,50,200,5,"Length of tree trunk",trunk_H%,trunk_length%
n$� -1,-1,0,-1,"Terrain on? *",0,0
x?� 26,16,40,2,"Grass pattern size",greens_H%,greens_numsegs%
�@� 30,0,90,5,"Grass display angle",greens_H%,greens_rotation%
�?� 12,10,36,2,"Grass segment size",greens_H%,greens_segsize%
�6� 15,7,25,1,"Branch sides",trunk_H%,trunk_segcirc%
�;� 15,6,30,1,"Branch sections",trunk_H%,trunk_seglength%
�E� 1,0,2,1,"Resolution reduction *",branching_H%,branching_resred%
�D� 3,1,4,1,"Branch splits into...",branching_H%,branching_splits%
�H� 3,1,7,1,"Number of branch splittings",branching_H%,branching_gens%
�H� 80,50,96,2,"Branch shrink ratio (%)",branching_H%,branching_scale%
�4� 10,5,30,1,"Branch width",trunk_H%,trunk_width%
�G� 50,30,65,5,"Maximum split angle",branching_H%,branching_maxangle%
�L� 45,20,70,5,"Minimum split separation",branching_H%,branching_minangle%
�6� -1,-1,0,-1,"Leaves on?",greens_H%,greens_leaves%
�;� 30,8,50,2,"Number leaves",greens_H%,greens_leafcount%
6� 12,5,25,1,"Leaf size",greens_H%,greens_leafsize%
;� 1,1,3,1,"Leaf generations",greens_H%,greens_leafgens%
8� 2000,1000,4000,100,"Zoom",general_H%,general_zoom%
"?� 1,1,10,1,"Number of trees *",general_H%,general_numtrees%
,E� 15,0,30,3,"Minumum dispersion *",general_H%,general_dispersion%
6>� -1,-1,0,-1,"Central tree? *",general_H%,general_central%
�
00000000  0d 00 0a 0a f4 20 2d 77  74 2d 0d 00 14 05 fa 0d  |..... -wt-......|
00000010  00 1e 04 0d 00 28 13 dd  f2 74 72 65 65 73 5f 73  |.....(...trees_s|
00000020  74 61 72 74 75 70 0d 00  32 0d f2 63 6f 64 65 76  |tartup..2..codev|
00000030  61 72 73 0d 00 3c 0a f2  69 6e 69 74 31 0d 00 46  |ars..<..init1..F|
00000040  0e f2 63 6f 64 65 73 65  74 75 70 0d 00 50 0c f2  |..codesetup..P..|
00000050  65 5f 73 74 61 72 74 0d  00 5a 12 f2 65 5f 63 6c  |e_start..Z..e_cl|
00000060  61 69 6d 28 32 30 30 30  29 0d 00 64 10 74 72 65  |aim(2000)..d.tre|
00000070  65 5f 64 6f 6e 65 25 3d  a3 0d 00 6e 05 e1 0d 00  |e_done%=...n....|
00000080  78 04 0d 00 82 10 dd f2  74 72 65 65 73 5f 64 72  |x.......trees_dr|
00000090  61 77 0d 00 8c 0d f2 72  65 61 64 76 61 72 73 0d  |aw.....readvars.|
000000a0  00 96 0f 77 69 6d 70 6d  6f 64 65 25 3d eb 0d 00  |...wimpmode%=...|
000000b0  a0 15 c8 99 20 22 48 6f  75 72 67 6c 61 73 73 5f  |.... "Hourglass_|
000000c0  4f 6e 22 0d 00 aa 0b 74  69 6d 65 25 3d 91 0d 00  |On"....time%=...|
000000d0  b4 04 0d 00 be 07 ea 20  85 0d 00 c8 35 ee 20 85  |....... ....5. .|
000000e0  20 ea 3a f2 72 65 6c 65  61 73 65 5f 73 63 72 65  | .:.release_scre|
000000f0  65 6e 3a f2 65 72 72 6f  72 28 f6 24 29 3a ff 28  |en:.error(.$):.(|
00000100  22 50 4f 49 4e 54 45 52  20 31 22 29 3a e1 0d 00  |"POINTER 1"):...|
00000110  d2 08 eb 20 31 35 0d 00  dc 14 62 25 21 30 3d 31  |... 15....b%!0=1|
00000120  34 39 3a 62 25 21 34 3d  2d 31 0d 00 e6 3b c8 99  |49:b%!4=-1...;..|
00000130  20 22 4f 53 5f 52 65 61  64 56 64 75 56 61 72 69  | "OS_ReadVduVari|
00000140  61 62 6c 65 73 22 2c 62  25 2c 62 25 3a 41 25 21  |ables",b%,b%:A%!|
00000150  76 61 72 73 5f 73 63 72  65 65 6e 73 74 61 72 74  |vars_screenstart|
00000160  3d 62 25 21 30 0d 00 f0  25 e7 20 75 70 64 61 74  |=b%!0...%. updat|
00000170  65 73 20 f1 8a 30 2c 30  29 3b 22 50 6c 65 61 73  |es ..0,0);"Pleas|
00000180  65 20 77 61 69 74 2e 2e  2e 22 0d 00 fa 0d 2a 46  |e wait..."....*F|
00000190  58 20 32 30 30 2c 31 0d  01 04 0f f2 63 6f 64 65  |X 200,1.....code|
000001a0  73 65 74 75 70 32 0d 01  0e 12 f2 74 65 72 72 61  |setup2.....terra|
000001b0  69 6e 5f 73 74 61 72 74  0d 01 18 15 f2 6d 61 6b  |in_start.....mak|
000001c0  65 5f 62 72 61 6e 63 68  74 61 62 6c 65 0d 01 22  |e_branchtable.."|
000001d0  04 0d 01 2c 0a f2 67 72  61 73 73 0d 01 36 0b f2  |...,..grass..6..|
000001e0  66 6f 72 65 73 74 0d 01  40 09 f2 73 6f 72 74 0d  |forest..@..sort.|
000001f0  01 4a 16 c8 99 20 22 48  6f 75 72 67 6c 61 73 73  |.J... "Hourglass|
00000200  5f 4f 66 66 22 0d 01 54  09 f2 64 72 61 77 0d 01  |_Off"..T..draw..|
00000210  5e 16 73 65 63 73 3d 28  91 2d 74 69 6d 65 25 29  |^.secs=(.-time%)|
00000220  2f 31 30 30 0d 01 68 64  e7 20 75 70 64 61 74 65  |/100..hd. update|
00000230  73 20 f1 8a 30 2c 30 29  3b 22 54 6f 74 61 6c 20  |s ..0,0);"Total |
00000240  74 69 6d 65 20 22 3b 73  65 63 73 20 81 20 36 30  |time ";secs . 60|
00000250  3b 22 20 6d 69 6e 73 20  22 3b 73 65 63 73 20 83  |;" mins ";secs .|
00000260  20 36 30 3b 22 2e 22 3b  73 65 63 73 2a 31 30 30  | 60;".";secs*100|
00000270  20 83 20 31 30 30 3b 22  20 73 65 63 73 2e 20 20  | . 100;" secs.  |
00000280  20 20 20 20 20 20 20 22  0d 01 72 0c 2a 46 58 20  |       "..r.*FX |
00000290  32 31 2c 30 0d 01 7c 0a  6b 65 79 24 3d be 0d 01  |21,0..|.key$=...|
000002a0  86 48 c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |.H.. "OS_SpriteO|
000002b0  70 22 2c 32 35 36 2b 31  36 2c 64 69 73 70 6c 61  |p",256+16,displa|
000002c0  79 5f 62 75 66 66 65 72  25 2c 22 74 72 65 65 73  |y_buffer%,"trees|
000002d0  70 72 69 74 65 22 2c 30  2c 30 2c 30 2c 31 32 37  |prite",0,0,0,127|
000002e0  39 2c 31 30 32 33 0d 01  90 13 f2 72 65 6c 65 61  |9,1023.....relea|
000002f0  73 65 5f 73 63 72 65 65  6e 0d 01 9a 37 21 70 62  |se_screen...7!pb|
00000300  25 3d 64 69 73 70 6c 61  79 5f 48 25 20 3a 20 c8  |%=display_H% : .|
00000310  99 20 22 54 65 6d 70 65  73 74 5f 53 68 6f 77 57  |. "Tempest_ShowW|
00000320  69 6e 64 6f 77 22 2c 31  2c 70 62 25 2c 74 62 25  |indow",1,pb%,tb%|
00000330  0d 01 a4 10 74 72 65 65  5f 64 6f 6e 65 25 3d b9  |....tree_done%=.|
00000340  0d 01 ae 05 e1 0d 01 b8  05 3a 0d 01 c2 14 dd f2  |.........:......|
00000350  72 65 6c 65 61 73 65 5f  73 63 72 65 65 6e 0d 01  |release_screen..|
00000360  cc 0f eb 20 77 69 6d 70  6d 6f 64 65 25 0d 01 d6  |... wimpmode%...|
00000370  1f c8 99 20 22 57 69 6d  70 5f 53 65 74 4d 6f 64  |... "Wimp_SetMod|
00000380  65 22 2c 77 69 6d 70 6d  6f 64 65 25 0d 01 e0 30  |e",wimpmode%...0|
00000390  c8 99 20 22 57 69 6d 70  5f 46 6f 72 63 65 52 65  |.. "Wimp_ForceRe|
000003a0  64 72 61 77 22 2c 2d 31  2c 30 2c 30 2c 74 62 25  |draw",-1,0,0,tb%|
000003b0  21 39 34 30 2c 74 62 25  21 39 34 34 0d 01 ea 0e  |!940,tb%!944....|
000003c0  2a 50 4f 49 4e 54 45 52  20 31 0d 01 f4 05 e1 0d  |*POINTER 1......|
000003d0  01 fe 05 3a 0d 02 08 11  dd f2 66 75 6c 6c 5f 73  |...:......full_s|
000003e0  63 72 65 65 6e 0d 02 12  0f 77 69 6d 70 6d 6f 64  |creen....wimpmod|
000003f0  65 25 3d eb 0d 02 1c 07  eb 31 35 0d 02 26 3e c8  |e%=......15..&>.|
00000400  99 20 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |. "OS_SpriteOp",|
00000410  33 34 2b 32 35 36 2c 64  69 73 70 6c 61 79 5f 62  |34+256,display_b|
00000420  75 66 66 65 72 25 2c 22  74 72 65 65 73 70 72 69  |uffer%,"treespri|
00000430  74 65 22 2c 30 2c 30 2c  30 0d 02 30 0d 2a 46 58  |te",0,0,0..0.*FX|
00000440  20 32 30 30 2c 31 0d 02  3a 08 41 24 3d be 0d 02  | 200,1..:.A$=...|
00000450  44 13 f2 72 65 6c 65 61  73 65 5f 73 63 72 65 65  |D..release_scree|
00000460  6e 0d 02 4e 2f 74 62 25  21 30 3d 30 20 3a 20 f4  |n..N/tb%!0=0 : .|
00000470  20 6e 65 76 65 72 20 61  6c 6c 6f 77 20 6d 65 6e  | never allow men|
00000480  75 20 74 6f 20 62 65 20  72 65 6f 70 65 6e 65 64  |u to be reopened|
00000490  0d 02 58 05 e1 0d 02 62  05 3a 0d 02 6c 05 3a 0d  |..X....b.:..l.:.|
000004a0  02 76 0b dd f2 69 6e 69  74 31 0d 02 80 0f 6d 61  |.v...init1....ma|
000004b0  78 5f 62 72 3d 32 30 30  30 0d 02 8a 53 de 20 62  |x_br=2000...S. b|
000004c0  5f 78 28 6d 61 78 5f 62  72 29 2c 62 5f 79 28 6d  |_x(max_br),b_y(m|
000004d0  61 78 5f 62 72 29 2c 62  5f 7a 28 6d 61 78 5f 62  |ax_br),b_z(max_b|
000004e0  72 29 2c 62 5f 78 61 25  28 6d 61 78 5f 62 72 29  |r),b_xa%(max_br)|
000004f0  2c 62 5f 7a 61 25 28 6d  61 78 5f 62 72 29 2c 20  |,b_za%(max_br), |
00000500  62 5f 73 7a 28 6d 61 78  5f 62 72 29 0d 02 94 2f  |b_sz(max_br).../|
00000510  de 20 72 5f 78 25 28 31  30 29 2c 72 5f 7a 25 28  |. r_x%(10),r_z%(|
00000520  31 30 29 2c 20 74 72 65  65 5f 78 28 31 30 29 2c  |10), tree_x(10),|
00000530  20 74 72 65 65 5f 7a 28  31 30 29 0d 02 9e 05 e1  | tree_z(10).....|
00000540  0d 02 a8 05 3a 0d 02 b2  14 dd f2 65 5f 63 6c 61  |....:......e_cla|
00000550  69 6d 28 73 69 7a 65 25  29 0d 02 bc 2b c8 99 20  |im(size%)...+.. |
00000560  22 57 69 6d 70 5f 53 6c  6f 74 53 69 7a 65 22 2c  |"Wimp_SlotSize",|
00000570  73 69 7a 65 25 2a 31 30  32 34 2c 2d 31 20 b8 20  |size%*1024,-1 . |
00000580  6d 65 6d 25 0d 02 c6 17  6d 65 6d 25 3d 6d 65 6d  |mem%....mem%=mem|
00000590  25 2d 28 93 2d 90 29 2d  31 32 38 0d 02 d0 04 0d  |%-(.-.)-128.....|
000005a0  02 da 16 6d 61 78 5f 72  65 63 73 3d 6d 65 6d 25  |...max_recs=mem%|
000005b0  20 81 20 32 34 0d 02 e4  29 e7 20 6d 61 78 5f 72  | . 24...). max_r|
000005c0  65 63 73 3e 34 2a 36 35  35 33 36 20 8c 20 6d 61  |ecs>4*65536 . ma|
000005d0  78 5f 72 65 63 73 3d 36  35 35 33 36 2a 34 0d 02  |x_recs=65536*4..|
000005e0  ee 10 63 6f 64 65 72 65  63 73 3d 93 2b 34 0d 02  |..coderecs=.+4..|
000005f0  f8 1d 73 6f 72 74 3d 63  6f 64 65 72 65 63 73 2b  |..sort=coderecs+|
00000600  6d 61 78 5f 72 65 63 73  2a 32 30 0d 03 02 1a 6e  |max_recs*20....n|
00000610  65 65 64 76 61 6c 25 3d  b9 3a f2 65 5f 76 61 6c  |eedval%=.:.e_val|
00000620  69 64 61 74 65 0d 03 0c  04 0d 03 16 18 41 25 21  |idate........A%!|
00000630  76 61 72 73 5f 73 6f 72  74 6d 65 6d 3d 73 6f 72  |vars_sortmem=sor|
00000640  74 0d 03 20 1c 41 25 21  76 61 72 73 5f 72 65 63  |t.. .A%!vars_rec|
00000650  74 6d 65 6d 3d 63 6f 64  65 72 65 63 73 0d 03 2a  |tmem=coderecs..*|
00000660  05 e1 0d 03 34 05 3a 0d  03 3e 05 3a 0d 03 48 0c  |....4.:..>.:..H.|
00000670  dd f2 66 6f 72 65 73 74  0d 03 52 35 f2 64 69 73  |..forest..R5.dis|
00000680  70 65 72 73 65 28 6e 75  6d 5f 74 72 65 65 73 2c  |perse(num_trees,|
00000690  b9 29 20 3a f4 20 61 6c  6c 6f 63 61 74 65 20 70  |.) :. allocate p|
000006a0  6f 73 6e 73 20 6f 66 20  74 72 65 65 73 0d 03 5c  |osns of trees..\|
000006b0  19 e3 20 74 72 65 65 25  3d 31 20 b8 20 6e 75 6d  |.. tree%=1 . num|
000006c0  5f 74 72 65 65 73 0d 03  66 13 20 20 62 5f 73 7a  |_trees..f.  b_sz|
000006d0  28 30 29 3d 74 5f 6c 65  6e 0d 03 70 2b 20 20 62  |(0)=t_len..p+  b|
000006e0  5f 78 28 30 29 3d 28 74  72 65 65 5f 78 28 74 72  |_x(0)=(tree_x(tr|
000006f0  65 65 25 29 2d 67 5f 73  69 7a 65 2f 32 29 2a 67  |ee%)-g_size/2)*g|
00000700  5f 67 61 70 0d 03 7a 2b  20 20 62 5f 7a 28 30 29  |_gap..z+  b_z(0)|
00000710  3d 28 74 72 65 65 5f 7a  28 74 72 65 65 25 29 2d  |=(tree_z(tree%)-|
00000720  67 5f 73 69 7a 65 2f 32  29 2a 67 5f 67 61 70 0d  |g_size/2)*g_gap.|
00000730  03 84 24 20 20 f2 72 6f  74 61 74 65 79 32 28 62  |..$  .rotatey2(b|
00000740  5f 78 28 30 29 2c 62 5f  7a 28 30 29 2c 67 5f 61  |_x(0),b_z(0),g_a|
00000750  6e 67 29 0d 03 8e 0e 20  20 62 5f 79 28 30 29 3d  |ng)....  b_y(0)=|
00000760  30 0d 03 98 0b 20 20 f2  74 72 65 65 0d 03 a2 11  |0....  .tree....|
00000770  20 20 74 5f 73 68 61 70  65 2b 3d 31 37 0d 03 ac  |  t_shape+=17...|
00000780  24 20 20 62 5f 73 69 64  65 73 2b 3d 62 5f 72 65  |$  b_sides+=b_re|
00000790  73 72 65 64 2a 28 62 5f  73 70 6c 69 74 73 2b 31  |sred*(b_splits+1|
000007a0  29 0d 03 b6 24 20 20 62  5f 73 65 63 74 73 2b 3d  |)...$  b_sects+=|
000007b0  62 5f 72 65 73 72 65 64  2a 28 62 5f 73 70 6c 69  |b_resred*(b_spli|
000007c0  74 73 2b 31 29 0d 03 c0  05 ed 0d 03 ca 19 74 5f  |ts+1).........t_|
000007d0  73 68 61 70 65 2d 3d 6e  75 6d 5f 74 72 65 65 73  |shape-=num_trees|
000007e0  2a 31 37 0d 03 d4 46 e7  75 70 64 61 74 65 73 20  |*17...F.updates |
000007f0  f1 8a 30 2c 30 29 3b 22  43 61 6c 63 75 6c 61 74  |..0,0);"Calculat|
00000800  69 6f 6e 20 74 69 6d 65  20 22 3b 28 91 2d 74 69  |ion time ";(.-ti|
00000810  6d 65 25 29 2f 31 30 30  3b 22 20 73 65 63 73 2e  |me%)/100;" secs.|
00000820  20 20 20 20 20 20 20 20  22 0d 03 de 05 e1 0d 03  |        ".......|
00000830  e8 05 3a 0d 03 f2 2f dd  f2 72 6f 74 61 74 65 79  |..:.../..rotatey|
00000840  32 28 f8 20 58 58 2c f8  20 5a 5a 2c 79 79 79 29  |2(. XX,. ZZ,yyy)|
00000850  20 3a f4 20 66 6f 72 20  50 52 4f 43 66 6f 72 65  | :. for PROCfore|
00000860  73 74 0d 03 fc 20 78 78  3d 58 58 2a a4 63 6f 73  |st... xx=XX*.cos|
00000870  28 79 79 79 29 2d 5a 5a  2a a4 73 69 6e 28 79 79  |(yyy)-ZZ*.sin(yy|
00000880  79 29 0d 04 06 20 5a 5a  3d 5a 5a 2a a4 63 6f 73  |y)... ZZ=ZZ*.cos|
00000890  28 79 79 79 29 2b 58 58  2a a4 73 69 6e 28 79 79  |(yyy)+XX*.sin(yy|
000008a0  79 29 0d 04 10 09 58 58  3d 78 78 0d 04 1a 05 e1  |y)....XX=xx.....|
000008b0  0d 04 24 05 3a 0d 04 2e  0b dd 20 f2 74 72 65 65  |..$.:..... .tree|
000008c0  0d 04 38 23 ea 20 78 61  2c 7a 61 2c 6f 6b 25 2c  |..8#. xa,za,ok%,|
000008d0  74 31 25 2c 74 32 25 2c  73 6d 32 25 2c 73 70 6c  |t1%,t2%,sm2%,spl|
000008e0  69 74 25 0d 04 42 39 73  6d 32 25 3d 62 5f 73 70  |it%..B9sm2%=b_sp|
000008f0  6c 69 74 6d 69 6e 5e 32  20 3a f4 20 66 61 73 74  |litmin^2 :. fast|
00000900  65 72 20 69 66 20 74 68  69 73 20 69 73 20 70 72  |er if this is pr|
00000910  65 2d 63 61 6c 63 75 6c  61 74 65 64 0d 04 4c 04  |e-calculated..L.|
00000920  0d 04 56 0e f2 62 72 61  6e 63 68 28 30 29 0d 04  |..V..branch(0)..|
00000930  60 14 74 72 65 65 3d b3  28 2d 74 5f 73 68 61 70  |`.tree=.(-t_shap|
00000940  65 29 0d 04 6a 17 62 72  61 6e 63 68 3d 30 3a 62  |e)..j.branch=0:b|
00000950  72 61 6e 63 68 65 73 3d  30 0d 04 74 05 f5 0d 04  |ranches=0..t....|
00000960  7e 44 20 20 f2 72 6f 74  61 74 65 28 30 2c 62 5f  |~D  .rotate(0,b_|
00000970  73 7a 28 62 72 61 6e 63  68 29 2c 30 2c 78 70 2c  |sz(branch),0,xp,|
00000980  79 70 2c 7a 70 2c 62 5f  78 61 25 28 62 72 61 6e  |yp,zp,b_xa%(bran|
00000990  63 68 29 2c 62 5f 7a 61  25 28 62 72 61 6e 63 68  |ch),b_za%(branch|
000009a0  29 29 0d 04 88 07 20 20  f5 0d 04 92 1f 20 20 20  |))....  .....   |
000009b0  20 e3 20 73 70 6c 69 74  25 3d 30 20 b8 20 62 5f  | . split%=0 . b_|
000009c0  73 70 72 6f 75 74 2d 31  0d 04 9c 31 20 20 20 20  |sprout-1...1    |
000009d0  20 20 72 5f 78 25 28 73  70 6c 69 74 25 29 3d b3  |  r_x%(split%)=.|
000009e0  28 62 5f 73 70 6c 69 74  6d 61 78 2a 32 29 2d 62  |(b_splitmax*2)-b|
000009f0  5f 73 70 6c 69 74 6d 61  78 0d 04 a6 31 20 20 20  |_splitmax...1   |
00000a00  20 20 20 72 5f 7a 25 28  73 70 6c 69 74 25 29 3d  |   r_z%(split%)=|
00000a10  b3 28 62 5f 73 70 6c 69  74 6d 61 78 2a 32 29 2d  |.(b_splitmax*2)-|
00000a20  62 5f 73 70 6c 69 74 6d  61 78 0d 04 b0 09 20 20  |b_splitmax....  |
00000a30  20 20 ed 0d 04 ba 0d 20  20 20 20 6f 6b 25 3d b9  |  .....    ok%=.|
00000a40  0d 04 c4 16 20 20 20 20  e7 20 62 5f 73 70 72 6f  |....    . b_spro|
00000a50  75 74 3e 31 20 8c 0d 04  ce 2e 20 20 20 20 20 20  |ut>1 .....      |
00000a60  e3 20 74 31 25 3d 31 20  b8 20 62 5f 73 70 72 6f  |. t1%=1 . b_spro|
00000a70  75 74 2d 31 3a e3 20 74  32 25 3d 30 20 b8 20 74  |ut-1:. t2%=0 . t|
00000a80  31 25 2d 31 0d 04 d8 4c  20 20 20 20 20 20 20 20  |1%-1...L        |
00000a90  20 20 e7 20 28 72 5f 78  25 28 74 32 25 29 2d 72  |  . (r_x%(t2%)-r|
00000aa0  5f 78 25 28 74 31 25 29  29 5e 32 20 2b 20 28 72  |_x%(t1%))^2 + (r|
00000ab0  5f 7a 25 28 74 32 25 29  2d 72 5f 7a 25 28 74 31  |_z%(t2%)-r_z%(t1|
00000ac0  25 29 29 5e 32 3c 73 6d  32 25 20 6f 6b 25 3d 30  |%))^2<sm2% ok%=0|
00000ad0  0d 04 e2 0d 20 20 20 20  20 20 ed 3a ed 0d 04 ec  |....      .:....|
00000ae0  09 20 20 20 20 cd 0d 04  f6 0b 20 20 fd 20 6f 6b  |.    .....  . ok|
00000af0  25 0d 05 00 1d 20 20 e3  20 73 70 6c 69 74 25 3d  |%....  . split%=|
00000b00  30 20 b8 20 62 5f 73 70  72 6f 75 74 2d 31 0d 05  |0 . b_sprout-1..|
00000b10  0a 31 20 20 20 20 f2 73  70 72 6f 75 74 28 62 72  |.1    .sprout(br|
00000b20  61 6e 63 68 2c 72 5f 78  25 28 73 70 6c 69 74 25  |anch,r_x%(split%|
00000b30  29 2c 72 5f 7a 25 28 73  70 6c 69 74 25 29 29 0d  |),r_z%(split%)).|
00000b40  05 14 07 20 20 ed 0d 05  1e 0f 20 20 62 72 61 6e  |...  .....  bran|
00000b50  63 68 2b 3d 31 0d 05 28  1d fd 20 62 72 61 6e 63  |ch+=1..(.. branc|
00000b60  68 65 73 2b 31 3d 6e 75  6d 5f 62 72 61 6e 63 68  |hes+1=num_branch|
00000b70  65 73 0d 05 32 05 e1 0d  05 3c 05 3a 0d 05 46 1a  |es..2....<.:..F.|
00000b80  dd 20 f2 73 70 72 6f 75  74 28 6e 62 25 2c 78 61  |. .sprout(nb%,xa|
00000b90  25 2c 7a 61 25 29 0d 05  50 0f 62 72 61 6e 63 68  |%,za%)..P.branch|
00000ba0  65 73 2b 3d 31 0d 05 5a  1d 62 5f 78 28 62 72 61  |es+=1..Z.b_x(bra|
00000bb0  6e 63 68 65 73 29 3d 62  5f 78 28 6e 62 25 29 2b  |nches)=b_x(nb%)+|
00000bc0  78 70 0d 05 64 1d 62 5f  79 28 62 72 61 6e 63 68  |xp..d.b_y(branch|
00000bd0  65 73 29 3d 62 5f 79 28  6e 62 25 29 2b 79 70 0d  |es)=b_y(nb%)+yp.|
00000be0  05 6e 1d 62 5f 7a 28 62  72 61 6e 63 68 65 73 29  |.n.b_z(branches)|
00000bf0  3d 62 5f 7a 28 6e 62 25  29 2b 7a 70 0d 05 78 2e  |=b_z(nb%)+zp..x.|
00000c00  62 5f 78 61 25 28 62 72  61 6e 63 68 65 73 29 3d  |b_xa%(branches)=|
00000c10  28 62 5f 78 61 25 28 6e  62 25 29 2b 78 61 25 2b  |(b_xa%(nb%)+xa%+|
00000c20  33 36 30 29 20 83 20 33  36 30 0d 05 82 2e 62 5f  |360) . 360....b_|
00000c30  7a 61 25 28 62 72 61 6e  63 68 65 73 29 3d 28 62  |za%(branches)=(b|
00000c40  5f 7a 61 25 28 6e 62 25  29 2b 7a 61 25 2b 33 36  |_za%(nb%)+za%+36|
00000c50  30 29 20 83 20 33 36 30  0d 05 8c 25 62 5f 73 7a  |0) . 360...%b_sz|
00000c60  28 62 72 61 6e 63 68 65  73 29 3d 62 5f 73 7a 28  |(branches)=b_sz(|
00000c70  6e 62 25 29 2a 62 5f 73  68 72 69 6e 6b 0d 05 96  |nb%)*b_shrink...|
00000c80  15 f2 62 72 61 6e 63 68  28 62 72 61 6e 63 68 65  |..branch(branche|
00000c90  73 29 0d 05 a0 05 e1 0d  05 aa 05 3a 0d 05 b4 12  |s).........:....|
00000ca0  dd 20 f2 62 72 61 6e 63  68 28 70 62 25 29 0d 05  |. .branch(pb%)..|
00000cb0  be 3c f4 20 74 68 69 73  20 69 6e 66 6f 20 63 61  |.<. this info ca|
00000cc0  6e 20 62 65 20 75 73 65  64 20 62 79 20 62 6f 74  |n be used by bot|
00000cd0  68 20 6c 65 61 76 65 73  20 61 6e 64 20 62 72 61  |h leaves and bra|
00000ce0  6e 63 68 65 73 20 63 6f  64 65 0d 05 c8 18 41 25  |nches code....A%|
00000cf0  21 6c 76 5f 78 64 61 74  61 3d 62 5f 78 28 70 62  |!lv_xdata=b_x(pb|
00000d00  25 29 0d 05 d2 18 41 25  21 6c 76 5f 79 64 61 74  |%)....A%!lv_ydat|
00000d10  61 3d 62 5f 79 28 70 62  25 29 0d 05 dc 18 41 25  |a=b_y(pb%)....A%|
00000d20  21 6c 76 5f 7a 64 61 74  61 3d 62 5f 7a 28 70 62  |!lv_zdata=b_z(pb|
00000d30  25 29 0d 05 e6 21 41 25  21 6c 76 5f 73 69 7a 65  |%)...!A%!lv_size|
00000d40  64 61 74 61 3d 62 5f 73  7a 28 70 62 25 29 20 2a  |data=b_sz(pb%) *|
00000d50  32 35 36 0d 05 f0 1c 41  25 21 6c 76 5f 78 61 5f  |256....A%!lv_xa_|
00000d60  64 61 74 61 3d 62 5f 78  61 25 28 70 62 25 29 0d  |data=b_xa%(pb%).|
00000d70  05 fa 1c 41 25 21 6c 76  5f 7a 61 5f 64 61 74 61  |...A%!lv_za_data|
00000d80  3d 62 5f 7a 61 25 28 70  62 25 29 0d 06 04 22 77  |=b_za%(pb%)..."w|
00000d90  3d 62 5f 73 7a 28 70 62  25 29 2f 74 5f 6c 65 6e  |=b_sz(pb%)/t_len|
00000da0  2a 62 5f 77 69 64 74 68  20 2a 32 35 36 0d 06 0e  |*b_width *256...|
00000db0  4c 41 25 21 62 72 5f 77  64 61 74 61 3d 77 20 3a  |LA%!br_wdata=w :|
00000dc0  f4 20 77 69 64 74 68 20  72 61 74 69 6e 67 2c 20  |. width rating, |
00000dd0  63 6f 75 6c 64 20 62 65  20 63 61 6c 63 27 65 64  |could be calc'ed|
00000de0  20 62 79 20 63 6f 64 65  20 62 75 74 20 73 69 6d  | by code but sim|
00000df0  70 6c 65 72 20 68 65 72  65 0d 06 18 2b 41 25 21  |pler here...+A%!|
00000e00  76 61 72 73 5f 6c 5f 73  69 7a 65 3d 62 5f 73 7a  |vars_l_size=b_sz|
00000e10  28 70 62 25 29 2f 74 5f  6c 65 6e 2a 6c 5f 73 69  |(pb%)/t_len*l_si|
00000e20  7a 65 2a 32 0d 06 22 04  0d 06 2c 43 e7 20 62 5f  |ze*2.."...,C. b_|
00000e30  73 70 6c 69 74 73 2d a4  67 65 6e 28 70 62 25 29  |splits-.gen(pb%)|
00000e40  3c 6c 5f 67 65 6e 73 20  80 20 6c 5f 6f 6e 20 8c  |<l_gens . l_on .|
00000e50  20 42 25 3d 76 65 63 5f  6c 65 61 76 65 73 3a d6  | B%=vec_leaves:.|
00000e60  20 65 6e 74 72 79 70 6f  69 6e 74 0d 06 36 1e 42  | entrypoint..6.B|
00000e70  25 3d 76 65 63 5f 62 72  61 6e 63 68 3a d6 20 65  |%=vec_branch:. e|
00000e80  6e 74 72 79 70 6f 69 6e  74 0d 06 40 04 0d 06 4a  |ntrypoint..@...J|
00000e90  1b e7 20 6e 65 77 67 65  6e 20 80 20 62 5f 72 65  |.. newgen . b_re|
00000ea0  73 72 65 64 3e 30 20 8c  0d 06 54 17 20 20 62 5f  |sred>0 ...T.  b_|
00000eb0  73 65 63 74 73 2d 3d 62  5f 72 65 73 72 65 64 0d  |sects-=b_resred.|
00000ec0  06 5e 17 20 20 62 5f 73  69 64 65 73 2d 3d 62 5f  |.^.  b_sides-=b_|
00000ed0  72 65 73 72 65 64 0d 06  68 17 20 20 f2 6d 61 6b  |resred..h.  .mak|
00000ee0  65 5f 62 72 61 6e 63 68  74 61 62 6c 65 0d 06 72  |e_branchtable..r|
00000ef0  05 cd 0d 06 7c 04 0d 06  86 0f e7 20 75 70 64 61  |....|...... upda|
00000f00  74 65 73 20 8c 0d 06 90  43 20 20 f1 8a 30 2c 30  |tes ....C  ..0,0|
00000f10  29 3b 22 54 72 65 65 20  22 3b 74 72 65 65 25 3b  |);"Tree ";tree%;|
00000f20  22 20 3a 20 22 3b 28 70  62 25 2a 31 30 30 20 81  |" : ";(pb%*100 .|
00000f30  20 6e 75 6d 5f 62 72 61  6e 63 68 65 73 29 3b 22  | num_branches);"|
00000f40  25 20 20 20 20 20 20 22  0d 06 9a 05 cd 0d 06 a4  |%      "........|
00000f50  05 e1 0d 06 ae 05 3a 0d  06 b8 05 3a 0d 06 c2 48  |......:....:...H|
00000f60  dd 20 f2 6d 61 6b 65 5f  62 72 61 6e 63 68 74 61  |. .make_branchta|
00000f70  62 6c 65 20 20 3a f4 20  63 6f 6e 74 72 6f 6c 73  |ble  :. controls|
00000f80  20 70 6f 73 69 74 69 6f  6e 73 20 6f 66 20 63 6f  | positions of co|
00000f90  6d 70 6f 6e 65 6e 74 20  70 61 72 74 73 20 6f 66  |mponent parts of|
00000fa0  20 62 72 2e 0d 06 cc 1b  e7 20 62 5f 73 65 63 74  | br...... b_sect|
00000fb0  73 3c 34 20 8c 20 62 5f  73 65 63 74 73 3d 34 0d  |s<4 . b_sects=4.|
00000fc0  06 d6 1b e7 20 62 5f 73  69 64 65 73 3c 36 20 8c  |.... b_sides<6 .|
00000fd0  20 62 5f 73 69 64 65 73  3d 36 0d 06 e0 22 41 25  | b_sides=6..."A%|
00000fe0  21 76 61 72 73 5f 62 5f  72 65 63 73 3d 62 5f 73  |!vars_b_recs=b_s|
00000ff0  69 64 65 73 2a 62 5f 73  65 63 74 73 0d 06 ea 1b  |ides*b_sects....|
00001000  41 25 21 76 61 72 73 5f  62 5f 73 69 64 65 73 3d  |A%!vars_b_sides=|
00001010  62 5f 73 69 64 65 73 0d  06 f4 04 0d 06 fe 16 ea  |b_sides.........|
00001020  20 61 6e 67 25 2c 72 61  64 2c 72 65 63 25 2c 79  | ang%,rad,rec%,y|
00001030  25 0d 07 08 16 e3 20 79  25 3d 30 20 b8 20 62 5f  |%..... y%=0 . b_|
00001040  73 65 63 74 73 2b 31 0d  07 12 23 20 20 72 61 64  |sects+1...#  rad|
00001050  3d 31 2d 79 25 2a 28 31  2d 62 5f 73 68 72 69 6e  |=1-y%*(1-b_shrin|
00001060  6b 29 2f 62 5f 73 65 63  74 73 0d 07 1c 1a 20 20  |k)/b_sects....  |
00001070  e3 20 61 6e 67 25 3d 30  20 b8 20 62 5f 73 69 64  |. ang%=0 . b_sid|
00001080  65 73 2b 31 0d 07 26 1c  20 20 20 20 72 65 63 25  |es+1..&.    rec%|
00001090  3d 79 25 2a 62 5f 73 69  64 65 73 2b 61 6e 67 25  |=y%*b_sides+ang%|
000010a0  0d 07 30 21 20 20 20 20  70 74 72 25 3d 41 25 21  |..0!    ptr%=A%!|
000010b0  76 61 72 73 5f 71 6d 65  6d 2b 72 65 63 25 2a 31  |vars_qmem+rec%*1|
000010c0  36 0d 07 3a 48 20 20 20  20 21 70 74 72 25 3d 72  |6..:H    !ptr%=r|
000010d0  61 64 2a 21 28 41 25 21  76 61 72 73 5f 63 6f 73  |ad*!(A%!vars_cos|
000010e0  6d 65 6d 2b 34 2a 28 28  61 6e 67 25 2a 33 36 30  |mem+4*((ang%*360|
000010f0  2f 62 5f 73 69 64 65 73  2b 39 30 29 20 83 20 33  |/b_sides+90) . 3|
00001100  36 30 29 29 20 81 32 35  36 0d 07 44 1e 20 20 20  |60)) .256..D.   |
00001110  20 70 74 72 25 21 34 3d  79 25 2f 62 5f 73 65 63  | ptr%!4=y%/b_sec|
00001120  74 73 20 2a 32 35 36 0d  07 4e 49 20 20 20 20 70  |ts *256..NI    p|
00001130  74 72 25 21 38 3d 72 61  64 2a 21 28 41 25 21 76  |tr%!8=rad*!(A%!v|
00001140  61 72 73 5f 73 69 6e 6d  65 6d 2b 34 2a 28 28 61  |ars_sinmem+4*((a|
00001150  6e 67 25 2a 33 36 30 2f  62 5f 73 69 64 65 73 2b  |ng%*360/b_sides+|
00001160  39 30 29 20 83 20 33 36  30 29 29 20 81 32 35 36  |90) . 360)) .256|
00001170  0d 07 58 30 20 20 20 20  70 74 72 25 21 31 32 3d  |..X0    ptr%!12=|
00001180  94 28 31 38 30 2d 61 6e  67 25 2a 33 36 30 2f 62  |.(180-ang%*360/b|
00001190  5f 73 69 64 65 73 29 2f  31 38 30 2a 32 2e 39 39  |_sides)/180*2.99|
000011a0  0d 07 62 07 20 20 ed 0d  07 6c 05 ed 0d 07 76 05  |..b.  ...l....v.|
000011b0  e1 0d 07 80 05 3a 0d 07  8a 39 dd 20 a4 67 65 6e  |.....:...9. .gen|
000011c0  28 62 62 25 29 20 20 3a  f4 20 66 69 6e 64 73 20  |(bb%)  :. finds |
000011d0  62 72 61 6e 63 68 20 64  65 70 74 68 20 66 72 6f  |branch depth fro|
000011e0  6d 20 73 65 72 69 61 6c  20 6e 75 6d 62 65 72 0d  |m serial number.|
000011f0  07 94 0b 67 65 6e 25 3d  2d 31 0d 07 9e 0a 63 6e  |...gen%=-1....cn|
00001200  74 25 3d 30 0d 07 a8 05  f5 0d 07 b2 0d 20 20 67  |t%=0.........  g|
00001210  65 6e 25 2b 3d 31 0d 07  bc 19 20 20 63 6e 74 25  |en%+=1....  cnt%|
00001220  2b 3d 62 5f 73 70 72 6f  75 74 5e 67 65 6e 25 0d  |+=b_sprout^gen%.|
00001230  07 c6 0e fd 20 63 6e 74  25 3e 62 62 25 0d 07 d0  |.... cnt%>bb%...|
00001240  46 6e 65 77 67 65 6e 3d  28 63 6e 74 25 3d 62 62  |Fnewgen=(cnt%=bb|
00001250  25 2b 31 29 20 3a f4 20  73 65 74 20 6f 6e 6c 79  |%+1) :. set only|
00001260  20 66 6f 72 20 4c 41 53  54 20 62 72 61 6e 63 68  | for LAST branch|
00001270  20 6f 66 20 65 61 63 68  20 67 65 6e 65 72 61 74  | of each generat|
00001280  69 6f 6e 0d 07 da 09 3d  67 65 6e 25 0d 07 e4 05  |ion....=gen%....|
00001290  3a 0d 07 ee 0b dd 20 f2  73 6f 72 74 0d 07 f8 08  |:..... .sort....|
000012a0  74 25 3d 91 0d 08 02 20  42 25 3d 76 65 63 5f 73  |t%=.... B%=vec_s|
000012b0  6f 72 74 63 6f 70 79 3a  d6 20 65 6e 74 72 79 70  |ortcopy:. entryp|
000012c0  6f 69 6e 74 0d 08 0c 2b  c8 99 20 22 4f 53 5f 48  |oint...+.. "OS_H|
000012d0  65 61 70 53 6f 72 74 22  2c 41 25 21 76 61 72 73  |eapSort",A%!vars|
000012e0  5f 72 65 63 74 73 2b 31  2c 73 6f 72 74 2c 31 0d  |_rects+1,sort,1.|
000012f0  08 16 3f e7 20 75 70 64  61 74 65 73 20 f1 8a 30  |..?. updates ..0|
00001300  2c 30 29 3b 22 53 6f 72  74 20 74 69 6d 65 20 3d  |,0);"Sort time =|
00001310  20 22 3b 28 91 2d 74 25  29 2f 31 30 30 3b 22 20  | ";(.-t%)/100;" |
00001320  73 65 63 73 2e 20 20 20  20 20 20 20 20 22 0d 08  |secs.        "..|
00001330  20 05 e1 0d 08 2a 05 3a  0d 08 34 0b dd 20 f2 64  | ....*.:..4.. .d|
00001340  72 61 77 0d 08 3e 1c 42  25 3d 76 65 63 5f 64 72  |raw..>.B%=vec_dr|
00001350  61 77 3a d6 20 65 6e 74  72 79 70 6f 69 6e 74 0d  |aw:. entrypoint.|
00001360  08 48 05 e1 0d 08 52 05  3a 0d 08 5c 0f dd 20 a4  |.H....R.:..\.. .|
00001370  62 72 61 6e 63 68 65 73  0d 08 66 0a 63 6e 74 25  |branches..f.cnt%|
00001380  3d 30 0d 08 70 17 e3 20  67 65 6e 25 3d 30 20 b8  |=0..p.. gen%=0 .|
00001390  20 62 5f 73 70 6c 69 74  73 0d 08 7a 19 20 20 63  | b_splits..z.  c|
000013a0  6e 74 25 2b 3d 62 5f 73  70 72 6f 75 74 5e 67 65  |nt%+=b_sprout^ge|
000013b0  6e 25 0d 08 84 05 ed 0d  08 8e 09 3d 63 6e 74 25  |n%.........=cnt%|
000013c0  0d 08 98 05 3a 0d 08 a2  0d dd 20 a4 6c 65 61 76  |....:..... .leav|
000013d0  65 73 0d 08 ac 0a 63 6e  74 25 3d 30 0d 08 b6 17  |es....cnt%=0....|
000013e0  e3 20 67 65 6e 25 3d 30  20 b8 20 62 5f 73 70 6c  |. gen%=0 . b_spl|
000013f0  69 74 73 0d 08 c0 32 20  20 e7 20 67 65 6e 25 3e  |its...2  . gen%>|
00001400  62 5f 73 70 6c 69 74 73  2d 6c 5f 67 65 6e 73 20  |b_splits-l_gens |
00001410  63 6e 74 25 2b 3d 28 62  5f 73 70 72 6f 75 74 5e  |cnt%+=(b_sprout^|
00001420  67 65 6e 25 29 0d 08 ca  05 ed 0d 08 d4 0f 3d 63  |gen%).........=c|
00001430  6e 74 25 2a 6c 5f 6e 75  6d 0d 08 de 05 3a 0d 08  |nt%*l_num....:..|
00001440  e8 30 dd 20 f2 72 6f 74  61 74 65 28 58 58 2c 79  |.0. .rotate(XX,y|
00001450  79 2c 5a 5a 2c f8 20 78  78 2c f8 20 79 79 2c f8  |y,ZZ,. xx,. yy,.|
00001460  20 7a 7a 2c 78 78 78 25  2c 7a 7a 7a 25 29 0d 08  | zz,xxx%,zzz%)..|
00001470  f2 22 59 59 3d 79 79 2a  a4 63 6f 73 28 78 78 78  |."YY=yy*.cos(xxx|
00001480  25 29 2d 5a 5a 2a a4 73  69 6e 28 78 78 78 25 29  |%)-ZZ*.sin(xxx%)|
00001490  0d 08 fc 22 7a 7a 3d 5a  5a 2a a4 63 6f 73 28 78  |..."zz=ZZ*.cos(x|
000014a0  78 78 25 29 2b 79 79 2a  a4 73 69 6e 28 78 78 78  |xx%)+yy*.sin(xxx|
000014b0  25 29 0d 09 06 22 78 78  3d 58 58 2a a4 63 6f 73  |%)..."xx=XX*.cos|
000014c0  28 7a 7a 7a 25 29 2d 59  59 2a a4 73 69 6e 28 7a  |(zzz%)-YY*.sin(z|
000014d0  7a 7a 25 29 0d 09 10 22  79 79 3d 59 59 2a a4 63  |zz%)..."yy=YY*.c|
000014e0  6f 73 28 7a 7a 7a 25 29  2b 58 58 2a a4 73 69 6e  |os(zzz%)+XX*.sin|
000014f0  28 7a 7a 7a 25 29 0d 09  1a 05 e1 0d 09 24 05 3a  |(zzz%).......$.:|
00001500  0d 09 2e 0d dd a4 73 69  6e 28 74 25 29 0d 09 38  |......sin(t%)..8|
00001510  21 3d 21 28 41 25 21 76  61 72 73 5f 73 69 6e 6d  |!=!(A%!vars_sinm|
00001520  65 6d 2b 34 2a 74 25 29  2f 36 35 35 33 36 0d 09  |em+4*t%)/65536..|
00001530  42 0d dd a4 63 6f 73 28  74 25 29 0d 09 4c 21 3d  |B...cos(t%)..L!=|
00001540  21 28 41 25 21 76 61 72  73 5f 63 6f 73 6d 65 6d  |!(A%!vars_cosmem|
00001550  2b 34 2a 74 25 29 2f 36  35 35 33 36 0d 09 56 05  |+4*t%)/65536..V.|
00001560  3a 0d 09 60 05 3a 0d 09  6a 4b 3a 20 f4 20 2a 2a  |:..`.:..jK: . **|
00001570  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 20 74 68 65 20 6e  |********** the n|
00001580  65 78 74 20 62 69 74 73  20 64 6f 20 74 68 65 20  |ext bits do the |
00001590  67 72 61 73 73 2c 20 74  65 72 72 61 69 6e 20 61  |grass, terrain a|
000015a0  6e 64 20 74 68 65 20 74  72 65 65 20 70 6f 73 6e  |nd the tree posn|
000015b0  73 0d 09 74 05 3a 0d 09  7e 0b dd f2 67 72 61 73  |s..t.:..~...gras|
000015c0  73 0d 09 88 1a e7 20 ac  20 67 5f 6f 6e 20 84 20  |s..... . g_on . |
000015d0  67 5f 73 69 7a 65 3c 3d  30 20 e1 0d 09 92 04 0d  |g_size<=0 ......|
000015e0  09 9c 18 41 25 21 76 61  72 73 5f 67 5f 6d 61 78  |...A%!vars_g_max|
000015f0  3d 67 5f 73 69 7a 65 0d  09 a6 3d 41 25 21 76 61  |=g_size...=A%!va|
00001600  72 73 5f 67 5f 73 74 6f  70 3d 28 67 5f 73 69 7a  |rs_g_stop=(g_siz|
00001610  65 2d 32 29 2a 67 5f 67  61 70 2f 32 20 3a f4 20  |e-2)*g_gap/2 :. |
00001620  68 69 67 68 65 73 74 20  63 6f 6f 72 64 20 54 4f  |highest coord TO|
00001630  20 55 53 45 0d 09 b0 19  41 25 21 76 61 72 73 5f  | USE....A%!vars_|
00001640  67 5f 77 69 64 74 68 3d  67 5f 67 61 70 0d 09 ba  |g_width=g_gap...|
00001650  4e 41 25 21 76 61 72 73  5f 67 5f 73 74 61 72 74  |NA%!vars_g_start|
00001660  3d 2d 67 5f 73 69 7a 65  2a 67 5f 67 61 70 2f 32  |=-g_size*g_gap/2|
00001670  20 3a f4 20 6c 6f 77 65  73 74 20 63 6f 6f 72 64  | :. lowest coord|
00001680  20 54 4f 20 55 53 45 20  28 69 65 20 67 6f 20 69  | TO USE (ie go i|
00001690  6e 63 6c 75 73 69 76 65  6c 79 29 0d 09 c4 17 41  |nclusively)....A|
000016a0  25 21 76 61 72 73 5f 67  5f 61 6e 67 3d 67 5f 61  |%!vars_g_ang=g_a|
000016b0  6e 67 0d 09 ce 04 0d 09  d8 1d 42 25 3d 76 65 63  |ng........B%=vec|
000016c0  5f 67 72 61 73 73 3a d6  20 65 6e 74 72 79 70 6f  |_grass:. entrypo|
000016d0  69 6e 74 0d 09 e2 16 e7  20 67 72 5f 6f 6e 20 8c  |int..... gr_on .|
000016e0  20 f2 74 65 72 72 61 69  6e 0d 09 ec 05 e1 0d 09  | .terrain.......|
000016f0  f6 05 3a 0d 0a 00 0d dd  f2 74 65 72 72 61 69 6e  |..:......terrain|
00001700  0d 0a 0a 20 42 25 3d 76  65 63 5f 61 64 76 67 72  |... B%=vec_advgr|
00001710  61 73 73 3a d6 20 65 6e  74 72 79 70 6f 69 6e 74  |ass:. entrypoint|
00001720  0d 0a 14 05 e1 0d 0a 1e  05 3a 0d 0a 28 13 dd f2  |.........:..(...|
00001730  74 65 72 72 61 69 6e 5f  73 74 61 72 74 0d 0a 32  |terrain_start..2|
00001740  42 f4 20 63 61 6c 6c 65  64 20 61 74 20 62 65 67  |B. called at beg|
00001750  69 6e 6e 69 6e 67 20 6f  66 20 65 61 63 68 20 66  |inning of each f|
00001760  6f 72 65 73 74 20 74 6f  20 69 6e 69 74 69 61 6c  |orest to initial|
00001770  69 73 65 20 74 68 65 20  74 65 72 72 61 69 6e 0d  |ise the terrain.|
00001780  0a 3c 49 67 72 5f 7a 6f  6f 6d 3d 32 36 2f 67 5f  |.<Igr_zoom=26/g_|
00001790  73 69 7a 65 20 3a f4 20  69 66 20 67 72 69 64 20  |size :. if grid |
000017a0  73 6d 61 6c 6c 20 74 68  65 6e 20 69 6e 63 72 65  |small then incre|
000017b0  61 73 65 20 70 65 61 6b  69 6e 65 73 73 20 70 65  |ase peakiness pe|
000017c0  72 20 73 71 75 61 72 65  0d 0a 46 16 41 25 21 67  |r square..F.A%!g|
000017d0  72 5f 61 74 74 72 61 63  74 6f 72 73 3d 33 0d 0a  |r_attractors=3..|
000017e0  50 04 0d 0a 5a 12 f2 64  69 73 70 65 72 73 65 28  |P...Z..disperse(|
000017f0  33 2c a3 29 0d 0a 64 04  0d 0a 6e 19 70 74 72 25  |3,.)..d...n.ptr%|
00001800  3d 41 25 2b 67 72 5f 61  74 74 72 61 63 74 6f 72  |=A%+gr_attractor|
00001810  31 0d 0a 78 0e e3 20 77  25 3d 31 20 b8 20 33 0d  |1..x.. w%=1 . 3.|
00001820  0a 82 16 20 20 21 70 74  72 25 3d 74 72 65 65 5f  |...  !ptr%=tree_|
00001830  78 28 77 25 29 0d 0a 8c  17 20 20 70 74 72 25 21  |x(w%)....  ptr%!|
00001840  34 3d 74 72 65 65 5f 7a  28 77 25 29 0d 0a 96 0e  |4=tree_z(w%)....|
00001850  20 20 70 74 72 25 21 38  3d 33 0d 0a a0 20 20 20  |  ptr%!8=3...   |
00001860  70 74 72 25 21 31 32 3d  28 b3 28 34 30 29 2b 35  |ptr%!12=(.(40)+5|
00001870  30 29 2f 67 72 5f 7a 6f  6f 6d 0d 0a aa 0e 20 20  |0)/gr_zoom....  |
00001880  70 74 72 25 2b 3d 31 36  0d 0a b4 05 ed 0d 0a be  |ptr%+=16........|
00001890  39 41 25 21 67 72 5f 61  74 74 62 61 73 65 3d 2d  |9A%!gr_attbase=-|
000018a0  32 35 36 2a 28 33 2e 32  2b 31 2e 36 2a 41 25 21  |256*(3.2+1.6*A%!|
000018b0  67 72 5f 61 74 74 72 61  63 74 6f 72 73 29 2a 67  |gr_attractors)*g|
000018c0  72 5f 7a 6f 6f 6d 0d 0a  c8 05 e1 0d 0a d2 05 3a  |r_zoom.........:|
000018d0  0d 0a dc 17 dd f2 64 69  73 70 65 72 73 65 28 6d  |......disperse(m|
000018e0  61 78 25 2c 74 25 29 0d  0a e6 10 ea 20 6f 6b 25  |ax%,t%)..... ok%|
000018f0  2c 74 72 69 65 73 25 0d  0a f0 05 f5 0d 0a fa 0f  |,tries%.........|
00001900  20 20 74 72 69 65 73 25  2b 3d 31 0d 0b 04 0b 20  |  tries%+=1.... |
00001910  20 6f 6b 25 3d b9 0d 0b  0e 13 20 20 e3 20 77 25  | ok%=.....  . w%|
00001920  3d 31 20 b8 20 6d 61 78  25 0d 0b 18 1c 20 20 20  |=1 . max%....   |
00001930  20 e7 20 77 25 3d 31 20  80 20 67 72 5f 6d 69 64  | . w%=1 . gr_mid|
00001940  64 6c 65 20 8c 0d 0b 22  1e 20 20 20 20 20 20 74  |dle ...".      t|
00001950  72 65 65 5f 78 28 31 29  3d 67 5f 73 69 7a 65 20  |ree_x(1)=g_size |
00001960  81 20 32 0d 0b 2c 1e 20  20 20 20 20 20 74 72 65  |. 2..,.      tre|
00001970  65 5f 7a 28 31 29 3d 67  5f 73 69 7a 65 20 81 20  |e_z(1)=g_size . |
00001980  32 0d 0b 36 09 20 20 20  20 cc 0d 0b 40 20 20 20  |2..6.    ...@   |
00001990  20 20 20 20 74 72 65 65  5f 78 28 77 25 29 3d b3  |    tree_x(w%)=.|
000019a0  28 67 5f 73 69 7a 65 2d  33 29 0d 0b 4a 3d 20 20  |(g_size-3)..J=  |
000019b0  20 20 20 20 74 72 65 65  5f 7a 28 77 25 29 3d b3  |    tree_z(w%)=.|
000019c0  28 67 5f 73 69 7a 65 2d  33 29 20 3a f4 20 6b 65  |(g_size-3) :. ke|
000019d0  65 70 73 20 61 77 61 79  20 66 72 6f 6d 20 65 64  |eps away from ed|
000019e0  67 65 20 62 79 20 31 0d  0b 54 09 20 20 20 20 cd  |ge by 1..T.    .|
000019f0  0d 0b 5e 10 20 20 20 20  e7 20 77 25 3e 31 20 8c  |..^.    . w%>1 .|
00001a00  0d 0b 68 17 20 20 20 20  20 20 e3 20 78 25 3d 31  |..h.      . x%=1|
00001a10  20 b8 20 77 25 2d 31 0d  0b 72 45 20 20 20 20 20  | . w%-1..rE     |
00001a20  20 20 20 74 65 73 74 25  3d 32 2a 94 28 74 72 65  |   test%=2*.(tre|
00001a30  65 5f 78 28 77 25 29 2d  74 72 65 65 5f 78 28 78  |e_x(w%)-tree_x(x|
00001a40  25 29 29 2b 94 28 74 72  65 65 5f 7a 28 77 25 29  |%))+.(tree_z(w%)|
00001a50  2d 74 72 65 65 5f 7a 28  78 25 29 29 0d 0b 7c 2b  |-tree_z(x%))..|+|
00001a60  20 20 20 20 20 20 20 20  e7 20 74 65 73 74 25 2a  |        . test%*|
00001a70  67 72 5f 7a 6f 6f 6d 3c  67 72 5f 64 69 73 70 20  |gr_zoom<gr_disp |
00001a80  8c 20 6f 6b 25 3d a3 0d  0b 86 0e 20 20 20 20 20  |. ok%=.....     |
00001a90  20 ed 20 78 25 0d 0b 90  09 20 20 20 20 cd 0d 0b  | . x%....    ...|
00001aa0  9a 39 20 20 20 20 e7 20  74 25 20 8c 20 e7 20 a4  |.9    . t% . . .|
00001ab0  68 65 69 67 68 74 28 74  72 65 65 5f 78 28 77 25  |height(tree_x(w%|
00001ac0  29 2c 74 72 65 65 5f 7a  28 77 25 29 29 3d 30 20  |),tree_z(w%))=0 |
00001ad0  8c 20 6f 6b 25 3d a3 0d  0b a4 07 20 20 ed 0d 0b  |. ok%=.....  ...|
00001ae0  ae 22 20 20 e7 20 74 72  69 65 73 25 20 83 20 31  |."  . tries% . 1|
00001af0  30 3d 39 20 8c 20 67 72  5f 64 69 73 70 2d 3d 31  |0=9 . gr_disp-=1|
00001b00  0d 0b b8 16 fd 20 6f 6b  25 20 84 20 74 72 69 65  |..... ok% . trie|
00001b10  73 25 3d 32 30 30 0d 0b  c2 53 e7 20 ac 20 6f 6b  |s%=200...S. . ok|
00001b20  25 20 8c 20 85 20 32 35  35 2c 22 43 6f 75 6c 64  |% . . 255,"Could|
00001b30  6e 27 74 20 61 6c 6c 6f  63 61 74 65 20 74 65 72  |n't allocate ter|
00001b40  72 61 69 6e 2f 74 72 65  65 20 70 6f 73 69 74 69  |rain/tree positi|
00001b50  6f 6e 73 2e 20 20 52 65  64 75 63 65 20 73 65 70  |ons.  Reduce sep|
00001b60  61 72 61 74 69 6f 6e 2e  22 0d 0b cc 05 e1 0d 0b  |aration.".......|
00001b70  d6 05 3a 0d 0b e0 13 dd  a4 68 65 69 67 68 74 28  |..:......height(|
00001b80  78 25 2c 7a 25 29 0d 0b  ea 38 3d 28 21 28 41 25  |x%,z%)...8=(!(A%|
00001b90  21 76 61 72 73 5f 72 65  63 74 6d 65 6d 2b 34 2b  |!vars_rectmem+4+|
00001ba0  78 25 2a 32 30 2b 7a 25  2a 32 30 2a 67 5f 73 69  |x%*20+z%*20*g_si|
00001bb0  7a 65 29 20 80 20 26 31  46 46 38 30 30 29 0d 0b  |ze) . &1FF800)..|
00001bc0  f4 3d f4 20 6e 6f 74 20  61 63 74 75 61 6c 20 68  |.=. not actual h|
00001bd0  65 69 67 68 74 2c 20 6a  75 73 74 20 65 6e 6f 75  |eight, just enou|
00001be0  67 68 20 74 6f 20 74 65  73 74 20 77 68 65 74 68  |gh to test wheth|
00001bf0  65 72 20 68 65 69 67 68  74 3d 30 0d 0b fe 05 3a  |er height=0....:|
00001c00  0d 0c 08 05 3a 0d 0c 12  27 3a f4 20 2a 2a 2a 2a  |....:...':. ****|
00001c10  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 20 61 72  |************* ar|
00001c20  6d 63 6f 64 65 20 74 68  69 6e 67 73 0d 0c 1c 05  |mcode things....|
00001c30  3a 0d 0c 26 05 3a 0d 0c  30 0e dd f2 63 6f 64 65  |:..&.:..0...code|
00001c40  76 61 72 73 0d 0c 3a 3e  f4 20 6e 61 6d 65 73 20  |vars..:>. names |
00001c50  6f 66 20 61 72 6d 63 6f  64 65 20 67 6c 6f 62 61  |of armcode globa|
00001c60  6c 20 76 61 72 69 61 62  6c 65 73 20 73 74 61 72  |l variables star|
00001c70  74 69 6e 67 20 61 74 20  61 64 64 72 20 69 6e 20  |ting at addr in |
00001c80  41 25 0d 0c 44 3d 76 61  72 73 5f 73 69 6e 6d 65  |A%..D=vars_sinme|
00001c90  6d 3d 30 3a 76 61 72 73  5f 63 6f 73 6d 65 6d 3d  |m=0:vars_cosmem=|
00001ca0  34 3a 76 61 72 73 5f 72  6e 64 52 4e 44 3d 38 3a  |4:vars_rndRND=8:|
00001cb0  76 61 72 73 5f 72 65 63  74 6d 65 6d 3d 31 32 0d  |vars_rectmem=12.|
00001cc0  0c 4e 12 76 61 72 73 5f  67 5f 73 74 6f 70 3d 31  |.N.vars_g_stop=1|
00001cd0  36 0d 0c 58 11 76 61 72  73 5f 72 65 63 74 73 3d  |6..X.vars_rects=|
00001ce0  32 30 0d 0c 62 3f 76 61  72 73 5f 67 5f 73 74 61  |20..b?vars_g_sta|
00001cf0  72 74 3d 32 34 3a 76 61  72 73 5f 67 5f 6d 61 78  |rt=24:vars_g_max|
00001d00  3d 32 38 3a 76 61 72 73  5f 67 5f 77 69 64 74 68  |=28:vars_g_width|
00001d10  3d 33 32 3a 76 61 72 73  5f 67 5f 61 6e 67 3d 33  |=32:vars_g_ang=3|
00001d20  36 0d 0c 6c 12 76 61 72  73 5f 6c 5f 73 69 7a 65  |6..l.vars_l_size|
00001d30  3d 34 30 0d 0c 76 24 76  61 72 73 5f 62 5f 73 68  |=40..v$vars_b_sh|
00001d40  72 69 6e 6b 3d 34 34 3a  76 61 72 73 5f 62 5f 77  |rink=44:vars_b_w|
00001d50  69 64 74 68 3d 34 38 0d  0c 80 11 76 61 72 73 5f  |idth=48....vars_|
00001d60  6c 5f 6e 75 6d 3d 35 32  0d 0c 8a 10 76 61 72 73  |l_num=52....vars|
00001d70  5f 74 65 73 74 3d 35 36  0d 0c 94 10 76 61 72 73  |_test=56....vars|
00001d80  5f 71 6d 65 6d 3d 36 30  0d 0c 9e 22 76 61 72 73  |_qmem=60..."vars|
00001d90  5f 62 5f 72 65 63 73 3d  36 34 3a 76 61 72 73 5f  |_b_recs=64:vars_|
00001da0  62 5f 73 69 64 65 73 3d  36 38 0d 0c a8 20 76 61  |b_sides=68... va|
00001db0  72 73 5f 7a 6f 6f 6d 3d  37 32 3a 76 61 72 73 5f  |rs_zoom=72:vars_|
00001dc0  73 6f 72 74 6d 65 6d 3d  37 36 0d 0c b2 44 6c 76  |sortmem=76...Dlv|
00001dd0  5f 78 64 61 74 61 3d 38  30 3a 6c 76 5f 79 64 61  |_xdata=80:lv_yda|
00001de0  74 61 3d 38 34 3a 6c 76  5f 7a 64 61 74 61 3d 38  |ta=84:lv_zdata=8|
00001df0  38 3a 6c 76 5f 73 69 7a  65 64 61 74 61 3d 39 32  |8:lv_sizedata=92|
00001e00  3a 6c 76 5f 78 61 5f 64  61 74 61 3d 39 36 0d 0c  |:lv_xa_data=96..|
00001e10  bc 3b 6c 76 5f 7a 61 5f  64 61 74 61 3d 31 30 30  |.;lv_za_data=100|
00001e20  3a 6c 76 5f 77 64 61 74  61 3d 31 30 34 3a 62 72  |:lv_wdata=104:br|
00001e30  5f 77 64 61 74 61 3d 31  30 34 3a 62 72 5f 7a 61  |_wdata=104:br_za|
00001e40  5f 64 61 74 61 3d 31 30  30 0d 0c c6 44 62 72 5f  |_data=100...Dbr_|
00001e50  78 64 61 74 61 3d 38 30  3a 62 72 5f 79 64 61 74  |xdata=80:br_ydat|
00001e60  61 3d 38 34 3a 62 72 5f  7a 64 61 74 61 3d 38 38  |a=84:br_zdata=88|
00001e70  3a 62 72 5f 73 69 7a 65  64 61 74 61 3d 39 32 3a  |:br_sizedata=92:|
00001e80  62 72 5f 78 61 5f 64 61  74 61 3d 39 36 0d 0c d0  |br_xa_data=96...|
00001e90  24 67 72 5f 61 74 74 72  61 63 74 6f 72 73 3d 31  |$gr_attractors=1|
00001ea0  30 38 3a 67 72 5f 61 74  74 62 61 73 65 3d 31 31  |08:gr_attbase=11|
00001eb0  32 0d 0c da 15 67 72 5f  61 74 74 72 61 63 74 6f  |2....gr_attracto|
00001ec0  72 31 3d 31 31 36 0d 0c  e4 25 76 61 72 73 5f 70  |r1=116...%vars_p|
00001ed0  6f 69 6e 74 31 78 3d 31  37 32 3a 76 61 72 73 5f  |oint1x=172:vars_|
00001ee0  70 6f 69 6e 74 31 79 3d  31 37 36 0d 0c ee 25 76  |point1y=176...%v|
00001ef0  61 72 73 5f 70 6f 69 6e  74 32 78 3d 31 38 30 3a  |ars_point2x=180:|
00001f00  76 61 72 73 5f 70 6f 69  6e 74 32 79 3d 31 38 34  |vars_point2y=184|
00001f10  0d 0c f8 25 76 61 72 73  5f 70 6f 69 6e 74 33 78  |...%vars_point3x|
00001f20  3d 31 38 38 3a 76 61 72  73 5f 70 6f 69 6e 74 33  |=188:vars_point3|
00001f30  79 3d 31 39 32 0d 0d 02  36 76 61 72 73 5f 76 65  |y=192...6vars_ve|
00001f40  63 74 6f 72 31 3d 31 39  36 3a 76 61 72 73 5f 76  |ctor1=196:vars_v|
00001f50  65 63 74 6f 72 32 3d 32  30 30 3a 76 61 72 73 5f  |ector2=200:vars_|
00001f60  76 65 63 74 6f 72 33 3d  32 30 34 0d 0d 0c 13 76  |vector3=204....v|
00001f70  61 72 73 5f 63 6f 6c 6f  75 72 3d 32 30 38 0d 0d  |ars_colour=208..|
00001f80  16 1e 76 61 72 73 5f 72  65 63 74 3d 32 31 32 20  |..vars_rect=212 |
00001f90  3a f4 20 34 2a 32 20 77  6f 72 64 73 0d 0d 20 37  |:. 4*2 words.. 7|
00001fa0  76 61 72 73 5f 77 61 74  65 72 5f 62 61 73 65 63  |vars_water_basec|
00001fb0  6f 6c 6f 75 72 3d 32 34  34 3a 76 61 72 73 5f 67  |olour=244:vars_g|
00001fc0  72 6f 75 6e 64 5f 6d 61  78 63 6f 6c 6f 75 72 3d  |round_maxcolour=|
00001fd0  32 34 38 0d 0d 2a 1c 76  61 72 73 5f 67 72 6f 75  |248..*.vars_grou|
00001fe0  6e 64 5f 6d 69 6e 73 68  69 66 74 3d 32 35 32 0d  |nd_minshift=252.|
00001ff0  0d 34 18 76 61 72 73 5f  73 63 72 65 65 6e 73 74  |.4.vars_screenst|
00002000  61 72 74 3d 32 35 36 0d  0d 3e 04 0d 0d 48 4c 76  |art=256..>...HLv|
00002010  65 63 5f 6e 75 6c 6c 3d  30 3a 76 65 63 5f 72 61  |ec_null=0:vec_ra|
00002020  6e 64 6f 6d 3d 31 3a 76  65 63 5f 67 72 61 73 73  |ndom=1:vec_grass|
00002030  3d 32 3a 76 65 63 5f 6c  65 61 76 65 73 3d 33 3a  |=2:vec_leaves=3:|
00002040  76 65 63 5f 62 72 61 6e  63 68 3d 34 3a 76 65 63  |vec_branch=4:vec|
00002050  5f 64 72 61 77 3d 35 0d  0d 52 21 76 65 63 5f 73  |_draw=5..R!vec_s|
00002060  6f 72 74 63 6f 70 79 3d  36 3a 76 65 63 5f 61 64  |ortcopy=6:vec_ad|
00002070  76 67 72 61 73 73 3d 37  0d 0d 5c 05 e1 0d 0d 66  |vgrass=7..\....f|
00002080  05 3a 0d 0d 70 05 3a 0d  0d 7a 38 dd f2 63 6f 64  |.:..p.:..z8..cod|
00002090  65 73 65 74 75 70 20 3a  20 f4 20 68 61 70 70 65  |esetup : . happe|
000020a0  6e 73 20 6f 6e 6c 79 20  61 74 20 62 65 67 69 6e  |ns only at begin|
000020b0  6e 69 6e 67 20 6f 66 20  70 72 6f 67 72 61 6d 0d  |ning of program.|
000020c0  0d 84 15 de 20 63 6f 64  65 74 61 62 6c 65 73 20  |.... codetables |
000020d0  33 30 30 30 0d 0d 8e 30  de 20 63 6f 64 65 71 20  |3000...0. codeq |
000020e0  38 30 30 30 20 3a f4 20  67 69 76 65 73 20 6d 61  |8000 :. gives ma|
000020f0  78 69 6d 75 6d 20 62 5f  72 65 63 73 2b 61 64 64  |ximum b_recs+add|
00002100  3d 35 30 30 0d 0d 98 04  0d 0d a2 12 de 20 63 6f  |=500......... co|
00002110  64 65 6d 65 6d 20 33 35  30 30 0d 0d ac 24 65 6e  |demem 3500...$en|
00002120  74 72 79 3d 63 6f 64 65  6d 65 6d 3a 65 6e 74 72  |try=codemem:entr|
00002130  79 70 6f 69 6e 74 3d 63  6f 64 65 6d 65 6d 0d 0d  |ypoint=codemem..|
00002140  b6 2d ff 28 22 4c 4f 41  44 20 3c 4f 62 65 79 24  |.-.("LOAD <Obey$|
00002150  44 69 72 3e 2e 61 72 6d  63 6f 64 65 20 22 2b c3  |Dir>.armcode "+.|
00002160  7e 28 63 6f 64 65 6d 65  6d 29 29 0d 0d c0 04 0d  |~(codemem)).....|
00002170  0d ca 0d de 20 41 25 20  32 30 34 38 0d 0d d4 29  |.... A% 2048...)|
00002180  e7 20 41 25 20 83 20 31  30 32 34 3c 3e 30 20 8c  |. A% . 1024<>0 .|
00002190  20 41 25 2b 3d 31 30 32  34 2d 28 41 25 20 83 20  | A%+=1024-(A% . |
000021a0  31 30 32 34 29 0d 0d de  04 0d 0d e8 16 41 25 21  |1024)........A%!|
000021b0  76 61 72 73 5f 71 6d 65  6d 3d 63 6f 64 65 71 0d  |vars_qmem=codeq.|
000021c0  0d f2 1d 41 25 21 76 61  72 73 5f 73 69 6e 6d 65  |...A%!vars_sinme|
000021d0  6d 3d 63 6f 64 65 74 61  62 6c 65 73 0d 0d fc 23  |m=codetables...#|
000021e0  41 25 21 76 61 72 73 5f  63 6f 73 6d 65 6d 3d 63  |A%!vars_cosmem=c|
000021f0  6f 64 65 74 61 62 6c 65  73 2b 33 36 31 2a 34 0d  |odetables+361*4.|
00002200  0e 06 10 e3 20 77 25 3d  30 20 b8 20 33 36 30 0d  |.... w%=0 . 360.|
00002210  0e 10 2b 20 20 21 28 41  25 21 76 61 72 73 5f 73  |..+  !(A%!vars_s|
00002220  69 6e 6d 65 6d 2b 77 25  2a 34 29 3d b5 28 b2 28  |inmem+w%*4)=.(.(|
00002230  77 25 29 29 2a 36 35 35  33 36 0d 0e 1a 2b 20 20  |w%))*65536...+  |
00002240  21 28 41 25 21 76 61 72  73 5f 63 6f 73 6d 65 6d  |!(A%!vars_cosmem|
00002250  2b 77 25 2a 34 29 3d 9b  28 b2 28 77 25 29 29 2a  |+w%*4)=.(.(w%))*|
00002260  36 35 35 33 36 0d 0e 24  05 ed 0d 0e 2e 04 0d 0e  |65536..$........|
00002270  38 05 e1 0d 0e 42 05 3a  0d 0e 4c 05 3a 0d 0e 56  |8....B.:..L.:..V|
00002280  10 dd f2 63 6f 64 65 73  65 74 75 70 32 0d 0e 60  |...codesetup2..`|
00002290  25 f4 20 73 65 74 73 20  75 70 20 76 61 72 69 61  |%. sets up varia|
000022a0  62 6c 65 73 20 66 6f 72  20 65 61 63 68 20 74 72  |bles for each tr|
000022b0  65 65 0d 0e 6a 17 41 25  21 76 61 72 73 5f 72 6e  |ee..j.A%!vars_rn|
000022c0  64 52 4e 44 3d b3 28 91  29 0d 0e 74 0c 77 25 3d  |dRND=.(.)..t.w%=|
000022d0  b3 28 2d 91 29 0d 0e 7e  14 41 25 21 76 61 72 73  |.(-.)..~.A%!vars|
000022e0  5f 72 65 63 74 73 3d 2d  31 0d 0e 88 1b 41 25 21  |_rects=-1....A%!|
000022f0  76 61 72 73 5f 62 5f 77  69 64 74 68 3d 62 5f 77  |vars_b_width=b_w|
00002300  69 64 74 68 0d 0e 92 1d  41 25 21 76 61 72 73 5f  |idth....A%!vars_|
00002310  62 5f 73 68 72 69 6e 6b  3d 62 5f 73 68 72 69 6e  |b_shrink=b_shrin|
00002320  6b 0d 0e 9c 19 41 25 21  76 61 72 73 5f 6c 5f 73  |k....A%!vars_l_s|
00002330  69 7a 65 3d 6c 5f 73 69  7a 65 0d 0e a6 17 41 25  |ize=l_size....A%|
00002340  21 76 61 72 73 5f 6c 5f  6e 75 6d 3d 6c 5f 6e 75  |!vars_l_num=l_nu|
00002350  6d 0d 0e b0 15 41 25 21  76 61 72 73 5f 7a 6f 6f  |m....A%!vars_zoo|
00002360  6d 3d 7a 6f 6f 6d 0d 0e  ba 05 e1 0d 0e c4 05 3a  |m=zoom.........:|
00002370  0d 0e ce 05 3a 0d 0e d8  3c 3a 20 f4 20 2a 2a 2a  |....:...<: . ***|
00002380  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 20 65 5f 20 2d 20  |********** e_ - |
00002390  6f 70 74 69 6f 6e 73 20  65 64 69 74 6f 72 20 2a  |options editor *|
000023a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000023b0  2a 0d 0e e2 05 3a 0d 0e  ec 05 3a 0d 0e f6 0d dd  |*....:....:.....|
000023c0  f2 65 5f 73 74 61 72 74  0d 0f 00 0f f7 2b 30 3a  |.e_start.....+0:|
000023d0  f3 20 65 5f 6e 76 25 0d  0f 0a 16 65 5f 61 72 6d  |. e_nv%....e_arm|
000023e0  3d 31 3a 65 5f 6c 69 6d  69 74 25 3d b9 0d 0f 14  |=1:e_limit%=....|
000023f0  4c de 20 65 5f 62 61 73  65 25 28 65 5f 6e 76 25  |L. e_base%(e_nv%|
00002400  29 2c 65 5f 76 61 6c 25  28 65 5f 6e 76 25 29 2c  |),e_val%(e_nv%),|
00002410  65 5f 6d 69 6e 25 28 65  5f 6e 76 25 29 2c 65 5f  |e_min%(e_nv%),e_|
00002420  6d 61 78 25 28 65 5f 6e  76 25 29 2c 65 5f 69 6e  |max%(e_nv%),e_in|
00002430  63 25 28 65 5f 6e 76 25  29 0d 0f 1e 33 de 20 65  |c%(e_nv%)...3. e|
00002440  5f 6e 61 6d 65 24 28 65  5f 6e 76 25 29 2c 20 65  |_name$(e_nv%), e|
00002450  5f 77 69 6e 64 25 28 65  5f 6e 76 25 29 2c 65 5f  |_wind%(e_nv%),e_|
00002460  69 63 6f 6e 25 28 65 5f  6e 76 25 29 0d 0f 28 12  |icon%(e_nv%)..(.|
00002470  e3 20 77 25 3d 31 20 b8  20 65 5f 6e 76 25 0d 0f  |. w%=1 . e_nv%..|
00002480  32 34 20 20 f3 20 65 5f  62 61 73 65 25 28 77 25  |24  . e_base%(w%|
00002490  29 2c 65 5f 6d 69 6e 25  28 77 25 29 2c 65 5f 6d  |),e_min%(w%),e_m|
000024a0  61 78 25 28 77 25 29 2c  65 5f 69 6e 63 25 28 77  |ax%(w%),e_inc%(w|
000024b0  25 29 0d 0f 3c 19 20 20  f3 20 65 5f 6e 61 6d 65  |%)..<.  . e_name|
000024c0  24 28 77 25 29 2c 77 24  2c 78 24 0d 0f 46 17 20  |$(w%),w$,x$..F. |
000024d0  20 65 5f 77 69 6e 64 25  28 77 25 29 3d a0 28 77  | e_wind%(w%)=.(w|
000024e0  24 29 0d 0f 50 17 20 20  65 5f 69 63 6f 6e 25 28  |$)..P.  e_icon%(|
000024f0  77 25 29 3d a0 28 78 24  29 0d 0f 5a 05 ed 0d 0f  |w%)=.(x$)..Z....|
00002500  64 16 65 5f 76 61 6c 25  28 29 3d 65 5f 62 61 73  |d.e_val%()=e_bas|
00002510  65 25 28 29 0d 0f 6e 0f  f2 65 5f 77 72 69 74 65  |e%()..n..e_write|
00002520  61 6c 6c 0d 0f 78 17 65  5f 6d 61 72 6b 25 3d 31  |all..x.e_mark%=1|
00002530  3a 65 5f 6d 69 73 63 25  3d b9 0d 0f 82 05 e1 0d  |:e_misc%=.......|
00002540  0f 8c 05 3a 0d 0f 96 05  3a 0d 0f a0 0e dd f2 65  |...:....:......e|
00002550  5f 73 63 72 6f 6c 6c 0d  0f aa 2c ea 20 77 69 6e  |_scroll...,. win|
00002560  64 6f 77 25 2c 69 63 6f  6e 25 2c 20 76 65 63 74  |dow%,icon%, vect|
00002570  6f 72 25 2c 20 69 6e 64  65 78 25 2c 20 6d 61 74  |or%, index%, mat|
00002580  63 68 25 0d 0f b4 11 77  69 6e 64 6f 77 25 3d 62  |ch%....window%=b|
00002590  25 21 32 30 0d 0f be 0f  69 63 6f 6e 25 3d 62 25  |%!20....icon%=b%|
000025a0  21 32 34 0d 0f c8 11 76  65 63 74 6f 72 25 3d 62  |!24....vector%=b|
000025b0  25 21 32 38 0d 0f d2 16  e3 20 69 6e 64 65 78 25  |%!28..... index%|
000025c0  3d 31 20 b8 20 65 5f 6e  76 25 0d 0f dc 47 20 20  |=1 . e_nv%...G  |
000025d0  e7 20 77 69 6e 64 6f 77  25 3d 65 5f 77 69 6e 64  |. window%=e_wind|
000025e0  25 28 69 6e 64 65 78 25  29 20 80 20 69 63 6f 6e  |%(index%) . icon|
000025f0  25 3d 65 5f 69 63 6f 6e  25 28 69 6e 64 65 78 25  |%=e_icon%(index%|
00002600  29 20 8c 20 6d 61 74 63  68 25 3d 69 6e 64 65 78  |) . match%=index|
00002610  25 0d 0f e6 05 ed 0d 0f  f0 04 0d 0f fa 5e 65 5f  |%............^e_|
00002620  76 61 6c 25 28 6d 61 74  63 68 25 29 3d a4 72 61  |val%(match%)=.ra|
00002630  6e 67 65 28 65 5f 76 61  6c 25 28 6d 61 74 63 68  |nge(e_val%(match|
00002640  25 29 2b 65 5f 69 6e 63  25 28 6d 61 74 63 68 25  |%)+e_inc%(match%|
00002650  29 2a 76 65 63 74 6f 72  25 2c 65 5f 6d 69 6e 25  |)*vector%,e_min%|
00002660  28 6d 61 74 63 68 25 29  2c 65 5f 6d 61 78 25 28  |(match%),e_max%(|
00002670  6d 61 74 63 68 25 29 29  0d 10 04 14 f2 65 5f 77  |match%)).....e_w|
00002680  72 69 74 65 28 6d 61 74  63 68 25 29 0d 10 0e 1a  |rite(match%)....|
00002690  6e 65 65 64 76 61 6c 25  3d b9 3a f2 65 5f 76 61  |needval%=.:.e_va|
000026a0  6c 69 64 61 74 65 0d 10  18 05 e1 0d 10 22 05 3a  |lidate.......".:|
000026b0  0d 10 2c 10 dd f2 65 5f  77 72 69 74 65 61 6c 6c  |..,...e_writeall|
000026c0  0d 10 36 0c ea 20 69 6e  64 65 78 25 0d 10 40 16  |..6.. index%..@.|
000026d0  e3 20 69 6e 64 65 78 25  3d 31 20 b8 20 65 5f 6e  |. index%=1 . e_n|
000026e0  76 25 0d 10 4a 16 20 20  f2 65 5f 77 72 69 74 65  |v%..J.  .e_write|
000026f0  28 69 6e 64 65 78 25 29  0d 10 54 05 ed 0d 10 5e  |(index%)..T....^|
00002700  05 e1 0d 10 68 05 3a 0d  10 72 15 dd f2 65 5f 77  |....h.:..r...e_w|
00002710  72 69 74 65 28 69 6e 64  65 78 25 29 0d 10 7c 1b  |rite(index%)..|.|
00002720  e7 20 65 5f 77 69 6e 64  25 28 69 6e 64 65 78 25  |. e_wind%(index%|
00002730  29 3d 30 20 8c 20 e1 0d  10 86 08 ea 20 77 24 0d  |)=0 . ...... w$.|
00002740  10 90 16 77 24 3d c3 65  5f 76 61 6c 25 28 69 6e  |...w$=.e_val%(in|
00002750  64 65 78 25 29 0d 10 9a  19 e7 20 65 5f 6d 69 6e  |dex%)..... e_min|
00002760  25 28 69 6e 64 65 78 25  29 3d 2d 31 20 8c 0d 10  |%(index%)=-1 ...|
00002770  a4 2e 20 20 e7 20 65 5f  76 61 6c 25 28 69 6e 64  |..  . e_val%(ind|
00002780  65 78 25 29 3d 2d 31 20  8c 20 77 24 3d 22 4f 6e  |ex%)=-1 . w$="On|
00002790  22 20 8b 20 77 24 3d 22  4f 66 66 22 0d 10 ae 05  |" . w$="Off"....|
000027a0  cd 0d 10 b8 43 c8 99 20  22 54 65 6d 70 65 73 74  |....C.. "Tempest|
000027b0  5f 53 65 74 49 63 6f 6e  54 65 78 74 22 2c 65 5f  |_SetIconText",e_|
000027c0  77 69 6e 64 25 28 69 6e  64 65 78 25 29 2c 65 5f  |wind%(index%),e_|
000027d0  69 63 6f 6e 25 28 69 6e  64 65 78 25 29 2c 74 62  |icon%(index%),tb|
000027e0  25 2c 77 24 0d 10 c2 05  e1 0d 10 cc 05 3a 0d 10  |%,w$.........:..|
000027f0  d6 05 3a 0d 10 e0 0e dd  f2 72 65 61 64 76 61 72  |..:......readvar|
00002800  73 0d 10 ea 15 74 5f 73  68 61 70 65 3d 65 5f 76  |s....t_shape=e_v|
00002810  61 6c 25 28 31 29 0d 10  f4 13 74 5f 6c 65 6e 3d  |al%(1)....t_len=|
00002820  65 5f 76 61 6c 25 28 32  29 0d 10 fe 13 67 72 5f  |e_val%(2)....gr_|
00002830  6f 6e 3d 65 5f 76 61 6c  25 28 33 29 0d 11 08 14  |on=e_val%(3)....|
00002840  67 5f 73 69 7a 65 3d 65  5f 76 61 6c 25 28 34 29  |g_size=e_val%(4)|
00002850  0d 11 12 13 67 5f 61 6e  67 3d 65 5f 76 61 6c 25  |....g_ang=e_val%|
00002860  28 35 29 0d 11 1c 13 67  5f 67 61 70 3d 65 5f 76  |(5)....g_gap=e_v|
00002870  61 6c 25 28 36 29 0d 11  26 15 62 5f 73 69 64 65  |al%(6)..&.b_side|
00002880  73 3d 65 5f 76 61 6c 25  28 37 29 0d 11 30 15 62  |s=e_val%(7)..0.b|
00002890  5f 73 65 63 74 73 3d 65  5f 76 61 6c 25 28 38 29  |_sects=e_val%(8)|
000028a0  0d 11 3a 16 62 5f 72 65  73 72 65 64 3d 65 5f 76  |..:.b_resred=e_v|
000028b0  61 6c 25 28 39 29 0d 11  44 17 62 5f 73 70 72 6f  |al%(9)..D.b_spro|
000028c0  75 74 3d 65 5f 76 61 6c  25 28 31 30 29 0d 11 4e  |ut=e_val%(10)..N|
000028d0  17 62 5f 73 70 6c 69 74  73 3d 65 5f 76 61 6c 25  |.b_splits=e_val%|
000028e0  28 31 31 29 0d 11 58 1b  62 5f 73 68 72 69 6e 6b  |(11)..X.b_shrink|
000028f0  3d 65 5f 76 61 6c 25 28  31 32 29 2f 31 30 30 0d  |=e_val%(12)/100.|
00002900  11 62 16 62 5f 77 69 64  74 68 3d 65 5f 76 61 6c  |.b.b_width=e_val|
00002910  25 28 31 33 29 0d 11 6c  19 62 5f 73 70 6c 69 74  |%(13)..l.b_split|
00002920  6d 61 78 3d 65 5f 76 61  6c 25 28 31 34 29 0d 11  |max=e_val%(14)..|
00002930  76 19 62 5f 73 70 6c 69  74 6d 69 6e 3d 65 5f 76  |v.b_splitmin=e_v|
00002940  61 6c 25 28 31 35 29 0d  11 80 13 6c 5f 6f 6e 3d  |al%(15)....l_on=|
00002950  65 5f 76 61 6c 25 28 31  36 29 0d 11 8a 14 6c 5f  |e_val%(16)....l_|
00002960  6e 75 6d 3d 65 5f 76 61  6c 25 28 31 37 29 0d 11  |num=e_val%(17)..|
00002970  94 15 6c 5f 73 69 7a 65  3d 65 5f 76 61 6c 25 28  |..l_size=e_val%(|
00002980  31 38 29 0d 11 9e 15 6c  5f 67 65 6e 73 3d 65 5f  |18)....l_gens=e_|
00002990  76 61 6c 25 28 31 39 29  0d 11 a8 13 7a 6f 6f 6d  |val%(19)....zoom|
000029a0  3d 65 5f 76 61 6c 25 28  32 30 29 0d 11 b2 18 6e  |=e_val%(20)....n|
000029b0  75 6d 5f 74 72 65 65 73  3d 65 5f 76 61 6c 25 28  |um_trees=e_val%(|
000029c0  32 31 29 0d 11 bc 32 e7  20 6e 75 6d 5f 74 72 65  |21)...2. num_tre|
000029d0  65 73 3e 31 20 8c 20 67  72 5f 64 69 73 70 3d 65  |es>1 . gr_disp=e|
000029e0  5f 76 61 6c 25 28 32 32  29 20 8b 20 67 72 5f 64  |_val%(22) . gr_d|
000029f0  69 73 70 3d 30 0d 11 c6  18 67 72 5f 6d 69 64 64  |isp=0....gr_midd|
00002a00  6c 65 3d 65 5f 76 61 6c  25 28 32 33 29 0d 11 d0  |le=e_val%(23)...|
00002a10  04 0d 11 da 0a 67 5f 6f  6e 3d b9 0d 11 e4 1a 6e  |.....g_on=.....n|
00002a20  75 6d 5f 62 72 61 6e 63  68 65 73 3d a4 62 72 61  |um_branches=.bra|
00002a30  6e 63 68 65 73 0d 11 ee  0d 75 70 64 61 74 65 73  |nches....updates|
00002a40  3d b9 0d 11 f8 26 41 25  21 76 61 72 73 5f 77 61  |=....&A%!vars_wa|
00002a50  74 65 72 5f 62 61 73 65  63 6f 6c 6f 75 72 3d 26  |ter_basecolour=&|
00002a60  30 30 30 33 30 30 30 30  0d 12 02 26 41 25 21 76  |00030000...&A%!v|
00002a70  61 72 73 5f 67 72 6f 75  6e 64 5f 6d 61 78 63 6f  |ars_ground_maxco|
00002a80  6c 6f 75 72 3d 26 30 33  30 30 30 33 30 31 0d 12  |lour=&03000301..|
00002a90  0c 1d 41 25 21 76 61 72  73 5f 67 72 6f 75 6e 64  |..A%!vars_ground|
00002aa0  5f 6d 69 6e 73 68 69 66  74 3d 38 0d 12 16 0f 70  |_minshift=8....p|
00002ab0  65 61 6b 69 6e 65 73 73  3d 31 0d 12 20 05 e1 0d  |eakiness=1.. ...|
00002ac0  12 2a 05 3a 0d 12 34 05  3a 0d 12 3e 46 dd f2 65  |.*.:..4.:..>F..e|
00002ad0  5f 76 61 6c 69 64 61 74  65 20 3a f4 20 63 68 65  |_validate :. che|
00002ae0  63 6b 73 20 73 65 74 74  69 6e 67 73 20 61 72 65  |cks settings are|
00002af0  20 70 6f 73 73 69 62 6c  65 2c 20 61 6e 64 20 70  | possible, and p|
00002b00  72 69 6e 74 73 20 6d 69  73 63 20 69 6e 66 6f 0d  |rints misc info.|
00002b10  12 48 0e ea 20 6e 65 78  74 65 72 72 25 0d 12 52  |.H.. nexterr%..R|
00002b20  1b 6e 65 78 74 65 72 72  25 3d 6d 61 69 6e 77 69  |.nexterr%=mainwi|
00002b30  6e 64 6f 77 5f 58 31 25  0d 12 5c 0d f2 72 65 61  |ndow_X1%..\..rea|
00002b40  64 76 61 72 73 0d 12 66  04 0d 12 70 0c 76 61 6c  |dvars..f...p.val|
00002b50  69 64 25 3d b9 0d 12 7a  1a 62 5f 72 65 63 73 3d  |id%=...z.b_recs=|
00002b60  62 5f 73 69 64 65 73 2a  62 5f 73 65 63 74 73 0d  |b_sides*b_sects.|
00002b70  12 84 4d 72 65 63 73 3d  a4 65 5f 62 72 61 6e 63  |..Mrecs=.e_branc|
00002b80  68 70 61 72 74 73 20 3a  f4 20 62 65 6c 6f 77 2c  |hparts :. below,|
00002b90  20 72 65 74 75 72 6e 73  20 6e 75 6d 62 65 72 20  | returns number |
00002ba0  6f 66 20 70 61 72 74 73  20 6e 65 65 64 65 64 20  |of parts needed |
00002bb0  66 6f 72 20 62 72 61 6e  63 68 65 73 0d 12 8e 18  |for branches....|
00002bc0  e7 20 6c 5f 6f 6e 20 72  65 63 73 2b 3d a4 6c 65  |. l_on recs+=.le|
00002bd0  61 76 65 73 0d 12 98 17  72 65 63 73 3d 72 65 63  |aves....recs=rec|
00002be0  73 2a 6e 75 6d 5f 74 72  65 65 73 0d 12 a2 19 e7  |s*num_trees.....|
00002bf0  20 67 5f 6f 6e 20 72 65  63 73 2b 3d 67 5f 73 69  | g_on recs+=g_si|
00002c00  7a 65 5e 32 0d 12 ac 10  6e 75 6d 72 65 63 73 3d  |ze^2....numrecs=|
00002c10  72 65 63 73 0d 12 b6 13  61 64 64 3d 62 5f 73 69  |recs....add=b_si|
00002c20  64 65 73 2a 32 2b 31 0d  12 c0 14 6d 65 6d 6e 65  |des*2+1....memne|
00002c30  65 64 25 3d 72 65 63 73  2a 32 34 0d 12 ca 04 0d  |ed%=recs*24.....|
00002c40  12 d4 56 e7 20 28 67 5f  73 69 7a 65 2a 31 2e 35  |..V. (g_size*1.5|
00002c50  2d 67 72 5f 64 69 73 70  2a 31 2e 37 35 29 5e 32  |-gr_disp*1.75)^2|
00002c60  3c 33 5e 28 6e 75 6d 5f  74 72 65 65 73 2d 31 29  |<3^(num_trees-1)|
00002c70  20 8c 20 f2 65 5f 65 72  72 28 22 54 72 65 65 20  | . .e_err("Tree |
00002c80  73 65 70 61 72 61 74 69  6f 6e 20 74 6f 6f 20 68  |separation too h|
00002c90  69 67 68 22 29 0d 12 de  34 e7 20 6d 65 6d 6e 65  |igh")...4. memne|
00002ca0  65 64 25 3e 6d 65 6d 25  20 8c 20 f2 65 5f 65 72  |ed%>mem% . .e_er|
00002cb0  72 28 22 49 6e 73 75 66  66 69 63 69 65 6e 74 20  |r("Insufficient |
00002cc0  6d 65 6d 6f 72 79 2e 22  29 0d 12 e8 3e e7 20 62  |memory.")...>. b|
00002cd0  5f 72 65 63 73 2b 61 64  64 3e 35 30 30 20 8c 20  |_recs+add>500 . |
00002ce0  f2 65 5f 65 72 72 28 22  54 6f 6f 20 6d 61 6e 79  |.e_err("Too many|
00002cf0  20 73 65 67 6d 65 6e 74  73 20 70 65 72 20 62 72  | segments per br|
00002d00  61 6e 63 68 2e 22 29 0d  12 f2 35 e7 20 a4 62 72  |anch.")...5. .br|
00002d10  61 6e 63 68 65 73 3e 6d  61 78 5f 62 72 20 8c 20  |anches>max_br . |
00002d20  f2 65 5f 65 72 72 28 22  54 6f 6f 20 6d 61 6e 79  |.e_err("Too many|
00002d30  20 62 72 61 6e 63 68 65  73 2e 22 29 0d 12 fc 53  | branches.")...S|
00002d40  e7 20 62 5f 73 70 6c 69  74 6d 61 78 2a 32 2d 62  |. b_splitmax*2-b|
00002d50  5f 73 70 6c 69 74 6d 69  6e 3c 28 62 5f 73 70 72  |_splitmin<(b_spr|
00002d60  6f 75 74 5e 33 29 20 f2  65 5f 65 72 72 28 22 42  |out^3) .e_err("B|
00002d70  72 61 6e 63 68 20 61 6e  67 6c 65 73 20 74 6f 6f  |ranch angles too|
00002d80  20 72 65 73 74 72 69 63  74 69 76 65 2e 22 29 0d  | restrictive.").|
00002d90  13 06 04 0d 13 10 4f c8  99 20 22 54 65 6d 70 65  |......O.. "Tempe|
00002da0  73 74 5f 53 65 74 49 63  6f 6e 54 65 78 74 22 2c  |st_SetIconText",|
00002db0  6d 61 69 6e 68 61 6e 64  6c 65 25 2c 6d 61 69 6e  |mainhandle%,main|
00002dc0  77 69 6e 64 6f 77 5f 6d  65 6d 25 2c 74 62 25 2c  |window_mem%,tb%,|
00002dd0  c3 28 6d 65 6d 25 20 81  20 31 30 32 34 29 2b 22  |.(mem% . 1024)+"|
00002de0  6b 22 0d 13 1a 57 c8 99  20 22 54 65 6d 70 65 73  |k"...W.. "Tempes|
00002df0  74 5f 53 65 74 49 63 6f  6e 54 65 78 74 22 2c 6d  |t_SetIconText",m|
00002e00  61 69 6e 68 61 6e 64 6c  65 25 2c 6d 61 69 6e 77  |ainhandle%,mainw|
00002e10  69 6e 64 6f 77 5f 6d 65  6d 6e 65 65 64 25 2c 74  |indow_memneed%,t|
00002e20  62 25 2c c3 28 6d 65 6d  6e 65 65 64 25 20 81 20  |b%,.(memneed% . |
00002e30  31 30 32 34 29 2b 22 6b  22 0d 13 24 04 0d 13 2e  |1024)+"k"..$....|
00002e40  31 f4 20 73 3d 49 4e 54  28 65 5f 61 72 6d 2a 72  |1. s=INT(e_arm*r|
00002e50  65 63 73 2f 31 30 30 30  2b 32 2b 6e 75 6d 5f 74  |ecs/1000+2+num_t|
00002e60  72 65 65 73 2a 62 5f 73  70 6c 69 74 73 29 0d 13  |rees*b_splits)..|
00002e70  38 04 0d 13 42 20 c8 95  20 6e 65 78 74 65 72 72  |8...B .. nexterr|
00002e80  25 3c 6d 61 69 6e 77 69  6e 64 6f 77 5f 58 6d 61  |%<mainwindow_Xma|
00002e90  78 25 0d 13 4c 3a 20 20  c8 99 20 22 54 65 6d 70  |x%..L:  .. "Temp|
00002ea0  65 73 74 5f 53 65 74 49  63 6f 6e 54 65 78 74 22  |est_SetIconText"|
00002eb0  2c 6d 61 69 6e 68 61 6e  64 6c 65 25 2c 6e 65 78  |,mainhandle%,nex|
00002ec0  74 65 72 72 25 2c 74 62  25 2c 22 22 0d 13 56 11  |terr%,tb%,""..V.|
00002ed0  20 20 6e 65 78 74 65 72  72 25 2b 3d 31 0d 13 60  |  nexterr%+=1..`|
00002ee0  05 ce 0d 13 6a 2e 21 70  62 25 3d 6d 61 69 6e 68  |....j.!pb%=mainh|
00002ef0  61 6e 64 6c 65 25 20 3a  20 70 62 25 21 34 3d 6d  |andle% : pb%!4=m|
00002f00  61 69 6e 77 69 6e 64 6f  77 5f 73 74 61 72 74 25  |ainwindow_start%|
00002f10  0d 13 74 27 70 62 25 21  38 3d 28 31 2b 76 61 6c  |..t'pb%!8=(1+val|
00002f20  69 64 25 29 3c 3c 32 32  20 3a 20 70 62 25 21 31  |id%)<<22 : pb%!1|
00002f30  32 3d 31 3c 3c 32 32 0d  13 7e 29 c8 99 20 22 54  |2=1<<22..~).. "T|
00002f40  65 6d 70 65 73 74 5f 45  6e 73 75 72 65 49 63 6f  |empest_EnsureIco|
00002f50  6e 53 74 61 74 65 22 2c  2c 70 62 25 2c 74 62 25  |nState",,pb%,tb%|
00002f60  0d 13 88 04 0d 13 92 0e  6e 65 65 64 76 61 6c 25  |........needval%|
00002f70  3d a3 0d 13 9c 05 e1 0d  13 a6 05 3a 0d 13 b0 11  |=..........:....|
00002f80  dd f2 65 5f 65 72 72 28  73 74 72 24 29 0d 13 ba  |..e_err(str$)...|
00002f90  3a c8 99 20 22 54 65 6d  70 65 73 74 5f 53 65 74  |:.. "Tempest_Set|
00002fa0  49 63 6f 6e 54 65 78 74  22 2c 6d 61 69 6e 68 61  |IconText",mainha|
00002fb0  6e 64 6c 65 25 2c 6e 65  78 74 65 72 72 25 2c 74  |ndle%,nexterr%,t|
00002fc0  62 25 2c 73 74 72 24 0d  13 c4 0c 76 61 6c 69 64  |b%,str$....valid|
00002fd0  25 3d a3 0d 13 ce 0f 6e  65 78 74 65 72 72 25 2b  |%=.....nexterr%+|
00002fe0  3d 31 0d 13 d8 05 e1 0d  13 e2 05 3a 0d 13 ec 13  |=1.........:....|
00002ff0  dd a4 65 5f 62 72 61 6e  63 68 70 61 72 74 73 0d  |..e_branchparts.|
00003000  13 f6 0a 63 6e 74 25 3d  30 0d 14 00 15 e3 20 77  |...cnt%=0..... w|
00003010  25 3d 30 20 b8 20 62 5f  73 70 6c 69 74 73 0d 14  |%=0 . b_splits..|
00003020  0a 28 20 20 78 25 3d 62  5f 73 65 63 74 73 2d 62  |.(  x%=b_sects-b|
00003030  5f 72 65 73 72 65 64 2a  77 25 3a e7 20 78 25 3c  |_resred*w%:. x%<|
00003040  34 20 78 25 3d 34 0d 14  14 28 20 20 79 25 3d 62  |4 x%=4...(  y%=b|
00003050  5f 73 69 64 65 73 2d 62  5f 72 65 73 72 65 64 2a  |_sides-b_resred*|
00003060  77 25 3a e7 20 79 25 3c  36 20 79 25 3d 36 0d 14  |w%:. y%<6 y%=6..|
00003070  1e 1f 20 20 63 6e 74 25  2b 3d 28 62 5f 73 70 72  |..  cnt%+=(b_spr|
00003080  6f 75 74 5e 77 25 29 2a  78 25 2a 79 25 0d 14 28  |out^w%)*x%*y%..(|
00003090  05 ed 0d 14 32 09 3d 63  6e 74 25 0d 14 3c 05 3a  |....2.=cnt%..<.:|
000030a0  0d 14 46 05 3a 0d 14 50  08 dc 20 32 33 0d 14 5a  |..F.:..P.. 23..Z|
000030b0  35 dc 20 36 2c 31 2c 39  39 2c 31 2c 22 54 72 65  |5. 6,1,99,1,"Tre|
000030c0  65 20 73 68 61 70 65 22  2c 67 65 6e 65 72 61 6c  |e shape",general|
000030d0  5f 48 25 2c 67 65 6e 65  72 61 6c 5f 73 68 61 70  |_H%,general_shap|
000030e0  65 25 0d 14 64 40 dc 20  31 30 30 2c 35 30 2c 32  |e%..d@. 100,50,2|
000030f0  30 30 2c 35 2c 22 4c 65  6e 67 74 68 20 6f 66 20  |00,5,"Length of |
00003100  74 72 65 65 20 74 72 75  6e 6b 22 2c 74 72 75 6e  |tree trunk",trun|
00003110  6b 5f 48 25 2c 74 72 75  6e 6b 5f 6c 65 6e 67 74  |k_H%,trunk_lengt|
00003120  68 25 0d 14 6e 24 dc 20  2d 31 2c 2d 31 2c 30 2c  |h%..n$. -1,-1,0,|
00003130  2d 31 2c 22 54 65 72 72  61 69 6e 20 6f 6e 3f 20  |-1,"Terrain on? |
00003140  2a 22 2c 30 2c 30 0d 14  78 3f dc 20 32 36 2c 31  |*",0,0..x?. 26,1|
00003150  36 2c 34 30 2c 32 2c 22  47 72 61 73 73 20 70 61  |6,40,2,"Grass pa|
00003160  74 74 65 72 6e 20 73 69  7a 65 22 2c 67 72 65 65  |ttern size",gree|
00003170  6e 73 5f 48 25 2c 67 72  65 65 6e 73 5f 6e 75 6d  |ns_H%,greens_num|
00003180  73 65 67 73 25 0d 14 82  40 dc 20 33 30 2c 30 2c  |segs%...@. 30,0,|
00003190  39 30 2c 35 2c 22 47 72  61 73 73 20 64 69 73 70  |90,5,"Grass disp|
000031a0  6c 61 79 20 61 6e 67 6c  65 22 2c 67 72 65 65 6e  |lay angle",green|
000031b0  73 5f 48 25 2c 67 72 65  65 6e 73 5f 72 6f 74 61  |s_H%,greens_rota|
000031c0  74 69 6f 6e 25 0d 14 8c  3f dc 20 31 32 2c 31 30  |tion%...?. 12,10|
000031d0  2c 33 36 2c 32 2c 22 47  72 61 73 73 20 73 65 67  |,36,2,"Grass seg|
000031e0  6d 65 6e 74 20 73 69 7a  65 22 2c 67 72 65 65 6e  |ment size",green|
000031f0  73 5f 48 25 2c 67 72 65  65 6e 73 5f 73 65 67 73  |s_H%,greens_segs|
00003200  69 7a 65 25 0d 14 96 36  dc 20 31 35 2c 37 2c 32  |ize%...6. 15,7,2|
00003210  35 2c 31 2c 22 42 72 61  6e 63 68 20 73 69 64 65  |5,1,"Branch side|
00003220  73 22 2c 74 72 75 6e 6b  5f 48 25 2c 74 72 75 6e  |s",trunk_H%,trun|
00003230  6b 5f 73 65 67 63 69 72  63 25 0d 14 a0 3b dc 20  |k_segcirc%...;. |
00003240  31 35 2c 36 2c 33 30 2c  31 2c 22 42 72 61 6e 63  |15,6,30,1,"Branc|
00003250  68 20 73 65 63 74 69 6f  6e 73 22 2c 74 72 75 6e  |h sections",trun|
00003260  6b 5f 48 25 2c 74 72 75  6e 6b 5f 73 65 67 6c 65  |k_H%,trunk_segle|
00003270  6e 67 74 68 25 0d 14 aa  45 dc 20 31 2c 30 2c 32  |ngth%...E. 1,0,2|
00003280  2c 31 2c 22 52 65 73 6f  6c 75 74 69 6f 6e 20 72  |,1,"Resolution r|
00003290  65 64 75 63 74 69 6f 6e  20 2a 22 2c 62 72 61 6e  |eduction *",bran|
000032a0  63 68 69 6e 67 5f 48 25  2c 62 72 61 6e 63 68 69  |ching_H%,branchi|
000032b0  6e 67 5f 72 65 73 72 65  64 25 0d 14 b4 44 dc 20  |ng_resred%...D. |
000032c0  33 2c 31 2c 34 2c 31 2c  22 42 72 61 6e 63 68 20  |3,1,4,1,"Branch |
000032d0  73 70 6c 69 74 73 20 69  6e 74 6f 2e 2e 2e 22 2c  |splits into...",|
000032e0  62 72 61 6e 63 68 69 6e  67 5f 48 25 2c 62 72 61  |branching_H%,bra|
000032f0  6e 63 68 69 6e 67 5f 73  70 6c 69 74 73 25 0d 14  |nching_splits%..|
00003300  be 48 dc 20 33 2c 31 2c  37 2c 31 2c 22 4e 75 6d  |.H. 3,1,7,1,"Num|
00003310  62 65 72 20 6f 66 20 62  72 61 6e 63 68 20 73 70  |ber of branch sp|
00003320  6c 69 74 74 69 6e 67 73  22 2c 62 72 61 6e 63 68  |littings",branch|
00003330  69 6e 67 5f 48 25 2c 62  72 61 6e 63 68 69 6e 67  |ing_H%,branching|
00003340  5f 67 65 6e 73 25 0d 14  c8 48 dc 20 38 30 2c 35  |_gens%...H. 80,5|
00003350  30 2c 39 36 2c 32 2c 22  42 72 61 6e 63 68 20 73  |0,96,2,"Branch s|
00003360  68 72 69 6e 6b 20 72 61  74 69 6f 20 28 25 29 22  |hrink ratio (%)"|
00003370  2c 62 72 61 6e 63 68 69  6e 67 5f 48 25 2c 62 72  |,branching_H%,br|
00003380  61 6e 63 68 69 6e 67 5f  73 63 61 6c 65 25 0d 14  |anching_scale%..|
00003390  d2 34 dc 20 31 30 2c 35  2c 33 30 2c 31 2c 22 42  |.4. 10,5,30,1,"B|
000033a0  72 61 6e 63 68 20 77 69  64 74 68 22 2c 74 72 75  |ranch width",tru|
000033b0  6e 6b 5f 48 25 2c 74 72  75 6e 6b 5f 77 69 64 74  |nk_H%,trunk_widt|
000033c0  68 25 0d 14 dc 47 dc 20  35 30 2c 33 30 2c 36 35  |h%...G. 50,30,65|
000033d0  2c 35 2c 22 4d 61 78 69  6d 75 6d 20 73 70 6c 69  |,5,"Maximum spli|
000033e0  74 20 61 6e 67 6c 65 22  2c 62 72 61 6e 63 68 69  |t angle",branchi|
000033f0  6e 67 5f 48 25 2c 62 72  61 6e 63 68 69 6e 67 5f  |ng_H%,branching_|
00003400  6d 61 78 61 6e 67 6c 65  25 0d 14 e6 4c dc 20 34  |maxangle%...L. 4|
00003410  35 2c 32 30 2c 37 30 2c  35 2c 22 4d 69 6e 69 6d  |5,20,70,5,"Minim|
00003420  75 6d 20 73 70 6c 69 74  20 73 65 70 61 72 61 74  |um split separat|
00003430  69 6f 6e 22 2c 62 72 61  6e 63 68 69 6e 67 5f 48  |ion",branching_H|
00003440  25 2c 62 72 61 6e 63 68  69 6e 67 5f 6d 69 6e 61  |%,branching_mina|
00003450  6e 67 6c 65 25 0d 14 f0  36 dc 20 2d 31 2c 2d 31  |ngle%...6. -1,-1|
00003460  2c 30 2c 2d 31 2c 22 4c  65 61 76 65 73 20 6f 6e  |,0,-1,"Leaves on|
00003470  3f 22 2c 67 72 65 65 6e  73 5f 48 25 2c 67 72 65  |?",greens_H%,gre|
00003480  65 6e 73 5f 6c 65 61 76  65 73 25 0d 14 fa 3b dc  |ens_leaves%...;.|
00003490  20 33 30 2c 38 2c 35 30  2c 32 2c 22 4e 75 6d 62  | 30,8,50,2,"Numb|
000034a0  65 72 20 6c 65 61 76 65  73 22 2c 67 72 65 65 6e  |er leaves",green|
000034b0  73 5f 48 25 2c 67 72 65  65 6e 73 5f 6c 65 61 66  |s_H%,greens_leaf|
000034c0  63 6f 75 6e 74 25 0d 15  04 36 dc 20 31 32 2c 35  |count%...6. 12,5|
000034d0  2c 32 35 2c 31 2c 22 4c  65 61 66 20 73 69 7a 65  |,25,1,"Leaf size|
000034e0  22 2c 67 72 65 65 6e 73  5f 48 25 2c 67 72 65 65  |",greens_H%,gree|
000034f0  6e 73 5f 6c 65 61 66 73  69 7a 65 25 0d 15 0e 3b  |ns_leafsize%...;|
00003500  dc 20 31 2c 31 2c 33 2c  31 2c 22 4c 65 61 66 20  |. 1,1,3,1,"Leaf |
00003510  67 65 6e 65 72 61 74 69  6f 6e 73 22 2c 67 72 65  |generations",gre|
00003520  65 6e 73 5f 48 25 2c 67  72 65 65 6e 73 5f 6c 65  |ens_H%,greens_le|
00003530  61 66 67 65 6e 73 25 0d  15 18 38 dc 20 32 30 30  |afgens%...8. 200|
00003540  30 2c 31 30 30 30 2c 34  30 30 30 2c 31 30 30 2c  |0,1000,4000,100,|
00003550  22 5a 6f 6f 6d 22 2c 67  65 6e 65 72 61 6c 5f 48  |"Zoom",general_H|
00003560  25 2c 67 65 6e 65 72 61  6c 5f 7a 6f 6f 6d 25 0d  |%,general_zoom%.|
00003570  15 22 3f dc 20 31 2c 31  2c 31 30 2c 31 2c 22 4e  |."?. 1,1,10,1,"N|
00003580  75 6d 62 65 72 20 6f 66  20 74 72 65 65 73 20 2a  |umber of trees *|
00003590  22 2c 67 65 6e 65 72 61  6c 5f 48 25 2c 67 65 6e  |",general_H%,gen|
000035a0  65 72 61 6c 5f 6e 75 6d  74 72 65 65 73 25 0d 15  |eral_numtrees%..|
000035b0  2c 45 dc 20 31 35 2c 30  2c 33 30 2c 33 2c 22 4d  |,E. 15,0,30,3,"M|
000035c0  69 6e 75 6d 75 6d 20 64  69 73 70 65 72 73 69 6f  |inumum dispersio|
000035d0  6e 20 2a 22 2c 67 65 6e  65 72 61 6c 5f 48 25 2c  |n *",general_H%,|
000035e0  67 65 6e 65 72 61 6c 5f  64 69 73 70 65 72 73 69  |general_dispersi|
000035f0  6f 6e 25 0d 15 36 3e dc  20 2d 31 2c 2d 31 2c 30  |on%..6>. -1,-1,0|
00003600  2c 2d 31 2c 22 43 65 6e  74 72 61 6c 20 74 72 65  |,-1,"Central tre|
00003610  65 3f 20 2a 22 2c 67 65  6e 65 72 61 6c 5f 48 25  |e? *",general_H%|
00003620  2c 67 65 6e 65 72 61 6c  5f 63 65 6e 74 72 61 6c  |,general_central|
00003630  25 0d ff                                          |%..|
00003633