Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_15_3.adf » !CavenDuel_Cavern » !CavernEd/!RunImage

!CavernEd/!RunImage

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_ArchimedesWorld_15_3.adf » !CavenDuel_Cavern
Filename: !CavernEd/!RunImage
Read OK:
File size: 8C91 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM >!RunImage
   20REM Cavern Duel Editor
   30REM Version 1.37 (4th December, 1997) Final Release
   40REM First fully multi-tasking version!
   50REM Written and designed by Stephen Scott 1995, 1996, 1997
   60REM Using WimpEd by Joe Taylor LEN Archimedes World 1992
   70:
   80SYS "Hourglass_On"
   90PROCWimp_Start("CavernEd",1900,2004)
  100PROCUser_SetInitialData
  110PROCCreate_Windows
  120PROCCreate_Menus
  130PROCWimp_MenuDisable(Screen_Menu%,3)
  140SYS "Hourglass_Off"
  150PROCWimp_WaitForEvent
  160PROCWimp_CloseDown
  170END
  180:
  190DEF PROCWimp_Start(TaskName$,wimp_memory%,icon%)
  200DIM wimp% wimp_memory%,icons% icon%
  210IF wimp_memory%<256 THEN wimp_memory%=256
  220icon_memory%=icons%+icon%
  230task$=TaskName$
  240indirect_sprites%=1 : direct_sprites%=1
  250PROCWimp_SetEventVariables
  260ON ERROR PROCWimp_Error:END
  270SYS"Wimp_Initialise",200,&4B534154,TaskName$ TO version%,task%
  280ENDPROC
  290:
  300DEF PROCWimp_SetEventVariables
  310DIM pointer_block% 20
  320interface%=FALSE
  330null%=1  :draw%=2 :  pointer_leaving%=1<<4
  340pointer_entering%=1<<5:mouse%=1<<6:drag%=1<<7
  350key%=1<<8:menu%=1<<9:scroll%=1<<10
  360lose_caret%=1<<11:gain_caret%=1<<12:message%=(1<<17)+(1<<18)
  370recorder%=1<<18:acknowledge%=1<<19:window%=0
  380sprites%=1:version%=0:task%=0
  390Bar_Window%=-2:Bar_Icon%=0:Bar_Menu%=0
  400x_origin%=0:y_origin%=0:SaveWindow%=-3
  410message_quit%=0:message_save%=2:message_load%=3
  420mouse_button%=2:save_event%=0
  430top_line%=0 : bottom_line%=0
  440ENDPROC
  450:
  460DEF PROCUser_SetInitialData
  470DIM screen$(7,3,16,16),youx(2),youy(2),yscx(2),yscy(2)
  480REM Set up 21 teleports (0-20)
  490DIM teletoscx(20),teletoscy(20),teletox(20),teletoy(20)
  500teletoscx()=0:teletoscy()=0:teletox()=0:teletoy()=0
  510DIM tscx(20),tscy(20),tx(20),ty(20),activ(20)
  520tscx()=0:tscy()=0:tx()=0:ty()=0:activ()=0
  530scx=0:scy=0:x=0:y=0
  540drawx=0:drawy=0
  550mouselock=0
  560selected=0
  570clear_selected=0
  580clearing=FALSE
  590loaded%=0
  600myownnumber%=0
  610xpos=0:ypos=0
  620telenum%=0
  630done1=0
  640done2=0
  650protect%=0
  660endloop%=0
  670defined=0
  680red=FALSE
  690green=FALSE
  700X=0:Y=0
  710SCX=0:SCY=0
  720REPEAT
  730screen$(SCX,SCY,X,Y)="0":REM Setup block
  740X+=1:IF X>16 THEN X=0:Y+=1
  750IF Y>16 THEN SCY+=1:X=0:Y=0
  760IF SCY>3 THEN SCX+=1:SCY=0:X=0:Y=0
  770UNTIL SCX>7
  780main%=0:oldicon%=0
  790DIM pal% 120:SYS "OS_File",12,"<CavernEd$Dir>.DesPal",pal%,0
  800update=FALSE:bitching=FALSE
  810tele_open=FALSE:draw$="1":erase$="0":s$=draw$
  820screen_x%=0:screen_y%=0
  830PROCWimp_SpritesPathLoad("<CavernEd$Dir>.DesSprs")
  840DIM pixtrans% 20,scalefac% 20
  850CD%=FALSE:save=FALSE
  860ENDPROC
  870:
  880DEF PROCCreate_Windows
  890infobox%=FNWimp_WindowLoad("info")
  900savebox%=FNWimp_WindowLoad("savebox")
  910checker%=FNWimp_WindowLoad("checker")
  920screen%=FNWimp_WindowLoad("Screen")
  930title%=wimp%!72:wimp%?35=&FF
  940Icons%=FNWimp_WindowLoad("icons")
  950Map%=FNWimp_WindowLoad("map")
  960wimp%!64=sprites%
  970teleports%=FNWimp_WindowLoad("teleports")
  980Bar_Icon%=FNWimp_IconBar("!caverned")
  990ENDPROC
 1000:
 1010DEF FNWimp_WindowLoad(window$)
 1020=FNWimp_WindowLoadFrom(window$,"<Obey$Dir>.Templates")
 1030:
 1040DEF FNWimp_WindowLoadFrom(window$,template$)
 1050LOCAL c%,i%,n%,j%,sp$,sp2$
 1060SYS "Wimp_OpenTemplate",,template$
 1070SYS "Wimp_LoadTemplate",,wimp%,icons%,icon_memory%,-1,window$,0 TO ,,icons%
 1080CASE sprites% OF
 1090WHEN 1    : wimp%!64=sprites%
 1100OTHERWISE : wimp%!64=FNEvent_Sprites(window%)
 1110ENDCASE
 1120SYS "Wimp_CreateWindow",,wimp% TO c%
 1130SYS "Wimp_CloseTemplate"
 1140SYS "Wimp_WhichIcon",c%,wimp%+40,1+2+(1<<8),2+(1<<8)
 1150CASE wimp%!40 OF
 1160WHEN -1   :
 1170OTHERWISE : i%=40
 1180REPEAT
 1190wimp%!4=wimp%!i% : wimp%!0=c%
 1200SYS "Wimp_GetIconState",,wimp%
 1210sp$=FNWimp_GetStringAtAddress(wimp%!28)
 1220SYS "Wimp_DeleteIcon",,wimp%
 1230CASE sprites% OF
 1240WHEN 1    : wimp%!32=1
 1250OTHERWISE :
 1260SYS "OS_SpriteOp",&108,sprites% TO ,,,n%
 1270j%=0
 1280REPEAT : j%+=1
 1290SYS "OS_SpriteOp",&10D,sprites%,pointer_block%,20,j%
 1300sp2$=FNWimp_GetStringAtAddress(pointer_block%)
 1310UNTIL j%=n% OR sp$=sp2$
 1320IF sp$=sp2$ THEN wimp%!32=sprites% ELSE wimp%!32=1
 1330ENDCASE
 1340wimp%!4=c%
 1350SYS "Wimp_CreateIcon",,wimp%+4 TO handle%
 1360i%+=4
 1370UNTIL (wimp%!i%)=-1
 1380ENDCASE
 1390=c%
 1400:
 1410DEF FNWimp_IconBar(Sprite$)
 1420LOCAL icon%
 1430wimp%!0=-1
 1440wimp%!4=0     : wimp%!8=0
 1450wimp%!12=68 : wimp%!16=68
 1460wimp%!20=&3002
 1470$(wimp%+24)=Sprite$
 1480SYS "Wimp_CreateIcon",,wimp% TO icon%
 1490=icon%
 1500:
 1510DEF PROCWimp_WaitForEvent
 1520LOCAL mask%,event%
 1530finished%=FALSE
 1540mask%=%111000011001
 1550REPEAT
 1560SYS"Wimp_Poll",mask%,wimp% TO event%
 1570CASE event% OF
 1580WHEN0 :
 1590WHEN1 : PROCWimp_PollDrawWindow
 1600WHEN2 : SYS "Wimp_OpenWindow",,wimp%
 1610WHEN3 : PROCWimp_PollCloseWindow
 1620WHEN4 :
 1630WHEN5 :
 1640WHEN6 : PROCWimp_PollMouseClick
 1650WHEN7 : PROCWimp_PollSaveMessage
 1660WHEN8 : PROCWimp_PollKeyPress
 1670WHEN9 : PROCEvent_MenuChoice(menu%)
 1680WHEN10:
 1690WHEN11:
 1700WHEN12:
 1710WHEN17,18: PROCWimp_PollMessages
 1720WHEN19:PROCack
 1730ENDCASE
 1740UNTIL finished%
 1750ENDPROC
 1760:
 1770DEF PROCWimp_PollDrawWindow
 1780LOCAL more%
 1790SYS"Wimp_RedrawWindow",,wimp%TOmore%
 1800window%=wimp%!0
 1810window_x%=wimp%!4
 1820window_y%=wimp%!16
 1830scroll_x%=wimp%!20
 1840scroll_y%=wimp%!24
 1850x_origin%=window_x%-scroll_x%
 1860y_origin%=window_y%-scroll_y%
 1870WHILE more%
 1880IF interface% THEN SYS"Wimp_BorderWindow",,wimp%
 1890PROCEvent_Draw(window%,x_origin%,y_origin%)
 1900SYS"Wimp_GetRectangle",,wimp%TOmore%
 1910ENDWHILE
 1920ENDPROC
 1930DEF FNEvent_Save(window%)
 1940CASE window% OF
 1950WHEN savebox% :=TRUE
 1960OTHERWISE :=FALSE
 1970ENDCASE
 1980:
 1990DEF FNEvent_Sprites(window%)=sprites%
 2000:
 2010DEF PROCCreate_Menus
 2020Bar_Menu%=FNWimp_MenuCreate("CavernEd\Info>infobox%\Instructions\Quit")
 2030menu$="Screen\Info>infobox%\Save>savebox%"
 2040Screen_Menu%=FNWimp_MenuCreate(menu$)
 2050ENDPROC
 2060:
 2070DEF FNEvent_Menu(window%)
 2080CASE window% OF
 2090WHEN Bar_Window% : =Bar_Menu%
 2100WHEN screen%     : =Screen_Menu%
 2110OTHERWISE        : =FALSE
 2120ENDCASE
 2130:
 2140DEF PROCEvent_WindowClose(window%,buttons%)
 2150CASE window% OF
 2160WHEN screen%
 2170main%=0:iconw%=0:map%=0
 2180PROCWimp_WindowClose(Icons%)
 2190PROCWimp_WindowClose(Map%)
 2200PROCWimp_WindowClose(teleports%)
 2210tele_open=FALSE:REM bitching=TRUE
 2220ENDCASE
 2230ENDPROC
 2240:
 2250DEF PROCEvent_Draw(window%,x_origin%,y_origin%)
 2260CASE window% OF
 2270WHEN screen%      : PROCUser_DrawScreenWindow
 2280ENDCASE
 2290ENDPROC
 2300:
 2310DEF PROCpixtrans
 2320FOR col%=0 TO 15:rgb%=pal%!2
 2330SYS"ColourTrans_ReturnColourNumber",rgb% TO colour%
 2340?(pixtrans%+col%)=colour%:pal%+=6:NEXT
 2350ENDPROC
 2360:
 2370DEF PROCUser_DrawScreenWindow
 2380$title%="Map ("+STR$(screen_x%)+","+STR$(screen_y%)+")"
 2390SYS "Wimp_ReadPixTrans",&100,sprites%,"5",0,0,0,scalefac%,pixtrans%
 2400scalefac%!8=1:scalefac%!12=1
 2410C=0:D=0
 2420FOR Y=15 TO 0 STEP-1
 2430FOR X=0 TO 15
 2440a$=screen$(screen_x%,screen_y%,X,Y)
 2450SYS&2E,256+52,sprites%,a$,(x_origin%+C),(y_origin%+D)-32,8,scalefac%,pixtrans%
 2460C+=64
 2470NEXT
 2480C=0:D-=32
 2490NEXT
 2500REM Print "tel" sprite at destination of current teleport
 2510IF tele_open THEN
 2520SYS&2E,256+52,sprites%,"tel",(x_origin%+(teletox(reference))*64),(y_origin%-(16-teletoy(reference))*32),8,scalefac%,pixtrans%
 2530ENDIF
 2540ENDPROC
 2550:
 2560DEF PROCEvent_MouseClick(window%,icon%,button%,x%,y%)
 2570CASE window% OF
 2580WHEN Bar_Window% : PROCUser_MouseBar
 2590WHEN checker%    : PROCUser_Mousechecker(button%,icon%)
 2600WHEN screen%     : PROCUser_MouseScreen(button%,icon%)
 2610WHEN Icons%      : PROCUser_Mouseicons(button%,icon%)
 2620WHEN Map%     : PROCUser_Mousemap(button%,icon%)
 2630WHEN teleports%  : PROCUser_Mouseteleports(button%,icon%)
 2640ENDCASE
 2650ENDPROC
 2660:
 2670DEF PROCUser_MouseBar
 2680IF main%=1 OR save=FALSE THEN
 2690PROCWimp_WindowBringToTop(screen%)
 2700PROCWimp_WindowForceDraw(screen%)
 2710ELSE
 2720PROCWimp_WindowBringToTop(screen%)
 2730main%=1
 2740ENDIF
 2750IF protect%=0 PROCWimp_WindowBringToTop(Icons%)
 2760PROCWimp_WindowBringToTop(Map%):
 2770IF bitching=FALSE PROCWimp_IconPutText(Map%,0,"mapdn"):bitching=TRUE:REM Set lower left icon down in map win
 2780ENDPROC
 2790:
 2800DEF PROCUser_Mousechecker(button%,icon%)
 2810IF icon%=1 THEN
 2820save=TRUE
 2830PROCunbox
 2840PROCWimp_WindowClose(checker%)
 2850update=FALSE
 2860PROCWimp_WindowBringToTop(savebox%)
 2870A$=FNWimp_IconText(savebox%,1)
 2880PROCWimp_IconCaret(savebox%,1,LEN(A$))
 2890ENDIF
 2900IF icon%=2 THEN
 2910PROCunbox
 2920update=FALSE
 2930PROCWimp_WindowClose(checker%)
 2940CD%=TRUE
 2950ENDIF
 2960IF icon%=3 THEN REM Add routine to cancel & close window
 2970PROCunbox
 2980PROCWimp_WindowClose(checker%)
 2990ENDIF
 3000IF CD%=TRUE THEN PROCWimp_CloseDown
 3010ENDPROC
 3020:
 3030DEF PROCUser_MouseScreen(button%,icon%)
 3040IF tele_open:PROCclicker:ENDPROC
 3050IF protect% THEN ENDPROC
 3060CASE button% OF
 3070WHEN 4:s$=draw$
 3080WHEN 1:s$=erase$
 3090ENDCASE
 3100update=TRUE
 3110mx=wimp%!0:my=wimp%!4
 3120!wimp%=screen%:SYS "Wimp_GetWindowState",,wimp%
 3130mx=(mx-wimp%!4+wimp%!20)
 3140my=-(my-wimp%!16+wimp%!24)
 3150mx=mx DIV 64:my=my DIV 32
 3160IF my>63 OR mx>127 THEN ENDPROC
 3170IF s$="7":IF screen$(screen_x%,screen_y%,mx,(15-my))="7":PROCtel:ENDPROC
 3180CASE s$ OF
 3190WHEN "7" : REM Staircase teleport
 3200REM Location details now fixed into teleport info window
 3210found%=0:ref=0
 3220FOR find=0 TO 20
 3230IF activ(find)=0 THEN found%=1:ref=find:find=20
 3240NEXT
 3250IF found%=0 THEN VDU7:ENDPROC
 3260teletoscx(ref)=screen_x%
 3270teletoscy(ref)=screen_y%
 3280teletox(ref)=mx
 3290teletoy(ref)=(15-my)
 3300tscx(ref)=screen_x%
 3310tscy(ref)=screen_y%
 3320tx(ref)=mx
 3330ty(ref)=(15-my)
 3340activ(ref)=1
 3350telenum%+=1:defined+=1:IF telenum%>20:VDU7:ENDPROC
 3360WHEN "17":REM Green player
 3370IF screen$(screen_x%,screen_y%,mx,(15-my))="18":VDU7:ENDPROC
 3380IF screen$(screen_x%,screen_y%,mx,(15-my))="0"  THEN : ELSE VDU7:ENDPROC
 3390IF green:screen$(yscx(1),yscy(1),youx(1),youy(1))="0"
 3400PROCWimp_WindowForceDraw(screen%)
 3410yscx(1)=screen_x%
 3420yscy(1)=screen_y%
 3430youx(1)=mx
 3440youy(1)=(15-my):green=TRUE
 3450WHEN "18":REM Red player
 3460IF screen$(screen_x%,screen_y%,mx,(15-my))="17":VDU7:ENDPROC
 3470IF screen$(screen_x%,screen_y%,mx,(15-my))="0"  THEN : ELSE VDU7:ENDPROC
 3480IF red:screen$(yscx(2),yscy(2),youx(2),youy(2))="0"
 3490PROCWimp_WindowForceDraw(screen%)
 3500yscx(2)=screen_x%
 3510yscy(2)=screen_y%
 3520youx(2)=mx
 3530youy(2)=(15-my):red=TRUE
 3540ENDCASE
 3550CASE screen$(screen_x%,screen_y%,mx,(15-my)) OF
 3560WHEN "7":PROCerase_teleporter
 3570WHEN "17":green=FALSE
 3580WHEN "18":red=FALSE
 3590ENDCASE
 3600screen$(screen_x%,screen_y%,mx,(15-my))=s$
 3610SYS "Wimp_ForceRedraw",screen%,mx*64,-(my+1)*32,(mx+1)*64,-(my)*32
 3620ENDPROC
 3630:
 3640DEF PROCclicker
 3650mx=wimp%!0:my=wimp%!4
 3660!wimp%=screen%:SYS "Wimp_GetWindowState",,wimp%
 3670mx=(mx-wimp%!4+wimp%!20)
 3680my=-(my-wimp%!16+wimp%!24)
 3690mx=mx DIV 64:my=my DIV 32
 3700IF my>63 OR mx>127 THEN ENDPROC
 3710teletox(reference)=mx
 3720teletoy(reference)=(15-my)
 3730REM c$=screen$(teletoscx(reference),teletoscy(reference),teletox(reference),teletoy(reference))
 3740REM IFc$="1" OR c$="2" OR c$="3" OR c$="4" VDU7:ENDPROC
 3750update=TRUE
 3760PROCWimp_IconPutText(teleports%,8,STR$(teletox(reference)))
 3770PROCWimp_IconPutText(teleports%,9,STR$(teletoy(reference)))
 3780PROCWimp_WindowForceDraw(screen%)
 3790PROCWimp_WindowClose(screen%)
 3800PROCWimp_WindowOpen(screen%)
 3810ENDPROC
 3820:
 3830DEF PROCrub1
 3840screen$(screen_x%,screen_y%,mx,(15-my))="0"
 3850ENDPROC
 3860DEF PROCrub2
 3870screen$(screen_x%,screen_y%,mx,(15-my))="0"
 3880ENDPROC
 3890:
 3900DEF PROCtel
 3910PROCWimp_WindowClose(Icons%)
 3920update=0
 3930reference=0
 3940IF telenum%<20 THEN f%=telenum%:ELSE f%=20
 3950FOR find=0 TO f%
 3960IF tscx(find)=screen_x% AND tscy(find)=screen_y% AND tx(find)=mx AND ty(find)=(15-my) AND activ(find)=1 THEN reference=find:found3%=1:find=telenum%
 3970NEXT
 3980PROCWimp_IconPutText(teleports%,6,STR$(teletoscx(reference)))
 3990PROCWimp_IconPutText(teleports%,7,STR$(teletoscy(reference)))
 4000PROCWimp_IconPutText(teleports%,8,STR$(teletox(reference)))
 4010PROCWimp_IconPutText(teleports%,9,STR$(teletoy(reference)))
 4020PROCWimp_WindowOpen(teleports%):tele_open=TRUE
 4030PROCWimp_IconPutText(Map%,oldicon%,"mapup"):this%=oldicon%
 4040screen_x%=teletoscx(reference):screen_y%=teletoscy(reference)
 4050$title%="Map ("+STR$(screen_x%)+","+STR$(screen_y%)+")"
 4060PROCupdatemap(1):REM Show teleport destination on map
 4070PROCWimp_WindowForceDraw(screen%)
 4080PROCWimp_WindowClose(screen%)
 4090PROCWimp_WindowOpen(screen%)
 4100ENDPROC
 4110:
 4120DEF PROCerase_teleporter:IF s$="7"THEN ENDPROC
 4130find=0
 4140REPEAT
 4150IF tscx(find)=screen_x% AND tscy(find)=screen_y% AND tx(find)=mx AND ty(find)=(15-my) THEN reference=find
 4160find+=1
 4170UNTIL find>20
 4180IF activ(reference)=0 AND tscy(reference)>0 THEN activ(reference)=0
 4190activ(reference)=0:tscx(reference)=0:tscy(reference)=0
 4200tx(reference)=0:ty(reference)=0
 4210teletoscx(reference)=0:teletoscy(reference)=0
 4220teletox(reference)=0:teletoy(reference)=0
 4230telenum%-=1:defined-=1
 4240IF telenum%<=0 telenum%=0
 4250IF defined<=0 defined=0
 4260IF defined<1 OR telenum%<1 THEN PROCWimp_WindowClose(teleports%):tele_open=FALSE:PROCWimp_WindowOpen(Icons%)
 4270ENDPROC
 4280:
 4290DEF PROCUser_Mouseicons( button%,icon%)
 4300CASE button% OF
 4310WHEN 4: REM Select
 4320CASE icon% OF
 4330REM Path icons
 4340WHEN 16:PROCdrawIcon("0")
 4350WHEN 17:PROCdrawIcon("5")
 4360WHEN 18:PROCdrawIcon("8")
 4370WHEN 19:PROCdrawIcon("9")
 4380WHEN 20:PROCdrawIcon("16")
 4390WHEN 21:PROCdrawIcon("19")
 4400REM Item icons
 4410WHEN 22:PROCdrawIcon("10")
 4420WHEN 23:PROCdrawIcon("11")
 4430WHEN 24:PROCdrawIcon("12")
 4440WHEN 25:PROCdrawIcon("14")
 4450WHEN 26:PROCdrawIcon("13")
 4460WHEN 27:PROCdrawIcon("15")
 4470REM Wall icons
 4480WHEN 28:PROCdrawIcon("1")
 4490WHEN 29:PROCdrawIcon("2")
 4500WHEN 30:PROCdrawIcon("3")
 4510WHEN 31:PROCdrawIcon("4")
 4520REM Teleports
 4530WHEN 32:PROCdrawIcon("6")
 4540WHEN 33:PROCdrawIcon("7")
 4550REM Players
 4560WHEN 34:PROCdrawIcon("18")
 4570WHEN 35:PROCdrawIcon("17")
 4580ENDCASE
 4590WHEN 1: REM Adjust
 4600CASE icon% OF
 4610WHEN 16:PROCeraseIcon("0")
 4620WHEN 17:PROCeraseIcon("5")
 4630WHEN 18:PROCeraseIcon("8")
 4640WHEN 19:PROCeraseIcon("9")
 4650WHEN 20:PROCeraseIcon("16")
 4660WHEN 21:PROCeraseIcon("19")
 4670REM Item icons
 4680WHEN 22:PROCeraseIcon("10")
 4690WHEN 23:PROCeraseIcon("11")
 4700WHEN 24:PROCeraseIcon("12")
 4710WHEN 25:PROCeraseIcon("14")
 4720WHEN 26:PROCeraseIcon("13")
 4730WHEN 27:PROCeraseIcon("15")
 4740REM Wall icons
 4750WHEN 28:PROCeraseIcon("1")
 4760WHEN 29:PROCeraseIcon("2")
 4770WHEN 30:PROCeraseIcon("3")
 4780WHEN 31:PROCeraseIcon("40")
 4790REM Teleports
 4800WHEN 32:PROCeraseIcon("6")
 4810WHEN 33:PROCeraseIcon("7")
 4820REM Players
 4830WHEN 34:PROCeraseIcon("18")
 4840WHEN 35:PROCeraseIcon("17")
 4850ENDCASE
 4860ENDCASE
 4870ENDPROC
 4880:
 4890DEF PROCdrawIcon(sp$)
 4900wimp%!0=Icons%
 4910wimp%!4=14
 4920SYS "Wimp_GetIconState",,wimp%
 4930IF $(wimp%+28)<>sp$ THEN
 4940$(wimp%+28)=sp$
 4950SYS "Wimp_DeleteIcon",,wimp%
 4960wimp%!4=Icons%
 4970SYS "Wimp_CreateIcon",,wimp%+4 TO ic%
 4980wimp%!0=Icons%
 4990wimp%!4=14
 5000wimp%!8=0
 5010wimp%!12=0
 5020SYS "Wimp_SetIconState",,wimp%
 5030ENDIF
 5040draw$=sp$
 5050ENDPROC
 5060:
 5070DEF PROCeraseIcon(sp$)
 5080wimp%!0=Icons%
 5090wimp%!4=15
 5100SYS "Wimp_GetIconState",,wimp%
 5110IF $(wimp%+28)<>sp$ THEN
 5120$(wimp%+28)=sp$
 5130SYS "Wimp_DeleteIcon",,wimp%
 5140wimp%!4=Icons%
 5150SYS "Wimp_CreateIcon",,wimp%+4 TO ic%
 5160wimp%!0=Icons%
 5170wimp%!4=15
 5180wimp%!8=0
 5190wimp%!12=0
 5200SYS "Wimp_SetIconState",,wimp%
 5210ENDIF
 5220erase$=sp$
 5230ENDPROC
 5240:
 5250DEF PROCUser_Mousemap(button%,icon%)
 5260IF tele_open THEN PROCupdatemap(0)
 5270PROCWimp_IconPutText(Map%,oldicon%,"mapup")
 5280PROCWimp_IconPutText(Map%,icon%,"mapdn")
 5290PROCWimp_WindowForceDraw(Map%)
 5300oldicon%=icon%
 5310CASE icon% OF
 5320WHEN 0,1,2,3,4,5,6,7:screen_x%=icon%:screen_y%=0
 5330WHEN 8,9,10,11,12,13,14,15:screen_x%=(icon%-8):screen_y%=1
 5340WHEN 16,17,18,19,20,21,22,23:screen_x%=(icon%-16):screen_y%=2
 5350WHEN 24,25,26,27,28,29,30,31:screen_x%=(icon%-24):screen_y%=3
 5360ENDCASE
 5370IF tele_open=TRUE THEN
 5380teletoscx(reference)=screen_x%
 5390teletoscy(reference)=screen_y%
 5400PROCWimp_IconPutText(teleports%,6,STR$(teletoscx(reference)))
 5410PROCWimp_IconPutText(teleports%,7,STR$(teletoscy(reference)))
 5420ENDIF
 5430$title%="Map ("+STR$(screen_x%)+","+STR$(screen_y%)+")"
 5440PROCWimp_WindowForceDraw(screen%)
 5450PROCWimp_WindowClose(screen%)
 5460PROCWimp_WindowOpen(screen%)
 5470ENDPROC
 5480:
 5490DEF PROCupdate
 5500$title%="Map ("+STR$(teletoscx(reference))+","+STR$(teletoscy(reference))+")"
 5510screen_x%=teletoscx(reference):screen_y%=teletoscy(reference)
 5520PROCWimp_WindowForceDraw(screen%)
 5530PROCWimp_WindowClose(screen%)
 5540PROCWimp_WindowOpen(screen%)
 5550ENDPROC
 5560DEF PROCupdatemap(m)
 5570IF m=0:PROCWimp_IconPutText(Map%,(teletoscy(reference)*8)+teletoscx(reference),"mapup"):oldicon%=(teletoscy(reference)*8)+teletoscx(reference)
 5580IF m=1:PROCWimp_IconPutText(Map%,(teletoscy(reference)*8)+teletoscx(reference),"mapdn"):oldicon%=(teletoscy(reference)*8)+teletoscx(reference)
 5590ENDPROC
 5600:
 5610DEF PROCUser_Mouseteleports(button%,icon%)
 5620CASE icon% OF
 5630WHEN 11: 
 5640IF teletoscx(reference)<7 THEN
 5650PROCupdatemap(0)
 5660teletoscx(reference)+=1
 5670PROCWimp_IconPutText(teleports%,6,STR$(teletoscx(reference)))
 5680PROCupdatemap(1):PROCupdate
 5690ENDIF
 5700WHEN 10:
 5710IF teletoscx(reference)>0 THEN
 5720PROCupdatemap(0)
 5730teletoscx(reference)-=1
 5740PROCWimp_IconPutText(teleports%,6,STR$(teletoscx(reference)))
 5750PROCupdatemap(1):PROCupdate
 5760ENDIF
 5770WHEN 13:
 5780IF teletoscy(reference)<3 THEN
 5790PROCupdatemap(0)
 5800teletoscy(reference)+=1
 5810PROCWimp_IconPutText(teleports%,7,STR$(teletoscy(reference)))
 5820PROCupdatemap(1):PROCupdate
 5830ENDIF
 5840WHEN 12:
 5850IF teletoscy(reference)>0 THEN
 5860PROCupdatemap(0)
 5870teletoscy(reference)-=1
 5880PROCWimp_IconPutText(teleports%,7,STR$(teletoscy(reference)))
 5890PROCupdatemap(1):PROCupdate
 5900ENDIF
 5910WHEN 15:
 5920IF teletox(reference)<15 THEN teletox(reference)+=1:PROCWimp_IconPutText(teleports%,8,STR$(teletox(reference))):PROCupdate
 5930WHEN 14:
 5940IF teletox(reference)>0:teletox(reference)-=1:PROCWimp_IconPutText(teleports%,8,STR$(teletox(reference))):PROCupdate
 5950WHEN 17:
 5960IF teletoy(reference)<15:teletoy(reference)+=1:PROCWimp_IconPutText(teleports%,9,STR$(teletoy(reference))):PROCupdate
 5970WHEN 16:
 5980IF teletoy(reference)>0:teletoy(reference)-=1:PROCWimp_IconPutText(teleports%,9,STR$(teletoy(reference))):PROCupdate
 5990WHEN 4:REM Cancel icon
 6000PROCupdatemap(0)
 6010teletoscx(reference)=tscx(reference)
 6020teletoscy(reference)=tscy(reference)
 6030teletox(reference)=tx(reference)
 6040teletoy(reference)=ty(reference)
 6050PROCWimp_IconPutText(Map%,this%,"mapdn"):oldicon%=this%
 6060PROCWimp_WindowClose(teleports%):tele_open=FALSE
 6070PROCWimp_WindowOpen(Icons%):PROCupdate
 6080WHEN 5:REM OK icon
 6090PROCupdatemap(1)
 6100oldicon%=(teletoscy(reference)*8)+teletoscx(reference)
 6110PROCWimp_WindowClose(teleports%):tele_open=FALSE
 6120PROCWimp_WindowOpen(Icons%):PROCupdate
 6130ENDCASE
 6140ENDPROC
 6150:
 6160DEF PROCEvent_KeyPress(window%,icon%,key%)
 6170CASE window% OF
 6180WHEN teleports%  : PROCUser_KeyPressteleports(icon%,key%)
 6190ENDCASE
 6200ENDPROC
 6210:
 6220DEF PROCUser_KeyPressteleports(icon%,key%)
 6230CASE key% OF
 6240WHEN 13:CASE icon% OF
 6250WHEN 6:PROCupdate
 6260WHEN 7:PROCupdate
 6270WHEN 8:PROCupdate
 6280WHEN 9:PROCupdate
 6290ENDCASE
 6300WHEN 398:PROCmove_caret(icon%,1)
 6310WHEN 399:PROCmove_caret(icon%,-1)
 6320OTHERWISE
 6330SYS "Wimp_ProcessKey",key%
 6340ENDCASE
 6350ENDPROC
 6360:
 6370DEF PROCmove_caret(I%,dir%)
 6380IF I%=6 AND dir%=-1 PROCWimp_IconCaret(teleports%,6,0):ENDPROC
 6390IF I%=6 AND dir%=1 PROCWimp_IconCaret(teleports%,7,0):ENDPROC
 6400IF I%=7 AND dir%=-1 PROCWimp_IconCaret(teleports%,6,0):ENDPROC
 6410IF I%=7 AND dir%=1 PROCWimp_IconCaret(teleports%,8,0):ENDPROC
 6420IF I%=8 AND dir%=-1 PROCWimp_IconCaret(teleports%,7,0):ENDPROC
 6430IF I%=8 AND dir%=1 PROCWimp_IconCaret(teleports%,9,0):ENDPROC
 6440IF I%=9 AND dir%=-1 PROCWimp_IconCaret(teleports%,8,0):ENDPROC
 6450IF I%=9 AND dir%=1 PROCWimp_IconCaret(teleports%,9,0):ENDPROC
 6460ENDPROC
 6470:
 6480DEF PROCEvent_MenuChoice(menu%)
 6490CASE menu% OF
 6500WHEN Bar_Menu%          : PROCUser_MenuChoiceBar
 6510WHEN Screen_Menu%       : PROCUser_MenuChoiceScreen
 6520ENDCASE
 6530ENDPROC
 6540:
 6550DEF PROCUser_MenuChoiceBar
 6560IF save=FALSE THEN
 6570CASE FNWimp_MenuChoice(0) OF
 6580WHEN 1 :
 6590WHEN 2 : PROCopentext
 6600WHEN 3 :
 6610IF update=TRUE THEN
 6620PROCWimp_WindowBringToTop(checker%)
 6630PROCmousebox(checker%)
 6640ENDIF
 6650IF update=FALSE THEN finished%=TRUE
 6660ENDCASE
 6670ENDIF
 6680ENDPROC
 6690:
 6700DEF PROCmousebox(w%)
 6710wimp%!0=w%
 6720SYS "Wimp_GetWindowOutline",,wimp%
 6730MOUSE RECTANGLE wimp%!4+2,wimp%!8+2,wimp%!12-wimp%!4-4,wimp%!16-wimp%!8-4
 6740ENDPROC
 6750:
 6760DEF PROCunbox
 6770SYS "OS_ReadModeVariable",-1,11 TO ,,xpic
 6780SYS "OS_ReadModeVariable",-1,12 TO ,,ypic
 6790SYS "OS_ReadModeVariable",-1,4 TO ,,xfact
 6800SYS "OS_ReadModeVariable",-1,5 TO ,,yfact
 6810MOUSE RECTANGLE 0,0,xpic<<xfact,ypic<<yfact
 6820ENDPROC
 6830:
 6840DEF PROCUser_MenuChoiceScreen
 6850CASE FNWimp_MenuChoice(0) OF
 6860WHEN 1 : 
 6870WHEN 2 : 
 6880WHEN 3 : IF telenum%>0 THEN
 6890PROCWimp_WindowOpen(teleports%)
 6900PROCWimp_WindowClose(Icons%):tele_open=TRUE
 6910PROCWimp_IconPutText(Map%,oldicon%,"mapup")
 6920oldicon%=(teletoscy(telenum%)*8)+teletoscx(telenum%)
 6930PROCupdatemap(0):PROCupdatemap(1):PROCupdate
 6940ENDIF
 6950ENDCASE
 6960ENDPROC
 6970:
 6980DEF PROCEvent_LoadFile(file$,type$)
 6990IF type$<>"22":PROCWimp_WindowAlert("Cavern Duel Editor","This is not a CaveFile!"):ENDPROC
 7000IF update=TRUE THEN
 7010check%=FNWimp_WindowCancel("Cavern Duel Editor","The current CaveFile has been modified, are you sure you want to load a new one ?")
 7020IF check%=TRUE THEN update=FALSE
 7030IF check%=FALSE THEN update=TRUE:ENDPROC
 7040ENDIF
 7050PROCWimp_IconPutText(savebox%,1,file$)
 7060SYS "Hourglass_On"
 7070x=0:y=15:scrx=0:scry=0:telenum%=0:backup%=0:defined=0
 7080channel=OPENIN(file$)
 7090a$=""
 7100A$=CHR$(BGET#channel)
 7110IF A$="#" THEN protect%=1:PROCWimp_WindowAlert("Cavern Duel Editor","This CaveFile has been protected from alteration. The map editing and saving functions will be disabled!")
 7120PROCWimp_WindowClose(screen%)
 7130IF protect%:PROCWimp_WindowClose(Icons%)
 7140IF protect%:PROCWimp_WindowClose(teleports%):tele_open=FALSE
 7150IF A$="*" THEN protect%=0
 7160REPEAT
 7170y=15
 7180REPEAT
 7190a$=CHR$(BGET#channel)
 7200CASE a$ OF
 7210WHEN "A":a$="12"
 7220WHEN "B":a$="11"
 7230WHEN "C":a$="10"
 7240WHEN "D":a$="13"
 7250WHEN "E":a$="14"
 7260WHEN "F":a$="15"
 7270WHEN "G":a$="16"
 7280WHEN "P":a$="17":youx(1)=x:youy(1)=y:yscx(1)=scrx:yscy(1)=scry:green=TRUE
 7290WHEN "Q":a$="18":youx(2)=x:youy(2)=y:yscx(2)=scrx:yscy(2)=scry:red=TRUE
 7300WHEN "H":a$="19"
 7310ENDCASE
 7320screen$(scrx,scry,x,y)=a$
 7330IF a$="7" :PROCread_details_of_teleport:telenum%+=1:backup%+=1:defined+=1
 7340x+=1:IF x>15 THEN x=0:y-=1
 7350UNTIL y<0
 7360a$=CHR$(BGET#channel)
 7370IF a$<>"-" THEN SYS "XOS_CLI","Close":PROCWimp_WindowAlert("Cavern Duel Editor","Damaged CaveFile. The load operation has been cancelled."):ENDPROC
 7380scry+=1:IF scry>3 THEN scry=0:scrx+=1
 7390UNTIL scrx>7
 7400SYS "XOS_CLI","Close"
 7410telenum%=backup%
 7420FOR A%=telenum%+1 TO 20
 7430activ(A%)=0
 7440teletoscx(A%)=0:teletoscy(A%)=0:teletox(A%)=0:teletoy(A%)=0:tscx(A%)=0:tscy(A%)=0:tx(A%)=0:ty(A%)=0
 7450NEXT
 7460safe%=TRUE
 7470cave_loaded%=TRUE
 7480sprite_deleted%=FALSE
 7490telenum%=1
 7500PROCWimp_IconPutText(teleports%,6,STR$(teletoscx(telenum%)))
 7510PROCWimp_IconPutText(teleports%,7,STR$(teletoscy(telenum%)))
 7520PROCWimp_IconPutText(teleports%,8,STR$(teletox(telenum%)))
 7530PROCWimp_IconPutText(teleports%,9,STR$(teletoy(telenum%)))
 7540SYS "Hourglass_Smash"
 7550PROCWimp_WindowOpen(screen%)
 7560PROCWimp_WindowForceDraw(screen%)
 7570PROCWimp_WindowOpen(Map%)
 7580PROCWimp_WindowOpen(Icons%)
 7590ENDPROC
 7600:
 7610DEF PROCread_details_of_teleport
 7620IF telenum%>20 VDU7:ENDPROC
 7630t1$=CHR$(BGET#channel)
 7640t2$=CHR$(BGET#channel)
 7650t3$=CHR$(BGET#channel):t4$=CHR$(BGET#channel)
 7660activ(telenum%)=1
 7670teletoscx(telenum%)=ASC(t1$)-65
 7680teletoscy(telenum%)=ASC(t2$)-65
 7690teletox(telenum%)=ASC(t3$)-65
 7700teletoy(telenum%)=ASC(t4$)-65
 7710tscx(telenum%)=scrx
 7720tscy(telenum%)=scry
 7730tx(telenum%)=x
 7740ty(telenum%)=y
 7750ENDPROC
 7760:
 7770DEF PROCEvent_SaveFile(file$,window%)
 7780CASE window% OF
 7790WHEN savebox%
 7800IF red=FALSE AND green=TRUE THEN PROCWimp_WindowAlert("Cavern Duel Editor","You haven't defined a location for the red player. The save operation has been cancelled."):PROCWimp_WindowClose(savebox%):PROCWimp_MenuClose:ENDPROC
 7810IF green=FALSE AND red=TRUE THEN PROCWimp_WindowAlert("Cavern Duel Editor","You haven't defined a location for the green player. The save operation has been cancelled."):PROCWimp_WindowClose(savebox%):PROCWimp_MenuClose:ENDPROC
 7820IF red=FALSE AND green=FALSE THEN PROCWimp_WindowAlert("Cavern Duel Editor","You haven't defined any locations for the red and green players. The save operation has been cancelled."):PROCWimp_WindowClose(savebox%):PROCWimp_MenuClose:ENDPROC
 7830LOCAL ERROR
 7840ON ERROR LOCAL PROCerr
 7850channel=OPENIN(file$)
 7860IF channel<>0 THEN
 7870check%=FNWimp_WindowCancel("Cavern Duel Editor","This CaveFile already exists. Do you want to overwrite it ?")
 7880IF check%=TRUE THEN channel=0
 7890CLOSE#channel
 7900IF check%=FALSE THEN PROCWimp_WindowClose(savebox%):ENDPROC
 7910ENDIF
 7920SYS "Hourglass_On"
 7930sc2x=0:sc2y=0:x=0:y=0
 7940channel=OPENOUT(file$)
 7950BPUT#channel,"*";
 7960REPEAT
 7970x=0:y=15
 7980REPEAT:done=0
 7990a$=screen$(sc2x,sc2y,x,y)
 8000CASE a$ OF
 8010WHEN "7":BPUT#channel,a$;:PROCsave_tele_details:done=1
 8020WHEN "12":a$="A":done=1:BPUT#channel,a$;
 8030WHEN "11":a$="B":done=1:BPUT#channel,a$;
 8040WHEN "10":a$="C":done=1:BPUT#channel,a$;
 8050WHEN "13":a$="D":done=1:BPUT#channel,a$;
 8060WHEN "14":a$="E":done=1:BPUT#channel,a$;
 8070WHEN "15":a$="F":done=1:BPUT#channel,a$;
 8080WHEN "16":a$="G":done=1:BPUT#channel,a$;
 8090WHEN "17":a$="P":done=1:BPUT#channel,a$;
 8100WHEN "18":a$="Q":done=1:BPUT#channel,a$;
 8110WHEN "19":a$="H":done=1:BPUT#channel,a$;
 8120ENDCASE
 8130IF done=0 THEN BPUT#channel,a$;
 8140x+=1:IF x>15 THEN x=0:y-=1
 8150UNTIL y<0
 8160BPUT#channel,"-";
 8170sc2y+=1:IF sc2y>3 THEN sc2x+=1:sc2y=0
 8180UNTIL sc2x>7
 8190CLOSE#channel
 8200PROCWimp_MenuClose
 8210SYS "XOS_CLI","SetType "+file$+" 022"
 8220ENDCASE
 8230SYS "Hourglass_Off"
 8240update=FALSE
 8250ENDPROC
 8260:
 8270DEF PROCerr
 8280IF ERR=67785 THEN
 8290PROCWimp_WindowErrorBox("Cavern Duel Editor","Your disc is write protected.  Please write enable the disc and click to continue."):SYS"XOS_CLI","Close"
 8300ELSE
 8310PROCWimp_WIndowErrorBox("Cavern Duel Editor","This file could not be saved into the selected directory."):SYS "XOS_CLI","Close"
 8320ENDIF
 8330ENDPROC
 8340:
 8350DEF PROCsave_tele_details:reference=0
 8360IF telenum%<21 THEN FOR a%=0TOtelenum%:ELSE FOR a%=0TO20
 8370IF tscx(a%)=sc2x AND tscy(a%)=sc2y AND tx(a%)=x AND ty(a%)=y THEN reference=a%:a%=telenum%
 8380NEXT
 8390BPUT#channel,CHR$(teletoscx(reference)+65);
 8400BPUT#channel,CHR$(teletoscy(reference)+65);
 8410BPUT#channel,CHR$(teletox(reference)+65);
 8420BPUT#channel,CHR$(teletoy(reference)+65);
 8430ENDPROC
 8440:
 8450DEF PROCWimp_WindowAlert(title$,message$)
 8460PROCWimp_WindowAlertBox(title$,message$,0)
 8470ENDPROC
 8480:
 8490DEF PROCWimp_WindowAlertBox(title$,message$,button%)
 8500LOCAL response%
 8510$(wimp%+4)=message$
 8520CASE button% OF
 8530WHEN 2    : response%=1
 8540WHEN 1    : response%=15
 8550WHEN 3    : response%=(1<<5)+16
 8560WHEN 4    : response%=(1<<6)+16
 8570OTHERWISE : response%=16
 8580ENDCASE
 8590SYS "Wimp_ReportError",wimp%,response%,title$ TO ,response%
 8600ENDPROC
 8610:
 8620DEF FNWimp_WindowCancel(title$,message$)
 8630$(wimp%+4)=message$
 8640response%=23
 8650SYS "Wimp_ReportError",wimp%,response%,title$ TO ,response%
 8660=response%-2
 8670:
 8680DEF PROCWimp_WindowErrorBox(title$,message$)
 8690PROCWimp_WindowAlertBox(title$,message$,2)
 8700ENDPROC
 8710:
 8720DEF FNWimp_WindowTitle(window%)
 8730wimp%!0=window%
 8740SYS "Wimp_GetWindowInfo",,wimp%
 8750IF ((wimp%!60)AND&100)=0 ERROR 1,"Title isn't indirected"
 8760=$(wimp%!76)
 8770:
 8780DEF PROCWimp_WindowBringToTop(window%)
 8790!wimp%=window%
 8800SYS "Wimp_GetWindowState",,wimp%
 8810wimp%!28=-1
 8820SYS "Wimp_OpenWindow",,wimp%
 8830ENDPROC
 8840:
 8850DEF PROCWimp_WindowClose(window%)
 8860!wimp%=window%
 8870SYS "Wimp_CloseWindow",,wimp%
 8880ENDPROC
 8890:
 8900DEF PROCWimp_WindowForceDraw(window%)
 8910CASE window% OF
 8920 WHEN -1   : SYS "Wimp_ForceRedraw",-1,0,0,2*1280,2*1024
 8930OTHERWISE : SYS "Wimp_ForceRedraw",window%,0,-2*1024,2*512,0 
 8940ENDCASE
 8950ENDPROC
 8960:
 8970DEF PROCWimp_WindowOpen(window%)
 8980!wimp%=window%
 8990SYS "Wimp_GetWindowState",,wimp%
 9000SYS "Wimp_OpenWindow",,wimp%
 9010ENDPROC
 9020:
 9030PROCWimp_WindowInterface
 9040SYS"Wimp_BorderWindow",,wimp%
 9050ENDPROC
 9060:
 9070DEF PROCWimp_IconCaret(window%,icon%,chars%)
 9080SYS "Wimp_SetCaretPosition",window%,icon%,,,-1,chars%
 9090ENDPROC
 9100:
 9110DEF FNWimp_IconText(window%,icon%)
 9120wimp%!0=window% : wimp%!4=icon%
 9130SYS "Wimp_GetIconState",,wimp%
 9140IF ((wimp%!24) AND &100)=0 ERROR 1,"Icon isn't indirected"
 9150=$(wimp%!28)
 9160:
 9170DEF FNWimp_IconValidation(window%,icon%)
 9180wimp%!0=window% : wimp%!4=icon%
 9190SYS "Wimp_GetIconState",,wimp%
 9200IF ((wimp%!24) AND &100)=0 ERROR 1,"Icon isn't indirected"
 9210=$(wimp%!32)
 9220:
 9230DEF PROCWimp_IconDisable(window%,icon%)
 9240wimp%!0=window% : wimp%!4=icon%
 9250wimp%!8=1<<22   : wimp%!12=1<<22
 9260SYS "Wimp_SetIconState",,wimp%
 9270ENDPROC
 9280:
 9290DEF PROCWimp_IconEnable(window%,icon%)
 9300wimp%!0=window% : wimp%!4=icon%
 9310wimp%!8=0       : wimp%!12=1<<22
 9320SYS "Wimp_SetIconState",,wimp%
 9330ENDPROC
 9340:
 9350DEF PROCWimp_IconPutSprite(window%,icon%,sprite$)
 9360wimp%!0=window%:wimp%!4=icon%
 9370SYS "Wimp_GetIconState",,wimp%
 9380SYS "Wimp_DeleteIcon",,wimp%
 9390wimp%!4=wimp%!8   : wimp%!8=wimp%!12  : wimp%!12=wimp%!16
 9400wimp%!16=wimp%!20 : wimp%!20=wimp%!24 : $(wimp%+24)=sprite$
 9410SYS "Wimp_CreateIcon",,wimp% TO icon%:ENDPROC
 9420:
 9430DEF PROCWimp_IconPutText(window%,icon%,text$)
 9440wimp%!0=window% : wimp%!4=icon%
 9450SYS "Wimp_GetIconState",,wimp%
 9460IF ((wimp%!24) AND &100)=0 ERROR 1,"Icon isn't indirected"
 9470$(wimp%!28)=text$
 9480wimp%!0=window% : wimp%!4=icon%
 9490wimp%!8=0 : wimp%!12=0
 9500SYS "Wimp_SetIconState",,wimp%
 9510ENDPROC
 9520:
 9530DEF PROCWimp_IconInterfaceStart
 9540SYS"Wimp_BorderIcon",,wimp%
 9550ENDPROC
 9560:
 9570DEF PROCWimp_IconInterfaceFinish
 9580wimp%!8=0
 9590SYS"Wimp_BorderIcon",,wimp%
 9600ENDPROC
 9610:
 9620DEF PROCWimp_MenuAdjustOn(menu%)
 9630SYS "Wimp_GetPointerInfo",,pointer_block%
 9640IF ((pointer_block%!8)AND1)=1 THEN SYS "Wimp_CreateMenu",,menu%,pointer_block%!0,pointer_block%!4
 9650ENDPROC
 9660:
 9670DEF FNWimp_MenuChoice(level%)
 9680=(wimp%!(4*level%))+1
 9690:
 9700DEF FNWimp_MenuCreate(menu$)
 9710IF menu$="Colours" THEN=FNWimp_MenuColours
 9720LOCAL menu%,index%,width%,length%,k%,s%
 9730DIM menu% 28+FNWimp_MenuNoOfEntries(menu$)*24
 9740menu%?12=7   : menu%?13=2  : menu%?14=7 :menu%?15=0
 9750menu%!16=140 : menu%!20=44 : menu%!24=0
 9760index%=menu%+28
 9770$menu%=LEFT$(menu$,INSTR(menu$,"\")-1)
 9780width%=LEN(LEFT$(menu$,INSTR(menu$,"\")-1))
 9790menu$+="\" : Menu_NoOfEntries%=0
 9800WHILE menu$<>""
 9810menu$=MID$(menu$,INSTR(menu$,"\")+1)
 9820CASE menu$ OF
 9830WHEN ""
 9840OTHERWISE :
 9850!index%=0 : index%!4=-1 : index%!8=&7000021
 9860length%=INSTR(menu$,"\")-1
 9870k%=INSTR(LEFT$(menu$,length%),">")
 9880CASE k% OF
 9890WHEN 0
 9900OTHERWISE
 9910s%=EVAL(MID$(menu$,k%+1,length%-k%))
 9920index%!4=s%
 9930length%=k%-1
 9940ENDCASE
 9950$(index%+12)=LEFT$(menu$,length%)
 9960IF length%>width% THEN width%=length%
 9970index%+=24
 9980ENDCASE
 9990ENDWHILE
10000menu%!16=16*(width%+1)
10010index%!-24=index%!-24 OR &80 : =menu%
10020:
10030DEF FNWimp_MenuColours
10040=FNWimp_MenuCreateColours(" ")
10050:
10060DEF FNWimp_MenuCreateColours(title$)
10070LOCAL x$,men%,j%,i%
10080x$=title$+"\0\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15"
10090men%=FNWimp_MenuCreate(x$)
10100FOR i%=0 TO 15
10110CASE TRUE OF
10120WHEN i%<4,i%=9,i%=12,i%=14,i%=15 : j%=7
10130OTHERWISE : j%=0
10140ENDCASE
10150men%?(39+i%*24)=i%*16+j%
10160PROCWimp_MenuCentre(men%,i%+1)
10170NEXT
10180=men%
10190:
10200DEF FNWimp_MenuNoOfEntries(menu$)
10210LOCAL n% ,j% : n%=0 : j%=0
10220REPEAT
10230j%=INSTR(menu$,"\",j%+1)
10240IF j%<>0 THEN n%+=1
10250UNTIL j%=0
10260=n%
10270:
10280DEF PROCWimp_MenuBackGroundColour(menu%,item%,colour%)
10290LOCAL fore%,i%
10300fore%=(menu%?(39+(item%-1)*24))MOD16
10310i%=((menu%?(39+(item%-1)*24))DIV16)MOD16
10320menu%?(39+(item%-1)*24)=fore%+16*colour%+i%
10330ENDPROC
10340:
10350DEF PROCWimp_MenuCentre(menu%,item%)
10360menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)OR(1<<3)
10370ENDPROC
10380:
10390DEF PROCWimp_MenuClose
10400SYS "Wimp_CreateMenu",-1
10410ENDPROC
10420:
10430DEF PROCWimp_MenuDisable(menu%,item%)
10440menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)OR(1<<22)
10450ENDPROC
10460:
10470DEF PROCWimp_MenuDottedLine(menu%,item%)
10480menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))OR2
10490ENDPROC
10500:
10510DEF PROCWimp_MenuEnable(menu%,item%)
10520PROCWimp_MenuDisable(menu%,item%)
10530menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)EOR(1<<22)
10540ENDPROC
10550:
10560DEF PROCWimp_MenuForegroundColour(menu%,item%,colour%)
10570menu%?(39+(item%-1)*24)=colour%+16*((menu%?(39+(item%-1)*24))DIV16)
10580ENDPROC
10590:
10600DEF PROCWimp_MenuGlue(menu1%,item%,menu2%)
10610menu1%!(8+item%*24)=menu2%
10620ENDPROC
10630:
10640DEF PROCWimp_MenuItem(menu%,item%,item$)
10650$(menu%+(40+(item%-1)*24))=LEFT$(item$,12)+CHR$0
10660ENDPROC
10670:
10680DEF PROCWimp_MenuMessage(menu%,item%)
10690menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))EOR(1<<3)
10700ENDPROC
10710:
10720DEF PROCWimp_MenuPopUp(Menu%,x%,y%)
10730menu%=Menu%
10740SYS "Wimp_CreateMenu",,menu%,x%-64,y%+20
10750ENDPROC
10760:
10770DEF PROCWimp_MenuPopUpBar(x%,y%)
10780LOCAL n% : n%=0
10790WHILE ((Bar_Menu%!(28+n%*24))AND%10000000)=0
10800n%+=1
10810ENDWHILE
10820SYS "Wimp_CreateMenu",,Bar_Menu%,x%-64,96+n%*44
10830menu%=Bar_Menu%
10840ENDPROC
10850:
10860DEF PROCWimp_MenuTick(menu%,item%)
10870menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))EOR1
10880ENDPROC
10890:
10900DEF PROCWimp_MenuTitle(menu%,title$)
10910$menu%=LEFT$(title$,12)+CHR$0
10920ENDPROC
10930:
10940DEF PROCWimp_MenuWrite(menu%,item%,buffer%,val%,BufferLength%)
10950menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))OR4
10960menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)OR&100
10970menu%!(40+(item%-1)*24)=buffer%
10980menu%!(44+(item%-1)*24)=val%
10990menu%!(48+(item%-1)*24)=BufferLength%
11000ENDPROC
11010:
11020DEF PROCWimp_SpritesLoad
11030PROCWimp_SpritesPathLoad("<Obey$Dir>.Sprites")
11040direct_sprites%=sprites%
11050ENDPROC
11060:
11070DEF PROCWimp_SpritesPathLoad(pathname$)
11080LOCAL S%,T%
11090S%=OPENIN(pathname$):T%=EXT#S%+16:CLOSE#S%
11100DIM sprites%T%,spname%12
11110!sprites%=T%:sprites%!8=0
11120SYS"OS_SpriteOp",&109,sprites%
11130SYS"OS_SpriteOp",&10A,sprites%,pathname$
11140ENDPROC
11150:
11160DEF FNWimp_FileType(type%)
11170CASE type%OF
11180WHEN&FFF:="Text"
11190WHEN&FFD:="Data"
11200WHEN&FFB:="Basic"
11210WHEN&FF9:="Sprite"
11220WHEN&FED:="Palette"
11230WHEN&FEC:="Template"
11240WHEN&AFF:="Draw"
11250WHEN&1000:="Folder"
11260WHEN&2000:="Application"
11270OTHERWISE=STR$~(type%)
11280ENDCASE
11290:
11300DEF FNWimp_GetFilePathName
11310=FNWimp_GetStringAtAddress(wimp%+44)
11320:
11330DEF FNWimp_FileLoad(pathname$)
11340LOCAL S%,T%,file%
11350S%=OPENIN pathname$
11360T%=EXT#S%+16
11370CLOSE#S%
11380DIM file%T%
11390SYS "XOS_CLI","Load"+pathname$+""+STR$~file%)
11400=file%
11410;
11420DEF FNWimp_GetStringAtAddress(array%)
11430LOCAL s$:s$=""
11440WHILE(?array%<>13)AND(?array%<>0):s$+=CHR$(?array%):array%+=1:ENDWHILE:
11450=s$
11460:
11470DEF FNWimp_GetFileFromPathname(f$)
11480CASE INSTR(f$,".") OF
11490WHEN 0    :=f$
11500OTHERWISE :=FNWimp_GetFileFromPathname(RIGHT$(f$,LEN(f$)-INSTR(f$,".")))
11510ENDCASE
11520:
11530DEF PROCWimp_SendToEdit(file$)
11540LOCAL n%
11550wimp%!4=&6CC01C0C
11560wimp%!16=5
11570wimp%!36=0
11580wimp%!40=&FFF
11590$(wimp%+44)=file$+CHR$0
11600n%=LEN file$+45
11610IF n%MOD4 THEN !wimp%=4+(n%>>2)<<2 ELSE !wimp%=n%
11620SYS "Wimp_SendMessage",17,wimp%,0
11630ENDPROC
11640:
11650DEF PROCopentext
11660!wimp%=256
11670wimp%!12=0
11680wimp%!16=5
11690wimp%!36=0
11700wimp%!40=&fff
11710$(wimp%+44)="CavernEd:Documents.!Help"
11720SYS "Wimp_SendMessage",18,wimp%,0
11730ENDPROC
11740:
11750DEF FNWimp_BASICParameters
11760LOCAL com$,param$,I%
11770SYS "OS_GetEnv" TO com$
11780params$=""
11790I%=INSTR(com$," -quit ")
11800IF I% THEN params$=MID$(com$,INSTR(com$," ",I%+LEN" -quit ")+1)
11810=params$
11820:
11830DEF PROCWimp_Error
11840LOCAL X$,x%
11850ON ERROR OFF
11860x%=ERL
11870X$=REPORT$+" at line "+STR$(x%)
11880DIM ErrorMsg%36
11890ErrorMsg%!0=36:ErrorMsg%!12=0:ErrorMsg%!16=&81080:ErrorMsg%!20=x%
11900$(ErrorMsg%+24)="!RunImage"
11910SYS"Wimp_SendMessage",17,ErrorMsg%
11920PROCWimp_WindowAlert(task$,X$)
11930PROCWimp_CloseDown
11940ENDPROC
11950:
11960DEF PROCWimp_CloseDown
11970SYS"Wimp_CloseDown",task%,"TASK"
11980ENDPROC
11990:
12000DEF PROCWimp_Quit
12010finished%=TRUE
12020ENDPROC
12030:
12040DEF FNWimp_ReadVariable(Variable$)
12050LOCAL len%,result%,variable%
12060$wimp%=Variable$
12070SYS"OS_ReadVarVal",wimp%,wimp%+255,255,,3TO,,len%
12080wimp%?(len%+255)=13
12090=$(wimp%+255)
12100:
12110DEF PROCWimp_PollCloseWindow
12120SYS "Wimp_GetPointerInfo",,wimp%
12130window%=wimp%!12 : buttons%=wimp%!8
12140PROCEvent_WindowClose(window%,buttons%)
12150!wimp%=window% : SYS "Wimp_CloseWindow",,wimp%
12160ENDPROC
12170:
12180DEF PROCWimp_PollMouseClick
12190button%=wimp%!8:window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
12200CASE button% OF
12210WHEN2    : PROCWimp_PollMenuPopUp
12220OTHERWISE: CASE FNEvent_Save(window%) OF
12230WHEN TRUE : PROCWimp_PollMouseSave
12240WHEN FALSE: PROCWimp_PollEventMouseClick
12250ENDCASE
12260ENDCASE
12270ENDPROC
12280:
12290DEF PROCWimp_PollMenuPopUp
12300menu%=FNEvent_Menu(window%)
12310CASE menu%  OF
12320WHEN FALSE:
12330OTHERWISE :
12340CASE window% OF
12350WHEN -2   : n%=0
12360WHILE ((Bar_Menu%!(28+n%*24))AND%10000000)=0
12370n%+=1
12380ENDWHILE
12390SYS "Wimp_CreateMenu",,Bar_Menu%,x%-64,140+n%*44
12400OTHERWISE : SYS"Wimp_CreateMenu",,menu%,x%-64,y%+20
12410ENDCASE
12420ENDCASE
12430ENDPROC
12440:
12450DEF PROCWimp_PollMouseSave
12460CASE icon% OF
12470WHEN 0 : IF button% AND &50 THEN PROCWimp_PollDragBox(window%)
12480WHEN 2 : IF button% AND 5 THEN  PROCWimp_PollSaveFile(window%)
12490ENDCASE
12500ENDPROC
12510:
12520DEF PROCWimp_PollEventMouseClick
12530IF interface% THEN SYS"Wimp_BorderIcon",,wimp%
12540PROCEvent_MouseClick(window%,icon%,button%,x%,y%)
12550CASE  interface% OF
12560WHEN TRUE :
12570wimp%!0=x%:wimp%!4=y% : wimp%!8=0
12580wimp%!12=window% : wimp%!16=icon%
12590SYS"Wimp_BorderIcon",,wimp%
12600ENDCASE
12610ENDPROC
12620:
12630DEF PROCWimp_PollSaveFile(window%)
12640LOCAL file$
12650wimp%!0=window% : wimp%!4=1 : SYS "Wimp_GetIconState",,wimp%
12660file$=$(wimp%!28)
12670CASE INSTR(file$,".") OF
12680WHEN 0   :
12690$(wimp%+4)="To save, drag the icon to a directory window"
12700SYS "Wimp_ReportError",wimp%,16,task$
12710OTHERWISE:
12720PROCEvent_SaveFile(file$,window%)
12730ENDCASE
12740SYS"Wimp_CreateMenu",-1
12750IF save=TRUE THEN PROCWimp_CloseDown
12760ENDPROC
12770:
12780DEF PROCWimp_PollDragBox(window%)
12790LOCAL x%,y%
12800save%=window%
12810!wimp%=window%
12820SYS"Wimp_GetWindowState",,wimp%
12830x%=wimp%!4-wimp%!20:y%=wimp%!16-wimp%!24
12840wimp%!4=0
12850SYS"Wimp_GetIconState",,wimp%
12860!wimp%=window%
12870wimp%!4=5
12880wimp%!8=x%+wimp%!8:wimp%!12=y%+wimp%!12
12890wimp%!16=x%+wimp%!16:wimp%!20=y%+wimp%!20
12900wimp%!24=0:wimp%!28=0
12910wimp%!32=&7FFFFFFF:wimp%!36=&7FFFFFFF
12920IF version%>=310 THEN
12930SYS"DragASprite_Start",%11000101,1,"file_022",wimp%+8,wimp%+24
12940ELSE
12950SYS"Wimp_DragBox",,wimp%
12960ENDIF
12970ENDPROC
12980:
12990DEF PROCWimp_PollKeyPress
13000window%=wimp%!0:icon%=wimp%!4:key%=wimp%!24
13010CASE FNEvent_Save(window%) OF
13020WHEN TRUE : PROCWimpPoll_SaveFile(window%)
13030WHEN FALSE: PROCEvent_KeyPress(window%,icon%,key%)
13040ENDCASE
13050ENDPROC
13060:
13070DEF PROCWimp_PollSaveMessage
13080LOCAL file$,window%,icon%,x%,y%
13090SYS"Wimp_GetPointerInfo",,wimp%
13100window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
13110wimp%!0=save% : wimp%!4=1 : SYS "Wimp_GetIconState",,wimp%
13120file$=$(wimp%!28)
13130file$=FNWimp_GetFileFromPathname(file$)
13140wimp%!20=window%
13150wimp%!24=icon%
13160wimp%!28=x%:wimp%!32=y%
13170wimp%!36=length%
13180wimp%!0=64
13190wimp%!12=0
13200wimp%!16=1
13210wimp%!40=&FFF
13220$(wimp%+44)=file$
13230SYS"Wimp_SendMessage",17,wimp%,wimp%!20,wimp%!24
13240ENDPROC
13250:
13260DEF PROCWimp_PollMessages
13270LOCAL file$
13280file$=FNWimp_GetStringAtAddress(wimp%+44)
13290CASE wimp%!16 OF
13300WHEN 0 : finished%=TRUE
13310WHEN 1 :
13320WHEN 2 :
13330wimp%!0=save% : wimp%!4=1 : SYS "Wimp_GetIconState",,wimp%
13340$(wimp%!28)=file$
13350wimp%!0=save% : wimp%!4=1 : wimp%!8=0 : wimp%!12=0
13360SYS "Wimp_SetIconState",,wimp%
13370SYS "Wimp_SetCaretPosition",save%,1,,,-1,LEN file$
13380PROCEvent_SaveFile(file$,save%)
13390IF save=TRUE THEN PROCWimp_CloseDown
13400WHEN 3
13410type$=FNWimp_FileType(wimp%!40) : PROCEvent_LoadFile(file$,type$)
13420ENDCASE
13430ENDPROC
13440:
13450DEF PROCack
13460IF wimp%!4=task% AND wimp%!16=5 THEN SYS "Wimp_StartTask","Run CavernEd:Documents.!Help"
13470ENDPROC
13480:
13490DEF FNWimp_GetStringAtAddress(array%)
13500LOCAL s$:s$=""
13510WHILE(?array%<>13)AND(?array%<>0):s$+=CHR$(?array%):array%+=1:ENDWHILE:
13520=s$
13530:
13540DEF FNWimp_GetFileFromPathname(f$)
13550CASE INSTR(f$,".") OF
13560WHEN 0    :=f$
13570OTHERWISE :=FNWimp_GetFileFromPathname(RIGHT$(f$,LEN(f$)-INSTR(f$,".")))
13580ENDCASE
13590:
13600DEF FNWimp_FileType(type%)
13610CASE type%OF
13620WHEN&FFF:="Text"
13630WHEN&FFD:="Data"
13640WHEN&FFB:="Basic"
13650WHEN&FF9:="Sprite"
13660WHEN&FED:="Palette"
13670WHEN&FEC:="Template"
13680WHEN&AFF:="Draw"
13690WHEN&1000:="Folder"
13700WHEN&2000:="Application"
13710OTHERWISE=STR$~(type%)
13720ENDCASE

� >!RunImage
� Cavern Duel Editor
5� Version 1.37 (4th December, 1997) Final Release
((� First fully multi-tasking version!
2<� Written and designed by Stephen Scott 1995, 1996, 1997
<8� Using WimpEd by Joe Taylor � Archimedes World 1992
F:
Pș "Hourglass_On"
Z%�Wimp_Start("CavernEd",1900,2004)
d�User_SetInitialData
n�Create_Windows
x�Create_Menus
�%�Wimp_MenuDisable(Screen_Menu%,3)
�ș "Hourglass_Off"
��Wimp_WaitForEvent
��Wimp_CloseDown
��
�:
�/� �Wimp_Start(TaskName$,wimp_memory%,icon%)
�%� wimp% wimp_memory%,icons% icon%
�)� wimp_memory%<256 � wimp_memory%=256
�icon_memory%=icons%+icon%
�task$=TaskName$
�+indirect_sprites%=1 : direct_sprites%=1
��Wimp_SetEventVariables
� � �Wimp_Error:�
@ș"Wimp_Initialise",200,&4B534154,TaskName$ � version%,task%
�
":
,� �Wimp_SetEventVariables
6� pointer_block% 20
@interface%=�
J.null%=1  :draw%=2 :  pointer_leaving%=1<<4
T1pointer_entering%=1<<5:mouse%=1<<6:drag%=1<<7
^&key%=1<<8:menu%=1<<9:scroll%=1<<10
h@lose_caret%=1<<11:gain_caret%=1<<12:message%=(1<<17)+(1<<18)
r0recorder%=1<<18:acknowledge%=1<<19:window%=0
|!sprites%=1:version%=0:task%=0
�*Bar_Window%=-2:Bar_Icon%=0:Bar_Menu%=0
�*x_origin%=0:y_origin%=0:SaveWindow%=-3
�3message_quit%=0:message_save%=2:message_load%=3
�!mouse_button%=2:save_event%=0
� top_line%=0 : bottom_line%=0
��
�:
�� �User_SetInitialData
�8� screen$(7,3,16,16),youx(2),youy(2),yscx(2),yscy(2)
� � Set up 21 teleports (0-20)
�9� teletoscx(20),teletoscy(20),teletox(20),teletoy(20)
�7teletoscx()=0:teletoscy()=0:teletox()=0:teletoy()=0
�/� tscx(20),tscy(20),tx(20),ty(20),activ(20)
-tscx()=0:tscy()=0:tx()=0:ty()=0:activ()=0
scx=0:scy=0:x=0:y=0
drawx=0:drawy=0
&mouselock=0
0selected=0
:clear_selected=0
Dclearing=�
N
loaded%=0
Xmyownnumber%=0
bxpos=0:ypos=0
ltelenum%=0
vdone1=0
�done2=0
�protect%=0
�endloop%=0
�
defined=0
�	red=�
�green=�
�X=0:Y=0
�SCX=0:SCY=0
��
�*screen$(SCX,SCY,X,Y)="0":� Setup block
�X+=1:� X>16 � X=0:Y+=1
�� Y>16 � SCY+=1:X=0:Y=0
�"� SCY>3 � SCX+=1:SCY=0:X=0:Y=0
� SCX>7
main%=0:oldicon%=0
=� pal% 120:ș "OS_File",12,"<CavernEd$Dir>.DesPal",pal%,0
 update=�:bitching=�
*-tele_open=�:draw$="1":erase$="0":s$=draw$
4screen_x%=0:screen_y%=0
>3�Wimp_SpritesPathLoad("<CavernEd$Dir>.DesSprs")
H� pixtrans% 20,scalefac% 20
RCD%=�:save=�
\�
f:
p� �Create_Windows
z%infobox%=�Wimp_WindowLoad("info")
�(savebox%=�Wimp_WindowLoad("savebox")
�(checker%=�Wimp_WindowLoad("checker")
�&screen%=�Wimp_WindowLoad("Screen")
� title%=wimp%!72:wimp%?35=&FF
�$Icons%=�Wimp_WindowLoad("icons")
� Map%=�Wimp_WindowLoad("map")
�wimp%!64=sprites%
�,teleports%=�Wimp_WindowLoad("teleports")
�(Bar_Icon%=�Wimp_IconBar("!caverned")
��
�:
�� �Wimp_WindowLoad(window$)
�9=�Wimp_WindowLoadFrom(window$,"<Obey$Dir>.Templates")
:
-� �Wimp_WindowLoadFrom(window$,template$)
� c%,i%,n%,j%,sp$,sp2$
$%ș "Wimp_OpenTemplate",,template$
.Mș "Wimp_LoadTemplate",,wimp%,icons%,icon_memory%,-1,window$,0 � ,,icons%
8Ȏ sprites% �
B� 1    : wimp%!64=sprites%
L( : wimp%!64=�Event_Sprites(window%)
V�
`&ș "Wimp_CreateWindow",,wimp% � c%
jș "Wimp_CloseTemplate"
t7ș "Wimp_WhichIcon",c%,wimp%+40,1+2+(1<<8),2+(1<<8)
~Ȏ wimp%!40 �
�� -1   :
�
 : i%=40
��
�!wimp%!4=wimp%!i% : wimp%!0=c%
�!ș "Wimp_GetIconState",,wimp%
�*sp$=�Wimp_GetStringAtAddress(wimp%!28)
�ș "Wimp_DeleteIcon",,wimp%
�Ȏ sprites% �
�� 1    : wimp%!32=1
� :
�*ș "OS_SpriteOp",&108,sprites% � ,,,n%
�j%=0

� : j%+=1

7ș "OS_SpriteOp",&10D,sprites%,pointer_block%,20,j%
1sp2$=�Wimp_GetStringAtAddress(pointer_block%)
� j%=n% � sp$=sp2$
(/� sp$=sp2$ � wimp%!32=sprites% � wimp%!32=1
2�
<wimp%!4=c%
F+ș "Wimp_CreateIcon",,wimp%+4 � handle%
P	i%+=4
Z� (wimp%!i%)=-1
d�
n=c%
x:
�� �Wimp_IconBar(Sprite$)
�� icon%
�wimp%!0=-1
�wimp%!4=0     : wimp%!8=0
�wimp%!12=68 : wimp%!16=68
�wimp%!20=&3002
�$(wimp%+24)=Sprite$
�'ș "Wimp_CreateIcon",,wimp% � icon%
�
=icon%
�:
�� �Wimp_WaitForEvent
�� mask%,event%
�finished%=�
mask%=%111000011001
�
&ș"Wimp_Poll",mask%,wimp% � event%
"Ȏ event% �
,�0 :
6�1 : �Wimp_PollDrawWindow
@$�2 : ș "Wimp_OpenWindow",,wimp%
J�3 : �Wimp_PollCloseWindow
T�4 :
^�5 :
h�6 : �Wimp_PollMouseClick
r�7 : �Wimp_PollSaveMessage
|�8 : �Wimp_PollKeyPress
�!�9 : �Event_MenuChoice(menu%)
��10:
��11:
��12:
��17,18: �Wimp_PollMessages
��19:�ack
��
�� finished%
��
�:
�� �Wimp_PollDrawWindow
�� more%
�&ș"Wimp_RedrawWindow",,wimp%�more%
window%=wimp%!0
window_x%=wimp%!4
window_y%=wimp%!16
&scroll_x%=wimp%!20
0scroll_y%=wimp%!24
:!x_origin%=window_x%-scroll_x%
D!y_origin%=window_y%-scroll_y%
Nȕ more%
X/� interface% � ș"Wimp_BorderWindow",,wimp%
b,�Event_Draw(window%,x_origin%,y_origin%)
l&ș"Wimp_GetRectangle",,wimp%�more%
v�
��
�� �Event_Save(window%)
�Ȏ window% �
�� savebox% :=�
�	 :=�
��
�:
�&� �Event_Sprites(window%)=sprites%
�:
�� �Create_Menus
�JBar_Menu%=�Wimp_MenuCreate("CavernEd\Info>infobox%\Instructions\Quit")
�.menu$="Screen\Info>infobox%\Save>savebox%"
�(Screen_Menu%=�Wimp_MenuCreate(menu$)
�
:
� �Event_Menu(window%)
 Ȏ window% �
*� Bar_Window% : =Bar_Menu%
4!� screen%     : =Screen_Menu%
>        : =�
H�
R:
\*� �Event_WindowClose(window%,buttons%)
fȎ window% �
p
� screen%
zmain%=0:iconw%=0:map%=0
��Wimp_WindowClose(Icons%)
��Wimp_WindowClose(Map%)
�!�Wimp_WindowClose(teleports%)
�tele_open=�:� bitching=TRUE
��
��
�:
�.� �Event_Draw(window%,x_origin%,y_origin%)
�Ȏ window% �
�+� screen%      : �User_DrawScreenWindow
��
��
�:
	� �pixtrans
	� col%=0 � 15:rgb%=pal%!2
	5ș"ColourTrans_ReturnColourNumber",rgb% � colour%
	$'?(pixtrans%+col%)=colour%:pal%+=6:�
	.�
	8:
	B� �User_DrawScreenWindow
	L5$title%="Map ("+�(screen_x%)+","+�(screen_y%)+")"
	VFș "Wimp_ReadPixTrans",&100,sprites%,"5",0,0,0,scalefac%,pixtrans%
	` scalefac%!8=1:scalefac%!12=1
	jC=0:D=0
	t� Y=15 � 0 �-1
	~� X=0 � 15
	�'a$=screen$(screen_x%,screen_y%,X,Y)
	�Qș&2E,256+52,sprites%,a$,(x_origin%+C),(y_origin%+D)-32,8,scalefac%,pixtrans%
	�	C+=64
	��
	�
C=0:D-=32
	��
	�;� Print "tel" sprite at destination of current teleport
	�� tele_open �
	؀ș&2E,256+52,sprites%,"tel",(x_origin%+(teletox(reference))*64),(y_origin%-(16-teletoy(reference))*32),8,scalefac%,pixtrans%
	��
	��
	�:
4� �Event_MouseClick(window%,icon%,button%,x%,y%)

Ȏ window% �
"� Bar_Window% : �User_MouseBar
5� checker%    : �User_Mousechecker(button%,icon%)
(4� screen%     : �User_MouseScreen(button%,icon%)
23� Icons%      : �User_Mouseicons(button%,icon%)
<.� Map%     : �User_Mousemap(button%,icon%)
F7� teleports%  : �User_Mouseteleports(button%,icon%)
P�
Z�
d:
n� �User_MouseBar
x� main%=1 � save=� �
�#�Wimp_WindowBringToTop(screen%)
�"�Wimp_WindowForceDraw(screen%)
��
�#�Wimp_WindowBringToTop(screen%)
�main%=1
��
�/� protect%=0 �Wimp_WindowBringToTop(Icons%)
�!�Wimp_WindowBringToTop(Map%):
�c� bitching=� �Wimp_IconPutText(Map%,0,"mapdn"):bitching=�:� Set lower left icon down in map win
��
�:
�'� �User_Mousechecker(button%,icon%)
�� icon%=1 �

save=�

�unbox
�Wimp_WindowClose(checker%)
"update=�
,$�Wimp_WindowBringToTop(savebox%)
6!A$=�Wimp_IconText(savebox%,1)
@%�Wimp_IconCaret(savebox%,1,�(A$))
J�
T� icon%=2 �
^
�unbox
hupdate=�
r�Wimp_WindowClose(checker%)
|	CD%=�
��
�6� icon%=3 � � Add routine to cancel & close window
�
�unbox
��Wimp_WindowClose(checker%)
��
�� CD%=� � �Wimp_CloseDown
��
�:
�&� �User_MouseScreen(button%,icon%)
�� tele_open:�clicker:�
�� protect% � �
�Ȏ button% �
�� 4:s$=draw$
� 1:s$=erase$
�
update=�
&mx=wimp%!0:my=wimp%!4
02!wimp%=screen%:ș "Wimp_GetWindowState",,wimp%
:mx=(mx-wimp%!4+wimp%!20)
Dmy=-(my-wimp%!16+wimp%!24)
Nmx=mx � 64:my=my � 32
X� my>63 � mx>127 � �
bA� s$="7":� screen$(screen_x%,screen_y%,mx,(15-my))="7":�tel:�
lȎ s$ �
v � "7" : � Staircase teleport
�:� Location details now fixed into teleport info window
�found%=0:ref=0
�� find=0 � 20
�/� activ(find)=0 � found%=1:ref=find:find=20
��
�� found%=0 � �7:�
�teletoscx(ref)=screen_x%
�teletoscy(ref)=screen_y%
�teletox(ref)=mx
�teletoy(ref)=(15-my)
�tscx(ref)=screen_x%
�tscy(ref)=screen_y%
�tx(ref)=mx

ty(ref)=(15-my)

activ(ref)=1

-telenum%+=1:defined+=1:� telenum%>20:�7:�

 � "17":� Green player

*7� screen$(screen_x%,screen_y%,mx,(15-my))="18":�7:�

4=� screen$(screen_x%,screen_y%,mx,(15-my))="0"  � : � �7:�

>8� green:screen$(yscx(1),yscy(1),youx(1),youy(1))="0"

H"�Wimp_WindowForceDraw(screen%)

Ryscx(1)=screen_x%

\yscy(1)=screen_y%

fyoux(1)=mx

pyouy(1)=(15-my):green=�

z� "18":� Red player

�7� screen$(screen_x%,screen_y%,mx,(15-my))="17":�7:�

�=� screen$(screen_x%,screen_y%,mx,(15-my))="0"  � : � �7:�

�6� red:screen$(yscx(2),yscy(2),youx(2),youy(2))="0"

�"�Wimp_WindowForceDraw(screen%)

�yscx(2)=screen_x%

�yscy(2)=screen_y%

�youx(2)=mx

�youy(2)=(15-my):red=�

��

�0Ȏ screen$(screen_x%,screen_y%,mx,(15-my)) �

�� "7":�erase_teleporter

�� "17":green=�

�� "18":red=�
�
.screen$(screen_x%,screen_y%,mx,(15-my))=s$
Eș "Wimp_ForceRedraw",screen%,mx*64,-(my+1)*32,(mx+1)*64,-(my)*32
$�
.:
8� �clicker
Bmx=wimp%!0:my=wimp%!4
L2!wimp%=screen%:ș "Wimp_GetWindowState",,wimp%
Vmx=(mx-wimp%!4+wimp%!20)
`my=-(my-wimp%!16+wimp%!24)
jmx=mx � 64:my=my � 32
t� my>63 � mx>127 � �
~teletox(reference)=mx
�teletoy(reference)=(15-my)
�a� c$=screen$(teletoscx(reference),teletoscy(reference),teletox(reference),teletoy(reference))
�9� IFc$="1" OR c$="2" OR c$="3" OR c$="4" VDU7:ENDPROC
�update=�
�9�Wimp_IconPutText(teleports%,8,�(teletox(reference)))
�9�Wimp_IconPutText(teleports%,9,�(teletoy(reference)))
�"�Wimp_WindowForceDraw(screen%)
��Wimp_WindowClose(screen%)
��Wimp_WindowOpen(screen%)
��
�:
�� �rub1
/screen$(screen_x%,screen_y%,mx,(15-my))="0"

�
� �rub2
/screen$(screen_x%,screen_y%,mx,(15-my))="0"
(�
2:
<
� �tel
F�Wimp_WindowClose(Icons%)
Pupdate=0
Zreference=0
d'� telenum%<20 � f%=telenum%:� f%=20
n� find=0 � f%
x�� tscx(find)=screen_x% � tscy(find)=screen_y% � tx(find)=mx � ty(find)=(15-my) � activ(find)=1 � reference=find:found3%=1:find=telenum%
��
�;�Wimp_IconPutText(teleports%,6,�(teletoscx(reference)))
�;�Wimp_IconPutText(teleports%,7,�(teletoscy(reference)))
�9�Wimp_IconPutText(teleports%,8,�(teletox(reference)))
�9�Wimp_IconPutText(teleports%,9,�(teletoy(reference)))
�,�Wimp_WindowOpen(teleports%):tele_open=�
�;�Wimp_IconPutText(Map%,oldicon%,"mapup"):this%=oldicon%
�Ascreen_x%=teletoscx(reference):screen_y%=teletoscy(reference)
�5$title%="Map ("+�(screen_x%)+","+�(screen_y%)+")"
�4�updatemap(1):� Show teleport destination on map
�"�Wimp_WindowForceDraw(screen%)
��Wimp_WindowClose(screen%)
��Wimp_WindowOpen(screen%)
�
:
#� �erase_teleporter:� s$="7"� �
"
find=0
,�
6c� tscx(find)=screen_x% � tscy(find)=screen_y% � tx(find)=mx � ty(find)=(15-my) � reference=find
@find+=1
J
� find>20
TA� activ(reference)=0 � tscy(reference)>0 � activ(reference)=0
^:activ(reference)=0:tscx(reference)=0:tscy(reference)=0
h#tx(reference)=0:ty(reference)=0
r1teletoscx(reference)=0:teletoscy(reference)=0
|-teletox(reference)=0:teletoy(reference)=0
�telenum%-=1:defined-=1
�� telenum%<=0 telenum%=0
�� defined<=0 defined=0
�a� defined<1 � telenum%<1 � �Wimp_WindowClose(teleports%):tele_open=�:�Wimp_WindowOpen(Icons%)
��
�:
�&� �User_Mouseicons( button%,icon%)
�Ȏ button% �
�� 4: � Select
�Ȏ icon% �
�� Path icons
�� 16:�drawIcon("0")
�� 17:�drawIcon("5")
� 18:�drawIcon("8")
� 19:�drawIcon("9")
� 20:�drawIcon("16")
&� 21:�drawIcon("19")
0� Item icons
:� 22:�drawIcon("10")
D� 23:�drawIcon("11")
N� 24:�drawIcon("12")
X� 25:�drawIcon("14")
b� 26:�drawIcon("13")
l� 27:�drawIcon("15")
v� Wall icons
�� 28:�drawIcon("1")
�� 29:�drawIcon("2")
�� 30:�drawIcon("3")
�� 31:�drawIcon("4")
�� Teleports
�� 32:�drawIcon("6")
�� 33:�drawIcon("7")
�
� Players
�� 34:�drawIcon("18")
�� 35:�drawIcon("17")
��
�� 1: � Adjust
�Ȏ icon% �
� 16:�eraseIcon("0")
� 17:�eraseIcon("5")
� 18:�eraseIcon("8")
 � 19:�eraseIcon("9")
*� 20:�eraseIcon("16")
4� 21:�eraseIcon("19")
>� Item icons
H� 22:�eraseIcon("10")
R� 23:�eraseIcon("11")
\� 24:�eraseIcon("12")
f� 25:�eraseIcon("14")
p� 26:�eraseIcon("13")
z� 27:�eraseIcon("15")
�� Wall icons
�� 28:�eraseIcon("1")
�� 29:�eraseIcon("2")
�� 30:�eraseIcon("3")
�� 31:�eraseIcon("40")
�� Teleports
�� 32:�eraseIcon("6")
�� 33:�eraseIcon("7")
�
� Players
�� 34:�eraseIcon("18")
�� 35:�eraseIcon("17")
��
��
�
:
� �drawIcon(sp$)
$wimp%!0=Icons%
.wimp%!4=14
8!ș "Wimp_GetIconState",,wimp%
B� $(wimp%+28)<>sp$ �
L$(wimp%+28)=sp$
Vș "Wimp_DeleteIcon",,wimp%
`wimp%!4=Icons%
j'ș "Wimp_CreateIcon",,wimp%+4 � ic%
twimp%!0=Icons%
~wimp%!4=14
�
wimp%!8=0
�wimp%!12=0
�!ș "Wimp_SetIconState",,wimp%
��
�
draw$=sp$
��
�:
�� �eraseIcon(sp$)
�wimp%!0=Icons%
�wimp%!4=15
�!ș "Wimp_GetIconState",,wimp%
�� $(wimp%+28)<>sp$ �
$(wimp%+28)=sp$

ș "Wimp_DeleteIcon",,wimp%
wimp%!4=Icons%
'ș "Wimp_CreateIcon",,wimp%+4 � ic%
(wimp%!0=Icons%
2wimp%!4=15
<
wimp%!8=0
Fwimp%!12=0
P!ș "Wimp_SetIconState",,wimp%
Z�
derase$=sp$
n�
x:
�#� �User_Mousemap(button%,icon%)
�� tele_open � �updatemap(0)
�,�Wimp_IconPutText(Map%,oldicon%,"mapup")
�)�Wimp_IconPutText(Map%,icon%,"mapdn")
��Wimp_WindowForceDraw(Map%)
�oldicon%=icon%
�Ȏ icon% �
�1� 0,1,2,3,4,5,6,7:screen_x%=icon%:screen_y%=0
�;� 8,9,10,11,12,13,14,15:screen_x%=(icon%-8):screen_y%=1
�>� 16,17,18,19,20,21,22,23:screen_x%=(icon%-16):screen_y%=2
�>� 24,25,26,27,28,29,30,31:screen_x%=(icon%-24):screen_y%=3
��
�� tele_open=� �
"teletoscx(reference)=screen_x%
"teletoscy(reference)=screen_y%
;�Wimp_IconPutText(teleports%,6,�(teletoscx(reference)))
";�Wimp_IconPutText(teleports%,7,�(teletoscy(reference)))
,�
65$title%="Map ("+�(screen_x%)+","+�(screen_y%)+")"
@"�Wimp_WindowForceDraw(screen%)
J�Wimp_WindowClose(screen%)
T�Wimp_WindowOpen(screen%)
^�
h:
r
� �update
|K$title%="Map ("+�(teletoscx(reference))+","+�(teletoscy(reference))+")"
�Ascreen_x%=teletoscx(reference):screen_y%=teletoscy(reference)
�"�Wimp_WindowForceDraw(screen%)
��Wimp_WindowClose(screen%)
��Wimp_WindowOpen(screen%)
��
�� �updatemap(m)
Ž� m=0:�Wimp_IconPutText(Map%,(teletoscy(reference)*8)+teletoscx(reference),"mapup"):oldicon%=(teletoscy(reference)*8)+teletoscx(reference)
̎� m=1:�Wimp_IconPutText(Map%,(teletoscy(reference)*8)+teletoscx(reference),"mapdn"):oldicon%=(teletoscy(reference)*8)+teletoscx(reference)
��
�:
�)� �User_Mouseteleports(button%,icon%)
�Ȏ icon% �
�
� 11: 
� teletoscx(reference)<7 �
�updatemap(0)
teletoscx(reference)+=1
&;�Wimp_IconPutText(teleports%,6,�(teletoscx(reference)))
0�updatemap(1):�update
:�
D	� 10:
N� teletoscx(reference)>0 �
X�updatemap(0)
bteletoscx(reference)-=1
l;�Wimp_IconPutText(teleports%,6,�(teletoscx(reference)))
v�updatemap(1):�update
��
�	� 13:
�� teletoscy(reference)<3 �
��updatemap(0)
�teletoscy(reference)+=1
�;�Wimp_IconPutText(teleports%,7,�(teletoscy(reference)))
��updatemap(1):�update
��
�	� 12:
�� teletoscy(reference)>0 �
��updatemap(0)
�teletoscy(reference)-=1
�;�Wimp_IconPutText(teleports%,7,�(teletoscy(reference)))
�updatemap(1):�update
�
	� 15:
 q� teletox(reference)<15 � teletox(reference)+=1:�Wimp_IconPutText(teleports%,8,�(teletox(reference))):�update
*	� 14:
4n� teletox(reference)>0:teletox(reference)-=1:�Wimp_IconPutText(teleports%,8,�(teletox(reference))):�update
>	� 17:
Ho� teletoy(reference)<15:teletoy(reference)+=1:�Wimp_IconPutText(teleports%,9,�(teletoy(reference))):�update
R	� 16:
\n� teletoy(reference)>0:teletoy(reference)-=1:�Wimp_IconPutText(teleports%,9,�(teletoy(reference))):�update
f� 4:� Cancel icon
p�updatemap(0)
z(teletoscx(reference)=tscx(reference)
�(teletoscy(reference)=tscy(reference)
�$teletox(reference)=tx(reference)
�$teletoy(reference)=ty(reference)
�8�Wimp_IconPutText(Map%,this%,"mapdn"):oldicon%=this%
�-�Wimp_WindowClose(teleports%):tele_open=�
�$�Wimp_WindowOpen(Icons%):�update
�� 5:� OK icon
��updatemap(1)
�:oldicon%=(teletoscy(reference)*8)+teletoscx(reference)
�-�Wimp_WindowClose(teleports%):tele_open=�
�$�Wimp_WindowOpen(Icons%):�update
��
��
:
)� �Event_KeyPress(window%,icon%,key%)
Ȏ window% �
$7� teleports%  : �User_KeyPressteleports(icon%,key%)
.�
8�
B:
L)� �User_KeyPressteleports(icon%,key%)
V
Ȏ key% �
`� 13:Ȏ icon% �
j� 6:�update
t� 7:�update
~� 8:�update
�� 9:�update
��
�� 398:�move_caret(icon%,1)
�� 399:�move_caret(icon%,-1)
�
�ș "Wimp_ProcessKey",key%
��
��
�:
�� �move_caret(I%,dir%)
�6� I%=6 � dir%=-1 �Wimp_IconCaret(teleports%,6,0):�
�5� I%=6 � dir%=1 �Wimp_IconCaret(teleports%,7,0):�
6� I%=7 � dir%=-1 �Wimp_IconCaret(teleports%,6,0):�

5� I%=7 � dir%=1 �Wimp_IconCaret(teleports%,8,0):�
6� I%=8 � dir%=-1 �Wimp_IconCaret(teleports%,7,0):�
5� I%=8 � dir%=1 �Wimp_IconCaret(teleports%,9,0):�
(6� I%=9 � dir%=-1 �Wimp_IconCaret(teleports%,8,0):�
25� I%=9 � dir%=1 �Wimp_IconCaret(teleports%,9,0):�
<�
F:
P� �Event_MenuChoice(menu%)
ZȎ menu% �
d.� Bar_Menu%          : �User_MenuChoiceBar
n1� Screen_Menu%       : �User_MenuChoiceScreen
x�
��
�:
�� �User_MenuChoiceBar
�� save=� �
�Ȏ �Wimp_MenuChoice(0) �
�	� 1 :
�� 2 : �opentext
�	� 3 :
�� update=� �
�$�Wimp_WindowBringToTop(checker%)
��mousebox(checker%)
��
�� update=� � finished%=�
�
�
�
":
,� �mousebox(w%)
6wimp%!0=w%
@%ș "Wimp_GetWindowOutline",,wimp%
JCȗ ȓ wimp%!4+2,wimp%!8+2,wimp%!12-wimp%!4-4,wimp%!16-wimp%!8-4
T�
^:
h� �unbox
r+ș "OS_ReadModeVariable",-1,11 � ,,xpic
|+ș "OS_ReadModeVariable",-1,12 � ,,ypic
�+ș "OS_ReadModeVariable",-1,4 � ,,xfact
�+ș "OS_ReadModeVariable",-1,5 � ,,yfact
�%ȗ ȓ 0,0,xpic<<xfact,ypic<<yfact
��
�:
�� �User_MenuChoiceScreen
�Ȏ �Wimp_MenuChoice(0) �
�
� 1 : 
�
� 2 : 
�� 3 : � telenum%>0 �
� �Wimp_WindowOpen(teleports%)
�)�Wimp_WindowClose(Icons%):tele_open=�
�,�Wimp_IconPutText(Map%,oldicon%,"mapup")
8oldicon%=(teletoscy(telenum%)*8)+teletoscx(telenum%)
'�updatemap(0):�updatemap(1):�update
�
&�
0�
::
D"� �Event_LoadFile(file$,type$)
NU� type$<>"22":�Wimp_WindowAlert("Cavern Duel Editor","This is not a CaveFile!"):�
X� update=� �
b�check%=�Wimp_WindowCancel("Cavern Duel Editor","The current CaveFile has been modified, are you sure you want to load a new one ?")
l� check%=� � update=�
v� check%=� � update=�:�
��
�'�Wimp_IconPutText(savebox%,1,file$)
�ș "Hourglass_On"
�9x=0:y=15:scrx=0:scry=0:telenum%=0:backup%=0:defined=0
�channel=�(file$)
�	a$=""
�A$=�(�#channel)
Ƭ� A$="#" � protect%=1:�Wimp_WindowAlert("Cavern Duel Editor","This CaveFile has been protected from alteration. The map editing and saving functions will be disabled!")
��Wimp_WindowClose(screen%)
�(� protect%:�Wimp_WindowClose(Icons%)
�8� protect%:�Wimp_WindowClose(teleports%):tele_open=�
�� A$="*" � protect%=0
��
y=15
�
a$=�(�#channel)
 Ȏ a$ �
*� "A":a$="12"
4� "B":a$="11"
>� "C":a$="10"
H� "D":a$="13"
R� "E":a$="14"
\� "F":a$="15"
f� "G":a$="16"
pG� "P":a$="17":youx(1)=x:youy(1)=y:yscx(1)=scrx:yscy(1)=scry:green=�
zE� "Q":a$="18":youx(2)=x:youy(2)=y:yscx(2)=scrx:yscy(2)=scry:red=�
�� "H":a$="19"
��
�screen$(scrx,scry,x,y)=a$
�I� a$="7" :�read_details_of_teleport:telenum%+=1:backup%+=1:defined+=1
�x+=1:� x>15 � x=0:y-=1
�	� y<0
�a$=�(�#channel)
ʉ� a$<>"-" � ș "XOS_CLI","Close":�Wimp_WindowAlert("Cavern Duel Editor","Damaged CaveFile. The load operation has been cancelled."):�
�%scry+=1:� scry>3 � scry=0:scrx+=1
�� scrx>7
�ș "XOS_CLI","Close"
�telenum%=backup%
�� A%=telenum%+1 � 20
activ(A%)=0
gteletoscx(A%)=0:teletoscy(A%)=0:teletox(A%)=0:teletoy(A%)=0:tscx(A%)=0:tscy(A%)=0:tx(A%)=0:ty(A%)=0
�
$safe%=�
.cave_loaded%=�
8sprite_deleted%=�
Btelenum%=1
L:�Wimp_IconPutText(teleports%,6,�(teletoscx(telenum%)))
V:�Wimp_IconPutText(teleports%,7,�(teletoscy(telenum%)))
`8�Wimp_IconPutText(teleports%,8,�(teletox(telenum%)))
j8�Wimp_IconPutText(teleports%,9,�(teletoy(telenum%)))
tș "Hourglass_Smash"
~�Wimp_WindowOpen(screen%)
�"�Wimp_WindowForceDraw(screen%)
��Wimp_WindowOpen(Map%)
��Wimp_WindowOpen(Icons%)
��
�:
�� �read_details_of_teleport
�� telenum%>20 �7:�
�t1$=�(�#channel)
�t2$=�(�#channel)
�%t3$=�(�#channel):t4$=�(�#channel)
�activ(telenum%)=1
�!teletoscx(telenum%)=�(t1$)-65
!teletoscy(telenum%)=�(t2$)-65

teletox(telenum%)=�(t3$)-65
teletoy(telenum%)=�(t4$)-65
tscx(telenum%)=scrx
(tscy(telenum%)=scry
2tx(telenum%)=x
<ty(telenum%)=y
F�
P:
Z$� �Event_SaveFile(file$,window%)
dȎ window% �
n� savebox%
x�� red=� � green=� � �Wimp_WindowAlert("Cavern Duel Editor","You haven't defined a location for the red player. The save operation has been cancelled."):�Wimp_WindowClose(savebox%):�Wimp_MenuClose:�
��� green=� � red=� � �Wimp_WindowAlert("Cavern Duel Editor","You haven't defined a location for the green player. The save operation has been cancelled."):�Wimp_WindowClose(savebox%):�Wimp_MenuClose:�
��� red=� � green=� � �Wimp_WindowAlert("Cavern Duel Editor","You haven't defined any locations for the red and green players. The save operation has been cancelled."):�Wimp_WindowClose(savebox%):�Wimp_MenuClose:�
�� �
�� � � �err
�channel=�(file$)
�� channel<>0 �
�qcheck%=�Wimp_WindowCancel("Cavern Duel Editor","This CaveFile already exists. Do you want to overwrite it ?")
�� check%=� � channel=0
�
�#channel
�.� check%=� � �Wimp_WindowClose(savebox%):�
��
�ș "Hourglass_On"
�sc2x=0:sc2y=0:x=0:y=0
channel=�(file$)
�#channel,"*";
�
"x=0:y=15
,�:done=0
6a$=screen$(sc2x,sc2y,x,y)
@Ȏ a$ �
J1� "7":�#channel,a$;:�save_tele_details:done=1
T&� "12":a$="A":done=1:�#channel,a$;
^&� "11":a$="B":done=1:�#channel,a$;
h&� "10":a$="C":done=1:�#channel,a$;
r&� "13":a$="D":done=1:�#channel,a$;
|&� "14":a$="E":done=1:�#channel,a$;
�&� "15":a$="F":done=1:�#channel,a$;
�&� "16":a$="G":done=1:�#channel,a$;
�&� "17":a$="P":done=1:�#channel,a$;
�&� "18":a$="Q":done=1:�#channel,a$;
�&� "19":a$="H":done=1:�#channel,a$;
��
�� done=0 � �#channel,a$;
�x+=1:� x>15 � x=0:y-=1
�	� y<0
��#channel,"-";
�%sc2y+=1:� sc2y>3 � sc2x+=1:sc2y=0
�� sc2x>7
�
�#channel
 �Wimp_MenuClose
 (ș "XOS_CLI","SetType "+file$+" 022"
 �
 &ș "Hourglass_Off"
 0update=�
 :�
 D:
 N
� �err
 X� �=67785 �
 b��Wimp_WindowErrorBox("Cavern Duel Editor","Your disc is write protected.  Please write enable the disc and click to continue."):ș"XOS_CLI","Close"
 l�
 v�Wimp_WIndowErrorBox("Cavern Duel Editor","This file could not be saved into the selected directory."):ș "XOS_CLI","Close"
 ��
 ��
 �:
 �$� �save_tele_details:reference=0
 �/� telenum%<21 � � a%=0�telenum%:� � a%=0�20
 �T� tscx(a%)=sc2x � tscy(a%)=sc2y � tx(a%)=x � ty(a%)=y � reference=a%:a%=telenum%
 ��
 �)�#channel,�(teletoscx(reference)+65);
 �)�#channel,�(teletoscy(reference)+65);
 �'�#channel,�(teletox(reference)+65);
 �'�#channel,�(teletoy(reference)+65);
 ��
 �:
!(� �Wimp_WindowAlert(title$,message$)
!+�Wimp_WindowAlertBox(title$,message$,0)
!�
! :
!*3� �Wimp_WindowAlertBox(title$,message$,button%)
!4� response%
!>$(wimp%+4)=message$
!HȎ button% �
!R� 2    : response%=1
!\� 1    : response%=15
!f � 3    : response%=(1<<5)+16
!p � 4    : response%=(1<<6)+16
!z : response%=16
!��
!�=ș "Wimp_ReportError",wimp%,response%,title$ � ,response%
!��
!�:
!�)� �Wimp_WindowCancel(title$,message$)
!�$(wimp%+4)=message$
!�response%=23
!�=ș "Wimp_ReportError",wimp%,response%,title$ � ,response%
!�=response%-2
!�:
!�+� �Wimp_WindowErrorBox(title$,message$)
!�+�Wimp_WindowAlertBox(title$,message$,2)
!��
":
" � �Wimp_WindowTitle(window%)
"wimp%!0=window%
"$"ș "Wimp_GetWindowInfo",,wimp%
".6� ((wimp%!60)�&100)=0 � 1,"Title isn't indirected"
"8=$(wimp%!76)
"B:
"L%� �Wimp_WindowBringToTop(window%)
"V!wimp%=window%
"`#ș "Wimp_GetWindowState",,wimp%
"jwimp%!28=-1
"tș "Wimp_OpenWindow",,wimp%
"~�
"�:
"� � �Wimp_WindowClose(window%)
"�!wimp%=window%
"� ș "Wimp_CloseWindow",,wimp%
"��
"�:
"�$� �Wimp_WindowForceDraw(window%)
"�Ȏ window% �
"�8 � -1   : ș "Wimp_ForceRedraw",-1,0,0,2*1280,2*1024
"�8 : ș "Wimp_ForceRedraw",window%,0,-2*1024,2*512,0 
"��
"��
#:
#
� �Wimp_WindowOpen(window%)
#!wimp%=window%
##ș "Wimp_GetWindowState",,wimp%
#(ș "Wimp_OpenWindow",,wimp%
#2�
#<:
#F�Wimp_WindowInterface
#P ș"Wimp_BorderWindow",,wimp%
#Z�
#d:
#n+� �Wimp_IconCaret(window%,icon%,chars%)
#x8ș "Wimp_SetCaretPosition",window%,icon%,,,-1,chars%
#��
#�:
#�#� �Wimp_IconText(window%,icon%)
#�#wimp%!0=window% : wimp%!4=icon%
#�!ș "Wimp_GetIconState",,wimp%
#�7� ((wimp%!24) � &100)=0 � 1,"Icon isn't indirected"
#�=$(wimp%!28)
#�:
#�)� �Wimp_IconValidation(window%,icon%)
#�#wimp%!0=window% : wimp%!4=icon%
#�!ș "Wimp_GetIconState",,wimp%
#�7� ((wimp%!24) � &100)=0 � 1,"Icon isn't indirected"
#�=$(wimp%!32)
$:
$&� �Wimp_IconDisable(window%,icon%)
$#wimp%!0=window% : wimp%!4=icon%
$"$wimp%!8=1<<22   : wimp%!12=1<<22
$,!ș "Wimp_SetIconState",,wimp%
$6�
$@:
$J%� �Wimp_IconEnable(window%,icon%)
$T#wimp%!0=window% : wimp%!4=icon%
$^$wimp%!8=0       : wimp%!12=1<<22
$h!ș "Wimp_SetIconState",,wimp%
$r�
$|:
$�0� �Wimp_IconPutSprite(window%,icon%,sprite$)
$�!wimp%!0=window%:wimp%!4=icon%
$�!ș "Wimp_GetIconState",,wimp%
$�ș "Wimp_DeleteIcon",,wimp%
$�=wimp%!4=wimp%!8   : wimp%!8=wimp%!12  : wimp%!12=wimp%!16
$�?wimp%!16=wimp%!20 : wimp%!20=wimp%!24 : $(wimp%+24)=sprite$
$�)ș "Wimp_CreateIcon",,wimp% � icon%:�
$�:
$�,� �Wimp_IconPutText(window%,icon%,text$)
$�#wimp%!0=window% : wimp%!4=icon%
$�!ș "Wimp_GetIconState",,wimp%
$�7� ((wimp%!24) � &100)=0 � 1,"Icon isn't indirected"
$�$(wimp%!28)=text$
%#wimp%!0=window% : wimp%!4=icon%
%wimp%!8=0 : wimp%!12=0
%!ș "Wimp_SetIconState",,wimp%
%&�
%0:
%:� �Wimp_IconInterfaceStart
%Dș"Wimp_BorderIcon",,wimp%
%N�
%X:
%b� �Wimp_IconInterfaceFinish
%l
wimp%!8=0
%vș"Wimp_BorderIcon",,wimp%
%��
%�:
%�� �Wimp_MenuAdjustOn(menu%)
%�,ș "Wimp_GetPointerInfo",,pointer_block%
%�^� ((pointer_block%!8)�1)=1 � ș "Wimp_CreateMenu",,menu%,pointer_block%!0,pointer_block%!4
%��
%�:
%�� �Wimp_MenuChoice(level%)
%�=(wimp%!(4*level%))+1
%�:
%�� �Wimp_MenuCreate(menu$)
%�)� menu$="Colours" �=�Wimp_MenuColours
%�'� menu%,index%,width%,length%,k%,s%
&.� menu% 28+�Wimp_MenuNoOfEntries(menu$)*24
&7menu%?12=7   : menu%?13=2  : menu%?14=7 :menu%?15=0
&+menu%!16=140 : menu%!20=44 : menu%!24=0
& index%=menu%+28
&* $menu%=�menu$,�menu$,"\")-1)
&4#width%=�(�menu$,�menu$,"\")-1))
&>$menu$+="\" : Menu_NoOfEntries%=0
&Hȕ menu$<>""
&Rmenu$=�menu$,�menu$,"\")+1)
&\Ȏ menu$ �
&f� ""
&p :
&z/!index%=0 : index%!4=-1 : index%!8=&7000021
&�length%=�menu$,"\")-1
&�k%=��menu$,length%),">")
&�Ȏ k% �
&�� 0
&�
&�!s%=�(�menu$,k%+1,length%-k%))
&�index%!4=s%
&�length%=k%-1
&��
&� $(index%+12)=�menu$,length%)
&�%� length%>width% � width%=length%
&�index%+=24
&��
'�
'menu%!16=16*(width%+1)
'(index%!-24=index%!-24 � &80 : =menu%
'$:
'.� �Wimp_MenuColours
'8!=�Wimp_MenuCreateColours(" ")
'B:
'L%� �Wimp_MenuCreateColours(title$)
'V� x$,men%,j%,i%
'`6x$=title$+"\0\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15"
'jmen%=�Wimp_MenuCreate(x$)
't� i%=0 � 15
'~
Ȏ � �
'�(� i%<4,i%=9,i%=12,i%=14,i%=15 : j%=7
'� : j%=0
'��
'�men%?(39+i%*24)=i%*16+j%
'��Wimp_MenuCentre(men%,i%+1)
'��
'�	=men%
'�:
'�"� �Wimp_MenuNoOfEntries(menu$)
'�� n% ,j% : n%=0 : j%=0
'��
'�j%=�menu$,"\",j%+1)
(� j%<>0 � n%+=1
(

� j%=0
(=n%
(:
((5� �Wimp_MenuBackGroundColour(menu%,item%,colour%)
(2� fore%,i%
(<&fore%=(menu%?(39+(item%-1)*24))�16
(F(i%=((menu%?(39+(item%-1)*24))�16)�16
(P/menu%?(39+(item%-1)*24)=fore%+16*colour%+i%
(Z�
(d:
(n#� �Wimp_MenuCentre(menu%,item%)
(x:menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�(1<<3)
(��
(�:
(�� �Wimp_MenuClose
(�ș "Wimp_CreateMenu",-1
(��
(�:
(�$� �Wimp_MenuDisable(menu%,item%)
(�;menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�(1<<22)
(��
(�:
(�'� �Wimp_MenuDottedLine(menu%,item%)
(�7menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))�2
(��
):
)#� �Wimp_MenuEnable(menu%,item%)
)"�Wimp_MenuDisable(menu%,item%)
)";menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�(1<<22)
),�
)6:
)@5� �Wimp_MenuForegroundColour(menu%,item%,colour%)
)JEmenu%?(39+(item%-1)*24)=colour%+16*((menu%?(39+(item%-1)*24))�16)
)T�
)^:
)h)� �Wimp_MenuGlue(menu1%,item%,menu2%)
)rmenu1%!(8+item%*24)=menu2%
)|�
)�:
)�'� �Wimp_MenuItem(menu%,item%,item$)
)�,$(menu%+(40+(item%-1)*24))=�item$,12)+�0
)��
)�:
)�$� �Wimp_MenuMessage(menu%,item%)
)�<menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))�(1<<3)
)��
)�:
)�"� �Wimp_MenuPopUp(Menu%,x%,y%)
)�menu%=Menu%
)�+ș "Wimp_CreateMenu",,menu%,x%-64,y%+20
)��
*:
*� �Wimp_MenuPopUpBar(x%,y%)
*� n% : n%=0
*&+ȕ ((Bar_Menu%!(28+n%*24))�%10000000)=0
*0	n%+=1
*:�
*D2ș "Wimp_CreateMenu",,Bar_Menu%,x%-64,96+n%*44
*Nmenu%=Bar_Menu%
*X�
*b:
*l!� �Wimp_MenuTick(menu%,item%)
*v7menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))�1
*��
*�:
*�#� �Wimp_MenuTitle(menu%,title$)
*�$menu%=�title$,12)+�0
*��
*�:
*�=� �Wimp_MenuWrite(menu%,item%,buffer%,val%,BufferLength%)
*�7menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))�4
*�8menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�&100
*�#menu%!(40+(item%-1)*24)=buffer%
*� menu%!(44+(item%-1)*24)=val%
*�)menu%!(48+(item%-1)*24)=BufferLength%
*��
+:
+� �Wimp_SpritesLoad
+/�Wimp_SpritesPathLoad("<Obey$Dir>.Sprites")
+ direct_sprites%=sprites%
+*�
+4:
+>&� �Wimp_SpritesPathLoad(pathname$)
+H� S%,T%
+R#S%=�(pathname$):T%=�#S%+16:�#S%
+\� sprites%T%,spname%12
+f!sprites%=T%:sprites%!8=0
+p!ș"OS_SpriteOp",&109,sprites%
+z+ș"OS_SpriteOp",&10A,sprites%,pathname$
+��
+�:
+�� �Wimp_FileType(type%)
+�
Ȏ type%�
+��&FFF:="Text"
+��&FFD:="Data"
+��&FFB:="Basic"
+��&FF9:="Sprite"
+��&FED:="Palette"
+��&FEC:="Template"
+��&AFF:="Draw"
+��&1000:="Folder"
+��&2000:="Application"
,=�~(type%)
,�
,:
,$� �Wimp_GetFilePathName
,.'=�Wimp_GetStringAtAddress(wimp%+44)
,8:
,B� �Wimp_FileLoad(pathname$)
,L� S%,T%,file%
,VS%=� pathname$
,`T%=�#S%+16
,j�#S%
,t
� file%T%
,~-ș "XOS_CLI","Load"+pathname$+""+�~file%)
,�
=file%
,�;
,�&� �Wimp_GetStringAtAddress(array%)
,�� s$:s$=""
,�<ȕ(?array%<>13)�(?array%<>0):s$+=�(?array%):array%+=1:�:
,�=s$
,�:
,�#� �Wimp_GetFileFromPathname(f$)
,�Ȏ �f$,".") �
,�� 0    :=f$
,�6 :=�Wimp_GetFileFromPathname(�f$,�(f$)-�f$,".")))
,��
-:
-
� �Wimp_SendToEdit(file$)
-� n%
-wimp%!4=&6CC01C0C
-(wimp%!16=5
-2wimp%!36=0
-<wimp%!40=&FFF
-F$(wimp%+44)=file$+�0
-Pn%=� file$+45
-Z,� n%�4 � !wimp%=4+(n%>>2)<<2 � !wimp%=n%
-d$ș "Wimp_SendMessage",17,wimp%,0
-n�
-x:
-�� �opentext
-�!wimp%=256
-�wimp%!12=0
-�wimp%!16=5
-�wimp%!36=0
-�wimp%!40=&fff
-�*$(wimp%+44)="CavernEd:Documents.!Help"
-�$ș "Wimp_SendMessage",18,wimp%,0
-��
-�:
-�� �Wimp_BASICParameters
-�� com$,param$,I%
-�ș "OS_GetEnv" � com$
.params$=""
.I%=�com$," -quit ")
.4� I% � params$=�com$,�com$," ",I%+�" -quit ")+1)
."=params$
.,:
.6� �Wimp_Error
.@� X$,x%
.J	� � �
.Tx%=�
.^X$=�$+" at line "+�(x%)
.h� ErrorMsg%36
.rEErrorMsg%!0=36:ErrorMsg%!12=0:ErrorMsg%!16=&81080:ErrorMsg%!20=x%
.|$(ErrorMsg%+24)="!RunImage"
.�%ș"Wimp_SendMessage",17,ErrorMsg%
.��Wimp_WindowAlert(task$,X$)
.��Wimp_CloseDown
.��
.�:
.�� �Wimp_CloseDown
.�#ș"Wimp_CloseDown",task%,"TASK"
.��
.�:
.�� �Wimp_Quit
.�finished%=�
.��
.�:
/#� �Wimp_ReadVariable(Variable$)
/� len%,result%,variable%
/$wimp%=Variable$
/&3ș"OS_ReadVarVal",wimp%,wimp%+255,255,,3�,,len%
/0wimp%?(len%+255)=13
/:=$(wimp%+255)
/D:
/N� �Wimp_PollCloseWindow
/X#ș "Wimp_GetPointerInfo",,wimp%
/b'window%=wimp%!12 : buttons%=wimp%!8
/l(�Event_WindowClose(window%,buttons%)
/v1!wimp%=window% : ș "Wimp_CloseWindow",,wimp%
/��
/�:
/�� �Wimp_PollMouseClick
/�Ibutton%=wimp%!8:window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
/�Ȏ button% �
/��2    : �Wimp_PollMenuPopUp
/� : Ȏ �Event_Save(window%) �
/�� � : �Wimp_PollMouseSave
/�"� �: �Wimp_PollEventMouseClick
/��
/��
/��
/�:
0� �Wimp_PollMenuPopUp
0menu%=�Event_Menu(window%)
0Ȏ menu%  �
0 � �:
0* :
04Ȏ window% �
0>� -2   : n%=0
0H+ȕ ((Bar_Menu%!(28+n%*24))�%10000000)=0
0R	n%+=1
0\�
0f3ș "Wimp_CreateMenu",,Bar_Menu%,x%-64,140+n%*44
0p. : ș"Wimp_CreateMenu",,menu%,x%-64,y%+20
0z�
0��
0��
0�:
0�� �Wimp_PollMouseSave
0�Ȏ icon% �
0�6� 0 : � button% � &50 � �Wimp_PollDragBox(window%)
0�6� 2 : � button% � 5 �  �Wimp_PollSaveFile(window%)
0��
0��
0�:
0�� �Wimp_PollEventMouseClick
0�-� interface% � ș"Wimp_BorderIcon",,wimp%
0�2�Event_MouseClick(window%,icon%,button%,x%,y%)
1Ȏ  interface% �
1	� � :
1%wimp%!0=x%:wimp%!4=y% : wimp%!8=0
1$%wimp%!12=window% : wimp%!16=icon%
1.ș"Wimp_BorderIcon",,wimp%
18�
1B�
1L:
1V!� �Wimp_PollSaveFile(window%)
1`� file$
1j?wimp%!0=window% : wimp%!4=1 : ș "Wimp_GetIconState",,wimp%
1tfile$=$(wimp%!28)
1~Ȏ �file$,".") �
1�� 0   :
1�=$(wimp%+4)="To save, drag the icon to a directory window"
1�(ș "Wimp_ReportError",wimp%,16,task$
1�:
1�"�Event_SaveFile(file$,window%)
1��
1�ș"Wimp_CreateMenu",-1
1�� save=� � �Wimp_CloseDown
1��
1�:
1� � �Wimp_PollDragBox(window%)
1�� x%,y%
2save%=window%
2
!wimp%=window%
2"ș"Wimp_GetWindowState",,wimp%
2,x%=wimp%!4-wimp%!20:y%=wimp%!16-wimp%!24
2(
wimp%!4=0
22 ș"Wimp_GetIconState",,wimp%
2<!wimp%=window%
2F
wimp%!4=5
2P+wimp%!8=x%+wimp%!8:wimp%!12=y%+wimp%!12
2Z-wimp%!16=x%+wimp%!16:wimp%!20=y%+wimp%!20
2dwimp%!24=0:wimp%!28=0
2n)wimp%!32=&7FFFFFFF:wimp%!36=&7FFFFFFF
2x� version%>=310 �
2�Aș"DragASprite_Start",%11000101,1,"file_022",wimp%+8,wimp%+24
2��
2�ș"Wimp_DragBox",,wimp%
2��
2��
2�:
2�� �Wimp_PollKeyPress
2�/window%=wimp%!0:icon%=wimp%!4:key%=wimp%!24
2�Ȏ �Event_Save(window%) �
2�%� � : �WimpPoll_SaveFile(window%)
2�,� �: �Event_KeyPress(window%,icon%,key%)
2��
2��
3:
3� �Wimp_PollSaveMessage
3� file$,window%,icon%,x%,y%
3""ș"Wimp_GetPointerInfo",,wimp%
3,9window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
36=wimp%!0=save% : wimp%!4=1 : ș "Wimp_GetIconState",,wimp%
3@file$=$(wimp%!28)
3J*file$=�Wimp_GetFileFromPathname(file$)
3Twimp%!20=window%
3^wimp%!24=icon%
3hwimp%!28=x%:wimp%!32=y%
3rwimp%!36=length%
3|wimp%!0=64
3�wimp%!12=0
3�wimp%!16=1
3�wimp%!40=&FFF
3�$(wimp%+44)=file$
3�3ș"Wimp_SendMessage",17,wimp%,wimp%!20,wimp%!24
3��
3�:
3�� �Wimp_PollMessages
3�� file$
3�,file$=�Wimp_GetStringAtAddress(wimp%+44)
3�Ȏ wimp%!16 �
3�� 0 : finished%=�
3�	� 1 :
4	� 2 :
4=wimp%!0=save% : wimp%!4=1 : ș "Wimp_GetIconState",,wimp%
4$(wimp%!28)=file$
4&6wimp%!0=save% : wimp%!4=1 : wimp%!8=0 : wimp%!12=0
40!ș "Wimp_SetIconState",,wimp%
4:3ș "Wimp_SetCaretPosition",save%,1,,,-1,� file$
4D �Event_SaveFile(file$,save%)
4N� save=� � �Wimp_CloseDown
4X� 3
4bAtype$=�Wimp_FileType(wimp%!40) : �Event_LoadFile(file$,type$)
4l�
4v�
4�:
4�
� �ack
4�U� wimp%!4=task% � wimp%!16=5 � ș "Wimp_StartTask","Run CavernEd:Documents.!Help"
4��
4�:
4�&� �Wimp_GetStringAtAddress(array%)
4�� s$:s$=""
4�<ȕ(?array%<>13)�(?array%<>0):s$+=�(?array%):array%+=1:�:
4�=s$
4�:
4�#� �Wimp_GetFileFromPathname(f$)
4�Ȏ �f$,".") �
4�� 0    :=f$
56 :=�Wimp_GetFileFromPathname(�f$,�(f$)-�f$,".")))
5�
5:
5 � �Wimp_FileType(type%)
5*
Ȏ type%�
54�&FFF:="Text"
5>�&FFD:="Data"
5H�&FFB:="Basic"
5R�&FF9:="Sprite"
5\�&FED:="Palette"
5f�&FEC:="Template"
5p�&AFF:="Draw"
5z�&1000:="Folder"
5��&2000:="Application"
5�=�~(type%)
5��
�
00000000  0d 00 0a 10 f4 20 3e 21  52 75 6e 49 6d 61 67 65  |..... >!RunImage|
00000010  0d 00 14 18 f4 20 43 61  76 65 72 6e 20 44 75 65  |..... Cavern Due|
00000020  6c 20 45 64 69 74 6f 72  0d 00 1e 35 f4 20 56 65  |l Editor...5. Ve|
00000030  72 73 69 6f 6e 20 31 2e  33 37 20 28 34 74 68 20  |rsion 1.37 (4th |
00000040  44 65 63 65 6d 62 65 72  2c 20 31 39 39 37 29 20  |December, 1997) |
00000050  46 69 6e 61 6c 20 52 65  6c 65 61 73 65 0d 00 28  |Final Release..(|
00000060  28 f4 20 46 69 72 73 74  20 66 75 6c 6c 79 20 6d  |(. First fully m|
00000070  75 6c 74 69 2d 74 61 73  6b 69 6e 67 20 76 65 72  |ulti-tasking ver|
00000080  73 69 6f 6e 21 0d 00 32  3c f4 20 57 72 69 74 74  |sion!..2<. Writt|
00000090  65 6e 20 61 6e 64 20 64  65 73 69 67 6e 65 64 20  |en and designed |
000000a0  62 79 20 53 74 65 70 68  65 6e 20 53 63 6f 74 74  |by Stephen Scott|
000000b0  20 31 39 39 35 2c 20 31  39 39 36 2c 20 31 39 39  | 1995, 1996, 199|
000000c0  37 0d 00 3c 38 f4 20 55  73 69 6e 67 20 57 69 6d  |7..<8. Using Wim|
000000d0  70 45 64 20 62 79 20 4a  6f 65 20 54 61 79 6c 6f  |pEd by Joe Taylo|
000000e0  72 20 a9 20 41 72 63 68  69 6d 65 64 65 73 20 57  |r . Archimedes W|
000000f0  6f 72 6c 64 20 31 39 39  32 0d 00 46 05 3a 0d 00  |orld 1992..F.:..|
00000100  50 15 c8 99 20 22 48 6f  75 72 67 6c 61 73 73 5f  |P... "Hourglass_|
00000110  4f 6e 22 0d 00 5a 25 f2  57 69 6d 70 5f 53 74 61  |On"..Z%.Wimp_Sta|
00000120  72 74 28 22 43 61 76 65  72 6e 45 64 22 2c 31 39  |rt("CavernEd",19|
00000130  30 30 2c 32 30 30 34 29  0d 00 64 18 f2 55 73 65  |00,2004)..d..Use|
00000140  72 5f 53 65 74 49 6e 69  74 69 61 6c 44 61 74 61  |r_SetInitialData|
00000150  0d 00 6e 13 f2 43 72 65  61 74 65 5f 57 69 6e 64  |..n..Create_Wind|
00000160  6f 77 73 0d 00 78 11 f2  43 72 65 61 74 65 5f 4d  |ows..x..Create_M|
00000170  65 6e 75 73 0d 00 82 25  f2 57 69 6d 70 5f 4d 65  |enus...%.Wimp_Me|
00000180  6e 75 44 69 73 61 62 6c  65 28 53 63 72 65 65 6e  |nuDisable(Screen|
00000190  5f 4d 65 6e 75 25 2c 33  29 0d 00 8c 16 c8 99 20  |_Menu%,3)...... |
000001a0  22 48 6f 75 72 67 6c 61  73 73 5f 4f 66 66 22 0d  |"Hourglass_Off".|
000001b0  00 96 16 f2 57 69 6d 70  5f 57 61 69 74 46 6f 72  |....Wimp_WaitFor|
000001c0  45 76 65 6e 74 0d 00 a0  13 f2 57 69 6d 70 5f 43  |Event.....Wimp_C|
000001d0  6c 6f 73 65 44 6f 77 6e  0d 00 aa 05 e0 0d 00 b4  |loseDown........|
000001e0  05 3a 0d 00 be 2f dd 20  f2 57 69 6d 70 5f 53 74  |.:.../. .Wimp_St|
000001f0  61 72 74 28 54 61 73 6b  4e 61 6d 65 24 2c 77 69  |art(TaskName$,wi|
00000200  6d 70 5f 6d 65 6d 6f 72  79 25 2c 69 63 6f 6e 25  |mp_memory%,icon%|
00000210  29 0d 00 c8 25 de 20 77  69 6d 70 25 20 77 69 6d  |)...%. wimp% wim|
00000220  70 5f 6d 65 6d 6f 72 79  25 2c 69 63 6f 6e 73 25  |p_memory%,icons%|
00000230  20 69 63 6f 6e 25 0d 00  d2 29 e7 20 77 69 6d 70  | icon%...). wimp|
00000240  5f 6d 65 6d 6f 72 79 25  3c 32 35 36 20 8c 20 77  |_memory%<256 . w|
00000250  69 6d 70 5f 6d 65 6d 6f  72 79 25 3d 32 35 36 0d  |imp_memory%=256.|
00000260  00 dc 1d 69 63 6f 6e 5f  6d 65 6d 6f 72 79 25 3d  |...icon_memory%=|
00000270  69 63 6f 6e 73 25 2b 69  63 6f 6e 25 0d 00 e6 13  |icons%+icon%....|
00000280  74 61 73 6b 24 3d 54 61  73 6b 4e 61 6d 65 24 0d  |task$=TaskName$.|
00000290  00 f0 2b 69 6e 64 69 72  65 63 74 5f 73 70 72 69  |..+indirect_spri|
000002a0  74 65 73 25 3d 31 20 3a  20 64 69 72 65 63 74 5f  |tes%=1 : direct_|
000002b0  73 70 72 69 74 65 73 25  3d 31 0d 00 fa 1b f2 57  |sprites%=1.....W|
000002c0  69 6d 70 5f 53 65 74 45  76 65 6e 74 56 61 72 69  |imp_SetEventVari|
000002d0  61 62 6c 65 73 0d 01 04  15 ee 20 85 20 f2 57 69  |ables..... . .Wi|
000002e0  6d 70 5f 45 72 72 6f 72  3a e0 0d 01 0e 40 c8 99  |mp_Error:....@..|
000002f0  22 57 69 6d 70 5f 49 6e  69 74 69 61 6c 69 73 65  |"Wimp_Initialise|
00000300  22 2c 32 30 30 2c 26 34  42 35 33 34 31 35 34 2c  |",200,&4B534154,|
00000310  54 61 73 6b 4e 61 6d 65  24 20 b8 20 76 65 72 73  |TaskName$ . vers|
00000320  69 6f 6e 25 2c 74 61 73  6b 25 0d 01 18 05 e1 0d  |ion%,task%......|
00000330  01 22 05 3a 0d 01 2c 1d  dd 20 f2 57 69 6d 70 5f  |.".:..,.. .Wimp_|
00000340  53 65 74 45 76 65 6e 74  56 61 72 69 61 62 6c 65  |SetEventVariable|
00000350  73 0d 01 36 17 de 20 70  6f 69 6e 74 65 72 5f 62  |s..6.. pointer_b|
00000360  6c 6f 63 6b 25 20 32 30  0d 01 40 10 69 6e 74 65  |lock% 20..@.inte|
00000370  72 66 61 63 65 25 3d a3  0d 01 4a 2e 6e 75 6c 6c  |rface%=...J.null|
00000380  25 3d 31 20 20 3a 64 72  61 77 25 3d 32 20 3a 20  |%=1  :draw%=2 : |
00000390  20 70 6f 69 6e 74 65 72  5f 6c 65 61 76 69 6e 67  | pointer_leaving|
000003a0  25 3d 31 3c 3c 34 0d 01  54 31 70 6f 69 6e 74 65  |%=1<<4..T1pointe|
000003b0  72 5f 65 6e 74 65 72 69  6e 67 25 3d 31 3c 3c 35  |r_entering%=1<<5|
000003c0  3a 6d 6f 75 73 65 25 3d  31 3c 3c 36 3a 64 72 61  |:mouse%=1<<6:dra|
000003d0  67 25 3d 31 3c 3c 37 0d  01 5e 26 6b 65 79 25 3d  |g%=1<<7..^&key%=|
000003e0  31 3c 3c 38 3a 6d 65 6e  75 25 3d 31 3c 3c 39 3a  |1<<8:menu%=1<<9:|
000003f0  73 63 72 6f 6c 6c 25 3d  31 3c 3c 31 30 0d 01 68  |scroll%=1<<10..h|
00000400  40 6c 6f 73 65 5f 63 61  72 65 74 25 3d 31 3c 3c  |@lose_caret%=1<<|
00000410  31 31 3a 67 61 69 6e 5f  63 61 72 65 74 25 3d 31  |11:gain_caret%=1|
00000420  3c 3c 31 32 3a 6d 65 73  73 61 67 65 25 3d 28 31  |<<12:message%=(1|
00000430  3c 3c 31 37 29 2b 28 31  3c 3c 31 38 29 0d 01 72  |<<17)+(1<<18)..r|
00000440  30 72 65 63 6f 72 64 65  72 25 3d 31 3c 3c 31 38  |0recorder%=1<<18|
00000450  3a 61 63 6b 6e 6f 77 6c  65 64 67 65 25 3d 31 3c  |:acknowledge%=1<|
00000460  3c 31 39 3a 77 69 6e 64  6f 77 25 3d 30 0d 01 7c  |<19:window%=0..||
00000470  21 73 70 72 69 74 65 73  25 3d 31 3a 76 65 72 73  |!sprites%=1:vers|
00000480  69 6f 6e 25 3d 30 3a 74  61 73 6b 25 3d 30 0d 01  |ion%=0:task%=0..|
00000490  86 2a 42 61 72 5f 57 69  6e 64 6f 77 25 3d 2d 32  |.*Bar_Window%=-2|
000004a0  3a 42 61 72 5f 49 63 6f  6e 25 3d 30 3a 42 61 72  |:Bar_Icon%=0:Bar|
000004b0  5f 4d 65 6e 75 25 3d 30  0d 01 90 2a 78 5f 6f 72  |_Menu%=0...*x_or|
000004c0  69 67 69 6e 25 3d 30 3a  79 5f 6f 72 69 67 69 6e  |igin%=0:y_origin|
000004d0  25 3d 30 3a 53 61 76 65  57 69 6e 64 6f 77 25 3d  |%=0:SaveWindow%=|
000004e0  2d 33 0d 01 9a 33 6d 65  73 73 61 67 65 5f 71 75  |-3...3message_qu|
000004f0  69 74 25 3d 30 3a 6d 65  73 73 61 67 65 5f 73 61  |it%=0:message_sa|
00000500  76 65 25 3d 32 3a 6d 65  73 73 61 67 65 5f 6c 6f  |ve%=2:message_lo|
00000510  61 64 25 3d 33 0d 01 a4  21 6d 6f 75 73 65 5f 62  |ad%=3...!mouse_b|
00000520  75 74 74 6f 6e 25 3d 32  3a 73 61 76 65 5f 65 76  |utton%=2:save_ev|
00000530  65 6e 74 25 3d 30 0d 01  ae 20 74 6f 70 5f 6c 69  |ent%=0... top_li|
00000540  6e 65 25 3d 30 20 3a 20  62 6f 74 74 6f 6d 5f 6c  |ne%=0 : bottom_l|
00000550  69 6e 65 25 3d 30 0d 01  b8 05 e1 0d 01 c2 05 3a  |ine%=0.........:|
00000560  0d 01 cc 1a dd 20 f2 55  73 65 72 5f 53 65 74 49  |..... .User_SetI|
00000570  6e 69 74 69 61 6c 44 61  74 61 0d 01 d6 38 de 20  |nitialData...8. |
00000580  73 63 72 65 65 6e 24 28  37 2c 33 2c 31 36 2c 31  |screen$(7,3,16,1|
00000590  36 29 2c 79 6f 75 78 28  32 29 2c 79 6f 75 79 28  |6),youx(2),youy(|
000005a0  32 29 2c 79 73 63 78 28  32 29 2c 79 73 63 79 28  |2),yscx(2),yscy(|
000005b0  32 29 0d 01 e0 20 f4 20  53 65 74 20 75 70 20 32  |2)... . Set up 2|
000005c0  31 20 74 65 6c 65 70 6f  72 74 73 20 28 30 2d 32  |1 teleports (0-2|
000005d0  30 29 0d 01 ea 39 de 20  74 65 6c 65 74 6f 73 63  |0)...9. teletosc|
000005e0  78 28 32 30 29 2c 74 65  6c 65 74 6f 73 63 79 28  |x(20),teletoscy(|
000005f0  32 30 29 2c 74 65 6c 65  74 6f 78 28 32 30 29 2c  |20),teletox(20),|
00000600  74 65 6c 65 74 6f 79 28  32 30 29 0d 01 f4 37 74  |teletoy(20)...7t|
00000610  65 6c 65 74 6f 73 63 78  28 29 3d 30 3a 74 65 6c  |eletoscx()=0:tel|
00000620  65 74 6f 73 63 79 28 29  3d 30 3a 74 65 6c 65 74  |etoscy()=0:telet|
00000630  6f 78 28 29 3d 30 3a 74  65 6c 65 74 6f 79 28 29  |ox()=0:teletoy()|
00000640  3d 30 0d 01 fe 2f de 20  74 73 63 78 28 32 30 29  |=0.../. tscx(20)|
00000650  2c 74 73 63 79 28 32 30  29 2c 74 78 28 32 30 29  |,tscy(20),tx(20)|
00000660  2c 74 79 28 32 30 29 2c  61 63 74 69 76 28 32 30  |,ty(20),activ(20|
00000670  29 0d 02 08 2d 74 73 63  78 28 29 3d 30 3a 74 73  |)...-tscx()=0:ts|
00000680  63 79 28 29 3d 30 3a 74  78 28 29 3d 30 3a 74 79  |cy()=0:tx()=0:ty|
00000690  28 29 3d 30 3a 61 63 74  69 76 28 29 3d 30 0d 02  |()=0:activ()=0..|
000006a0  12 17 73 63 78 3d 30 3a  73 63 79 3d 30 3a 78 3d  |..scx=0:scy=0:x=|
000006b0  30 3a 79 3d 30 0d 02 1c  13 64 72 61 77 78 3d 30  |0:y=0....drawx=0|
000006c0  3a 64 72 61 77 79 3d 30  0d 02 26 0f 6d 6f 75 73  |:drawy=0..&.mous|
000006d0  65 6c 6f 63 6b 3d 30 0d  02 30 0e 73 65 6c 65 63  |elock=0..0.selec|
000006e0  74 65 64 3d 30 0d 02 3a  14 63 6c 65 61 72 5f 73  |ted=0..:.clear_s|
000006f0  65 6c 65 63 74 65 64 3d  30 0d 02 44 0e 63 6c 65  |elected=0..D.cle|
00000700  61 72 69 6e 67 3d a3 0d  02 4e 0d 6c 6f 61 64 65  |aring=...N.loade|
00000710  64 25 3d 30 0d 02 58 12  6d 79 6f 77 6e 6e 75 6d  |d%=0..X.myownnum|
00000720  62 65 72 25 3d 30 0d 02  62 11 78 70 6f 73 3d 30  |ber%=0..b.xpos=0|
00000730  3a 79 70 6f 73 3d 30 0d  02 6c 0e 74 65 6c 65 6e  |:ypos=0..l.telen|
00000740  75 6d 25 3d 30 0d 02 76  0b 64 6f 6e 65 31 3d 30  |um%=0..v.done1=0|
00000750  0d 02 80 0b 64 6f 6e 65  32 3d 30 0d 02 8a 0e 70  |....done2=0....p|
00000760  72 6f 74 65 63 74 25 3d  30 0d 02 94 0e 65 6e 64  |rotect%=0....end|
00000770  6c 6f 6f 70 25 3d 30 0d  02 9e 0d 64 65 66 69 6e  |loop%=0....defin|
00000780  65 64 3d 30 0d 02 a8 09  72 65 64 3d a3 0d 02 b2  |ed=0....red=....|
00000790  0b 67 72 65 65 6e 3d a3  0d 02 bc 0b 58 3d 30 3a  |.green=.....X=0:|
000007a0  59 3d 30 0d 02 c6 0f 53  43 58 3d 30 3a 53 43 59  |Y=0....SCX=0:SCY|
000007b0  3d 30 0d 02 d0 05 f5 0d  02 da 2a 73 63 72 65 65  |=0........*scree|
000007c0  6e 24 28 53 43 58 2c 53  43 59 2c 58 2c 59 29 3d  |n$(SCX,SCY,X,Y)=|
000007d0  22 30 22 3a f4 20 53 65  74 75 70 20 62 6c 6f 63  |"0":. Setup bloc|
000007e0  6b 0d 02 e4 1a 58 2b 3d  31 3a e7 20 58 3e 31 36  |k....X+=1:. X>16|
000007f0  20 8c 20 58 3d 30 3a 59  2b 3d 31 0d 02 ee 1b e7  | . X=0:Y+=1.....|
00000800  20 59 3e 31 36 20 8c 20  53 43 59 2b 3d 31 3a 58  | Y>16 . SCY+=1:X|
00000810  3d 30 3a 59 3d 30 0d 02  f8 22 e7 20 53 43 59 3e  |=0:Y=0...". SCY>|
00000820  33 20 8c 20 53 43 58 2b  3d 31 3a 53 43 59 3d 30  |3 . SCX+=1:SCY=0|
00000830  3a 58 3d 30 3a 59 3d 30  0d 03 02 0b fd 20 53 43  |:X=0:Y=0..... SC|
00000840  58 3e 37 0d 03 0c 16 6d  61 69 6e 25 3d 30 3a 6f  |X>7....main%=0:o|
00000850  6c 64 69 63 6f 6e 25 3d  30 0d 03 16 3d de 20 70  |ldicon%=0...=. p|
00000860  61 6c 25 20 31 32 30 3a  c8 99 20 22 4f 53 5f 46  |al% 120:.. "OS_F|
00000870  69 6c 65 22 2c 31 32 2c  22 3c 43 61 76 65 72 6e  |ile",12,"<Cavern|
00000880  45 64 24 44 69 72 3e 2e  44 65 73 50 61 6c 22 2c  |Ed$Dir>.DesPal",|
00000890  70 61 6c 25 2c 30 0d 03  20 17 75 70 64 61 74 65  |pal%,0.. .update|
000008a0  3d a3 3a 62 69 74 63 68  69 6e 67 3d a3 0d 03 2a  |=.:bitching=...*|
000008b0  2d 74 65 6c 65 5f 6f 70  65 6e 3d a3 3a 64 72 61  |-tele_open=.:dra|
000008c0  77 24 3d 22 31 22 3a 65  72 61 73 65 24 3d 22 30  |w$="1":erase$="0|
000008d0  22 3a 73 24 3d 64 72 61  77 24 0d 03 34 1b 73 63  |":s$=draw$..4.sc|
000008e0  72 65 65 6e 5f 78 25 3d  30 3a 73 63 72 65 65 6e  |reen_x%=0:screen|
000008f0  5f 79 25 3d 30 0d 03 3e  33 f2 57 69 6d 70 5f 53  |_y%=0..>3.Wimp_S|
00000900  70 72 69 74 65 73 50 61  74 68 4c 6f 61 64 28 22  |pritesPathLoad("|
00000910  3c 43 61 76 65 72 6e 45  64 24 44 69 72 3e 2e 44  |<CavernEd$Dir>.D|
00000920  65 73 53 70 72 73 22 29  0d 03 48 1f de 20 70 69  |esSprs")..H.. pi|
00000930  78 74 72 61 6e 73 25 20  32 30 2c 73 63 61 6c 65  |xtrans% 20,scale|
00000940  66 61 63 25 20 32 30 0d  03 52 10 43 44 25 3d a3  |fac% 20..R.CD%=.|
00000950  3a 73 61 76 65 3d a3 0d  03 5c 05 e1 0d 03 66 05  |:save=...\....f.|
00000960  3a 0d 03 70 15 dd 20 f2  43 72 65 61 74 65 5f 57  |:..p.. .Create_W|
00000970  69 6e 64 6f 77 73 0d 03  7a 25 69 6e 66 6f 62 6f  |indows..z%infobo|
00000980  78 25 3d a4 57 69 6d 70  5f 57 69 6e 64 6f 77 4c  |x%=.Wimp_WindowL|
00000990  6f 61 64 28 22 69 6e 66  6f 22 29 0d 03 84 28 73  |oad("info")...(s|
000009a0  61 76 65 62 6f 78 25 3d  a4 57 69 6d 70 5f 57 69  |avebox%=.Wimp_Wi|
000009b0  6e 64 6f 77 4c 6f 61 64  28 22 73 61 76 65 62 6f  |ndowLoad("savebo|
000009c0  78 22 29 0d 03 8e 28 63  68 65 63 6b 65 72 25 3d  |x")...(checker%=|
000009d0  a4 57 69 6d 70 5f 57 69  6e 64 6f 77 4c 6f 61 64  |.Wimp_WindowLoad|
000009e0  28 22 63 68 65 63 6b 65  72 22 29 0d 03 98 26 73  |("checker")...&s|
000009f0  63 72 65 65 6e 25 3d a4  57 69 6d 70 5f 57 69 6e  |creen%=.Wimp_Win|
00000a00  64 6f 77 4c 6f 61 64 28  22 53 63 72 65 65 6e 22  |dowLoad("Screen"|
00000a10  29 0d 03 a2 20 74 69 74  6c 65 25 3d 77 69 6d 70  |)... title%=wimp|
00000a20  25 21 37 32 3a 77 69 6d  70 25 3f 33 35 3d 26 46  |%!72:wimp%?35=&F|
00000a30  46 0d 03 ac 24 49 63 6f  6e 73 25 3d a4 57 69 6d  |F...$Icons%=.Wim|
00000a40  70 5f 57 69 6e 64 6f 77  4c 6f 61 64 28 22 69 63  |p_WindowLoad("ic|
00000a50  6f 6e 73 22 29 0d 03 b6  20 4d 61 70 25 3d a4 57  |ons")... Map%=.W|
00000a60  69 6d 70 5f 57 69 6e 64  6f 77 4c 6f 61 64 28 22  |imp_WindowLoad("|
00000a70  6d 61 70 22 29 0d 03 c0  15 77 69 6d 70 25 21 36  |map")....wimp%!6|
00000a80  34 3d 73 70 72 69 74 65  73 25 0d 03 ca 2c 74 65  |4=sprites%...,te|
00000a90  6c 65 70 6f 72 74 73 25  3d a4 57 69 6d 70 5f 57  |leports%=.Wimp_W|
00000aa0  69 6e 64 6f 77 4c 6f 61  64 28 22 74 65 6c 65 70  |indowLoad("telep|
00000ab0  6f 72 74 73 22 29 0d 03  d4 28 42 61 72 5f 49 63  |orts")...(Bar_Ic|
00000ac0  6f 6e 25 3d a4 57 69 6d  70 5f 49 63 6f 6e 42 61  |on%=.Wimp_IconBa|
00000ad0  72 28 22 21 63 61 76 65  72 6e 65 64 22 29 0d 03  |r("!caverned")..|
00000ae0  de 05 e1 0d 03 e8 05 3a  0d 03 f2 1f dd 20 a4 57  |.......:..... .W|
00000af0  69 6d 70 5f 57 69 6e 64  6f 77 4c 6f 61 64 28 77  |imp_WindowLoad(w|
00000b00  69 6e 64 6f 77 24 29 0d  03 fc 39 3d a4 57 69 6d  |indow$)...9=.Wim|
00000b10  70 5f 57 69 6e 64 6f 77  4c 6f 61 64 46 72 6f 6d  |p_WindowLoadFrom|
00000b20  28 77 69 6e 64 6f 77 24  2c 22 3c 4f 62 65 79 24  |(window$,"<Obey$|
00000b30  44 69 72 3e 2e 54 65 6d  70 6c 61 74 65 73 22 29  |Dir>.Templates")|
00000b40  0d 04 06 05 3a 0d 04 10  2d dd 20 a4 57 69 6d 70  |....:...-. .Wimp|
00000b50  5f 57 69 6e 64 6f 77 4c  6f 61 64 46 72 6f 6d 28  |_WindowLoadFrom(|
00000b60  77 69 6e 64 6f 77 24 2c  74 65 6d 70 6c 61 74 65  |window$,template|
00000b70  24 29 0d 04 1a 1a ea 20  63 25 2c 69 25 2c 6e 25  |$)..... c%,i%,n%|
00000b80  2c 6a 25 2c 73 70 24 2c  73 70 32 24 0d 04 24 25  |,j%,sp$,sp2$..$%|
00000b90  c8 99 20 22 57 69 6d 70  5f 4f 70 65 6e 54 65 6d  |.. "Wimp_OpenTem|
00000ba0  70 6c 61 74 65 22 2c 2c  74 65 6d 70 6c 61 74 65  |plate",,template|
00000bb0  24 0d 04 2e 4d c8 99 20  22 57 69 6d 70 5f 4c 6f  |$...M.. "Wimp_Lo|
00000bc0  61 64 54 65 6d 70 6c 61  74 65 22 2c 2c 77 69 6d  |adTemplate",,wim|
00000bd0  70 25 2c 69 63 6f 6e 73  25 2c 69 63 6f 6e 5f 6d  |p%,icons%,icon_m|
00000be0  65 6d 6f 72 79 25 2c 2d  31 2c 77 69 6e 64 6f 77  |emory%,-1,window|
00000bf0  24 2c 30 20 b8 20 2c 2c  69 63 6f 6e 73 25 0d 04  |$,0 . ,,icons%..|
00000c00  38 11 c8 8e 20 73 70 72  69 74 65 73 25 20 ca 0d  |8... sprites% ..|
00000c10  04 42 1e c9 20 31 20 20  20 20 3a 20 77 69 6d 70  |.B.. 1    : wimp|
00000c20  25 21 36 34 3d 73 70 72  69 74 65 73 25 0d 04 4c  |%!64=sprites%..L|
00000c30  28 7f 20 3a 20 77 69 6d  70 25 21 36 34 3d a4 45  |(. : wimp%!64=.E|
00000c40  76 65 6e 74 5f 53 70 72  69 74 65 73 28 77 69 6e  |vent_Sprites(win|
00000c50  64 6f 77 25 29 0d 04 56  05 cb 0d 04 60 26 c8 99  |dow%)..V....`&..|
00000c60  20 22 57 69 6d 70 5f 43  72 65 61 74 65 57 69 6e  | "Wimp_CreateWin|
00000c70  64 6f 77 22 2c 2c 77 69  6d 70 25 20 b8 20 63 25  |dow",,wimp% . c%|
00000c80  0d 04 6a 1b c8 99 20 22  57 69 6d 70 5f 43 6c 6f  |..j... "Wimp_Clo|
00000c90  73 65 54 65 6d 70 6c 61  74 65 22 0d 04 74 37 c8  |seTemplate"..t7.|
00000ca0  99 20 22 57 69 6d 70 5f  57 68 69 63 68 49 63 6f  |. "Wimp_WhichIco|
00000cb0  6e 22 2c 63 25 2c 77 69  6d 70 25 2b 34 30 2c 31  |n",c%,wimp%+40,1|
00000cc0  2b 32 2b 28 31 3c 3c 38  29 2c 32 2b 28 31 3c 3c  |+2+(1<<8),2+(1<<|
00000cd0  38 29 0d 04 7e 11 c8 8e  20 77 69 6d 70 25 21 34  |8)..~... wimp%!4|
00000ce0  30 20 ca 0d 04 88 0c c9  20 2d 31 20 20 20 3a 0d  |0 ...... -1   :.|
00000cf0  04 92 0d 7f 20 3a 20 69  25 3d 34 30 0d 04 9c 05  |.... : i%=40....|
00000d00  f5 0d 04 a6 21 77 69 6d  70 25 21 34 3d 77 69 6d  |....!wimp%!4=wim|
00000d10  70 25 21 69 25 20 3a 20  77 69 6d 70 25 21 30 3d  |p%!i% : wimp%!0=|
00000d20  63 25 0d 04 b0 21 c8 99  20 22 57 69 6d 70 5f 47  |c%...!.. "Wimp_G|
00000d30  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 77 69  |etIconState",,wi|
00000d40  6d 70 25 0d 04 ba 2a 73  70 24 3d a4 57 69 6d 70  |mp%...*sp$=.Wimp|
00000d50  5f 47 65 74 53 74 72 69  6e 67 41 74 41 64 64 72  |_GetStringAtAddr|
00000d60  65 73 73 28 77 69 6d 70  25 21 32 38 29 0d 04 c4  |ess(wimp%!28)...|
00000d70  1f c8 99 20 22 57 69 6d  70 5f 44 65 6c 65 74 65  |... "Wimp_Delete|
00000d80  49 63 6f 6e 22 2c 2c 77  69 6d 70 25 0d 04 ce 11  |Icon",,wimp%....|
00000d90  c8 8e 20 73 70 72 69 74  65 73 25 20 ca 0d 04 d8  |.. sprites% ....|
00000da0  17 c9 20 31 20 20 20 20  3a 20 77 69 6d 70 25 21  |.. 1    : wimp%!|
00000db0  33 32 3d 31 0d 04 e2 07  7f 20 3a 0d 04 ec 2a c8  |32=1..... :...*.|
00000dc0  99 20 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |. "OS_SpriteOp",|
00000dd0  26 31 30 38 2c 73 70 72  69 74 65 73 25 20 b8 20  |&108,sprites% . |
00000de0  2c 2c 2c 6e 25 0d 04 f6  08 6a 25 3d 30 0d 05 00  |,,,n%....j%=0...|
00000df0  0d f5 20 3a 20 6a 25 2b  3d 31 0d 05 0a 37 c8 99  |.. : j%+=1...7..|
00000e00  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 26  | "OS_SpriteOp",&|
00000e10  31 30 44 2c 73 70 72 69  74 65 73 25 2c 70 6f 69  |10D,sprites%,poi|
00000e20  6e 74 65 72 5f 62 6c 6f  63 6b 25 2c 32 30 2c 6a  |nter_block%,20,j|
00000e30  25 0d 05 14 31 73 70 32  24 3d a4 57 69 6d 70 5f  |%...1sp2$=.Wimp_|
00000e40  47 65 74 53 74 72 69 6e  67 41 74 41 64 64 72 65  |GetStringAtAddre|
00000e50  73 73 28 70 6f 69 6e 74  65 72 5f 62 6c 6f 63 6b  |ss(pointer_block|
00000e60  25 29 0d 05 1e 16 fd 20  6a 25 3d 6e 25 20 84 20  |%)..... j%=n% . |
00000e70  73 70 24 3d 73 70 32 24  0d 05 28 2f e7 20 73 70  |sp$=sp2$..(/. sp|
00000e80  24 3d 73 70 32 24 20 8c  20 77 69 6d 70 25 21 33  |$=sp2$ . wimp%!3|
00000e90  32 3d 73 70 72 69 74 65  73 25 20 8b 20 77 69 6d  |2=sprites% . wim|
00000ea0  70 25 21 33 32 3d 31 0d  05 32 05 cb 0d 05 3c 0e  |p%!32=1..2....<.|
00000eb0  77 69 6d 70 25 21 34 3d  63 25 0d 05 46 2b c8 99  |wimp%!4=c%..F+..|
00000ec0  20 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  | "Wimp_CreateIco|
00000ed0  6e 22 2c 2c 77 69 6d 70  25 2b 34 20 b8 20 68 61  |n",,wimp%+4 . ha|
00000ee0  6e 64 6c 65 25 0d 05 50  09 69 25 2b 3d 34 0d 05  |ndle%..P.i%+=4..|
00000ef0  5a 13 fd 20 28 77 69 6d  70 25 21 69 25 29 3d 2d  |Z.. (wimp%!i%)=-|
00000f00  31 0d 05 64 05 cb 0d 05  6e 07 3d 63 25 0d 05 78  |1..d....n.=c%..x|
00000f10  05 3a 0d 05 82 1c dd 20  a4 57 69 6d 70 5f 49 63  |.:..... .Wimp_Ic|
00000f20  6f 6e 42 61 72 28 53 70  72 69 74 65 24 29 0d 05  |onBar(Sprite$)..|
00000f30  8c 0b ea 20 69 63 6f 6e  25 0d 05 96 0e 77 69 6d  |... icon%....wim|
00000f40  70 25 21 30 3d 2d 31 0d  05 a0 1d 77 69 6d 70 25  |p%!0=-1....wimp%|
00000f50  21 34 3d 30 20 20 20 20  20 3a 20 77 69 6d 70 25  |!4=0     : wimp%|
00000f60  21 38 3d 30 0d 05 aa 1d  77 69 6d 70 25 21 31 32  |!8=0....wimp%!12|
00000f70  3d 36 38 20 3a 20 77 69  6d 70 25 21 31 36 3d 36  |=68 : wimp%!16=6|
00000f80  38 0d 05 b4 12 77 69 6d  70 25 21 32 30 3d 26 33  |8....wimp%!20=&3|
00000f90  30 30 32 0d 05 be 17 24  28 77 69 6d 70 25 2b 32  |002....$(wimp%+2|
00000fa0  34 29 3d 53 70 72 69 74  65 24 0d 05 c8 27 c8 99  |4)=Sprite$...'..|
00000fb0  20 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  | "Wimp_CreateIco|
00000fc0  6e 22 2c 2c 77 69 6d 70  25 20 b8 20 69 63 6f 6e  |n",,wimp% . icon|
00000fd0  25 0d 05 d2 0a 3d 69 63  6f 6e 25 0d 05 dc 05 3a  |%....=icon%....:|
00000fe0  0d 05 e6 18 dd 20 f2 57  69 6d 70 5f 57 61 69 74  |..... .Wimp_Wait|
00000ff0  46 6f 72 45 76 65 6e 74  0d 05 f0 12 ea 20 6d 61  |ForEvent..... ma|
00001000  73 6b 25 2c 65 76 65 6e  74 25 0d 05 fa 0f 66 69  |sk%,event%....fi|
00001010  6e 69 73 68 65 64 25 3d  a3 0d 06 04 17 6d 61 73  |nished%=.....mas|
00001020  6b 25 3d 25 31 31 31 30  30 30 30 31 31 30 30 31  |k%=%111000011001|
00001030  0d 06 0e 05 f5 0d 06 18  26 c8 99 22 57 69 6d 70  |........&.."Wimp|
00001040  5f 50 6f 6c 6c 22 2c 6d  61 73 6b 25 2c 77 69 6d  |_Poll",mask%,wim|
00001050  70 25 20 b8 20 65 76 65  6e 74 25 0d 06 22 0f c8  |p% . event%.."..|
00001060  8e 20 65 76 65 6e 74 25  20 ca 0d 06 2c 08 c9 30  |. event% ...,..0|
00001070  20 3a 0d 06 36 1d c9 31  20 3a 20 f2 57 69 6d 70  | :..6..1 : .Wimp|
00001080  5f 50 6f 6c 6c 44 72 61  77 57 69 6e 64 6f 77 0d  |_PollDrawWindow.|
00001090  06 40 24 c9 32 20 3a 20  c8 99 20 22 57 69 6d 70  |.@$.2 : .. "Wimp|
000010a0  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 77 69  |_OpenWindow",,wi|
000010b0  6d 70 25 0d 06 4a 1e c9  33 20 3a 20 f2 57 69 6d  |mp%..J..3 : .Wim|
000010c0  70 5f 50 6f 6c 6c 43 6c  6f 73 65 57 69 6e 64 6f  |p_PollCloseWindo|
000010d0  77 0d 06 54 08 c9 34 20  3a 0d 06 5e 08 c9 35 20  |w..T..4 :..^..5 |
000010e0  3a 0d 06 68 1d c9 36 20  3a 20 f2 57 69 6d 70 5f  |:..h..6 : .Wimp_|
000010f0  50 6f 6c 6c 4d 6f 75 73  65 43 6c 69 63 6b 0d 06  |PollMouseClick..|
00001100  72 1e c9 37 20 3a 20 f2  57 69 6d 70 5f 50 6f 6c  |r..7 : .Wimp_Pol|
00001110  6c 53 61 76 65 4d 65 73  73 61 67 65 0d 06 7c 1b  |lSaveMessage..|.|
00001120  c9 38 20 3a 20 f2 57 69  6d 70 5f 50 6f 6c 6c 4b  |.8 : .Wimp_PollK|
00001130  65 79 50 72 65 73 73 0d  06 86 21 c9 39 20 3a 20  |eyPress...!.9 : |
00001140  f2 45 76 65 6e 74 5f 4d  65 6e 75 43 68 6f 69 63  |.Event_MenuChoic|
00001150  65 28 6d 65 6e 75 25 29  0d 06 90 08 c9 31 30 3a  |e(menu%).....10:|
00001160  0d 06 9a 08 c9 31 31 3a  0d 06 a4 08 c9 31 32 3a  |.....11:.....12:|
00001170  0d 06 ae 1e c9 31 37 2c  31 38 3a 20 f2 57 69 6d  |.....17,18: .Wim|
00001180  70 5f 50 6f 6c 6c 4d 65  73 73 61 67 65 73 0d 06  |p_PollMessages..|
00001190  b8 0c c9 31 39 3a f2 61  63 6b 0d 06 c2 05 cb 0d  |...19:.ack......|
000011a0  06 cc 0f fd 20 66 69 6e  69 73 68 65 64 25 0d 06  |.... finished%..|
000011b0  d6 05 e1 0d 06 e0 05 3a  0d 06 ea 1a dd 20 f2 57  |.......:..... .W|
000011c0  69 6d 70 5f 50 6f 6c 6c  44 72 61 77 57 69 6e 64  |imp_PollDrawWind|
000011d0  6f 77 0d 06 f4 0b ea 20  6d 6f 72 65 25 0d 06 fe  |ow..... more%...|
000011e0  26 c8 99 22 57 69 6d 70  5f 52 65 64 72 61 77 57  |&.."Wimp_RedrawW|
000011f0  69 6e 64 6f 77 22 2c 2c  77 69 6d 70 25 b8 6d 6f  |indow",,wimp%.mo|
00001200  72 65 25 0d 07 08 13 77  69 6e 64 6f 77 25 3d 77  |re%....window%=w|
00001210  69 6d 70 25 21 30 0d 07  12 15 77 69 6e 64 6f 77  |imp%!0....window|
00001220  5f 78 25 3d 77 69 6d 70  25 21 34 0d 07 1c 16 77  |_x%=wimp%!4....w|
00001230  69 6e 64 6f 77 5f 79 25  3d 77 69 6d 70 25 21 31  |indow_y%=wimp%!1|
00001240  36 0d 07 26 16 73 63 72  6f 6c 6c 5f 78 25 3d 77  |6..&.scroll_x%=w|
00001250  69 6d 70 25 21 32 30 0d  07 30 16 73 63 72 6f 6c  |imp%!20..0.scrol|
00001260  6c 5f 79 25 3d 77 69 6d  70 25 21 32 34 0d 07 3a  |l_y%=wimp%!24..:|
00001270  21 78 5f 6f 72 69 67 69  6e 25 3d 77 69 6e 64 6f  |!x_origin%=windo|
00001280  77 5f 78 25 2d 73 63 72  6f 6c 6c 5f 78 25 0d 07  |w_x%-scroll_x%..|
00001290  44 21 79 5f 6f 72 69 67  69 6e 25 3d 77 69 6e 64  |D!y_origin%=wind|
000012a0  6f 77 5f 79 25 2d 73 63  72 6f 6c 6c 5f 79 25 0d  |ow_y%-scroll_y%.|
000012b0  07 4e 0c c8 95 20 6d 6f  72 65 25 0d 07 58 2f e7  |.N... more%..X/.|
000012c0  20 69 6e 74 65 72 66 61  63 65 25 20 8c 20 c8 99  | interface% . ..|
000012d0  22 57 69 6d 70 5f 42 6f  72 64 65 72 57 69 6e 64  |"Wimp_BorderWind|
000012e0  6f 77 22 2c 2c 77 69 6d  70 25 0d 07 62 2c f2 45  |ow",,wimp%..b,.E|
000012f0  76 65 6e 74 5f 44 72 61  77 28 77 69 6e 64 6f 77  |vent_Draw(window|
00001300  25 2c 78 5f 6f 72 69 67  69 6e 25 2c 79 5f 6f 72  |%,x_origin%,y_or|
00001310  69 67 69 6e 25 29 0d 07  6c 26 c8 99 22 57 69 6d  |igin%)..l&.."Wim|
00001320  70 5f 47 65 74 52 65 63  74 61 6e 67 6c 65 22 2c  |p_GetRectangle",|
00001330  2c 77 69 6d 70 25 b8 6d  6f 72 65 25 0d 07 76 05  |,wimp%.more%..v.|
00001340  ce 0d 07 80 05 e1 0d 07  8a 1a dd 20 a4 45 76 65  |........... .Eve|
00001350  6e 74 5f 53 61 76 65 28  77 69 6e 64 6f 77 25 29  |nt_Save(window%)|
00001360  0d 07 94 10 c8 8e 20 77  69 6e 64 6f 77 25 20 ca  |...... window% .|
00001370  0d 07 9e 12 c9 20 73 61  76 65 62 6f 78 25 20 3a  |..... savebox% :|
00001380  3d b9 0d 07 a8 09 7f 20  3a 3d a3 0d 07 b2 05 cb  |=...... :=......|
00001390  0d 07 bc 05 3a 0d 07 c6  26 dd 20 a4 45 76 65 6e  |....:...&. .Even|
000013a0  74 5f 53 70 72 69 74 65  73 28 77 69 6e 64 6f 77  |t_Sprites(window|
000013b0  25 29 3d 73 70 72 69 74  65 73 25 0d 07 d0 05 3a  |%)=sprites%....:|
000013c0  0d 07 da 13 dd 20 f2 43  72 65 61 74 65 5f 4d 65  |..... .Create_Me|
000013d0  6e 75 73 0d 07 e4 4a 42  61 72 5f 4d 65 6e 75 25  |nus...JBar_Menu%|
000013e0  3d a4 57 69 6d 70 5f 4d  65 6e 75 43 72 65 61 74  |=.Wimp_MenuCreat|
000013f0  65 28 22 43 61 76 65 72  6e 45 64 5c 49 6e 66 6f  |e("CavernEd\Info|
00001400  3e 69 6e 66 6f 62 6f 78  25 5c 49 6e 73 74 72 75  |>infobox%\Instru|
00001410  63 74 69 6f 6e 73 5c 51  75 69 74 22 29 0d 07 ee  |ctions\Quit")...|
00001420  2e 6d 65 6e 75 24 3d 22  53 63 72 65 65 6e 5c 49  |.menu$="Screen\I|
00001430  6e 66 6f 3e 69 6e 66 6f  62 6f 78 25 5c 53 61 76  |nfo>infobox%\Sav|
00001440  65 3e 73 61 76 65 62 6f  78 25 22 0d 07 f8 28 53  |e>savebox%"...(S|
00001450  63 72 65 65 6e 5f 4d 65  6e 75 25 3d a4 57 69 6d  |creen_Menu%=.Wim|
00001460  70 5f 4d 65 6e 75 43 72  65 61 74 65 28 6d 65 6e  |p_MenuCreate(men|
00001470  75 24 29 0d 08 02 05 e1  0d 08 0c 05 3a 0d 08 16  |u$).........:...|
00001480  1a dd 20 a4 45 76 65 6e  74 5f 4d 65 6e 75 28 77  |.. .Event_Menu(w|
00001490  69 6e 64 6f 77 25 29 0d  08 20 10 c8 8e 20 77 69  |indow%).. ... wi|
000014a0  6e 64 6f 77 25 20 ca 0d  08 2a 1e c9 20 42 61 72  |ndow% ...*.. Bar|
000014b0  5f 57 69 6e 64 6f 77 25  20 3a 20 3d 42 61 72 5f  |_Window% : =Bar_|
000014c0  4d 65 6e 75 25 0d 08 34  21 c9 20 73 63 72 65 65  |Menu%..4!. scree|
000014d0  6e 25 20 20 20 20 20 3a  20 3d 53 63 72 65 65 6e  |n%     : =Screen|
000014e0  5f 4d 65 6e 75 25 0d 08  3e 11 7f 20 20 20 20 20  |_Menu%..>..     |
000014f0  20 20 20 3a 20 3d a3 0d  08 48 05 cb 0d 08 52 05  |   : =...H....R.|
00001500  3a 0d 08 5c 2a dd 20 f2  45 76 65 6e 74 5f 57 69  |:..\*. .Event_Wi|
00001510  6e 64 6f 77 43 6c 6f 73  65 28 77 69 6e 64 6f 77  |ndowClose(window|
00001520  25 2c 62 75 74 74 6f 6e  73 25 29 0d 08 66 10 c8  |%,buttons%)..f..|
00001530  8e 20 77 69 6e 64 6f 77  25 20 ca 0d 08 70 0d c9  |. window% ...p..|
00001540  20 73 63 72 65 65 6e 25  0d 08 7a 1b 6d 61 69 6e  | screen%..z.main|
00001550  25 3d 30 3a 69 63 6f 6e  77 25 3d 30 3a 6d 61 70  |%=0:iconw%=0:map|
00001560  25 3d 30 0d 08 84 1d f2  57 69 6d 70 5f 57 69 6e  |%=0.....Wimp_Win|
00001570  64 6f 77 43 6c 6f 73 65  28 49 63 6f 6e 73 25 29  |dowClose(Icons%)|
00001580  0d 08 8e 1b f2 57 69 6d  70 5f 57 69 6e 64 6f 77  |.....Wimp_Window|
00001590  43 6c 6f 73 65 28 4d 61  70 25 29 0d 08 98 21 f2  |Close(Map%)...!.|
000015a0  57 69 6d 70 5f 57 69 6e  64 6f 77 43 6c 6f 73 65  |Wimp_WindowClose|
000015b0  28 74 65 6c 65 70 6f 72  74 73 25 29 0d 08 a2 1f  |(teleports%)....|
000015c0  74 65 6c 65 5f 6f 70 65  6e 3d a3 3a f4 20 62 69  |tele_open=.:. bi|
000015d0  74 63 68 69 6e 67 3d 54  52 55 45 0d 08 ac 05 cb  |tching=TRUE.....|
000015e0  0d 08 b6 05 e1 0d 08 c0  05 3a 0d 08 ca 2e dd 20  |.........:..... |
000015f0  f2 45 76 65 6e 74 5f 44  72 61 77 28 77 69 6e 64  |.Event_Draw(wind|
00001600  6f 77 25 2c 78 5f 6f 72  69 67 69 6e 25 2c 79 5f  |ow%,x_origin%,y_|
00001610  6f 72 69 67 69 6e 25 29  0d 08 d4 10 c8 8e 20 77  |origin%)...... w|
00001620  69 6e 64 6f 77 25 20 ca  0d 08 de 2b c9 20 73 63  |indow% ....+. sc|
00001630  72 65 65 6e 25 20 20 20  20 20 20 3a 20 f2 55 73  |reen%      : .Us|
00001640  65 72 5f 44 72 61 77 53  63 72 65 65 6e 57 69 6e  |er_DrawScreenWin|
00001650  64 6f 77 0d 08 e8 05 cb  0d 08 f2 05 e1 0d 08 fc  |dow.............|
00001660  05 3a 0d 09 06 0f dd 20  f2 70 69 78 74 72 61 6e  |.:..... .pixtran|
00001670  73 0d 09 10 1d e3 20 63  6f 6c 25 3d 30 20 b8 20  |s..... col%=0 . |
00001680  31 35 3a 72 67 62 25 3d  70 61 6c 25 21 32 0d 09  |15:rgb%=pal%!2..|
00001690  1a 35 c8 99 22 43 6f 6c  6f 75 72 54 72 61 6e 73  |.5.."ColourTrans|
000016a0  5f 52 65 74 75 72 6e 43  6f 6c 6f 75 72 4e 75 6d  |_ReturnColourNum|
000016b0  62 65 72 22 2c 72 67 62  25 20 b8 20 63 6f 6c 6f  |ber",rgb% . colo|
000016c0  75 72 25 0d 09 24 27 3f  28 70 69 78 74 72 61 6e  |ur%..$'?(pixtran|
000016d0  73 25 2b 63 6f 6c 25 29  3d 63 6f 6c 6f 75 72 25  |s%+col%)=colour%|
000016e0  3a 70 61 6c 25 2b 3d 36  3a ed 0d 09 2e 05 e1 0d  |:pal%+=6:.......|
000016f0  09 38 05 3a 0d 09 42 1c  dd 20 f2 55 73 65 72 5f  |.8.:..B.. .User_|
00001700  44 72 61 77 53 63 72 65  65 6e 57 69 6e 64 6f 77  |DrawScreenWindow|
00001710  0d 09 4c 35 24 74 69 74  6c 65 25 3d 22 4d 61 70  |..L5$title%="Map|
00001720  20 28 22 2b c3 28 73 63  72 65 65 6e 5f 78 25 29  | ("+.(screen_x%)|
00001730  2b 22 2c 22 2b c3 28 73  63 72 65 65 6e 5f 79 25  |+","+.(screen_y%|
00001740  29 2b 22 29 22 0d 09 56  46 c8 99 20 22 57 69 6d  |)+")"..VF.. "Wim|
00001750  70 5f 52 65 61 64 50 69  78 54 72 61 6e 73 22 2c  |p_ReadPixTrans",|
00001760  26 31 30 30 2c 73 70 72  69 74 65 73 25 2c 22 35  |&100,sprites%,"5|
00001770  22 2c 30 2c 30 2c 30 2c  73 63 61 6c 65 66 61 63  |",0,0,0,scalefac|
00001780  25 2c 70 69 78 74 72 61  6e 73 25 0d 09 60 20 73  |%,pixtrans%..` s|
00001790  63 61 6c 65 66 61 63 25  21 38 3d 31 3a 73 63 61  |calefac%!8=1:sca|
000017a0  6c 65 66 61 63 25 21 31  32 3d 31 0d 09 6a 0b 43  |lefac%!12=1..j.C|
000017b0  3d 30 3a 44 3d 30 0d 09  74 12 e3 20 59 3d 31 35  |=0:D=0..t.. Y=15|
000017c0  20 b8 20 30 20 88 2d 31  0d 09 7e 0e e3 20 58 3d  | . 0 .-1..~.. X=|
000017d0  30 20 b8 20 31 35 0d 09  88 27 61 24 3d 73 63 72  |0 . 15...'a$=scr|
000017e0  65 65 6e 24 28 73 63 72  65 65 6e 5f 78 25 2c 73  |een$(screen_x%,s|
000017f0  63 72 65 65 6e 5f 79 25  2c 58 2c 59 29 0d 09 92  |creen_y%,X,Y)...|
00001800  51 c8 99 26 32 45 2c 32  35 36 2b 35 32 2c 73 70  |Q..&2E,256+52,sp|
00001810  72 69 74 65 73 25 2c 61  24 2c 28 78 5f 6f 72 69  |rites%,a$,(x_ori|
00001820  67 69 6e 25 2b 43 29 2c  28 79 5f 6f 72 69 67 69  |gin%+C),(y_origi|
00001830  6e 25 2b 44 29 2d 33 32  2c 38 2c 73 63 61 6c 65  |n%+D)-32,8,scale|
00001840  66 61 63 25 2c 70 69 78  74 72 61 6e 73 25 0d 09  |fac%,pixtrans%..|
00001850  9c 09 43 2b 3d 36 34 0d  09 a6 05 ed 0d 09 b0 0d  |..C+=64.........|
00001860  43 3d 30 3a 44 2d 3d 33  32 0d 09 ba 05 ed 0d 09  |C=0:D-=32.......|
00001870  c4 3b f4 20 50 72 69 6e  74 20 22 74 65 6c 22 20  |.;. Print "tel" |
00001880  73 70 72 69 74 65 20 61  74 20 64 65 73 74 69 6e  |sprite at destin|
00001890  61 74 69 6f 6e 20 6f 66  20 63 75 72 72 65 6e 74  |ation of current|
000018a0  20 74 65 6c 65 70 6f 72  74 0d 09 ce 11 e7 20 74  | teleport..... t|
000018b0  65 6c 65 5f 6f 70 65 6e  20 8c 0d 09 d8 80 c8 99  |ele_open .......|
000018c0  26 32 45 2c 32 35 36 2b  35 32 2c 73 70 72 69 74  |&2E,256+52,sprit|
000018d0  65 73 25 2c 22 74 65 6c  22 2c 28 78 5f 6f 72 69  |es%,"tel",(x_ori|
000018e0  67 69 6e 25 2b 28 74 65  6c 65 74 6f 78 28 72 65  |gin%+(teletox(re|
000018f0  66 65 72 65 6e 63 65 29  29 2a 36 34 29 2c 28 79  |ference))*64),(y|
00001900  5f 6f 72 69 67 69 6e 25  2d 28 31 36 2d 74 65 6c  |_origin%-(16-tel|
00001910  65 74 6f 79 28 72 65 66  65 72 65 6e 63 65 29 29  |etoy(reference))|
00001920  2a 33 32 29 2c 38 2c 73  63 61 6c 65 66 61 63 25  |*32),8,scalefac%|
00001930  2c 70 69 78 74 72 61 6e  73 25 0d 09 e2 05 cd 0d  |,pixtrans%......|
00001940  09 ec 05 e1 0d 09 f6 05  3a 0d 0a 00 34 dd 20 f2  |........:...4. .|
00001950  45 76 65 6e 74 5f 4d 6f  75 73 65 43 6c 69 63 6b  |Event_MouseClick|
00001960  28 77 69 6e 64 6f 77 25  2c 69 63 6f 6e 25 2c 62  |(window%,icon%,b|
00001970  75 74 74 6f 6e 25 2c 78  25 2c 79 25 29 0d 0a 0a  |utton%,x%,y%)...|
00001980  10 c8 8e 20 77 69 6e 64  6f 77 25 20 ca 0d 0a 14  |... window% ....|
00001990  22 c9 20 42 61 72 5f 57  69 6e 64 6f 77 25 20 3a  |". Bar_Window% :|
000019a0  20 f2 55 73 65 72 5f 4d  6f 75 73 65 42 61 72 0d  | .User_MouseBar.|
000019b0  0a 1e 35 c9 20 63 68 65  63 6b 65 72 25 20 20 20  |..5. checker%   |
000019c0  20 3a 20 f2 55 73 65 72  5f 4d 6f 75 73 65 63 68  | : .User_Mousech|
000019d0  65 63 6b 65 72 28 62 75  74 74 6f 6e 25 2c 69 63  |ecker(button%,ic|
000019e0  6f 6e 25 29 0d 0a 28 34  c9 20 73 63 72 65 65 6e  |on%)..(4. screen|
000019f0  25 20 20 20 20 20 3a 20  f2 55 73 65 72 5f 4d 6f  |%     : .User_Mo|
00001a00  75 73 65 53 63 72 65 65  6e 28 62 75 74 74 6f 6e  |useScreen(button|
00001a10  25 2c 69 63 6f 6e 25 29  0d 0a 32 33 c9 20 49 63  |%,icon%)..23. Ic|
00001a20  6f 6e 73 25 20 20 20 20  20 20 3a 20 f2 55 73 65  |ons%      : .Use|
00001a30  72 5f 4d 6f 75 73 65 69  63 6f 6e 73 28 62 75 74  |r_Mouseicons(but|
00001a40  74 6f 6e 25 2c 69 63 6f  6e 25 29 0d 0a 3c 2e c9  |ton%,icon%)..<..|
00001a50  20 4d 61 70 25 20 20 20  20 20 3a 20 f2 55 73 65  | Map%     : .Use|
00001a60  72 5f 4d 6f 75 73 65 6d  61 70 28 62 75 74 74 6f  |r_Mousemap(butto|
00001a70  6e 25 2c 69 63 6f 6e 25  29 0d 0a 46 37 c9 20 74  |n%,icon%)..F7. t|
00001a80  65 6c 65 70 6f 72 74 73  25 20 20 3a 20 f2 55 73  |eleports%  : .Us|
00001a90  65 72 5f 4d 6f 75 73 65  74 65 6c 65 70 6f 72 74  |er_Mouseteleport|
00001aa0  73 28 62 75 74 74 6f 6e  25 2c 69 63 6f 6e 25 29  |s(button%,icon%)|
00001ab0  0d 0a 50 05 cb 0d 0a 5a  05 e1 0d 0a 64 05 3a 0d  |..P....Z....d.:.|
00001ac0  0a 6e 14 dd 20 f2 55 73  65 72 5f 4d 6f 75 73 65  |.n.. .User_Mouse|
00001ad0  42 61 72 0d 0a 78 18 e7  20 6d 61 69 6e 25 3d 31  |Bar..x.. main%=1|
00001ae0  20 84 20 73 61 76 65 3d  a3 20 8c 0d 0a 82 23 f2  | . save=. ....#.|
00001af0  57 69 6d 70 5f 57 69 6e  64 6f 77 42 72 69 6e 67  |Wimp_WindowBring|
00001b00  54 6f 54 6f 70 28 73 63  72 65 65 6e 25 29 0d 0a  |ToTop(screen%)..|
00001b10  8c 22 f2 57 69 6d 70 5f  57 69 6e 64 6f 77 46 6f  |.".Wimp_WindowFo|
00001b20  72 63 65 44 72 61 77 28  73 63 72 65 65 6e 25 29  |rceDraw(screen%)|
00001b30  0d 0a 96 05 cc 0d 0a a0  23 f2 57 69 6d 70 5f 57  |........#.Wimp_W|
00001b40  69 6e 64 6f 77 42 72 69  6e 67 54 6f 54 6f 70 28  |indowBringToTop(|
00001b50  73 63 72 65 65 6e 25 29  0d 0a aa 0b 6d 61 69 6e  |screen%)....main|
00001b60  25 3d 31 0d 0a b4 05 cd  0d 0a be 2f e7 20 70 72  |%=1......../. pr|
00001b70  6f 74 65 63 74 25 3d 30  20 f2 57 69 6d 70 5f 57  |otect%=0 .Wimp_W|
00001b80  69 6e 64 6f 77 42 72 69  6e 67 54 6f 54 6f 70 28  |indowBringToTop(|
00001b90  49 63 6f 6e 73 25 29 0d  0a c8 21 f2 57 69 6d 70  |Icons%)...!.Wimp|
00001ba0  5f 57 69 6e 64 6f 77 42  72 69 6e 67 54 6f 54 6f  |_WindowBringToTo|
00001bb0  70 28 4d 61 70 25 29 3a  0d 0a d2 63 e7 20 62 69  |p(Map%):...c. bi|
00001bc0  74 63 68 69 6e 67 3d a3  20 f2 57 69 6d 70 5f 49  |tching=. .Wimp_I|
00001bd0  63 6f 6e 50 75 74 54 65  78 74 28 4d 61 70 25 2c  |conPutText(Map%,|
00001be0  30 2c 22 6d 61 70 64 6e  22 29 3a 62 69 74 63 68  |0,"mapdn"):bitch|
00001bf0  69 6e 67 3d b9 3a f4 20  53 65 74 20 6c 6f 77 65  |ing=.:. Set lowe|
00001c00  72 20 6c 65 66 74 20 69  63 6f 6e 20 64 6f 77 6e  |r left icon down|
00001c10  20 69 6e 20 6d 61 70 20  77 69 6e 0d 0a dc 05 e1  | in map win.....|
00001c20  0d 0a e6 05 3a 0d 0a f0  27 dd 20 f2 55 73 65 72  |....:...'. .User|
00001c30  5f 4d 6f 75 73 65 63 68  65 63 6b 65 72 28 62 75  |_Mousechecker(bu|
00001c40  74 74 6f 6e 25 2c 69 63  6f 6e 25 29 0d 0a fa 0f  |tton%,icon%)....|
00001c50  e7 20 69 63 6f 6e 25 3d  31 20 8c 0d 0b 04 0a 73  |. icon%=1 .....s|
00001c60  61 76 65 3d b9 0d 0b 0e  0a f2 75 6e 62 6f 78 0d  |ave=......unbox.|
00001c70  0b 18 1f f2 57 69 6d 70  5f 57 69 6e 64 6f 77 43  |....Wimp_WindowC|
00001c80  6c 6f 73 65 28 63 68 65  63 6b 65 72 25 29 0d 0b  |lose(checker%)..|
00001c90  22 0c 75 70 64 61 74 65  3d a3 0d 0b 2c 24 f2 57  |".update=...,$.W|
00001ca0  69 6d 70 5f 57 69 6e 64  6f 77 42 72 69 6e 67 54  |imp_WindowBringT|
00001cb0  6f 54 6f 70 28 73 61 76  65 62 6f 78 25 29 0d 0b  |oTop(savebox%)..|
00001cc0  36 21 41 24 3d a4 57 69  6d 70 5f 49 63 6f 6e 54  |6!A$=.Wimp_IconT|
00001cd0  65 78 74 28 73 61 76 65  62 6f 78 25 2c 31 29 0d  |ext(savebox%,1).|
00001ce0  0b 40 25 f2 57 69 6d 70  5f 49 63 6f 6e 43 61 72  |.@%.Wimp_IconCar|
00001cf0  65 74 28 73 61 76 65 62  6f 78 25 2c 31 2c a9 28  |et(savebox%,1,.(|
00001d00  41 24 29 29 0d 0b 4a 05  cd 0d 0b 54 0f e7 20 69  |A$))..J....T.. i|
00001d10  63 6f 6e 25 3d 32 20 8c  0d 0b 5e 0a f2 75 6e 62  |con%=2 ...^..unb|
00001d20  6f 78 0d 0b 68 0c 75 70  64 61 74 65 3d a3 0d 0b  |ox..h.update=...|
00001d30  72 1f f2 57 69 6d 70 5f  57 69 6e 64 6f 77 43 6c  |r..Wimp_WindowCl|
00001d40  6f 73 65 28 63 68 65 63  6b 65 72 25 29 0d 0b 7c  |ose(checker%)..||
00001d50  09 43 44 25 3d b9 0d 0b  86 05 cd 0d 0b 90 36 e7  |.CD%=.........6.|
00001d60  20 69 63 6f 6e 25 3d 33  20 8c 20 f4 20 41 64 64  | icon%=3 . . Add|
00001d70  20 72 6f 75 74 69 6e 65  20 74 6f 20 63 61 6e 63  | routine to canc|
00001d80  65 6c 20 26 20 63 6c 6f  73 65 20 77 69 6e 64 6f  |el & close windo|
00001d90  77 0d 0b 9a 0a f2 75 6e  62 6f 78 0d 0b a4 1f f2  |w.....unbox.....|
00001da0  57 69 6d 70 5f 57 69 6e  64 6f 77 43 6c 6f 73 65  |Wimp_WindowClose|
00001db0  28 63 68 65 63 6b 65 72  25 29 0d 0b ae 05 cd 0d  |(checker%)......|
00001dc0  0b b8 1d e7 20 43 44 25  3d b9 20 8c 20 f2 57 69  |.... CD%=. . .Wi|
00001dd0  6d 70 5f 43 6c 6f 73 65  44 6f 77 6e 0d 0b c2 05  |mp_CloseDown....|
00001de0  e1 0d 0b cc 05 3a 0d 0b  d6 26 dd 20 f2 55 73 65  |.....:...&. .Use|
00001df0  72 5f 4d 6f 75 73 65 53  63 72 65 65 6e 28 62 75  |r_MouseScreen(bu|
00001e00  74 74 6f 6e 25 2c 69 63  6f 6e 25 29 0d 0b e0 1a  |tton%,icon%)....|
00001e10  e7 20 74 65 6c 65 5f 6f  70 65 6e 3a f2 63 6c 69  |. tele_open:.cli|
00001e20  63 6b 65 72 3a e1 0d 0b  ea 12 e7 20 70 72 6f 74  |cker:...... prot|
00001e30  65 63 74 25 20 8c 20 e1  0d 0b f4 10 c8 8e 20 62  |ect% . ....... b|
00001e40  75 74 74 6f 6e 25 20 ca  0d 0b fe 10 c9 20 34 3a  |utton% ...... 4:|
00001e50  73 24 3d 64 72 61 77 24  0d 0c 08 11 c9 20 31 3a  |s$=draw$..... 1:|
00001e60  73 24 3d 65 72 61 73 65  24 0d 0c 12 05 cb 0d 0c  |s$=erase$.......|
00001e70  1c 0c 75 70 64 61 74 65  3d b9 0d 0c 26 19 6d 78  |..update=...&.mx|
00001e80  3d 77 69 6d 70 25 21 30  3a 6d 79 3d 77 69 6d 70  |=wimp%!0:my=wimp|
00001e90  25 21 34 0d 0c 30 32 21  77 69 6d 70 25 3d 73 63  |%!4..02!wimp%=sc|
00001ea0  72 65 65 6e 25 3a c8 99  20 22 57 69 6d 70 5f 47  |reen%:.. "Wimp_G|
00001eb0  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00001ec0  77 69 6d 70 25 0d 0c 3a  1c 6d 78 3d 28 6d 78 2d  |wimp%..:.mx=(mx-|
00001ed0  77 69 6d 70 25 21 34 2b  77 69 6d 70 25 21 32 30  |wimp%!4+wimp%!20|
00001ee0  29 0d 0c 44 1e 6d 79 3d  2d 28 6d 79 2d 77 69 6d  |)..D.my=-(my-wim|
00001ef0  70 25 21 31 36 2b 77 69  6d 70 25 21 32 34 29 0d  |p%!16+wimp%!24).|
00001f00  0c 4e 19 6d 78 3d 6d 78  20 81 20 36 34 3a 6d 79  |.N.mx=mx . 64:my|
00001f10  3d 6d 79 20 81 20 33 32  0d 0c 58 18 e7 20 6d 79  |=my . 32..X.. my|
00001f20  3e 36 33 20 84 20 6d 78  3e 31 32 37 20 8c 20 e1  |>63 . mx>127 . .|
00001f30  0d 0c 62 41 e7 20 73 24  3d 22 37 22 3a e7 20 73  |..bA. s$="7":. s|
00001f40  63 72 65 65 6e 24 28 73  63 72 65 65 6e 5f 78 25  |creen$(screen_x%|
00001f50  2c 73 63 72 65 65 6e 5f  79 25 2c 6d 78 2c 28 31  |,screen_y%,mx,(1|
00001f60  35 2d 6d 79 29 29 3d 22  37 22 3a f2 74 65 6c 3a  |5-my))="7":.tel:|
00001f70  e1 0d 0c 6c 0b c8 8e 20  73 24 20 ca 0d 0c 76 20  |...l... s$ ...v |
00001f80  c9 20 22 37 22 20 3a 20  f4 20 53 74 61 69 72 63  |. "7" : . Stairc|
00001f90  61 73 65 20 74 65 6c 65  70 6f 72 74 0d 0c 80 3a  |ase teleport...:|
00001fa0  f4 20 4c 6f 63 61 74 69  6f 6e 20 64 65 74 61 69  |. Location detai|
00001fb0  6c 73 20 6e 6f 77 20 66  69 78 65 64 20 69 6e 74  |ls now fixed int|
00001fc0  6f 20 74 65 6c 65 70 6f  72 74 20 69 6e 66 6f 20  |o teleport info |
00001fd0  77 69 6e 64 6f 77 0d 0c  8a 12 66 6f 75 6e 64 25  |window....found%|
00001fe0  3d 30 3a 72 65 66 3d 30  0d 0c 94 11 e3 20 66 69  |=0:ref=0..... fi|
00001ff0  6e 64 3d 30 20 b8 20 32  30 0d 0c 9e 2f e7 20 61  |nd=0 . 20.../. a|
00002000  63 74 69 76 28 66 69 6e  64 29 3d 30 20 8c 20 66  |ctiv(find)=0 . f|
00002010  6f 75 6e 64 25 3d 31 3a  72 65 66 3d 66 69 6e 64  |ound%=1:ref=find|
00002020  3a 66 69 6e 64 3d 32 30  0d 0c a8 05 ed 0d 0c b2  |:find=20........|
00002030  15 e7 20 66 6f 75 6e 64  25 3d 30 20 8c 20 ef 37  |.. found%=0 . .7|
00002040  3a e1 0d 0c bc 1c 74 65  6c 65 74 6f 73 63 78 28  |:.....teletoscx(|
00002050  72 65 66 29 3d 73 63 72  65 65 6e 5f 78 25 0d 0c  |ref)=screen_x%..|
00002060  c6 1c 74 65 6c 65 74 6f  73 63 79 28 72 65 66 29  |..teletoscy(ref)|
00002070  3d 73 63 72 65 65 6e 5f  79 25 0d 0c d0 13 74 65  |=screen_y%....te|
00002080  6c 65 74 6f 78 28 72 65  66 29 3d 6d 78 0d 0c da  |letox(ref)=mx...|
00002090  18 74 65 6c 65 74 6f 79  28 72 65 66 29 3d 28 31  |.teletoy(ref)=(1|
000020a0  35 2d 6d 79 29 0d 0c e4  17 74 73 63 78 28 72 65  |5-my)....tscx(re|
000020b0  66 29 3d 73 63 72 65 65  6e 5f 78 25 0d 0c ee 17  |f)=screen_x%....|
000020c0  74 73 63 79 28 72 65 66  29 3d 73 63 72 65 65 6e  |tscy(ref)=screen|
000020d0  5f 79 25 0d 0c f8 0e 74  78 28 72 65 66 29 3d 6d  |_y%....tx(ref)=m|
000020e0  78 0d 0d 02 13 74 79 28  72 65 66 29 3d 28 31 35  |x....ty(ref)=(15|
000020f0  2d 6d 79 29 0d 0d 0c 10  61 63 74 69 76 28 72 65  |-my)....activ(re|
00002100  66 29 3d 31 0d 0d 16 2d  74 65 6c 65 6e 75 6d 25  |f)=1...-telenum%|
00002110  2b 3d 31 3a 64 65 66 69  6e 65 64 2b 3d 31 3a e7  |+=1:defined+=1:.|
00002120  20 74 65 6c 65 6e 75 6d  25 3e 32 30 3a ef 37 3a  | telenum%>20:.7:|
00002130  e1 0d 0d 20 19 c9 20 22  31 37 22 3a f4 20 47 72  |... .. "17":. Gr|
00002140  65 65 6e 20 70 6c 61 79  65 72 0d 0d 2a 37 e7 20  |een player..*7. |
00002150  73 63 72 65 65 6e 24 28  73 63 72 65 65 6e 5f 78  |screen$(screen_x|
00002160  25 2c 73 63 72 65 65 6e  5f 79 25 2c 6d 78 2c 28  |%,screen_y%,mx,(|
00002170  31 35 2d 6d 79 29 29 3d  22 31 38 22 3a ef 37 3a  |15-my))="18":.7:|
00002180  e1 0d 0d 34 3d e7 20 73  63 72 65 65 6e 24 28 73  |...4=. screen$(s|
00002190  63 72 65 65 6e 5f 78 25  2c 73 63 72 65 65 6e 5f  |creen_x%,screen_|
000021a0  79 25 2c 6d 78 2c 28 31  35 2d 6d 79 29 29 3d 22  |y%,mx,(15-my))="|
000021b0  30 22 20 20 8c 20 3a 20  8b 20 ef 37 3a e1 0d 0d  |0"  . : . .7:...|
000021c0  3e 38 e7 20 67 72 65 65  6e 3a 73 63 72 65 65 6e  |>8. green:screen|
000021d0  24 28 79 73 63 78 28 31  29 2c 79 73 63 79 28 31  |$(yscx(1),yscy(1|
000021e0  29 2c 79 6f 75 78 28 31  29 2c 79 6f 75 79 28 31  |),youx(1),youy(1|
000021f0  29 29 3d 22 30 22 0d 0d  48 22 f2 57 69 6d 70 5f  |))="0"..H".Wimp_|
00002200  57 69 6e 64 6f 77 46 6f  72 63 65 44 72 61 77 28  |WindowForceDraw(|
00002210  73 63 72 65 65 6e 25 29  0d 0d 52 15 79 73 63 78  |screen%)..R.yscx|
00002220  28 31 29 3d 73 63 72 65  65 6e 5f 78 25 0d 0d 5c  |(1)=screen_x%..\|
00002230  15 79 73 63 79 28 31 29  3d 73 63 72 65 65 6e 5f  |.yscy(1)=screen_|
00002240  79 25 0d 0d 66 0e 79 6f  75 78 28 31 29 3d 6d 78  |y%..f.youx(1)=mx|
00002250  0d 0d 70 1b 79 6f 75 79  28 31 29 3d 28 31 35 2d  |..p.youy(1)=(15-|
00002260  6d 79 29 3a 67 72 65 65  6e 3d b9 0d 0d 7a 17 c9  |my):green=...z..|
00002270  20 22 31 38 22 3a f4 20  52 65 64 20 70 6c 61 79  | "18":. Red play|
00002280  65 72 0d 0d 84 37 e7 20  73 63 72 65 65 6e 24 28  |er...7. screen$(|
00002290  73 63 72 65 65 6e 5f 78  25 2c 73 63 72 65 65 6e  |screen_x%,screen|
000022a0  5f 79 25 2c 6d 78 2c 28  31 35 2d 6d 79 29 29 3d  |_y%,mx,(15-my))=|
000022b0  22 31 37 22 3a ef 37 3a  e1 0d 0d 8e 3d e7 20 73  |"17":.7:....=. s|
000022c0  63 72 65 65 6e 24 28 73  63 72 65 65 6e 5f 78 25  |creen$(screen_x%|
000022d0  2c 73 63 72 65 65 6e 5f  79 25 2c 6d 78 2c 28 31  |,screen_y%,mx,(1|
000022e0  35 2d 6d 79 29 29 3d 22  30 22 20 20 8c 20 3a 20  |5-my))="0"  . : |
000022f0  8b 20 ef 37 3a e1 0d 0d  98 36 e7 20 72 65 64 3a  |. .7:....6. red:|
00002300  73 63 72 65 65 6e 24 28  79 73 63 78 28 32 29 2c  |screen$(yscx(2),|
00002310  79 73 63 79 28 32 29 2c  79 6f 75 78 28 32 29 2c  |yscy(2),youx(2),|
00002320  79 6f 75 79 28 32 29 29  3d 22 30 22 0d 0d a2 22  |youy(2))="0"..."|
00002330  f2 57 69 6d 70 5f 57 69  6e 64 6f 77 46 6f 72 63  |.Wimp_WindowForc|
00002340  65 44 72 61 77 28 73 63  72 65 65 6e 25 29 0d 0d  |eDraw(screen%)..|
00002350  ac 15 79 73 63 78 28 32  29 3d 73 63 72 65 65 6e  |..yscx(2)=screen|
00002360  5f 78 25 0d 0d b6 15 79  73 63 79 28 32 29 3d 73  |_x%....yscy(2)=s|
00002370  63 72 65 65 6e 5f 79 25  0d 0d c0 0e 79 6f 75 78  |creen_y%....youx|
00002380  28 32 29 3d 6d 78 0d 0d  ca 19 79 6f 75 79 28 32  |(2)=mx....youy(2|
00002390  29 3d 28 31 35 2d 6d 79  29 3a 72 65 64 3d b9 0d  |)=(15-my):red=..|
000023a0  0d d4 05 cb 0d 0d de 30  c8 8e 20 73 63 72 65 65  |.......0.. scree|
000023b0  6e 24 28 73 63 72 65 65  6e 5f 78 25 2c 73 63 72  |n$(screen_x%,scr|
000023c0  65 65 6e 5f 79 25 2c 6d  78 2c 28 31 35 2d 6d 79  |een_y%,mx,(15-my|
000023d0  29 29 20 ca 0d 0d e8 1b  c9 20 22 37 22 3a f2 65  |)) ...... "7":.e|
000023e0  72 61 73 65 5f 74 65 6c  65 70 6f 72 74 65 72 0d  |rase_teleporter.|
000023f0  0d f2 12 c9 20 22 31 37  22 3a 67 72 65 65 6e 3d  |.... "17":green=|
00002400  a3 0d 0d fc 10 c9 20 22  31 38 22 3a 72 65 64 3d  |...... "18":red=|
00002410  a3 0d 0e 06 05 cb 0d 0e  10 2e 73 63 72 65 65 6e  |..........screen|
00002420  24 28 73 63 72 65 65 6e  5f 78 25 2c 73 63 72 65  |$(screen_x%,scre|
00002430  65 6e 5f 79 25 2c 6d 78  2c 28 31 35 2d 6d 79 29  |en_y%,mx,(15-my)|
00002440  29 3d 73 24 0d 0e 1a 45  c8 99 20 22 57 69 6d 70  |)=s$...E.. "Wimp|
00002450  5f 46 6f 72 63 65 52 65  64 72 61 77 22 2c 73 63  |_ForceRedraw",sc|
00002460  72 65 65 6e 25 2c 6d 78  2a 36 34 2c 2d 28 6d 79  |reen%,mx*64,-(my|
00002470  2b 31 29 2a 33 32 2c 28  6d 78 2b 31 29 2a 36 34  |+1)*32,(mx+1)*64|
00002480  2c 2d 28 6d 79 29 2a 33  32 0d 0e 24 05 e1 0d 0e  |,-(my)*32..$....|
00002490  2e 05 3a 0d 0e 38 0e dd  20 f2 63 6c 69 63 6b 65  |..:..8.. .clicke|
000024a0  72 0d 0e 42 19 6d 78 3d  77 69 6d 70 25 21 30 3a  |r..B.mx=wimp%!0:|
000024b0  6d 79 3d 77 69 6d 70 25  21 34 0d 0e 4c 32 21 77  |my=wimp%!4..L2!w|
000024c0  69 6d 70 25 3d 73 63 72  65 65 6e 25 3a c8 99 20  |imp%=screen%:.. |
000024d0  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |"Wimp_GetWindowS|
000024e0  74 61 74 65 22 2c 2c 77  69 6d 70 25 0d 0e 56 1c  |tate",,wimp%..V.|
000024f0  6d 78 3d 28 6d 78 2d 77  69 6d 70 25 21 34 2b 77  |mx=(mx-wimp%!4+w|
00002500  69 6d 70 25 21 32 30 29  0d 0e 60 1e 6d 79 3d 2d  |imp%!20)..`.my=-|
00002510  28 6d 79 2d 77 69 6d 70  25 21 31 36 2b 77 69 6d  |(my-wimp%!16+wim|
00002520  70 25 21 32 34 29 0d 0e  6a 19 6d 78 3d 6d 78 20  |p%!24)..j.mx=mx |
00002530  81 20 36 34 3a 6d 79 3d  6d 79 20 81 20 33 32 0d  |. 64:my=my . 32.|
00002540  0e 74 18 e7 20 6d 79 3e  36 33 20 84 20 6d 78 3e  |.t.. my>63 . mx>|
00002550  31 32 37 20 8c 20 e1 0d  0e 7e 19 74 65 6c 65 74  |127 . ...~.telet|
00002560  6f 78 28 72 65 66 65 72  65 6e 63 65 29 3d 6d 78  |ox(reference)=mx|
00002570  0d 0e 88 1e 74 65 6c 65  74 6f 79 28 72 65 66 65  |....teletoy(refe|
00002580  72 65 6e 63 65 29 3d 28  31 35 2d 6d 79 29 0d 0e  |rence)=(15-my)..|
00002590  92 61 f4 20 63 24 3d 73  63 72 65 65 6e 24 28 74  |.a. c$=screen$(t|
000025a0  65 6c 65 74 6f 73 63 78  28 72 65 66 65 72 65 6e  |eletoscx(referen|
000025b0  63 65 29 2c 74 65 6c 65  74 6f 73 63 79 28 72 65  |ce),teletoscy(re|
000025c0  66 65 72 65 6e 63 65 29  2c 74 65 6c 65 74 6f 78  |ference),teletox|
000025d0  28 72 65 66 65 72 65 6e  63 65 29 2c 74 65 6c 65  |(reference),tele|
000025e0  74 6f 79 28 72 65 66 65  72 65 6e 63 65 29 29 0d  |toy(reference)).|
000025f0  0e 9c 39 f4 20 49 46 63  24 3d 22 31 22 20 4f 52  |..9. IFc$="1" OR|
00002600  20 63 24 3d 22 32 22 20  4f 52 20 63 24 3d 22 33  | c$="2" OR c$="3|
00002610  22 20 4f 52 20 63 24 3d  22 34 22 20 56 44 55 37  |" OR c$="4" VDU7|
00002620  3a 45 4e 44 50 52 4f 43  0d 0e a6 0c 75 70 64 61  |:ENDPROC....upda|
00002630  74 65 3d b9 0d 0e b0 39  f2 57 69 6d 70 5f 49 63  |te=....9.Wimp_Ic|
00002640  6f 6e 50 75 74 54 65 78  74 28 74 65 6c 65 70 6f  |onPutText(telepo|
00002650  72 74 73 25 2c 38 2c c3  28 74 65 6c 65 74 6f 78  |rts%,8,.(teletox|
00002660  28 72 65 66 65 72 65 6e  63 65 29 29 29 0d 0e ba  |(reference)))...|
00002670  39 f2 57 69 6d 70 5f 49  63 6f 6e 50 75 74 54 65  |9.Wimp_IconPutTe|
00002680  78 74 28 74 65 6c 65 70  6f 72 74 73 25 2c 39 2c  |xt(teleports%,9,|
00002690  c3 28 74 65 6c 65 74 6f  79 28 72 65 66 65 72 65  |.(teletoy(refere|
000026a0  6e 63 65 29 29 29 0d 0e  c4 22 f2 57 69 6d 70 5f  |nce)))...".Wimp_|
000026b0  57 69 6e 64 6f 77 46 6f  72 63 65 44 72 61 77 28  |WindowForceDraw(|
000026c0  73 63 72 65 65 6e 25 29  0d 0e ce 1e f2 57 69 6d  |screen%).....Wim|
000026d0  70 5f 57 69 6e 64 6f 77  43 6c 6f 73 65 28 73 63  |p_WindowClose(sc|
000026e0  72 65 65 6e 25 29 0d 0e  d8 1d f2 57 69 6d 70 5f  |reen%).....Wimp_|
000026f0  57 69 6e 64 6f 77 4f 70  65 6e 28 73 63 72 65 65  |WindowOpen(scree|
00002700  6e 25 29 0d 0e e2 05 e1  0d 0e ec 05 3a 0d 0e f6  |n%).........:...|
00002710  0b dd 20 f2 72 75 62 31  0d 0f 00 2f 73 63 72 65  |.. .rub1.../scre|
00002720  65 6e 24 28 73 63 72 65  65 6e 5f 78 25 2c 73 63  |en$(screen_x%,sc|
00002730  72 65 65 6e 5f 79 25 2c  6d 78 2c 28 31 35 2d 6d  |reen_y%,mx,(15-m|
00002740  79 29 29 3d 22 30 22 0d  0f 0a 05 e1 0d 0f 14 0b  |y))="0".........|
00002750  dd 20 f2 72 75 62 32 0d  0f 1e 2f 73 63 72 65 65  |. .rub2.../scree|
00002760  6e 24 28 73 63 72 65 65  6e 5f 78 25 2c 73 63 72  |n$(screen_x%,scr|
00002770  65 65 6e 5f 79 25 2c 6d  78 2c 28 31 35 2d 6d 79  |een_y%,mx,(15-my|
00002780  29 29 3d 22 30 22 0d 0f  28 05 e1 0d 0f 32 05 3a  |))="0"..(....2.:|
00002790  0d 0f 3c 0a dd 20 f2 74  65 6c 0d 0f 46 1d f2 57  |..<.. .tel..F..W|
000027a0  69 6d 70 5f 57 69 6e 64  6f 77 43 6c 6f 73 65 28  |imp_WindowClose(|
000027b0  49 63 6f 6e 73 25 29 0d  0f 50 0c 75 70 64 61 74  |Icons%)..P.updat|
000027c0  65 3d 30 0d 0f 5a 0f 72  65 66 65 72 65 6e 63 65  |e=0..Z.reference|
000027d0  3d 30 0d 0f 64 27 e7 20  74 65 6c 65 6e 75 6d 25  |=0..d'. telenum%|
000027e0  3c 32 30 20 8c 20 66 25  3d 74 65 6c 65 6e 75 6d  |<20 . f%=telenum|
000027f0  25 3a 8b 20 66 25 3d 32  30 0d 0f 6e 11 e3 20 66  |%:. f%=20..n.. f|
00002800  69 6e 64 3d 30 20 b8 20  66 25 0d 0f 78 8b e7 20  |ind=0 . f%..x.. |
00002810  74 73 63 78 28 66 69 6e  64 29 3d 73 63 72 65 65  |tscx(find)=scree|
00002820  6e 5f 78 25 20 80 20 74  73 63 79 28 66 69 6e 64  |n_x% . tscy(find|
00002830  29 3d 73 63 72 65 65 6e  5f 79 25 20 80 20 74 78  |)=screen_y% . tx|
00002840  28 66 69 6e 64 29 3d 6d  78 20 80 20 74 79 28 66  |(find)=mx . ty(f|
00002850  69 6e 64 29 3d 28 31 35  2d 6d 79 29 20 80 20 61  |ind)=(15-my) . a|
00002860  63 74 69 76 28 66 69 6e  64 29 3d 31 20 8c 20 72  |ctiv(find)=1 . r|
00002870  65 66 65 72 65 6e 63 65  3d 66 69 6e 64 3a 66 6f  |eference=find:fo|
00002880  75 6e 64 33 25 3d 31 3a  66 69 6e 64 3d 74 65 6c  |und3%=1:find=tel|
00002890  65 6e 75 6d 25 0d 0f 82  05 ed 0d 0f 8c 3b f2 57  |enum%........;.W|
000028a0  69 6d 70 5f 49 63 6f 6e  50 75 74 54 65 78 74 28  |imp_IconPutText(|
000028b0  74 65 6c 65 70 6f 72 74  73 25 2c 36 2c c3 28 74  |teleports%,6,.(t|
000028c0  65 6c 65 74 6f 73 63 78  28 72 65 66 65 72 65 6e  |eletoscx(referen|
000028d0  63 65 29 29 29 0d 0f 96  3b f2 57 69 6d 70 5f 49  |ce)))...;.Wimp_I|
000028e0  63 6f 6e 50 75 74 54 65  78 74 28 74 65 6c 65 70  |conPutText(telep|
000028f0  6f 72 74 73 25 2c 37 2c  c3 28 74 65 6c 65 74 6f  |orts%,7,.(teleto|
00002900  73 63 79 28 72 65 66 65  72 65 6e 63 65 29 29 29  |scy(reference)))|
00002910  0d 0f a0 39 f2 57 69 6d  70 5f 49 63 6f 6e 50 75  |...9.Wimp_IconPu|
00002920  74 54 65 78 74 28 74 65  6c 65 70 6f 72 74 73 25  |tText(teleports%|
00002930  2c 38 2c c3 28 74 65 6c  65 74 6f 78 28 72 65 66  |,8,.(teletox(ref|
00002940  65 72 65 6e 63 65 29 29  29 0d 0f aa 39 f2 57 69  |erence)))...9.Wi|
00002950  6d 70 5f 49 63 6f 6e 50  75 74 54 65 78 74 28 74  |mp_IconPutText(t|
00002960  65 6c 65 70 6f 72 74 73  25 2c 39 2c c3 28 74 65  |eleports%,9,.(te|
00002970  6c 65 74 6f 79 28 72 65  66 65 72 65 6e 63 65 29  |letoy(reference)|
00002980  29 29 0d 0f b4 2c f2 57  69 6d 70 5f 57 69 6e 64  |))...,.Wimp_Wind|
00002990  6f 77 4f 70 65 6e 28 74  65 6c 65 70 6f 72 74 73  |owOpen(teleports|
000029a0  25 29 3a 74 65 6c 65 5f  6f 70 65 6e 3d b9 0d 0f  |%):tele_open=...|
000029b0  be 3b f2 57 69 6d 70 5f  49 63 6f 6e 50 75 74 54  |.;.Wimp_IconPutT|
000029c0  65 78 74 28 4d 61 70 25  2c 6f 6c 64 69 63 6f 6e  |ext(Map%,oldicon|
000029d0  25 2c 22 6d 61 70 75 70  22 29 3a 74 68 69 73 25  |%,"mapup"):this%|
000029e0  3d 6f 6c 64 69 63 6f 6e  25 0d 0f c8 41 73 63 72  |=oldicon%...Ascr|
000029f0  65 65 6e 5f 78 25 3d 74  65 6c 65 74 6f 73 63 78  |een_x%=teletoscx|
00002a00  28 72 65 66 65 72 65 6e  63 65 29 3a 73 63 72 65  |(reference):scre|
00002a10  65 6e 5f 79 25 3d 74 65  6c 65 74 6f 73 63 79 28  |en_y%=teletoscy(|
00002a20  72 65 66 65 72 65 6e 63  65 29 0d 0f d2 35 24 74  |reference)...5$t|
00002a30  69 74 6c 65 25 3d 22 4d  61 70 20 28 22 2b c3 28  |itle%="Map ("+.(|
00002a40  73 63 72 65 65 6e 5f 78  25 29 2b 22 2c 22 2b c3  |screen_x%)+","+.|
00002a50  28 73 63 72 65 65 6e 5f  79 25 29 2b 22 29 22 0d  |(screen_y%)+")".|
00002a60  0f dc 34 f2 75 70 64 61  74 65 6d 61 70 28 31 29  |..4.updatemap(1)|
00002a70  3a f4 20 53 68 6f 77 20  74 65 6c 65 70 6f 72 74  |:. Show teleport|
00002a80  20 64 65 73 74 69 6e 61  74 69 6f 6e 20 6f 6e 20  | destination on |
00002a90  6d 61 70 0d 0f e6 22 f2  57 69 6d 70 5f 57 69 6e  |map...".Wimp_Win|
00002aa0  64 6f 77 46 6f 72 63 65  44 72 61 77 28 73 63 72  |dowForceDraw(scr|
00002ab0  65 65 6e 25 29 0d 0f f0  1e f2 57 69 6d 70 5f 57  |een%).....Wimp_W|
00002ac0  69 6e 64 6f 77 43 6c 6f  73 65 28 73 63 72 65 65  |indowClose(scree|
00002ad0  6e 25 29 0d 0f fa 1d f2  57 69 6d 70 5f 57 69 6e  |n%).....Wimp_Win|
00002ae0  64 6f 77 4f 70 65 6e 28  73 63 72 65 65 6e 25 29  |dowOpen(screen%)|
00002af0  0d 10 04 05 e1 0d 10 0e  05 3a 0d 10 18 23 dd 20  |.........:...#. |
00002b00  f2 65 72 61 73 65 5f 74  65 6c 65 70 6f 72 74 65  |.erase_teleporte|
00002b10  72 3a e7 20 73 24 3d 22  37 22 8c 20 e1 0d 10 22  |r:. s$="7". ..."|
00002b20  0a 66 69 6e 64 3d 30 0d  10 2c 05 f5 0d 10 36 63  |.find=0..,....6c|
00002b30  e7 20 74 73 63 78 28 66  69 6e 64 29 3d 73 63 72  |. tscx(find)=scr|
00002b40  65 65 6e 5f 78 25 20 80  20 74 73 63 79 28 66 69  |een_x% . tscy(fi|
00002b50  6e 64 29 3d 73 63 72 65  65 6e 5f 79 25 20 80 20  |nd)=screen_y% . |
00002b60  74 78 28 66 69 6e 64 29  3d 6d 78 20 80 20 74 79  |tx(find)=mx . ty|
00002b70  28 66 69 6e 64 29 3d 28  31 35 2d 6d 79 29 20 8c  |(find)=(15-my) .|
00002b80  20 72 65 66 65 72 65 6e  63 65 3d 66 69 6e 64 0d  | reference=find.|
00002b90  10 40 0b 66 69 6e 64 2b  3d 31 0d 10 4a 0d fd 20  |.@.find+=1..J.. |
00002ba0  66 69 6e 64 3e 32 30 0d  10 54 41 e7 20 61 63 74  |find>20..TA. act|
00002bb0  69 76 28 72 65 66 65 72  65 6e 63 65 29 3d 30 20  |iv(reference)=0 |
00002bc0  80 20 74 73 63 79 28 72  65 66 65 72 65 6e 63 65  |. tscy(reference|
00002bd0  29 3e 30 20 8c 20 61 63  74 69 76 28 72 65 66 65  |)>0 . activ(refe|
00002be0  72 65 6e 63 65 29 3d 30  0d 10 5e 3a 61 63 74 69  |rence)=0..^:acti|
00002bf0  76 28 72 65 66 65 72 65  6e 63 65 29 3d 30 3a 74  |v(reference)=0:t|
00002c00  73 63 78 28 72 65 66 65  72 65 6e 63 65 29 3d 30  |scx(reference)=0|
00002c10  3a 74 73 63 79 28 72 65  66 65 72 65 6e 63 65 29  |:tscy(reference)|
00002c20  3d 30 0d 10 68 23 74 78  28 72 65 66 65 72 65 6e  |=0..h#tx(referen|
00002c30  63 65 29 3d 30 3a 74 79  28 72 65 66 65 72 65 6e  |ce)=0:ty(referen|
00002c40  63 65 29 3d 30 0d 10 72  31 74 65 6c 65 74 6f 73  |ce)=0..r1teletos|
00002c50  63 78 28 72 65 66 65 72  65 6e 63 65 29 3d 30 3a  |cx(reference)=0:|
00002c60  74 65 6c 65 74 6f 73 63  79 28 72 65 66 65 72 65  |teletoscy(refere|
00002c70  6e 63 65 29 3d 30 0d 10  7c 2d 74 65 6c 65 74 6f  |nce)=0..|-teleto|
00002c80  78 28 72 65 66 65 72 65  6e 63 65 29 3d 30 3a 74  |x(reference)=0:t|
00002c90  65 6c 65 74 6f 79 28 72  65 66 65 72 65 6e 63 65  |eletoy(reference|
00002ca0  29 3d 30 0d 10 86 1a 74  65 6c 65 6e 75 6d 25 2d  |)=0....telenum%-|
00002cb0  3d 31 3a 64 65 66 69 6e  65 64 2d 3d 31 0d 10 90  |=1:defined-=1...|
00002cc0  1c e7 20 74 65 6c 65 6e  75 6d 25 3c 3d 30 20 74  |.. telenum%<=0 t|
00002cd0  65 6c 65 6e 75 6d 25 3d  30 0d 10 9a 1a e7 20 64  |elenum%=0..... d|
00002ce0  65 66 69 6e 65 64 3c 3d  30 20 64 65 66 69 6e 65  |efined<=0 define|
00002cf0  64 3d 30 0d 10 a4 61 e7  20 64 65 66 69 6e 65 64  |d=0...a. defined|
00002d00  3c 31 20 84 20 74 65 6c  65 6e 75 6d 25 3c 31 20  |<1 . telenum%<1 |
00002d10  8c 20 f2 57 69 6d 70 5f  57 69 6e 64 6f 77 43 6c  |. .Wimp_WindowCl|
00002d20  6f 73 65 28 74 65 6c 65  70 6f 72 74 73 25 29 3a  |ose(teleports%):|
00002d30  74 65 6c 65 5f 6f 70 65  6e 3d a3 3a f2 57 69 6d  |tele_open=.:.Wim|
00002d40  70 5f 57 69 6e 64 6f 77  4f 70 65 6e 28 49 63 6f  |p_WindowOpen(Ico|
00002d50  6e 73 25 29 0d 10 ae 05  e1 0d 10 b8 05 3a 0d 10  |ns%).........:..|
00002d60  c2 26 dd 20 f2 55 73 65  72 5f 4d 6f 75 73 65 69  |.&. .User_Mousei|
00002d70  63 6f 6e 73 28 20 62 75  74 74 6f 6e 25 2c 69 63  |cons( button%,ic|
00002d80  6f 6e 25 29 0d 10 cc 10  c8 8e 20 62 75 74 74 6f  |on%)...... butto|
00002d90  6e 25 20 ca 0d 10 d6 11  c9 20 34 3a 20 f4 20 53  |n% ...... 4: . S|
00002da0  65 6c 65 63 74 0d 10 e0  0e c8 8e 20 69 63 6f 6e  |elect...... icon|
00002db0  25 20 ca 0d 10 ea 10 f4  20 50 61 74 68 20 69 63  |% ...... Path ic|
00002dc0  6f 6e 73 0d 10 f4 17 c9  20 31 36 3a f2 64 72 61  |ons..... 16:.dra|
00002dd0  77 49 63 6f 6e 28 22 30  22 29 0d 10 fe 17 c9 20  |wIcon("0")..... |
00002de0  31 37 3a f2 64 72 61 77  49 63 6f 6e 28 22 35 22  |17:.drawIcon("5"|
00002df0  29 0d 11 08 17 c9 20 31  38 3a f2 64 72 61 77 49  |)..... 18:.drawI|
00002e00  63 6f 6e 28 22 38 22 29  0d 11 12 17 c9 20 31 39  |con("8")..... 19|
00002e10  3a f2 64 72 61 77 49 63  6f 6e 28 22 39 22 29 0d  |:.drawIcon("9").|
00002e20  11 1c 18 c9 20 32 30 3a  f2 64 72 61 77 49 63 6f  |.... 20:.drawIco|
00002e30  6e 28 22 31 36 22 29 0d  11 26 18 c9 20 32 31 3a  |n("16")..&.. 21:|
00002e40  f2 64 72 61 77 49 63 6f  6e 28 22 31 39 22 29 0d  |.drawIcon("19").|
00002e50  11 30 10 f4 20 49 74 65  6d 20 69 63 6f 6e 73 0d  |.0.. Item icons.|
00002e60  11 3a 18 c9 20 32 32 3a  f2 64 72 61 77 49 63 6f  |.:.. 22:.drawIco|
00002e70  6e 28 22 31 30 22 29 0d  11 44 18 c9 20 32 33 3a  |n("10")..D.. 23:|
00002e80  f2 64 72 61 77 49 63 6f  6e 28 22 31 31 22 29 0d  |.drawIcon("11").|
00002e90  11 4e 18 c9 20 32 34 3a  f2 64 72 61 77 49 63 6f  |.N.. 24:.drawIco|
00002ea0  6e 28 22 31 32 22 29 0d  11 58 18 c9 20 32 35 3a  |n("12")..X.. 25:|
00002eb0  f2 64 72 61 77 49 63 6f  6e 28 22 31 34 22 29 0d  |.drawIcon("14").|
00002ec0  11 62 18 c9 20 32 36 3a  f2 64 72 61 77 49 63 6f  |.b.. 26:.drawIco|
00002ed0  6e 28 22 31 33 22 29 0d  11 6c 18 c9 20 32 37 3a  |n("13")..l.. 27:|
00002ee0  f2 64 72 61 77 49 63 6f  6e 28 22 31 35 22 29 0d  |.drawIcon("15").|
00002ef0  11 76 10 f4 20 57 61 6c  6c 20 69 63 6f 6e 73 0d  |.v.. Wall icons.|
00002f00  11 80 17 c9 20 32 38 3a  f2 64 72 61 77 49 63 6f  |.... 28:.drawIco|
00002f10  6e 28 22 31 22 29 0d 11  8a 17 c9 20 32 39 3a f2  |n("1")..... 29:.|
00002f20  64 72 61 77 49 63 6f 6e  28 22 32 22 29 0d 11 94  |drawIcon("2")...|
00002f30  17 c9 20 33 30 3a f2 64  72 61 77 49 63 6f 6e 28  |.. 30:.drawIcon(|
00002f40  22 33 22 29 0d 11 9e 17  c9 20 33 31 3a f2 64 72  |"3")..... 31:.dr|
00002f50  61 77 49 63 6f 6e 28 22  34 22 29 0d 11 a8 0f f4  |awIcon("4").....|
00002f60  20 54 65 6c 65 70 6f 72  74 73 0d 11 b2 17 c9 20  | Teleports..... |
00002f70  33 32 3a f2 64 72 61 77  49 63 6f 6e 28 22 36 22  |32:.drawIcon("6"|
00002f80  29 0d 11 bc 17 c9 20 33  33 3a f2 64 72 61 77 49  |)..... 33:.drawI|
00002f90  63 6f 6e 28 22 37 22 29  0d 11 c6 0d f4 20 50 6c  |con("7")..... Pl|
00002fa0  61 79 65 72 73 0d 11 d0  18 c9 20 33 34 3a f2 64  |ayers..... 34:.d|
00002fb0  72 61 77 49 63 6f 6e 28  22 31 38 22 29 0d 11 da  |rawIcon("18")...|
00002fc0  18 c9 20 33 35 3a f2 64  72 61 77 49 63 6f 6e 28  |.. 35:.drawIcon(|
00002fd0  22 31 37 22 29 0d 11 e4  05 cb 0d 11 ee 11 c9 20  |"17").......... |
00002fe0  31 3a 20 f4 20 41 64 6a  75 73 74 0d 11 f8 0e c8  |1: . Adjust.....|
00002ff0  8e 20 69 63 6f 6e 25 20  ca 0d 12 02 18 c9 20 31  |. icon% ...... 1|
00003000  36 3a f2 65 72 61 73 65  49 63 6f 6e 28 22 30 22  |6:.eraseIcon("0"|
00003010  29 0d 12 0c 18 c9 20 31  37 3a f2 65 72 61 73 65  |)..... 17:.erase|
00003020  49 63 6f 6e 28 22 35 22  29 0d 12 16 18 c9 20 31  |Icon("5")..... 1|
00003030  38 3a f2 65 72 61 73 65  49 63 6f 6e 28 22 38 22  |8:.eraseIcon("8"|
00003040  29 0d 12 20 18 c9 20 31  39 3a f2 65 72 61 73 65  |).. .. 19:.erase|
00003050  49 63 6f 6e 28 22 39 22  29 0d 12 2a 19 c9 20 32  |Icon("9")..*.. 2|
00003060  30 3a f2 65 72 61 73 65  49 63 6f 6e 28 22 31 36  |0:.eraseIcon("16|
00003070  22 29 0d 12 34 19 c9 20  32 31 3a f2 65 72 61 73  |")..4.. 21:.eras|
00003080  65 49 63 6f 6e 28 22 31  39 22 29 0d 12 3e 10 f4  |eIcon("19")..>..|
00003090  20 49 74 65 6d 20 69 63  6f 6e 73 0d 12 48 19 c9  | Item icons..H..|
000030a0  20 32 32 3a f2 65 72 61  73 65 49 63 6f 6e 28 22  | 22:.eraseIcon("|
000030b0  31 30 22 29 0d 12 52 19  c9 20 32 33 3a f2 65 72  |10")..R.. 23:.er|
000030c0  61 73 65 49 63 6f 6e 28  22 31 31 22 29 0d 12 5c  |aseIcon("11")..\|
000030d0  19 c9 20 32 34 3a f2 65  72 61 73 65 49 63 6f 6e  |.. 24:.eraseIcon|
000030e0  28 22 31 32 22 29 0d 12  66 19 c9 20 32 35 3a f2  |("12")..f.. 25:.|
000030f0  65 72 61 73 65 49 63 6f  6e 28 22 31 34 22 29 0d  |eraseIcon("14").|
00003100  12 70 19 c9 20 32 36 3a  f2 65 72 61 73 65 49 63  |.p.. 26:.eraseIc|
00003110  6f 6e 28 22 31 33 22 29  0d 12 7a 19 c9 20 32 37  |on("13")..z.. 27|
00003120  3a f2 65 72 61 73 65 49  63 6f 6e 28 22 31 35 22  |:.eraseIcon("15"|
00003130  29 0d 12 84 10 f4 20 57  61 6c 6c 20 69 63 6f 6e  |)..... Wall icon|
00003140  73 0d 12 8e 18 c9 20 32  38 3a f2 65 72 61 73 65  |s..... 28:.erase|
00003150  49 63 6f 6e 28 22 31 22  29 0d 12 98 18 c9 20 32  |Icon("1")..... 2|
00003160  39 3a f2 65 72 61 73 65  49 63 6f 6e 28 22 32 22  |9:.eraseIcon("2"|
00003170  29 0d 12 a2 18 c9 20 33  30 3a f2 65 72 61 73 65  |)..... 30:.erase|
00003180  49 63 6f 6e 28 22 33 22  29 0d 12 ac 19 c9 20 33  |Icon("3")..... 3|
00003190  31 3a f2 65 72 61 73 65  49 63 6f 6e 28 22 34 30  |1:.eraseIcon("40|
000031a0  22 29 0d 12 b6 0f f4 20  54 65 6c 65 70 6f 72 74  |")..... Teleport|
000031b0  73 0d 12 c0 18 c9 20 33  32 3a f2 65 72 61 73 65  |s..... 32:.erase|
000031c0  49 63 6f 6e 28 22 36 22  29 0d 12 ca 18 c9 20 33  |Icon("6")..... 3|
000031d0  33 3a f2 65 72 61 73 65  49 63 6f 6e 28 22 37 22  |3:.eraseIcon("7"|
000031e0  29 0d 12 d4 0d f4 20 50  6c 61 79 65 72 73 0d 12  |)..... Players..|
000031f0  de 19 c9 20 33 34 3a f2  65 72 61 73 65 49 63 6f  |... 34:.eraseIco|
00003200  6e 28 22 31 38 22 29 0d  12 e8 19 c9 20 33 35 3a  |n("18")..... 35:|
00003210  f2 65 72 61 73 65 49 63  6f 6e 28 22 31 37 22 29  |.eraseIcon("17")|
00003220  0d 12 f2 05 cb 0d 12 fc  05 cb 0d 13 06 05 e1 0d  |................|
00003230  13 10 05 3a 0d 13 1a 14  dd 20 f2 64 72 61 77 49  |...:..... .drawI|
00003240  63 6f 6e 28 73 70 24 29  0d 13 24 12 77 69 6d 70  |con(sp$)..$.wimp|
00003250  25 21 30 3d 49 63 6f 6e  73 25 0d 13 2e 0e 77 69  |%!0=Icons%....wi|
00003260  6d 70 25 21 34 3d 31 34  0d 13 38 21 c8 99 20 22  |mp%!4=14..8!.. "|
00003270  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00003280  65 22 2c 2c 77 69 6d 70  25 0d 13 42 18 e7 20 24  |e",,wimp%..B.. $|
00003290  28 77 69 6d 70 25 2b 32  38 29 3c 3e 73 70 24 20  |(wimp%+28)<>sp$ |
000032a0  8c 0d 13 4c 13 24 28 77  69 6d 70 25 2b 32 38 29  |...L.$(wimp%+28)|
000032b0  3d 73 70 24 0d 13 56 1f  c8 99 20 22 57 69 6d 70  |=sp$..V... "Wimp|
000032c0  5f 44 65 6c 65 74 65 49  63 6f 6e 22 2c 2c 77 69  |_DeleteIcon",,wi|
000032d0  6d 70 25 0d 13 60 12 77  69 6d 70 25 21 34 3d 49  |mp%..`.wimp%!4=I|
000032e0  63 6f 6e 73 25 0d 13 6a  27 c8 99 20 22 57 69 6d  |cons%..j'.. "Wim|
000032f0  70 5f 43 72 65 61 74 65  49 63 6f 6e 22 2c 2c 77  |p_CreateIcon",,w|
00003300  69 6d 70 25 2b 34 20 b8  20 69 63 25 0d 13 74 12  |imp%+4 . ic%..t.|
00003310  77 69 6d 70 25 21 30 3d  49 63 6f 6e 73 25 0d 13  |wimp%!0=Icons%..|
00003320  7e 0e 77 69 6d 70 25 21  34 3d 31 34 0d 13 88 0d  |~.wimp%!4=14....|
00003330  77 69 6d 70 25 21 38 3d  30 0d 13 92 0e 77 69 6d  |wimp%!8=0....wim|
00003340  70 25 21 31 32 3d 30 0d  13 9c 21 c8 99 20 22 57  |p%!12=0...!.. "W|
00003350  69 6d 70 5f 53 65 74 49  63 6f 6e 53 74 61 74 65  |imp_SetIconState|
00003360  22 2c 2c 77 69 6d 70 25  0d 13 a6 05 cd 0d 13 b0  |",,wimp%........|
00003370  0d 64 72 61 77 24 3d 73  70 24 0d 13 ba 05 e1 0d  |.draw$=sp$......|
00003380  13 c4 05 3a 0d 13 ce 15  dd 20 f2 65 72 61 73 65  |...:..... .erase|
00003390  49 63 6f 6e 28 73 70 24  29 0d 13 d8 12 77 69 6d  |Icon(sp$)....wim|
000033a0  70 25 21 30 3d 49 63 6f  6e 73 25 0d 13 e2 0e 77  |p%!0=Icons%....w|
000033b0  69 6d 70 25 21 34 3d 31  35 0d 13 ec 21 c8 99 20  |imp%!4=15...!.. |
000033c0  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
000033d0  74 65 22 2c 2c 77 69 6d  70 25 0d 13 f6 18 e7 20  |te",,wimp%..... |
000033e0  24 28 77 69 6d 70 25 2b  32 38 29 3c 3e 73 70 24  |$(wimp%+28)<>sp$|
000033f0  20 8c 0d 14 00 13 24 28  77 69 6d 70 25 2b 32 38  | .....$(wimp%+28|
00003400  29 3d 73 70 24 0d 14 0a  1f c8 99 20 22 57 69 6d  |)=sp$...... "Wim|
00003410  70 5f 44 65 6c 65 74 65  49 63 6f 6e 22 2c 2c 77  |p_DeleteIcon",,w|
00003420  69 6d 70 25 0d 14 14 12  77 69 6d 70 25 21 34 3d  |imp%....wimp%!4=|
00003430  49 63 6f 6e 73 25 0d 14  1e 27 c8 99 20 22 57 69  |Icons%...'.. "Wi|
00003440  6d 70 5f 43 72 65 61 74  65 49 63 6f 6e 22 2c 2c  |mp_CreateIcon",,|
00003450  77 69 6d 70 25 2b 34 20  b8 20 69 63 25 0d 14 28  |wimp%+4 . ic%..(|
00003460  12 77 69 6d 70 25 21 30  3d 49 63 6f 6e 73 25 0d  |.wimp%!0=Icons%.|
00003470  14 32 0e 77 69 6d 70 25  21 34 3d 31 35 0d 14 3c  |.2.wimp%!4=15..<|
00003480  0d 77 69 6d 70 25 21 38  3d 30 0d 14 46 0e 77 69  |.wimp%!8=0..F.wi|
00003490  6d 70 25 21 31 32 3d 30  0d 14 50 21 c8 99 20 22  |mp%!12=0..P!.. "|
000034a0  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
000034b0  65 22 2c 2c 77 69 6d 70  25 0d 14 5a 05 cd 0d 14  |e",,wimp%..Z....|
000034c0  64 0e 65 72 61 73 65 24  3d 73 70 24 0d 14 6e 05  |d.erase$=sp$..n.|
000034d0  e1 0d 14 78 05 3a 0d 14  82 23 dd 20 f2 55 73 65  |...x.:...#. .Use|
000034e0  72 5f 4d 6f 75 73 65 6d  61 70 28 62 75 74 74 6f  |r_Mousemap(butto|
000034f0  6e 25 2c 69 63 6f 6e 25  29 0d 14 8c 1f e7 20 74  |n%,icon%)..... t|
00003500  65 6c 65 5f 6f 70 65 6e  20 8c 20 f2 75 70 64 61  |ele_open . .upda|
00003510  74 65 6d 61 70 28 30 29  0d 14 96 2c f2 57 69 6d  |temap(0)...,.Wim|
00003520  70 5f 49 63 6f 6e 50 75  74 54 65 78 74 28 4d 61  |p_IconPutText(Ma|
00003530  70 25 2c 6f 6c 64 69 63  6f 6e 25 2c 22 6d 61 70  |p%,oldicon%,"map|
00003540  75 70 22 29 0d 14 a0 29  f2 57 69 6d 70 5f 49 63  |up")...).Wimp_Ic|
00003550  6f 6e 50 75 74 54 65 78  74 28 4d 61 70 25 2c 69  |onPutText(Map%,i|
00003560  63 6f 6e 25 2c 22 6d 61  70 64 6e 22 29 0d 14 aa  |con%,"mapdn")...|
00003570  1f f2 57 69 6d 70 5f 57  69 6e 64 6f 77 46 6f 72  |..Wimp_WindowFor|
00003580  63 65 44 72 61 77 28 4d  61 70 25 29 0d 14 b4 12  |ceDraw(Map%)....|
00003590  6f 6c 64 69 63 6f 6e 25  3d 69 63 6f 6e 25 0d 14  |oldicon%=icon%..|
000035a0  be 0e c8 8e 20 69 63 6f  6e 25 20 ca 0d 14 c8 31  |.... icon% ....1|
000035b0  c9 20 30 2c 31 2c 32 2c  33 2c 34 2c 35 2c 36 2c  |. 0,1,2,3,4,5,6,|
000035c0  37 3a 73 63 72 65 65 6e  5f 78 25 3d 69 63 6f 6e  |7:screen_x%=icon|
000035d0  25 3a 73 63 72 65 65 6e  5f 79 25 3d 30 0d 14 d2  |%:screen_y%=0...|
000035e0  3b c9 20 38 2c 39 2c 31  30 2c 31 31 2c 31 32 2c  |;. 8,9,10,11,12,|
000035f0  31 33 2c 31 34 2c 31 35  3a 73 63 72 65 65 6e 5f  |13,14,15:screen_|
00003600  78 25 3d 28 69 63 6f 6e  25 2d 38 29 3a 73 63 72  |x%=(icon%-8):scr|
00003610  65 65 6e 5f 79 25 3d 31  0d 14 dc 3e c9 20 31 36  |een_y%=1...>. 16|
00003620  2c 31 37 2c 31 38 2c 31  39 2c 32 30 2c 32 31 2c  |,17,18,19,20,21,|
00003630  32 32 2c 32 33 3a 73 63  72 65 65 6e 5f 78 25 3d  |22,23:screen_x%=|
00003640  28 69 63 6f 6e 25 2d 31  36 29 3a 73 63 72 65 65  |(icon%-16):scree|
00003650  6e 5f 79 25 3d 32 0d 14  e6 3e c9 20 32 34 2c 32  |n_y%=2...>. 24,2|
00003660  35 2c 32 36 2c 32 37 2c  32 38 2c 32 39 2c 33 30  |5,26,27,28,29,30|
00003670  2c 33 31 3a 73 63 72 65  65 6e 5f 78 25 3d 28 69  |,31:screen_x%=(i|
00003680  63 6f 6e 25 2d 32 34 29  3a 73 63 72 65 65 6e 5f  |con%-24):screen_|
00003690  79 25 3d 33 0d 14 f0 05  cb 0d 14 fa 13 e7 20 74  |y%=3.......... t|
000036a0  65 6c 65 5f 6f 70 65 6e  3d b9 20 8c 0d 15 04 22  |ele_open=. ...."|
000036b0  74 65 6c 65 74 6f 73 63  78 28 72 65 66 65 72 65  |teletoscx(refere|
000036c0  6e 63 65 29 3d 73 63 72  65 65 6e 5f 78 25 0d 15  |nce)=screen_x%..|
000036d0  0e 22 74 65 6c 65 74 6f  73 63 79 28 72 65 66 65  |."teletoscy(refe|
000036e0  72 65 6e 63 65 29 3d 73  63 72 65 65 6e 5f 79 25  |rence)=screen_y%|
000036f0  0d 15 18 3b f2 57 69 6d  70 5f 49 63 6f 6e 50 75  |...;.Wimp_IconPu|
00003700  74 54 65 78 74 28 74 65  6c 65 70 6f 72 74 73 25  |tText(teleports%|
00003710  2c 36 2c c3 28 74 65 6c  65 74 6f 73 63 78 28 72  |,6,.(teletoscx(r|
00003720  65 66 65 72 65 6e 63 65  29 29 29 0d 15 22 3b f2  |eference)))..";.|
00003730  57 69 6d 70 5f 49 63 6f  6e 50 75 74 54 65 78 74  |Wimp_IconPutText|
00003740  28 74 65 6c 65 70 6f 72  74 73 25 2c 37 2c c3 28  |(teleports%,7,.(|
00003750  74 65 6c 65 74 6f 73 63  79 28 72 65 66 65 72 65  |teletoscy(refere|
00003760  6e 63 65 29 29 29 0d 15  2c 05 cd 0d 15 36 35 24  |nce)))..,....65$|
00003770  74 69 74 6c 65 25 3d 22  4d 61 70 20 28 22 2b c3  |title%="Map ("+.|
00003780  28 73 63 72 65 65 6e 5f  78 25 29 2b 22 2c 22 2b  |(screen_x%)+","+|
00003790  c3 28 73 63 72 65 65 6e  5f 79 25 29 2b 22 29 22  |.(screen_y%)+")"|
000037a0  0d 15 40 22 f2 57 69 6d  70 5f 57 69 6e 64 6f 77  |..@".Wimp_Window|
000037b0  46 6f 72 63 65 44 72 61  77 28 73 63 72 65 65 6e  |ForceDraw(screen|
000037c0  25 29 0d 15 4a 1e f2 57  69 6d 70 5f 57 69 6e 64  |%)..J..Wimp_Wind|
000037d0  6f 77 43 6c 6f 73 65 28  73 63 72 65 65 6e 25 29  |owClose(screen%)|
000037e0  0d 15 54 1d f2 57 69 6d  70 5f 57 69 6e 64 6f 77  |..T..Wimp_Window|
000037f0  4f 70 65 6e 28 73 63 72  65 65 6e 25 29 0d 15 5e  |Open(screen%)..^|
00003800  05 e1 0d 15 68 05 3a 0d  15 72 0d dd 20 f2 75 70  |....h.:..r.. .up|
00003810  64 61 74 65 0d 15 7c 4b  24 74 69 74 6c 65 25 3d  |date..|K$title%=|
00003820  22 4d 61 70 20 28 22 2b  c3 28 74 65 6c 65 74 6f  |"Map ("+.(teleto|
00003830  73 63 78 28 72 65 66 65  72 65 6e 63 65 29 29 2b  |scx(reference))+|
00003840  22 2c 22 2b c3 28 74 65  6c 65 74 6f 73 63 79 28  |","+.(teletoscy(|
00003850  72 65 66 65 72 65 6e 63  65 29 29 2b 22 29 22 0d  |reference))+")".|
00003860  15 86 41 73 63 72 65 65  6e 5f 78 25 3d 74 65 6c  |..Ascreen_x%=tel|
00003870  65 74 6f 73 63 78 28 72  65 66 65 72 65 6e 63 65  |etoscx(reference|
00003880  29 3a 73 63 72 65 65 6e  5f 79 25 3d 74 65 6c 65  |):screen_y%=tele|
00003890  74 6f 73 63 79 28 72 65  66 65 72 65 6e 63 65 29  |toscy(reference)|
000038a0  0d 15 90 22 f2 57 69 6d  70 5f 57 69 6e 64 6f 77  |...".Wimp_Window|
000038b0  46 6f 72 63 65 44 72 61  77 28 73 63 72 65 65 6e  |ForceDraw(screen|
000038c0  25 29 0d 15 9a 1e f2 57  69 6d 70 5f 57 69 6e 64  |%).....Wimp_Wind|
000038d0  6f 77 43 6c 6f 73 65 28  73 63 72 65 65 6e 25 29  |owClose(screen%)|
000038e0  0d 15 a4 1d f2 57 69 6d  70 5f 57 69 6e 64 6f 77  |.....Wimp_Window|
000038f0  4f 70 65 6e 28 73 63 72  65 65 6e 25 29 0d 15 ae  |Open(screen%)...|
00003900  05 e1 0d 15 b8 13 dd 20  f2 75 70 64 61 74 65 6d  |....... .updatem|
00003910  61 70 28 6d 29 0d 15 c2  8e e7 20 6d 3d 30 3a f2  |ap(m)..... m=0:.|
00003920  57 69 6d 70 5f 49 63 6f  6e 50 75 74 54 65 78 74  |Wimp_IconPutText|
00003930  28 4d 61 70 25 2c 28 74  65 6c 65 74 6f 73 63 79  |(Map%,(teletoscy|
00003940  28 72 65 66 65 72 65 6e  63 65 29 2a 38 29 2b 74  |(reference)*8)+t|
00003950  65 6c 65 74 6f 73 63 78  28 72 65 66 65 72 65 6e  |eletoscx(referen|
00003960  63 65 29 2c 22 6d 61 70  75 70 22 29 3a 6f 6c 64  |ce),"mapup"):old|
00003970  69 63 6f 6e 25 3d 28 74  65 6c 65 74 6f 73 63 79  |icon%=(teletoscy|
00003980  28 72 65 66 65 72 65 6e  63 65 29 2a 38 29 2b 74  |(reference)*8)+t|
00003990  65 6c 65 74 6f 73 63 78  28 72 65 66 65 72 65 6e  |eletoscx(referen|
000039a0  63 65 29 0d 15 cc 8e e7  20 6d 3d 31 3a f2 57 69  |ce)..... m=1:.Wi|
000039b0  6d 70 5f 49 63 6f 6e 50  75 74 54 65 78 74 28 4d  |mp_IconPutText(M|
000039c0  61 70 25 2c 28 74 65 6c  65 74 6f 73 63 79 28 72  |ap%,(teletoscy(r|
000039d0  65 66 65 72 65 6e 63 65  29 2a 38 29 2b 74 65 6c  |eference)*8)+tel|
000039e0  65 74 6f 73 63 78 28 72  65 66 65 72 65 6e 63 65  |etoscx(reference|
000039f0  29 2c 22 6d 61 70 64 6e  22 29 3a 6f 6c 64 69 63  |),"mapdn"):oldic|
00003a00  6f 6e 25 3d 28 74 65 6c  65 74 6f 73 63 79 28 72  |on%=(teletoscy(r|
00003a10  65 66 65 72 65 6e 63 65  29 2a 38 29 2b 74 65 6c  |eference)*8)+tel|
00003a20  65 74 6f 73 63 78 28 72  65 66 65 72 65 6e 63 65  |etoscx(reference|
00003a30  29 0d 15 d6 05 e1 0d 15  e0 05 3a 0d 15 ea 29 dd  |).........:...).|
00003a40  20 f2 55 73 65 72 5f 4d  6f 75 73 65 74 65 6c 65  | .User_Mousetele|
00003a50  70 6f 72 74 73 28 62 75  74 74 6f 6e 25 2c 69 63  |ports(button%,ic|
00003a60  6f 6e 25 29 0d 15 f4 0e  c8 8e 20 69 63 6f 6e 25  |on%)...... icon%|
00003a70  20 ca 0d 15 fe 0a c9 20  31 31 3a 20 0d 16 08 1e  | ...... 11: ....|
00003a80  e7 20 74 65 6c 65 74 6f  73 63 78 28 72 65 66 65  |. teletoscx(refe|
00003a90  72 65 6e 63 65 29 3c 37  20 8c 0d 16 12 11 f2 75  |rence)<7 ......u|
00003aa0  70 64 61 74 65 6d 61 70  28 30 29 0d 16 1c 1b 74  |pdatemap(0)....t|
00003ab0  65 6c 65 74 6f 73 63 78  28 72 65 66 65 72 65 6e  |eletoscx(referen|
00003ac0  63 65 29 2b 3d 31 0d 16  26 3b f2 57 69 6d 70 5f  |ce)+=1..&;.Wimp_|
00003ad0  49 63 6f 6e 50 75 74 54  65 78 74 28 74 65 6c 65  |IconPutText(tele|
00003ae0  70 6f 72 74 73 25 2c 36  2c c3 28 74 65 6c 65 74  |ports%,6,.(telet|
00003af0  6f 73 63 78 28 72 65 66  65 72 65 6e 63 65 29 29  |oscx(reference))|
00003b00  29 0d 16 30 19 f2 75 70  64 61 74 65 6d 61 70 28  |)..0..updatemap(|
00003b10  31 29 3a f2 75 70 64 61  74 65 0d 16 3a 05 cd 0d  |1):.update..:...|
00003b20  16 44 09 c9 20 31 30 3a  0d 16 4e 1e e7 20 74 65  |.D.. 10:..N.. te|
00003b30  6c 65 74 6f 73 63 78 28  72 65 66 65 72 65 6e 63  |letoscx(referenc|
00003b40  65 29 3e 30 20 8c 0d 16  58 11 f2 75 70 64 61 74  |e)>0 ...X..updat|
00003b50  65 6d 61 70 28 30 29 0d  16 62 1b 74 65 6c 65 74  |emap(0)..b.telet|
00003b60  6f 73 63 78 28 72 65 66  65 72 65 6e 63 65 29 2d  |oscx(reference)-|
00003b70  3d 31 0d 16 6c 3b f2 57  69 6d 70 5f 49 63 6f 6e  |=1..l;.Wimp_Icon|
00003b80  50 75 74 54 65 78 74 28  74 65 6c 65 70 6f 72 74  |PutText(teleport|
00003b90  73 25 2c 36 2c c3 28 74  65 6c 65 74 6f 73 63 78  |s%,6,.(teletoscx|
00003ba0  28 72 65 66 65 72 65 6e  63 65 29 29 29 0d 16 76  |(reference)))..v|
00003bb0  19 f2 75 70 64 61 74 65  6d 61 70 28 31 29 3a f2  |..updatemap(1):.|
00003bc0  75 70 64 61 74 65 0d 16  80 05 cd 0d 16 8a 09 c9  |update..........|
00003bd0  20 31 33 3a 0d 16 94 1e  e7 20 74 65 6c 65 74 6f  | 13:..... teleto|
00003be0  73 63 79 28 72 65 66 65  72 65 6e 63 65 29 3c 33  |scy(reference)<3|
00003bf0  20 8c 0d 16 9e 11 f2 75  70 64 61 74 65 6d 61 70  | ......updatemap|
00003c00  28 30 29 0d 16 a8 1b 74  65 6c 65 74 6f 73 63 79  |(0)....teletoscy|
00003c10  28 72 65 66 65 72 65 6e  63 65 29 2b 3d 31 0d 16  |(reference)+=1..|
00003c20  b2 3b f2 57 69 6d 70 5f  49 63 6f 6e 50 75 74 54  |.;.Wimp_IconPutT|
00003c30  65 78 74 28 74 65 6c 65  70 6f 72 74 73 25 2c 37  |ext(teleports%,7|
00003c40  2c c3 28 74 65 6c 65 74  6f 73 63 79 28 72 65 66  |,.(teletoscy(ref|
00003c50  65 72 65 6e 63 65 29 29  29 0d 16 bc 19 f2 75 70  |erence))).....up|
00003c60  64 61 74 65 6d 61 70 28  31 29 3a f2 75 70 64 61  |datemap(1):.upda|
00003c70  74 65 0d 16 c6 05 cd 0d  16 d0 09 c9 20 31 32 3a  |te.......... 12:|
00003c80  0d 16 da 1e e7 20 74 65  6c 65 74 6f 73 63 79 28  |..... teletoscy(|
00003c90  72 65 66 65 72 65 6e 63  65 29 3e 30 20 8c 0d 16  |reference)>0 ...|
00003ca0  e4 11 f2 75 70 64 61 74  65 6d 61 70 28 30 29 0d  |...updatemap(0).|
00003cb0  16 ee 1b 74 65 6c 65 74  6f 73 63 79 28 72 65 66  |...teletoscy(ref|
00003cc0  65 72 65 6e 63 65 29 2d  3d 31 0d 16 f8 3b f2 57  |erence)-=1...;.W|
00003cd0  69 6d 70 5f 49 63 6f 6e  50 75 74 54 65 78 74 28  |imp_IconPutText(|
00003ce0  74 65 6c 65 70 6f 72 74  73 25 2c 37 2c c3 28 74  |teleports%,7,.(t|
00003cf0  65 6c 65 74 6f 73 63 79  28 72 65 66 65 72 65 6e  |eletoscy(referen|
00003d00  63 65 29 29 29 0d 17 02  19 f2 75 70 64 61 74 65  |ce))).....update|
00003d10  6d 61 70 28 31 29 3a f2  75 70 64 61 74 65 0d 17  |map(1):.update..|
00003d20  0c 05 cd 0d 17 16 09 c9  20 31 35 3a 0d 17 20 71  |........ 15:.. q|
00003d30  e7 20 74 65 6c 65 74 6f  78 28 72 65 66 65 72 65  |. teletox(refere|
00003d40  6e 63 65 29 3c 31 35 20  8c 20 74 65 6c 65 74 6f  |nce)<15 . teleto|
00003d50  78 28 72 65 66 65 72 65  6e 63 65 29 2b 3d 31 3a  |x(reference)+=1:|
00003d60  f2 57 69 6d 70 5f 49 63  6f 6e 50 75 74 54 65 78  |.Wimp_IconPutTex|
00003d70  74 28 74 65 6c 65 70 6f  72 74 73 25 2c 38 2c c3  |t(teleports%,8,.|
00003d80  28 74 65 6c 65 74 6f 78  28 72 65 66 65 72 65 6e  |(teletox(referen|
00003d90  63 65 29 29 29 3a f2 75  70 64 61 74 65 0d 17 2a  |ce))):.update..*|
00003da0  09 c9 20 31 34 3a 0d 17  34 6e e7 20 74 65 6c 65  |.. 14:..4n. tele|
00003db0  74 6f 78 28 72 65 66 65  72 65 6e 63 65 29 3e 30  |tox(reference)>0|
00003dc0  3a 74 65 6c 65 74 6f 78  28 72 65 66 65 72 65 6e  |:teletox(referen|
00003dd0  63 65 29 2d 3d 31 3a f2  57 69 6d 70 5f 49 63 6f  |ce)-=1:.Wimp_Ico|
00003de0  6e 50 75 74 54 65 78 74  28 74 65 6c 65 70 6f 72  |nPutText(telepor|
00003df0  74 73 25 2c 38 2c c3 28  74 65 6c 65 74 6f 78 28  |ts%,8,.(teletox(|
00003e00  72 65 66 65 72 65 6e 63  65 29 29 29 3a f2 75 70  |reference))):.up|
00003e10  64 61 74 65 0d 17 3e 09  c9 20 31 37 3a 0d 17 48  |date..>.. 17:..H|
00003e20  6f e7 20 74 65 6c 65 74  6f 79 28 72 65 66 65 72  |o. teletoy(refer|
00003e30  65 6e 63 65 29 3c 31 35  3a 74 65 6c 65 74 6f 79  |ence)<15:teletoy|
00003e40  28 72 65 66 65 72 65 6e  63 65 29 2b 3d 31 3a f2  |(reference)+=1:.|
00003e50  57 69 6d 70 5f 49 63 6f  6e 50 75 74 54 65 78 74  |Wimp_IconPutText|
00003e60  28 74 65 6c 65 70 6f 72  74 73 25 2c 39 2c c3 28  |(teleports%,9,.(|
00003e70  74 65 6c 65 74 6f 79 28  72 65 66 65 72 65 6e 63  |teletoy(referenc|
00003e80  65 29 29 29 3a f2 75 70  64 61 74 65 0d 17 52 09  |e))):.update..R.|
00003e90  c9 20 31 36 3a 0d 17 5c  6e e7 20 74 65 6c 65 74  |. 16:..\n. telet|
00003ea0  6f 79 28 72 65 66 65 72  65 6e 63 65 29 3e 30 3a  |oy(reference)>0:|
00003eb0  74 65 6c 65 74 6f 79 28  72 65 66 65 72 65 6e 63  |teletoy(referenc|
00003ec0  65 29 2d 3d 31 3a f2 57  69 6d 70 5f 49 63 6f 6e  |e)-=1:.Wimp_Icon|
00003ed0  50 75 74 54 65 78 74 28  74 65 6c 65 70 6f 72 74  |PutText(teleport|
00003ee0  73 25 2c 39 2c c3 28 74  65 6c 65 74 6f 79 28 72  |s%,9,.(teletoy(r|
00003ef0  65 66 65 72 65 6e 63 65  29 29 29 3a f2 75 70 64  |eference))):.upd|
00003f00  61 74 65 0d 17 66 15 c9  20 34 3a f4 20 43 61 6e  |ate..f.. 4:. Can|
00003f10  63 65 6c 20 69 63 6f 6e  0d 17 70 11 f2 75 70 64  |cel icon..p..upd|
00003f20  61 74 65 6d 61 70 28 30  29 0d 17 7a 28 74 65 6c  |atemap(0)..z(tel|
00003f30  65 74 6f 73 63 78 28 72  65 66 65 72 65 6e 63 65  |etoscx(reference|
00003f40  29 3d 74 73 63 78 28 72  65 66 65 72 65 6e 63 65  |)=tscx(reference|
00003f50  29 0d 17 84 28 74 65 6c  65 74 6f 73 63 79 28 72  |)...(teletoscy(r|
00003f60  65 66 65 72 65 6e 63 65  29 3d 74 73 63 79 28 72  |eference)=tscy(r|
00003f70  65 66 65 72 65 6e 63 65  29 0d 17 8e 24 74 65 6c  |eference)...$tel|
00003f80  65 74 6f 78 28 72 65 66  65 72 65 6e 63 65 29 3d  |etox(reference)=|
00003f90  74 78 28 72 65 66 65 72  65 6e 63 65 29 0d 17 98  |tx(reference)...|
00003fa0  24 74 65 6c 65 74 6f 79  28 72 65 66 65 72 65 6e  |$teletoy(referen|
00003fb0  63 65 29 3d 74 79 28 72  65 66 65 72 65 6e 63 65  |ce)=ty(reference|
00003fc0  29 0d 17 a2 38 f2 57 69  6d 70 5f 49 63 6f 6e 50  |)...8.Wimp_IconP|
00003fd0  75 74 54 65 78 74 28 4d  61 70 25 2c 74 68 69 73  |utText(Map%,this|
00003fe0  25 2c 22 6d 61 70 64 6e  22 29 3a 6f 6c 64 69 63  |%,"mapdn"):oldic|
00003ff0  6f 6e 25 3d 74 68 69 73  25 0d 17 ac 2d f2 57 69  |on%=this%...-.Wi|
00004000  6d 70 5f 57 69 6e 64 6f  77 43 6c 6f 73 65 28 74  |mp_WindowClose(t|
00004010  65 6c 65 70 6f 72 74 73  25 29 3a 74 65 6c 65 5f  |eleports%):tele_|
00004020  6f 70 65 6e 3d a3 0d 17  b6 24 f2 57 69 6d 70 5f  |open=....$.Wimp_|
00004030  57 69 6e 64 6f 77 4f 70  65 6e 28 49 63 6f 6e 73  |WindowOpen(Icons|
00004040  25 29 3a f2 75 70 64 61  74 65 0d 17 c0 11 c9 20  |%):.update..... |
00004050  35 3a f4 20 4f 4b 20 69  63 6f 6e 0d 17 ca 11 f2  |5:. OK icon.....|
00004060  75 70 64 61 74 65 6d 61  70 28 31 29 0d 17 d4 3a  |updatemap(1)...:|
00004070  6f 6c 64 69 63 6f 6e 25  3d 28 74 65 6c 65 74 6f  |oldicon%=(teleto|
00004080  73 63 79 28 72 65 66 65  72 65 6e 63 65 29 2a 38  |scy(reference)*8|
00004090  29 2b 74 65 6c 65 74 6f  73 63 78 28 72 65 66 65  |)+teletoscx(refe|
000040a0  72 65 6e 63 65 29 0d 17  de 2d f2 57 69 6d 70 5f  |rence)...-.Wimp_|
000040b0  57 69 6e 64 6f 77 43 6c  6f 73 65 28 74 65 6c 65  |WindowClose(tele|
000040c0  70 6f 72 74 73 25 29 3a  74 65 6c 65 5f 6f 70 65  |ports%):tele_ope|
000040d0  6e 3d a3 0d 17 e8 24 f2  57 69 6d 70 5f 57 69 6e  |n=....$.Wimp_Win|
000040e0  64 6f 77 4f 70 65 6e 28  49 63 6f 6e 73 25 29 3a  |dowOpen(Icons%):|
000040f0  f2 75 70 64 61 74 65 0d  17 f2 05 cb 0d 17 fc 05  |.update.........|
00004100  e1 0d 18 06 05 3a 0d 18  10 29 dd 20 f2 45 76 65  |.....:...). .Eve|
00004110  6e 74 5f 4b 65 79 50 72  65 73 73 28 77 69 6e 64  |nt_KeyPress(wind|
00004120  6f 77 25 2c 69 63 6f 6e  25 2c 6b 65 79 25 29 0d  |ow%,icon%,key%).|
00004130  18 1a 10 c8 8e 20 77 69  6e 64 6f 77 25 20 ca 0d  |..... window% ..|
00004140  18 24 37 c9 20 74 65 6c  65 70 6f 72 74 73 25 20  |.$7. teleports% |
00004150  20 3a 20 f2 55 73 65 72  5f 4b 65 79 50 72 65 73  | : .User_KeyPres|
00004160  73 74 65 6c 65 70 6f 72  74 73 28 69 63 6f 6e 25  |steleports(icon%|
00004170  2c 6b 65 79 25 29 0d 18  2e 05 cb 0d 18 38 05 e1  |,key%).......8..|
00004180  0d 18 42 05 3a 0d 18 4c  29 dd 20 f2 55 73 65 72  |..B.:..L). .User|
00004190  5f 4b 65 79 50 72 65 73  73 74 65 6c 65 70 6f 72  |_KeyPresstelepor|
000041a0  74 73 28 69 63 6f 6e 25  2c 6b 65 79 25 29 0d 18  |ts(icon%,key%)..|
000041b0  56 0d c8 8e 20 6b 65 79  25 20 ca 0d 18 60 13 c9  |V... key% ...`..|
000041c0  20 31 33 3a c8 8e 20 69  63 6f 6e 25 20 ca 0d 18  | 13:.. icon% ...|
000041d0  6a 0f c9 20 36 3a f2 75  70 64 61 74 65 0d 18 74  |j.. 6:.update..t|
000041e0  0f c9 20 37 3a f2 75 70  64 61 74 65 0d 18 7e 0f  |.. 7:.update..~.|
000041f0  c9 20 38 3a f2 75 70 64  61 74 65 0d 18 88 0f c9  |. 8:.update.....|
00004200  20 39 3a f2 75 70 64 61  74 65 0d 18 92 05 cb 0d  | 9:.update......|
00004210  18 9c 1e c9 20 33 39 38  3a f2 6d 6f 76 65 5f 63  |.... 398:.move_c|
00004220  61 72 65 74 28 69 63 6f  6e 25 2c 31 29 0d 18 a6  |aret(icon%,1)...|
00004230  1f c9 20 33 39 39 3a f2  6d 6f 76 65 5f 63 61 72  |.. 399:.move_car|
00004240  65 74 28 69 63 6f 6e 25  2c 2d 31 29 0d 18 b0 05  |et(icon%,-1)....|
00004250  7f 0d 18 ba 1d c8 99 20  22 57 69 6d 70 5f 50 72  |....... "Wimp_Pr|
00004260  6f 63 65 73 73 4b 65 79  22 2c 6b 65 79 25 0d 18  |ocessKey",key%..|
00004270  c4 05 cb 0d 18 ce 05 e1  0d 18 d8 05 3a 0d 18 e2  |............:...|
00004280  1a dd 20 f2 6d 6f 76 65  5f 63 61 72 65 74 28 49  |.. .move_caret(I|
00004290  25 2c 64 69 72 25 29 0d  18 ec 36 e7 20 49 25 3d  |%,dir%)...6. I%=|
000042a0  36 20 80 20 64 69 72 25  3d 2d 31 20 f2 57 69 6d  |6 . dir%=-1 .Wim|
000042b0  70 5f 49 63 6f 6e 43 61  72 65 74 28 74 65 6c 65  |p_IconCaret(tele|
000042c0  70 6f 72 74 73 25 2c 36  2c 30 29 3a e1 0d 18 f6  |ports%,6,0):....|
000042d0  35 e7 20 49 25 3d 36 20  80 20 64 69 72 25 3d 31  |5. I%=6 . dir%=1|
000042e0  20 f2 57 69 6d 70 5f 49  63 6f 6e 43 61 72 65 74  | .Wimp_IconCaret|
000042f0  28 74 65 6c 65 70 6f 72  74 73 25 2c 37 2c 30 29  |(teleports%,7,0)|
00004300  3a e1 0d 19 00 36 e7 20  49 25 3d 37 20 80 20 64  |:....6. I%=7 . d|
00004310  69 72 25 3d 2d 31 20 f2  57 69 6d 70 5f 49 63 6f  |ir%=-1 .Wimp_Ico|
00004320  6e 43 61 72 65 74 28 74  65 6c 65 70 6f 72 74 73  |nCaret(teleports|
00004330  25 2c 36 2c 30 29 3a e1  0d 19 0a 35 e7 20 49 25  |%,6,0):....5. I%|
00004340  3d 37 20 80 20 64 69 72  25 3d 31 20 f2 57 69 6d  |=7 . dir%=1 .Wim|
00004350  70 5f 49 63 6f 6e 43 61  72 65 74 28 74 65 6c 65  |p_IconCaret(tele|
00004360  70 6f 72 74 73 25 2c 38  2c 30 29 3a e1 0d 19 14  |ports%,8,0):....|
00004370  36 e7 20 49 25 3d 38 20  80 20 64 69 72 25 3d 2d  |6. I%=8 . dir%=-|
00004380  31 20 f2 57 69 6d 70 5f  49 63 6f 6e 43 61 72 65  |1 .Wimp_IconCare|
00004390  74 28 74 65 6c 65 70 6f  72 74 73 25 2c 37 2c 30  |t(teleports%,7,0|
000043a0  29 3a e1 0d 19 1e 35 e7  20 49 25 3d 38 20 80 20  |):....5. I%=8 . |
000043b0  64 69 72 25 3d 31 20 f2  57 69 6d 70 5f 49 63 6f  |dir%=1 .Wimp_Ico|
000043c0  6e 43 61 72 65 74 28 74  65 6c 65 70 6f 72 74 73  |nCaret(teleports|
000043d0  25 2c 39 2c 30 29 3a e1  0d 19 28 36 e7 20 49 25  |%,9,0):...(6. I%|
000043e0  3d 39 20 80 20 64 69 72  25 3d 2d 31 20 f2 57 69  |=9 . dir%=-1 .Wi|
000043f0  6d 70 5f 49 63 6f 6e 43  61 72 65 74 28 74 65 6c  |mp_IconCaret(tel|
00004400  65 70 6f 72 74 73 25 2c  38 2c 30 29 3a e1 0d 19  |eports%,8,0):...|
00004410  32 35 e7 20 49 25 3d 39  20 80 20 64 69 72 25 3d  |25. I%=9 . dir%=|
00004420  31 20 f2 57 69 6d 70 5f  49 63 6f 6e 43 61 72 65  |1 .Wimp_IconCare|
00004430  74 28 74 65 6c 65 70 6f  72 74 73 25 2c 39 2c 30  |t(teleports%,9,0|
00004440  29 3a e1 0d 19 3c 05 e1  0d 19 46 05 3a 0d 19 50  |):...<....F.:..P|
00004450  1e dd 20 f2 45 76 65 6e  74 5f 4d 65 6e 75 43 68  |.. .Event_MenuCh|
00004460  6f 69 63 65 28 6d 65 6e  75 25 29 0d 19 5a 0e c8  |oice(menu%)..Z..|
00004470  8e 20 6d 65 6e 75 25 20  ca 0d 19 64 2e c9 20 42  |. menu% ...d.. B|
00004480  61 72 5f 4d 65 6e 75 25  20 20 20 20 20 20 20 20  |ar_Menu%        |
00004490  20 20 3a 20 f2 55 73 65  72 5f 4d 65 6e 75 43 68  |  : .User_MenuCh|
000044a0  6f 69 63 65 42 61 72 0d  19 6e 31 c9 20 53 63 72  |oiceBar..n1. Scr|
000044b0  65 65 6e 5f 4d 65 6e 75  25 20 20 20 20 20 20 20  |een_Menu%       |
000044c0  3a 20 f2 55 73 65 72 5f  4d 65 6e 75 43 68 6f 69  |: .User_MenuChoi|
000044d0  63 65 53 63 72 65 65 6e  0d 19 78 05 cb 0d 19 82  |ceScreen..x.....|
000044e0  05 e1 0d 19 8c 05 3a 0d  19 96 19 dd 20 f2 55 73  |......:..... .Us|
000044f0  65 72 5f 4d 65 6e 75 43  68 6f 69 63 65 42 61 72  |er_MenuChoiceBar|
00004500  0d 19 a0 0e e7 20 73 61  76 65 3d a3 20 8c 0d 19  |..... save=. ...|
00004510  aa 1c c8 8e 20 a4 57 69  6d 70 5f 4d 65 6e 75 43  |.... .Wimp_MenuC|
00004520  68 6f 69 63 65 28 30 29  20 ca 0d 19 b4 09 c9 20  |hoice(0) ...... |
00004530  31 20 3a 0d 19 be 13 c9  20 32 20 3a 20 f2 6f 70  |1 :..... 2 : .op|
00004540  65 6e 74 65 78 74 0d 19  c8 09 c9 20 33 20 3a 0d  |entext..... 3 :.|
00004550  19 d2 10 e7 20 75 70 64  61 74 65 3d b9 20 8c 0d  |.... update=. ..|
00004560  19 dc 24 f2 57 69 6d 70  5f 57 69 6e 64 6f 77 42  |..$.Wimp_WindowB|
00004570  72 69 6e 67 54 6f 54 6f  70 28 63 68 65 63 6b 65  |ringToTop(checke|
00004580  72 25 29 0d 19 e6 17 f2  6d 6f 75 73 65 62 6f 78  |r%).....mousebox|
00004590  28 63 68 65 63 6b 65 72  25 29 0d 19 f0 05 cd 0d  |(checker%)......|
000045a0  19 fa 1c e7 20 75 70 64  61 74 65 3d a3 20 8c 20  |.... update=. . |
000045b0  66 69 6e 69 73 68 65 64  25 3d b9 0d 1a 04 05 cb  |finished%=......|
000045c0  0d 1a 0e 05 cd 0d 1a 18  05 e1 0d 1a 22 05 3a 0d  |............".:.|
000045d0  1a 2c 13 dd 20 f2 6d 6f  75 73 65 62 6f 78 28 77  |.,.. .mousebox(w|
000045e0  25 29 0d 1a 36 0e 77 69  6d 70 25 21 30 3d 77 25  |%)..6.wimp%!0=w%|
000045f0  0d 1a 40 25 c8 99 20 22  57 69 6d 70 5f 47 65 74  |..@%.. "Wimp_Get|
00004600  57 69 6e 64 6f 77 4f 75  74 6c 69 6e 65 22 2c 2c  |WindowOutline",,|
00004610  77 69 6d 70 25 0d 1a 4a  43 c8 97 20 c8 93 20 77  |wimp%..JC.. .. w|
00004620  69 6d 70 25 21 34 2b 32  2c 77 69 6d 70 25 21 38  |imp%!4+2,wimp%!8|
00004630  2b 32 2c 77 69 6d 70 25  21 31 32 2d 77 69 6d 70  |+2,wimp%!12-wimp|
00004640  25 21 34 2d 34 2c 77 69  6d 70 25 21 31 36 2d 77  |%!4-4,wimp%!16-w|
00004650  69 6d 70 25 21 38 2d 34  0d 1a 54 05 e1 0d 1a 5e  |imp%!8-4..T....^|
00004660  05 3a 0d 1a 68 0c dd 20  f2 75 6e 62 6f 78 0d 1a  |.:..h.. .unbox..|
00004670  72 2b c8 99 20 22 4f 53  5f 52 65 61 64 4d 6f 64  |r+.. "OS_ReadMod|
00004680  65 56 61 72 69 61 62 6c  65 22 2c 2d 31 2c 31 31  |eVariable",-1,11|
00004690  20 b8 20 2c 2c 78 70 69  63 0d 1a 7c 2b c8 99 20  | . ,,xpic..|+.. |
000046a0  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
000046b0  61 62 6c 65 22 2c 2d 31  2c 31 32 20 b8 20 2c 2c  |able",-1,12 . ,,|
000046c0  79 70 69 63 0d 1a 86 2b  c8 99 20 22 4f 53 5f 52  |ypic...+.. "OS_R|
000046d0  65 61 64 4d 6f 64 65 56  61 72 69 61 62 6c 65 22  |eadModeVariable"|
000046e0  2c 2d 31 2c 34 20 b8 20  2c 2c 78 66 61 63 74 0d  |,-1,4 . ,,xfact.|
000046f0  1a 90 2b c8 99 20 22 4f  53 5f 52 65 61 64 4d 6f  |..+.. "OS_ReadMo|
00004700  64 65 56 61 72 69 61 62  6c 65 22 2c 2d 31 2c 35  |deVariable",-1,5|
00004710  20 b8 20 2c 2c 79 66 61  63 74 0d 1a 9a 25 c8 97  | . ,,yfact...%..|
00004720  20 c8 93 20 30 2c 30 2c  78 70 69 63 3c 3c 78 66  | .. 0,0,xpic<<xf|
00004730  61 63 74 2c 79 70 69 63  3c 3c 79 66 61 63 74 0d  |act,ypic<<yfact.|
00004740  1a a4 05 e1 0d 1a ae 05  3a 0d 1a b8 1c dd 20 f2  |........:..... .|
00004750  55 73 65 72 5f 4d 65 6e  75 43 68 6f 69 63 65 53  |User_MenuChoiceS|
00004760  63 72 65 65 6e 0d 1a c2  1c c8 8e 20 a4 57 69 6d  |creen...... .Wim|
00004770  70 5f 4d 65 6e 75 43 68  6f 69 63 65 28 30 29 20  |p_MenuChoice(0) |
00004780  ca 0d 1a cc 0a c9 20 31  20 3a 20 0d 1a d6 0a c9  |...... 1 : .....|
00004790  20 32 20 3a 20 0d 1a e0  18 c9 20 33 20 3a 20 e7  | 2 : ..... 3 : .|
000047a0  20 74 65 6c 65 6e 75 6d  25 3e 30 20 8c 0d 1a ea  | telenum%>0 ....|
000047b0  20 f2 57 69 6d 70 5f 57  69 6e 64 6f 77 4f 70 65  | .Wimp_WindowOpe|
000047c0  6e 28 74 65 6c 65 70 6f  72 74 73 25 29 0d 1a f4  |n(teleports%)...|
000047d0  29 f2 57 69 6d 70 5f 57  69 6e 64 6f 77 43 6c 6f  |).Wimp_WindowClo|
000047e0  73 65 28 49 63 6f 6e 73  25 29 3a 74 65 6c 65 5f  |se(Icons%):tele_|
000047f0  6f 70 65 6e 3d b9 0d 1a  fe 2c f2 57 69 6d 70 5f  |open=....,.Wimp_|
00004800  49 63 6f 6e 50 75 74 54  65 78 74 28 4d 61 70 25  |IconPutText(Map%|
00004810  2c 6f 6c 64 69 63 6f 6e  25 2c 22 6d 61 70 75 70  |,oldicon%,"mapup|
00004820  22 29 0d 1b 08 38 6f 6c  64 69 63 6f 6e 25 3d 28  |")...8oldicon%=(|
00004830  74 65 6c 65 74 6f 73 63  79 28 74 65 6c 65 6e 75  |teletoscy(telenu|
00004840  6d 25 29 2a 38 29 2b 74  65 6c 65 74 6f 73 63 78  |m%)*8)+teletoscx|
00004850  28 74 65 6c 65 6e 75 6d  25 29 0d 1b 12 27 f2 75  |(telenum%)...'.u|
00004860  70 64 61 74 65 6d 61 70  28 30 29 3a f2 75 70 64  |pdatemap(0):.upd|
00004870  61 74 65 6d 61 70 28 31  29 3a f2 75 70 64 61 74  |atemap(1):.updat|
00004880  65 0d 1b 1c 05 cd 0d 1b  26 05 cb 0d 1b 30 05 e1  |e.......&....0..|
00004890  0d 1b 3a 05 3a 0d 1b 44  22 dd 20 f2 45 76 65 6e  |..:.:..D". .Even|
000048a0  74 5f 4c 6f 61 64 46 69  6c 65 28 66 69 6c 65 24  |t_LoadFile(file$|
000048b0  2c 74 79 70 65 24 29 0d  1b 4e 55 e7 20 74 79 70  |,type$)..NU. typ|
000048c0  65 24 3c 3e 22 32 32 22  3a f2 57 69 6d 70 5f 57  |e$<>"22":.Wimp_W|
000048d0  69 6e 64 6f 77 41 6c 65  72 74 28 22 43 61 76 65  |indowAlert("Cave|
000048e0  72 6e 20 44 75 65 6c 20  45 64 69 74 6f 72 22 2c  |rn Duel Editor",|
000048f0  22 54 68 69 73 20 69 73  20 6e 6f 74 20 61 20 43  |"This is not a C|
00004900  61 76 65 46 69 6c 65 21  22 29 3a e1 0d 1b 58 10  |aveFile!"):...X.|
00004910  e7 20 75 70 64 61 74 65  3d b9 20 8c 0d 1b 62 87  |. update=. ...b.|
00004920  63 68 65 63 6b 25 3d a4  57 69 6d 70 5f 57 69 6e  |check%=.Wimp_Win|
00004930  64 6f 77 43 61 6e 63 65  6c 28 22 43 61 76 65 72  |dowCancel("Caver|
00004940  6e 20 44 75 65 6c 20 45  64 69 74 6f 72 22 2c 22  |n Duel Editor","|
00004950  54 68 65 20 63 75 72 72  65 6e 74 20 43 61 76 65  |The current Cave|
00004960  46 69 6c 65 20 68 61 73  20 62 65 65 6e 20 6d 6f  |File has been mo|
00004970  64 69 66 69 65 64 2c 20  61 72 65 20 79 6f 75 20  |dified, are you |
00004980  73 75 72 65 20 79 6f 75  20 77 61 6e 74 20 74 6f  |sure you want to|
00004990  20 6c 6f 61 64 20 61 20  6e 65 77 20 6f 6e 65 20  | load a new one |
000049a0  3f 22 29 0d 1b 6c 19 e7  20 63 68 65 63 6b 25 3d  |?")..l.. check%=|
000049b0  b9 20 8c 20 75 70 64 61  74 65 3d a3 0d 1b 76 1b  |. . update=...v.|
000049c0  e7 20 63 68 65 63 6b 25  3d a3 20 8c 20 75 70 64  |. check%=. . upd|
000049d0  61 74 65 3d b9 3a e1 0d  1b 80 05 cd 0d 1b 8a 27  |ate=.:.........'|
000049e0  f2 57 69 6d 70 5f 49 63  6f 6e 50 75 74 54 65 78  |.Wimp_IconPutTex|
000049f0  74 28 73 61 76 65 62 6f  78 25 2c 31 2c 66 69 6c  |t(savebox%,1,fil|
00004a00  65 24 29 0d 1b 94 15 c8  99 20 22 48 6f 75 72 67  |e$)...... "Hourg|
00004a10  6c 61 73 73 5f 4f 6e 22  0d 1b 9e 39 78 3d 30 3a  |lass_On"...9x=0:|
00004a20  79 3d 31 35 3a 73 63 72  78 3d 30 3a 73 63 72 79  |y=15:scrx=0:scry|
00004a30  3d 30 3a 74 65 6c 65 6e  75 6d 25 3d 30 3a 62 61  |=0:telenum%=0:ba|
00004a40  63 6b 75 70 25 3d 30 3a  64 65 66 69 6e 65 64 3d  |ckup%=0:defined=|
00004a50  30 0d 1b a8 14 63 68 61  6e 6e 65 6c 3d 8e 28 66  |0....channel=.(f|
00004a60  69 6c 65 24 29 0d 1b b2  09 61 24 3d 22 22 0d 1b  |ile$)....a$=""..|
00004a70  bc 13 41 24 3d bd 28 9a  23 63 68 61 6e 6e 65 6c  |..A$=.(.#channel|
00004a80  29 0d 1b c6 ac e7 20 41  24 3d 22 23 22 20 8c 20  |)..... A$="#" . |
00004a90  70 72 6f 74 65 63 74 25  3d 31 3a f2 57 69 6d 70  |protect%=1:.Wimp|
00004aa0  5f 57 69 6e 64 6f 77 41  6c 65 72 74 28 22 43 61  |_WindowAlert("Ca|
00004ab0  76 65 72 6e 20 44 75 65  6c 20 45 64 69 74 6f 72  |vern Duel Editor|
00004ac0  22 2c 22 54 68 69 73 20  43 61 76 65 46 69 6c 65  |","This CaveFile|
00004ad0  20 68 61 73 20 62 65 65  6e 20 70 72 6f 74 65 63  | has been protec|
00004ae0  74 65 64 20 66 72 6f 6d  20 61 6c 74 65 72 61 74  |ted from alterat|
00004af0  69 6f 6e 2e 20 54 68 65  20 6d 61 70 20 65 64 69  |ion. The map edi|
00004b00  74 69 6e 67 20 61 6e 64  20 73 61 76 69 6e 67 20  |ting and saving |
00004b10  66 75 6e 63 74 69 6f 6e  73 20 77 69 6c 6c 20 62  |functions will b|
00004b20  65 20 64 69 73 61 62 6c  65 64 21 22 29 0d 1b d0  |e disabled!")...|
00004b30  1e f2 57 69 6d 70 5f 57  69 6e 64 6f 77 43 6c 6f  |..Wimp_WindowClo|
00004b40  73 65 28 73 63 72 65 65  6e 25 29 0d 1b da 28 e7  |se(screen%)...(.|
00004b50  20 70 72 6f 74 65 63 74  25 3a f2 57 69 6d 70 5f  | protect%:.Wimp_|
00004b60  57 69 6e 64 6f 77 43 6c  6f 73 65 28 49 63 6f 6e  |WindowClose(Icon|
00004b70  73 25 29 0d 1b e4 38 e7  20 70 72 6f 74 65 63 74  |s%)...8. protect|
00004b80  25 3a f2 57 69 6d 70 5f  57 69 6e 64 6f 77 43 6c  |%:.Wimp_WindowCl|
00004b90  6f 73 65 28 74 65 6c 65  70 6f 72 74 73 25 29 3a  |ose(teleports%):|
00004ba0  74 65 6c 65 5f 6f 70 65  6e 3d a3 0d 1b ee 19 e7  |tele_open=......|
00004bb0  20 41 24 3d 22 2a 22 20  8c 20 70 72 6f 74 65 63  | A$="*" . protec|
00004bc0  74 25 3d 30 0d 1b f8 05  f5 0d 1c 02 08 79 3d 31  |t%=0.........y=1|
00004bd0  35 0d 1c 0c 05 f5 0d 1c  16 13 61 24 3d bd 28 9a  |5.........a$=.(.|
00004be0  23 63 68 61 6e 6e 65 6c  29 0d 1c 20 0b c8 8e 20  |#channel).. ... |
00004bf0  61 24 20 ca 0d 1c 2a 11  c9 20 22 41 22 3a 61 24  |a$ ...*.. "A":a$|
00004c00  3d 22 31 32 22 0d 1c 34  11 c9 20 22 42 22 3a 61  |="12"..4.. "B":a|
00004c10  24 3d 22 31 31 22 0d 1c  3e 11 c9 20 22 43 22 3a  |$="11"..>.. "C":|
00004c20  61 24 3d 22 31 30 22 0d  1c 48 11 c9 20 22 44 22  |a$="10"..H.. "D"|
00004c30  3a 61 24 3d 22 31 33 22  0d 1c 52 11 c9 20 22 45  |:a$="13"..R.. "E|
00004c40  22 3a 61 24 3d 22 31 34  22 0d 1c 5c 11 c9 20 22  |":a$="14"..\.. "|
00004c50  46 22 3a 61 24 3d 22 31  35 22 0d 1c 66 11 c9 20  |F":a$="15"..f.. |
00004c60  22 47 22 3a 61 24 3d 22  31 36 22 0d 1c 70 47 c9  |"G":a$="16"..pG.|
00004c70  20 22 50 22 3a 61 24 3d  22 31 37 22 3a 79 6f 75  | "P":a$="17":you|
00004c80  78 28 31 29 3d 78 3a 79  6f 75 79 28 31 29 3d 79  |x(1)=x:youy(1)=y|
00004c90  3a 79 73 63 78 28 31 29  3d 73 63 72 78 3a 79 73  |:yscx(1)=scrx:ys|
00004ca0  63 79 28 31 29 3d 73 63  72 79 3a 67 72 65 65 6e  |cy(1)=scry:green|
00004cb0  3d b9 0d 1c 7a 45 c9 20  22 51 22 3a 61 24 3d 22  |=...zE. "Q":a$="|
00004cc0  31 38 22 3a 79 6f 75 78  28 32 29 3d 78 3a 79 6f  |18":youx(2)=x:yo|
00004cd0  75 79 28 32 29 3d 79 3a  79 73 63 78 28 32 29 3d  |uy(2)=y:yscx(2)=|
00004ce0  73 63 72 78 3a 79 73 63  79 28 32 29 3d 73 63 72  |scrx:yscy(2)=scr|
00004cf0  79 3a 72 65 64 3d b9 0d  1c 84 11 c9 20 22 48 22  |y:red=...... "H"|
00004d00  3a 61 24 3d 22 31 39 22  0d 1c 8e 05 cb 0d 1c 98  |:a$="19"........|
00004d10  1d 73 63 72 65 65 6e 24  28 73 63 72 78 2c 73 63  |.screen$(scrx,sc|
00004d20  72 79 2c 78 2c 79 29 3d  61 24 0d 1c a2 49 e7 20  |ry,x,y)=a$...I. |
00004d30  61 24 3d 22 37 22 20 3a  f2 72 65 61 64 5f 64 65  |a$="7" :.read_de|
00004d40  74 61 69 6c 73 5f 6f 66  5f 74 65 6c 65 70 6f 72  |tails_of_telepor|
00004d50  74 3a 74 65 6c 65 6e 75  6d 25 2b 3d 31 3a 62 61  |t:telenum%+=1:ba|
00004d60  63 6b 75 70 25 2b 3d 31  3a 64 65 66 69 6e 65 64  |ckup%+=1:defined|
00004d70  2b 3d 31 0d 1c ac 1a 78  2b 3d 31 3a e7 20 78 3e  |+=1....x+=1:. x>|
00004d80  31 35 20 8c 20 78 3d 30  3a 79 2d 3d 31 0d 1c b6  |15 . x=0:y-=1...|
00004d90  09 fd 20 79 3c 30 0d 1c  c0 13 61 24 3d bd 28 9a  |.. y<0....a$=.(.|
00004da0  23 63 68 61 6e 6e 65 6c  29 0d 1c ca 89 e7 20 61  |#channel)..... a|
00004db0  24 3c 3e 22 2d 22 20 8c  20 c8 99 20 22 58 4f 53  |$<>"-" . .. "XOS|
00004dc0  5f 43 4c 49 22 2c 22 43  6c 6f 73 65 22 3a f2 57  |_CLI","Close":.W|
00004dd0  69 6d 70 5f 57 69 6e 64  6f 77 41 6c 65 72 74 28  |imp_WindowAlert(|
00004de0  22 43 61 76 65 72 6e 20  44 75 65 6c 20 45 64 69  |"Cavern Duel Edi|
00004df0  74 6f 72 22 2c 22 44 61  6d 61 67 65 64 20 43 61  |tor","Damaged Ca|
00004e00  76 65 46 69 6c 65 2e 20  54 68 65 20 6c 6f 61 64  |veFile. The load|
00004e10  20 6f 70 65 72 61 74 69  6f 6e 20 68 61 73 20 62  | operation has b|
00004e20  65 65 6e 20 63 61 6e 63  65 6c 6c 65 64 2e 22 29  |een cancelled.")|
00004e30  3a e1 0d 1c d4 25 73 63  72 79 2b 3d 31 3a e7 20  |:....%scry+=1:. |
00004e40  73 63 72 79 3e 33 20 8c  20 73 63 72 79 3d 30 3a  |scry>3 . scry=0:|
00004e50  73 63 72 78 2b 3d 31 0d  1c de 0c fd 20 73 63 72  |scrx+=1..... scr|
00004e60  78 3e 37 0d 1c e8 18 c8  99 20 22 58 4f 53 5f 43  |x>7...... "XOS_C|
00004e70  4c 49 22 2c 22 43 6c 6f  73 65 22 0d 1c f2 14 74  |LI","Close"....t|
00004e80  65 6c 65 6e 75 6d 25 3d  62 61 63 6b 75 70 25 0d  |elenum%=backup%.|
00004e90  1c fc 18 e3 20 41 25 3d  74 65 6c 65 6e 75 6d 25  |.... A%=telenum%|
00004ea0  2b 31 20 b8 20 32 30 0d  1d 06 0f 61 63 74 69 76  |+1 . 20....activ|
00004eb0  28 41 25 29 3d 30 0d 1d  10 67 74 65 6c 65 74 6f  |(A%)=0...gteleto|
00004ec0  73 63 78 28 41 25 29 3d  30 3a 74 65 6c 65 74 6f  |scx(A%)=0:teleto|
00004ed0  73 63 79 28 41 25 29 3d  30 3a 74 65 6c 65 74 6f  |scy(A%)=0:teleto|
00004ee0  78 28 41 25 29 3d 30 3a  74 65 6c 65 74 6f 79 28  |x(A%)=0:teletoy(|
00004ef0  41 25 29 3d 30 3a 74 73  63 78 28 41 25 29 3d 30  |A%)=0:tscx(A%)=0|
00004f00  3a 74 73 63 79 28 41 25  29 3d 30 3a 74 78 28 41  |:tscy(A%)=0:tx(A|
00004f10  25 29 3d 30 3a 74 79 28  41 25 29 3d 30 0d 1d 1a  |%)=0:ty(A%)=0...|
00004f20  05 ed 0d 1d 24 0b 73 61  66 65 25 3d b9 0d 1d 2e  |....$.safe%=....|
00004f30  12 63 61 76 65 5f 6c 6f  61 64 65 64 25 3d b9 0d  |.cave_loaded%=..|
00004f40  1d 38 15 73 70 72 69 74  65 5f 64 65 6c 65 74 65  |.8.sprite_delete|
00004f50  64 25 3d a3 0d 1d 42 0e  74 65 6c 65 6e 75 6d 25  |d%=...B.telenum%|
00004f60  3d 31 0d 1d 4c 3a f2 57  69 6d 70 5f 49 63 6f 6e  |=1..L:.Wimp_Icon|
00004f70  50 75 74 54 65 78 74 28  74 65 6c 65 70 6f 72 74  |PutText(teleport|
00004f80  73 25 2c 36 2c c3 28 74  65 6c 65 74 6f 73 63 78  |s%,6,.(teletoscx|
00004f90  28 74 65 6c 65 6e 75 6d  25 29 29 29 0d 1d 56 3a  |(telenum%)))..V:|
00004fa0  f2 57 69 6d 70 5f 49 63  6f 6e 50 75 74 54 65 78  |.Wimp_IconPutTex|
00004fb0  74 28 74 65 6c 65 70 6f  72 74 73 25 2c 37 2c c3  |t(teleports%,7,.|
00004fc0  28 74 65 6c 65 74 6f 73  63 79 28 74 65 6c 65 6e  |(teletoscy(telen|
00004fd0  75 6d 25 29 29 29 0d 1d  60 38 f2 57 69 6d 70 5f  |um%)))..`8.Wimp_|
00004fe0  49 63 6f 6e 50 75 74 54  65 78 74 28 74 65 6c 65  |IconPutText(tele|
00004ff0  70 6f 72 74 73 25 2c 38  2c c3 28 74 65 6c 65 74  |ports%,8,.(telet|
00005000  6f 78 28 74 65 6c 65 6e  75 6d 25 29 29 29 0d 1d  |ox(telenum%)))..|
00005010  6a 38 f2 57 69 6d 70 5f  49 63 6f 6e 50 75 74 54  |j8.Wimp_IconPutT|
00005020  65 78 74 28 74 65 6c 65  70 6f 72 74 73 25 2c 39  |ext(teleports%,9|
00005030  2c c3 28 74 65 6c 65 74  6f 79 28 74 65 6c 65 6e  |,.(teletoy(telen|
00005040  75 6d 25 29 29 29 0d 1d  74 18 c8 99 20 22 48 6f  |um%)))..t... "Ho|
00005050  75 72 67 6c 61 73 73 5f  53 6d 61 73 68 22 0d 1d  |urglass_Smash"..|
00005060  7e 1d f2 57 69 6d 70 5f  57 69 6e 64 6f 77 4f 70  |~..Wimp_WindowOp|
00005070  65 6e 28 73 63 72 65 65  6e 25 29 0d 1d 88 22 f2  |en(screen%)...".|
00005080  57 69 6d 70 5f 57 69 6e  64 6f 77 46 6f 72 63 65  |Wimp_WindowForce|
00005090  44 72 61 77 28 73 63 72  65 65 6e 25 29 0d 1d 92  |Draw(screen%)...|
000050a0  1a f2 57 69 6d 70 5f 57  69 6e 64 6f 77 4f 70 65  |..Wimp_WindowOpe|
000050b0  6e 28 4d 61 70 25 29 0d  1d 9c 1c f2 57 69 6d 70  |n(Map%).....Wimp|
000050c0  5f 57 69 6e 64 6f 77 4f  70 65 6e 28 49 63 6f 6e  |_WindowOpen(Icon|
000050d0  73 25 29 0d 1d a6 05 e1  0d 1d b0 05 3a 0d 1d ba  |s%).........:...|
000050e0  1f dd 20 f2 72 65 61 64  5f 64 65 74 61 69 6c 73  |.. .read_details|
000050f0  5f 6f 66 5f 74 65 6c 65  70 6f 72 74 0d 1d c4 16  |_of_teleport....|
00005100  e7 20 74 65 6c 65 6e 75  6d 25 3e 32 30 20 ef 37  |. telenum%>20 .7|
00005110  3a e1 0d 1d ce 14 74 31  24 3d bd 28 9a 23 63 68  |:.....t1$=.(.#ch|
00005120  61 6e 6e 65 6c 29 0d 1d  d8 14 74 32 24 3d bd 28  |annel)....t2$=.(|
00005130  9a 23 63 68 61 6e 6e 65  6c 29 0d 1d e2 25 74 33  |.#channel)...%t3|
00005140  24 3d bd 28 9a 23 63 68  61 6e 6e 65 6c 29 3a 74  |$=.(.#channel):t|
00005150  34 24 3d bd 28 9a 23 63  68 61 6e 6e 65 6c 29 0d  |4$=.(.#channel).|
00005160  1d ec 15 61 63 74 69 76  28 74 65 6c 65 6e 75 6d  |...activ(telenum|
00005170  25 29 3d 31 0d 1d f6 21  74 65 6c 65 74 6f 73 63  |%)=1...!teletosc|
00005180  78 28 74 65 6c 65 6e 75  6d 25 29 3d 97 28 74 31  |x(telenum%)=.(t1|
00005190  24 29 2d 36 35 0d 1e 00  21 74 65 6c 65 74 6f 73  |$)-65...!teletos|
000051a0  63 79 28 74 65 6c 65 6e  75 6d 25 29 3d 97 28 74  |cy(telenum%)=.(t|
000051b0  32 24 29 2d 36 35 0d 1e  0a 1f 74 65 6c 65 74 6f  |2$)-65....teleto|
000051c0  78 28 74 65 6c 65 6e 75  6d 25 29 3d 97 28 74 33  |x(telenum%)=.(t3|
000051d0  24 29 2d 36 35 0d 1e 14  1f 74 65 6c 65 74 6f 79  |$)-65....teletoy|
000051e0  28 74 65 6c 65 6e 75 6d  25 29 3d 97 28 74 34 24  |(telenum%)=.(t4$|
000051f0  29 2d 36 35 0d 1e 1e 17  74 73 63 78 28 74 65 6c  |)-65....tscx(tel|
00005200  65 6e 75 6d 25 29 3d 73  63 72 78 0d 1e 28 17 74  |enum%)=scrx..(.t|
00005210  73 63 79 28 74 65 6c 65  6e 75 6d 25 29 3d 73 63  |scy(telenum%)=sc|
00005220  72 79 0d 1e 32 12 74 78  28 74 65 6c 65 6e 75 6d  |ry..2.tx(telenum|
00005230  25 29 3d 78 0d 1e 3c 12  74 79 28 74 65 6c 65 6e  |%)=x..<.ty(telen|
00005240  75 6d 25 29 3d 79 0d 1e  46 05 e1 0d 1e 50 05 3a  |um%)=y..F....P.:|
00005250  0d 1e 5a 24 dd 20 f2 45  76 65 6e 74 5f 53 61 76  |..Z$. .Event_Sav|
00005260  65 46 69 6c 65 28 66 69  6c 65 24 2c 77 69 6e 64  |eFile(file$,wind|
00005270  6f 77 25 29 0d 1e 64 10  c8 8e 20 77 69 6e 64 6f  |ow%)..d... windo|
00005280  77 25 20 ca 0d 1e 6e 0e  c9 20 73 61 76 65 62 6f  |w% ...n.. savebo|
00005290  78 25 0d 1e 78 c9 e7 20  72 65 64 3d a3 20 80 20  |x%..x.. red=. . |
000052a0  67 72 65 65 6e 3d b9 20  8c 20 f2 57 69 6d 70 5f  |green=. . .Wimp_|
000052b0  57 69 6e 64 6f 77 41 6c  65 72 74 28 22 43 61 76  |WindowAlert("Cav|
000052c0  65 72 6e 20 44 75 65 6c  20 45 64 69 74 6f 72 22  |ern Duel Editor"|
000052d0  2c 22 59 6f 75 20 68 61  76 65 6e 27 74 20 64 65  |,"You haven't de|
000052e0  66 69 6e 65 64 20 61 20  6c 6f 63 61 74 69 6f 6e  |fined a location|
000052f0  20 66 6f 72 20 74 68 65  20 72 65 64 20 70 6c 61  | for the red pla|
00005300  79 65 72 2e 20 54 68 65  20 73 61 76 65 20 6f 70  |yer. The save op|
00005310  65 72 61 74 69 6f 6e 20  68 61 73 20 62 65 65 6e  |eration has been|
00005320  20 63 61 6e 63 65 6c 6c  65 64 2e 22 29 3a f2 57  | cancelled."):.W|
00005330  69 6d 70 5f 57 69 6e 64  6f 77 43 6c 6f 73 65 28  |imp_WindowClose(|
00005340  73 61 76 65 62 6f 78 25  29 3a f2 57 69 6d 70 5f  |savebox%):.Wimp_|
00005350  4d 65 6e 75 43 6c 6f 73  65 3a e1 0d 1e 82 cb e7  |MenuClose:......|
00005360  20 67 72 65 65 6e 3d a3  20 80 20 72 65 64 3d b9  | green=. . red=.|
00005370  20 8c 20 f2 57 69 6d 70  5f 57 69 6e 64 6f 77 41  | . .Wimp_WindowA|
00005380  6c 65 72 74 28 22 43 61  76 65 72 6e 20 44 75 65  |lert("Cavern Due|
00005390  6c 20 45 64 69 74 6f 72  22 2c 22 59 6f 75 20 68  |l Editor","You h|
000053a0  61 76 65 6e 27 74 20 64  65 66 69 6e 65 64 20 61  |aven't defined a|
000053b0  20 6c 6f 63 61 74 69 6f  6e 20 66 6f 72 20 74 68  | location for th|
000053c0  65 20 67 72 65 65 6e 20  70 6c 61 79 65 72 2e 20  |e green player. |
000053d0  54 68 65 20 73 61 76 65  20 6f 70 65 72 61 74 69  |The save operati|
000053e0  6f 6e 20 68 61 73 20 62  65 65 6e 20 63 61 6e 63  |on has been canc|
000053f0  65 6c 6c 65 64 2e 22 29  3a f2 57 69 6d 70 5f 57  |elled."):.Wimp_W|
00005400  69 6e 64 6f 77 43 6c 6f  73 65 28 73 61 76 65 62  |indowClose(saveb|
00005410  6f 78 25 29 3a f2 57 69  6d 70 5f 4d 65 6e 75 43  |ox%):.Wimp_MenuC|
00005420  6c 6f 73 65 3a e1 0d 1e  8c d7 e7 20 72 65 64 3d  |lose:...... red=|
00005430  a3 20 80 20 67 72 65 65  6e 3d a3 20 8c 20 f2 57  |. . green=. . .W|
00005440  69 6d 70 5f 57 69 6e 64  6f 77 41 6c 65 72 74 28  |imp_WindowAlert(|
00005450  22 43 61 76 65 72 6e 20  44 75 65 6c 20 45 64 69  |"Cavern Duel Edi|
00005460  74 6f 72 22 2c 22 59 6f  75 20 68 61 76 65 6e 27  |tor","You haven'|
00005470  74 20 64 65 66 69 6e 65  64 20 61 6e 79 20 6c 6f  |t defined any lo|
00005480  63 61 74 69 6f 6e 73 20  66 6f 72 20 74 68 65 20  |cations for the |
00005490  72 65 64 20 61 6e 64 20  67 72 65 65 6e 20 70 6c  |red and green pl|
000054a0  61 79 65 72 73 2e 20 54  68 65 20 73 61 76 65 20  |ayers. The save |
000054b0  6f 70 65 72 61 74 69 6f  6e 20 68 61 73 20 62 65  |operation has be|
000054c0  65 6e 20 63 61 6e 63 65  6c 6c 65 64 2e 22 29 3a  |en cancelled."):|
000054d0  f2 57 69 6d 70 5f 57 69  6e 64 6f 77 43 6c 6f 73  |.Wimp_WindowClos|
000054e0  65 28 73 61 76 65 62 6f  78 25 29 3a f2 57 69 6d  |e(savebox%):.Wim|
000054f0  70 5f 4d 65 6e 75 43 6c  6f 73 65 3a e1 0d 1e 96  |p_MenuClose:....|
00005500  07 ea 20 85 0d 1e a0 0e  ee 20 85 20 ea 20 f2 65  |.. ...... . . .e|
00005510  72 72 0d 1e aa 14 63 68  61 6e 6e 65 6c 3d 8e 28  |rr....channel=.(|
00005520  66 69 6c 65 24 29 0d 1e  b4 12 e7 20 63 68 61 6e  |file$)..... chan|
00005530  6e 65 6c 3c 3e 30 20 8c  0d 1e be 71 63 68 65 63  |nel<>0 ....qchec|
00005540  6b 25 3d a4 57 69 6d 70  5f 57 69 6e 64 6f 77 43  |k%=.Wimp_WindowC|
00005550  61 6e 63 65 6c 28 22 43  61 76 65 72 6e 20 44 75  |ancel("Cavern Du|
00005560  65 6c 20 45 64 69 74 6f  72 22 2c 22 54 68 69 73  |el Editor","This|
00005570  20 43 61 76 65 46 69 6c  65 20 61 6c 72 65 61 64  | CaveFile alread|
00005580  79 20 65 78 69 73 74 73  2e 20 44 6f 20 79 6f 75  |y exists. Do you|
00005590  20 77 61 6e 74 20 74 6f  20 6f 76 65 72 77 72 69  | want to overwri|
000055a0  74 65 20 69 74 20 3f 22  29 0d 1e c8 1a e7 20 63  |te it ?")..... c|
000055b0  68 65 63 6b 25 3d b9 20  8c 20 63 68 61 6e 6e 65  |heck%=. . channe|
000055c0  6c 3d 30 0d 1e d2 0d d9  23 63 68 61 6e 6e 65 6c  |l=0.....#channel|
000055d0  0d 1e dc 2e e7 20 63 68  65 63 6b 25 3d a3 20 8c  |..... check%=. .|
000055e0  20 f2 57 69 6d 70 5f 57  69 6e 64 6f 77 43 6c 6f  | .Wimp_WindowClo|
000055f0  73 65 28 73 61 76 65 62  6f 78 25 29 3a e1 0d 1e  |se(savebox%):...|
00005600  e6 05 cd 0d 1e f0 15 c8  99 20 22 48 6f 75 72 67  |......... "Hourg|
00005610  6c 61 73 73 5f 4f 6e 22  0d 1e fa 19 73 63 32 78  |lass_On"....sc2x|
00005620  3d 30 3a 73 63 32 79 3d  30 3a 78 3d 30 3a 79 3d  |=0:sc2y=0:x=0:y=|
00005630  30 0d 1f 04 14 63 68 61  6e 6e 65 6c 3d ae 28 66  |0....channel=.(f|
00005640  69 6c 65 24 29 0d 1f 0e  12 d5 23 63 68 61 6e 6e  |ile$).....#chann|
00005650  65 6c 2c 22 2a 22 3b 0d  1f 18 05 f5 0d 1f 22 0c  |el,"*";.......".|
00005660  78 3d 30 3a 79 3d 31 35  0d 1f 2c 0c f5 3a 64 6f  |x=0:y=15..,..:do|
00005670  6e 65 3d 30 0d 1f 36 1d  61 24 3d 73 63 72 65 65  |ne=0..6.a$=scree|
00005680  6e 24 28 73 63 32 78 2c  73 63 32 79 2c 78 2c 79  |n$(sc2x,sc2y,x,y|
00005690  29 0d 1f 40 0b c8 8e 20  61 24 20 ca 0d 1f 4a 31  |)..@... a$ ...J1|
000056a0  c9 20 22 37 22 3a d5 23  63 68 61 6e 6e 65 6c 2c  |. "7":.#channel,|
000056b0  61 24 3b 3a f2 73 61 76  65 5f 74 65 6c 65 5f 64  |a$;:.save_tele_d|
000056c0  65 74 61 69 6c 73 3a 64  6f 6e 65 3d 31 0d 1f 54  |etails:done=1..T|
000056d0  26 c9 20 22 31 32 22 3a  61 24 3d 22 41 22 3a 64  |&. "12":a$="A":d|
000056e0  6f 6e 65 3d 31 3a d5 23  63 68 61 6e 6e 65 6c 2c  |one=1:.#channel,|
000056f0  61 24 3b 0d 1f 5e 26 c9  20 22 31 31 22 3a 61 24  |a$;..^&. "11":a$|
00005700  3d 22 42 22 3a 64 6f 6e  65 3d 31 3a d5 23 63 68  |="B":done=1:.#ch|
00005710  61 6e 6e 65 6c 2c 61 24  3b 0d 1f 68 26 c9 20 22  |annel,a$;..h&. "|
00005720  31 30 22 3a 61 24 3d 22  43 22 3a 64 6f 6e 65 3d  |10":a$="C":done=|
00005730  31 3a d5 23 63 68 61 6e  6e 65 6c 2c 61 24 3b 0d  |1:.#channel,a$;.|
00005740  1f 72 26 c9 20 22 31 33  22 3a 61 24 3d 22 44 22  |.r&. "13":a$="D"|
00005750  3a 64 6f 6e 65 3d 31 3a  d5 23 63 68 61 6e 6e 65  |:done=1:.#channe|
00005760  6c 2c 61 24 3b 0d 1f 7c  26 c9 20 22 31 34 22 3a  |l,a$;..|&. "14":|
00005770  61 24 3d 22 45 22 3a 64  6f 6e 65 3d 31 3a d5 23  |a$="E":done=1:.#|
00005780  63 68 61 6e 6e 65 6c 2c  61 24 3b 0d 1f 86 26 c9  |channel,a$;...&.|
00005790  20 22 31 35 22 3a 61 24  3d 22 46 22 3a 64 6f 6e  | "15":a$="F":don|
000057a0  65 3d 31 3a d5 23 63 68  61 6e 6e 65 6c 2c 61 24  |e=1:.#channel,a$|
000057b0  3b 0d 1f 90 26 c9 20 22  31 36 22 3a 61 24 3d 22  |;...&. "16":a$="|
000057c0  47 22 3a 64 6f 6e 65 3d  31 3a d5 23 63 68 61 6e  |G":done=1:.#chan|
000057d0  6e 65 6c 2c 61 24 3b 0d  1f 9a 26 c9 20 22 31 37  |nel,a$;...&. "17|
000057e0  22 3a 61 24 3d 22 50 22  3a 64 6f 6e 65 3d 31 3a  |":a$="P":done=1:|
000057f0  d5 23 63 68 61 6e 6e 65  6c 2c 61 24 3b 0d 1f a4  |.#channel,a$;...|
00005800  26 c9 20 22 31 38 22 3a  61 24 3d 22 51 22 3a 64  |&. "18":a$="Q":d|
00005810  6f 6e 65 3d 31 3a d5 23  63 68 61 6e 6e 65 6c 2c  |one=1:.#channel,|
00005820  61 24 3b 0d 1f ae 26 c9  20 22 31 39 22 3a 61 24  |a$;...&. "19":a$|
00005830  3d 22 48 22 3a 64 6f 6e  65 3d 31 3a d5 23 63 68  |="H":done=1:.#ch|
00005840  61 6e 6e 65 6c 2c 61 24  3b 0d 1f b8 05 cb 0d 1f  |annel,a$;.......|
00005850  c2 1c e7 20 64 6f 6e 65  3d 30 20 8c 20 d5 23 63  |... done=0 . .#c|
00005860  68 61 6e 6e 65 6c 2c 61  24 3b 0d 1f cc 1a 78 2b  |hannel,a$;....x+|
00005870  3d 31 3a e7 20 78 3e 31  35 20 8c 20 78 3d 30 3a  |=1:. x>15 . x=0:|
00005880  79 2d 3d 31 0d 1f d6 09  fd 20 79 3c 30 0d 1f e0  |y-=1..... y<0...|
00005890  12 d5 23 63 68 61 6e 6e  65 6c 2c 22 2d 22 3b 0d  |..#channel,"-";.|
000058a0  1f ea 25 73 63 32 79 2b  3d 31 3a e7 20 73 63 32  |..%sc2y+=1:. sc2|
000058b0  79 3e 33 20 8c 20 73 63  32 78 2b 3d 31 3a 73 63  |y>3 . sc2x+=1:sc|
000058c0  32 79 3d 30 0d 1f f4 0c  fd 20 73 63 32 78 3e 37  |2y=0..... sc2x>7|
000058d0  0d 1f fe 0d d9 23 63 68  61 6e 6e 65 6c 0d 20 08  |.....#channel. .|
000058e0  13 f2 57 69 6d 70 5f 4d  65 6e 75 43 6c 6f 73 65  |..Wimp_MenuClose|
000058f0  0d 20 12 28 c8 99 20 22  58 4f 53 5f 43 4c 49 22  |. .(.. "XOS_CLI"|
00005900  2c 22 53 65 74 54 79 70  65 20 22 2b 66 69 6c 65  |,"SetType "+file|
00005910  24 2b 22 20 30 32 32 22  0d 20 1c 05 cb 0d 20 26  |$+" 022". .... &|
00005920  16 c8 99 20 22 48 6f 75  72 67 6c 61 73 73 5f 4f  |... "Hourglass_O|
00005930  66 66 22 0d 20 30 0c 75  70 64 61 74 65 3d a3 0d  |ff". 0.update=..|
00005940  20 3a 05 e1 0d 20 44 05  3a 0d 20 4e 0a dd 20 f2  | :... D.:. N.. .|
00005950  65 72 72 0d 20 58 0f e7  20 9f 3d 36 37 37 38 35  |err. X.. .=67785|
00005960  20 8c 0d 20 62 97 f2 57  69 6d 70 5f 57 69 6e 64  | .. b..Wimp_Wind|
00005970  6f 77 45 72 72 6f 72 42  6f 78 28 22 43 61 76 65  |owErrorBox("Cave|
00005980  72 6e 20 44 75 65 6c 20  45 64 69 74 6f 72 22 2c  |rn Duel Editor",|
00005990  22 59 6f 75 72 20 64 69  73 63 20 69 73 20 77 72  |"Your disc is wr|
000059a0  69 74 65 20 70 72 6f 74  65 63 74 65 64 2e 20 20  |ite protected.  |
000059b0  50 6c 65 61 73 65 20 77  72 69 74 65 20 65 6e 61  |Please write ena|
000059c0  62 6c 65 20 74 68 65 20  64 69 73 63 20 61 6e 64  |ble the disc and|
000059d0  20 63 6c 69 63 6b 20 74  6f 20 63 6f 6e 74 69 6e  | click to contin|
000059e0  75 65 2e 22 29 3a c8 99  22 58 4f 53 5f 43 4c 49  |ue."):.."XOS_CLI|
000059f0  22 2c 22 43 6c 6f 73 65  22 0d 20 6c 05 cc 0d 20  |","Close". l... |
00005a00  76 7f f2 57 69 6d 70 5f  57 49 6e 64 6f 77 45 72  |v..Wimp_WIndowEr|
00005a10  72 6f 72 42 6f 78 28 22  43 61 76 65 72 6e 20 44  |rorBox("Cavern D|
00005a20  75 65 6c 20 45 64 69 74  6f 72 22 2c 22 54 68 69  |uel Editor","Thi|
00005a30  73 20 66 69 6c 65 20 63  6f 75 6c 64 20 6e 6f 74  |s file could not|
00005a40  20 62 65 20 73 61 76 65  64 20 69 6e 74 6f 20 74  | be saved into t|
00005a50  68 65 20 73 65 6c 65 63  74 65 64 20 64 69 72 65  |he selected dire|
00005a60  63 74 6f 72 79 2e 22 29  3a c8 99 20 22 58 4f 53  |ctory."):.. "XOS|
00005a70  5f 43 4c 49 22 2c 22 43  6c 6f 73 65 22 0d 20 80  |_CLI","Close". .|
00005a80  05 cd 0d 20 8a 05 e1 0d  20 94 05 3a 0d 20 9e 24  |... .... ..:. .$|
00005a90  dd 20 f2 73 61 76 65 5f  74 65 6c 65 5f 64 65 74  |. .save_tele_det|
00005aa0  61 69 6c 73 3a 72 65 66  65 72 65 6e 63 65 3d 30  |ails:reference=0|
00005ab0  0d 20 a8 2f e7 20 74 65  6c 65 6e 75 6d 25 3c 32  |. ./. telenum%<2|
00005ac0  31 20 8c 20 e3 20 61 25  3d 30 b8 74 65 6c 65 6e  |1 . . a%=0.telen|
00005ad0  75 6d 25 3a 8b 20 e3 20  61 25 3d 30 b8 32 30 0d  |um%:. . a%=0.20.|
00005ae0  20 b2 54 e7 20 74 73 63  78 28 61 25 29 3d 73 63  | .T. tscx(a%)=sc|
00005af0  32 78 20 80 20 74 73 63  79 28 61 25 29 3d 73 63  |2x . tscy(a%)=sc|
00005b00  32 79 20 80 20 74 78 28  61 25 29 3d 78 20 80 20  |2y . tx(a%)=x . |
00005b10  74 79 28 61 25 29 3d 79  20 8c 20 72 65 66 65 72  |ty(a%)=y . refer|
00005b20  65 6e 63 65 3d 61 25 3a  61 25 3d 74 65 6c 65 6e  |ence=a%:a%=telen|
00005b30  75 6d 25 0d 20 bc 05 ed  0d 20 c6 29 d5 23 63 68  |um%. .... .).#ch|
00005b40  61 6e 6e 65 6c 2c bd 28  74 65 6c 65 74 6f 73 63  |annel,.(teletosc|
00005b50  78 28 72 65 66 65 72 65  6e 63 65 29 2b 36 35 29  |x(reference)+65)|
00005b60  3b 0d 20 d0 29 d5 23 63  68 61 6e 6e 65 6c 2c bd  |;. .).#channel,.|
00005b70  28 74 65 6c 65 74 6f 73  63 79 28 72 65 66 65 72  |(teletoscy(refer|
00005b80  65 6e 63 65 29 2b 36 35  29 3b 0d 20 da 27 d5 23  |ence)+65);. .'.#|
00005b90  63 68 61 6e 6e 65 6c 2c  bd 28 74 65 6c 65 74 6f  |channel,.(teleto|
00005ba0  78 28 72 65 66 65 72 65  6e 63 65 29 2b 36 35 29  |x(reference)+65)|
00005bb0  3b 0d 20 e4 27 d5 23 63  68 61 6e 6e 65 6c 2c bd  |;. .'.#channel,.|
00005bc0  28 74 65 6c 65 74 6f 79  28 72 65 66 65 72 65 6e  |(teletoy(referen|
00005bd0  63 65 29 2b 36 35 29 3b  0d 20 ee 05 e1 0d 20 f8  |ce)+65);. .... .|
00005be0  05 3a 0d 21 02 28 dd 20  f2 57 69 6d 70 5f 57 69  |.:.!.(. .Wimp_Wi|
00005bf0  6e 64 6f 77 41 6c 65 72  74 28 74 69 74 6c 65 24  |ndowAlert(title$|
00005c00  2c 6d 65 73 73 61 67 65  24 29 0d 21 0c 2b f2 57  |,message$).!.+.W|
00005c10  69 6d 70 5f 57 69 6e 64  6f 77 41 6c 65 72 74 42  |imp_WindowAlertB|
00005c20  6f 78 28 74 69 74 6c 65  24 2c 6d 65 73 73 61 67  |ox(title$,messag|
00005c30  65 24 2c 30 29 0d 21 16  05 e1 0d 21 20 05 3a 0d  |e$,0).!....! .:.|
00005c40  21 2a 33 dd 20 f2 57 69  6d 70 5f 57 69 6e 64 6f  |!*3. .Wimp_Windo|
00005c50  77 41 6c 65 72 74 42 6f  78 28 74 69 74 6c 65 24  |wAlertBox(title$|
00005c60  2c 6d 65 73 73 61 67 65  24 2c 62 75 74 74 6f 6e  |,message$,button|
00005c70  25 29 0d 21 34 0f ea 20  72 65 73 70 6f 6e 73 65  |%).!4.. response|
00005c80  25 0d 21 3e 17 24 28 77  69 6d 70 25 2b 34 29 3d  |%.!>.$(wimp%+4)=|
00005c90  6d 65 73 73 61 67 65 24  0d 21 48 10 c8 8e 20 62  |message$.!H... b|
00005ca0  75 74 74 6f 6e 25 20 ca  0d 21 52 18 c9 20 32 20  |utton% ..!R.. 2 |
00005cb0  20 20 20 3a 20 72 65 73  70 6f 6e 73 65 25 3d 31  |   : response%=1|
00005cc0  0d 21 5c 19 c9 20 31 20  20 20 20 3a 20 72 65 73  |.!\.. 1    : res|
00005cd0  70 6f 6e 73 65 25 3d 31  35 0d 21 66 20 c9 20 33  |ponse%=15.!f . 3|
00005ce0  20 20 20 20 3a 20 72 65  73 70 6f 6e 73 65 25 3d  |    : response%=|
00005cf0  28 31 3c 3c 35 29 2b 31  36 0d 21 70 20 c9 20 34  |(1<<5)+16.!p . 4|
00005d00  20 20 20 20 3a 20 72 65  73 70 6f 6e 73 65 25 3d  |    : response%=|
00005d10  28 31 3c 3c 36 29 2b 31  36 0d 21 7a 14 7f 20 3a  |(1<<6)+16.!z.. :|
00005d20  20 72 65 73 70 6f 6e 73  65 25 3d 31 36 0d 21 84  | response%=16.!.|
00005d30  05 cb 0d 21 8e 3d c8 99  20 22 57 69 6d 70 5f 52  |...!.=.. "Wimp_R|
00005d40  65 70 6f 72 74 45 72 72  6f 72 22 2c 77 69 6d 70  |eportError",wimp|
00005d50  25 2c 72 65 73 70 6f 6e  73 65 25 2c 74 69 74 6c  |%,response%,titl|
00005d60  65 24 20 b8 20 2c 72 65  73 70 6f 6e 73 65 25 0d  |e$ . ,response%.|
00005d70  21 98 05 e1 0d 21 a2 05  3a 0d 21 ac 29 dd 20 a4  |!....!..:.!.). .|
00005d80  57 69 6d 70 5f 57 69 6e  64 6f 77 43 61 6e 63 65  |Wimp_WindowCance|
00005d90  6c 28 74 69 74 6c 65 24  2c 6d 65 73 73 61 67 65  |l(title$,message|
00005da0  24 29 0d 21 b6 17 24 28  77 69 6d 70 25 2b 34 29  |$).!..$(wimp%+4)|
00005db0  3d 6d 65 73 73 61 67 65  24 0d 21 c0 10 72 65 73  |=message$.!..res|
00005dc0  70 6f 6e 73 65 25 3d 32  33 0d 21 ca 3d c8 99 20  |ponse%=23.!.=.. |
00005dd0  22 57 69 6d 70 5f 52 65  70 6f 72 74 45 72 72 6f  |"Wimp_ReportErro|
00005de0  72 22 2c 77 69 6d 70 25  2c 72 65 73 70 6f 6e 73  |r",wimp%,respons|
00005df0  65 25 2c 74 69 74 6c 65  24 20 b8 20 2c 72 65 73  |e%,title$ . ,res|
00005e00  70 6f 6e 73 65 25 0d 21  d4 10 3d 72 65 73 70 6f  |ponse%.!..=respo|
00005e10  6e 73 65 25 2d 32 0d 21  de 05 3a 0d 21 e8 2b dd  |nse%-2.!..:.!.+.|
00005e20  20 f2 57 69 6d 70 5f 57  69 6e 64 6f 77 45 72 72  | .Wimp_WindowErr|
00005e30  6f 72 42 6f 78 28 74 69  74 6c 65 24 2c 6d 65 73  |orBox(title$,mes|
00005e40  73 61 67 65 24 29 0d 21  f2 2b f2 57 69 6d 70 5f  |sage$).!.+.Wimp_|
00005e50  57 69 6e 64 6f 77 41 6c  65 72 74 42 6f 78 28 74  |WindowAlertBox(t|
00005e60  69 74 6c 65 24 2c 6d 65  73 73 61 67 65 24 2c 32  |itle$,message$,2|
00005e70  29 0d 21 fc 05 e1 0d 22  06 05 3a 0d 22 10 20 dd  |).!...."..:.". .|
00005e80  20 a4 57 69 6d 70 5f 57  69 6e 64 6f 77 54 69 74  | .Wimp_WindowTit|
00005e90  6c 65 28 77 69 6e 64 6f  77 25 29 0d 22 1a 13 77  |le(window%)."..w|
00005ea0  69 6d 70 25 21 30 3d 77  69 6e 64 6f 77 25 0d 22  |imp%!0=window%."|
00005eb0  24 22 c8 99 20 22 57 69  6d 70 5f 47 65 74 57 69  |$".. "Wimp_GetWi|
00005ec0  6e 64 6f 77 49 6e 66 6f  22 2c 2c 77 69 6d 70 25  |ndowInfo",,wimp%|
00005ed0  0d 22 2e 36 e7 20 28 28  77 69 6d 70 25 21 36 30  |.".6. ((wimp%!60|
00005ee0  29 80 26 31 30 30 29 3d  30 20 85 20 31 2c 22 54  |).&100)=0 . 1,"T|
00005ef0  69 74 6c 65 20 69 73 6e  27 74 20 69 6e 64 69 72  |itle isn't indir|
00005f00  65 63 74 65 64 22 0d 22  38 10 3d 24 28 77 69 6d  |ected"."8.=$(wim|
00005f10  70 25 21 37 36 29 0d 22  42 05 3a 0d 22 4c 25 dd  |p%!76)."B.:."L%.|
00005f20  20 f2 57 69 6d 70 5f 57  69 6e 64 6f 77 42 72 69  | .Wimp_WindowBri|
00005f30  6e 67 54 6f 54 6f 70 28  77 69 6e 64 6f 77 25 29  |ngToTop(window%)|
00005f40  0d 22 56 12 21 77 69 6d  70 25 3d 77 69 6e 64 6f  |."V.!wimp%=windo|
00005f50  77 25 0d 22 60 23 c8 99  20 22 57 69 6d 70 5f 47  |w%."`#.. "Wimp_G|
00005f60  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00005f70  77 69 6d 70 25 0d 22 6a  0f 77 69 6d 70 25 21 32  |wimp%."j.wimp%!2|
00005f80  38 3d 2d 31 0d 22 74 1f  c8 99 20 22 57 69 6d 70  |8=-1."t... "Wimp|
00005f90  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 77 69  |_OpenWindow",,wi|
00005fa0  6d 70 25 0d 22 7e 05 e1  0d 22 88 05 3a 0d 22 92  |mp%."~..."..:.".|
00005fb0  20 dd 20 f2 57 69 6d 70  5f 57 69 6e 64 6f 77 43  | . .Wimp_WindowC|
00005fc0  6c 6f 73 65 28 77 69 6e  64 6f 77 25 29 0d 22 9c  |lose(window%).".|
00005fd0  12 21 77 69 6d 70 25 3d  77 69 6e 64 6f 77 25 0d  |.!wimp%=window%.|
00005fe0  22 a6 20 c8 99 20 22 57  69 6d 70 5f 43 6c 6f 73  |". .. "Wimp_Clos|
00005ff0  65 57 69 6e 64 6f 77 22  2c 2c 77 69 6d 70 25 0d  |eWindow",,wimp%.|
00006000  22 b0 05 e1 0d 22 ba 05  3a 0d 22 c4 24 dd 20 f2  |"...."..:.".$. .|
00006010  57 69 6d 70 5f 57 69 6e  64 6f 77 46 6f 72 63 65  |Wimp_WindowForce|
00006020  44 72 61 77 28 77 69 6e  64 6f 77 25 29 0d 22 ce  |Draw(window%).".|
00006030  10 c8 8e 20 77 69 6e 64  6f 77 25 20 ca 0d 22 d8  |... window% ..".|
00006040  38 20 c9 20 2d 31 20 20  20 3a 20 c8 99 20 22 57  |8 . -1   : .. "W|
00006050  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
00006060  2c 2d 31 2c 30 2c 30 2c  32 2a 31 32 38 30 2c 32  |,-1,0,0,2*1280,2|
00006070  2a 31 30 32 34 0d 22 e2  38 7f 20 3a 20 c8 99 20  |*1024.".8. : .. |
00006080  22 57 69 6d 70 5f 46 6f  72 63 65 52 65 64 72 61  |"Wimp_ForceRedra|
00006090  77 22 2c 77 69 6e 64 6f  77 25 2c 30 2c 2d 32 2a  |w",window%,0,-2*|
000060a0  31 30 32 34 2c 32 2a 35  31 32 2c 30 20 0d 22 ec  |1024,2*512,0 .".|
000060b0  05 cb 0d 22 f6 05 e1 0d  23 00 05 3a 0d 23 0a 1f  |..."....#..:.#..|
000060c0  dd 20 f2 57 69 6d 70 5f  57 69 6e 64 6f 77 4f 70  |. .Wimp_WindowOp|
000060d0  65 6e 28 77 69 6e 64 6f  77 25 29 0d 23 14 12 21  |en(window%).#..!|
000060e0  77 69 6d 70 25 3d 77 69  6e 64 6f 77 25 0d 23 1e  |wimp%=window%.#.|
000060f0  23 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |#.. "Wimp_GetWin|
00006100  64 6f 77 53 74 61 74 65  22 2c 2c 77 69 6d 70 25  |dowState",,wimp%|
00006110  0d 23 28 1f c8 99 20 22  57 69 6d 70 5f 4f 70 65  |.#(... "Wimp_Ope|
00006120  6e 57 69 6e 64 6f 77 22  2c 2c 77 69 6d 70 25 0d  |nWindow",,wimp%.|
00006130  23 32 05 e1 0d 23 3c 05  3a 0d 23 46 19 f2 57 69  |#2...#<.:.#F..Wi|
00006140  6d 70 5f 57 69 6e 64 6f  77 49 6e 74 65 72 66 61  |mp_WindowInterfa|
00006150  63 65 0d 23 50 20 c8 99  22 57 69 6d 70 5f 42 6f  |ce.#P .."Wimp_Bo|
00006160  72 64 65 72 57 69 6e 64  6f 77 22 2c 2c 77 69 6d  |rderWindow",,wim|
00006170  70 25 0d 23 5a 05 e1 0d  23 64 05 3a 0d 23 6e 2b  |p%.#Z...#d.:.#n+|
00006180  dd 20 f2 57 69 6d 70 5f  49 63 6f 6e 43 61 72 65  |. .Wimp_IconCare|
00006190  74 28 77 69 6e 64 6f 77  25 2c 69 63 6f 6e 25 2c  |t(window%,icon%,|
000061a0  63 68 61 72 73 25 29 0d  23 78 38 c8 99 20 22 57  |chars%).#x8.. "W|
000061b0  69 6d 70 5f 53 65 74 43  61 72 65 74 50 6f 73 69  |imp_SetCaretPosi|
000061c0  74 69 6f 6e 22 2c 77 69  6e 64 6f 77 25 2c 69 63  |tion",window%,ic|
000061d0  6f 6e 25 2c 2c 2c 2d 31  2c 63 68 61 72 73 25 0d  |on%,,,-1,chars%.|
000061e0  23 82 05 e1 0d 23 8c 05  3a 0d 23 96 23 dd 20 a4  |#....#..:.#.#. .|
000061f0  57 69 6d 70 5f 49 63 6f  6e 54 65 78 74 28 77 69  |Wimp_IconText(wi|
00006200  6e 64 6f 77 25 2c 69 63  6f 6e 25 29 0d 23 a0 23  |ndow%,icon%).#.#|
00006210  77 69 6d 70 25 21 30 3d  77 69 6e 64 6f 77 25 20  |wimp%!0=window% |
00006220  3a 20 77 69 6d 70 25 21  34 3d 69 63 6f 6e 25 0d  |: wimp%!4=icon%.|
00006230  23 aa 21 c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |#.!.. "Wimp_GetI|
00006240  63 6f 6e 53 74 61 74 65  22 2c 2c 77 69 6d 70 25  |conState",,wimp%|
00006250  0d 23 b4 37 e7 20 28 28  77 69 6d 70 25 21 32 34  |.#.7. ((wimp%!24|
00006260  29 20 80 20 26 31 30 30  29 3d 30 20 85 20 31 2c  |) . &100)=0 . 1,|
00006270  22 49 63 6f 6e 20 69 73  6e 27 74 20 69 6e 64 69  |"Icon isn't indi|
00006280  72 65 63 74 65 64 22 0d  23 be 10 3d 24 28 77 69  |rected".#..=$(wi|
00006290  6d 70 25 21 32 38 29 0d  23 c8 05 3a 0d 23 d2 29  |mp%!28).#..:.#.)|
000062a0  dd 20 a4 57 69 6d 70 5f  49 63 6f 6e 56 61 6c 69  |. .Wimp_IconVali|
000062b0  64 61 74 69 6f 6e 28 77  69 6e 64 6f 77 25 2c 69  |dation(window%,i|
000062c0  63 6f 6e 25 29 0d 23 dc  23 77 69 6d 70 25 21 30  |con%).#.#wimp%!0|
000062d0  3d 77 69 6e 64 6f 77 25  20 3a 20 77 69 6d 70 25  |=window% : wimp%|
000062e0  21 34 3d 69 63 6f 6e 25  0d 23 e6 21 c8 99 20 22  |!4=icon%.#.!.. "|
000062f0  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00006300  65 22 2c 2c 77 69 6d 70  25 0d 23 f0 37 e7 20 28  |e",,wimp%.#.7. (|
00006310  28 77 69 6d 70 25 21 32  34 29 20 80 20 26 31 30  |(wimp%!24) . &10|
00006320  30 29 3d 30 20 85 20 31  2c 22 49 63 6f 6e 20 69  |0)=0 . 1,"Icon i|
00006330  73 6e 27 74 20 69 6e 64  69 72 65 63 74 65 64 22  |sn't indirected"|
00006340  0d 23 fa 10 3d 24 28 77  69 6d 70 25 21 33 32 29  |.#..=$(wimp%!32)|
00006350  0d 24 04 05 3a 0d 24 0e  26 dd 20 f2 57 69 6d 70  |.$..:.$.&. .Wimp|
00006360  5f 49 63 6f 6e 44 69 73  61 62 6c 65 28 77 69 6e  |_IconDisable(win|
00006370  64 6f 77 25 2c 69 63 6f  6e 25 29 0d 24 18 23 77  |dow%,icon%).$.#w|
00006380  69 6d 70 25 21 30 3d 77  69 6e 64 6f 77 25 20 3a  |imp%!0=window% :|
00006390  20 77 69 6d 70 25 21 34  3d 69 63 6f 6e 25 0d 24  | wimp%!4=icon%.$|
000063a0  22 24 77 69 6d 70 25 21  38 3d 31 3c 3c 32 32 20  |"$wimp%!8=1<<22 |
000063b0  20 20 3a 20 77 69 6d 70  25 21 31 32 3d 31 3c 3c  |  : wimp%!12=1<<|
000063c0  32 32 0d 24 2c 21 c8 99  20 22 57 69 6d 70 5f 53  |22.$,!.. "Wimp_S|
000063d0  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 77 69  |etIconState",,wi|
000063e0  6d 70 25 0d 24 36 05 e1  0d 24 40 05 3a 0d 24 4a  |mp%.$6...$@.:.$J|
000063f0  25 dd 20 f2 57 69 6d 70  5f 49 63 6f 6e 45 6e 61  |%. .Wimp_IconEna|
00006400  62 6c 65 28 77 69 6e 64  6f 77 25 2c 69 63 6f 6e  |ble(window%,icon|
00006410  25 29 0d 24 54 23 77 69  6d 70 25 21 30 3d 77 69  |%).$T#wimp%!0=wi|
00006420  6e 64 6f 77 25 20 3a 20  77 69 6d 70 25 21 34 3d  |ndow% : wimp%!4=|
00006430  69 63 6f 6e 25 0d 24 5e  24 77 69 6d 70 25 21 38  |icon%.$^$wimp%!8|
00006440  3d 30 20 20 20 20 20 20  20 3a 20 77 69 6d 70 25  |=0       : wimp%|
00006450  21 31 32 3d 31 3c 3c 32  32 0d 24 68 21 c8 99 20  |!12=1<<22.$h!.. |
00006460  22 57 69 6d 70 5f 53 65  74 49 63 6f 6e 53 74 61  |"Wimp_SetIconSta|
00006470  74 65 22 2c 2c 77 69 6d  70 25 0d 24 72 05 e1 0d  |te",,wimp%.$r...|
00006480  24 7c 05 3a 0d 24 86 30  dd 20 f2 57 69 6d 70 5f  |$|.:.$.0. .Wimp_|
00006490  49 63 6f 6e 50 75 74 53  70 72 69 74 65 28 77 69  |IconPutSprite(wi|
000064a0  6e 64 6f 77 25 2c 69 63  6f 6e 25 2c 73 70 72 69  |ndow%,icon%,spri|
000064b0  74 65 24 29 0d 24 90 21  77 69 6d 70 25 21 30 3d  |te$).$.!wimp%!0=|
000064c0  77 69 6e 64 6f 77 25 3a  77 69 6d 70 25 21 34 3d  |window%:wimp%!4=|
000064d0  69 63 6f 6e 25 0d 24 9a  21 c8 99 20 22 57 69 6d  |icon%.$.!.. "Wim|
000064e0  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
000064f0  2c 77 69 6d 70 25 0d 24  a4 1f c8 99 20 22 57 69  |,wimp%.$.... "Wi|
00006500  6d 70 5f 44 65 6c 65 74  65 49 63 6f 6e 22 2c 2c  |mp_DeleteIcon",,|
00006510  77 69 6d 70 25 0d 24 ae  3d 77 69 6d 70 25 21 34  |wimp%.$.=wimp%!4|
00006520  3d 77 69 6d 70 25 21 38  20 20 20 3a 20 77 69 6d  |=wimp%!8   : wim|
00006530  70 25 21 38 3d 77 69 6d  70 25 21 31 32 20 20 3a  |p%!8=wimp%!12  :|
00006540  20 77 69 6d 70 25 21 31  32 3d 77 69 6d 70 25 21  | wimp%!12=wimp%!|
00006550  31 36 0d 24 b8 3f 77 69  6d 70 25 21 31 36 3d 77  |16.$.?wimp%!16=w|
00006560  69 6d 70 25 21 32 30 20  3a 20 77 69 6d 70 25 21  |imp%!20 : wimp%!|
00006570  32 30 3d 77 69 6d 70 25  21 32 34 20 3a 20 24 28  |20=wimp%!24 : $(|
00006580  77 69 6d 70 25 2b 32 34  29 3d 73 70 72 69 74 65  |wimp%+24)=sprite|
00006590  24 0d 24 c2 29 c8 99 20  22 57 69 6d 70 5f 43 72  |$.$.).. "Wimp_Cr|
000065a0  65 61 74 65 49 63 6f 6e  22 2c 2c 77 69 6d 70 25  |eateIcon",,wimp%|
000065b0  20 b8 20 69 63 6f 6e 25  3a e1 0d 24 cc 05 3a 0d  | . icon%:..$..:.|
000065c0  24 d6 2c dd 20 f2 57 69  6d 70 5f 49 63 6f 6e 50  |$.,. .Wimp_IconP|
000065d0  75 74 54 65 78 74 28 77  69 6e 64 6f 77 25 2c 69  |utText(window%,i|
000065e0  63 6f 6e 25 2c 74 65 78  74 24 29 0d 24 e0 23 77  |con%,text$).$.#w|
000065f0  69 6d 70 25 21 30 3d 77  69 6e 64 6f 77 25 20 3a  |imp%!0=window% :|
00006600  20 77 69 6d 70 25 21 34  3d 69 63 6f 6e 25 0d 24  | wimp%!4=icon%.$|
00006610  ea 21 c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |.!.. "Wimp_GetIc|
00006620  6f 6e 53 74 61 74 65 22  2c 2c 77 69 6d 70 25 0d  |onState",,wimp%.|
00006630  24 f4 37 e7 20 28 28 77  69 6d 70 25 21 32 34 29  |$.7. ((wimp%!24)|
00006640  20 80 20 26 31 30 30 29  3d 30 20 85 20 31 2c 22  | . &100)=0 . 1,"|
00006650  49 63 6f 6e 20 69 73 6e  27 74 20 69 6e 64 69 72  |Icon isn't indir|
00006660  65 63 74 65 64 22 0d 24  fe 15 24 28 77 69 6d 70  |ected".$..$(wimp|
00006670  25 21 32 38 29 3d 74 65  78 74 24 0d 25 08 23 77  |%!28)=text$.%.#w|
00006680  69 6d 70 25 21 30 3d 77  69 6e 64 6f 77 25 20 3a  |imp%!0=window% :|
00006690  20 77 69 6d 70 25 21 34  3d 69 63 6f 6e 25 0d 25  | wimp%!4=icon%.%|
000066a0  12 1a 77 69 6d 70 25 21  38 3d 30 20 3a 20 77 69  |..wimp%!8=0 : wi|
000066b0  6d 70 25 21 31 32 3d 30  0d 25 1c 21 c8 99 20 22  |mp%!12=0.%.!.. "|
000066c0  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
000066d0  65 22 2c 2c 77 69 6d 70  25 0d 25 26 05 e1 0d 25  |e",,wimp%.%&...%|
000066e0  30 05 3a 0d 25 3a 1e dd  20 f2 57 69 6d 70 5f 49  |0.:.%:.. .Wimp_I|
000066f0  63 6f 6e 49 6e 74 65 72  66 61 63 65 53 74 61 72  |conInterfaceStar|
00006700  74 0d 25 44 1e c8 99 22  57 69 6d 70 5f 42 6f 72  |t.%D..."Wimp_Bor|
00006710  64 65 72 49 63 6f 6e 22  2c 2c 77 69 6d 70 25 0d  |derIcon",,wimp%.|
00006720  25 4e 05 e1 0d 25 58 05  3a 0d 25 62 1f dd 20 f2  |%N...%X.:.%b.. .|
00006730  57 69 6d 70 5f 49 63 6f  6e 49 6e 74 65 72 66 61  |Wimp_IconInterfa|
00006740  63 65 46 69 6e 69 73 68  0d 25 6c 0d 77 69 6d 70  |ceFinish.%l.wimp|
00006750  25 21 38 3d 30 0d 25 76  1e c8 99 22 57 69 6d 70  |%!8=0.%v..."Wimp|
00006760  5f 42 6f 72 64 65 72 49  63 6f 6e 22 2c 2c 77 69  |_BorderIcon",,wi|
00006770  6d 70 25 0d 25 80 05 e1  0d 25 8a 05 3a 0d 25 94  |mp%.%....%..:.%.|
00006780  1f dd 20 f2 57 69 6d 70  5f 4d 65 6e 75 41 64 6a  |.. .Wimp_MenuAdj|
00006790  75 73 74 4f 6e 28 6d 65  6e 75 25 29 0d 25 9e 2c  |ustOn(menu%).%.,|
000067a0  c8 99 20 22 57 69 6d 70  5f 47 65 74 50 6f 69 6e  |.. "Wimp_GetPoin|
000067b0  74 65 72 49 6e 66 6f 22  2c 2c 70 6f 69 6e 74 65  |terInfo",,pointe|
000067c0  72 5f 62 6c 6f 63 6b 25  0d 25 a8 5e e7 20 28 28  |r_block%.%.^. ((|
000067d0  70 6f 69 6e 74 65 72 5f  62 6c 6f 63 6b 25 21 38  |pointer_block%!8|
000067e0  29 80 31 29 3d 31 20 8c  20 c8 99 20 22 57 69 6d  |).1)=1 . .. "Wim|
000067f0  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 6d  |p_CreateMenu",,m|
00006800  65 6e 75 25 2c 70 6f 69  6e 74 65 72 5f 62 6c 6f  |enu%,pointer_blo|
00006810  63 6b 25 21 30 2c 70 6f  69 6e 74 65 72 5f 62 6c  |ck%!0,pointer_bl|
00006820  6f 63 6b 25 21 34 0d 25  b2 05 e1 0d 25 bc 05 3a  |ock%!4.%....%..:|
00006830  0d 25 c6 1e dd 20 a4 57  69 6d 70 5f 4d 65 6e 75  |.%... .Wimp_Menu|
00006840  43 68 6f 69 63 65 28 6c  65 76 65 6c 25 29 0d 25  |Choice(level%).%|
00006850  d0 19 3d 28 77 69 6d 70  25 21 28 34 2a 6c 65 76  |..=(wimp%!(4*lev|
00006860  65 6c 25 29 29 2b 31 0d  25 da 05 3a 0d 25 e4 1d  |el%))+1.%..:.%..|
00006870  dd 20 a4 57 69 6d 70 5f  4d 65 6e 75 43 72 65 61  |. .Wimp_MenuCrea|
00006880  74 65 28 6d 65 6e 75 24  29 0d 25 ee 29 e7 20 6d  |te(menu$).%.). m|
00006890  65 6e 75 24 3d 22 43 6f  6c 6f 75 72 73 22 20 8c  |enu$="Colours" .|
000068a0  3d a4 57 69 6d 70 5f 4d  65 6e 75 43 6f 6c 6f 75  |=.Wimp_MenuColou|
000068b0  72 73 0d 25 f8 27 ea 20  6d 65 6e 75 25 2c 69 6e  |rs.%.'. menu%,in|
000068c0  64 65 78 25 2c 77 69 64  74 68 25 2c 6c 65 6e 67  |dex%,width%,leng|
000068d0  74 68 25 2c 6b 25 2c 73  25 0d 26 02 2e de 20 6d  |th%,k%,s%.&... m|
000068e0  65 6e 75 25 20 32 38 2b  a4 57 69 6d 70 5f 4d 65  |enu% 28+.Wimp_Me|
000068f0  6e 75 4e 6f 4f 66 45 6e  74 72 69 65 73 28 6d 65  |nuNoOfEntries(me|
00006900  6e 75 24 29 2a 32 34 0d  26 0c 37 6d 65 6e 75 25  |nu$)*24.&.7menu%|
00006910  3f 31 32 3d 37 20 20 20  3a 20 6d 65 6e 75 25 3f  |?12=7   : menu%?|
00006920  31 33 3d 32 20 20 3a 20  6d 65 6e 75 25 3f 31 34  |13=2  : menu%?14|
00006930  3d 37 20 3a 6d 65 6e 75  25 3f 31 35 3d 30 0d 26  |=7 :menu%?15=0.&|
00006940  16 2b 6d 65 6e 75 25 21  31 36 3d 31 34 30 20 3a  |.+menu%!16=140 :|
00006950  20 6d 65 6e 75 25 21 32  30 3d 34 34 20 3a 20 6d  | menu%!20=44 : m|
00006960  65 6e 75 25 21 32 34 3d  30 0d 26 20 13 69 6e 64  |enu%!24=0.& .ind|
00006970  65 78 25 3d 6d 65 6e 75  25 2b 32 38 0d 26 2a 20  |ex%=menu%+28.&* |
00006980  24 6d 65 6e 75 25 3d c0  6d 65 6e 75 24 2c a7 6d  |$menu%=.menu$,.m|
00006990  65 6e 75 24 2c 22 5c 22  29 2d 31 29 0d 26 34 23  |enu$,"\")-1).&4#|
000069a0  77 69 64 74 68 25 3d a9  28 c0 6d 65 6e 75 24 2c  |width%=.(.menu$,|
000069b0  a7 6d 65 6e 75 24 2c 22  5c 22 29 2d 31 29 29 0d  |.menu$,"\")-1)).|
000069c0  26 3e 24 6d 65 6e 75 24  2b 3d 22 5c 22 20 3a 20  |&>$menu$+="\" : |
000069d0  4d 65 6e 75 5f 4e 6f 4f  66 45 6e 74 72 69 65 73  |Menu_NoOfEntries|
000069e0  25 3d 30 0d 26 48 10 c8  95 20 6d 65 6e 75 24 3c  |%=0.&H... menu$<|
000069f0  3e 22 22 0d 26 52 1f 6d  65 6e 75 24 3d c1 6d 65  |>"".&R.menu$=.me|
00006a00  6e 75 24 2c a7 6d 65 6e  75 24 2c 22 5c 22 29 2b  |nu$,.menu$,"\")+|
00006a10  31 29 0d 26 5c 0e c8 8e  20 6d 65 6e 75 24 20 ca  |1).&\... menu$ .|
00006a20  0d 26 66 08 c9 20 22 22  0d 26 70 07 7f 20 3a 0d  |.&f.. "".&p.. :.|
00006a30  26 7a 2f 21 69 6e 64 65  78 25 3d 30 20 3a 20 69  |&z/!index%=0 : i|
00006a40  6e 64 65 78 25 21 34 3d  2d 31 20 3a 20 69 6e 64  |ndex%!4=-1 : ind|
00006a50  65 78 25 21 38 3d 26 37  30 30 30 30 32 31 0d 26  |ex%!8=&7000021.&|
00006a60  84 19 6c 65 6e 67 74 68  25 3d a7 6d 65 6e 75 24  |..length%=.menu$|
00006a70  2c 22 5c 22 29 2d 31 0d  26 8e 1c 6b 25 3d a7 c0  |,"\")-1.&..k%=..|
00006a80  6d 65 6e 75 24 2c 6c 65  6e 67 74 68 25 29 2c 22  |menu$,length%),"|
00006a90  3e 22 29 0d 26 98 0b c8  8e 20 6b 25 20 ca 0d 26  |>").&.... k% ..&|
00006aa0  a2 07 c9 20 30 0d 26 ac  05 7f 0d 26 b6 21 73 25  |... 0.&....&.!s%|
00006ab0  3d a0 28 c1 6d 65 6e 75  24 2c 6b 25 2b 31 2c 6c  |=.(.menu$,k%+1,l|
00006ac0  65 6e 67 74 68 25 2d 6b  25 29 29 0d 26 c0 0f 69  |ength%-k%)).&..i|
00006ad0  6e 64 65 78 25 21 34 3d  73 25 0d 26 ca 10 6c 65  |ndex%!4=s%.&..le|
00006ae0  6e 67 74 68 25 3d 6b 25  2d 31 0d 26 d4 05 cb 0d  |ngth%=k%-1.&....|
00006af0  26 de 20 24 28 69 6e 64  65 78 25 2b 31 32 29 3d  |&. $(index%+12)=|
00006b00  c0 6d 65 6e 75 24 2c 6c  65 6e 67 74 68 25 29 0d  |.menu$,length%).|
00006b10  26 e8 25 e7 20 6c 65 6e  67 74 68 25 3e 77 69 64  |&.%. length%>wid|
00006b20  74 68 25 20 8c 20 77 69  64 74 68 25 3d 6c 65 6e  |th% . width%=len|
00006b30  67 74 68 25 0d 26 f2 0e  69 6e 64 65 78 25 2b 3d  |gth%.&..index%+=|
00006b40  32 34 0d 26 fc 05 cb 0d  27 06 05 ce 0d 27 10 1a  |24.&....'....'..|
00006b50  6d 65 6e 75 25 21 31 36  3d 31 36 2a 28 77 69 64  |menu%!16=16*(wid|
00006b60  74 68 25 2b 31 29 0d 27  1a 28 69 6e 64 65 78 25  |th%+1).'.(index%|
00006b70  21 2d 32 34 3d 69 6e 64  65 78 25 21 2d 32 34 20  |!-24=index%!-24 |
00006b80  84 20 26 38 30 20 3a 20  3d 6d 65 6e 75 25 0d 27  |. &80 : =menu%.'|
00006b90  24 05 3a 0d 27 2e 17 dd  20 a4 57 69 6d 70 5f 4d  |$.:.'... .Wimp_M|
00006ba0  65 6e 75 43 6f 6c 6f 75  72 73 0d 27 38 21 3d a4  |enuColours.'8!=.|
00006bb0  57 69 6d 70 5f 4d 65 6e  75 43 72 65 61 74 65 43  |Wimp_MenuCreateC|
00006bc0  6f 6c 6f 75 72 73 28 22  20 22 29 0d 27 42 05 3a  |olours(" ").'B.:|
00006bd0  0d 27 4c 25 dd 20 a4 57  69 6d 70 5f 4d 65 6e 75  |.'L%. .Wimp_Menu|
00006be0  43 72 65 61 74 65 43 6f  6c 6f 75 72 73 28 74 69  |CreateColours(ti|
00006bf0  74 6c 65 24 29 0d 27 56  13 ea 20 78 24 2c 6d 65  |tle$).'V.. x$,me|
00006c00  6e 25 2c 6a 25 2c 69 25  0d 27 60 36 78 24 3d 74  |n%,j%,i%.'`6x$=t|
00006c10  69 74 6c 65 24 2b 22 5c  30 5c 31 5c 32 5c 33 5c  |itle$+"\0\1\2\3\|
00006c20  34 5c 35 5c 36 5c 37 5c  38 5c 39 5c 31 30 5c 31  |4\5\6\7\8\9\10\1|
00006c30  31 5c 31 32 5c 31 33 5c  31 34 5c 31 35 22 0d 27  |1\12\13\14\15".'|
00006c40  6a 1d 6d 65 6e 25 3d a4  57 69 6d 70 5f 4d 65 6e  |j.men%=.Wimp_Men|
00006c50  75 43 72 65 61 74 65 28  78 24 29 0d 27 74 0f e3  |uCreate(x$).'t..|
00006c60  20 69 25 3d 30 20 b8 20  31 35 0d 27 7e 0a c8 8e  | i%=0 . 15.'~...|
00006c70  20 b9 20 ca 0d 27 88 28  c9 20 69 25 3c 34 2c 69  | . ..'.(. i%<4,i|
00006c80  25 3d 39 2c 69 25 3d 31  32 2c 69 25 3d 31 34 2c  |%=9,i%=12,i%=14,|
00006c90  69 25 3d 31 35 20 3a 20  6a 25 3d 37 0d 27 92 0c  |i%=15 : j%=7.'..|
00006ca0  7f 20 3a 20 6a 25 3d 30  0d 27 9c 05 cb 0d 27 a6  |. : j%=0.'....'.|
00006cb0  1c 6d 65 6e 25 3f 28 33  39 2b 69 25 2a 32 34 29  |.men%?(39+i%*24)|
00006cc0  3d 69 25 2a 31 36 2b 6a  25 0d 27 b0 1f f2 57 69  |=i%*16+j%.'...Wi|
00006cd0  6d 70 5f 4d 65 6e 75 43  65 6e 74 72 65 28 6d 65  |mp_MenuCentre(me|
00006ce0  6e 25 2c 69 25 2b 31 29  0d 27 ba 05 ed 0d 27 c4  |n%,i%+1).'....'.|
00006cf0  09 3d 6d 65 6e 25 0d 27  ce 05 3a 0d 27 d8 22 dd  |.=men%.'..:.'.".|
00006d00  20 a4 57 69 6d 70 5f 4d  65 6e 75 4e 6f 4f 66 45  | .Wimp_MenuNoOfE|
00006d10  6e 74 72 69 65 73 28 6d  65 6e 75 24 29 0d 27 e2  |ntries(menu$).'.|
00006d20  1a ea 20 6e 25 20 2c 6a  25 20 3a 20 6e 25 3d 30  |.. n% ,j% : n%=0|
00006d30  20 3a 20 6a 25 3d 30 0d  27 ec 05 f5 0d 27 f6 17  | : j%=0.'....'..|
00006d40  6a 25 3d a7 6d 65 6e 75  24 2c 22 5c 22 2c 6a 25  |j%=.menu$,"\",j%|
00006d50  2b 31 29 0d 28 00 13 e7  20 6a 25 3c 3e 30 20 8c  |+1).(... j%<>0 .|
00006d60  20 6e 25 2b 3d 31 0d 28  0a 0a fd 20 6a 25 3d 30  | n%+=1.(... j%=0|
00006d70  0d 28 14 07 3d 6e 25 0d  28 1e 05 3a 0d 28 28 35  |.(..=n%.(..:.((5|
00006d80  dd 20 f2 57 69 6d 70 5f  4d 65 6e 75 42 61 63 6b  |. .Wimp_MenuBack|
00006d90  47 72 6f 75 6e 64 43 6f  6c 6f 75 72 28 6d 65 6e  |GroundColour(men|
00006da0  75 25 2c 69 74 65 6d 25  2c 63 6f 6c 6f 75 72 25  |u%,item%,colour%|
00006db0  29 0d 28 32 0e ea 20 66  6f 72 65 25 2c 69 25 0d  |).(2.. fore%,i%.|
00006dc0  28 3c 26 66 6f 72 65 25  3d 28 6d 65 6e 75 25 3f  |(<&fore%=(menu%?|
00006dd0  28 33 39 2b 28 69 74 65  6d 25 2d 31 29 2a 32 34  |(39+(item%-1)*24|
00006de0  29 29 83 31 36 0d 28 46  28 69 25 3d 28 28 6d 65  |)).16.(F(i%=((me|
00006df0  6e 75 25 3f 28 33 39 2b  28 69 74 65 6d 25 2d 31  |nu%?(39+(item%-1|
00006e00  29 2a 32 34 29 29 81 31  36 29 83 31 36 0d 28 50  |)*24)).16).16.(P|
00006e10  2f 6d 65 6e 75 25 3f 28  33 39 2b 28 69 74 65 6d  |/menu%?(39+(item|
00006e20  25 2d 31 29 2a 32 34 29  3d 66 6f 72 65 25 2b 31  |%-1)*24)=fore%+1|
00006e30  36 2a 63 6f 6c 6f 75 72  25 2b 69 25 0d 28 5a 05  |6*colour%+i%.(Z.|
00006e40  e1 0d 28 64 05 3a 0d 28  6e 23 dd 20 f2 57 69 6d  |..(d.:.(n#. .Wim|
00006e50  70 5f 4d 65 6e 75 43 65  6e 74 72 65 28 6d 65 6e  |p_MenuCentre(men|
00006e60  75 25 2c 69 74 65 6d 25  29 0d 28 78 3a 6d 65 6e  |u%,item%).(x:men|
00006e70  75 25 21 28 33 36 2b 28  69 74 65 6d 25 2d 31 29  |u%!(36+(item%-1)|
00006e80  2a 32 34 29 3d 6d 65 6e  75 25 21 28 33 36 2b 28  |*24)=menu%!(36+(|
00006e90  69 74 65 6d 25 2d 31 29  2a 32 34 29 84 28 31 3c  |item%-1)*24).(1<|
00006ea0  3c 33 29 0d 28 82 05 e1  0d 28 8c 05 3a 0d 28 96  |<3).(....(..:.(.|
00006eb0  15 dd 20 f2 57 69 6d 70  5f 4d 65 6e 75 43 6c 6f  |.. .Wimp_MenuClo|
00006ec0  73 65 0d 28 a0 1b c8 99  20 22 57 69 6d 70 5f 43  |se.(.... "Wimp_C|
00006ed0  72 65 61 74 65 4d 65 6e  75 22 2c 2d 31 0d 28 aa  |reateMenu",-1.(.|
00006ee0  05 e1 0d 28 b4 05 3a 0d  28 be 24 dd 20 f2 57 69  |...(..:.(.$. .Wi|
00006ef0  6d 70 5f 4d 65 6e 75 44  69 73 61 62 6c 65 28 6d  |mp_MenuDisable(m|
00006f00  65 6e 75 25 2c 69 74 65  6d 25 29 0d 28 c8 3b 6d  |enu%,item%).(.;m|
00006f10  65 6e 75 25 21 28 33 36  2b 28 69 74 65 6d 25 2d  |enu%!(36+(item%-|
00006f20  31 29 2a 32 34 29 3d 6d  65 6e 75 25 21 28 33 36  |1)*24)=menu%!(36|
00006f30  2b 28 69 74 65 6d 25 2d  31 29 2a 32 34 29 84 28  |+(item%-1)*24).(|
00006f40  31 3c 3c 32 32 29 0d 28  d2 05 e1 0d 28 dc 05 3a  |1<<22).(....(..:|
00006f50  0d 28 e6 27 dd 20 f2 57  69 6d 70 5f 4d 65 6e 75  |.(.'. .Wimp_Menu|
00006f60  44 6f 74 74 65 64 4c 69  6e 65 28 6d 65 6e 75 25  |DottedLine(menu%|
00006f70  2c 69 74 65 6d 25 29 0d  28 f0 37 6d 65 6e 75 25  |,item%).(.7menu%|
00006f80  21 28 32 38 2b 28 69 74  65 6d 25 2d 31 29 2a 32  |!(28+(item%-1)*2|
00006f90  34 29 3d 28 6d 65 6e 75  25 21 28 32 38 2b 28 69  |4)=(menu%!(28+(i|
00006fa0  74 65 6d 25 2d 31 29 2a  32 34 29 29 84 32 0d 28  |tem%-1)*24)).2.(|
00006fb0  fa 05 e1 0d 29 04 05 3a  0d 29 0e 23 dd 20 f2 57  |....)..:.).#. .W|
00006fc0  69 6d 70 5f 4d 65 6e 75  45 6e 61 62 6c 65 28 6d  |imp_MenuEnable(m|
00006fd0  65 6e 75 25 2c 69 74 65  6d 25 29 0d 29 18 22 f2  |enu%,item%).).".|
00006fe0  57 69 6d 70 5f 4d 65 6e  75 44 69 73 61 62 6c 65  |Wimp_MenuDisable|
00006ff0  28 6d 65 6e 75 25 2c 69  74 65 6d 25 29 0d 29 22  |(menu%,item%).)"|
00007000  3b 6d 65 6e 75 25 21 28  33 36 2b 28 69 74 65 6d  |;menu%!(36+(item|
00007010  25 2d 31 29 2a 32 34 29  3d 6d 65 6e 75 25 21 28  |%-1)*24)=menu%!(|
00007020  33 36 2b 28 69 74 65 6d  25 2d 31 29 2a 32 34 29  |36+(item%-1)*24)|
00007030  82 28 31 3c 3c 32 32 29  0d 29 2c 05 e1 0d 29 36  |.(1<<22).),...)6|
00007040  05 3a 0d 29 40 35 dd 20  f2 57 69 6d 70 5f 4d 65  |.:.)@5. .Wimp_Me|
00007050  6e 75 46 6f 72 65 67 72  6f 75 6e 64 43 6f 6c 6f  |nuForegroundColo|
00007060  75 72 28 6d 65 6e 75 25  2c 69 74 65 6d 25 2c 63  |ur(menu%,item%,c|
00007070  6f 6c 6f 75 72 25 29 0d  29 4a 45 6d 65 6e 75 25  |olour%).)JEmenu%|
00007080  3f 28 33 39 2b 28 69 74  65 6d 25 2d 31 29 2a 32  |?(39+(item%-1)*2|
00007090  34 29 3d 63 6f 6c 6f 75  72 25 2b 31 36 2a 28 28  |4)=colour%+16*((|
000070a0  6d 65 6e 75 25 3f 28 33  39 2b 28 69 74 65 6d 25  |menu%?(39+(item%|
000070b0  2d 31 29 2a 32 34 29 29  81 31 36 29 0d 29 54 05  |-1)*24)).16).)T.|
000070c0  e1 0d 29 5e 05 3a 0d 29  68 29 dd 20 f2 57 69 6d  |..)^.:.)h). .Wim|
000070d0  70 5f 4d 65 6e 75 47 6c  75 65 28 6d 65 6e 75 31  |p_MenuGlue(menu1|
000070e0  25 2c 69 74 65 6d 25 2c  6d 65 6e 75 32 25 29 0d  |%,item%,menu2%).|
000070f0  29 72 1e 6d 65 6e 75 31  25 21 28 38 2b 69 74 65  |)r.menu1%!(8+ite|
00007100  6d 25 2a 32 34 29 3d 6d  65 6e 75 32 25 0d 29 7c  |m%*24)=menu2%.)||
00007110  05 e1 0d 29 86 05 3a 0d  29 90 27 dd 20 f2 57 69  |...)..:.).'. .Wi|
00007120  6d 70 5f 4d 65 6e 75 49  74 65 6d 28 6d 65 6e 75  |mp_MenuItem(menu|
00007130  25 2c 69 74 65 6d 25 2c  69 74 65 6d 24 29 0d 29  |%,item%,item$).)|
00007140  9a 2c 24 28 6d 65 6e 75  25 2b 28 34 30 2b 28 69  |.,$(menu%+(40+(i|
00007150  74 65 6d 25 2d 31 29 2a  32 34 29 29 3d c0 69 74  |tem%-1)*24))=.it|
00007160  65 6d 24 2c 31 32 29 2b  bd 30 0d 29 a4 05 e1 0d  |em$,12)+.0.)....|
00007170  29 ae 05 3a 0d 29 b8 24  dd 20 f2 57 69 6d 70 5f  |)..:.).$. .Wimp_|
00007180  4d 65 6e 75 4d 65 73 73  61 67 65 28 6d 65 6e 75  |MenuMessage(menu|
00007190  25 2c 69 74 65 6d 25 29  0d 29 c2 3c 6d 65 6e 75  |%,item%).).<menu|
000071a0  25 21 28 32 38 2b 28 69  74 65 6d 25 2d 31 29 2a  |%!(28+(item%-1)*|
000071b0  32 34 29 3d 28 6d 65 6e  75 25 21 28 32 38 2b 28  |24)=(menu%!(28+(|
000071c0  69 74 65 6d 25 2d 31 29  2a 32 34 29 29 82 28 31  |item%-1)*24)).(1|
000071d0  3c 3c 33 29 0d 29 cc 05  e1 0d 29 d6 05 3a 0d 29  |<<3).)....)..:.)|
000071e0  e0 22 dd 20 f2 57 69 6d  70 5f 4d 65 6e 75 50 6f  |.". .Wimp_MenuPo|
000071f0  70 55 70 28 4d 65 6e 75  25 2c 78 25 2c 79 25 29  |pUp(Menu%,x%,y%)|
00007200  0d 29 ea 0f 6d 65 6e 75  25 3d 4d 65 6e 75 25 0d  |.)..menu%=Menu%.|
00007210  29 f4 2b c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |).+.. "Wimp_Crea|
00007220  74 65 4d 65 6e 75 22 2c  2c 6d 65 6e 75 25 2c 78  |teMenu",,menu%,x|
00007230  25 2d 36 34 2c 79 25 2b  32 30 0d 29 fe 05 e1 0d  |%-64,y%+20.)....|
00007240  2a 08 05 3a 0d 2a 12 1f  dd 20 f2 57 69 6d 70 5f  |*..:.*... .Wimp_|
00007250  4d 65 6e 75 50 6f 70 55  70 42 61 72 28 78 25 2c  |MenuPopUpBar(x%,|
00007260  79 25 29 0d 2a 1c 0f ea  20 6e 25 20 3a 20 6e 25  |y%).*... n% : n%|
00007270  3d 30 0d 2a 26 2b c8 95  20 28 28 42 61 72 5f 4d  |=0.*&+.. ((Bar_M|
00007280  65 6e 75 25 21 28 32 38  2b 6e 25 2a 32 34 29 29  |enu%!(28+n%*24))|
00007290  80 25 31 30 30 30 30 30  30 30 29 3d 30 0d 2a 30  |.%10000000)=0.*0|
000072a0  09 6e 25 2b 3d 31 0d 2a  3a 05 ce 0d 2a 44 32 c8  |.n%+=1.*:...*D2.|
000072b0  99 20 22 57 69 6d 70 5f  43 72 65 61 74 65 4d 65  |. "Wimp_CreateMe|
000072c0  6e 75 22 2c 2c 42 61 72  5f 4d 65 6e 75 25 2c 78  |nu",,Bar_Menu%,x|
000072d0  25 2d 36 34 2c 39 36 2b  6e 25 2a 34 34 0d 2a 4e  |%-64,96+n%*44.*N|
000072e0  13 6d 65 6e 75 25 3d 42  61 72 5f 4d 65 6e 75 25  |.menu%=Bar_Menu%|
000072f0  0d 2a 58 05 e1 0d 2a 62  05 3a 0d 2a 6c 21 dd 20  |.*X...*b.:.*l!. |
00007300  f2 57 69 6d 70 5f 4d 65  6e 75 54 69 63 6b 28 6d  |.Wimp_MenuTick(m|
00007310  65 6e 75 25 2c 69 74 65  6d 25 29 0d 2a 76 37 6d  |enu%,item%).*v7m|
00007320  65 6e 75 25 21 28 32 38  2b 28 69 74 65 6d 25 2d  |enu%!(28+(item%-|
00007330  31 29 2a 32 34 29 3d 28  6d 65 6e 75 25 21 28 32  |1)*24)=(menu%!(2|
00007340  38 2b 28 69 74 65 6d 25  2d 31 29 2a 32 34 29 29  |8+(item%-1)*24))|
00007350  82 31 0d 2a 80 05 e1 0d  2a 8a 05 3a 0d 2a 94 23  |.1.*....*..:.*.#|
00007360  dd 20 f2 57 69 6d 70 5f  4d 65 6e 75 54 69 74 6c  |. .Wimp_MenuTitl|
00007370  65 28 6d 65 6e 75 25 2c  74 69 74 6c 65 24 29 0d  |e(menu%,title$).|
00007380  2a 9e 19 24 6d 65 6e 75  25 3d c0 74 69 74 6c 65  |*..$menu%=.title|
00007390  24 2c 31 32 29 2b bd 30  0d 2a a8 05 e1 0d 2a b2  |$,12)+.0.*....*.|
000073a0  05 3a 0d 2a bc 3d dd 20  f2 57 69 6d 70 5f 4d 65  |.:.*.=. .Wimp_Me|
000073b0  6e 75 57 72 69 74 65 28  6d 65 6e 75 25 2c 69 74  |nuWrite(menu%,it|
000073c0  65 6d 25 2c 62 75 66 66  65 72 25 2c 76 61 6c 25  |em%,buffer%,val%|
000073d0  2c 42 75 66 66 65 72 4c  65 6e 67 74 68 25 29 0d  |,BufferLength%).|
000073e0  2a c6 37 6d 65 6e 75 25  21 28 32 38 2b 28 69 74  |*.7menu%!(28+(it|
000073f0  65 6d 25 2d 31 29 2a 32  34 29 3d 28 6d 65 6e 75  |em%-1)*24)=(menu|
00007400  25 21 28 32 38 2b 28 69  74 65 6d 25 2d 31 29 2a  |%!(28+(item%-1)*|
00007410  32 34 29 29 84 34 0d 2a  d0 38 6d 65 6e 75 25 21  |24)).4.*.8menu%!|
00007420  28 33 36 2b 28 69 74 65  6d 25 2d 31 29 2a 32 34  |(36+(item%-1)*24|
00007430  29 3d 6d 65 6e 75 25 21  28 33 36 2b 28 69 74 65  |)=menu%!(36+(ite|
00007440  6d 25 2d 31 29 2a 32 34  29 84 26 31 30 30 0d 2a  |m%-1)*24).&100.*|
00007450  da 23 6d 65 6e 75 25 21  28 34 30 2b 28 69 74 65  |.#menu%!(40+(ite|
00007460  6d 25 2d 31 29 2a 32 34  29 3d 62 75 66 66 65 72  |m%-1)*24)=buffer|
00007470  25 0d 2a e4 20 6d 65 6e  75 25 21 28 34 34 2b 28  |%.*. menu%!(44+(|
00007480  69 74 65 6d 25 2d 31 29  2a 32 34 29 3d 76 61 6c  |item%-1)*24)=val|
00007490  25 0d 2a ee 29 6d 65 6e  75 25 21 28 34 38 2b 28  |%.*.)menu%!(48+(|
000074a0  69 74 65 6d 25 2d 31 29  2a 32 34 29 3d 42 75 66  |item%-1)*24)=Buf|
000074b0  66 65 72 4c 65 6e 67 74  68 25 0d 2a f8 05 e1 0d  |ferLength%.*....|
000074c0  2b 02 05 3a 0d 2b 0c 17  dd 20 f2 57 69 6d 70 5f  |+..:.+... .Wimp_|
000074d0  53 70 72 69 74 65 73 4c  6f 61 64 0d 2b 16 2f f2  |SpritesLoad.+./.|
000074e0  57 69 6d 70 5f 53 70 72  69 74 65 73 50 61 74 68  |Wimp_SpritesPath|
000074f0  4c 6f 61 64 28 22 3c 4f  62 65 79 24 44 69 72 3e  |Load("<Obey$Dir>|
00007500  2e 53 70 72 69 74 65 73  22 29 0d 2b 20 1c 64 69  |.Sprites").+ .di|
00007510  72 65 63 74 5f 73 70 72  69 74 65 73 25 3d 73 70  |rect_sprites%=sp|
00007520  72 69 74 65 73 25 0d 2b  2a 05 e1 0d 2b 34 05 3a  |rites%.+*...+4.:|
00007530  0d 2b 3e 26 dd 20 f2 57  69 6d 70 5f 53 70 72 69  |.+>&. .Wimp_Spri|
00007540  74 65 73 50 61 74 68 4c  6f 61 64 28 70 61 74 68  |tesPathLoad(path|
00007550  6e 61 6d 65 24 29 0d 2b  48 0b ea 20 53 25 2c 54  |name$).+H.. S%,T|
00007560  25 0d 2b 52 23 53 25 3d  8e 28 70 61 74 68 6e 61  |%.+R#S%=.(pathna|
00007570  6d 65 24 29 3a 54 25 3d  a2 23 53 25 2b 31 36 3a  |me$):T%=.#S%+16:|
00007580  d9 23 53 25 0d 2b 5c 1a  de 20 73 70 72 69 74 65  |.#S%.+\.. sprite|
00007590  73 25 54 25 2c 73 70 6e  61 6d 65 25 31 32 0d 2b  |s%T%,spname%12.+|
000075a0  66 1d 21 73 70 72 69 74  65 73 25 3d 54 25 3a 73  |f.!sprites%=T%:s|
000075b0  70 72 69 74 65 73 25 21  38 3d 30 0d 2b 70 21 c8  |prites%!8=0.+p!.|
000075c0  99 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 26  |."OS_SpriteOp",&|
000075d0  31 30 39 2c 73 70 72 69  74 65 73 25 0d 2b 7a 2b  |109,sprites%.+z+|
000075e0  c8 99 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |.."OS_SpriteOp",|
000075f0  26 31 30 41 2c 73 70 72  69 74 65 73 25 2c 70 61  |&10A,sprites%,pa|
00007600  74 68 6e 61 6d 65 24 0d  2b 84 05 e1 0d 2b 8e 05  |thname$.+....+..|
00007610  3a 0d 2b 98 1b dd 20 a4  57 69 6d 70 5f 46 69 6c  |:.+... .Wimp_Fil|
00007620  65 54 79 70 65 28 74 79  70 65 25 29 0d 2b a2 0d  |eType(type%).+..|
00007630  c8 8e 20 74 79 70 65 25  ca 0d 2b ac 11 c9 26 46  |.. type%..+...&F|
00007640  46 46 3a 3d 22 54 65 78  74 22 0d 2b b6 11 c9 26  |FF:="Text".+...&|
00007650  46 46 44 3a 3d 22 44 61  74 61 22 0d 2b c0 12 c9  |FFD:="Data".+...|
00007660  26 46 46 42 3a 3d 22 42  61 73 69 63 22 0d 2b ca  |&FFB:="Basic".+.|
00007670  13 c9 26 46 46 39 3a 3d  22 53 70 72 69 74 65 22  |..&FF9:="Sprite"|
00007680  0d 2b d4 14 c9 26 46 45  44 3a 3d 22 50 61 6c 65  |.+...&FED:="Pale|
00007690  74 74 65 22 0d 2b de 15  c9 26 46 45 43 3a 3d 22  |tte".+...&FEC:="|
000076a0  54 65 6d 70 6c 61 74 65  22 0d 2b e8 11 c9 26 41  |Template".+...&A|
000076b0  46 46 3a 3d 22 44 72 61  77 22 0d 2b f2 14 c9 26  |FF:="Draw".+...&|
000076c0  31 30 30 30 3a 3d 22 46  6f 6c 64 65 72 22 0d 2b  |1000:="Folder".+|
000076d0  fc 19 c9 26 32 30 30 30  3a 3d 22 41 70 70 6c 69  |...&2000:="Appli|
000076e0  63 61 74 69 6f 6e 22 0d  2c 06 0f 7f 3d c3 7e 28  |cation".,...=.~(|
000076f0  74 79 70 65 25 29 0d 2c  10 05 cb 0d 2c 1a 05 3a  |type%).,....,..:|
00007700  0d 2c 24 1b dd 20 a4 57  69 6d 70 5f 47 65 74 46  |.,$.. .Wimp_GetF|
00007710  69 6c 65 50 61 74 68 4e  61 6d 65 0d 2c 2e 27 3d  |ilePathName.,.'=|
00007720  a4 57 69 6d 70 5f 47 65  74 53 74 72 69 6e 67 41  |.Wimp_GetStringA|
00007730  74 41 64 64 72 65 73 73  28 77 69 6d 70 25 2b 34  |tAddress(wimp%+4|
00007740  34 29 0d 2c 38 05 3a 0d  2c 42 1f dd 20 a4 57 69  |4).,8.:.,B.. .Wi|
00007750  6d 70 5f 46 69 6c 65 4c  6f 61 64 28 70 61 74 68  |mp_FileLoad(path|
00007760  6e 61 6d 65 24 29 0d 2c  4c 11 ea 20 53 25 2c 54  |name$).,L.. S%,T|
00007770  25 2c 66 69 6c 65 25 0d  2c 56 12 53 25 3d 8e 20  |%,file%.,V.S%=. |
00007780  70 61 74 68 6e 61 6d 65  24 0d 2c 60 0e 54 25 3d  |pathname$.,`.T%=|
00007790  a2 23 53 25 2b 31 36 0d  2c 6a 08 d9 23 53 25 0d  |.#S%+16.,j..#S%.|
000077a0  2c 74 0d de 20 66 69 6c  65 25 54 25 0d 2c 7e 2d  |,t.. file%T%.,~-|
000077b0  c8 99 20 22 58 4f 53 5f  43 4c 49 22 2c 22 4c 6f  |.. "XOS_CLI","Lo|
000077c0  61 64 22 2b 70 61 74 68  6e 61 6d 65 24 2b 22 22  |ad"+pathname$+""|
000077d0  2b c3 7e 66 69 6c 65 25  29 0d 2c 88 0a 3d 66 69  |+.~file%).,..=fi|
000077e0  6c 65 25 0d 2c 92 05 3b  0d 2c 9c 26 dd 20 a4 57  |le%.,..;.,.&. .W|
000077f0  69 6d 70 5f 47 65 74 53  74 72 69 6e 67 41 74 41  |imp_GetStringAtA|
00007800  64 64 72 65 73 73 28 61  72 72 61 79 25 29 0d 2c  |ddress(array%).,|
00007810  a6 0e ea 20 73 24 3a 73  24 3d 22 22 0d 2c b0 3c  |... s$:s$="".,.<|
00007820  c8 95 28 3f 61 72 72 61  79 25 3c 3e 31 33 29 80  |..(?array%<>13).|
00007830  28 3f 61 72 72 61 79 25  3c 3e 30 29 3a 73 24 2b  |(?array%<>0):s$+|
00007840  3d bd 28 3f 61 72 72 61  79 25 29 3a 61 72 72 61  |=.(?array%):arra|
00007850  79 25 2b 3d 31 3a ce 3a  0d 2c ba 07 3d 73 24 0d  |y%+=1:.:.,..=s$.|
00007860  2c c4 05 3a 0d 2c ce 23  dd 20 a4 57 69 6d 70 5f  |,..:.,.#. .Wimp_|
00007870  47 65 74 46 69 6c 65 46  72 6f 6d 50 61 74 68 6e  |GetFileFromPathn|
00007880  61 6d 65 28 66 24 29 0d  2c d8 11 c8 8e 20 a7 66  |ame(f$).,.... .f|
00007890  24 2c 22 2e 22 29 20 ca  0d 2c e2 0f c9 20 30 20  |$,".") ..,... 0 |
000078a0  20 20 20 3a 3d 66 24 0d  2c ec 36 7f 20 3a 3d a4  |   :=f$.,.6. :=.|
000078b0  57 69 6d 70 5f 47 65 74  46 69 6c 65 46 72 6f 6d  |Wimp_GetFileFrom|
000078c0  50 61 74 68 6e 61 6d 65  28 c2 66 24 2c a9 28 66  |Pathname(.f$,.(f|
000078d0  24 29 2d a7 66 24 2c 22  2e 22 29 29 29 0d 2c f6  |$)-.f$,"."))).,.|
000078e0  05 cb 0d 2d 00 05 3a 0d  2d 0a 1d dd 20 f2 57 69  |...-..:.-... .Wi|
000078f0  6d 70 5f 53 65 6e 64 54  6f 45 64 69 74 28 66 69  |mp_SendToEdit(fi|
00007900  6c 65 24 29 0d 2d 14 08  ea 20 6e 25 0d 2d 1e 15  |le$).-... n%.-..|
00007910  77 69 6d 70 25 21 34 3d  26 36 43 43 30 31 43 30  |wimp%!4=&6CC01C0|
00007920  43 0d 2d 28 0e 77 69 6d  70 25 21 31 36 3d 35 0d  |C.-(.wimp%!16=5.|
00007930  2d 32 0e 77 69 6d 70 25  21 33 36 3d 30 0d 2d 3c  |-2.wimp%!36=0.-<|
00007940  11 77 69 6d 70 25 21 34  30 3d 26 46 46 46 0d 2d  |.wimp%!40=&FFF.-|
00007950  46 18 24 28 77 69 6d 70  25 2b 34 34 29 3d 66 69  |F.$(wimp%+44)=fi|
00007960  6c 65 24 2b bd 30 0d 2d  50 11 6e 25 3d a9 20 66  |le$+.0.-P.n%=. f|
00007970  69 6c 65 24 2b 34 35 0d  2d 5a 2c e7 20 6e 25 83  |ile$+45.-Z,. n%.|
00007980  34 20 8c 20 21 77 69 6d  70 25 3d 34 2b 28 6e 25  |4 . !wimp%=4+(n%|
00007990  3e 3e 32 29 3c 3c 32 20  8b 20 21 77 69 6d 70 25  |>>2)<<2 . !wimp%|
000079a0  3d 6e 25 0d 2d 64 24 c8  99 20 22 57 69 6d 70 5f  |=n%.-d$.. "Wimp_|
000079b0  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 37 2c  |SendMessage",17,|
000079c0  77 69 6d 70 25 2c 30 0d  2d 6e 05 e1 0d 2d 78 05  |wimp%,0.-n...-x.|
000079d0  3a 0d 2d 82 0f dd 20 f2  6f 70 65 6e 74 65 78 74  |:.-... .opentext|
000079e0  0d 2d 8c 0e 21 77 69 6d  70 25 3d 32 35 36 0d 2d  |.-..!wimp%=256.-|
000079f0  96 0e 77 69 6d 70 25 21  31 32 3d 30 0d 2d a0 0e  |..wimp%!12=0.-..|
00007a00  77 69 6d 70 25 21 31 36  3d 35 0d 2d aa 0e 77 69  |wimp%!16=5.-..wi|
00007a10  6d 70 25 21 33 36 3d 30  0d 2d b4 11 77 69 6d 70  |mp%!36=0.-..wimp|
00007a20  25 21 34 30 3d 26 66 66  66 0d 2d be 2a 24 28 77  |%!40=&fff.-.*$(w|
00007a30  69 6d 70 25 2b 34 34 29  3d 22 43 61 76 65 72 6e  |imp%+44)="Cavern|
00007a40  45 64 3a 44 6f 63 75 6d  65 6e 74 73 2e 21 48 65  |Ed:Documents.!He|
00007a50  6c 70 22 0d 2d c8 24 c8  99 20 22 57 69 6d 70 5f  |lp".-.$.. "Wimp_|
00007a60  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 38 2c  |SendMessage",18,|
00007a70  77 69 6d 70 25 2c 30 0d  2d d2 05 e1 0d 2d dc 05  |wimp%,0.-....-..|
00007a80  3a 0d 2d e6 1b dd 20 a4  57 69 6d 70 5f 42 41 53  |:.-... .Wimp_BAS|
00007a90  49 43 50 61 72 61 6d 65  74 65 72 73 0d 2d f0 14  |ICParameters.-..|
00007aa0  ea 20 63 6f 6d 24 2c 70  61 72 61 6d 24 2c 49 25  |. com$,param$,I%|
00007ab0  0d 2d fa 19 c8 99 20 22  4f 53 5f 47 65 74 45 6e  |.-.... "OS_GetEn|
00007ac0  76 22 20 b8 20 63 6f 6d  24 0d 2e 04 0e 70 61 72  |v" . com$....par|
00007ad0  61 6d 73 24 3d 22 22 0d  2e 0e 17 49 25 3d a7 63  |ams$=""....I%=.c|
00007ae0  6f 6d 24 2c 22 20 2d 71  75 69 74 20 22 29 0d 2e  |om$," -quit ")..|
00007af0  18 34 e7 20 49 25 20 8c  20 70 61 72 61 6d 73 24  |.4. I% . params$|
00007b00  3d c1 63 6f 6d 24 2c a7  63 6f 6d 24 2c 22 20 22  |=.com$,.com$," "|
00007b10  2c 49 25 2b a9 22 20 2d  71 75 69 74 20 22 29 2b  |,I%+." -quit ")+|
00007b20  31 29 0d 2e 22 0c 3d 70  61 72 61 6d 73 24 0d 2e  |1)..".=params$..|
00007b30  2c 05 3a 0d 2e 36 11 dd  20 f2 57 69 6d 70 5f 45  |,.:..6.. .Wimp_E|
00007b40  72 72 6f 72 0d 2e 40 0b  ea 20 58 24 2c 78 25 0d  |rror..@.. X$,x%.|
00007b50  2e 4a 09 ee 20 85 20 87  0d 2e 54 08 78 25 3d 9e  |.J.. . ...T.x%=.|
00007b60  0d 2e 5e 1b 58 24 3d f6  24 2b 22 20 61 74 20 6c  |..^.X$=.$+" at l|
00007b70  69 6e 65 20 22 2b c3 28  78 25 29 0d 2e 68 11 de  |ine "+.(x%)..h..|
00007b80  20 45 72 72 6f 72 4d 73  67 25 33 36 0d 2e 72 45  | ErrorMsg%36..rE|
00007b90  45 72 72 6f 72 4d 73 67  25 21 30 3d 33 36 3a 45  |ErrorMsg%!0=36:E|
00007ba0  72 72 6f 72 4d 73 67 25  21 31 32 3d 30 3a 45 72  |rrorMsg%!12=0:Er|
00007bb0  72 6f 72 4d 73 67 25 21  31 36 3d 26 38 31 30 38  |rorMsg%!16=&8108|
00007bc0  30 3a 45 72 72 6f 72 4d  73 67 25 21 32 30 3d 78  |0:ErrorMsg%!20=x|
00007bd0  25 0d 2e 7c 1f 24 28 45  72 72 6f 72 4d 73 67 25  |%..|.$(ErrorMsg%|
00007be0  2b 32 34 29 3d 22 21 52  75 6e 49 6d 61 67 65 22  |+24)="!RunImage"|
00007bf0  0d 2e 86 25 c8 99 22 57  69 6d 70 5f 53 65 6e 64  |...%.."Wimp_Send|
00007c00  4d 65 73 73 61 67 65 22  2c 31 37 2c 45 72 72 6f  |Message",17,Erro|
00007c10  72 4d 73 67 25 0d 2e 90  1f f2 57 69 6d 70 5f 57  |rMsg%.....Wimp_W|
00007c20  69 6e 64 6f 77 41 6c 65  72 74 28 74 61 73 6b 24  |indowAlert(task$|
00007c30  2c 58 24 29 0d 2e 9a 13  f2 57 69 6d 70 5f 43 6c  |,X$).....Wimp_Cl|
00007c40  6f 73 65 44 6f 77 6e 0d  2e a4 05 e1 0d 2e ae 05  |oseDown.........|
00007c50  3a 0d 2e b8 15 dd 20 f2  57 69 6d 70 5f 43 6c 6f  |:..... .Wimp_Clo|
00007c60  73 65 44 6f 77 6e 0d 2e  c2 23 c8 99 22 57 69 6d  |seDown...#.."Wim|
00007c70  70 5f 43 6c 6f 73 65 44  6f 77 6e 22 2c 74 61 73  |p_CloseDown",tas|
00007c80  6b 25 2c 22 54 41 53 4b  22 0d 2e cc 05 e1 0d 2e  |k%,"TASK".......|
00007c90  d6 05 3a 0d 2e e0 10 dd  20 f2 57 69 6d 70 5f 51  |..:..... .Wimp_Q|
00007ca0  75 69 74 0d 2e ea 0f 66  69 6e 69 73 68 65 64 25  |uit....finished%|
00007cb0  3d b9 0d 2e f4 05 e1 0d  2e fe 05 3a 0d 2f 08 23  |=..........:./.#|
00007cc0  dd 20 a4 57 69 6d 70 5f  52 65 61 64 56 61 72 69  |. .Wimp_ReadVari|
00007cd0  61 62 6c 65 28 56 61 72  69 61 62 6c 65 24 29 0d  |able(Variable$).|
00007ce0  2f 12 1c ea 20 6c 65 6e  25 2c 72 65 73 75 6c 74  |/... len%,result|
00007cf0  25 2c 76 61 72 69 61 62  6c 65 25 0d 2f 1c 14 24  |%,variable%./..$|
00007d00  77 69 6d 70 25 3d 56 61  72 69 61 62 6c 65 24 0d  |wimp%=Variable$.|
00007d10  2f 26 33 c8 99 22 4f 53  5f 52 65 61 64 56 61 72  |/&3.."OS_ReadVar|
00007d20  56 61 6c 22 2c 77 69 6d  70 25 2c 77 69 6d 70 25  |Val",wimp%,wimp%|
00007d30  2b 32 35 35 2c 32 35 35  2c 2c 33 b8 2c 2c 6c 65  |+255,255,,3.,,le|
00007d40  6e 25 0d 2f 30 17 77 69  6d 70 25 3f 28 6c 65 6e  |n%./0.wimp%?(len|
00007d50  25 2b 32 35 35 29 3d 31  33 0d 2f 3a 11 3d 24 28  |%+255)=13./:.=$(|
00007d60  77 69 6d 70 25 2b 32 35  35 29 0d 2f 44 05 3a 0d  |wimp%+255)./D.:.|
00007d70  2f 4e 1b dd 20 f2 57 69  6d 70 5f 50 6f 6c 6c 43  |/N.. .Wimp_PollC|
00007d80  6c 6f 73 65 57 69 6e 64  6f 77 0d 2f 58 23 c8 99  |loseWindow./X#..|
00007d90  20 22 57 69 6d 70 5f 47  65 74 50 6f 69 6e 74 65  | "Wimp_GetPointe|
00007da0  72 49 6e 66 6f 22 2c 2c  77 69 6d 70 25 0d 2f 62  |rInfo",,wimp%./b|
00007db0  27 77 69 6e 64 6f 77 25  3d 77 69 6d 70 25 21 31  |'window%=wimp%!1|
00007dc0  32 20 3a 20 62 75 74 74  6f 6e 73 25 3d 77 69 6d  |2 : buttons%=wim|
00007dd0  70 25 21 38 0d 2f 6c 28  f2 45 76 65 6e 74 5f 57  |p%!8./l(.Event_W|
00007de0  69 6e 64 6f 77 43 6c 6f  73 65 28 77 69 6e 64 6f  |indowClose(windo|
00007df0  77 25 2c 62 75 74 74 6f  6e 73 25 29 0d 2f 76 31  |w%,buttons%)./v1|
00007e00  21 77 69 6d 70 25 3d 77  69 6e 64 6f 77 25 20 3a  |!wimp%=window% :|
00007e10  20 c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 57  | .. "Wimp_CloseW|
00007e20  69 6e 64 6f 77 22 2c 2c  77 69 6d 70 25 0d 2f 80  |indow",,wimp%./.|
00007e30  05 e1 0d 2f 8a 05 3a 0d  2f 94 1a dd 20 f2 57 69  |.../..:./... .Wi|
00007e40  6d 70 5f 50 6f 6c 6c 4d  6f 75 73 65 43 6c 69 63  |mp_PollMouseClic|
00007e50  6b 0d 2f 9e 49 62 75 74  74 6f 6e 25 3d 77 69 6d  |k./.Ibutton%=wim|
00007e60  70 25 21 38 3a 77 69 6e  64 6f 77 25 3d 77 69 6d  |p%!8:window%=wim|
00007e70  70 25 21 31 32 3a 69 63  6f 6e 25 3d 77 69 6d 70  |p%!12:icon%=wimp|
00007e80  25 21 31 36 3a 78 25 3d  77 69 6d 70 25 21 30 3a  |%!16:x%=wimp%!0:|
00007e90  79 25 3d 77 69 6d 70 25  21 34 0d 2f a8 10 c8 8e  |y%=wimp%!4./....|
00007ea0  20 62 75 74 74 6f 6e 25  20 ca 0d 2f b2 1f c9 32  | button% ../...2|
00007eb0  20 20 20 20 3a 20 f2 57  69 6d 70 5f 50 6f 6c 6c  |    : .Wimp_Poll|
00007ec0  4d 65 6e 75 50 6f 70 55  70 0d 2f bc 20 7f 3a 20  |MenuPopUp./. .: |
00007ed0  c8 8e 20 a4 45 76 65 6e  74 5f 53 61 76 65 28 77  |.. .Event_Save(w|
00007ee0  69 6e 64 6f 77 25 29 20  ca 0d 2f c6 1d c9 20 b9  |indow%) ../... .|
00007ef0  20 3a 20 f2 57 69 6d 70  5f 50 6f 6c 6c 4d 6f 75  | : .Wimp_PollMou|
00007f00  73 65 53 61 76 65 0d 2f  d0 22 c9 20 a3 3a 20 f2  |seSave./.". .: .|
00007f10  57 69 6d 70 5f 50 6f 6c  6c 45 76 65 6e 74 4d 6f  |Wimp_PollEventMo|
00007f20  75 73 65 43 6c 69 63 6b  0d 2f da 05 cb 0d 2f e4  |useClick./..../.|
00007f30  05 cb 0d 2f ee 05 e1 0d  2f f8 05 3a 0d 30 02 19  |.../..../..:.0..|
00007f40  dd 20 f2 57 69 6d 70 5f  50 6f 6c 6c 4d 65 6e 75  |. .Wimp_PollMenu|
00007f50  50 6f 70 55 70 0d 30 0c  1e 6d 65 6e 75 25 3d a4  |PopUp.0..menu%=.|
00007f60  45 76 65 6e 74 5f 4d 65  6e 75 28 77 69 6e 64 6f  |Event_Menu(windo|
00007f70  77 25 29 0d 30 16 0f c8  8e 20 6d 65 6e 75 25 20  |w%).0.... menu% |
00007f80  20 ca 0d 30 20 08 c9 20  a3 3a 0d 30 2a 07 7f 20  | ..0 .. .:.0*.. |
00007f90  3a 0d 30 34 10 c8 8e 20  77 69 6e 64 6f 77 25 20  |:.04... window% |
00007fa0  ca 0d 30 3e 11 c9 20 2d  32 20 20 20 3a 20 6e 25  |..0>.. -2   : n%|
00007fb0  3d 30 0d 30 48 2b c8 95  20 28 28 42 61 72 5f 4d  |=0.0H+.. ((Bar_M|
00007fc0  65 6e 75 25 21 28 32 38  2b 6e 25 2a 32 34 29 29  |enu%!(28+n%*24))|
00007fd0  80 25 31 30 30 30 30 30  30 30 29 3d 30 0d 30 52  |.%10000000)=0.0R|
00007fe0  09 6e 25 2b 3d 31 0d 30  5c 05 ce 0d 30 66 33 c8  |.n%+=1.0\...0f3.|
00007ff0  99 20 22 57 69 6d 70 5f  43 72 65 61 74 65 4d 65  |. "Wimp_CreateMe|
00008000  6e 75 22 2c 2c 42 61 72  5f 4d 65 6e 75 25 2c 78  |nu",,Bar_Menu%,x|
00008010  25 2d 36 34 2c 31 34 30  2b 6e 25 2a 34 34 0d 30  |%-64,140+n%*44.0|
00008020  70 2e 7f 20 3a 20 c8 99  22 57 69 6d 70 5f 43 72  |p.. : .."Wimp_Cr|
00008030  65 61 74 65 4d 65 6e 75  22 2c 2c 6d 65 6e 75 25  |eateMenu",,menu%|
00008040  2c 78 25 2d 36 34 2c 79  25 2b 32 30 0d 30 7a 05  |,x%-64,y%+20.0z.|
00008050  cb 0d 30 84 05 cb 0d 30  8e 05 e1 0d 30 98 05 3a  |..0....0....0..:|
00008060  0d 30 a2 19 dd 20 f2 57  69 6d 70 5f 50 6f 6c 6c  |.0... .Wimp_Poll|
00008070  4d 6f 75 73 65 53 61 76  65 0d 30 ac 0e c8 8e 20  |MouseSave.0.... |
00008080  69 63 6f 6e 25 20 ca 0d  30 b6 36 c9 20 30 20 3a  |icon% ..0.6. 0 :|
00008090  20 e7 20 62 75 74 74 6f  6e 25 20 80 20 26 35 30  | . button% . &50|
000080a0  20 8c 20 f2 57 69 6d 70  5f 50 6f 6c 6c 44 72 61  | . .Wimp_PollDra|
000080b0  67 42 6f 78 28 77 69 6e  64 6f 77 25 29 0d 30 c0  |gBox(window%).0.|
000080c0  36 c9 20 32 20 3a 20 e7  20 62 75 74 74 6f 6e 25  |6. 2 : . button%|
000080d0  20 80 20 35 20 8c 20 20  f2 57 69 6d 70 5f 50 6f  | . 5 .  .Wimp_Po|
000080e0  6c 6c 53 61 76 65 46 69  6c 65 28 77 69 6e 64 6f  |llSaveFile(windo|
000080f0  77 25 29 0d 30 ca 05 cb  0d 30 d4 05 e1 0d 30 de  |w%).0....0....0.|
00008100  05 3a 0d 30 e8 1f dd 20  f2 57 69 6d 70 5f 50 6f  |.:.0... .Wimp_Po|
00008110  6c 6c 45 76 65 6e 74 4d  6f 75 73 65 43 6c 69 63  |llEventMouseClic|
00008120  6b 0d 30 f2 2d e7 20 69  6e 74 65 72 66 61 63 65  |k.0.-. interface|
00008130  25 20 8c 20 c8 99 22 57  69 6d 70 5f 42 6f 72 64  |% . .."Wimp_Bord|
00008140  65 72 49 63 6f 6e 22 2c  2c 77 69 6d 70 25 0d 30  |erIcon",,wimp%.0|
00008150  fc 32 f2 45 76 65 6e 74  5f 4d 6f 75 73 65 43 6c  |.2.Event_MouseCl|
00008160  69 63 6b 28 77 69 6e 64  6f 77 25 2c 69 63 6f 6e  |ick(window%,icon|
00008170  25 2c 62 75 74 74 6f 6e  25 2c 78 25 2c 79 25 29  |%,button%,x%,y%)|
00008180  0d 31 06 14 c8 8e 20 20  69 6e 74 65 72 66 61 63  |.1....  interfac|
00008190  65 25 20 ca 0d 31 10 09  c9 20 b9 20 3a 0d 31 1a  |e% ..1... . :.1.|
000081a0  25 77 69 6d 70 25 21 30  3d 78 25 3a 77 69 6d 70  |%wimp%!0=x%:wimp|
000081b0  25 21 34 3d 79 25 20 3a  20 77 69 6d 70 25 21 38  |%!4=y% : wimp%!8|
000081c0  3d 30 0d 31 24 25 77 69  6d 70 25 21 31 32 3d 77  |=0.1$%wimp%!12=w|
000081d0  69 6e 64 6f 77 25 20 3a  20 77 69 6d 70 25 21 31  |indow% : wimp%!1|
000081e0  36 3d 69 63 6f 6e 25 0d  31 2e 1e c8 99 22 57 69  |6=icon%.1...."Wi|
000081f0  6d 70 5f 42 6f 72 64 65  72 49 63 6f 6e 22 2c 2c  |mp_BorderIcon",,|
00008200  77 69 6d 70 25 0d 31 38  05 cb 0d 31 42 05 e1 0d  |wimp%.18...1B...|
00008210  31 4c 05 3a 0d 31 56 21  dd 20 f2 57 69 6d 70 5f  |1L.:.1V!. .Wimp_|
00008220  50 6f 6c 6c 53 61 76 65  46 69 6c 65 28 77 69 6e  |PollSaveFile(win|
00008230  64 6f 77 25 29 0d 31 60  0b ea 20 66 69 6c 65 24  |dow%).1`.. file$|
00008240  0d 31 6a 3f 77 69 6d 70  25 21 30 3d 77 69 6e 64  |.1j?wimp%!0=wind|
00008250  6f 77 25 20 3a 20 77 69  6d 70 25 21 34 3d 31 20  |ow% : wimp%!4=1 |
00008260  3a 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |: .. "Wimp_GetIc|
00008270  6f 6e 53 74 61 74 65 22  2c 2c 77 69 6d 70 25 0d  |onState",,wimp%.|
00008280  31 74 15 66 69 6c 65 24  3d 24 28 77 69 6d 70 25  |1t.file$=$(wimp%|
00008290  21 32 38 29 0d 31 7e 14  c8 8e 20 a7 66 69 6c 65  |!28).1~... .file|
000082a0  24 2c 22 2e 22 29 20 ca  0d 31 88 0b c9 20 30 20  |$,".") ..1... 0 |
000082b0  20 20 3a 0d 31 92 3d 24  28 77 69 6d 70 25 2b 34  |  :.1.=$(wimp%+4|
000082c0  29 3d 22 54 6f 20 73 61  76 65 2c 20 64 72 61 67  |)="To save, drag|
000082d0  20 74 68 65 20 69 63 6f  6e 20 74 6f 20 61 20 64  | the icon to a d|
000082e0  69 72 65 63 74 6f 72 79  20 77 69 6e 64 6f 77 22  |irectory window"|
000082f0  0d 31 9c 28 c8 99 20 22  57 69 6d 70 5f 52 65 70  |.1.(.. "Wimp_Rep|
00008300  6f 72 74 45 72 72 6f 72  22 2c 77 69 6d 70 25 2c  |ortError",wimp%,|
00008310  31 36 2c 74 61 73 6b 24  0d 31 a6 06 7f 3a 0d 31  |16,task$.1...:.1|
00008320  b0 22 f2 45 76 65 6e 74  5f 53 61 76 65 46 69 6c  |.".Event_SaveFil|
00008330  65 28 66 69 6c 65 24 2c  77 69 6e 64 6f 77 25 29  |e(file$,window%)|
00008340  0d 31 ba 05 cb 0d 31 c4  1a c8 99 22 57 69 6d 70  |.1....1...."Wimp|
00008350  5f 43 72 65 61 74 65 4d  65 6e 75 22 2c 2d 31 0d  |_CreateMenu",-1.|
00008360  31 ce 1e e7 20 73 61 76  65 3d b9 20 8c 20 f2 57  |1... save=. . .W|
00008370  69 6d 70 5f 43 6c 6f 73  65 44 6f 77 6e 0d 31 d8  |imp_CloseDown.1.|
00008380  05 e1 0d 31 e2 05 3a 0d  31 ec 20 dd 20 f2 57 69  |...1..:.1. . .Wi|
00008390  6d 70 5f 50 6f 6c 6c 44  72 61 67 42 6f 78 28 77  |mp_PollDragBox(w|
000083a0  69 6e 64 6f 77 25 29 0d  31 f6 0b ea 20 78 25 2c  |indow%).1... x%,|
000083b0  79 25 0d 32 00 11 73 61  76 65 25 3d 77 69 6e 64  |y%.2..save%=wind|
000083c0  6f 77 25 0d 32 0a 12 21  77 69 6d 70 25 3d 77 69  |ow%.2..!wimp%=wi|
000083d0  6e 64 6f 77 25 0d 32 14  22 c8 99 22 57 69 6d 70  |ndow%.2.".."Wimp|
000083e0  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
000083f0  2c 2c 77 69 6d 70 25 0d  32 1e 2c 78 25 3d 77 69  |,,wimp%.2.,x%=wi|
00008400  6d 70 25 21 34 2d 77 69  6d 70 25 21 32 30 3a 79  |mp%!4-wimp%!20:y|
00008410  25 3d 77 69 6d 70 25 21  31 36 2d 77 69 6d 70 25  |%=wimp%!16-wimp%|
00008420  21 32 34 0d 32 28 0d 77  69 6d 70 25 21 34 3d 30  |!24.2(.wimp%!4=0|
00008430  0d 32 32 20 c8 99 22 57  69 6d 70 5f 47 65 74 49  |.22 .."Wimp_GetI|
00008440  63 6f 6e 53 74 61 74 65  22 2c 2c 77 69 6d 70 25  |conState",,wimp%|
00008450  0d 32 3c 12 21 77 69 6d  70 25 3d 77 69 6e 64 6f  |.2<.!wimp%=windo|
00008460  77 25 0d 32 46 0d 77 69  6d 70 25 21 34 3d 35 0d  |w%.2F.wimp%!4=5.|
00008470  32 50 2b 77 69 6d 70 25  21 38 3d 78 25 2b 77 69  |2P+wimp%!8=x%+wi|
00008480  6d 70 25 21 38 3a 77 69  6d 70 25 21 31 32 3d 79  |mp%!8:wimp%!12=y|
00008490  25 2b 77 69 6d 70 25 21  31 32 0d 32 5a 2d 77 69  |%+wimp%!12.2Z-wi|
000084a0  6d 70 25 21 31 36 3d 78  25 2b 77 69 6d 70 25 21  |mp%!16=x%+wimp%!|
000084b0  31 36 3a 77 69 6d 70 25  21 32 30 3d 79 25 2b 77  |16:wimp%!20=y%+w|
000084c0  69 6d 70 25 21 32 30 0d  32 64 19 77 69 6d 70 25  |imp%!20.2d.wimp%|
000084d0  21 32 34 3d 30 3a 77 69  6d 70 25 21 32 38 3d 30  |!24=0:wimp%!28=0|
000084e0  0d 32 6e 29 77 69 6d 70  25 21 33 32 3d 26 37 46  |.2n)wimp%!32=&7F|
000084f0  46 46 46 46 46 46 3a 77  69 6d 70 25 21 33 36 3d  |FFFFFF:wimp%!36=|
00008500  26 37 46 46 46 46 46 46  46 0d 32 78 15 e7 20 76  |&7FFFFFFF.2x.. v|
00008510  65 72 73 69 6f 6e 25 3e  3d 33 31 30 20 8c 0d 32  |ersion%>=310 ..2|
00008520  82 41 c8 99 22 44 72 61  67 41 53 70 72 69 74 65  |.A.."DragASprite|
00008530  5f 53 74 61 72 74 22 2c  25 31 31 30 30 30 31 30  |_Start",%1100010|
00008540  31 2c 31 2c 22 66 69 6c  65 5f 30 32 32 22 2c 77  |1,1,"file_022",w|
00008550  69 6d 70 25 2b 38 2c 77  69 6d 70 25 2b 32 34 0d  |imp%+8,wimp%+24.|
00008560  32 8c 05 cc 0d 32 96 1b  c8 99 22 57 69 6d 70 5f  |2....2...."Wimp_|
00008570  44 72 61 67 42 6f 78 22  2c 2c 77 69 6d 70 25 0d  |DragBox",,wimp%.|
00008580  32 a0 05 cd 0d 32 aa 05  e1 0d 32 b4 05 3a 0d 32  |2....2....2..:.2|
00008590  be 18 dd 20 f2 57 69 6d  70 5f 50 6f 6c 6c 4b 65  |... .Wimp_PollKe|
000085a0  79 50 72 65 73 73 0d 32  c8 2f 77 69 6e 64 6f 77  |yPress.2./window|
000085b0  25 3d 77 69 6d 70 25 21  30 3a 69 63 6f 6e 25 3d  |%=wimp%!0:icon%=|
000085c0  77 69 6d 70 25 21 34 3a  6b 65 79 25 3d 77 69 6d  |wimp%!4:key%=wim|
000085d0  70 25 21 32 34 0d 32 d2  1d c8 8e 20 a4 45 76 65  |p%!24.2.... .Eve|
000085e0  6e 74 5f 53 61 76 65 28  77 69 6e 64 6f 77 25 29  |nt_Save(window%)|
000085f0  20 ca 0d 32 dc 25 c9 20  b9 20 3a 20 f2 57 69 6d  | ..2.%. . : .Wim|
00008600  70 50 6f 6c 6c 5f 53 61  76 65 46 69 6c 65 28 77  |pPoll_SaveFile(w|
00008610  69 6e 64 6f 77 25 29 0d  32 e6 2c c9 20 a3 3a 20  |indow%).2.,. .: |
00008620  f2 45 76 65 6e 74 5f 4b  65 79 50 72 65 73 73 28  |.Event_KeyPress(|
00008630  77 69 6e 64 6f 77 25 2c  69 63 6f 6e 25 2c 6b 65  |window%,icon%,ke|
00008640  79 25 29 0d 32 f0 05 cb  0d 32 fa 05 e1 0d 33 04  |y%).2....2....3.|
00008650  05 3a 0d 33 0e 1b dd 20  f2 57 69 6d 70 5f 50 6f  |.:.3... .Wimp_Po|
00008660  6c 6c 53 61 76 65 4d 65  73 73 61 67 65 0d 33 18  |llSaveMessage.3.|
00008670  1f ea 20 66 69 6c 65 24  2c 77 69 6e 64 6f 77 25  |.. file$,window%|
00008680  2c 69 63 6f 6e 25 2c 78  25 2c 79 25 0d 33 22 22  |,icon%,x%,y%.3""|
00008690  c8 99 22 57 69 6d 70 5f  47 65 74 50 6f 69 6e 74  |.."Wimp_GetPoint|
000086a0  65 72 49 6e 66 6f 22 2c  2c 77 69 6d 70 25 0d 33  |erInfo",,wimp%.3|
000086b0  2c 39 77 69 6e 64 6f 77  25 3d 77 69 6d 70 25 21  |,9window%=wimp%!|
000086c0  31 32 3a 69 63 6f 6e 25  3d 77 69 6d 70 25 21 31  |12:icon%=wimp%!1|
000086d0  36 3a 78 25 3d 77 69 6d  70 25 21 30 3a 79 25 3d  |6:x%=wimp%!0:y%=|
000086e0  77 69 6d 70 25 21 34 0d  33 36 3d 77 69 6d 70 25  |wimp%!4.36=wimp%|
000086f0  21 30 3d 73 61 76 65 25  20 3a 20 77 69 6d 70 25  |!0=save% : wimp%|
00008700  21 34 3d 31 20 3a 20 c8  99 20 22 57 69 6d 70 5f  |!4=1 : .. "Wimp_|
00008710  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 77  |GetIconState",,w|
00008720  69 6d 70 25 0d 33 40 15  66 69 6c 65 24 3d 24 28  |imp%.3@.file$=$(|
00008730  77 69 6d 70 25 21 32 38  29 0d 33 4a 2a 66 69 6c  |wimp%!28).3J*fil|
00008740  65 24 3d a4 57 69 6d 70  5f 47 65 74 46 69 6c 65  |e$=.Wimp_GetFile|
00008750  46 72 6f 6d 50 61 74 68  6e 61 6d 65 28 66 69 6c  |FromPathname(fil|
00008760  65 24 29 0d 33 54 14 77  69 6d 70 25 21 32 30 3d  |e$).3T.wimp%!20=|
00008770  77 69 6e 64 6f 77 25 0d  33 5e 12 77 69 6d 70 25  |window%.3^.wimp%|
00008780  21 32 34 3d 69 63 6f 6e  25 0d 33 68 1b 77 69 6d  |!24=icon%.3h.wim|
00008790  70 25 21 32 38 3d 78 25  3a 77 69 6d 70 25 21 33  |p%!28=x%:wimp%!3|
000087a0  32 3d 79 25 0d 33 72 14  77 69 6d 70 25 21 33 36  |2=y%.3r.wimp%!36|
000087b0  3d 6c 65 6e 67 74 68 25  0d 33 7c 0e 77 69 6d 70  |=length%.3|.wimp|
000087c0  25 21 30 3d 36 34 0d 33  86 0e 77 69 6d 70 25 21  |%!0=64.3..wimp%!|
000087d0  31 32 3d 30 0d 33 90 0e  77 69 6d 70 25 21 31 36  |12=0.3..wimp%!16|
000087e0  3d 31 0d 33 9a 11 77 69  6d 70 25 21 34 30 3d 26  |=1.3..wimp%!40=&|
000087f0  46 46 46 0d 33 a4 15 24  28 77 69 6d 70 25 2b 34  |FFF.3..$(wimp%+4|
00008800  34 29 3d 66 69 6c 65 24  0d 33 ae 33 c8 99 22 57  |4)=file$.3.3.."W|
00008810  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
00008820  2c 31 37 2c 77 69 6d 70  25 2c 77 69 6d 70 25 21  |,17,wimp%,wimp%!|
00008830  32 30 2c 77 69 6d 70 25  21 32 34 0d 33 b8 05 e1  |20,wimp%!24.3...|
00008840  0d 33 c2 05 3a 0d 33 cc  18 dd 20 f2 57 69 6d 70  |.3..:.3... .Wimp|
00008850  5f 50 6f 6c 6c 4d 65 73  73 61 67 65 73 0d 33 d6  |_PollMessages.3.|
00008860  0b ea 20 66 69 6c 65 24  0d 33 e0 2c 66 69 6c 65  |.. file$.3.,file|
00008870  24 3d a4 57 69 6d 70 5f  47 65 74 53 74 72 69 6e  |$=.Wimp_GetStrin|
00008880  67 41 74 41 64 64 72 65  73 73 28 77 69 6d 70 25  |gAtAddress(wimp%|
00008890  2b 34 34 29 0d 33 ea 11  c8 8e 20 77 69 6d 70 25  |+44).3.... wimp%|
000088a0  21 31 36 20 ca 0d 33 f4  15 c9 20 30 20 3a 20 66  |!16 ..3... 0 : f|
000088b0  69 6e 69 73 68 65 64 25  3d b9 0d 33 fe 09 c9 20  |inished%=..3... |
000088c0  31 20 3a 0d 34 08 09 c9  20 32 20 3a 0d 34 12 3d  |1 :.4... 2 :.4.=|
000088d0  77 69 6d 70 25 21 30 3d  73 61 76 65 25 20 3a 20  |wimp%!0=save% : |
000088e0  77 69 6d 70 25 21 34 3d  31 20 3a 20 c8 99 20 22  |wimp%!4=1 : .. "|
000088f0  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00008900  65 22 2c 2c 77 69 6d 70  25 0d 34 1c 15 24 28 77  |e",,wimp%.4..$(w|
00008910  69 6d 70 25 21 32 38 29  3d 66 69 6c 65 24 0d 34  |imp%!28)=file$.4|
00008920  26 36 77 69 6d 70 25 21  30 3d 73 61 76 65 25 20  |&6wimp%!0=save% |
00008930  3a 20 77 69 6d 70 25 21  34 3d 31 20 3a 20 77 69  |: wimp%!4=1 : wi|
00008940  6d 70 25 21 38 3d 30 20  3a 20 77 69 6d 70 25 21  |mp%!8=0 : wimp%!|
00008950  31 32 3d 30 0d 34 30 21  c8 99 20 22 57 69 6d 70  |12=0.40!.. "Wimp|
00008960  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
00008970  77 69 6d 70 25 0d 34 3a  33 c8 99 20 22 57 69 6d  |wimp%.4:3.. "Wim|
00008980  70 5f 53 65 74 43 61 72  65 74 50 6f 73 69 74 69  |p_SetCaretPositi|
00008990  6f 6e 22 2c 73 61 76 65  25 2c 31 2c 2c 2c 2d 31  |on",save%,1,,,-1|
000089a0  2c a9 20 66 69 6c 65 24  0d 34 44 20 f2 45 76 65  |,. file$.4D .Eve|
000089b0  6e 74 5f 53 61 76 65 46  69 6c 65 28 66 69 6c 65  |nt_SaveFile(file|
000089c0  24 2c 73 61 76 65 25 29  0d 34 4e 1e e7 20 73 61  |$,save%).4N.. sa|
000089d0  76 65 3d b9 20 8c 20 f2  57 69 6d 70 5f 43 6c 6f  |ve=. . .Wimp_Clo|
000089e0  73 65 44 6f 77 6e 0d 34  58 07 c9 20 33 0d 34 62  |seDown.4X.. 3.4b|
000089f0  41 74 79 70 65 24 3d a4  57 69 6d 70 5f 46 69 6c  |Atype$=.Wimp_Fil|
00008a00  65 54 79 70 65 28 77 69  6d 70 25 21 34 30 29 20  |eType(wimp%!40) |
00008a10  3a 20 f2 45 76 65 6e 74  5f 4c 6f 61 64 46 69 6c  |: .Event_LoadFil|
00008a20  65 28 66 69 6c 65 24 2c  74 79 70 65 24 29 0d 34  |e(file$,type$).4|
00008a30  6c 05 cb 0d 34 76 05 e1  0d 34 80 05 3a 0d 34 8a  |l...4v...4..:.4.|
00008a40  0a dd 20 f2 61 63 6b 0d  34 94 55 e7 20 77 69 6d  |.. .ack.4.U. wim|
00008a50  70 25 21 34 3d 74 61 73  6b 25 20 80 20 77 69 6d  |p%!4=task% . wim|
00008a60  70 25 21 31 36 3d 35 20  8c 20 c8 99 20 22 57 69  |p%!16=5 . .. "Wi|
00008a70  6d 70 5f 53 74 61 72 74  54 61 73 6b 22 2c 22 52  |mp_StartTask","R|
00008a80  75 6e 20 43 61 76 65 72  6e 45 64 3a 44 6f 63 75  |un CavernEd:Docu|
00008a90  6d 65 6e 74 73 2e 21 48  65 6c 70 22 0d 34 9e 05  |ments.!Help".4..|
00008aa0  e1 0d 34 a8 05 3a 0d 34  b2 26 dd 20 a4 57 69 6d  |..4..:.4.&. .Wim|
00008ab0  70 5f 47 65 74 53 74 72  69 6e 67 41 74 41 64 64  |p_GetStringAtAdd|
00008ac0  72 65 73 73 28 61 72 72  61 79 25 29 0d 34 bc 0e  |ress(array%).4..|
00008ad0  ea 20 73 24 3a 73 24 3d  22 22 0d 34 c6 3c c8 95  |. s$:s$="".4.<..|
00008ae0  28 3f 61 72 72 61 79 25  3c 3e 31 33 29 80 28 3f  |(?array%<>13).(?|
00008af0  61 72 72 61 79 25 3c 3e  30 29 3a 73 24 2b 3d bd  |array%<>0):s$+=.|
00008b00  28 3f 61 72 72 61 79 25  29 3a 61 72 72 61 79 25  |(?array%):array%|
00008b10  2b 3d 31 3a ce 3a 0d 34  d0 07 3d 73 24 0d 34 da  |+=1:.:.4..=s$.4.|
00008b20  05 3a 0d 34 e4 23 dd 20  a4 57 69 6d 70 5f 47 65  |.:.4.#. .Wimp_Ge|
00008b30  74 46 69 6c 65 46 72 6f  6d 50 61 74 68 6e 61 6d  |tFileFromPathnam|
00008b40  65 28 66 24 29 0d 34 ee  11 c8 8e 20 a7 66 24 2c  |e(f$).4.... .f$,|
00008b50  22 2e 22 29 20 ca 0d 34  f8 0f c9 20 30 20 20 20  |".") ..4... 0   |
00008b60  20 3a 3d 66 24 0d 35 02  36 7f 20 3a 3d a4 57 69  | :=f$.5.6. :=.Wi|
00008b70  6d 70 5f 47 65 74 46 69  6c 65 46 72 6f 6d 50 61  |mp_GetFileFromPa|
00008b80  74 68 6e 61 6d 65 28 c2  66 24 2c a9 28 66 24 29  |thname(.f$,.(f$)|
00008b90  2d a7 66 24 2c 22 2e 22  29 29 29 0d 35 0c 05 cb  |-.f$,"."))).5...|
00008ba0  0d 35 16 05 3a 0d 35 20  1b dd 20 a4 57 69 6d 70  |.5..:.5 .. .Wimp|
00008bb0  5f 46 69 6c 65 54 79 70  65 28 74 79 70 65 25 29  |_FileType(type%)|
00008bc0  0d 35 2a 0d c8 8e 20 74  79 70 65 25 ca 0d 35 34  |.5*... type%..54|
00008bd0  11 c9 26 46 46 46 3a 3d  22 54 65 78 74 22 0d 35  |..&FFF:="Text".5|
00008be0  3e 11 c9 26 46 46 44 3a  3d 22 44 61 74 61 22 0d  |>..&FFD:="Data".|
00008bf0  35 48 12 c9 26 46 46 42  3a 3d 22 42 61 73 69 63  |5H..&FFB:="Basic|
00008c00  22 0d 35 52 13 c9 26 46  46 39 3a 3d 22 53 70 72  |".5R..&FF9:="Spr|
00008c10  69 74 65 22 0d 35 5c 14  c9 26 46 45 44 3a 3d 22  |ite".5\..&FED:="|
00008c20  50 61 6c 65 74 74 65 22  0d 35 66 15 c9 26 46 45  |Palette".5f..&FE|
00008c30  43 3a 3d 22 54 65 6d 70  6c 61 74 65 22 0d 35 70  |C:="Template".5p|
00008c40  11 c9 26 41 46 46 3a 3d  22 44 72 61 77 22 0d 35  |..&AFF:="Draw".5|
00008c50  7a 14 c9 26 31 30 30 30  3a 3d 22 46 6f 6c 64 65  |z..&1000:="Folde|
00008c60  72 22 0d 35 84 19 c9 26  32 30 30 30 3a 3d 22 41  |r".5...&2000:="A|
00008c70  70 70 6c 69 63 61 74 69  6f 6e 22 0d 35 8e 0f 7f  |pplication".5...|
00008c80  3d c3 7e 28 74 79 70 65  25 29 0d 35 98 05 cb 0d  |=.~(type%).5....|
00008c90  ff                                                |.|
00008c91