Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199610.adf » Regulars » StarInfo/Lurcock/!KeyFilter/!RunImage

StarInfo/Lurcock/!KeyFilter/!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_AcornUser_199610.adf » Regulars
Filename: StarInfo/Lurcock/!KeyFilter/!RunImage
Read OK:
File size: 6B60 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM ><KeyFilter$Dir>.!RunImage
   20:
   30ON ERROR ERROR EXT ERR,REPORT$+" @ "+STR$ERL:END
   40PROCinit
   50ON ERROR PROCerror
   60WHILE quit%=FALSE
   70PROCpoll
   80ENDWHILE
   90SYS"Wimp_CloseDown"
  100END
  110:
  120DEF PROCinit
  130taskname$="KeyFilter":errname$=taskname$
  140DIM q% 1400,miscb% 256,errblock% 256,caret% 32
  150maxcode%=&1000:DIM code% maxcode%
  160DIM id_data% 5120
  170maxremaps%=80:DIM remap$(maxremaps%):remaps%=1
  180remap$(1)="K000�K000"
  190DIM msglist% 8:!msglist%=0
  200SYS"Wimp_Initialise",310,&4B534154,taskname$,msglist%
  210PROCinit_keycodes
  220PROCinit_templates
  230PROCinit_menus
  240PROCinit_ibar
  250PROCinit_save
  260PROCinit_code
  270
  280vsn$="1.00 (08.02.1996)"
  281PROCseticontext(wh_proginfo%,4,vsn$)
  290
  300current%=1:PROCupdatelist:PROCstringtowindow(current%)
  310openmenu%=0:savetype%=0:REM 1=data, 2=module
  320trapkey%=FALSE:REM 1=from, 2=to
  330oddkey$="[Unknown]"
  340quit%=FALSE
  350ENDPROC
  360:
  370DEF PROCinit_ibar
  380!q%=-1:q%!4=0:q%!8=0:q%!12=68:q%!16=68:q%!20=&700301A
  390$(q%+24)="!keyfilter":SYS"Wimp_CreateIcon",,q% TO ibarhandle%
  400ENDPROC
  410:
  420DEF PROCinit_save
  430DIM savesprite$(2)
  440savesprite$(1)="file_ffd":savesprite$(2)="file_ffa"
  450DIM saveft%(2)
  460saveft%(1)=&ffd:saveft%(2)=&ffa
  470DIM savewh%(2)
  480savewh%(1)=wh_savedat%:savewh%(2)=wh_savemod%
  490ENDPROC
  500:
  510DEF PROCinit_code
  520DIM const_code% 32,date% 32
  530DIM mlabel%(maxremaps%),mloops%(maxremaps%),mloope%(maxremaps%)
  540P%=const_code%
  550[OPT 2
  560MOV R0,R0,ROR R1
  570MOV PC,R14
  580]
  590wp=12:sp=13:link=14:pc=15
  600ENDPROC
  610:
  620DEF PROCinit_templates
  630DIM tname% 11
  640idsize%=1450:DIM idata% idsize%
  650idmax%=idata%+idsize%:idleft%=idata%
  660nextt%=0
  670SYS"Wimp_OpenTemplate",,"<KeyFilter$Dir>.Templates"
  680wh_main%=FNloadtemplate("Main")
  690wh_list%=FNloadtemplate("List")
  700wh_savemod%=FNloadtemplate("SaveModule")
  710wh_proginfo%=FNloadtemplate("progInfo")
  720wh_savedat%=FNloadtemplate("SaveData")
  730SYS"Wimp_CloseTemplate"
  740ENDPROC
  750DEF FNloadtemplate(tname$)
  760$tname%=tname$
  770SYS"Wimp_LoadTemplate",,q%,idleft%,idmax%,-1,tname%,0TO,,idleft%,,,,nextt%
  780SYS"Wimp_CreateWindow",,q% TO whandle%
  790=whandle%
  800:
  810DEF PROCinit_menus
  820menu_ibar%=FNmakemenu("KeyFilter","Info�wh_proginfo%|Quit")
  830menu_main%=FNmakemenu("KeyFilter","Save module�wh_savemod%|_\Save data�wh_savedat%|Clear data")
  840ENDPROC
  850:
  860DEF PROCinit_keycodes
  870LOCAL fh%,in$
  880fh%=OPENIN"<KeyFilter$Dir>.KeyCodes"
  890keycodes%=-1
  900REPEAT:in$=GET$#fh%:keycodes%+=1:UNTIL EOF#fh%
  910PTR#fh%=0
  920DIM keycode%(keycodes%),keyname$(keycodes%)
  930FOR loop%=0 TO keycodes%
  940  in$="&"+GET$#fh%
  950  keycode%(loop%)=EVAL(in$)
  960  keyname$(loop%)=MID$(in$,INSTR(in$," ")+1)
  970NEXT loop%
  980CLOSE#fh%
  990ENDPROC
 1000:
 1010REM =============================================================
 1020:
 1030DEF PROCpoll
 1040SYS"Wimp_Poll",,q% TO reason%
 1050CASE reason% OF
 1060  WHEN 2:IF !q%=wh_main% PROCupdatelink(q%,wh_list%,0) ELSE SYS"Wimp_OpenWindow",,q%
 1070  WHEN 3:SYS"Wimp_CloseWindow",,q%
 1080    IF !q%=wh_main% THEN !q%=wh_list%:SYS"Wimp_CloseWindow",,q%
 1090  WHEN 6:PROCclick(q%!8,q%!12,q%!16)
 1100  WHEN 7:PROCstopdrag
 1110  WHEN 8:PROCprocesskey
 1120  WHEN 9:PROCmenuselect
 1130  WHEN 11:PROClosecaret
 1140  WHEN 17,18:PROCreceive
 1150ENDCASE
 1160ENDPROC
 1170:
 1180DEF PROCreceive
 1190CASE q%!16 OF
 1200  WHEN 0:quit%=TRUE
 1210  WHEN 2:PROCdo_save(FNcts(q%+44))
 1220    $(FNindir(savewh%(savetype%),2))=FNcts(q%+44)
 1230    q%!12=q%!8:q%!16=3:!q%=256
 1240    SYS"Wimp_SendMessage",18,q%,q%!20,q%!24
 1250  WHEN 3:q%!12=q%!8:q%!16=4:SYS"Wimp_SendMessage",17,q%,q%!4
 1260    PROCload_data(FNcts(q%+44))
 1270ENDCASE
 1280ENDPROC
 1290:
 1300DEF PROClosecaret
 1310LOCAL ih%
 1320IF trapkey%>0 THEN
 1330  IF trapkey%=1 ih%=3 ELSE ih%=9
 1340  PROCseticon(wh_main%,ih%,0,1<<21)
 1350  trapkey%=0
 1360ENDIF
 1370ENDPROC
 1380:
 1390DEF PROCclick(button%,whandle%,ihandle%)
 1400LOCAL otk%,loop%,yscroll%
 1410IF button%=2 THEN PROCopenmenu:ENDPROC
 1420CASE whandle% OF
 1430  WHEN -2
 1440   !q%=wh_main%:SYS"Wimp_GetWindowState",,q%
 1450   IF ((q%!32)AND(1<<16))=0 THEN
 1460     PROCcentrewindow(q%+4)
 1470     PROCyscroll_zero(wh_list%)
 1480   ENDIF
 1490   PROCupdatelink(q%,wh_list%,0)
 1500  WHEN wh_main%
 1510   CASE ihandle% OF
 1520     WHEN 3,9
 1530       otk%=trapkey%
 1540       trapkey%=(-2-(ihandle%=3))*FNselicon(wh_main%,ihandle%)
 1550       IF trapkey%=0 THEN
 1560         PROCseticon(whandle%,(ihandle%EOR10),0,1<<21)
 1570         SYS"Wimp_SetCaretPosition",!caret%,caret%!4,caret%!8,caret%!16,caret%!20,caret%!24
 1580        ELSE
 1590         PROCseticon(whandle%,(ihandle%EOR10),0,1<<21)
 1600         IF otk%=0 THEN
 1610           SYS"Wimp_GetCaretPosition",,caret%
 1620           SYS"Wimp_SetCaretPosition",whandle%,-1,0,0,(1<<25),-1
 1630         ENDIF
 1640       ENDIF
 1650     WHEN 14
 1660       IF remaps%<80 THEN
 1670         remaps%+=1:remap$(remaps%)="K000�K000"
 1680         PROCwindowtostring(current%):current%=remaps%
 1690         PROCupdatelist
 1700         PROCstringtowindow(current%)
 1710         !q%=wh_main%:SYS"Wimp_GetWindowState",,q%
 1720         PROCupdatelink(q%,wh_list%,0)
 1730         PROCshowcurrent
 1740        ELSE
 1750         dummy%=FNreport("Sorry, maximum 80 key remaps. Hack the program if you need more!",2)
 1760       ENDIF
 1770     WHEN 15
 1780       IF remaps%>1 THEN
 1790         remaps%-=1
 1800         IF current%<=remaps% THEN
 1810           FOR loop%=current% TO remaps%
 1820             remap$(loop%)=remap$(loop%+1)
 1830           NEXT loop%
 1840         ENDIF
 1850         IF current%>remaps% current%=remaps%
 1860         !miscb%=wh_list%:SYS"Wimp_GetWindowState",,miscb%
 1870         yscroll%=miscb%!24
 1880         PROCupdatelist
 1890         !q%=wh_main%:SYS"Wimp_GetWindowState",,q%
 1900         PROCupdatelink(q%,wh_list%,0)
 1910         !miscb%=wh_list%:SYS"Wimp_GetWindowState",,miscb%
 1920         miscb%!24=yscroll%:SYS"Wimp_OpenWindow",,miscb%
 1930         PROCstringtowindow(current%)
 1940        ELSE
 1950         dummy%=FNreport("Sorry, minimum 1 key remap!",2)
 1960       ENDIF
 1970     WHEN 7,8,11:PROCwindowtostring(current%)
 1980   ENDCASE
 1990  WHEN wh_list%
 2000   IF ihandle%<>current%-1 THEN
 2010     PROCwindowtostring(current%)
 2020     current%=ihandle%+1
 2030     PROCstringtowindow(current%)
 2040    ELSE
 2050     IF FNselicon(wh_list%,ihandle%)=0 THEN PROCseticon(wh_list%,ihandle%,1<<21,1<<21)
 2060   ENDIF
 2070  WHEN wh_savedat%,wh_savemod%
 2080   IF whandle%=wh_savedat% THEN savetype%=1 ELSE savetype%=2
 2090   IF ihandle%=3 AND button%>15 THEN PROCstartdrag(whandle%)
 2100   IF ihandle%=0 THEN PROCquicksave
 2110ENDCASE
 2120ENDPROC
 2130:
 2140DEF PROCopenmenu
 2150LOCAL my%
 2160CASE q%!12 OF
 2170  WHEN -2:openmenu%=menu_ibar%:my%=184
 2180  OTHERWISE:openmenu%=menu_main%:my%=q%!4
 2190ENDCASE
 2200SYS"Wimp_CreateMenu",,openmenu%,!q%-64,my%
 2210ENDPROC
 2220:
 2230DEF PROCmenuselect
 2240IF openmenu%=menu_ibar% AND !q%=1 THEN quit%=TRUE
 2250IF openmenu%=menu_main% AND !q%=2 THEN PROCwipe_data
 2260SYS"Wimp_GetPointerInfo",,miscb%
 2270IF miscb%!8=1 THEN SYS"Wimp_CreateMenu",,menu%,0,0
 2280ENDPROC
 2290:
 2300DEF PROCprocesskey
 2310LOCAL key%,loop%,key$
 2320IF trapkey%>0 THEN
 2330  SYS"Wimp_SetCaretPosition",!caret%,caret%!4,caret%!8,caret%!16,caret%!20,caret%!24
 2340  IF trapkey%=1 ih%=3 ELSE ih%=9
 2350  PROCseticon(wh_main%,ih%,0,1<<21)
 2360  key%=q%!24
 2370  PROCupdatewi(wh_main%,ih%+1,"&"+STR$~key%)
 2380  PROCseticontext(wh_main%,ih%,FNkeyname(key%))
 2390  PROCwindowtostring(current%)
 2400  trapkey%=0
 2410 ELSE
 2420  CASE !q% OF
 2430    WHEN wh_main%
 2440      IF (q%!4=4 OR q%!4=10) AND q%!24=13 THEN
 2450        PROCseticontext(wh_main%,q%!4-1,FNkeyname(FNeval($(FNindir(wh_main%,q%!4)))))
 2460        PROCwindowtostring(current%)
 2470       ELSE
 2480        IF q%!24=13 AND q%!4=12 THEN
 2490          PROCwindowtostring(current%)
 2500         ELSE:SYS"Wimp_ProcessKey",q%!24
 2510        ENDIF
 2520      ENDIF
 2530    WHEN wh_savedat%,wh_savemod%
 2540      IF q%!24=13 THEN
 2550        IF !q%=wh_savedat% THEN savetype%=1 ELSE savetype%=2
 2560        PROCquicksave
 2570       ELSE
 2580        SYS"Wimp_ProcessKey",q%!24
 2590      ENDIF
 2600    OTHERWISE:SYS"Wimp_ProcessKey",q%!24
 2610  ENDCASE
 2620ENDIF
 2630ENDPROC
 2640:
 2650DEF FNkeyname(key%)
 2660LOCAL loop%,key$
 2670IF key%<&20 OR key%>&179 OR key%=&7F THEN
 2680  loop%=0
 2690  WHILE keycode%(loop%)<>key% AND loop%<keycodes%
 2700  loop%+=1:ENDWHILE
 2710  IF keycode%(loop%)<>key% key$=oddkey$ ELSE key$=keyname$(loop%)
 2720 ELSE
 2730  key$="�"+CHR$(key%)+"� ("+STR$~key%+")"
 2740ENDIF
 2750=key$
 2760:
 2770DEF PROCwipe_data
 2780errname$="Warning from "+taskname$
 2790IF FNreport("Are you sure you would like to clear all the data? (OK clears)",19)=2 THEN errname$=taskname$:ENDPROC
 2800remaps%=1:current%=1:remap$(1)="K000�K000":PROCupdatelist
 2810!q%=wh_main%
 2820SYS"Wimp_GetWindowState",,q%:PROCupdatelink(q%,wh_list%,0)
 2830ENDPROC
 2840:
 2850DEF PROCupdatelist
 2860LOCAL loop%,id%
 2870id%=id_data%
 2880!miscb%=wh_list%:SYS"Wimp_GetWindowInfo",,miscb%+1
 2890SYS"Wimp_DeleteWindow",,miscb%
 2900miscb%!48=-16-52*remaps%
 2910IF miscb%!48>-382 miscb%!48=-382
 2920miscb%!88=0
 2930SYS"Wimp_CreateWindow",,miscb%+4 TO wh_list%
 2940FOR loop%=1 TO remaps%
 2950  !miscb%=wh_list%
 2960  miscb%!4=8:miscb%!8=-(52*loop%+8)
 2970  miscb%!12=366:miscb%!16=-(52*loop%-52+8)
 2980  miscb%!20=&701B1B1
 2990  IF loop%=current% THEN miscb%!20+=(1<<21)
 3000  miscb%!24=id%:miscb%!28=-1
 3010  $id%=FNtranslate(loop%):miscb%!32=LEN($id%)+1
 3020  id%+=50:REM NB: maxlen 50!!
 3030  SYS"Wimp_CreateIcon",,miscb%
 3040NEXT loop%
 3050ENDPROC
 3060:
 3070DEF FNtranslate(mapping%)
 3080LOCAL in$,out$
 3090in$=remap$(mapping%)
 3100out$=FNshortkeyname(EVAL("&"+MID$(in$,2,3)))+" � "
 3110CASE MID$(in$,6,1) OF
 3120  WHEN "K":out$+=FNshortkeyname(EVAL("&"+MID$(in$,7,3)))
 3130  WHEN "M":out$+=MID$(in$,6)
 3140  WHEN "N":out$+="[Null]"
 3150ENDCASE
 3160=out$
 3170:
 3180DEF FNshortkeyname(in%)
 3190LOCAL out$
 3200out$=FNkeyname(in%)
 3210IF INSTR(out$," ")=0 THEN =out$
 3220=LEFT$(out$,INSTR(out$," ")-1)
 3230:
 3240DEF PROCstringtowindow(mapping%)
 3250LOCAL key1%,key2%,in$
 3260in$=remap$(mapping%)
 3270REM dummy%=FNreport(STR$(mapping%)+","+in$,1)
 3280key1%=EVAL("&"+MID$(in$,2,3))
 3290PROCupdatewi(wh_main%,4,"&"+STR$~key1%)
 3300PROCseticontext(wh_main%,3,FNkeyname(key1%))
 3310CASE MID$(in$,6,1) OF
 3320  WHEN "K"
 3330    PROCsel(8,-1):PROCsel(7,0):PROCsel(11,0)
 3340    key2%=EVAL("&"+MID$(in$,7,3))
 3350    PROCupdatewi(wh_main%,10,"&"+STR$~key2%)
 3360    PROCseticontext(wh_main%,9,FNkeyname(key2%))
 3370    PROCupdatewi(wh_main%,12,"")
 3380  WHEN "N"
 3390    PROCsel(7,-1):PROCsel(8,0):PROCsel(11,0)
 3400    PROCupdatewi(wh_main%,10,"&FFF")
 3410    PROCseticontext(wh_main%,9,"[None]")
 3420    PROCupdatewi(wh_main%,12,"")
 3430  WHEN "M"
 3440    PROCsel(7,0):PROCsel(8,0):PROCsel(11,-1)
 3450    PROCupdatewi(wh_main%,10,"&FFF")
 3460    PROCseticontext(wh_main%,9,"[None]")
 3470    PROCupdatewi(wh_main%,12,MID$(in$,7))
 3480ENDCASE
 3490ENDPROC
 3500:
 3510DEF PROCwindowtostring(mapping%)
 3520LOCAL type%,out$
 3530type%=FNsel_esg(wh_main%,1)
 3540out$="K"+FNstr(FNeval($(FNindir(wh_main%,4))))+"�"
 3550CASE type% OF
 3560  WHEN -1,7:out$+="N"
 3570  WHEN 8:out$=out$+"K"+FNstr(FNeval($(FNindir(wh_main%,10))))
 3580  WHEN 11:out$=out$+"M"+$(FNindir(wh_main%,12))
 3590ENDCASE
 3600remap$(mapping%)=out$
 3610PROCseticontext(wh_list%,mapping%-1,FNtranslate(mapping%))
 3620ENDPROC
 3630:
 3640DEF FNeval(in$)
 3650ON ERROR LOCAL =EVAL("&"+in$)
 3660=EVAL(in$)
 3670:
 3680DEF FNstr(in%)
 3690=STRING$(3-LEN(STR$~in%),"0")+STR$~in%
 3700:
 3710DEF PROCsel(ih%,flag%)
 3720!miscb%=wh_main%:miscb%!4=ih%
 3730miscb%!8=(1<<21)AND flag%
 3740miscb%!12=1<<21
 3750SYS"Wimp_SetIconState",,miscb%
 3760ENDPROC
 3770:
 3780DEF PROCshowcurrent
 3790LOCAL t%,b%,re%
 3800!miscb%=wh_list%:SYS"Wimp_GetWindowState",,miscb%
 3810t%=-8-52*(current%-1):b%=-8-52*current%+382
 3820IF t%>miscb%!24 THEN miscb%!24=t%:re%=TRUE
 3830IF b%<miscb%!24 THEN miscb%!24=b%:re%=TRUE
 3840IF re%=TRUE THEN SYS"Wimp_OpenWindow",,miscb%
 3850ENDPROC
 3860:
 3870REM =============================================================
 3880:
 3890DEF PROCstartdrag(wh%)
 3900LOCAL xorig%,yorig%
 3910!miscb%=wh%
 3920SYS"Wimp_GetWindowState",,miscb%
 3930xorig%=miscb%!4-miscb%!20
 3940yorig%=miscb%!16-miscb%!24
 3950miscb%!4=3
 3960SYS"Wimp_GetIconState",,miscb%
 3970IF FNsoliddrag=TRUE THEN
 3980  !miscb%=xorig%+miscb%!8:miscb%!4=yorig%+miscb%!12
 3990  miscb%!8=xorig%+miscb%!16:miscb%!12=yorig%+miscb%!20
 4000  SYS"DragASprite_Start",%10000101,1,savesprite$(savetype%),miscb%
 4010 ELSE
 4020  miscb%!4=5:miscb%!8=xorig%+miscb%!8
 4030  miscb%!12=miscb%!12+yorig%:miscb%!16=miscb%!16+xorig%
 4040  miscb%!20=miscb%!20+yorig%:miscb%!24=0
 4050  miscb%!28=0:miscb%!32=&7fffffff:miscb%!36=&7fffffff
 4060  SYS"Wimp_DragBox",,miscb%
 4070ENDIF
 4080ENDPROC
 4090:
 4100DEF FNsoliddrag
 4110LOCAL byte%
 4120SYS"OS_Byte",161,28 TO ,,byte%
 4130IF (byte%AND2)=2 THEN =TRUE ELSE =FALSE
 4140:
 4150DEF PROCstopdrag
 4160LOCAL leaf$
 4170SYS"XDragASprite_Stop"
 4180SYS"Wimp_CreateMenu",,-1
 4190SYS"Wimp_GetPointerInfo",,miscb%
 4200q%!20=miscb%!12:q%!24=miscb%!16:q%!28=!miscb%:q%!32=miscb%!4
 4210q%!36=256:q%!40=saveft%(savetype%)
 4220leaf$=FNleafname($(FNindir(savewh%(savetype%),2)))
 4230$(q%+44)=leaf$+CHR$0:q%!16=1:q%!12=0
 4240!q%=((48+LEN(leaf$))DIV4)*4
 4250SYS"Wimp_SendMessage",18,q%,q%!20,q%!24
 4260ENDPROC
 4270:
 4280DEF PROCdo_save(filename$)
 4290CASE savetype% OF
 4300  WHEN 1:PROCsave_data(filename$)
 4310  WHEN 2:PROCassemble(filename$)
 4320ENDCASE
 4330ENDPROC
 4340:
 4350DEF FNleafname(in$)
 4360LOCAL out$,pos%
 4370pos%=LEN(in$)
 4380WHILE MID$(in$,pos%,1)<>"." AND pos%>0
 4390pos%-=1:ENDWHILE
 4400=MID$(in$,pos%+1)
 4410:
 4420DEF PROCquicksave
 4430IF INSTR($(FNindir(savewh%(savetype%),2)),".")=0 THEN
 4440  d%=FNreport("To save, drag the icon to a directory viewer",1)
 4450 ELSE
 4460  PROCdo_save($(FNindir(savewh%(savetype%),2)))
 4461  SYS"Wimp_CreateMenu",,-1
 4470ENDIF
 4480ENDPROC
 4490:
 4500DEF PROCsave_data(filename$)
 4510LOCAL fh%,loop%
 4520fh%=OPENOUT(filename$)
 4530BPUT#fh%,"This is a KeyFilter file. Version 1.00"
 4540BPUT#fh%,STR$(remaps%)
 4550BPUT#fh%,FNcts(FNindir(wh_main%,17))
 4560BPUT#fh%,FNcts(FNindir(wh_main%,19))
 4570FOR loop%=1 TO remaps%
 4580  BPUT#fh%,remap$(loop%)
 4590NEXT loop%
 4600CLOSE#fh%
 4610ENDPROC
 4620:
 4630DEF PROCload_data(filename$)
 4640LOCAL fh%,loop%,in$
 4650fh%=OPENIN(filename$)
 4660in$=GET$#fh%
 4670IF in$<>"This is a KeyFilter file. Version 1.00" THEN CLOSE#fh%:dummy%=FNreport("This doesn't look like a KeyFilter file. I'm going to ignore it.",2):ENDPROC
 4680remaps%=VAL(GET$#fh%)
 4690PROCupdatewi(wh_main%,17,GET$#fh%)
 4700PROCupdatewi(wh_main%,19,GET$#fh%)
 4710FOR loop%=1 TO remaps%
 4720  remap$(loop%)=GET$#fh%
 4730NEXT loop%
 4740CLOSE#fh%
 4750PROCseticontext(wh_savedat%,2,filename$)
 4751PROCseticontext(wh_savemod%,2,LEFT$($(FNindir(wh_main%,17)),10))
 4760current%=1
 4770PROCupdatelist
 4780PROCyscroll_zero(wh_list%)
 4790!q%=wh_main%:SYS"Wimp_GetWindowState",,q%
 4800PROCupdatelink(q%,wh_list%,0)
 4810PROCstringtowindow(current%)
 4820ENDPROC
 4830:
 4840REM =============================================================
 4850:
 4860DEF PROCassemble(filename$)
 4870LOCAL filtname$,taskname$
 4880filtname$=$(FNindir(wh_main%,17))
 4890taskname$=$(FNindir(wh_main%,19))
 4900taskhandle=260
 4910his_taskh=264
 4920FOR pass%=12 TO 14 STEP 2
 4930P%=0:O%=code%:L%=code%+maxcode%
 4940[OPT pass%
 4950          EQUD StartCode
 4960          EQUD InitCode
 4970          EQUD FinalCode
 4980          EQUD ServiceCode
 4990          EQUD TitleString
 5000          EQUD HelpString
 5010          EQUD HelpTable
 5020          EQUD 0    \ SWI chunk number
 5030          EQUD 0    \ SWI handler
 5040          EQUD 0    \ SWI decode table
 5050          EQUD 0    \ SWI decode code
 5060.TitleString
 5070          EQUS filtname$
 5080          EQUB 0
 5090          ALIGN
 5100.HelpString
 5110          EQUS filtname$
 5120          EQUB 9
 5130          EQUS "Assembled "+FNdate
 5140          EQUB 13
 5150          EQUS "Produced using KeyFilter 1.00 for "+taskname$+"."
 5160          EQUB 0
 5170          ALIGN
 5180.HelpTable
 5190          EQUS "Desktop_"+filtname$
 5200          EQUB 0
 5210          ALIGN
 5220          EQUD StarCommand
 5230          EQUD 0
 5240          EQUD 0
 5250          EQUD donotuse
 5260          EQUS filtname$
 5270          EQUB 0
 5280          ALIGN
 5290          EQUD 0
 5300          EQUD 0
 5310          EQUD 0
 5320          EQUD help
 5330          EQUB 0
 5340.help     EQUS "This module filters keypresses and menu "
 5350          EQUS "selections for "+taskname$+"."
 5360          EQUB 0
 5370.donotuse
 5380          EQUS "Do not use *Desktop_"+filtname$+"."
 5390          EQUB 0
 5400          ALIGN
 5410.InitCode
 5420          STMFD   (sp)!,{R7-R11,R14}
 5430          MOV     R0,#6                   ; 6 - claim workspace
 5440          MOV     R3,#300                 ; 300 bytes please
 5450          SWI     "XOS_Module"            ; Claim it
 5460          BVS     InitExit                ; Got it?
 5470          STR     R2,[wp]                 ; Then store the address
 5480          MOV     R0,#0
 5490          STR     R0,[R2,#taskhandle]     ; no taskhandle yet
 5500          LDR     R12,[R12]
 5510          MOV     R3,#0
 5520.scanloop MOV     R1,R12
 5530          MOV     R2,#16
 5540          SWI     "TaskManager_EnumerateTasks"
 5550          CMN     R0,#1
 5560          BNE     chkname
 5570.sl_end   STR     R3,[wp,#his_taskh]
 5580          CMP     R3,#0
 5590          BNE     Attach_filter
 5600          LDMFD   (sp)!,{R7-R11,pc}       ; that's all folks
 5610.chkname  ADR     R4,taskname
 5620          MOV     R8,R12
 5630          LDR     R5,[R8,#4]
 5640.chkloop  LDRB    R6,[R4],#1
 5650          LDRB    R7,[R5],#1
 5660          CMP     R6,#32
 5670          MOVLT   R6,#0
 5680          CMP     R7,#32
 5690          MOVLT   R7,#0
 5700          CMP     R6,R7
 5710          BNE     scanloop
 5720          CMP     R6,#0
 5730          BNE     chkloop
 5740          LDR     R3,[R8]
 5750          B       sl_end
 5760.Attach_filter
 5770          ADR     R0,filtname
 5780          ADR     R1,FilterCode
 5790          MOV     R2,#0
 5800          LDR     R3,[R12,#his_taskh]
 5810          LDR     R4,filtmask
 5820          SWI     "XFilter_RegisterPostFilter"
 5830          LDMFD   (sp)!,{R7-R11,pc}
 5840.InitExit
 5850          LDMFD   (sp)!,{R7-R11,pc}
 5860.StarCommand
 5870          STMFD   (sp)!,{R14}
 5880          MOV     R2,R0                   ; parameters
 5890          ADR     R1,TitleString          ; module name
 5900          MOV     R0,#2
 5910          SWI     "XOS_Module"            ; enter as language
 5920          LDMFD   (sp)!,{pc}
 5930.StartCode
 5940          LDR     wp,[R12]                ; load workspace pointer
 5950          LDR     R0,[wp,#taskhandle]     ; load task handle
 5960          TEQ     R0,#0                   ; am I running?
 5970          LDRGT   R1,TASK                 ; if so...
 5980          SWIGT   "XWimp_CloseDown"       ; quit
 5990          MOVGT   R0,#0                   ; then...
 6000          STRGT   R0,[wp,#taskhandle]     ; store taskhandle 0  
 6010          MOV     R0,#300                 ; wimp version
 6020          LDR     R1,TASK                 ; 4B534154
 6030          ADR     R2,TitleString          ; Task name
 6040          ADR     R3,message_list
 6050          SWI     "XWimp_Initialise"      ; Initialise!
 6060          SWIVS   "XOS_Exit"              ; exit if error occurred
 6070          STR     R1,[R12,#taskhandle]    ; store task handle
 6080.poll     LDR     R0,mask                 ; reason code mask
 6090          MOV     R1,wp                   ; workspace
 6100          SWI     "XWimp_Poll"            ; poll the wimp
 6110          CMP     R0,#17                  ; reason code 17?
 6120          CMPNE   R0,#18                  ; or 18?
 6130          BNE     poll                    ; if not keep going
 6140          LDR     R0,[wp,#16]             ; get message type
 6150          MOV     R4,#&40000
 6160          ADD     R4,R4,#&C2
 6170          CMP     R0,R4
 6180          BEQ     task_initialise
 6190          ADD     R4,R4,#1
 6200          CMP     R0,R4
 6210          BEQ     task_closedown
 6220          CMP     R0,#0                   ; quit?
 6230          SWIEQ   "XWimp_CloseDown"       ; if so quit
 6240          MOVEQ   R1,#0                   ; and...
 6250          STREQ   R1,[wp,#taskhandle]     ; store task handle 0
 6260          SWIEQ   "XOS_Exit"              ; and exit
 6270          B       poll
 6280.task_initialise
 6290          LDR     R4,[R12,#his_taskh]
 6300          CMP     R4,#0
 6310          BNE     poll
 6320          ADR     R4,taskname
 6330          ADD     R5,R12,#28
 6340.newt_chk LDRB    R6,[R4],#1
 6350          LDRB    R7,[R5],#1
 6360          CMP     R6,R7
 6370          BNE     poll
 6380          CMP     R6,#0
 6390          BNE     newt_chk
 6400          LDR     R3,[R12,#4]
 6410          STR     R3,[R12,#his_taskh]
 6420          ADR     R0,filtname
 6430          ADR     R1,FilterCode
 6440          MOV     R2,#0
 6450          LDR     R4,filtmask
 6460          SWI     "XFilter_RegisterPostFilter"
 6470          B       poll
 6480.task_closedown
 6490          LDR     R4,[R12,#4]
 6500          LDR     R5,[R12,#his_taskh]
 6510          CMP     R4,R5
 6520          BNE     poll
 6530          ADR     R0,filtname
 6540          ADR     R1,FilterCode
 6550          MOV     R2,#0
 6560          LDR     R3,[R12,#his_taskh]
 6570          LDR     R4,filtmask
 6580          SWI     "XFilter_DeRegisterPostFilter"
 6590          MOV     R0,#0
 6600          STR     R0,[R12,#his_taskh]
 6610          B       poll
 6620.FinalCode
 6630          STMFD   (sp)!,{R7-R11,R14}
 6640          LDR     wp,[R12]                ; load workspace pointer
 6650          LDR     R0,[wp,#taskhandle]     ; load task handle
 6660          TEQ     R0,#0                   ; am I running?
 6670          LDRGT   R1,TASK                 ; if so...
 6680          SWIGT   "XWimp_CloseDown"       ; quit
 6690          MOV     R1,#0                   ; and...
 6700          STR     R1,[wp,#taskhandle]     ; store task handle of 0
 6710          LDR     R0,[wp,#his_taskh]
 6720          TEQ     R0,#0
 6730          ADRGT   R0,filtname
 6740          ADRGT   R1,FilterCode
 6750          MOVGT   R2,#0
 6760          LDRGT   R3,[R12,#his_taskh]
 6770          LDRGT   R4,filtmask
 6780          SWIGT   "XFilter_DeRegisterPostFilter"
 6790          MOVGT   R0,#0
 6800          STRGT   R0,[R12,#his_taskh]
 6810          MOV     R0,#7                   ; now...
 6820          MOV     R2,wp                   ; ...
 6830          SWI     "OS_Module"             ; free the workspace
 6840          LDMFD   (sp)!,{R7-R11,pc}
 6850.ServiceCode
 6860          LDR     wp,[wp]                 ; load workspace pointer
 6870          STMFD   (sp)!,{R14}
 6880          TEQ     R1,#&49                 ; StartWimp?
 6890          BEQ     Service_StartWimp
 6900          TEQ     R1,#&4A                 ; StartedWimp?
 6910          BEQ     Service_StartedWimp
 6920          TEQ     R1,#&27                 ; Reset?
 6930          MOVEQ   R14,#0
 6940          STREQ   R14,[wp,#taskhandle]    ; store task handle of 0
 6950          LDMFD   (sp)!,{pc}
 6960.Service_StartWimp
 6970          LDR     R14,[wp,#taskhandle]    ; get task handle
 6980          TEQ     R14,#0                  ; am I running?
 6990          MVNEQ   R14,#0                  ; if not make handle -1
 7000          STREQ   R14,[wp,#taskhandle]    ; and store it
 7010          ADREQ   R0,HelpTable            ; R0 to start command
 7020          MOVEQ   R1,#0                   ; and claim service
 7030          LDMFD   (sp)!,{pc}
 7040.Service_StartedWimp
 7050          LDR     R14,[wp,#taskhandle]    ; get task handle
 7060          CMN     R14,#1                  ; is it -1?
 7070          MOVEQ   R14,#0                  ; if so make it 0
 7080          STREQ   R14,[wp,#taskhandle]    ; and store it
 7090          LDMFD   (sp)!,{pc}
 7100.FilterCode
 7110          CMP     R0,#8
 7120          MOVNES  PC,R14
 7130          STMFD   R13!,{R3,R4}
 7140          LDR     R3,[R1,#24]
 7150          FNfilter_keys
 7160.filt_end STR     R3,[R1,#24]
 7170          LDMFD   R13!,{R3,R4}
 7180          MOVS    PC,R14
 7190          FNmenu_blocks
 7200.TASK     EQUS    "TASK"
 7210.message_list
 7220          EQUD &400C2
 7230          EQUD &400C3
 7240          EQUD 0
 7250.mask     EQUD    %10000001100000110001
 7260.filtmask EQUD    %11100011100001110011
 7270.filtname EQUS filtname$
 7280          EQUB 0
 7290          ALIGN
 7300.taskname EQUS taskname$
 7310          EQUB 0
 7320          ALIGN
 7330
 7340]NEXT pass%
 7350SYS "OS_File",10,filename$,&FFA,,code%,O%
 7360ENDPROC
 7370:
 7380DEF FNfilter_keys
 7390LOCAL loop%,from%,to%,in$
 7400FOR loop%=1 TO remaps%
 7410in$=remap$(loop%)
 7420IF LEFT$(in$,1)="K" THEN
 7430  from%=EVAL("&"+MID$(in$,2,3))
 7440  IF FNlegal(from%) THEN
 7450    [ OPT pass%:CMP R3,#from% :]
 7460  ELSE
 7470    [ OPT pass%:MOV R4,#&100:ADD R4,R4,#(from%-&100):CMP R3,R4 :]
 7480  ENDIF
 7490  CASE MID$(in$,6,1) OF
 7500    WHEN "K"
 7510      to%=EVAL("&"+MID$(in$,7,3))
 7520      IF FNlegal(to%) THEN
 7530        [ OPT pass%:MOVEQ R3,#to% :]
 7540      ELSE
 7550        [ OPT pass%:MOVEQ R3,#&100:ADDEQ R3,R3,#(to%-&100) :]
 7560      ENDIF
 7570    WHEN "N":[ OPT pass%:MOVEQ R0,#0 :]
 7580    WHEN "M"
 7590     [OPT pass%:BNE mloope%(loop%):ADR R3,mlabel%(loop%):MOV R4,R1
 7600      .mloops%(loop%) LDR R0,[R3],#4:STR R0,[R4],#4
 7610      CMN R0,#1:BNE mloops%(loop%):MOV R0,#9:.mloope%(loop%):]
 7620  ENDCASE
 7630  IF loop%<remaps% THEN [ OPT pass%:BEQ filt_end :]
 7640ENDIF
 7650NEXT loop%
 7660=0
 7670:
 7680DEF FNmenu_blocks
 7690LOCAL loop%,from%,to$
 7700FOR loop%=1 TO remaps%
 7710  IF MID$(remap$(loop%),6,1)="M" THEN
 7720    to$=MID$(remap$(loop%),7)
 7730    [OPT pass%: .mlabel%(loop%) :]
 7740    REPEAT
 7750      [ OPT pass%: EQUD VAL(to$) :]
 7760      IF INSTR(to$,",")>0 THEN
 7770        to$=MID$(to$,INSTR(to$,",")+1)
 7780      ELSE:to$=""
 7790      ENDIF
 7800    UNTIL to$=""
 7810    [ OPT pass%:EQUD -1 :]
 7820  ENDIF
 7830NEXT loop%
 7840=0
 7850:
 7860DEF FNlegal(c%)
 7870LOCAL legal%,shift%
 7880FOR shift%=0 TO 15
 7890  A%=c%:B%=shift%*2:C%=USR(const_code%)
 7900  IF (C%AND-256)=0 THEN legal%=TRUE
 7910NEXT shift%
 7920=legal%
 7930:
 7940DEF FNdate
 7950!date%=3:SYS"OS_Word",14,date%
 7960SYS"Territory_ConvertDateAndTime",-1,date%,date%+16,240,"%dy %m3 %ce%yr"+CHR$0
 7970=FNcts(date%+16)
 7980:
 7990REM =============================================================
 8000:
 8010DEF FNmakemenu(title$,menu$)
 8020LOCAL b%,items%,pos%,size%,id%,ids%,i$,f$,f%,p%,sub%,maxlen%
 8030maxlen%=LEN(title$)-3
 8040REPEAT
 8050 a%=INSTR(menu$,"|",pos%+1)
 8060 i$=MID$(menu$,pos%+1,a%-pos%-1)
 8070 IF INSTR(i$,"�") THEN i$=LEFT$(i$,INSTR(i$,"�")-1)
 8080 IF INSTR(i$,"\") THEN f$=LEFT$(i$,INSTR(i$,"\")-1) ELSE f$=""
 8090 i$=MID$(i$,INSTR(i$,"\")+1)
 8100 IF LEN(i$)>11 OR INSTR(f$,"I") THEN ids%+=LEN(i$)+1
 8110 pos%=a%:IF pos%>0 THEN items%+=1
 8120UNTIL a%=0
 8130size%=24*items%+60
 8140DIM b% size%
 8150IF ids%>0 THEN ids%+=8:DIM id% ids%:ids%=id%
 8160$b%=title$:b%!12=&70207:b%!20=44:b%!24=0
 8170pos%=0
 8180FOR l%=0 TO items%
 8190 f%=0:sub%=-1
 8200 IF l%=items% THEN f%=&80
 8210 a%=INSTR(menu$,"|",pos%+1)
 8220 IF a%=0 THEN a%=LEN(menu$)+1
 8230 i$=MID$(menu$,pos%+1,a%-pos%-1)
 8240 IF INSTR(i$,"�") THEN
 8250  i$=LEFT$(i$,INSTR(i$,"�")-1)
 8260  sub%=EVAL(MID$(menu$,pos%+LEN(i$)+2,a%-pos%-LEN(i$)-2))
 8270 ENDIF
 8280 IF INSTR(i$,"\") THEN f$=LEFT$(i$,INSTR(i$,"\")-1) ELSE f$=""
 8290 i$=MID$(i$,INSTR(i$,"\")+1)
 8300 IF INSTR(f$,"T") THEN f%+=1
 8310 IF INSTR(f$,"_") THEN f%+=2
 8320 IF INSTR(f$,"W") THEN f%+=4
 8330 IF INSTR(f$,"M") THEN f%+=8
 8340 p%=b%+28+24*l%
 8350 !p%=f%:p%!4=sub%:p%!8=&7000021
 8360 IF LEN(i$)>11 OR INSTR(f$,"I") THEN
 8370   p%!8+=&100:p%!12=ids%:p%!16=0:p%!20=LEN(i$)
 8380   $ids%=i$:ids%+=LEN(i$)+1
 8390  ELSE 
 8400   $(p%+12)=i$
 8410 ENDIF
 8420 IF LEN(i$)>maxlen% THEN maxlen%=LEN(i$)
 8430 pos%=a%
 8440NEXT l%
 8450b%!16=(maxlen%+1)<<4
 8460=b%
 8470:
 8480DEF FNwindowopen(wh%)
 8490!miscb%=wh%:SYS"Wimp_GetWindowState",,miscb%
 8500IF (miscb%!32)AND(1<<16) THEN =TRUE
 8510=FALSE
 8520:
 8530DEF PROCyscroll_zero(wh%)
 8540!miscb%=wh%:SYS"Wimp_GetWindowState",,miscb%
 8550IF miscb%!24<>0 THEN miscb%!24=0:SYS"Wimp_OpenWindow",,miscb%
 8560ENDPROC
 8570:
 8580DEF PROCcentrewindow(b%)
 8590LOCAL xsize%,ysize%,wx%,wy%
 8600xsize%=(FNreadmodevar(11)+1)<<(FNreadmodevar(4))
 8610ysize%=(FNreadmodevar(12)+1)<<(FNreadmodevar(5))
 8620wx%=b%!8-!b%:wy%=b%!12-b%!4
 8630!b%=(xsize%DIV2)-(wx%DIV2)
 8640b%!4=(ysize%DIV2)-(wy%DIV2)
 8650b%!8=!b%+wx%:b%!12=b%!4+wy%
 8660ENDPROC
 8670:
 8680DEF FNreadmodevar(var%)
 8690LOCAL value%
 8700SYS"OS_ReadModeVariable",-1,var% TO ,,value%
 8710=value%
 8720:
 8730DEF PROCupdatelink(wblock%,linkh%,icon%)
 8740LOCAL b%,BEHIND%
 8750b%=miscb%+40
 8760!miscb%=linkh%:SYS"Wimp_GetIconState",,miscb%
 8770behind%=wblock%!28:wblock%!28=linkh%
 8780!b%=!wblock%:b%!4=icon%:SYS"Wimp_GetIconState",,b%
 8790!miscb%=linkh%:SYS"Wimp_GetWindowState",,miscb%
 8800miscb%!28=behind%
 8810miscb%!4=wblock%!4+b%!8+2
 8820miscb%!8=wblock%!16+b%!12+2
 8830miscb%!12=wblock%!4+b%!16+2
 8840miscb%!16=wblock%!16+b%!20-2
 8850SYS"Wimp_OpenWindow",,miscb%
 8860SYS"Wimp_OpenWindow",,wblock%
 8870ENDPROC
 8880:
 8890DEF PROCseticon(wh%,ih%,e%,c%)
 8900!miscb%=wh%:miscb%!4=ih%:miscb%!8=e%:miscb%!12=c%
 8910SYS"Wimp_SetIconState",,miscb%
 8920ENDPROC
 8930:
 8940DEF PROCupdatewi(wh%,ih%,data$)
 8950!miscb%=wh%:miscb%!4=ih%:SYS"Wimp_GetIconState",,miscb%
 8960$(miscb%!28)=data$
 8970SYS"Wimp_GetCaretPosition",,miscb%
 8980IF !miscb%=wh% AND miscb%!4=ih% THEN
 8990IF (miscb%!20)>LEN(data$) miscb%!20=LEN(data$)
 9000SYS"Wimp_SetCaretPosition",!miscb%,miscb%!4,miscb%!8,miscb%!12,-1,miscb%!20
 9010ENDIF
 9020PROCseticon(wh%,ih%,0,0)
 9030ENDPROC
 9040:
 9050DEF PROCseticontext(wh%,ih%,text$)
 9060!miscb%=wh%:miscb%!4=ih%
 9070SYS"Wimp_GetIconState",,miscb%
 9080IF $(miscb%!28)=text$ ENDPROC
 9090$(miscb%!28)=text$
 9100miscb%!8=0:miscb%!12=0
 9110SYS"Wimp_SetIconState",,miscb%
 9120ENDPROC
 9130:
 9140DEF FNselicon(wh%,ih%)
 9150!miscb%=wh%:miscb%!4=ih%
 9160SYS"Wimp_GetIconState",,miscb%
 9170IF (miscb%!24)AND(1<<21) THEN =TRUE ELSE =FALSE
 9180:
 9190DEF FNindir(wh%,ih%)
 9200!miscb%=wh%:miscb%!4=ih%
 9210SYS"Wimp_GetIconState",,miscb%
 9220=miscb%!28
 9230:
 9240DEF FNsel_esg(wh%,esg%)
 9250SYS"Wimp_WhichIcon",wh%,miscb%,&3F0000,(1<<21)+(esg%<<16)
 9260=!miscb%
 9270:
 9280DEF FNcts(p%)
 9290LOCAL o$
 9300WHILE ?p%>31 AND LEN(o$)<255
 9310o$+=CHR$?p%:p%+=1
 9320ENDWHILE
 9330=o$
 9340:
 9350DEF FNreport(report$,flags%)
 9360!errblock%=255:$(errblock%+4)=report$
 9370SYS"Wimp_ReportError",errblock%,flags%,errname$ TO ,click%
 9380=click%
 9390:
 9400DEF PROCerror
 9410IF FNreport(REPORT$+" at line "+STR$ERL+" - quit?",3)=1 quit%=-1
 9420ENDPROC
 9430

 � ><KeyFilter$Dir>.!RunImage
:
� � � � �,�$+" @ "+Þ:�
(	�init
2� � �error
<ȕ quit%=�
F	�poll
P�
Zș"Wimp_CloseDown"
d�
n:
x� �init
�,taskname$="KeyFilter":errname$=taskname$
�0� q% 1400,miscb% 256,errblock% 256,caret% 32
�#maxcode%=&1000:� code% maxcode%
�� id_data% 5120
�0maxremaps%=80:� remap$(maxremaps%):remaps%=1
�remap$(1)="K000�K000"
�� msglist% 8:!msglist%=0
�8ș"Wimp_Initialise",310,&4B534154,taskname$,msglist%
��init_keycodes
��init_templates
��init_menus
��init_ibar
��init_save
�init_code

vsn$="1.00 (08.02.1996)"
%�seticontext(wh_proginfo%,4,vsn$)
"
,4current%=1:�updatelist:�stringtowindow(current%)
6.openmenu%=0:savetype%=0:� 1=data, 2=module
@trapkey%=�:� 1=from, 2=to
Joddkey$="[Unknown]"
Tquit%=�
^�
h:
r� �init_ibar
|9!q%=-1:q%!4=0:q%!8=0:q%!12=68:q%!16=68:q%!20=&700301A
�?$(q%+24)="!keyfilter":ș"Wimp_CreateIcon",,q% � ibarhandle%
��
�:
�� �init_save
�� savesprite$(2)
�7savesprite$(1)="file_ffd":savesprite$(2)="file_ffa"
�� saveft%(2)
�#saveft%(1)=&ffd:saveft%(2)=&ffa
�� savewh%(2)
�1savewh%(1)=wh_savedat%:savewh%(2)=wh_savemod%
��
�:
�� �init_code
� const_code% 32,date% 32
A� mlabel%(maxremaps%),mloops%(maxremaps%),mloope%(maxremaps%)
P%=const_code%
&
[OPT 2
0MOV R0,R0,ROR R1
:MOV PC,R14
D]
Nwp=12:sp=13:link=14:pc=15
X�
b:
l� �init_templates
v� tname% 11
�!idsize%=1450:� idata% idsize%
�(idmax%=idata%+idsize%:idleft%=idata%
�nextt%=0
�6ș"Wimp_OpenTemplate",,"<KeyFilter$Dir>.Templates"
�"wh_main%=�loadtemplate("Main")
�"wh_list%=�loadtemplate("List")
�+wh_savemod%=�loadtemplate("SaveModule")
�*wh_proginfo%=�loadtemplate("progInfo")
�)wh_savedat%=�loadtemplate("SaveData")
�ș"Wimp_CloseTemplate"
��
�� �loadtemplate(tname$)
�$tname%=tname$
Lș"Wimp_LoadTemplate",,q%,idleft%,idmax%,-1,tname%,0�,,idleft%,,,,nextt%
(ș"Wimp_CreateWindow",,q% � whandle%

=whandle%
 :
*� �init_menus
4>menu_ibar%=�makemenu("KeyFilter","Info�wh_proginfo%|Quit")
>bmenu_main%=�makemenu("KeyFilter","Save module�wh_savemod%|_\Save data�wh_savedat%|Clear data")
H�
R:
\� �init_keycodes
f
� fh%,in$
p#fh%=�"<KeyFilter$Dir>.KeyCodes"
zkeycodes%=-1
�$�:in$=�#fh%:keycodes%+=1:� �#fh%
��#fh%=0
�-� keycode%(keycodes%),keyname$(keycodes%)
�� loop%=0 � keycodes%
�  in$="&"+�#fh%
�  keycode%(loop%)=�(in$)
�'  keyname$(loop%)=�in$,�in$," ")+1)
�� loop%
�	�#fh%
��
�:
�C� =============================================================
�:
� �poll
ș"Wimp_Poll",,q% � reason%
Ȏ reason% �
$M  � 2:� !q%=wh_main% �updatelink(q%,wh_list%,0) � ș"Wimp_OpenWindow",,q%
."  � 3:ș"Wimp_CloseWindow",,q%
8>    � !q%=wh_main% � !q%=wh_list%:ș"Wimp_CloseWindow",,q%
B"  � 6:�click(q%!8,q%!12,q%!16)
L  � 7:�stopdrag
V  � 8:�processkey
`  � 9:�menuselect
j  � 11:�losecaret
t  � 17,18:�receive
~�
��
�:
�� �receive
�Ȏ q%!16 �
�  � 0:quit%=�
�  � 2:�do_save(�cts(q%+44))
�3    $(�indir(savewh%(savetype%),2))=�cts(q%+44)
�"    q%!12=q%!8:q%!16=3:!q%=256
�.    ș"Wimp_SendMessage",18,q%,q%!20,q%!24
�<  � 3:q%!12=q%!8:q%!16=4:ș"Wimp_SendMessage",17,q%,q%!4
�    �load_data(�cts(q%+44))
��
�

:
� �losecaret
	� ih%
(� trapkey%>0 �
2   � trapkey%=1 ih%=3 � ih%=9
<$  �seticon(wh_main%,ih%,0,1<<21)
F  trapkey%=0
P�
Z�
d:
n'� �click(button%,whandle%,ihandle%)
x� otk%,loop%,yscroll%
�� button%=2 � �openmenu:�
�Ȏ whandle% �
�
  � -2
�/   !q%=wh_main%:ș"Wimp_GetWindowState",,q%
�   � ((q%!32)�(1<<16))=0 �
�     �centrewindow(q%+4)
�      �yscroll_zero(wh_list%)
�   �
�!   �updatelink(q%,wh_list%,0)
�  � wh_main%
�   Ȏ ihandle% �
�     � 3,9
�       otk%=trapkey%
A       trapkey%=(-2-(ihandle%=3))*�selicon(wh_main%,ihandle%)
       � trapkey%=0 �
5         �seticon(whandle%,(ihandle%�10),0,1<<21)
"^         ș"Wimp_SetCaretPosition",!caret%,caret%!4,caret%!8,caret%!16,caret%!20,caret%!24
,
        �
65         �seticon(whandle%,(ihandle%�10),0,1<<21)
@         � otk%=0 �
J0           ș"Wimp_GetCaretPosition",,caret%
TC           ș"Wimp_SetCaretPosition",whandle%,-1,0,0,(1<<25),-1
^         �
h       �
r
     � 14
|       � remaps%<80 �
�3         remaps%+=1:remap$(remaps%)="K000�K000"
�7         �windowtostring(current%):current%=remaps%
�         �updatelist
�&         �stringtowindow(current%)
�5         !q%=wh_main%:ș"Wimp_GetWindowState",,q%
�'         �updatelink(q%,wh_list%,0)
�         �showcurrent
�
        �
�a         dummy%=�report("Sorry, maximum 80 key remaps. Hack the program if you need more!",2)
�       �
�
     � 15
�       � remaps%>1 �
�         remaps%-=1
"         � current%<=remaps% �
)           � loop%=current% � remaps%
.             remap$(loop%)=remap$(loop%+1)
&           � loop%
0         �
:0         � current%>remaps% current%=remaps%
D=         !miscb%=wh_list%:ș"Wimp_GetWindowState",,miscb%
N         yscroll%=miscb%!24
X         �updatelist
b5         !q%=wh_main%:ș"Wimp_GetWindowState",,q%
l'         �updatelink(q%,wh_list%,0)
v=         !miscb%=wh_list%:ș"Wimp_GetWindowState",,miscb%
�;         miscb%!24=yscroll%:ș"Wimp_OpenWindow",,miscb%
�&         �stringtowindow(current%)
�
        �
�<         dummy%=�report("Sorry, minimum 1 key remap!",2)
�       �
�+     � 7,8,11:�windowtostring(current%)
�   �
�  � wh_list%
�   � ihandle%<>current%-1 �
�"     �windowtostring(current%)
�     current%=ihandle%+1
�"     �stringtowindow(current%)
�	    �
R     � �selicon(wh_list%,ihandle%)=0 � �seticon(wh_list%,ihandle%,1<<21,1<<21)
   �
  � wh_savedat%,wh_savemod%
 9   � whandle%=wh_savedat% � savetype%=1 � savetype%=2
*7   � ihandle%=3 � button%>15 � �startdrag(whandle%)
4    � ihandle%=0 � �quicksave
>�
H�
R:
\� �openmenu
f	� my%
pȎ q%!12 �
z'  � -2:openmenu%=menu_ibar%:my%=184
�%  :openmenu%=menu_main%:my%=q%!4
��
�-ș"Wimp_CreateMenu",,openmenu%,!q%-64,my%
��
�:
�� �menuselect
�,� openmenu%=menu_ibar% � !q%=1 � quit%=�
�/� openmenu%=menu_main% � !q%=2 � �wipe_data
�#ș"Wimp_GetPointerInfo",,miscb%
�1� miscb%!8=1 � ș"Wimp_CreateMenu",,menu%,0,0
��
�:
�� �processkey
	� key%,loop%,key$
	� trapkey%>0 �
	W  ș"Wimp_SetCaretPosition",!caret%,caret%!4,caret%!8,caret%!16,caret%!20,caret%!24
	$   � trapkey%=1 ih%=3 � ih%=9
	.$  �seticon(wh_main%,ih%,0,1<<21)
	8  key%=q%!24
	B*  �updatewi(wh_main%,ih%+1,"&"+�~key%)
	L/  �seticontext(wh_main%,ih%,�keyname(key%))
	V  �windowtostring(current%)
	`  trapkey%=0
	j �
	t  Ȏ !q% �
	~    � wh_main%
	�+      � (q%!4=4 � q%!4=10) � q%!24=13 �
	�S        �seticontext(wh_main%,q%!4-1,�keyname(�eval($(�indir(wh_main%,q%!4)))))
	�%        �windowtostring(current%)
	�       �
	�"        � q%!24=13 � q%!4=12 �
	�'          �windowtostring(current%)
	�(         �:ș"Wimp_ProcessKey",q%!24
	�
        �
	�      �
	�!    � wh_savedat%,wh_savemod%
	�      � q%!24=13 �
	�9        � !q%=wh_savedat% � savetype%=1 � savetype%=2
        �quicksave

       �
%        ș"Wimp_ProcessKey",q%!24
      �
(#    :ș"Wimp_ProcessKey",q%!24
2  �
<�
F�
P:
Z� �keyname(key%)
d� loop%,key$
n'� key%<&20 � key%>&179 � key%=&7F �
x
  loop%=0
�0  ȕ keycode%(loop%)<>key% � loop%<keycodes%
�  loop%+=1:�
�A  � keycode%(loop%)<>key% key$=oddkey$ � key$=keyname$(loop%)
� �
�'  key$="�"+�(key%)+"� ("+�~key%+")"
��
�	=key$
�:
�� �wipe_data
�&errname$="Warning from "+taskname$
�k� �report("Are you sure you would like to clear all the data? (OK clears)",19)=2 � errname$=taskname$:�
�:remaps%=1:current%=1:remap$(1)="K000�K000":�updatelist
�!q%=wh_main%
:ș"Wimp_GetWindowState",,q%:�updatelink(q%,wh_list%,0)
�
:
"� �updatelist
,� loop%,id%
6id%=id_data%
@5!miscb%=wh_list%:ș"Wimp_GetWindowInfo",,miscb%+1
J!ș"Wimp_DeleteWindow",,miscb%
Tmiscb%!48=-16-52*remaps%
^#� miscb%!48>-382 miscb%!48=-382
hmiscb%!88=0
r.ș"Wimp_CreateWindow",,miscb%+4 � wh_list%
|� loop%=1 � remaps%
�  !miscb%=wh_list%
�'  miscb%!4=8:miscb%!8=-(52*loop%+8)
�.  miscb%!12=366:miscb%!16=-(52*loop%-52+8)
�  miscb%!20=&701B1B1
�+  � loop%=current% � miscb%!20+=(1<<21)
�   miscb%!24=id%:miscb%!28=-1
�0  $id%=�translate(loop%):miscb%!32=�($id%)+1
�  id%+=50:� NB: maxlen 50!!
�!  ș"Wimp_CreateIcon",,miscb%
�� loop%
��
�:
�� �translate(mapping%)
� in$,out$
in$=remap$(mapping%)
.out$=�shortkeyname(�("&"+�in$,2,3)))+" � "
&Ȏ �in$,6,1) �
01  � "K":out$+=�shortkeyname(�("&"+�in$,7,3)))
:  � "M":out$+=�in$,6)
D  � "N":out$+="[Null]"
N�
X	=out$
b:
l� �shortkeyname(in%)
v
� out$
�out$=�keyname(in%)
�� �out$," ")=0 � =out$
�=�out$,�out$," ")-1)
�:
�� �stringtowindow(mapping%)
�� key1%,key2%,in$
�in$=remap$(mapping%)
�/� dummy%=FNreport(STR$(mapping%)+","+in$,1)
�key1%=�("&"+�in$,2,3))
�%�updatewi(wh_main%,4,"&"+�~key1%)
�,�seticontext(wh_main%,3,�keyname(key1%))
�Ȏ �in$,6,1) �
�  � "K"

'    �sel(8,-1):�sel(7,0):�sel(11,0)

    key2%=�("&"+�in$,7,3))

*    �updatewi(wh_main%,10,"&"+�~key2%)

 0    �seticontext(wh_main%,9,�keyname(key2%))

*!    �updatewi(wh_main%,12,"")

4  � "N"

>'    �sel(7,-1):�sel(8,0):�sel(11,0)

H%    �updatewi(wh_main%,10,"&FFF")

R)    �seticontext(wh_main%,9,"[None]")

\!    �updatewi(wh_main%,12,"")

f  � "M"

p'    �sel(7,0):�sel(8,0):�sel(11,-1)

z%    �updatewi(wh_main%,10,"&FFF")

�)    �seticontext(wh_main%,9,"[None]")

�&    �updatewi(wh_main%,12,�in$,7))

��

��

�:

�� �windowtostring(mapping%)

�� type%,out$

�type%=�sel_esg(wh_main%,1)

�3out$="K"+�str(�eval($(�indir(wh_main%,4))))+"�"

�Ȏ type% �

�  � -1,7:out$+="N"

�;  � 8:out$=out$+"K"+�str(�eval($(�indir(wh_main%,10))))

�/  � 11:out$=out$+"M"+$(�indir(wh_main%,12))
�
remap$(mapping%)=out$
:�seticontext(wh_list%,mapping%-1,�translate(mapping%))
$�
.:
8� �eval(in$)
B� � � =�("&"+in$)
L=�(in$)
V:
`� �str(in%)
j=�3-�(�~in%),"0")+�~in%
t:
~� �sel(ih%,flag%)
�!!miscb%=wh_main%:miscb%!4=ih%
�miscb%!8=(1<<21)� flag%
�miscb%!12=1<<21
�!ș"Wimp_SetIconState",,miscb%
��
�:
�� �showcurrent
�� t%,b%,re%
�4!miscb%=wh_list%:ș"Wimp_GetWindowState",,miscb%
�/t%=-8-52*(current%-1):b%=-8-52*current%+382
�'� t%>miscb%!24 � miscb%!24=t%:re%=�
�'� b%<miscb%!24 � miscb%!24=b%:re%=�
)� re%=� � ș"Wimp_OpenWindow",,miscb%

�
:
C� =============================================================
(:
2� �startdrag(wh%)
<� xorig%,yorig%
F!miscb%=wh%
P#ș"Wimp_GetWindowState",,miscb%
Zxorig%=miscb%!4-miscb%!20
dyorig%=miscb%!16-miscb%!24
nmiscb%!4=3
x!ș"Wimp_GetIconState",,miscb%
�� �soliddrag=� �
�7  !miscb%=xorig%+miscb%!8:miscb%!4=yorig%+miscb%!12
�:  miscb%!8=xorig%+miscb%!16:miscb%!12=yorig%+miscb%!20
�E  ș"DragASprite_Start",%10000101,1,savesprite$(savetype%),miscb%
� �
�)  miscb%!4=5:miscb%!8=xorig%+miscb%!8
�;  miscb%!12=miscb%!12+yorig%:miscb%!16=miscb%!16+xorig%
�,  miscb%!20=miscb%!20+yorig%:miscb%!24=0
�9  miscb%!28=0:miscb%!32=&7fffffff:miscb%!36=&7fffffff
�  ș"Wimp_DragBox",,miscb%
��
��
�:
� �soliddrag
� byte%
 ș"OS_Byte",161,28 � ,,byte%
"� (byte%�2)=2 � =� � =�
,:
6� �stopdrag
@� leaf$
Jș"XDragASprite_Stop"
Tș"Wimp_CreateMenu",,-1
^#ș"Wimp_GetPointerInfo",,miscb%
h@q%!20=miscb%!12:q%!24=miscb%!16:q%!28=!miscb%:q%!32=miscb%!4
r&q%!36=256:q%!40=saveft%(savetype%)
|4leaf$=�leafname($(�indir(savewh%(savetype%),2)))
�%$(q%+44)=leaf$+�0:q%!16=1:q%!12=0
�!q%=((48+�(leaf$))�4)*4
�*ș"Wimp_SendMessage",18,q%,q%!20,q%!24
��
�:
�� �do_save(filename$)
�Ȏ savetype% �
�  � 1:�save_data(filename$)
�  � 2:�assemble(filename$)
��
��
�:
�� �leafname(in$)
� out$,pos%
pos%=�(in$)
!ȕ �in$,pos%,1)<>"." � pos%>0
&
pos%-=1:�
0=�in$,pos%+1)
::
D� �quicksave
N/� �$(�indir(savewh%(savetype%),2)),".")=0 �
XB  d%=�report("To save, drag the icon to a directory viewer",1)
b �
l/  �do_save($(�indir(savewh%(savetype%),2)))
m  ș"Wimp_CreateMenu",,-1
v�
��
�:
�� �save_data(filename$)
�� fh%,loop%
�fh%=�(filename$)
�2�#fh%,"This is a KeyFilter file. Version 1.00"
��#fh%,�(remaps%)
�#�#fh%,�cts(�indir(wh_main%,17))
�#�#fh%,�cts(�indir(wh_main%,19))
�� loop%=1 � remaps%
�  �#fh%,remap$(loop%)
�� loop%
�	�#fh%
�
:
� �load_data(filename$)
 � fh%,loop%,in$
*fh%=�(filename$)
4
in$=�#fh%
>�� in$<>"This is a KeyFilter file. Version 1.00" � �#fh%:dummy%=�report("This doesn't look like a KeyFilter file. I'm going to ignore it.",2):�
Hremaps%=�(�#fh%)
R �updatewi(wh_main%,17,�#fh%)
\ �updatewi(wh_main%,19,�#fh%)
f� loop%=1 � remaps%
p  remap$(loop%)=�#fh%
z� loop%
�	�#fh%
�)�seticontext(wh_savedat%,2,filename$)
�;�seticontext(wh_savemod%,2,�$(�indir(wh_main%,17)),10))
�current%=1
��updatelist
��yscroll_zero(wh_list%)
�,!q%=wh_main%:ș"Wimp_GetWindowState",,q%
��updatelink(q%,wh_list%,0)
��stringtowindow(current%)
��
�:
�C� =============================================================
�:
�� �assemble(filename$)
� filtname$,taskname$
$filtname$=$(�indir(wh_main%,17))
$taskname$=$(�indir(wh_main%,19))
$taskhandle=260
.his_taskh=264
8� pass%=12 � 14 � 2
B#P%=0:O%=code%:L%=code%+maxcode%
L[OPT pass%
V          EQUD StartCode
`          EQUD InitCode
j          EQUD FinalCode
t          EQUD ServiceCode
~          EQUD TitleString
�          EQUD HelpString
�          EQUD HelpTable
�*          EQUD 0    \ SWI chunk number
�%          EQUD 0    \ SWI handler
�*          EQUD 0    \ SWI decode table
�)          EQUD 0    \ SWI decode code
�.TitleString
�          EQUS filtname$
�          EQUB 0
�          ALIGN
�.HelpString
�          EQUS filtname$
          EQUB 9

%          EQUS "Assembled "+�date
          EQUB 13
E          EQUS "Produced using KeyFilter 1.00 for "+taskname$+"."
(          EQUB 0
2          ALIGN
<.HelpTable
F'          EQUS "Desktop_"+filtname$
P          EQUB 0
Z          ALIGN
d          EQUD StarCommand
n          EQUD 0
x          EQUD 0
�          EQUD donotuse
�          EQUS filtname$
�          EQUB 0
�          ALIGN
�          EQUD 0
�          EQUD 0
�          EQUD 0
�          EQUD help
�          EQUB 0
�=.help     EQUS "This module filters keypresses and menu "
�2          EQUS "selections for "+taskname$+"."
�          EQUB 0
�
.donotuse
7          EQUS "Do not use *Desktop_"+filtname$+"."
          EQUB 0
          ALIGN
"
.InitCode
,(          STMFD   (sp)!,{R7-R11,R14}
6C          MOV     R0,#6                   ; 6 - claim workspace
@@          MOV     R3,#300                 ; 300 bytes please
J8          SWI     "XOS_Module"            ; Claim it
T7          BVS     InitExit                ; Got it?
^F          STR     R2,[wp]                 ; Then store the address
h          MOV     R0,#0
rA          STR     R0,[R2,#taskhandle]     ; no taskhandle yet
|          LDR     R12,[R12]
�          MOV     R3,#0
�.scanloop MOV     R1,R12
�          MOV     R2,#16
�2          SWI     "TaskManager_EnumerateTasks"
�          CMN     R0,#1
�          BNE     chkname
�(.sl_end   STR     R3,[wp,#his_taskh]
�          CMP     R3,#0
�#          BNE     Attach_filter
�@          LDMFD   (sp)!,{R7-R11,pc}       ; that's all folks
�!.chkname  ADR     R4,taskname
�          MOV     R8,R12
�           LDR     R5,[R8,#4]
 .chkloop  LDRB    R6,[R4],#1
           LDRB    R7,[R5],#1
          CMP     R6,#32
&          MOVLT   R6,#0
0          CMP     R7,#32
:          MOVLT   R7,#0
D          CMP     R6,R7
N          BNE     scanloop
X          CMP     R6,#0
b          BNE     chkloop
l          LDR     R3,[R8]
v          B       sl_end
�.Attach_filter
�!          ADR     R0,filtname
�#          ADR     R1,FilterCode
�          MOV     R2,#0
�)          LDR     R3,[R12,#his_taskh]
�!          LDR     R4,filtmask
�2          SWI     "XFilter_RegisterPostFilter"
�'          LDMFD   (sp)!,{R7-R11,pc}
�
.InitExit
�'          LDMFD   (sp)!,{R7-R11,pc}
�.StarCommand
�!          STMFD   (sp)!,{R14}
�:          MOV     R2,R0                   ; parameters
;          ADR     R1,TitleString          ; module name
          MOV     R0,#2
A          SWI     "XOS_Module"            ; enter as language
            LDMFD   (sp)!,{pc}
*.StartCode
4F          LDR     wp,[R12]                ; load workspace pointer
>@          LDR     R0,[wp,#taskhandle]     ; load task handle
H=          TEQ     R0,#0                   ; am I running?
R8          LDRGT   R1,TASK                 ; if so...
\4          SWIGT   "XWimp_CloseDown"       ; quit
f7          MOVGT   R0,#0                   ; then...
pD          STRGT   R0,[wp,#taskhandle]     ; store taskhandle 0  
z<          MOV     R0,#300                 ; wimp version
�8          LDR     R1,TASK                 ; 4B534154
�9          ADR     R2,TitleString          ; Task name
�%          ADR     R3,message_list
�;          SWI     "XWimp_Initialise"      ; Initialise!
�F          SWIVS   "XOS_Exit"              ; exit if error occurred
�A          STR     R1,[R12,#taskhandle]    ; store task handle
�@.poll     LDR     R0,mask                 ; reason code mask
�9          MOV     R1,wp                   ; workspace
�=          SWI     "XWimp_Poll"            ; poll the wimp
�?          CMP     R0,#17                  ; reason code 17?
�6          CMPNE   R0,#18                  ; or 18?
�A          BNE     poll                    ; if not keep going
�@          LDR     R0,[wp,#16]             ; get message type
           MOV     R4,#&40000
           ADD     R4,R4,#&C2
          CMP     R0,R4
$%          BEQ     task_initialise
.          ADD     R4,R4,#1
8          CMP     R0,R4
B$          BEQ     task_closedown
L5          CMP     R0,#0                   ; quit?
V:          SWIEQ   "XWimp_CloseDown"       ; if so quit
`3          �Q   R1,#0                   ; and...
jC          STREQ   R1,[wp,#taskhandle]     ; store task handle 0
t8          SWIEQ   "XOS_Exit"              ; and exit
~          B       poll
�.task_initialise
�)          LDR     R4,[R12,#his_taskh]
�          CMP     R4,#0
�          BNE     poll
�!          ADR     R4,taskname
�           ADD     R5,R12,#28
� .newt_chk LDRB    R6,[R4],#1
�           LDRB    R7,[R5],#1
�          CMP     R6,R7
�          BNE     poll
�          CMP     R6,#0
�          BNE     newt_chk
!          LDR     R3,[R12,#4]

)          STR     R3,[R12,#his_taskh]
!          ADR     R0,filtname
#          ADR     R1,FilterCode
(          MOV     R2,#0
2!          LDR     R4,filtmask
<2          SWI     "XFilter_RegisterPostFilter"
F          B       poll
P.task_closedown
Z!          LDR     R4,[R12,#4]
d)          LDR     R5,[R12,#his_taskh]
n          CMP     R4,R5
x          BNE     poll
�!          ADR     R0,filtname
�#          ADR     R1,FilterCode
�          MOV     R2,#0
�)          LDR     R3,[R12,#his_taskh]
�!          LDR     R4,filtmask
�4          SWI     "XFilter_DeRegisterPostFilter"
�          MOV     R0,#0
�)          STR     R0,[R12,#his_taskh]
�          B       poll
�.FinalCode
�(          STMFD   (sp)!,{R7-R11,R14}
�F          LDR     wp,[R12]                ; load workspace pointer
�@          LDR     R0,[wp,#taskhandle]     ; load task handle
=          TEQ     R0,#0                   ; am I running?
8          LDRGT   R1,TASK                 ; if so...
4          SWIGT   "XWimp_CloseDown"       ; quit
"6          MOV     R1,#0                   ; and...
,F          STR     R1,[wp,#taskhandle]     ; store task handle of 0
6(          LDR     R0,[wp,#his_taskh]
@          TEQ     R0,#0
J!          ADRGT   R0,filtname
T#          ADRGT   R1,FilterCode
^          MOVGT   R2,#0
h)          LDRGT   R3,[R12,#his_taskh]
r!          LDRGT   R4,filtmask
|4          SWIGT   "XFilter_DeRegisterPostFilter"
�          MOVGT   R0,#0
�)          STRGT   R0,[R12,#his_taskh]
�6          MOV     R0,#7                   ; now...
�3          MOV     R2,wp                   ; ...
�B          SWI     "OS_Module"             ; free the workspace
�'          LDMFD   (sp)!,{R7-R11,pc}
�.ServiceCode
�F          LDR     wp,[wp]                 ; load workspace pointer
�!          STMFD   (sp)!,{R14}
�:          TEQ     R1,#&49                 ; StartWimp?
�'          BEQ     Service_StartWimp
�<          TEQ     R1,#&4A                 ; StartedWimp?
�)          BEQ     Service_StartedWimp
6          TEQ     R1,#&27                 ; Reset?
          �Q   R14,#0
F          STREQ   R14,[wp,#taskhandle]    ; store task handle of 0
&           LDMFD   (sp)!,{pc}
0.Service_StartWimp
:?          LDR     R14,[wp,#taskhandle]    ; get task handle
D=          TEQ     R14,#0                  ; am I running?
NE          MVNEQ   R14,#0                  ; if not make handle -1
X<          STREQ   R14,[wp,#taskhandle]    ; and store it
bC          ADREQ   R0,HelpTable            ; R0 to start command
l>          �Q   R1,#0                   ; and claim service
v           LDMFD   (sp)!,{pc}
�.Service_StartedWimp
�?          LDR     R14,[wp,#taskhandle]    ; get task handle
�9          CMN     R14,#1                  ; is it -1?
�<          �Q   R14,#0                  ; if so make it 0
�<          STREQ   R14,[wp,#taskhandle]    ; and store it
�           LDMFD   (sp)!,{pc}
�.FilterCode
�          CMP     R0,#8
�          MOVNES  PC,R14
�"          STMFD   R13!,{R3,R4}
�!          LDR     R3,[R1,#24]
�          �filter_keys
�!.filt_end STR     R3,[R1,#24]
"          LDMFD   R13!,{R3,R4}
          MOVS    PC,R14
          �menu_blocks
 .TASK     EQUS    "TASK"
*.message_list
4          EQUD &400C2
>          EQUD &400C3
H          EQUD 0
R+.mask     EQUD    %10000001100000110001
\+.filtmask EQUD    %11100011100001110011
f.filtname EQUS filtname$
p          EQUB 0
z          ALIGN
�.taskname EQUS taskname$
�          EQUB 0
�          ALIGN
�
�]� pass%
�,ș "OS_File",10,filename$,&FFA,,code%,O%
��
�:
�� �filter_keys
�� loop%,from%,to%,in$
�� loop%=1 � remaps%
�in$=remap$(loop%)
�� �in$,1)="K" �
  from%=�("&"+�in$,2,3))
  � �legal(from%) �
$    [ OPT pass%:CMP R3,#from% :]
$  �
.E    [ OPT pass%:MOV R4,#&100:ADD R4,R4,#(from%-&100):CMP R3,R4 :]
8  �
B  Ȏ �in$,6,1) �
L
    � "K"
V      to%=�("&"+�in$,7,3))
`      � �legal(to%) �
j%        [ OPT pass%:�Q R3,#to% :]
t      �
~>        [ OPT pass%:�Q R3,#&100:ADDEQ R3,R3,#(to%-&100) :]
�      �
�%    � "N":[ OPT pass%:�Q R0,#0 :]
�
    � "M"
�F     [OPT pass%:BNE mloope%(loop%):ADR R3,mlabel%(loop%):MOV R4,R1
�7      .mloops%(loop%) LDR R0,[R3],#4:STR R0,[R4],#4
�B      CMN R0,#1:BNE mloops%(loop%):MOV R0,#9:.mloope%(loop%):]
�  �
�3  � loop%<remaps% � [ OPT pass%:BEQ filt_end :]
��
�� loop%
�=0
�:
� �menu_blocks

� loop%,from%,to$
� loop%=1 � remaps%
!  � �remap$(loop%),6,1)="M" �
(    to$=�remap$(loop%),7)
2&    [OPT pass%: .mlabel%(loop%) :]
<	    �
F%      [ OPT pass%: EQUD �(to$) :]
P      � �to$,",")>0 �
Z!        to$=�to$,�to$,",")+1)
d      �:to$=""
n      �
x    � to$=""
�    [ OPT pass%:EQUD -1 :]
�  �
�� loop%
�=0
�:
�� �legal(c%)
�� legal%,shift%
�� shift%=0 � 15
�)  A%=c%:B%=shift%*2:C%=�(const_code%)
�  � (C%�-256)=0 � legal%=�
�� shift%
�=legal%
�:
� �date
!!date%=3:ș"OS_Word",14,date%
Nș"Territory_ConvertDateAndTime",-1,date%,date%+16,240,"%dy %m3 %ce%yr"+�0
"=�cts(date%+16)
,:
6C� =============================================================
@:
J� �makemenu(title$,menu$)
T<� b%,items%,pos%,size%,id%,ids%,i$,f$,f%,p%,sub%,maxlen%
^maxlen%=�(title$)-3
h�
r a%=�menu$,"|",pos%+1)
|  i$=�menu$,pos%+1,a%-pos%-1)
�$ � �i$,"�") � i$=�i$,�i$,"�")-1)
�, � �i$,"\") � f$=�i$,�i$,"\")-1) � f$=""
� i$=�i$,�i$,"\")+1)
�* � �(i$)>11 � �f$,"I") � ids%+=�(i$)+1
�! pos%=a%:� pos%>0 � items%+=1
�
� a%=0
�size%=24*items%+60
�� b% size%
�*� ids%>0 � ids%+=8:� id% ids%:ids%=id%
�,$b%=title$:b%!12=&70207:b%!20=44:b%!24=0
�
pos%=0
�� l%=0 � items%
� f%=0:sub%=-1
  � l%=items% � f%=&80
  a%=�menu$,"|",pos%+1)
  � a%=0 � a%=�(menu$)+1
 &  i$=�menu$,pos%+1,a%-pos%-1)
 0 � �i$,"�") �
 :  i$=�i$,�i$,"�")-1)
 D2  sub%=�(�menu$,pos%+�(i$)+2,a%-pos%-�(i$)-2))
 N �
 X, � �i$,"\") � f$=�i$,�i$,"\")-1) � f$=""
 b i$=�i$,�i$,"\")+1)
 l � �f$,"T") � f%+=1
 v � �f$,"_") � f%+=2
 � � �f$,"W") � f%+=4
 � � �f$,"M") � f%+=8
 � p%=b%+28+24*l%
 �# !p%=f%:p%!4=sub%:p%!8=&7000021
 � � �(i$)>11 � �f$,"I") �
 �0   p%!8+=&100:p%!12=ids%:p%!16=0:p%!20=�(i$)
 �   $ids%=i$:ids%+=�(i$)+1
 �  � 
 �   $(p%+12)=i$
 � �
 �$ � �(i$)>maxlen% � maxlen%=�(i$)
 � pos%=a%
 �� l%
!b%!16=(maxlen%+1)<<4
!=b%
!:
! � �windowopen(wh%)
!*/!miscb%=wh%:ș"Wimp_GetWindowState",,miscb%
!4� (miscb%!32)�(1<<16) � =�
!>=�
!H:
!R� �yscroll_zero(wh%)
!\/!miscb%=wh%:ș"Wimp_GetWindowState",,miscb%
!f<� miscb%!24<>0 � miscb%!24=0:ș"Wimp_OpenWindow",,miscb%
!p�
!z:
!�� �centrewindow(b%)
!�� xsize%,ysize%,wx%,wy%
!�2xsize%=(�readmodevar(11)+1)<<(�readmodevar(4))
!�2ysize%=(�readmodevar(12)+1)<<(�readmodevar(5))
!�wx%=b%!8-!b%:wy%=b%!12-b%!4
!�!b%=(xsize%�2)-(wx%�2)
!�b%!4=(ysize%�2)-(wy%�2)
!�b%!8=!b%+wx%:b%!12=b%!4+wy%
!��
!�:
!�� �readmodevar(var%)
!�� value%
!�.ș"OS_ReadModeVariable",-1,var% � ,,value%
"=value%
":
"'� �updatelink(wblock%,linkh%,icon%)
"$� b%,BEHIND%
".b%=miscb%+40
"80!miscb%=linkh%:ș"Wimp_GetIconState",,miscb%
"B(behind%=wblock%!28:wblock%!28=linkh%
"L5!b%=!wblock%:b%!4=icon%:ș"Wimp_GetIconState",,b%
"V2!miscb%=linkh%:ș"Wimp_GetWindowState",,miscb%
"`miscb%!28=behind%
"jmiscb%!4=wblock%!4+b%!8+2
"tmiscb%!8=wblock%!16+b%!12+2
"~miscb%!12=wblock%!4+b%!16+2
"� miscb%!16=wblock%!16+b%!20-2
"�ș"Wimp_OpenWindow",,miscb%
"� ș"Wimp_OpenWindow",,wblock%
"��
"�:
"�� �seticon(wh%,ih%,e%,c%)
"�5!miscb%=wh%:miscb%!4=ih%:miscb%!8=e%:miscb%!12=c%
"�!ș"Wimp_SetIconState",,miscb%
"��
"�:
"�� �updatewi(wh%,ih%,data$)
"�:!miscb%=wh%:miscb%!4=ih%:ș"Wimp_GetIconState",,miscb%
#$(miscb%!28)=data$
#
%ș"Wimp_GetCaretPosition",,miscb%
#"� !miscb%=wh% � miscb%!4=ih% �
#-� (miscb%!20)>�(data$) miscb%!20=�(data$)
#(Nș"Wimp_SetCaretPosition",!miscb%,miscb%!4,miscb%!8,miscb%!12,-1,miscb%!20
#2�
#<�seticon(wh%,ih%,0,0)
#F�
#P:
#Z!� �seticontext(wh%,ih%,text$)
#d!miscb%=wh%:miscb%!4=ih%
#n!ș"Wimp_GetIconState",,miscb%
#x� $(miscb%!28)=text$ �
#�$(miscb%!28)=text$
#�miscb%!8=0:miscb%!12=0
#�!ș"Wimp_SetIconState",,miscb%
#��
#�:
#�� �selicon(wh%,ih%)
#�!miscb%=wh%:miscb%!4=ih%
#�!ș"Wimp_GetIconState",,miscb%
#�#� (miscb%!24)�(1<<21) � =� � =�
#�:
#�� �indir(wh%,ih%)
#�!miscb%=wh%:miscb%!4=ih%
#�!ș"Wimp_GetIconState",,miscb%
$=miscb%!28
$:
$� �sel_esg(wh%,esg%)
$"<ș"Wimp_WhichIcon",wh%,miscb%,&3F0000,(1<<21)+(esg%<<16)
$,=!miscb%
$6:
$@� �cts(p%)
$J� o$
$Tȕ ?p%>31 � �(o$)<255
$^o$+=�?p%:p%+=1
$h�
$r=o$
$|:
$�� �report(report$,flags%)
$�)!errblock%=255:$(errblock%+4)=report$
$�<ș"Wimp_ReportError",errblock%,flags%,errname$ � ,click%
$�=click%
$�:
$�� �error
$�8� �report(�$+" at line "+Þ+" - quit?",3)=1 quit%=-1
$��
$�
�
00000000  0d 00 0a 20 f4 20 3e 3c  4b 65 79 46 69 6c 74 65  |... . ><KeyFilte|
00000010  72 24 44 69 72 3e 2e 21  52 75 6e 49 6d 61 67 65  |r$Dir>.!RunImage|
00000020  0d 00 14 05 3a 0d 00 1e  1b ee 20 85 20 85 20 a2  |....:..... . . .|
00000030  20 9f 2c f6 24 2b 22 20  40 20 22 2b c3 9e 3a e0  | .,.$+" @ "+..:.|
00000040  0d 00 28 09 f2 69 6e 69  74 0d 00 32 0e ee 20 85  |..(..init..2.. .|
00000050  20 f2 65 72 72 6f 72 0d  00 3c 0e c8 95 20 71 75  | .error..<... qu|
00000060  69 74 25 3d a3 0d 00 46  09 f2 70 6f 6c 6c 0d 00  |it%=...F..poll..|
00000070  50 05 ce 0d 00 5a 16 c8  99 22 57 69 6d 70 5f 43  |P....Z..."Wimp_C|
00000080  6c 6f 73 65 44 6f 77 6e  22 0d 00 64 05 e0 0d 00  |loseDown"..d....|
00000090  6e 05 3a 0d 00 78 0b dd  20 f2 69 6e 69 74 0d 00  |n.:..x.. .init..|
000000a0  82 2c 74 61 73 6b 6e 61  6d 65 24 3d 22 4b 65 79  |.,taskname$="Key|
000000b0  46 69 6c 74 65 72 22 3a  65 72 72 6e 61 6d 65 24  |Filter":errname$|
000000c0  3d 74 61 73 6b 6e 61 6d  65 24 0d 00 8c 30 de 20  |=taskname$...0. |
000000d0  71 25 20 31 34 30 30 2c  6d 69 73 63 62 25 20 32  |q% 1400,miscb% 2|
000000e0  35 36 2c 65 72 72 62 6c  6f 63 6b 25 20 32 35 36  |56,errblock% 256|
000000f0  2c 63 61 72 65 74 25 20  33 32 0d 00 96 23 6d 61  |,caret% 32...#ma|
00000100  78 63 6f 64 65 25 3d 26  31 30 30 30 3a de 20 63  |xcode%=&1000:. c|
00000110  6f 64 65 25 20 6d 61 78  63 6f 64 65 25 0d 00 a0  |ode% maxcode%...|
00000120  13 de 20 69 64 5f 64 61  74 61 25 20 35 31 32 30  |.. id_data% 5120|
00000130  0d 00 aa 30 6d 61 78 72  65 6d 61 70 73 25 3d 38  |...0maxremaps%=8|
00000140  30 3a de 20 72 65 6d 61  70 24 28 6d 61 78 72 65  |0:. remap$(maxre|
00000150  6d 61 70 73 25 29 3a 72  65 6d 61 70 73 25 3d 31  |maps%):remaps%=1|
00000160  0d 00 b4 19 72 65 6d 61  70 24 28 31 29 3d 22 4b  |....remap$(1)="K|
00000170  30 30 30 bb 4b 30 30 30  22 0d 00 be 1c de 20 6d  |000.K000"..... m|
00000180  73 67 6c 69 73 74 25 20  38 3a 21 6d 73 67 6c 69  |sglist% 8:!msgli|
00000190  73 74 25 3d 30 0d 00 c8  38 c8 99 22 57 69 6d 70  |st%=0...8.."Wimp|
000001a0  5f 49 6e 69 74 69 61 6c  69 73 65 22 2c 33 31 30  |_Initialise",310|
000001b0  2c 26 34 42 35 33 34 31  35 34 2c 74 61 73 6b 6e  |,&4B534154,taskn|
000001c0  61 6d 65 24 2c 6d 73 67  6c 69 73 74 25 0d 00 d2  |ame$,msglist%...|
000001d0  12 f2 69 6e 69 74 5f 6b  65 79 63 6f 64 65 73 0d  |..init_keycodes.|
000001e0  00 dc 13 f2 69 6e 69 74  5f 74 65 6d 70 6c 61 74  |....init_templat|
000001f0  65 73 0d 00 e6 0f f2 69  6e 69 74 5f 6d 65 6e 75  |es.....init_menu|
00000200  73 0d 00 f0 0e f2 69 6e  69 74 5f 69 62 61 72 0d  |s.....init_ibar.|
00000210  00 fa 0e f2 69 6e 69 74  5f 73 61 76 65 0d 01 04  |....init_save...|
00000220  0e f2 69 6e 69 74 5f 63  6f 64 65 0d 01 0e 04 0d  |..init_code.....|
00000230  01 18 1c 76 73 6e 24 3d  22 31 2e 30 30 20 28 30  |...vsn$="1.00 (0|
00000240  38 2e 30 32 2e 31 39 39  36 29 22 0d 01 19 25 f2  |8.02.1996)"...%.|
00000250  73 65 74 69 63 6f 6e 74  65 78 74 28 77 68 5f 70  |seticontext(wh_p|
00000260  72 6f 67 69 6e 66 6f 25  2c 34 2c 76 73 6e 24 29  |roginfo%,4,vsn$)|
00000270  0d 01 22 04 0d 01 2c 34  63 75 72 72 65 6e 74 25  |.."...,4current%|
00000280  3d 31 3a f2 75 70 64 61  74 65 6c 69 73 74 3a f2  |=1:.updatelist:.|
00000290  73 74 72 69 6e 67 74 6f  77 69 6e 64 6f 77 28 63  |stringtowindow(c|
000002a0  75 72 72 65 6e 74 25 29  0d 01 36 2e 6f 70 65 6e  |urrent%)..6.open|
000002b0  6d 65 6e 75 25 3d 30 3a  73 61 76 65 74 79 70 65  |menu%=0:savetype|
000002c0  25 3d 30 3a f4 20 31 3d  64 61 74 61 2c 20 32 3d  |%=0:. 1=data, 2=|
000002d0  6d 6f 64 75 6c 65 0d 01  40 1d 74 72 61 70 6b 65  |module..@.trapke|
000002e0  79 25 3d a3 3a f4 20 31  3d 66 72 6f 6d 2c 20 32  |y%=.:. 1=from, 2|
000002f0  3d 74 6f 0d 01 4a 17 6f  64 64 6b 65 79 24 3d 22  |=to..J.oddkey$="|
00000300  5b 55 6e 6b 6e 6f 77 6e  5d 22 0d 01 54 0b 71 75  |[Unknown]"..T.qu|
00000310  69 74 25 3d a3 0d 01 5e  05 e1 0d 01 68 05 3a 0d  |it%=...^....h.:.|
00000320  01 72 10 dd 20 f2 69 6e  69 74 5f 69 62 61 72 0d  |.r.. .init_ibar.|
00000330  01 7c 39 21 71 25 3d 2d  31 3a 71 25 21 34 3d 30  |.|9!q%=-1:q%!4=0|
00000340  3a 71 25 21 38 3d 30 3a  71 25 21 31 32 3d 36 38  |:q%!8=0:q%!12=68|
00000350  3a 71 25 21 31 36 3d 36  38 3a 71 25 21 32 30 3d  |:q%!16=68:q%!20=|
00000360  26 37 30 30 33 30 31 41  0d 01 86 3f 24 28 71 25  |&700301A...?$(q%|
00000370  2b 32 34 29 3d 22 21 6b  65 79 66 69 6c 74 65 72  |+24)="!keyfilter|
00000380  22 3a c8 99 22 57 69 6d  70 5f 43 72 65 61 74 65  |":.."Wimp_Create|
00000390  49 63 6f 6e 22 2c 2c 71  25 20 b8 20 69 62 61 72  |Icon",,q% . ibar|
000003a0  68 61 6e 64 6c 65 25 0d  01 90 05 e1 0d 01 9a 05  |handle%.........|
000003b0  3a 0d 01 a4 10 dd 20 f2  69 6e 69 74 5f 73 61 76  |:..... .init_sav|
000003c0  65 0d 01 ae 14 de 20 73  61 76 65 73 70 72 69 74  |e..... savesprit|
000003d0  65 24 28 32 29 0d 01 b8  37 73 61 76 65 73 70 72  |e$(2)...7savespr|
000003e0  69 74 65 24 28 31 29 3d  22 66 69 6c 65 5f 66 66  |ite$(1)="file_ff|
000003f0  64 22 3a 73 61 76 65 73  70 72 69 74 65 24 28 32  |d":savesprite$(2|
00000400  29 3d 22 66 69 6c 65 5f  66 66 61 22 0d 01 c2 10  |)="file_ffa"....|
00000410  de 20 73 61 76 65 66 74  25 28 32 29 0d 01 cc 23  |. saveft%(2)...#|
00000420  73 61 76 65 66 74 25 28  31 29 3d 26 66 66 64 3a  |saveft%(1)=&ffd:|
00000430  73 61 76 65 66 74 25 28  32 29 3d 26 66 66 61 0d  |saveft%(2)=&ffa.|
00000440  01 d6 10 de 20 73 61 76  65 77 68 25 28 32 29 0d  |.... savewh%(2).|
00000450  01 e0 31 73 61 76 65 77  68 25 28 31 29 3d 77 68  |..1savewh%(1)=wh|
00000460  5f 73 61 76 65 64 61 74  25 3a 73 61 76 65 77 68  |_savedat%:savewh|
00000470  25 28 32 29 3d 77 68 5f  73 61 76 65 6d 6f 64 25  |%(2)=wh_savemod%|
00000480  0d 01 ea 05 e1 0d 01 f4  05 3a 0d 01 fe 10 dd 20  |.........:..... |
00000490  f2 69 6e 69 74 5f 63 6f  64 65 0d 02 08 1d de 20  |.init_code..... |
000004a0  63 6f 6e 73 74 5f 63 6f  64 65 25 20 33 32 2c 64  |const_code% 32,d|
000004b0  61 74 65 25 20 33 32 0d  02 12 41 de 20 6d 6c 61  |ate% 32...A. mla|
000004c0  62 65 6c 25 28 6d 61 78  72 65 6d 61 70 73 25 29  |bel%(maxremaps%)|
000004d0  2c 6d 6c 6f 6f 70 73 25  28 6d 61 78 72 65 6d 61  |,mloops%(maxrema|
000004e0  70 73 25 29 2c 6d 6c 6f  6f 70 65 25 28 6d 61 78  |ps%),mloope%(max|
000004f0  72 65 6d 61 70 73 25 29  0d 02 1c 12 50 25 3d 63  |remaps%)....P%=c|
00000500  6f 6e 73 74 5f 63 6f 64  65 25 0d 02 26 0a 5b 4f  |onst_code%..&.[O|
00000510  50 54 20 32 0d 02 30 14  4d 4f 56 20 52 30 2c 52  |PT 2..0.MOV R0,R|
00000520  30 2c 52 4f 52 20 52 31  0d 02 3a 0e 4d 4f 56 20  |0,ROR R1..:.MOV |
00000530  50 43 2c 52 31 34 0d 02  44 05 5d 0d 02 4e 1d 77  |PC,R14..D.]..N.w|
00000540  70 3d 31 32 3a 73 70 3d  31 33 3a 6c 69 6e 6b 3d  |p=12:sp=13:link=|
00000550  31 34 3a 70 63 3d 31 35  0d 02 58 05 e1 0d 02 62  |14:pc=15..X....b|
00000560  05 3a 0d 02 6c 15 dd 20  f2 69 6e 69 74 5f 74 65  |.:..l.. .init_te|
00000570  6d 70 6c 61 74 65 73 0d  02 76 0f de 20 74 6e 61  |mplates..v.. tna|
00000580  6d 65 25 20 31 31 0d 02  80 21 69 64 73 69 7a 65  |me% 11...!idsize|
00000590  25 3d 31 34 35 30 3a de  20 69 64 61 74 61 25 20  |%=1450:. idata% |
000005a0  69 64 73 69 7a 65 25 0d  02 8a 28 69 64 6d 61 78  |idsize%...(idmax|
000005b0  25 3d 69 64 61 74 61 25  2b 69 64 73 69 7a 65 25  |%=idata%+idsize%|
000005c0  3a 69 64 6c 65 66 74 25  3d 69 64 61 74 61 25 0d  |:idleft%=idata%.|
000005d0  02 94 0c 6e 65 78 74 74  25 3d 30 0d 02 9e 36 c8  |...nextt%=0...6.|
000005e0  99 22 57 69 6d 70 5f 4f  70 65 6e 54 65 6d 70 6c  |."Wimp_OpenTempl|
000005f0  61 74 65 22 2c 2c 22 3c  4b 65 79 46 69 6c 74 65  |ate",,"<KeyFilte|
00000600  72 24 44 69 72 3e 2e 54  65 6d 70 6c 61 74 65 73  |r$Dir>.Templates|
00000610  22 0d 02 a8 22 77 68 5f  6d 61 69 6e 25 3d a4 6c  |"..."wh_main%=.l|
00000620  6f 61 64 74 65 6d 70 6c  61 74 65 28 22 4d 61 69  |oadtemplate("Mai|
00000630  6e 22 29 0d 02 b2 22 77  68 5f 6c 69 73 74 25 3d  |n")..."wh_list%=|
00000640  a4 6c 6f 61 64 74 65 6d  70 6c 61 74 65 28 22 4c  |.loadtemplate("L|
00000650  69 73 74 22 29 0d 02 bc  2b 77 68 5f 73 61 76 65  |ist")...+wh_save|
00000660  6d 6f 64 25 3d a4 6c 6f  61 64 74 65 6d 70 6c 61  |mod%=.loadtempla|
00000670  74 65 28 22 53 61 76 65  4d 6f 64 75 6c 65 22 29  |te("SaveModule")|
00000680  0d 02 c6 2a 77 68 5f 70  72 6f 67 69 6e 66 6f 25  |...*wh_proginfo%|
00000690  3d a4 6c 6f 61 64 74 65  6d 70 6c 61 74 65 28 22  |=.loadtemplate("|
000006a0  70 72 6f 67 49 6e 66 6f  22 29 0d 02 d0 29 77 68  |progInfo")...)wh|
000006b0  5f 73 61 76 65 64 61 74  25 3d a4 6c 6f 61 64 74  |_savedat%=.loadt|
000006c0  65 6d 70 6c 61 74 65 28  22 53 61 76 65 44 61 74  |emplate("SaveDat|
000006d0  61 22 29 0d 02 da 1a c8  99 22 57 69 6d 70 5f 43  |a")......"Wimp_C|
000006e0  6c 6f 73 65 54 65 6d 70  6c 61 74 65 22 0d 02 e4  |loseTemplate"...|
000006f0  05 e1 0d 02 ee 1b dd 20  a4 6c 6f 61 64 74 65 6d  |....... .loadtem|
00000700  70 6c 61 74 65 28 74 6e  61 6d 65 24 29 0d 02 f8  |plate(tname$)...|
00000710  12 24 74 6e 61 6d 65 25  3d 74 6e 61 6d 65 24 0d  |.$tname%=tname$.|
00000720  03 02 4c c8 99 22 57 69  6d 70 5f 4c 6f 61 64 54  |..L.."Wimp_LoadT|
00000730  65 6d 70 6c 61 74 65 22  2c 2c 71 25 2c 69 64 6c  |emplate",,q%,idl|
00000740  65 66 74 25 2c 69 64 6d  61 78 25 2c 2d 31 2c 74  |eft%,idmax%,-1,t|
00000750  6e 61 6d 65 25 2c 30 b8  2c 2c 69 64 6c 65 66 74  |name%,0.,,idleft|
00000760  25 2c 2c 2c 2c 6e 65 78  74 74 25 0d 03 0c 28 c8  |%,,,,nextt%...(.|
00000770  99 22 57 69 6d 70 5f 43  72 65 61 74 65 57 69 6e  |."Wimp_CreateWin|
00000780  64 6f 77 22 2c 2c 71 25  20 b8 20 77 68 61 6e 64  |dow",,q% . whand|
00000790  6c 65 25 0d 03 16 0d 3d  77 68 61 6e 64 6c 65 25  |le%....=whandle%|
000007a0  0d 03 20 05 3a 0d 03 2a  11 dd 20 f2 69 6e 69 74  |.. .:..*.. .init|
000007b0  5f 6d 65 6e 75 73 0d 03  34 3e 6d 65 6e 75 5f 69  |_menus..4>menu_i|
000007c0  62 61 72 25 3d a4 6d 61  6b 65 6d 65 6e 75 28 22  |bar%=.makemenu("|
000007d0  4b 65 79 46 69 6c 74 65  72 22 2c 22 49 6e 66 6f  |KeyFilter","Info|
000007e0  bb 77 68 5f 70 72 6f 67  69 6e 66 6f 25 7c 51 75  |.wh_proginfo%|Qu|
000007f0  69 74 22 29 0d 03 3e 62  6d 65 6e 75 5f 6d 61 69  |it")..>bmenu_mai|
00000800  6e 25 3d a4 6d 61 6b 65  6d 65 6e 75 28 22 4b 65  |n%=.makemenu("Ke|
00000810  79 46 69 6c 74 65 72 22  2c 22 53 61 76 65 20 6d  |yFilter","Save m|
00000820  6f 64 75 6c 65 bb 77 68  5f 73 61 76 65 6d 6f 64  |odule.wh_savemod|
00000830  25 7c 5f 5c 53 61 76 65  20 64 61 74 61 bb 77 68  |%|_\Save data.wh|
00000840  5f 73 61 76 65 64 61 74  25 7c 43 6c 65 61 72 20  |_savedat%|Clear |
00000850  64 61 74 61 22 29 0d 03  48 05 e1 0d 03 52 05 3a  |data")..H....R.:|
00000860  0d 03 5c 14 dd 20 f2 69  6e 69 74 5f 6b 65 79 63  |..\.. .init_keyc|
00000870  6f 64 65 73 0d 03 66 0d  ea 20 66 68 25 2c 69 6e  |odes..f.. fh%,in|
00000880  24 0d 03 70 23 66 68 25  3d 8e 22 3c 4b 65 79 46  |$..p#fh%=."<KeyF|
00000890  69 6c 74 65 72 24 44 69  72 3e 2e 4b 65 79 43 6f  |ilter$Dir>.KeyCo|
000008a0  64 65 73 22 0d 03 7a 10  6b 65 79 63 6f 64 65 73  |des"..z.keycodes|
000008b0  25 3d 2d 31 0d 03 84 24  f5 3a 69 6e 24 3d be 23  |%=-1...$.:in$=.#|
000008c0  66 68 25 3a 6b 65 79 63  6f 64 65 73 25 2b 3d 31  |fh%:keycodes%+=1|
000008d0  3a fd 20 c5 23 66 68 25  0d 03 8e 0b cf 23 66 68  |:. .#fh%.....#fh|
000008e0  25 3d 30 0d 03 98 2d de  20 6b 65 79 63 6f 64 65  |%=0...-. keycode|
000008f0  25 28 6b 65 79 63 6f 64  65 73 25 29 2c 6b 65 79  |%(keycodes%),key|
00000900  6e 61 6d 65 24 28 6b 65  79 63 6f 64 65 73 25 29  |name$(keycodes%)|
00000910  0d 03 a2 19 e3 20 6c 6f  6f 70 25 3d 30 20 b8 20  |..... loop%=0 . |
00000920  6b 65 79 63 6f 64 65 73  25 0d 03 ac 13 20 20 69  |keycodes%....  i|
00000930  6e 24 3d 22 26 22 2b be  23 66 68 25 0d 03 b6 1c  |n$="&"+.#fh%....|
00000940  20 20 6b 65 79 63 6f 64  65 25 28 6c 6f 6f 70 25  |  keycode%(loop%|
00000950  29 3d a0 28 69 6e 24 29  0d 03 c0 27 20 20 6b 65  |)=.(in$)...'  ke|
00000960  79 6e 61 6d 65 24 28 6c  6f 6f 70 25 29 3d c1 69  |yname$(loop%)=.i|
00000970  6e 24 2c a7 69 6e 24 2c  22 20 22 29 2b 31 29 0d  |n$,.in$," ")+1).|
00000980  03 ca 0b ed 20 6c 6f 6f  70 25 0d 03 d4 09 d9 23  |.... loop%.....#|
00000990  66 68 25 0d 03 de 05 e1  0d 03 e8 05 3a 0d 03 f2  |fh%.........:...|
000009a0  43 f4 20 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |C. =============|
000009b0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000009e0  0d 03 fc 05 3a 0d 04 06  0b dd 20 f2 70 6f 6c 6c  |....:..... .poll|
000009f0  0d 04 10 1f c8 99 22 57  69 6d 70 5f 50 6f 6c 6c  |......"Wimp_Poll|
00000a00  22 2c 2c 71 25 20 b8 20  72 65 61 73 6f 6e 25 0d  |",,q% . reason%.|
00000a10  04 1a 10 c8 8e 20 72 65  61 73 6f 6e 25 20 ca 0d  |..... reason% ..|
00000a20  04 24 4d 20 20 c9 20 32  3a e7 20 21 71 25 3d 77  |.$M  . 2:. !q%=w|
00000a30  68 5f 6d 61 69 6e 25 20  f2 75 70 64 61 74 65 6c  |h_main% .updatel|
00000a40  69 6e 6b 28 71 25 2c 77  68 5f 6c 69 73 74 25 2c  |ink(q%,wh_list%,|
00000a50  30 29 20 8b 20 c8 99 22  57 69 6d 70 5f 4f 70 65  |0) . .."Wimp_Ope|
00000a60  6e 57 69 6e 64 6f 77 22  2c 2c 71 25 0d 04 2e 22  |nWindow",,q%..."|
00000a70  20 20 c9 20 33 3a c8 99  22 57 69 6d 70 5f 43 6c  |  . 3:.."Wimp_Cl|
00000a80  6f 73 65 57 69 6e 64 6f  77 22 2c 2c 71 25 0d 04  |oseWindow",,q%..|
00000a90  38 3e 20 20 20 20 e7 20  21 71 25 3d 77 68 5f 6d  |8>    . !q%=wh_m|
00000aa0  61 69 6e 25 20 8c 20 21  71 25 3d 77 68 5f 6c 69  |ain% . !q%=wh_li|
00000ab0  73 74 25 3a c8 99 22 57  69 6d 70 5f 43 6c 6f 73  |st%:.."Wimp_Clos|
00000ac0  65 57 69 6e 64 6f 77 22  2c 2c 71 25 0d 04 42 22  |eWindow",,q%..B"|
00000ad0  20 20 c9 20 36 3a f2 63  6c 69 63 6b 28 71 25 21  |  . 6:.click(q%!|
00000ae0  38 2c 71 25 21 31 32 2c  71 25 21 31 36 29 0d 04  |8,q%!12,q%!16)..|
00000af0  4c 13 20 20 c9 20 37 3a  f2 73 74 6f 70 64 72 61  |L.  . 7:.stopdra|
00000b00  67 0d 04 56 15 20 20 c9  20 38 3a f2 70 72 6f 63  |g..V.  . 8:.proc|
00000b10  65 73 73 6b 65 79 0d 04  60 15 20 20 c9 20 39 3a  |esskey..`.  . 9:|
00000b20  f2 6d 65 6e 75 73 65 6c  65 63 74 0d 04 6a 15 20  |.menuselect..j. |
00000b30  20 c9 20 31 31 3a f2 6c  6f 73 65 63 61 72 65 74  | . 11:.losecaret|
00000b40  0d 04 74 16 20 20 c9 20  31 37 2c 31 38 3a f2 72  |..t.  . 17,18:.r|
00000b50  65 63 65 69 76 65 0d 04  7e 05 cb 0d 04 88 05 e1  |eceive..~.......|
00000b60  0d 04 92 05 3a 0d 04 9c  0e dd 20 f2 72 65 63 65  |....:..... .rece|
00000b70  69 76 65 0d 04 a6 0e c8  8e 20 71 25 21 31 36 20  |ive...... q%!16 |
00000b80  ca 0d 04 b0 11 20 20 c9  20 30 3a 71 75 69 74 25  |.....  . 0:quit%|
00000b90  3d b9 0d 04 ba 1f 20 20  c9 20 32 3a f2 64 6f 5f  |=.....  . 2:.do_|
00000ba0  73 61 76 65 28 a4 63 74  73 28 71 25 2b 34 34 29  |save(.cts(q%+44)|
00000bb0  29 0d 04 c4 33 20 20 20  20 24 28 a4 69 6e 64 69  |)...3    $(.indi|
00000bc0  72 28 73 61 76 65 77 68  25 28 73 61 76 65 74 79  |r(savewh%(savety|
00000bd0  70 65 25 29 2c 32 29 29  3d a4 63 74 73 28 71 25  |pe%),2))=.cts(q%|
00000be0  2b 34 34 29 0d 04 ce 22  20 20 20 20 71 25 21 31  |+44)..."    q%!1|
00000bf0  32 3d 71 25 21 38 3a 71  25 21 31 36 3d 33 3a 21  |2=q%!8:q%!16=3:!|
00000c00  71 25 3d 32 35 36 0d 04  d8 2e 20 20 20 20 c8 99  |q%=256....    ..|
00000c10  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00000c20  65 22 2c 31 38 2c 71 25  2c 71 25 21 32 30 2c 71  |e",18,q%,q%!20,q|
00000c30  25 21 32 34 0d 04 e2 3c  20 20 c9 20 33 3a 71 25  |%!24...<  . 3:q%|
00000c40  21 31 32 3d 71 25 21 38  3a 71 25 21 31 36 3d 34  |!12=q%!8:q%!16=4|
00000c50  3a c8 99 22 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |:.."Wimp_SendMes|
00000c60  73 61 67 65 22 2c 31 37  2c 71 25 2c 71 25 21 34  |sage",17,q%,q%!4|
00000c70  0d 04 ec 1f 20 20 20 20  f2 6c 6f 61 64 5f 64 61  |....    .load_da|
00000c80  74 61 28 a4 63 74 73 28  71 25 2b 34 34 29 29 0d  |ta(.cts(q%+44)).|
00000c90  04 f6 05 cb 0d 05 00 05  e1 0d 05 0a 05 3a 0d 05  |.............:..|
00000ca0  14 10 dd 20 f2 6c 6f 73  65 63 61 72 65 74 0d 05  |... .losecaret..|
00000cb0  1e 09 ea 20 69 68 25 0d  05 28 12 e7 20 74 72 61  |... ih%..(.. tra|
00000cc0  70 6b 65 79 25 3e 30 20  8c 0d 05 32 20 20 20 e7  |pkey%>0 ...2   .|
00000cd0  20 74 72 61 70 6b 65 79  25 3d 31 20 69 68 25 3d  | trapkey%=1 ih%=|
00000ce0  33 20 8b 20 69 68 25 3d  39 0d 05 3c 24 20 20 f2  |3 . ih%=9..<$  .|
00000cf0  73 65 74 69 63 6f 6e 28  77 68 5f 6d 61 69 6e 25  |seticon(wh_main%|
00000d00  2c 69 68 25 2c 30 2c 31  3c 3c 32 31 29 0d 05 46  |,ih%,0,1<<21)..F|
00000d10  10 20 20 74 72 61 70 6b  65 79 25 3d 30 0d 05 50  |.  trapkey%=0..P|
00000d20  05 cd 0d 05 5a 05 e1 0d  05 64 05 3a 0d 05 6e 27  |....Z....d.:..n'|
00000d30  dd 20 f2 63 6c 69 63 6b  28 62 75 74 74 6f 6e 25  |. .click(button%|
00000d40  2c 77 68 61 6e 64 6c 65  25 2c 69 68 61 6e 64 6c  |,whandle%,ihandl|
00000d50  65 25 29 0d 05 78 19 ea  20 6f 74 6b 25 2c 6c 6f  |e%)..x.. otk%,lo|
00000d60  6f 70 25 2c 79 73 63 72  6f 6c 6c 25 0d 05 82 1d  |op%,yscroll%....|
00000d70  e7 20 62 75 74 74 6f 6e  25 3d 32 20 8c 20 f2 6f  |. button%=2 . .o|
00000d80  70 65 6e 6d 65 6e 75 3a  e1 0d 05 8c 11 c8 8e 20  |penmenu:....... |
00000d90  77 68 61 6e 64 6c 65 25  20 ca 0d 05 96 0a 20 20  |whandle% .....  |
00000da0  c9 20 2d 32 0d 05 a0 2f  20 20 20 21 71 25 3d 77  |. -2.../   !q%=w|
00000db0  68 5f 6d 61 69 6e 25 3a  c8 99 22 57 69 6d 70 5f  |h_main%:.."Wimp_|
00000dc0  47 65 74 57 69 6e 64 6f  77 53 74 61 74 65 22 2c  |GetWindowState",|
00000dd0  2c 71 25 0d 05 aa 1e 20  20 20 e7 20 28 28 71 25  |,q%....   . ((q%|
00000de0  21 33 32 29 80 28 31 3c  3c 31 36 29 29 3d 30 20  |!32).(1<<16))=0 |
00000df0  8c 0d 05 b4 1c 20 20 20  20 20 f2 63 65 6e 74 72  |.....     .centr|
00000e00  65 77 69 6e 64 6f 77 28  71 25 2b 34 29 0d 05 be  |ewindow(q%+4)...|
00000e10  20 20 20 20 20 20 f2 79  73 63 72 6f 6c 6c 5f 7a  |      .yscroll_z|
00000e20  65 72 6f 28 77 68 5f 6c  69 73 74 25 29 0d 05 c8  |ero(wh_list%)...|
00000e30  08 20 20 20 cd 0d 05 d2  21 20 20 20 f2 75 70 64  |.   ....!   .upd|
00000e40  61 74 65 6c 69 6e 6b 28  71 25 2c 77 68 5f 6c 69  |atelink(q%,wh_li|
00000e50  73 74 25 2c 30 29 0d 05  dc 10 20 20 c9 20 77 68  |st%,0)....  . wh|
00000e60  5f 6d 61 69 6e 25 0d 05  e6 14 20 20 20 c8 8e 20  |_main%....   .. |
00000e70  69 68 61 6e 64 6c 65 25  20 ca 0d 05 f0 0e 20 20  |ihandle% .....  |
00000e80  20 20 20 c9 20 33 2c 39  0d 05 fa 18 20 20 20 20  |   . 3,9....    |
00000e90  20 20 20 6f 74 6b 25 3d  74 72 61 70 6b 65 79 25  |   otk%=trapkey%|
00000ea0  0d 06 04 41 20 20 20 20  20 20 20 74 72 61 70 6b  |...A       trapk|
00000eb0  65 79 25 3d 28 2d 32 2d  28 69 68 61 6e 64 6c 65  |ey%=(-2-(ihandle|
00000ec0  25 3d 33 29 29 2a a4 73  65 6c 69 63 6f 6e 28 77  |%=3))*.selicon(w|
00000ed0  68 5f 6d 61 69 6e 25 2c  69 68 61 6e 64 6c 65 25  |h_main%,ihandle%|
00000ee0  29 0d 06 0e 19 20 20 20  20 20 20 20 e7 20 74 72  |)....       . tr|
00000ef0  61 70 6b 65 79 25 3d 30  20 8c 0d 06 18 35 20 20  |apkey%=0 ....5  |
00000f00  20 20 20 20 20 20 20 f2  73 65 74 69 63 6f 6e 28  |       .seticon(|
00000f10  77 68 61 6e 64 6c 65 25  2c 28 69 68 61 6e 64 6c  |whandle%,(ihandl|
00000f20  65 25 82 31 30 29 2c 30  2c 31 3c 3c 32 31 29 0d  |e%.10),0,1<<21).|
00000f30  06 22 5e 20 20 20 20 20  20 20 20 20 c8 99 22 57  |."^         .."W|
00000f40  69 6d 70 5f 53 65 74 43  61 72 65 74 50 6f 73 69  |imp_SetCaretPosi|
00000f50  74 69 6f 6e 22 2c 21 63  61 72 65 74 25 2c 63 61  |tion",!caret%,ca|
00000f60  72 65 74 25 21 34 2c 63  61 72 65 74 25 21 38 2c  |ret%!4,caret%!8,|
00000f70  63 61 72 65 74 25 21 31  36 2c 63 61 72 65 74 25  |caret%!16,caret%|
00000f80  21 32 30 2c 63 61 72 65  74 25 21 32 34 0d 06 2c  |!20,caret%!24..,|
00000f90  0d 20 20 20 20 20 20 20  20 cc 0d 06 36 35 20 20  |.        ...65  |
00000fa0  20 20 20 20 20 20 20 f2  73 65 74 69 63 6f 6e 28  |       .seticon(|
00000fb0  77 68 61 6e 64 6c 65 25  2c 28 69 68 61 6e 64 6c  |whandle%,(ihandl|
00000fc0  65 25 82 31 30 29 2c 30  2c 31 3c 3c 32 31 29 0d  |e%.10),0,1<<21).|
00000fd0  06 40 17 20 20 20 20 20  20 20 20 20 e7 20 6f 74  |.@.         . ot|
00000fe0  6b 25 3d 30 20 8c 0d 06  4a 30 20 20 20 20 20 20  |k%=0 ...J0      |
00000ff0  20 20 20 20 20 c8 99 22  57 69 6d 70 5f 47 65 74  |     .."Wimp_Get|
00001000  43 61 72 65 74 50 6f 73  69 74 69 6f 6e 22 2c 2c  |CaretPosition",,|
00001010  63 61 72 65 74 25 0d 06  54 43 20 20 20 20 20 20  |caret%..TC      |
00001020  20 20 20 20 20 c8 99 22  57 69 6d 70 5f 53 65 74  |     .."Wimp_Set|
00001030  43 61 72 65 74 50 6f 73  69 74 69 6f 6e 22 2c 77  |CaretPosition",w|
00001040  68 61 6e 64 6c 65 25 2c  2d 31 2c 30 2c 30 2c 28  |handle%,-1,0,0,(|
00001050  31 3c 3c 32 35 29 2c 2d  31 0d 06 5e 0e 20 20 20  |1<<25),-1..^.   |
00001060  20 20 20 20 20 20 cd 0d  06 68 0c 20 20 20 20 20  |      ...h.     |
00001070  20 20 cd 0d 06 72 0d 20  20 20 20 20 c9 20 31 34  |  ...r.     . 14|
00001080  0d 06 7c 19 20 20 20 20  20 20 20 e7 20 72 65 6d  |..|.       . rem|
00001090  61 70 73 25 3c 38 30 20  8c 0d 06 86 33 20 20 20  |aps%<80 ....3   |
000010a0  20 20 20 20 20 20 72 65  6d 61 70 73 25 2b 3d 31  |      remaps%+=1|
000010b0  3a 72 65 6d 61 70 24 28  72 65 6d 61 70 73 25 29  |:remap$(remaps%)|
000010c0  3d 22 4b 30 30 30 bb 4b  30 30 30 22 0d 06 90 37  |="K000.K000"...7|
000010d0  20 20 20 20 20 20 20 20  20 f2 77 69 6e 64 6f 77  |         .window|
000010e0  74 6f 73 74 72 69 6e 67  28 63 75 72 72 65 6e 74  |tostring(current|
000010f0  25 29 3a 63 75 72 72 65  6e 74 25 3d 72 65 6d 61  |%):current%=rema|
00001100  70 73 25 0d 06 9a 18 20  20 20 20 20 20 20 20 20  |ps%....         |
00001110  f2 75 70 64 61 74 65 6c  69 73 74 0d 06 a4 26 20  |.updatelist...& |
00001120  20 20 20 20 20 20 20 20  f2 73 74 72 69 6e 67 74  |        .stringt|
00001130  6f 77 69 6e 64 6f 77 28  63 75 72 72 65 6e 74 25  |owindow(current%|
00001140  29 0d 06 ae 35 20 20 20  20 20 20 20 20 20 21 71  |)...5         !q|
00001150  25 3d 77 68 5f 6d 61 69  6e 25 3a c8 99 22 57 69  |%=wh_main%:.."Wi|
00001160  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
00001170  65 22 2c 2c 71 25 0d 06  b8 27 20 20 20 20 20 20  |e",,q%...'      |
00001180  20 20 20 f2 75 70 64 61  74 65 6c 69 6e 6b 28 71  |   .updatelink(q|
00001190  25 2c 77 68 5f 6c 69 73  74 25 2c 30 29 0d 06 c2  |%,wh_list%,0)...|
000011a0  19 20 20 20 20 20 20 20  20 20 f2 73 68 6f 77 63  |.         .showc|
000011b0  75 72 72 65 6e 74 0d 06  cc 0d 20 20 20 20 20 20  |urrent....      |
000011c0  20 20 cc 0d 06 d6 61 20  20 20 20 20 20 20 20 20  |  ....a         |
000011d0  64 75 6d 6d 79 25 3d a4  72 65 70 6f 72 74 28 22  |dummy%=.report("|
000011e0  53 6f 72 72 79 2c 20 6d  61 78 69 6d 75 6d 20 38  |Sorry, maximum 8|
000011f0  30 20 6b 65 79 20 72 65  6d 61 70 73 2e 20 48 61  |0 key remaps. Ha|
00001200  63 6b 20 74 68 65 20 70  72 6f 67 72 61 6d 20 69  |ck the program i|
00001210  66 20 79 6f 75 20 6e 65  65 64 20 6d 6f 72 65 21  |f you need more!|
00001220  22 2c 32 29 0d 06 e0 0c  20 20 20 20 20 20 20 cd  |",2)....       .|
00001230  0d 06 ea 0d 20 20 20 20  20 c9 20 31 35 0d 06 f4  |....     . 15...|
00001240  18 20 20 20 20 20 20 20  e7 20 72 65 6d 61 70 73  |.       . remaps|
00001250  25 3e 31 20 8c 0d 06 fe  17 20 20 20 20 20 20 20  |%>1 .....       |
00001260  20 20 72 65 6d 61 70 73  25 2d 3d 31 0d 07 08 22  |  remaps%-=1..."|
00001270  20 20 20 20 20 20 20 20  20 e7 20 63 75 72 72 65  |         . curre|
00001280  6e 74 25 3c 3d 72 65 6d  61 70 73 25 20 8c 0d 07  |nt%<=remaps% ...|
00001290  12 29 20 20 20 20 20 20  20 20 20 20 20 e3 20 6c  |.)           . l|
000012a0  6f 6f 70 25 3d 63 75 72  72 65 6e 74 25 20 b8 20  |oop%=current% . |
000012b0  72 65 6d 61 70 73 25 0d  07 1c 2e 20 20 20 20 20  |remaps%....     |
000012c0  20 20 20 20 20 20 20 20  72 65 6d 61 70 24 28 6c  |        remap$(l|
000012d0  6f 6f 70 25 29 3d 72 65  6d 61 70 24 28 6c 6f 6f  |oop%)=remap$(loo|
000012e0  70 25 2b 31 29 0d 07 26  16 20 20 20 20 20 20 20  |p%+1)..&.       |
000012f0  20 20 20 20 ed 20 6c 6f  6f 70 25 0d 07 30 0e 20  |    . loop%..0. |
00001300  20 20 20 20 20 20 20 20  cd 0d 07 3a 30 20 20 20  |        ...:0   |
00001310  20 20 20 20 20 20 e7 20  63 75 72 72 65 6e 74 25  |      . current%|
00001320  3e 72 65 6d 61 70 73 25  20 63 75 72 72 65 6e 74  |>remaps% current|
00001330  25 3d 72 65 6d 61 70 73  25 0d 07 44 3d 20 20 20  |%=remaps%..D=   |
00001340  20 20 20 20 20 20 21 6d  69 73 63 62 25 3d 77 68  |      !miscb%=wh|
00001350  5f 6c 69 73 74 25 3a c8  99 22 57 69 6d 70 5f 47  |_list%:.."Wimp_G|
00001360  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00001370  6d 69 73 63 62 25 0d 07  4e 1f 20 20 20 20 20 20  |miscb%..N.      |
00001380  20 20 20 79 73 63 72 6f  6c 6c 25 3d 6d 69 73 63  |   yscroll%=misc|
00001390  62 25 21 32 34 0d 07 58  18 20 20 20 20 20 20 20  |b%!24..X.       |
000013a0  20 20 f2 75 70 64 61 74  65 6c 69 73 74 0d 07 62  |  .updatelist..b|
000013b0  35 20 20 20 20 20 20 20  20 20 21 71 25 3d 77 68  |5         !q%=wh|
000013c0  5f 6d 61 69 6e 25 3a c8  99 22 57 69 6d 70 5f 47  |_main%:.."Wimp_G|
000013d0  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
000013e0  71 25 0d 07 6c 27 20 20  20 20 20 20 20 20 20 f2  |q%..l'         .|
000013f0  75 70 64 61 74 65 6c 69  6e 6b 28 71 25 2c 77 68  |updatelink(q%,wh|
00001400  5f 6c 69 73 74 25 2c 30  29 0d 07 76 3d 20 20 20  |_list%,0)..v=   |
00001410  20 20 20 20 20 20 21 6d  69 73 63 62 25 3d 77 68  |      !miscb%=wh|
00001420  5f 6c 69 73 74 25 3a c8  99 22 57 69 6d 70 5f 47  |_list%:.."Wimp_G|
00001430  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00001440  6d 69 73 63 62 25 0d 07  80 3b 20 20 20 20 20 20  |miscb%...;      |
00001450  20 20 20 6d 69 73 63 62  25 21 32 34 3d 79 73 63  |   miscb%!24=ysc|
00001460  72 6f 6c 6c 25 3a c8 99  22 57 69 6d 70 5f 4f 70  |roll%:.."Wimp_Op|
00001470  65 6e 57 69 6e 64 6f 77  22 2c 2c 6d 69 73 63 62  |enWindow",,miscb|
00001480  25 0d 07 8a 26 20 20 20  20 20 20 20 20 20 f2 73  |%...&         .s|
00001490  74 72 69 6e 67 74 6f 77  69 6e 64 6f 77 28 63 75  |tringtowindow(cu|
000014a0  72 72 65 6e 74 25 29 0d  07 94 0d 20 20 20 20 20  |rrent%)....     |
000014b0  20 20 20 cc 0d 07 9e 3c  20 20 20 20 20 20 20 20  |   ....<        |
000014c0  20 64 75 6d 6d 79 25 3d  a4 72 65 70 6f 72 74 28  | dummy%=.report(|
000014d0  22 53 6f 72 72 79 2c 20  6d 69 6e 69 6d 75 6d 20  |"Sorry, minimum |
000014e0  31 20 6b 65 79 20 72 65  6d 61 70 21 22 2c 32 29  |1 key remap!",2)|
000014f0  0d 07 a8 0c 20 20 20 20  20 20 20 cd 0d 07 b2 2b  |....       ....+|
00001500  20 20 20 20 20 c9 20 37  2c 38 2c 31 31 3a f2 77  |     . 7,8,11:.w|
00001510  69 6e 64 6f 77 74 6f 73  74 72 69 6e 67 28 63 75  |indowtostring(cu|
00001520  72 72 65 6e 74 25 29 0d  07 bc 08 20 20 20 cb 0d  |rrent%)....   ..|
00001530  07 c6 10 20 20 c9 20 77  68 5f 6c 69 73 74 25 0d  |...  . wh_list%.|
00001540  07 d0 1f 20 20 20 e7 20  69 68 61 6e 64 6c 65 25  |...   . ihandle%|
00001550  3c 3e 63 75 72 72 65 6e  74 25 2d 31 20 8c 0d 07  |<>current%-1 ...|
00001560  da 22 20 20 20 20 20 f2  77 69 6e 64 6f 77 74 6f  |."     .windowto|
00001570  73 74 72 69 6e 67 28 63  75 72 72 65 6e 74 25 29  |string(current%)|
00001580  0d 07 e4 1c 20 20 20 20  20 63 75 72 72 65 6e 74  |....     current|
00001590  25 3d 69 68 61 6e 64 6c  65 25 2b 31 0d 07 ee 22  |%=ihandle%+1..."|
000015a0  20 20 20 20 20 f2 73 74  72 69 6e 67 74 6f 77 69  |     .stringtowi|
000015b0  6e 64 6f 77 28 63 75 72  72 65 6e 74 25 29 0d 07  |ndow(current%)..|
000015c0  f8 09 20 20 20 20 cc 0d  08 02 52 20 20 20 20 20  |..    ....R     |
000015d0  e7 20 a4 73 65 6c 69 63  6f 6e 28 77 68 5f 6c 69  |. .selicon(wh_li|
000015e0  73 74 25 2c 69 68 61 6e  64 6c 65 25 29 3d 30 20  |st%,ihandle%)=0 |
000015f0  8c 20 f2 73 65 74 69 63  6f 6e 28 77 68 5f 6c 69  |. .seticon(wh_li|
00001600  73 74 25 2c 69 68 61 6e  64 6c 65 25 2c 31 3c 3c  |st%,ihandle%,1<<|
00001610  32 31 2c 31 3c 3c 32 31  29 0d 08 0c 08 20 20 20  |21,1<<21)....   |
00001620  cd 0d 08 16 1f 20 20 c9  20 77 68 5f 73 61 76 65  |.....  . wh_save|
00001630  64 61 74 25 2c 77 68 5f  73 61 76 65 6d 6f 64 25  |dat%,wh_savemod%|
00001640  0d 08 20 39 20 20 20 e7  20 77 68 61 6e 64 6c 65  |.. 9   . whandle|
00001650  25 3d 77 68 5f 73 61 76  65 64 61 74 25 20 8c 20  |%=wh_savedat% . |
00001660  73 61 76 65 74 79 70 65  25 3d 31 20 8b 20 73 61  |savetype%=1 . sa|
00001670  76 65 74 79 70 65 25 3d  32 0d 08 2a 37 20 20 20  |vetype%=2..*7   |
00001680  e7 20 69 68 61 6e 64 6c  65 25 3d 33 20 80 20 62  |. ihandle%=3 . b|
00001690  75 74 74 6f 6e 25 3e 31  35 20 8c 20 f2 73 74 61  |utton%>15 . .sta|
000016a0  72 74 64 72 61 67 28 77  68 61 6e 64 6c 65 25 29  |rtdrag(whandle%)|
000016b0  0d 08 34 20 20 20 20 e7  20 69 68 61 6e 64 6c 65  |..4    . ihandle|
000016c0  25 3d 30 20 8c 20 f2 71  75 69 63 6b 73 61 76 65  |%=0 . .quicksave|
000016d0  0d 08 3e 05 cb 0d 08 48  05 e1 0d 08 52 05 3a 0d  |..>....H....R.:.|
000016e0  08 5c 0f dd 20 f2 6f 70  65 6e 6d 65 6e 75 0d 08  |.\.. .openmenu..|
000016f0  66 09 ea 20 6d 79 25 0d  08 70 0e c8 8e 20 71 25  |f.. my%..p... q%|
00001700  21 31 32 20 ca 0d 08 7a  27 20 20 c9 20 2d 32 3a  |!12 ...z'  . -2:|
00001710  6f 70 65 6e 6d 65 6e 75  25 3d 6d 65 6e 75 5f 69  |openmenu%=menu_i|
00001720  62 61 72 25 3a 6d 79 25  3d 31 38 34 0d 08 84 25  |bar%:my%=184...%|
00001730  20 20 7f 3a 6f 70 65 6e  6d 65 6e 75 25 3d 6d 65  |  .:openmenu%=me|
00001740  6e 75 5f 6d 61 69 6e 25  3a 6d 79 25 3d 71 25 21  |nu_main%:my%=q%!|
00001750  34 0d 08 8e 05 cb 0d 08  98 2d c8 99 22 57 69 6d  |4........-.."Wim|
00001760  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 6f  |p_CreateMenu",,o|
00001770  70 65 6e 6d 65 6e 75 25  2c 21 71 25 2d 36 34 2c  |penmenu%,!q%-64,|
00001780  6d 79 25 0d 08 a2 05 e1  0d 08 ac 05 3a 0d 08 b6  |my%.........:...|
00001790  11 dd 20 f2 6d 65 6e 75  73 65 6c 65 63 74 0d 08  |.. .menuselect..|
000017a0  c0 2c e7 20 6f 70 65 6e  6d 65 6e 75 25 3d 6d 65  |.,. openmenu%=me|
000017b0  6e 75 5f 69 62 61 72 25  20 80 20 21 71 25 3d 31  |nu_ibar% . !q%=1|
000017c0  20 8c 20 71 75 69 74 25  3d b9 0d 08 ca 2f e7 20  | . quit%=..../. |
000017d0  6f 70 65 6e 6d 65 6e 75  25 3d 6d 65 6e 75 5f 6d  |openmenu%=menu_m|
000017e0  61 69 6e 25 20 80 20 21  71 25 3d 32 20 8c 20 f2  |ain% . !q%=2 . .|
000017f0  77 69 70 65 5f 64 61 74  61 0d 08 d4 23 c8 99 22  |wipe_data...#.."|
00001800  57 69 6d 70 5f 47 65 74  50 6f 69 6e 74 65 72 49  |Wimp_GetPointerI|
00001810  6e 66 6f 22 2c 2c 6d 69  73 63 62 25 0d 08 de 31  |nfo",,miscb%...1|
00001820  e7 20 6d 69 73 63 62 25  21 38 3d 31 20 8c 20 c8  |. miscb%!8=1 . .|
00001830  99 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  |."Wimp_CreateMen|
00001840  75 22 2c 2c 6d 65 6e 75  25 2c 30 2c 30 0d 08 e8  |u",,menu%,0,0...|
00001850  05 e1 0d 08 f2 05 3a 0d  08 fc 11 dd 20 f2 70 72  |......:..... .pr|
00001860  6f 63 65 73 73 6b 65 79  0d 09 06 15 ea 20 6b 65  |ocesskey..... ke|
00001870  79 25 2c 6c 6f 6f 70 25  2c 6b 65 79 24 0d 09 10  |y%,loop%,key$...|
00001880  12 e7 20 74 72 61 70 6b  65 79 25 3e 30 20 8c 0d  |.. trapkey%>0 ..|
00001890  09 1a 57 20 20 c8 99 22  57 69 6d 70 5f 53 65 74  |..W  .."Wimp_Set|
000018a0  43 61 72 65 74 50 6f 73  69 74 69 6f 6e 22 2c 21  |CaretPosition",!|
000018b0  63 61 72 65 74 25 2c 63  61 72 65 74 25 21 34 2c  |caret%,caret%!4,|
000018c0  63 61 72 65 74 25 21 38  2c 63 61 72 65 74 25 21  |caret%!8,caret%!|
000018d0  31 36 2c 63 61 72 65 74  25 21 32 30 2c 63 61 72  |16,caret%!20,car|
000018e0  65 74 25 21 32 34 0d 09  24 20 20 20 e7 20 74 72  |et%!24..$   . tr|
000018f0  61 70 6b 65 79 25 3d 31  20 69 68 25 3d 33 20 8b  |apkey%=1 ih%=3 .|
00001900  20 69 68 25 3d 39 0d 09  2e 24 20 20 f2 73 65 74  | ih%=9...$  .set|
00001910  69 63 6f 6e 28 77 68 5f  6d 61 69 6e 25 2c 69 68  |icon(wh_main%,ih|
00001920  25 2c 30 2c 31 3c 3c 32  31 29 0d 09 38 10 20 20  |%,0,1<<21)..8.  |
00001930  6b 65 79 25 3d 71 25 21  32 34 0d 09 42 2a 20 20  |key%=q%!24..B*  |
00001940  f2 75 70 64 61 74 65 77  69 28 77 68 5f 6d 61 69  |.updatewi(wh_mai|
00001950  6e 25 2c 69 68 25 2b 31  2c 22 26 22 2b c3 7e 6b  |n%,ih%+1,"&"+.~k|
00001960  65 79 25 29 0d 09 4c 2f  20 20 f2 73 65 74 69 63  |ey%)..L/  .setic|
00001970  6f 6e 74 65 78 74 28 77  68 5f 6d 61 69 6e 25 2c  |ontext(wh_main%,|
00001980  69 68 25 2c a4 6b 65 79  6e 61 6d 65 28 6b 65 79  |ih%,.keyname(key|
00001990  25 29 29 0d 09 56 1f 20  20 f2 77 69 6e 64 6f 77  |%))..V.  .window|
000019a0  74 6f 73 74 72 69 6e 67  28 63 75 72 72 65 6e 74  |tostring(current|
000019b0  25 29 0d 09 60 10 20 20  74 72 61 70 6b 65 79 25  |%)..`.  trapkey%|
000019c0  3d 30 0d 09 6a 06 20 cc  0d 09 74 0e 20 20 c8 8e  |=0..j. ...t.  ..|
000019d0  20 21 71 25 20 ca 0d 09  7e 12 20 20 20 20 c9 20  | !q% ...~.    . |
000019e0  77 68 5f 6d 61 69 6e 25  0d 09 88 2b 20 20 20 20  |wh_main%...+    |
000019f0  20 20 e7 20 28 71 25 21  34 3d 34 20 84 20 71 25  |  . (q%!4=4 . q%|
00001a00  21 34 3d 31 30 29 20 80  20 71 25 21 32 34 3d 31  |!4=10) . q%!24=1|
00001a10  33 20 8c 0d 09 92 53 20  20 20 20 20 20 20 20 f2  |3 ....S        .|
00001a20  73 65 74 69 63 6f 6e 74  65 78 74 28 77 68 5f 6d  |seticontext(wh_m|
00001a30  61 69 6e 25 2c 71 25 21  34 2d 31 2c a4 6b 65 79  |ain%,q%!4-1,.key|
00001a40  6e 61 6d 65 28 a4 65 76  61 6c 28 24 28 a4 69 6e  |name(.eval($(.in|
00001a50  64 69 72 28 77 68 5f 6d  61 69 6e 25 2c 71 25 21  |dir(wh_main%,q%!|
00001a60  34 29 29 29 29 29 0d 09  9c 25 20 20 20 20 20 20  |4)))))...%      |
00001a70  20 20 f2 77 69 6e 64 6f  77 74 6f 73 74 72 69 6e  |  .windowtostrin|
00001a80  67 28 63 75 72 72 65 6e  74 25 29 0d 09 a6 0c 20  |g(current%).... |
00001a90  20 20 20 20 20 20 cc 0d  09 b0 22 20 20 20 20 20  |      ...."     |
00001aa0  20 20 20 e7 20 71 25 21  32 34 3d 31 33 20 80 20  |   . q%!24=13 . |
00001ab0  71 25 21 34 3d 31 32 20  8c 0d 09 ba 27 20 20 20  |q%!4=12 ....'   |
00001ac0  20 20 20 20 20 20 20 f2  77 69 6e 64 6f 77 74 6f  |       .windowto|
00001ad0  73 74 72 69 6e 67 28 63  75 72 72 65 6e 74 25 29  |string(current%)|
00001ae0  0d 09 c4 28 20 20 20 20  20 20 20 20 20 cc 3a c8  |...(         .:.|
00001af0  99 22 57 69 6d 70 5f 50  72 6f 63 65 73 73 4b 65  |."Wimp_ProcessKe|
00001b00  79 22 2c 71 25 21 32 34  0d 09 ce 0d 20 20 20 20  |y",q%!24....    |
00001b10  20 20 20 20 cd 0d 09 d8  0b 20 20 20 20 20 20 cd  |    .....      .|
00001b20  0d 09 e2 21 20 20 20 20  c9 20 77 68 5f 73 61 76  |...!    . wh_sav|
00001b30  65 64 61 74 25 2c 77 68  5f 73 61 76 65 6d 6f 64  |edat%,wh_savemod|
00001b40  25 0d 09 ec 16 20 20 20  20 20 20 e7 20 71 25 21  |%....      . q%!|
00001b50  32 34 3d 31 33 20 8c 0d  09 f6 39 20 20 20 20 20  |24=13 ....9     |
00001b60  20 20 20 e7 20 21 71 25  3d 77 68 5f 73 61 76 65  |   . !q%=wh_save|
00001b70  64 61 74 25 20 8c 20 73  61 76 65 74 79 70 65 25  |dat% . savetype%|
00001b80  3d 31 20 8b 20 73 61 76  65 74 79 70 65 25 3d 32  |=1 . savetype%=2|
00001b90  0d 0a 00 16 20 20 20 20  20 20 20 20 f2 71 75 69  |....        .qui|
00001ba0  63 6b 73 61 76 65 0d 0a  0a 0c 20 20 20 20 20 20  |cksave....      |
00001bb0  20 cc 0d 0a 14 25 20 20  20 20 20 20 20 20 c8 99  | ....%        ..|
00001bc0  22 57 69 6d 70 5f 50 72  6f 63 65 73 73 4b 65 79  |"Wimp_ProcessKey|
00001bd0  22 2c 71 25 21 32 34 0d  0a 1e 0b 20 20 20 20 20  |",q%!24....     |
00001be0  20 cd 0d 0a 28 23 20 20  20 20 7f 3a c8 99 22 57  | ...(#    .:.."W|
00001bf0  69 6d 70 5f 50 72 6f 63  65 73 73 4b 65 79 22 2c  |imp_ProcessKey",|
00001c00  71 25 21 32 34 0d 0a 32  07 20 20 cb 0d 0a 3c 05  |q%!24..2.  ...<.|
00001c10  cd 0d 0a 46 05 e1 0d 0a  50 05 3a 0d 0a 5a 14 dd  |...F....P.:..Z..|
00001c20  20 a4 6b 65 79 6e 61 6d  65 28 6b 65 79 25 29 0d  | .keyname(key%).|
00001c30  0a 64 10 ea 20 6c 6f 6f  70 25 2c 6b 65 79 24 0d  |.d.. loop%,key$.|
00001c40  0a 6e 27 e7 20 6b 65 79  25 3c 26 32 30 20 84 20  |.n'. key%<&20 . |
00001c50  6b 65 79 25 3e 26 31 37  39 20 84 20 6b 65 79 25  |key%>&179 . key%|
00001c60  3d 26 37 46 20 8c 0d 0a  78 0d 20 20 6c 6f 6f 70  |=&7F ...x.  loop|
00001c70  25 3d 30 0d 0a 82 30 20  20 c8 95 20 6b 65 79 63  |%=0...0  .. keyc|
00001c80  6f 64 65 25 28 6c 6f 6f  70 25 29 3c 3e 6b 65 79  |ode%(loop%)<>key|
00001c90  25 20 80 20 6c 6f 6f 70  25 3c 6b 65 79 63 6f 64  |% . loop%<keycod|
00001ca0  65 73 25 0d 0a 8c 10 20  20 6c 6f 6f 70 25 2b 3d  |es%....  loop%+=|
00001cb0  31 3a ce 0d 0a 96 41 20  20 e7 20 6b 65 79 63 6f  |1:....A  . keyco|
00001cc0  64 65 25 28 6c 6f 6f 70  25 29 3c 3e 6b 65 79 25  |de%(loop%)<>key%|
00001cd0  20 6b 65 79 24 3d 6f 64  64 6b 65 79 24 20 8b 20  | key$=oddkey$ . |
00001ce0  6b 65 79 24 3d 6b 65 79  6e 61 6d 65 24 28 6c 6f  |key$=keyname$(lo|
00001cf0  6f 70 25 29 0d 0a a0 06  20 cc 0d 0a aa 27 20 20  |op%).... ....'  |
00001d00  6b 65 79 24 3d 22 90 22  2b bd 28 6b 65 79 25 29  |key$="."+.(key%)|
00001d10  2b 22 91 20 28 22 2b c3  7e 6b 65 79 25 2b 22 29  |+". ("+.~key%+")|
00001d20  22 0d 0a b4 05 cd 0d 0a  be 09 3d 6b 65 79 24 0d  |".........=key$.|
00001d30  0a c8 05 3a 0d 0a d2 10  dd 20 f2 77 69 70 65 5f  |...:..... .wipe_|
00001d40  64 61 74 61 0d 0a dc 26  65 72 72 6e 61 6d 65 24  |data...&errname$|
00001d50  3d 22 57 61 72 6e 69 6e  67 20 66 72 6f 6d 20 22  |="Warning from "|
00001d60  2b 74 61 73 6b 6e 61 6d  65 24 0d 0a e6 6b e7 20  |+taskname$...k. |
00001d70  a4 72 65 70 6f 72 74 28  22 41 72 65 20 79 6f 75  |.report("Are you|
00001d80  20 73 75 72 65 20 79 6f  75 20 77 6f 75 6c 64 20  | sure you would |
00001d90  6c 69 6b 65 20 74 6f 20  63 6c 65 61 72 20 61 6c  |like to clear al|
00001da0  6c 20 74 68 65 20 64 61  74 61 3f 20 28 4f 4b 20  |l the data? (OK |
00001db0  63 6c 65 61 72 73 29 22  2c 31 39 29 3d 32 20 8c  |clears)",19)=2 .|
00001dc0  20 65 72 72 6e 61 6d 65  24 3d 74 61 73 6b 6e 61  | errname$=taskna|
00001dd0  6d 65 24 3a e1 0d 0a f0  3a 72 65 6d 61 70 73 25  |me$:....:remaps%|
00001de0  3d 31 3a 63 75 72 72 65  6e 74 25 3d 31 3a 72 65  |=1:current%=1:re|
00001df0  6d 61 70 24 28 31 29 3d  22 4b 30 30 30 bb 4b 30  |map$(1)="K000.K0|
00001e00  30 30 22 3a f2 75 70 64  61 74 65 6c 69 73 74 0d  |00":.updatelist.|
00001e10  0a fa 10 21 71 25 3d 77  68 5f 6d 61 69 6e 25 0d  |...!q%=wh_main%.|
00001e20  0b 04 3a c8 99 22 57 69  6d 70 5f 47 65 74 57 69  |..:.."Wimp_GetWi|
00001e30  6e 64 6f 77 53 74 61 74  65 22 2c 2c 71 25 3a f2  |ndowState",,q%:.|
00001e40  75 70 64 61 74 65 6c 69  6e 6b 28 71 25 2c 77 68  |updatelink(q%,wh|
00001e50  5f 6c 69 73 74 25 2c 30  29 0d 0b 0e 05 e1 0d 0b  |_list%,0).......|
00001e60  18 05 3a 0d 0b 22 11 dd  20 f2 75 70 64 61 74 65  |..:..".. .update|
00001e70  6c 69 73 74 0d 0b 2c 0f  ea 20 6c 6f 6f 70 25 2c  |list..,.. loop%,|
00001e80  69 64 25 0d 0b 36 10 69  64 25 3d 69 64 5f 64 61  |id%..6.id%=id_da|
00001e90  74 61 25 0d 0b 40 35 21  6d 69 73 63 62 25 3d 77  |ta%..@5!miscb%=w|
00001ea0  68 5f 6c 69 73 74 25 3a  c8 99 22 57 69 6d 70 5f  |h_list%:.."Wimp_|
00001eb0  47 65 74 57 69 6e 64 6f  77 49 6e 66 6f 22 2c 2c  |GetWindowInfo",,|
00001ec0  6d 69 73 63 62 25 2b 31  0d 0b 4a 21 c8 99 22 57  |miscb%+1..J!.."W|
00001ed0  69 6d 70 5f 44 65 6c 65  74 65 57 69 6e 64 6f 77  |imp_DeleteWindow|
00001ee0  22 2c 2c 6d 69 73 63 62  25 0d 0b 54 1c 6d 69 73  |",,miscb%..T.mis|
00001ef0  63 62 25 21 34 38 3d 2d  31 36 2d 35 32 2a 72 65  |cb%!48=-16-52*re|
00001f00  6d 61 70 73 25 0d 0b 5e  23 e7 20 6d 69 73 63 62  |maps%..^#. miscb|
00001f10  25 21 34 38 3e 2d 33 38  32 20 6d 69 73 63 62 25  |%!48>-382 miscb%|
00001f20  21 34 38 3d 2d 33 38 32  0d 0b 68 0f 6d 69 73 63  |!48=-382..h.misc|
00001f30  62 25 21 38 38 3d 30 0d  0b 72 2e c8 99 22 57 69  |b%!88=0..r..."Wi|
00001f40  6d 70 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 22  |mp_CreateWindow"|
00001f50  2c 2c 6d 69 73 63 62 25  2b 34 20 b8 20 77 68 5f  |,,miscb%+4 . wh_|
00001f60  6c 69 73 74 25 0d 0b 7c  17 e3 20 6c 6f 6f 70 25  |list%..|.. loop%|
00001f70  3d 31 20 b8 20 72 65 6d  61 70 73 25 0d 0b 86 16  |=1 . remaps%....|
00001f80  20 20 21 6d 69 73 63 62  25 3d 77 68 5f 6c 69 73  |  !miscb%=wh_lis|
00001f90  74 25 0d 0b 90 27 20 20  6d 69 73 63 62 25 21 34  |t%...'  miscb%!4|
00001fa0  3d 38 3a 6d 69 73 63 62  25 21 38 3d 2d 28 35 32  |=8:miscb%!8=-(52|
00001fb0  2a 6c 6f 6f 70 25 2b 38  29 0d 0b 9a 2e 20 20 6d  |*loop%+8)....  m|
00001fc0  69 73 63 62 25 21 31 32  3d 33 36 36 3a 6d 69 73  |iscb%!12=366:mis|
00001fd0  63 62 25 21 31 36 3d 2d  28 35 32 2a 6c 6f 6f 70  |cb%!16=-(52*loop|
00001fe0  25 2d 35 32 2b 38 29 0d  0b a4 18 20 20 6d 69 73  |%-52+8)....  mis|
00001ff0  63 62 25 21 32 30 3d 26  37 30 31 42 31 42 31 0d  |cb%!20=&701B1B1.|
00002000  0b ae 2b 20 20 e7 20 6c  6f 6f 70 25 3d 63 75 72  |..+  . loop%=cur|
00002010  72 65 6e 74 25 20 8c 20  6d 69 73 63 62 25 21 32  |rent% . miscb%!2|
00002020  30 2b 3d 28 31 3c 3c 32  31 29 0d 0b b8 20 20 20  |0+=(1<<21)...   |
00002030  6d 69 73 63 62 25 21 32  34 3d 69 64 25 3a 6d 69  |miscb%!24=id%:mi|
00002040  73 63 62 25 21 32 38 3d  2d 31 0d 0b c2 30 20 20  |scb%!28=-1...0  |
00002050  24 69 64 25 3d a4 74 72  61 6e 73 6c 61 74 65 28  |$id%=.translate(|
00002060  6c 6f 6f 70 25 29 3a 6d  69 73 63 62 25 21 33 32  |loop%):miscb%!32|
00002070  3d a9 28 24 69 64 25 29  2b 31 0d 0b cc 1f 20 20  |=.($id%)+1....  |
00002080  69 64 25 2b 3d 35 30 3a  f4 20 4e 42 3a 20 6d 61  |id%+=50:. NB: ma|
00002090  78 6c 65 6e 20 35 30 21  21 0d 0b d6 21 20 20 c8  |xlen 50!!...!  .|
000020a0  99 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  |."Wimp_CreateIco|
000020b0  6e 22 2c 2c 6d 69 73 63  62 25 0d 0b e0 0b ed 20  |n",,miscb%..... |
000020c0  6c 6f 6f 70 25 0d 0b ea  05 e1 0d 0b f4 05 3a 0d  |loop%.........:.|
000020d0  0b fe 1a dd 20 a4 74 72  61 6e 73 6c 61 74 65 28  |.... .translate(|
000020e0  6d 61 70 70 69 6e 67 25  29 0d 0c 08 0e ea 20 69  |mapping%)..... i|
000020f0  6e 24 2c 6f 75 74 24 0d  0c 12 18 69 6e 24 3d 72  |n$,out$....in$=r|
00002100  65 6d 61 70 24 28 6d 61  70 70 69 6e 67 25 29 0d  |emap$(mapping%).|
00002110  0c 1c 2e 6f 75 74 24 3d  a4 73 68 6f 72 74 6b 65  |...out$=.shortke|
00002120  79 6e 61 6d 65 28 a0 28  22 26 22 2b c1 69 6e 24  |yname(.("&"+.in$|
00002130  2c 32 2c 33 29 29 29 2b  22 20 89 20 22 0d 0c 26  |,2,3)))+" . "..&|
00002140  12 c8 8e 20 c1 69 6e 24  2c 36 2c 31 29 20 ca 0d  |... .in$,6,1) ..|
00002150  0c 30 31 20 20 c9 20 22  4b 22 3a 6f 75 74 24 2b  |.01  . "K":out$+|
00002160  3d a4 73 68 6f 72 74 6b  65 79 6e 61 6d 65 28 a0  |=.shortkeyname(.|
00002170  28 22 26 22 2b c1 69 6e  24 2c 37 2c 33 29 29 29  |("&"+.in$,7,3)))|
00002180  0d 0c 3a 19 20 20 c9 20  22 4d 22 3a 6f 75 74 24  |..:.  . "M":out$|
00002190  2b 3d c1 69 6e 24 2c 36  29 0d 0c 44 1a 20 20 c9  |+=.in$,6)..D.  .|
000021a0  20 22 4e 22 3a 6f 75 74  24 2b 3d 22 5b 4e 75 6c  | "N":out$+="[Nul|
000021b0  6c 5d 22 0d 0c 4e 05 cb  0d 0c 58 09 3d 6f 75 74  |l]"..N....X.=out|
000021c0  24 0d 0c 62 05 3a 0d 0c  6c 18 dd 20 a4 73 68 6f  |$..b.:..l.. .sho|
000021d0  72 74 6b 65 79 6e 61 6d  65 28 69 6e 25 29 0d 0c  |rtkeyname(in%)..|
000021e0  76 0a ea 20 6f 75 74 24  0d 0c 80 16 6f 75 74 24  |v.. out$....out$|
000021f0  3d a4 6b 65 79 6e 61 6d  65 28 69 6e 25 29 0d 0c  |=.keyname(in%)..|
00002200  8a 1a e7 20 a7 6f 75 74  24 2c 22 20 22 29 3d 30  |... .out$," ")=0|
00002210  20 8c 20 3d 6f 75 74 24  0d 0c 94 18 3d c0 6f 75  | . =out$....=.ou|
00002220  74 24 2c a7 6f 75 74 24  2c 22 20 22 29 2d 31 29  |t$,.out$," ")-1)|
00002230  0d 0c 9e 05 3a 0d 0c a8  1f dd 20 f2 73 74 72 69  |....:..... .stri|
00002240  6e 67 74 6f 77 69 6e 64  6f 77 28 6d 61 70 70 69  |ngtowindow(mappi|
00002250  6e 67 25 29 0d 0c b2 15  ea 20 6b 65 79 31 25 2c  |ng%)..... key1%,|
00002260  6b 65 79 32 25 2c 69 6e  24 0d 0c bc 18 69 6e 24  |key2%,in$....in$|
00002270  3d 72 65 6d 61 70 24 28  6d 61 70 70 69 6e 67 25  |=remap$(mapping%|
00002280  29 0d 0c c6 2f f4 20 64  75 6d 6d 79 25 3d 46 4e  |).../. dummy%=FN|
00002290  72 65 70 6f 72 74 28 53  54 52 24 28 6d 61 70 70  |report(STR$(mapp|
000022a0  69 6e 67 25 29 2b 22 2c  22 2b 69 6e 24 2c 31 29  |ing%)+","+in$,1)|
000022b0  0d 0c d0 1a 6b 65 79 31  25 3d a0 28 22 26 22 2b  |....key1%=.("&"+|
000022c0  c1 69 6e 24 2c 32 2c 33  29 29 0d 0c da 25 f2 75  |.in$,2,3))...%.u|
000022d0  70 64 61 74 65 77 69 28  77 68 5f 6d 61 69 6e 25  |pdatewi(wh_main%|
000022e0  2c 34 2c 22 26 22 2b c3  7e 6b 65 79 31 25 29 0d  |,4,"&"+.~key1%).|
000022f0  0c e4 2c f2 73 65 74 69  63 6f 6e 74 65 78 74 28  |..,.seticontext(|
00002300  77 68 5f 6d 61 69 6e 25  2c 33 2c a4 6b 65 79 6e  |wh_main%,3,.keyn|
00002310  61 6d 65 28 6b 65 79 31  25 29 29 0d 0c ee 12 c8  |ame(key1%)).....|
00002320  8e 20 c1 69 6e 24 2c 36  2c 31 29 20 ca 0d 0c f8  |. .in$,6,1) ....|
00002330  0b 20 20 c9 20 22 4b 22  0d 0d 02 27 20 20 20 20  |.  . "K"...'    |
00002340  f2 73 65 6c 28 38 2c 2d  31 29 3a f2 73 65 6c 28  |.sel(8,-1):.sel(|
00002350  37 2c 30 29 3a f2 73 65  6c 28 31 31 2c 30 29 0d  |7,0):.sel(11,0).|
00002360  0d 0c 1e 20 20 20 20 6b  65 79 32 25 3d a0 28 22  |...    key2%=.("|
00002370  26 22 2b c1 69 6e 24 2c  37 2c 33 29 29 0d 0d 16  |&"+.in$,7,3))...|
00002380  2a 20 20 20 20 f2 75 70  64 61 74 65 77 69 28 77  |*    .updatewi(w|
00002390  68 5f 6d 61 69 6e 25 2c  31 30 2c 22 26 22 2b c3  |h_main%,10,"&"+.|
000023a0  7e 6b 65 79 32 25 29 0d  0d 20 30 20 20 20 20 f2  |~key2%).. 0    .|
000023b0  73 65 74 69 63 6f 6e 74  65 78 74 28 77 68 5f 6d  |seticontext(wh_m|
000023c0  61 69 6e 25 2c 39 2c a4  6b 65 79 6e 61 6d 65 28  |ain%,9,.keyname(|
000023d0  6b 65 79 32 25 29 29 0d  0d 2a 21 20 20 20 20 f2  |key2%))..*!    .|
000023e0  75 70 64 61 74 65 77 69  28 77 68 5f 6d 61 69 6e  |updatewi(wh_main|
000023f0  25 2c 31 32 2c 22 22 29  0d 0d 34 0b 20 20 c9 20  |%,12,"")..4.  . |
00002400  22 4e 22 0d 0d 3e 27 20  20 20 20 f2 73 65 6c 28  |"N"..>'    .sel(|
00002410  37 2c 2d 31 29 3a f2 73  65 6c 28 38 2c 30 29 3a  |7,-1):.sel(8,0):|
00002420  f2 73 65 6c 28 31 31 2c  30 29 0d 0d 48 25 20 20  |.sel(11,0)..H%  |
00002430  20 20 f2 75 70 64 61 74  65 77 69 28 77 68 5f 6d  |  .updatewi(wh_m|
00002440  61 69 6e 25 2c 31 30 2c  22 26 46 46 46 22 29 0d  |ain%,10,"&FFF").|
00002450  0d 52 29 20 20 20 20 f2  73 65 74 69 63 6f 6e 74  |.R)    .seticont|
00002460  65 78 74 28 77 68 5f 6d  61 69 6e 25 2c 39 2c 22  |ext(wh_main%,9,"|
00002470  5b 4e 6f 6e 65 5d 22 29  0d 0d 5c 21 20 20 20 20  |[None]")..\!    |
00002480  f2 75 70 64 61 74 65 77  69 28 77 68 5f 6d 61 69  |.updatewi(wh_mai|
00002490  6e 25 2c 31 32 2c 22 22  29 0d 0d 66 0b 20 20 c9  |n%,12,"")..f.  .|
000024a0  20 22 4d 22 0d 0d 70 27  20 20 20 20 f2 73 65 6c  | "M"..p'    .sel|
000024b0  28 37 2c 30 29 3a f2 73  65 6c 28 38 2c 30 29 3a  |(7,0):.sel(8,0):|
000024c0  f2 73 65 6c 28 31 31 2c  2d 31 29 0d 0d 7a 25 20  |.sel(11,-1)..z% |
000024d0  20 20 20 f2 75 70 64 61  74 65 77 69 28 77 68 5f  |   .updatewi(wh_|
000024e0  6d 61 69 6e 25 2c 31 30  2c 22 26 46 46 46 22 29  |main%,10,"&FFF")|
000024f0  0d 0d 84 29 20 20 20 20  f2 73 65 74 69 63 6f 6e  |...)    .seticon|
00002500  74 65 78 74 28 77 68 5f  6d 61 69 6e 25 2c 39 2c  |text(wh_main%,9,|
00002510  22 5b 4e 6f 6e 65 5d 22  29 0d 0d 8e 26 20 20 20  |"[None]")...&   |
00002520  20 f2 75 70 64 61 74 65  77 69 28 77 68 5f 6d 61  | .updatewi(wh_ma|
00002530  69 6e 25 2c 31 32 2c c1  69 6e 24 2c 37 29 29 0d  |in%,12,.in$,7)).|
00002540  0d 98 05 cb 0d 0d a2 05  e1 0d 0d ac 05 3a 0d 0d  |.............:..|
00002550  b6 1f dd 20 f2 77 69 6e  64 6f 77 74 6f 73 74 72  |... .windowtostr|
00002560  69 6e 67 28 6d 61 70 70  69 6e 67 25 29 0d 0d c0  |ing(mapping%)...|
00002570  10 ea 20 74 79 70 65 25  2c 6f 75 74 24 0d 0d ca  |.. type%,out$...|
00002580  1e 74 79 70 65 25 3d a4  73 65 6c 5f 65 73 67 28  |.type%=.sel_esg(|
00002590  77 68 5f 6d 61 69 6e 25  2c 31 29 0d 0d d4 33 6f  |wh_main%,1)...3o|
000025a0  75 74 24 3d 22 4b 22 2b  a4 73 74 72 28 a4 65 76  |ut$="K"+.str(.ev|
000025b0  61 6c 28 24 28 a4 69 6e  64 69 72 28 77 68 5f 6d  |al($(.indir(wh_m|
000025c0  61 69 6e 25 2c 34 29 29  29 29 2b 22 bb 22 0d 0d  |ain%,4))))+"."..|
000025d0  de 0e c8 8e 20 74 79 70  65 25 20 ca 0d 0d e8 16  |.... type% .....|
000025e0  20 20 c9 20 2d 31 2c 37  3a 6f 75 74 24 2b 3d 22  |  . -1,7:out$+="|
000025f0  4e 22 0d 0d f2 3b 20 20  c9 20 38 3a 6f 75 74 24  |N"...;  . 8:out$|
00002600  3d 6f 75 74 24 2b 22 4b  22 2b a4 73 74 72 28 a4  |=out$+"K"+.str(.|
00002610  65 76 61 6c 28 24 28 a4  69 6e 64 69 72 28 77 68  |eval($(.indir(wh|
00002620  5f 6d 61 69 6e 25 2c 31  30 29 29 29 29 0d 0d fc  |_main%,10))))...|
00002630  2f 20 20 c9 20 31 31 3a  6f 75 74 24 3d 6f 75 74  |/  . 11:out$=out|
00002640  24 2b 22 4d 22 2b 24 28  a4 69 6e 64 69 72 28 77  |$+"M"+$(.indir(w|
00002650  68 5f 6d 61 69 6e 25 2c  31 32 29 29 0d 0e 06 05  |h_main%,12))....|
00002660  cb 0d 0e 10 19 72 65 6d  61 70 24 28 6d 61 70 70  |.....remap$(mapp|
00002670  69 6e 67 25 29 3d 6f 75  74 24 0d 0e 1a 3a f2 73  |ing%)=out$...:.s|
00002680  65 74 69 63 6f 6e 74 65  78 74 28 77 68 5f 6c 69  |eticontext(wh_li|
00002690  73 74 25 2c 6d 61 70 70  69 6e 67 25 2d 31 2c a4  |st%,mapping%-1,.|
000026a0  74 72 61 6e 73 6c 61 74  65 28 6d 61 70 70 69 6e  |translate(mappin|
000026b0  67 25 29 29 0d 0e 24 05  e1 0d 0e 2e 05 3a 0d 0e  |g%))..$......:..|
000026c0  38 10 dd 20 a4 65 76 61  6c 28 69 6e 24 29 0d 0e  |8.. .eval(in$)..|
000026d0  42 15 ee 20 85 20 ea 20  3d a0 28 22 26 22 2b 69  |B.. . . =.("&"+i|
000026e0  6e 24 29 0d 0e 4c 0b 3d  a0 28 69 6e 24 29 0d 0e  |n$)..L.=.(in$)..|
000026f0  56 05 3a 0d 0e 60 0f dd  20 a4 73 74 72 28 69 6e  |V.:..`.. .str(in|
00002700  25 29 0d 0e 6a 1b 3d c4  33 2d a9 28 c3 7e 69 6e  |%)..j.=.3-.(.~in|
00002710  25 29 2c 22 30 22 29 2b  c3 7e 69 6e 25 0d 0e 74  |%),"0")+.~in%..t|
00002720  05 3a 0d 0e 7e 15 dd 20  f2 73 65 6c 28 69 68 25  |.:..~.. .sel(ih%|
00002730  2c 66 6c 61 67 25 29 0d  0e 88 21 21 6d 69 73 63  |,flag%)...!!misc|
00002740  62 25 3d 77 68 5f 6d 61  69 6e 25 3a 6d 69 73 63  |b%=wh_main%:misc|
00002750  62 25 21 34 3d 69 68 25  0d 0e 92 1b 6d 69 73 63  |b%!4=ih%....misc|
00002760  62 25 21 38 3d 28 31 3c  3c 32 31 29 80 20 66 6c  |b%!8=(1<<21). fl|
00002770  61 67 25 0d 0e 9c 13 6d  69 73 63 62 25 21 31 32  |ag%....miscb%!12|
00002780  3d 31 3c 3c 32 31 0d 0e  a6 21 c8 99 22 57 69 6d  |=1<<21...!.."Wim|
00002790  70 5f 53 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_SetIconState",|
000027a0  2c 6d 69 73 63 62 25 0d  0e b0 05 e1 0d 0e ba 05  |,miscb%.........|
000027b0  3a 0d 0e c4 12 dd 20 f2  73 68 6f 77 63 75 72 72  |:..... .showcurr|
000027c0  65 6e 74 0d 0e ce 0f ea  20 74 25 2c 62 25 2c 72  |ent..... t%,b%,r|
000027d0  65 25 0d 0e d8 34 21 6d  69 73 63 62 25 3d 77 68  |e%...4!miscb%=wh|
000027e0  5f 6c 69 73 74 25 3a c8  99 22 57 69 6d 70 5f 47  |_list%:.."Wimp_G|
000027f0  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00002800  6d 69 73 63 62 25 0d 0e  e2 2f 74 25 3d 2d 38 2d  |miscb%.../t%=-8-|
00002810  35 32 2a 28 63 75 72 72  65 6e 74 25 2d 31 29 3a  |52*(current%-1):|
00002820  62 25 3d 2d 38 2d 35 32  2a 63 75 72 72 65 6e 74  |b%=-8-52*current|
00002830  25 2b 33 38 32 0d 0e ec  27 e7 20 74 25 3e 6d 69  |%+382...'. t%>mi|
00002840  73 63 62 25 21 32 34 20  8c 20 6d 69 73 63 62 25  |scb%!24 . miscb%|
00002850  21 32 34 3d 74 25 3a 72  65 25 3d b9 0d 0e f6 27  |!24=t%:re%=....'|
00002860  e7 20 62 25 3c 6d 69 73  63 62 25 21 32 34 20 8c  |. b%<miscb%!24 .|
00002870  20 6d 69 73 63 62 25 21  32 34 3d 62 25 3a 72 65  | miscb%!24=b%:re|
00002880  25 3d b9 0d 0f 00 29 e7  20 72 65 25 3d b9 20 8c  |%=....). re%=. .|
00002890  20 c8 99 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  | .."Wimp_OpenWin|
000028a0  64 6f 77 22 2c 2c 6d 69  73 63 62 25 0d 0f 0a 05  |dow",,miscb%....|
000028b0  e1 0d 0f 14 05 3a 0d 0f  1e 43 f4 20 3d 3d 3d 3d  |.....:...C. ====|
000028c0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000028f0  3d 3d 3d 3d 3d 3d 3d 3d  3d 0d 0f 28 05 3a 0d 0f  |=========..(.:..|
00002900  32 15 dd 20 f2 73 74 61  72 74 64 72 61 67 28 77  |2.. .startdrag(w|
00002910  68 25 29 0d 0f 3c 13 ea  20 78 6f 72 69 67 25 2c  |h%)..<.. xorig%,|
00002920  79 6f 72 69 67 25 0d 0f  46 0f 21 6d 69 73 63 62  |yorig%..F.!miscb|
00002930  25 3d 77 68 25 0d 0f 50  23 c8 99 22 57 69 6d 70  |%=wh%..P#.."Wimp|
00002940  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
00002950  2c 2c 6d 69 73 63 62 25  0d 0f 5a 1d 78 6f 72 69  |,,miscb%..Z.xori|
00002960  67 25 3d 6d 69 73 63 62  25 21 34 2d 6d 69 73 63  |g%=miscb%!4-misc|
00002970  62 25 21 32 30 0d 0f 64  1e 79 6f 72 69 67 25 3d  |b%!20..d.yorig%=|
00002980  6d 69 73 63 62 25 21 31  36 2d 6d 69 73 63 62 25  |miscb%!16-miscb%|
00002990  21 32 34 0d 0f 6e 0e 6d  69 73 63 62 25 21 34 3d  |!24..n.miscb%!4=|
000029a0  33 0d 0f 78 21 c8 99 22  57 69 6d 70 5f 47 65 74  |3..x!.."Wimp_Get|
000029b0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 6d 69 73 63  |IconState",,misc|
000029c0  62 25 0d 0f 82 14 e7 20  a4 73 6f 6c 69 64 64 72  |b%..... .soliddr|
000029d0  61 67 3d b9 20 8c 0d 0f  8c 37 20 20 21 6d 69 73  |ag=. ....7  !mis|
000029e0  63 62 25 3d 78 6f 72 69  67 25 2b 6d 69 73 63 62  |cb%=xorig%+miscb|
000029f0  25 21 38 3a 6d 69 73 63  62 25 21 34 3d 79 6f 72  |%!8:miscb%!4=yor|
00002a00  69 67 25 2b 6d 69 73 63  62 25 21 31 32 0d 0f 96  |ig%+miscb%!12...|
00002a10  3a 20 20 6d 69 73 63 62  25 21 38 3d 78 6f 72 69  |:  miscb%!8=xori|
00002a20  67 25 2b 6d 69 73 63 62  25 21 31 36 3a 6d 69 73  |g%+miscb%!16:mis|
00002a30  63 62 25 21 31 32 3d 79  6f 72 69 67 25 2b 6d 69  |cb%!12=yorig%+mi|
00002a40  73 63 62 25 21 32 30 0d  0f a0 45 20 20 c8 99 22  |scb%!20...E  .."|
00002a50  44 72 61 67 41 53 70 72  69 74 65 5f 53 74 61 72  |DragASprite_Star|
00002a60  74 22 2c 25 31 30 30 30  30 31 30 31 2c 31 2c 73  |t",%10000101,1,s|
00002a70  61 76 65 73 70 72 69 74  65 24 28 73 61 76 65 74  |avesprite$(savet|
00002a80  79 70 65 25 29 2c 6d 69  73 63 62 25 0d 0f aa 06  |ype%),miscb%....|
00002a90  20 cc 0d 0f b4 29 20 20  6d 69 73 63 62 25 21 34  | ....)  miscb%!4|
00002aa0  3d 35 3a 6d 69 73 63 62  25 21 38 3d 78 6f 72 69  |=5:miscb%!8=xori|
00002ab0  67 25 2b 6d 69 73 63 62  25 21 38 0d 0f be 3b 20  |g%+miscb%!8...; |
00002ac0  20 6d 69 73 63 62 25 21  31 32 3d 6d 69 73 63 62  | miscb%!12=miscb|
00002ad0  25 21 31 32 2b 79 6f 72  69 67 25 3a 6d 69 73 63  |%!12+yorig%:misc|
00002ae0  62 25 21 31 36 3d 6d 69  73 63 62 25 21 31 36 2b  |b%!16=miscb%!16+|
00002af0  78 6f 72 69 67 25 0d 0f  c8 2c 20 20 6d 69 73 63  |xorig%...,  misc|
00002b00  62 25 21 32 30 3d 6d 69  73 63 62 25 21 32 30 2b  |b%!20=miscb%!20+|
00002b10  79 6f 72 69 67 25 3a 6d  69 73 63 62 25 21 32 34  |yorig%:miscb%!24|
00002b20  3d 30 0d 0f d2 39 20 20  6d 69 73 63 62 25 21 32  |=0...9  miscb%!2|
00002b30  38 3d 30 3a 6d 69 73 63  62 25 21 33 32 3d 26 37  |8=0:miscb%!32=&7|
00002b40  66 66 66 66 66 66 66 3a  6d 69 73 63 62 25 21 33  |fffffff:miscb%!3|
00002b50  36 3d 26 37 66 66 66 66  66 66 66 0d 0f dc 1e 20  |6=&7fffffff.... |
00002b60  20 c8 99 22 57 69 6d 70  5f 44 72 61 67 42 6f 78  | .."Wimp_DragBox|
00002b70  22 2c 2c 6d 69 73 63 62  25 0d 0f e6 05 cd 0d 0f  |",,miscb%.......|
00002b80  f0 05 e1 0d 0f fa 05 3a  0d 10 04 10 dd 20 a4 73  |.......:..... .s|
00002b90  6f 6c 69 64 64 72 61 67  0d 10 0e 0b ea 20 62 79  |oliddrag..... by|
00002ba0  74 65 25 0d 10 18 20 c8  99 22 4f 53 5f 42 79 74  |te%... .."OS_Byt|
00002bb0  65 22 2c 31 36 31 2c 32  38 20 b8 20 2c 2c 62 79  |e",161,28 . ,,by|
00002bc0  74 65 25 0d 10 22 1b e7  20 28 62 79 74 65 25 80  |te%..".. (byte%.|
00002bd0  32 29 3d 32 20 8c 20 3d  b9 20 8b 20 3d a3 0d 10  |2)=2 . =. . =...|
00002be0  2c 05 3a 0d 10 36 0f dd  20 f2 73 74 6f 70 64 72  |,.:..6.. .stopdr|
00002bf0  61 67 0d 10 40 0b ea 20  6c 65 61 66 24 0d 10 4a  |ag..@.. leaf$..J|
00002c00  19 c8 99 22 58 44 72 61  67 41 53 70 72 69 74 65  |..."XDragASprite|
00002c10  5f 53 74 6f 70 22 0d 10  54 1b c8 99 22 57 69 6d  |_Stop"..T..."Wim|
00002c20  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 2d  |p_CreateMenu",,-|
00002c30  31 0d 10 5e 23 c8 99 22  57 69 6d 70 5f 47 65 74  |1..^#.."Wimp_Get|
00002c40  50 6f 69 6e 74 65 72 49  6e 66 6f 22 2c 2c 6d 69  |PointerInfo",,mi|
00002c50  73 63 62 25 0d 10 68 40  71 25 21 32 30 3d 6d 69  |scb%..h@q%!20=mi|
00002c60  73 63 62 25 21 31 32 3a  71 25 21 32 34 3d 6d 69  |scb%!12:q%!24=mi|
00002c70  73 63 62 25 21 31 36 3a  71 25 21 32 38 3d 21 6d  |scb%!16:q%!28=!m|
00002c80  69 73 63 62 25 3a 71 25  21 33 32 3d 6d 69 73 63  |iscb%:q%!32=misc|
00002c90  62 25 21 34 0d 10 72 26  71 25 21 33 36 3d 32 35  |b%!4..r&q%!36=25|
00002ca0  36 3a 71 25 21 34 30 3d  73 61 76 65 66 74 25 28  |6:q%!40=saveft%(|
00002cb0  73 61 76 65 74 79 70 65  25 29 0d 10 7c 34 6c 65  |savetype%)..|4le|
00002cc0  61 66 24 3d a4 6c 65 61  66 6e 61 6d 65 28 24 28  |af$=.leafname($(|
00002cd0  a4 69 6e 64 69 72 28 73  61 76 65 77 68 25 28 73  |.indir(savewh%(s|
00002ce0  61 76 65 74 79 70 65 25  29 2c 32 29 29 29 0d 10  |avetype%),2)))..|
00002cf0  86 25 24 28 71 25 2b 34  34 29 3d 6c 65 61 66 24  |.%$(q%+44)=leaf$|
00002d00  2b bd 30 3a 71 25 21 31  36 3d 31 3a 71 25 21 31  |+.0:q%!16=1:q%!1|
00002d10  32 3d 30 0d 10 90 1b 21  71 25 3d 28 28 34 38 2b  |2=0....!q%=((48+|
00002d20  a9 28 6c 65 61 66 24 29  29 81 34 29 2a 34 0d 10  |.(leaf$)).4)*4..|
00002d30  9a 2a c8 99 22 57 69 6d  70 5f 53 65 6e 64 4d 65  |.*.."Wimp_SendMe|
00002d40  73 73 61 67 65 22 2c 31  38 2c 71 25 2c 71 25 21  |ssage",18,q%,q%!|
00002d50  32 30 2c 71 25 21 32 34  0d 10 a4 05 e1 0d 10 ae  |20,q%!24........|
00002d60  05 3a 0d 10 b8 19 dd 20  f2 64 6f 5f 73 61 76 65  |.:..... .do_save|
00002d70  28 66 69 6c 65 6e 61 6d  65 24 29 0d 10 c2 12 c8  |(filename$).....|
00002d80  8e 20 73 61 76 65 74 79  70 65 25 20 ca 0d 10 cc  |. savetype% ....|
00002d90  1f 20 20 c9 20 31 3a f2  73 61 76 65 5f 64 61 74  |.  . 1:.save_dat|
00002da0  61 28 66 69 6c 65 6e 61  6d 65 24 29 0d 10 d6 1e  |a(filename$)....|
00002db0  20 20 c9 20 32 3a f2 61  73 73 65 6d 62 6c 65 28  |  . 2:.assemble(|
00002dc0  66 69 6c 65 6e 61 6d 65  24 29 0d 10 e0 05 cb 0d  |filename$)......|
00002dd0  10 ea 05 e1 0d 10 f4 05  3a 0d 10 fe 14 dd 20 a4  |........:..... .|
00002de0  6c 65 61 66 6e 61 6d 65  28 69 6e 24 29 0d 11 08  |leafname(in$)...|
00002df0  0f ea 20 6f 75 74 24 2c  70 6f 73 25 0d 11 12 0f  |.. out$,pos%....|
00002e00  70 6f 73 25 3d a9 28 69  6e 24 29 0d 11 1c 21 c8  |pos%=.(in$)...!.|
00002e10  95 20 c1 69 6e 24 2c 70  6f 73 25 2c 31 29 3c 3e  |. .in$,pos%,1)<>|
00002e20  22 2e 22 20 80 20 70 6f  73 25 3e 30 0d 11 26 0d  |"." . pos%>0..&.|
00002e30  70 6f 73 25 2d 3d 31 3a  ce 0d 11 30 11 3d c1 69  |pos%-=1:...0.=.i|
00002e40  6e 24 2c 70 6f 73 25 2b  31 29 0d 11 3a 05 3a 0d  |n$,pos%+1)..:.:.|
00002e50  11 44 10 dd 20 f2 71 75  69 63 6b 73 61 76 65 0d  |.D.. .quicksave.|
00002e60  11 4e 2f e7 20 a7 24 28  a4 69 6e 64 69 72 28 73  |.N/. .$(.indir(s|
00002e70  61 76 65 77 68 25 28 73  61 76 65 74 79 70 65 25  |avewh%(savetype%|
00002e80  29 2c 32 29 29 2c 22 2e  22 29 3d 30 20 8c 0d 11  |),2)),".")=0 ...|
00002e90  58 42 20 20 64 25 3d a4  72 65 70 6f 72 74 28 22  |XB  d%=.report("|
00002ea0  54 6f 20 73 61 76 65 2c  20 64 72 61 67 20 74 68  |To save, drag th|
00002eb0  65 20 69 63 6f 6e 20 74  6f 20 61 20 64 69 72 65  |e icon to a dire|
00002ec0  63 74 6f 72 79 20 76 69  65 77 65 72 22 2c 31 29  |ctory viewer",1)|
00002ed0  0d 11 62 06 20 cc 0d 11  6c 2f 20 20 f2 64 6f 5f  |..b. ...l/  .do_|
00002ee0  73 61 76 65 28 24 28 a4  69 6e 64 69 72 28 73 61  |save($(.indir(sa|
00002ef0  76 65 77 68 25 28 73 61  76 65 74 79 70 65 25 29  |vewh%(savetype%)|
00002f00  2c 32 29 29 29 0d 11 6d  1d 20 20 c8 99 22 57 69  |,2)))..m.  .."Wi|
00002f10  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 2c 2c  |mp_CreateMenu",,|
00002f20  2d 31 0d 11 76 05 cd 0d  11 80 05 e1 0d 11 8a 05  |-1..v...........|
00002f30  3a 0d 11 94 1b dd 20 f2  73 61 76 65 5f 64 61 74  |:..... .save_dat|
00002f40  61 28 66 69 6c 65 6e 61  6d 65 24 29 0d 11 9e 0f  |a(filename$)....|
00002f50  ea 20 66 68 25 2c 6c 6f  6f 70 25 0d 11 a8 14 66  |. fh%,loop%....f|
00002f60  68 25 3d ae 28 66 69 6c  65 6e 61 6d 65 24 29 0d  |h%=.(filename$).|
00002f70  11 b2 32 d5 23 66 68 25  2c 22 54 68 69 73 20 69  |..2.#fh%,"This i|
00002f80  73 20 61 20 4b 65 79 46  69 6c 74 65 72 20 66 69  |s a KeyFilter fi|
00002f90  6c 65 2e 20 56 65 72 73  69 6f 6e 20 31 2e 30 30  |le. Version 1.00|
00002fa0  22 0d 11 bc 14 d5 23 66  68 25 2c c3 28 72 65 6d  |".....#fh%,.(rem|
00002fb0  61 70 73 25 29 0d 11 c6  23 d5 23 66 68 25 2c a4  |aps%)...#.#fh%,.|
00002fc0  63 74 73 28 a4 69 6e 64  69 72 28 77 68 5f 6d 61  |cts(.indir(wh_ma|
00002fd0  69 6e 25 2c 31 37 29 29  0d 11 d0 23 d5 23 66 68  |in%,17))...#.#fh|
00002fe0  25 2c a4 63 74 73 28 a4  69 6e 64 69 72 28 77 68  |%,.cts(.indir(wh|
00002ff0  5f 6d 61 69 6e 25 2c 31  39 29 29 0d 11 da 17 e3  |_main%,19)).....|
00003000  20 6c 6f 6f 70 25 3d 31  20 b8 20 72 65 6d 61 70  | loop%=1 . remap|
00003010  73 25 0d 11 e4 19 20 20  d5 23 66 68 25 2c 72 65  |s%....  .#fh%,re|
00003020  6d 61 70 24 28 6c 6f 6f  70 25 29 0d 11 ee 0b ed  |map$(loop%).....|
00003030  20 6c 6f 6f 70 25 0d 11  f8 09 d9 23 66 68 25 0d  | loop%.....#fh%.|
00003040  12 02 05 e1 0d 12 0c 05  3a 0d 12 16 1b dd 20 f2  |........:..... .|
00003050  6c 6f 61 64 5f 64 61 74  61 28 66 69 6c 65 6e 61  |load_data(filena|
00003060  6d 65 24 29 0d 12 20 13  ea 20 66 68 25 2c 6c 6f  |me$).. .. fh%,lo|
00003070  6f 70 25 2c 69 6e 24 0d  12 2a 14 66 68 25 3d 8e  |op%,in$..*.fh%=.|
00003080  28 66 69 6c 65 6e 61 6d  65 24 29 0d 12 34 0d 69  |(filename$)..4.i|
00003090  6e 24 3d be 23 66 68 25  0d 12 3e 92 e7 20 69 6e  |n$=.#fh%..>.. in|
000030a0  24 3c 3e 22 54 68 69 73  20 69 73 20 61 20 4b 65  |$<>"This is a Ke|
000030b0  79 46 69 6c 74 65 72 20  66 69 6c 65 2e 20 56 65  |yFilter file. Ve|
000030c0  72 73 69 6f 6e 20 31 2e  30 30 22 20 8c 20 d9 23  |rsion 1.00" . .#|
000030d0  66 68 25 3a 64 75 6d 6d  79 25 3d a4 72 65 70 6f  |fh%:dummy%=.repo|
000030e0  72 74 28 22 54 68 69 73  20 64 6f 65 73 6e 27 74  |rt("This doesn't|
000030f0  20 6c 6f 6f 6b 20 6c 69  6b 65 20 61 20 4b 65 79  | look like a Key|
00003100  46 69 6c 74 65 72 20 66  69 6c 65 2e 20 49 27 6d  |Filter file. I'm|
00003110  20 67 6f 69 6e 67 20 74  6f 20 69 67 6e 6f 72 65  | going to ignore|
00003120  20 69 74 2e 22 2c 32 29  3a e1 0d 12 48 14 72 65  | it.",2):...H.re|
00003130  6d 61 70 73 25 3d bb 28  be 23 66 68 25 29 0d 12  |maps%=.(.#fh%)..|
00003140  52 20 f2 75 70 64 61 74  65 77 69 28 77 68 5f 6d  |R .updatewi(wh_m|
00003150  61 69 6e 25 2c 31 37 2c  be 23 66 68 25 29 0d 12  |ain%,17,.#fh%)..|
00003160  5c 20 f2 75 70 64 61 74  65 77 69 28 77 68 5f 6d  |\ .updatewi(wh_m|
00003170  61 69 6e 25 2c 31 39 2c  be 23 66 68 25 29 0d 12  |ain%,19,.#fh%)..|
00003180  66 17 e3 20 6c 6f 6f 70  25 3d 31 20 b8 20 72 65  |f.. loop%=1 . re|
00003190  6d 61 70 73 25 0d 12 70  19 20 20 72 65 6d 61 70  |maps%..p.  remap|
000031a0  24 28 6c 6f 6f 70 25 29  3d be 23 66 68 25 0d 12  |$(loop%)=.#fh%..|
000031b0  7a 0b ed 20 6c 6f 6f 70  25 0d 12 84 09 d9 23 66  |z.. loop%.....#f|
000031c0  68 25 0d 12 8e 29 f2 73  65 74 69 63 6f 6e 74 65  |h%...).seticonte|
000031d0  78 74 28 77 68 5f 73 61  76 65 64 61 74 25 2c 32  |xt(wh_savedat%,2|
000031e0  2c 66 69 6c 65 6e 61 6d  65 24 29 0d 12 8f 3b f2  |,filename$)...;.|
000031f0  73 65 74 69 63 6f 6e 74  65 78 74 28 77 68 5f 73  |seticontext(wh_s|
00003200  61 76 65 6d 6f 64 25 2c  32 2c c0 24 28 a4 69 6e  |avemod%,2,.$(.in|
00003210  64 69 72 28 77 68 5f 6d  61 69 6e 25 2c 31 37 29  |dir(wh_main%,17)|
00003220  29 2c 31 30 29 29 0d 12  98 0e 63 75 72 72 65 6e  |),10))....curren|
00003230  74 25 3d 31 0d 12 a2 0f  f2 75 70 64 61 74 65 6c  |t%=1.....updatel|
00003240  69 73 74 0d 12 ac 1b f2  79 73 63 72 6f 6c 6c 5f  |ist.....yscroll_|
00003250  7a 65 72 6f 28 77 68 5f  6c 69 73 74 25 29 0d 12  |zero(wh_list%)..|
00003260  b6 2c 21 71 25 3d 77 68  5f 6d 61 69 6e 25 3a c8  |.,!q%=wh_main%:.|
00003270  99 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  |."Wimp_GetWindow|
00003280  53 74 61 74 65 22 2c 2c  71 25 0d 12 c0 1e f2 75  |State",,q%.....u|
00003290  70 64 61 74 65 6c 69 6e  6b 28 71 25 2c 77 68 5f  |pdatelink(q%,wh_|
000032a0  6c 69 73 74 25 2c 30 29  0d 12 ca 1d f2 73 74 72  |list%,0).....str|
000032b0  69 6e 67 74 6f 77 69 6e  64 6f 77 28 63 75 72 72  |ingtowindow(curr|
000032c0  65 6e 74 25 29 0d 12 d4  05 e1 0d 12 de 05 3a 0d  |ent%).........:.|
000032d0  12 e8 43 f4 20 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |..C. ===========|
000032e0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00003310  3d 3d 0d 12 f2 05 3a 0d  12 fc 1a dd 20 f2 61 73  |==....:..... .as|
00003320  73 65 6d 62 6c 65 28 66  69 6c 65 6e 61 6d 65 24  |semble(filename$|
00003330  29 0d 13 06 19 ea 20 66  69 6c 74 6e 61 6d 65 24  |)..... filtname$|
00003340  2c 74 61 73 6b 6e 61 6d  65 24 0d 13 10 24 66 69  |,taskname$...$fi|
00003350  6c 74 6e 61 6d 65 24 3d  24 28 a4 69 6e 64 69 72  |ltname$=$(.indir|
00003360  28 77 68 5f 6d 61 69 6e  25 2c 31 37 29 29 0d 13  |(wh_main%,17))..|
00003370  1a 24 74 61 73 6b 6e 61  6d 65 24 3d 24 28 a4 69  |.$taskname$=$(.i|
00003380  6e 64 69 72 28 77 68 5f  6d 61 69 6e 25 2c 31 39  |ndir(wh_main%,19|
00003390  29 29 0d 13 24 12 74 61  73 6b 68 61 6e 64 6c 65  |))..$.taskhandle|
000033a0  3d 32 36 30 0d 13 2e 11  68 69 73 5f 74 61 73 6b  |=260....his_task|
000033b0  68 3d 32 36 34 0d 13 38  17 e3 20 70 61 73 73 25  |h=264..8.. pass%|
000033c0  3d 31 32 20 b8 20 31 34  20 88 20 32 0d 13 42 23  |=12 . 14 . 2..B#|
000033d0  50 25 3d 30 3a 4f 25 3d  63 6f 64 65 25 3a 4c 25  |P%=0:O%=code%:L%|
000033e0  3d 63 6f 64 65 25 2b 6d  61 78 63 6f 64 65 25 0d  |=code%+maxcode%.|
000033f0  13 4c 0e 5b 4f 50 54 20  70 61 73 73 25 0d 13 56  |.L.[OPT pass%..V|
00003400  1c 20 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |.          EQUD |
00003410  53 74 61 72 74 43 6f 64  65 0d 13 60 1b 20 20 20  |StartCode..`.   |
00003420  20 20 20 20 20 20 20 45  51 55 44 20 49 6e 69 74  |       EQUD Init|
00003430  43 6f 64 65 0d 13 6a 1c  20 20 20 20 20 20 20 20  |Code..j.        |
00003440  20 20 45 51 55 44 20 46  69 6e 61 6c 43 6f 64 65  |  EQUD FinalCode|
00003450  0d 13 74 1e 20 20 20 20  20 20 20 20 20 20 45 51  |..t.          EQ|
00003460  55 44 20 53 65 72 76 69  63 65 43 6f 64 65 0d 13  |UD ServiceCode..|
00003470  7e 1e 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |~.          EQUD|
00003480  20 54 69 74 6c 65 53 74  72 69 6e 67 0d 13 88 1d  | TitleString....|
00003490  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 48  |          EQUD H|
000034a0  65 6c 70 53 74 72 69 6e  67 0d 13 92 1c 20 20 20  |elpString....   |
000034b0  20 20 20 20 20 20 20 45  51 55 44 20 48 65 6c 70  |       EQUD Help|
000034c0  54 61 62 6c 65 0d 13 9c  2a 20 20 20 20 20 20 20  |Table...*       |
000034d0  20 20 20 45 51 55 44 20  30 20 20 20 20 5c 20 53  |   EQUD 0    \ S|
000034e0  57 49 20 63 68 75 6e 6b  20 6e 75 6d 62 65 72 0d  |WI chunk number.|
000034f0  13 a6 25 20 20 20 20 20  20 20 20 20 20 45 51 55  |..%          EQU|
00003500  44 20 30 20 20 20 20 5c  20 53 57 49 20 68 61 6e  |D 0    \ SWI han|
00003510  64 6c 65 72 0d 13 b0 2a  20 20 20 20 20 20 20 20  |dler...*        |
00003520  20 20 45 51 55 44 20 30  20 20 20 20 5c 20 53 57  |  EQUD 0    \ SW|
00003530  49 20 64 65 63 6f 64 65  20 74 61 62 6c 65 0d 13  |I decode table..|
00003540  ba 29 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |.)          EQUD|
00003550  20 30 20 20 20 20 5c 20  53 57 49 20 64 65 63 6f  | 0    \ SWI deco|
00003560  64 65 20 63 6f 64 65 0d  13 c4 10 2e 54 69 74 6c  |de code.....Titl|
00003570  65 53 74 72 69 6e 67 0d  13 ce 1c 20 20 20 20 20  |eString....     |
00003580  20 20 20 20 20 45 51 55  53 20 66 69 6c 74 6e 61  |     EQUS filtna|
00003590  6d 65 24 0d 13 d8 14 20  20 20 20 20 20 20 20 20  |me$....         |
000035a0  20 45 51 55 42 20 30 0d  13 e2 13 20 20 20 20 20  | EQUB 0....     |
000035b0  20 20 20 20 20 41 4c 49  47 4e 0d 13 ec 0f 2e 48  |     ALIGN.....H|
000035c0  65 6c 70 53 74 72 69 6e  67 0d 13 f6 1c 20 20 20  |elpString....   |
000035d0  20 20 20 20 20 20 20 45  51 55 53 20 66 69 6c 74  |       EQUS filt|
000035e0  6e 61 6d 65 24 0d 14 00  14 20 20 20 20 20 20 20  |name$....       |
000035f0  20 20 20 45 51 55 42 20  39 0d 14 0a 25 20 20 20  |   EQUB 9...%   |
00003600  20 20 20 20 20 20 20 45  51 55 53 20 22 41 73 73  |       EQUS "Ass|
00003610  65 6d 62 6c 65 64 20 22  2b a4 64 61 74 65 0d 14  |embled "+.date..|
00003620  14 15 20 20 20 20 20 20  20 20 20 20 45 51 55 42  |..          EQUB|
00003630  20 31 33 0d 14 1e 45 20  20 20 20 20 20 20 20 20  | 13...E         |
00003640  20 45 51 55 53 20 22 50  72 6f 64 75 63 65 64 20  | EQUS "Produced |
00003650  75 73 69 6e 67 20 4b 65  79 46 69 6c 74 65 72 20  |using KeyFilter |
00003660  31 2e 30 30 20 66 6f 72  20 22 2b 74 61 73 6b 6e  |1.00 for "+taskn|
00003670  61 6d 65 24 2b 22 2e 22  0d 14 28 14 20 20 20 20  |ame$+"."..(.    |
00003680  20 20 20 20 20 20 45 51  55 42 20 30 0d 14 32 13  |      EQUB 0..2.|
00003690  20 20 20 20 20 20 20 20  20 20 41 4c 49 47 4e 0d  |          ALIGN.|
000036a0  14 3c 0e 2e 48 65 6c 70  54 61 62 6c 65 0d 14 46  |.<..HelpTable..F|
000036b0  27 20 20 20 20 20 20 20  20 20 20 45 51 55 53 20  |'          EQUS |
000036c0  22 44 65 73 6b 74 6f 70  5f 22 2b 66 69 6c 74 6e  |"Desktop_"+filtn|
000036d0  61 6d 65 24 0d 14 50 14  20 20 20 20 20 20 20 20  |ame$..P.        |
000036e0  20 20 45 51 55 42 20 30  0d 14 5a 13 20 20 20 20  |  EQUB 0..Z.    |
000036f0  20 20 20 20 20 20 41 4c  49 47 4e 0d 14 64 1e 20  |      ALIGN..d. |
00003700  20 20 20 20 20 20 20 20  20 45 51 55 44 20 53 74  |         EQUD St|
00003710  61 72 43 6f 6d 6d 61 6e  64 0d 14 6e 14 20 20 20  |arCommand..n.   |
00003720  20 20 20 20 20 20 20 45  51 55 44 20 30 0d 14 78  |       EQUD 0..x|
00003730  14 20 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |.          EQUD |
00003740  30 0d 14 82 1b 20 20 20  20 20 20 20 20 20 20 45  |0....          E|
00003750  51 55 44 20 64 6f 6e 6f  74 75 73 65 0d 14 8c 1c  |QUD donotuse....|
00003760  20 20 20 20 20 20 20 20  20 20 45 51 55 53 20 66  |          EQUS f|
00003770  69 6c 74 6e 61 6d 65 24  0d 14 96 14 20 20 20 20  |iltname$....    |
00003780  20 20 20 20 20 20 45 51  55 42 20 30 0d 14 a0 13  |      EQUB 0....|
00003790  20 20 20 20 20 20 20 20  20 20 41 4c 49 47 4e 0d  |          ALIGN.|
000037a0  14 aa 14 20 20 20 20 20  20 20 20 20 20 45 51 55  |...          EQU|
000037b0  44 20 30 0d 14 b4 14 20  20 20 20 20 20 20 20 20  |D 0....         |
000037c0  20 45 51 55 44 20 30 0d  14 be 14 20 20 20 20 20  | EQUD 0....     |
000037d0  20 20 20 20 20 45 51 55  44 20 30 0d 14 c8 17 20  |     EQUD 0.... |
000037e0  20 20 20 20 20 20 20 20  20 45 51 55 44 20 68 65  |         EQUD he|
000037f0  6c 70 0d 14 d2 14 20 20  20 20 20 20 20 20 20 20  |lp....          |
00003800  45 51 55 42 20 30 0d 14  dc 3d 2e 68 65 6c 70 20  |EQUB 0...=.help |
00003810  20 20 20 20 45 51 55 53  20 22 54 68 69 73 20 6d  |    EQUS "This m|
00003820  6f 64 75 6c 65 20 66 69  6c 74 65 72 73 20 6b 65  |odule filters ke|
00003830  79 70 72 65 73 73 65 73  20 61 6e 64 20 6d 65 6e  |ypresses and men|
00003840  75 20 22 0d 14 e6 32 20  20 20 20 20 20 20 20 20  |u "...2         |
00003850  20 45 51 55 53 20 22 73  65 6c 65 63 74 69 6f 6e  | EQUS "selection|
00003860  73 20 66 6f 72 20 22 2b  74 61 73 6b 6e 61 6d 65  |s for "+taskname|
00003870  24 2b 22 2e 22 0d 14 f0  14 20 20 20 20 20 20 20  |$+"."....       |
00003880  20 20 20 45 51 55 42 20  30 0d 14 fa 0d 2e 64 6f  |   EQUB 0.....do|
00003890  6e 6f 74 75 73 65 0d 15  04 37 20 20 20 20 20 20  |notuse...7      |
000038a0  20 20 20 20 45 51 55 53  20 22 44 6f 20 6e 6f 74  |    EQUS "Do not|
000038b0  20 75 73 65 20 2a 44 65  73 6b 74 6f 70 5f 22 2b  | use *Desktop_"+|
000038c0  66 69 6c 74 6e 61 6d 65  24 2b 22 2e 22 0d 15 0e  |filtname$+"."...|
000038d0  14 20 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |.          EQUB |
000038e0  30 0d 15 18 13 20 20 20  20 20 20 20 20 20 20 41  |0....          A|
000038f0  4c 49 47 4e 0d 15 22 0d  2e 49 6e 69 74 43 6f 64  |LIGN.."..InitCod|
00003900  65 0d 15 2c 28 20 20 20  20 20 20 20 20 20 20 53  |e..,(          S|
00003910  54 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 52 37  |TMFD   (sp)!,{R7|
00003920  2d 52 31 31 2c 52 31 34  7d 0d 15 36 43 20 20 20  |-R11,R14}..6C   |
00003930  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00003940  30 2c 23 36 20 20 20 20  20 20 20 20 20 20 20 20  |0,#6            |
00003950  20 20 20 20 20 20 20 3b  20 36 20 2d 20 63 6c 61  |       ; 6 - cla|
00003960  69 6d 20 77 6f 72 6b 73  70 61 63 65 0d 15 40 40  |im workspace..@@|
00003970  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00003980  20 20 52 33 2c 23 33 30  30 20 20 20 20 20 20 20  |  R3,#300       |
00003990  20 20 20 20 20 20 20 20  20 20 3b 20 33 30 30 20  |          ; 300 |
000039a0  62 79 74 65 73 20 70 6c  65 61 73 65 0d 15 4a 38  |bytes please..J8|
000039b0  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
000039c0  20 20 22 58 4f 53 5f 4d  6f 64 75 6c 65 22 20 20  |  "XOS_Module"  |
000039d0  20 20 20 20 20 20 20 20  20 20 3b 20 43 6c 61 69  |          ; Clai|
000039e0  6d 20 69 74 0d 15 54 37  20 20 20 20 20 20 20 20  |m it..T7        |
000039f0  20 20 42 56 53 20 20 20  20 20 49 6e 69 74 45 78  |  BVS     InitEx|
00003a00  69 74 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |it              |
00003a10  20 20 3b 20 47 6f 74 20  69 74 3f 0d 15 5e 46 20  |  ; Got it?..^F |
00003a20  20 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |         STR    |
00003a30  20 52 32 2c 5b 77 70 5d  20 20 20 20 20 20 20 20  | R2,[wp]        |
00003a40  20 20 20 20 20 20 20 20  20 3b 20 54 68 65 6e 20  |         ; Then |
00003a50  73 74 6f 72 65 20 74 68  65 20 61 64 64 72 65 73  |store the addres|
00003a60  73 0d 15 68 1b 20 20 20  20 20 20 20 20 20 20 4d  |s..h.          M|
00003a70  4f 56 20 20 20 20 20 52  30 2c 23 30 0d 15 72 41  |OV     R0,#0..rA|
00003a80  20 20 20 20 20 20 20 20  20 20 53 54 52 20 20 20  |          STR   |
00003a90  20 20 52 30 2c 5b 52 32  2c 23 74 61 73 6b 68 61  |  R0,[R2,#taskha|
00003aa0  6e 64 6c 65 5d 20 20 20  20 20 3b 20 6e 6f 20 74  |ndle]     ; no t|
00003ab0  61 73 6b 68 61 6e 64 6c  65 20 79 65 74 0d 15 7c  |askhandle yet..||
00003ac0  1f 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |.          LDR  |
00003ad0  20 20 20 52 31 32 2c 5b  52 31 32 5d 0d 15 86 1b  |   R12,[R12]....|
00003ae0  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00003af0  20 20 52 33 2c 23 30 0d  15 90 1c 2e 73 63 61 6e  |  R3,#0.....scan|
00003b00  6c 6f 6f 70 20 4d 4f 56  20 20 20 20 20 52 31 2c  |loop MOV     R1,|
00003b10  52 31 32 0d 15 9a 1c 20  20 20 20 20 20 20 20 20  |R12....         |
00003b20  20 4d 4f 56 20 20 20 20  20 52 32 2c 23 31 36 0d  | MOV     R2,#16.|
00003b30  15 a4 32 20 20 20 20 20  20 20 20 20 20 53 57 49  |..2          SWI|
00003b40  20 20 20 20 20 22 54 61  73 6b 4d 61 6e 61 67 65  |     "TaskManage|
00003b50  72 5f 45 6e 75 6d 65 72  61 74 65 54 61 73 6b 73  |r_EnumerateTasks|
00003b60  22 0d 15 ae 1b 20 20 20  20 20 20 20 20 20 20 43  |"....          C|
00003b70  4d 4e 20 20 20 20 20 52  30 2c 23 31 0d 15 b8 1d  |MN     R0,#1....|
00003b80  20 20 20 20 20 20 20 20  20 20 42 4e 45 20 20 20  |          BNE   |
00003b90  20 20 63 68 6b 6e 61 6d  65 0d 15 c2 28 2e 73 6c  |  chkname...(.sl|
00003ba0  5f 65 6e 64 20 20 20 53  54 52 20 20 20 20 20 52  |_end   STR     R|
00003bb0  33 2c 5b 77 70 2c 23 68  69 73 5f 74 61 73 6b 68  |3,[wp,#his_taskh|
00003bc0  5d 0d 15 cc 1b 20 20 20  20 20 20 20 20 20 20 43  |]....          C|
00003bd0  4d 50 20 20 20 20 20 52  33 2c 23 30 0d 15 d6 23  |MP     R3,#0...#|
00003be0  20 20 20 20 20 20 20 20  20 20 42 4e 45 20 20 20  |          BNE   |
00003bf0  20 20 41 74 74 61 63 68  5f 66 69 6c 74 65 72 0d  |  Attach_filter.|
00003c00  15 e0 40 20 20 20 20 20  20 20 20 20 20 4c 44 4d  |..@          LDM|
00003c10  46 44 20 20 20 28 73 70  29 21 2c 7b 52 37 2d 52  |FD   (sp)!,{R7-R|
00003c20  31 31 2c 70 63 7d 20 20  20 20 20 20 20 3b 20 74  |11,pc}       ; t|
00003c30  68 61 74 27 73 20 61 6c  6c 20 66 6f 6c 6b 73 0d  |hat's all folks.|
00003c40  15 ea 21 2e 63 68 6b 6e  61 6d 65 20 20 41 44 52  |..!.chkname  ADR|
00003c50  20 20 20 20 20 52 34 2c  74 61 73 6b 6e 61 6d 65  |     R4,taskname|
00003c60  0d 15 f4 1c 20 20 20 20  20 20 20 20 20 20 4d 4f  |....          MO|
00003c70  56 20 20 20 20 20 52 38  2c 52 31 32 0d 15 fe 20  |V     R8,R12... |
00003c80  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
00003c90  20 20 52 35 2c 5b 52 38  2c 23 34 5d 0d 16 08 20  |  R5,[R8,#4]... |
00003ca0  2e 63 68 6b 6c 6f 6f 70  20 20 4c 44 52 42 20 20  |.chkloop  LDRB  |
00003cb0  20 20 52 36 2c 5b 52 34  5d 2c 23 31 0d 16 12 20  |  R6,[R4],#1... |
00003cc0  20 20 20 20 20 20 20 20  20 20 4c 44 52 42 20 20  |          LDRB  |
00003cd0  20 20 52 37 2c 5b 52 35  5d 2c 23 31 0d 16 1c 1c  |  R7,[R5],#1....|
00003ce0  20 20 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |          CMP   |
00003cf0  20 20 52 36 2c 23 33 32  0d 16 26 1b 20 20 20 20  |  R6,#32..&.    |
00003d00  20 20 20 20 20 20 4d 4f  56 4c 54 20 20 20 52 36  |      MOVLT   R6|
00003d10  2c 23 30 0d 16 30 1c 20  20 20 20 20 20 20 20 20  |,#0..0.         |
00003d20  20 43 4d 50 20 20 20 20  20 52 37 2c 23 33 32 0d  | CMP     R7,#32.|
00003d30  16 3a 1b 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |.:.          MOV|
00003d40  4c 54 20 20 20 52 37 2c  23 30 0d 16 44 1b 20 20  |LT   R7,#0..D.  |
00003d50  20 20 20 20 20 20 20 20  43 4d 50 20 20 20 20 20  |        CMP     |
00003d60  52 36 2c 52 37 0d 16 4e  1e 20 20 20 20 20 20 20  |R6,R7..N.       |
00003d70  20 20 20 42 4e 45 20 20  20 20 20 73 63 61 6e 6c  |   BNE     scanl|
00003d80  6f 6f 70 0d 16 58 1b 20  20 20 20 20 20 20 20 20  |oop..X.         |
00003d90  20 43 4d 50 20 20 20 20  20 52 36 2c 23 30 0d 16  | CMP     R6,#0..|
00003da0  62 1d 20 20 20 20 20 20  20 20 20 20 42 4e 45 20  |b.          BNE |
00003db0  20 20 20 20 63 68 6b 6c  6f 6f 70 0d 16 6c 1d 20  |    chkloop..l. |
00003dc0  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
00003dd0  20 52 33 2c 5b 52 38 5d  0d 16 76 1c 20 20 20 20  | R3,[R8]..v.    |
00003de0  20 20 20 20 20 20 42 20  20 20 20 20 20 20 73 6c  |      B       sl|
00003df0  5f 65 6e 64 0d 16 80 12  2e 41 74 74 61 63 68 5f  |_end.....Attach_|
00003e00  66 69 6c 74 65 72 0d 16  8a 21 20 20 20 20 20 20  |filter...!      |
00003e10  20 20 20 20 41 44 52 20  20 20 20 20 52 30 2c 66  |    ADR     R0,f|
00003e20  69 6c 74 6e 61 6d 65 0d  16 94 23 20 20 20 20 20  |iltname...#     |
00003e30  20 20 20 20 20 41 44 52  20 20 20 20 20 52 31 2c  |     ADR     R1,|
00003e40  46 69 6c 74 65 72 43 6f  64 65 0d 16 9e 1b 20 20  |FilterCode....  |
00003e50  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00003e60  52 32 2c 23 30 0d 16 a8  29 20 20 20 20 20 20 20  |R2,#0...)       |
00003e70  20 20 20 4c 44 52 20 20  20 20 20 52 33 2c 5b 52  |   LDR     R3,[R|
00003e80  31 32 2c 23 68 69 73 5f  74 61 73 6b 68 5d 0d 16  |12,#his_taskh]..|
00003e90  b2 21 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |.!          LDR |
00003ea0  20 20 20 20 52 34 2c 66  69 6c 74 6d 61 73 6b 0d  |    R4,filtmask.|
00003eb0  16 bc 32 20 20 20 20 20  20 20 20 20 20 53 57 49  |..2          SWI|
00003ec0  20 20 20 20 20 22 58 46  69 6c 74 65 72 5f 52 65  |     "XFilter_Re|
00003ed0  67 69 73 74 65 72 50 6f  73 74 46 69 6c 74 65 72  |gisterPostFilter|
00003ee0  22 0d 16 c6 27 20 20 20  20 20 20 20 20 20 20 4c  |"...'          L|
00003ef0  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 52 37  |DMFD   (sp)!,{R7|
00003f00  2d 52 31 31 2c 70 63 7d  0d 16 d0 0d 2e 49 6e 69  |-R11,pc}.....Ini|
00003f10  74 45 78 69 74 0d 16 da  27 20 20 20 20 20 20 20  |tExit...'       |
00003f20  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00003f30  2c 7b 52 37 2d 52 31 31  2c 70 63 7d 0d 16 e4 10  |,{R7-R11,pc}....|
00003f40  2e 53 74 61 72 43 6f 6d  6d 61 6e 64 0d 16 ee 21  |.StarCommand...!|
00003f50  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
00003f60  20 20 28 73 70 29 21 2c  7b 52 31 34 7d 0d 16 f8  |  (sp)!,{R14}...|
00003f70  3a 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |:          MOV  |
00003f80  20 20 20 52 32 2c 52 30  20 20 20 20 20 20 20 20  |   R2,R0        |
00003f90  20 20 20 20 20 20 20 20  20 20 20 3b 20 70 61 72  |           ; par|
00003fa0  61 6d 65 74 65 72 73 0d  17 02 3b 20 20 20 20 20  |ameters...;     |
00003fb0  20 20 20 20 20 41 44 52  20 20 20 20 20 52 31 2c  |     ADR     R1,|
00003fc0  54 69 74 6c 65 53 74 72  69 6e 67 20 20 20 20 20  |TitleString     |
00003fd0  20 20 20 20 20 3b 20 6d  6f 64 75 6c 65 20 6e 61  |     ; module na|
00003fe0  6d 65 0d 17 0c 1b 20 20  20 20 20 20 20 20 20 20  |me....          |
00003ff0  4d 4f 56 20 20 20 20 20  52 30 2c 23 32 0d 17 16  |MOV     R0,#2...|
00004000  41 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |A          SWI  |
00004010  20 20 20 22 58 4f 53 5f  4d 6f 64 75 6c 65 22 20  |   "XOS_Module" |
00004020  20 20 20 20 20 20 20 20  20 20 20 3b 20 65 6e 74  |           ; ent|
00004030  65 72 20 61 73 20 6c 61  6e 67 75 61 67 65 0d 17  |er as language..|
00004040  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
00004050  44 20 20 20 28 73 70 29  21 2c 7b 70 63 7d 0d 17  |D   (sp)!,{pc}..|
00004060  2a 0e 2e 53 74 61 72 74  43 6f 64 65 0d 17 34 46  |*..StartCode..4F|
00004070  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
00004080  20 20 77 70 2c 5b 52 31  32 5d 20 20 20 20 20 20  |  wp,[R12]      |
00004090  20 20 20 20 20 20 20 20  20 20 3b 20 6c 6f 61 64  |          ; load|
000040a0  20 77 6f 72 6b 73 70 61  63 65 20 70 6f 69 6e 74  | workspace point|
000040b0  65 72 0d 17 3e 40 20 20  20 20 20 20 20 20 20 20  |er..>@          |
000040c0  4c 44 52 20 20 20 20 20  52 30 2c 5b 77 70 2c 23  |LDR     R0,[wp,#|
000040d0  74 61 73 6b 68 61 6e 64  6c 65 5d 20 20 20 20 20  |taskhandle]     |
000040e0  3b 20 6c 6f 61 64 20 74  61 73 6b 20 68 61 6e 64  |; load task hand|
000040f0  6c 65 0d 17 48 3d 20 20  20 20 20 20 20 20 20 20  |le..H=          |
00004100  54 45 51 20 20 20 20 20  52 30 2c 23 30 20 20 20  |TEQ     R0,#0   |
00004110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004120  3b 20 61 6d 20 49 20 72  75 6e 6e 69 6e 67 3f 0d  |; am I running?.|
00004130  17 52 38 20 20 20 20 20  20 20 20 20 20 4c 44 52  |.R8          LDR|
00004140  47 54 20 20 20 52 31 2c  54 41 53 4b 20 20 20 20  |GT   R1,TASK    |
00004150  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
00004160  66 20 73 6f 2e 2e 2e 0d  17 5c 34 20 20 20 20 20  |f so.....\4     |
00004170  20 20 20 20 20 53 57 49  47 54 20 20 20 22 58 57  |     SWIGT   "XW|
00004180  69 6d 70 5f 43 6c 6f 73  65 44 6f 77 6e 22 20 20  |imp_CloseDown"  |
00004190  20 20 20 20 20 3b 20 71  75 69 74 0d 17 66 37 20  |     ; quit..f7 |
000041a0  20 20 20 20 20 20 20 20  20 4d 4f 56 47 54 20 20  |         MOVGT  |
000041b0  20 52 30 2c 23 30 20 20  20 20 20 20 20 20 20 20  | R0,#0          |
000041c0  20 20 20 20 20 20 20 20  20 3b 20 74 68 65 6e 2e  |         ; then.|
000041d0  2e 2e 0d 17 70 44 20 20  20 20 20 20 20 20 20 20  |....pD          |
000041e0  53 54 52 47 54 20 20 20  52 30 2c 5b 77 70 2c 23  |STRGT   R0,[wp,#|
000041f0  74 61 73 6b 68 61 6e 64  6c 65 5d 20 20 20 20 20  |taskhandle]     |
00004200  3b 20 73 74 6f 72 65 20  74 61 73 6b 68 61 6e 64  |; store taskhand|
00004210  6c 65 20 30 20 20 0d 17  7a 3c 20 20 20 20 20 20  |le 0  ..z<      |
00004220  20 20 20 20 4d 4f 56 20  20 20 20 20 52 30 2c 23  |    MOV     R0,#|
00004230  33 30 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |300             |
00004240  20 20 20 20 3b 20 77 69  6d 70 20 76 65 72 73 69  |    ; wimp versi|
00004250  6f 6e 0d 17 84 38 20 20  20 20 20 20 20 20 20 20  |on...8          |
00004260  4c 44 52 20 20 20 20 20  52 31 2c 54 41 53 4b 20  |LDR     R1,TASK |
00004270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004280  3b 20 34 42 35 33 34 31  35 34 0d 17 8e 39 20 20  |; 4B534154...9  |
00004290  20 20 20 20 20 20 20 20  41 44 52 20 20 20 20 20  |        ADR     |
000042a0  52 32 2c 54 69 74 6c 65  53 74 72 69 6e 67 20 20  |R2,TitleString  |
000042b0  20 20 20 20 20 20 20 20  3b 20 54 61 73 6b 20 6e  |        ; Task n|
000042c0  61 6d 65 0d 17 98 25 20  20 20 20 20 20 20 20 20  |ame...%         |
000042d0  20 41 44 52 20 20 20 20  20 52 33 2c 6d 65 73 73  | ADR     R3,mess|
000042e0  61 67 65 5f 6c 69 73 74  0d 17 a2 3b 20 20 20 20  |age_list...;    |
000042f0  20 20 20 20 20 20 53 57  49 20 20 20 20 20 22 58  |      SWI     "X|
00004300  57 69 6d 70 5f 49 6e 69  74 69 61 6c 69 73 65 22  |Wimp_Initialise"|
00004310  20 20 20 20 20 20 3b 20  49 6e 69 74 69 61 6c 69  |      ; Initiali|
00004320  73 65 21 0d 17 ac 46 20  20 20 20 20 20 20 20 20  |se!...F         |
00004330  20 53 57 49 56 53 20 20  20 22 58 4f 53 5f 45 78  | SWIVS   "XOS_Ex|
00004340  69 74 22 20 20 20 20 20  20 20 20 20 20 20 20 20  |it"             |
00004350  20 3b 20 65 78 69 74 20  69 66 20 65 72 72 6f 72  | ; exit if error|
00004360  20 6f 63 63 75 72 72 65  64 0d 17 b6 41 20 20 20  | occurred...A   |
00004370  20 20 20 20 20 20 20 53  54 52 20 20 20 20 20 52  |       STR     R|
00004380  31 2c 5b 52 31 32 2c 23  74 61 73 6b 68 61 6e 64  |1,[R12,#taskhand|
00004390  6c 65 5d 20 20 20 20 3b  20 73 74 6f 72 65 20 74  |le]    ; store t|
000043a0  61 73 6b 20 68 61 6e 64  6c 65 0d 17 c0 40 2e 70  |ask handle...@.p|
000043b0  6f 6c 6c 20 20 20 20 20  4c 44 52 20 20 20 20 20  |oll     LDR     |
000043c0  52 30 2c 6d 61 73 6b 20  20 20 20 20 20 20 20 20  |R0,mask         |
000043d0  20 20 20 20 20 20 20 20  3b 20 72 65 61 73 6f 6e  |        ; reason|
000043e0  20 63 6f 64 65 20 6d 61  73 6b 0d 17 ca 39 20 20  | code mask...9  |
000043f0  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00004400  52 31 2c 77 70 20 20 20  20 20 20 20 20 20 20 20  |R1,wp           |
00004410  20 20 20 20 20 20 20 20  3b 20 77 6f 72 6b 73 70  |        ; worksp|
00004420  61 63 65 0d 17 d4 3d 20  20 20 20 20 20 20 20 20  |ace...=         |
00004430  20 53 57 49 20 20 20 20  20 22 58 57 69 6d 70 5f  | SWI     "XWimp_|
00004440  50 6f 6c 6c 22 20 20 20  20 20 20 20 20 20 20 20  |Poll"           |
00004450  20 3b 20 70 6f 6c 6c 20  74 68 65 20 77 69 6d 70  | ; poll the wimp|
00004460  0d 17 de 3f 20 20 20 20  20 20 20 20 20 20 43 4d  |...?          CM|
00004470  50 20 20 20 20 20 52 30  2c 23 31 37 20 20 20 20  |P     R0,#17    |
00004480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00004490  72 65 61 73 6f 6e 20 63  6f 64 65 20 31 37 3f 0d  |reason code 17?.|
000044a0  17 e8 36 20 20 20 20 20  20 20 20 20 20 43 4d 50  |..6          CMP|
000044b0  4e 45 20 20 20 52 30 2c  23 31 38 20 20 20 20 20  |NE   R0,#18     |
000044c0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 6f  |             ; o|
000044d0  72 20 31 38 3f 0d 17 f2  41 20 20 20 20 20 20 20  |r 18?...A       |
000044e0  20 20 20 42 4e 45 20 20  20 20 20 70 6f 6c 6c 20  |   BNE     poll |
000044f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004500  20 20 20 3b 20 69 66 20  6e 6f 74 20 6b 65 65 70  |   ; if not keep|
00004510  20 67 6f 69 6e 67 0d 17  fc 40 20 20 20 20 20 20  | going...@      |
00004520  20 20 20 20 4c 44 52 20  20 20 20 20 52 30 2c 5b  |    LDR     R0,[|
00004530  77 70 2c 23 31 36 5d 20  20 20 20 20 20 20 20 20  |wp,#16]         |
00004540  20 20 20 20 3b 20 67 65  74 20 6d 65 73 73 61 67  |    ; get messag|
00004550  65 20 74 79 70 65 0d 18  06 20 20 20 20 20 20 20  |e type...       |
00004560  20 20 20 20 4d 4f 56 20  20 20 20 20 52 34 2c 23  |    MOV     R4,#|
00004570  26 34 30 30 30 30 0d 18  10 20 20 20 20 20 20 20  |&40000...       |
00004580  20 20 20 20 41 44 44 20  20 20 20 20 52 34 2c 52  |    ADD     R4,R|
00004590  34 2c 23 26 43 32 0d 18  1a 1b 20 20 20 20 20 20  |4,#&C2....      |
000045a0  20 20 20 20 43 4d 50 20  20 20 20 20 52 30 2c 52  |    CMP     R0,R|
000045b0  34 0d 18 24 25 20 20 20  20 20 20 20 20 20 20 42  |4..$%          B|
000045c0  45 51 20 20 20 20 20 74  61 73 6b 5f 69 6e 69 74  |EQ     task_init|
000045d0  69 61 6c 69 73 65 0d 18  2e 1e 20 20 20 20 20 20  |ialise....      |
000045e0  20 20 20 20 41 44 44 20  20 20 20 20 52 34 2c 52  |    ADD     R4,R|
000045f0  34 2c 23 31 0d 18 38 1b  20 20 20 20 20 20 20 20  |4,#1..8.        |
00004600  20 20 43 4d 50 20 20 20  20 20 52 30 2c 52 34 0d  |  CMP     R0,R4.|
00004610  18 42 24 20 20 20 20 20  20 20 20 20 20 42 45 51  |.B$          BEQ|
00004620  20 20 20 20 20 74 61 73  6b 5f 63 6c 6f 73 65 64  |     task_closed|
00004630  6f 77 6e 0d 18 4c 35 20  20 20 20 20 20 20 20 20  |own..L5         |
00004640  20 43 4d 50 20 20 20 20  20 52 30 2c 23 30 20 20  | CMP     R0,#0  |
00004650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004660  20 3b 20 71 75 69 74 3f  0d 18 56 3a 20 20 20 20  | ; quit?..V:    |
00004670  20 20 20 20 20 20 53 57  49 45 51 20 20 20 22 58  |      SWIEQ   "X|
00004680  57 69 6d 70 5f 43 6c 6f  73 65 44 6f 77 6e 22 20  |Wimp_CloseDown" |
00004690  20 20 20 20 20 20 3b 20  69 66 20 73 6f 20 71 75  |      ; if so qu|
000046a0  69 74 0d 18 60 33 20 20  20 20 20 20 20 20 20 20  |it..`3          |
000046b0  ec 51 20 20 20 52 31 2c  23 30 20 20 20 20 20 20  |.Q   R1,#0      |
000046c0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 61  |             ; a|
000046d0  6e 64 2e 2e 2e 0d 18 6a  43 20 20 20 20 20 20 20  |nd.....jC       |
000046e0  20 20 20 53 54 52 45 51  20 20 20 52 31 2c 5b 77  |   STREQ   R1,[w|
000046f0  70 2c 23 74 61 73 6b 68  61 6e 64 6c 65 5d 20 20  |p,#taskhandle]  |
00004700  20 20 20 3b 20 73 74 6f  72 65 20 74 61 73 6b 20  |   ; store task |
00004710  68 61 6e 64 6c 65 20 30  0d 18 74 38 20 20 20 20  |handle 0..t8    |
00004720  20 20 20 20 20 20 53 57  49 45 51 20 20 20 22 58  |      SWIEQ   "X|
00004730  4f 53 5f 45 78 69 74 22  20 20 20 20 20 20 20 20  |OS_Exit"        |
00004740  20 20 20 20 20 20 3b 20  61 6e 64 20 65 78 69 74  |      ; and exit|
00004750  0d 18 7e 1a 20 20 20 20  20 20 20 20 20 20 42 20  |..~.          B |
00004760  20 20 20 20 20 20 70 6f  6c 6c 0d 18 88 14 2e 74  |      poll.....t|
00004770  61 73 6b 5f 69 6e 69 74  69 61 6c 69 73 65 0d 18  |ask_initialise..|
00004780  92 29 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |.)          LDR |
00004790  20 20 20 20 52 34 2c 5b  52 31 32 2c 23 68 69 73  |    R4,[R12,#his|
000047a0  5f 74 61 73 6b 68 5d 0d  18 9c 1b 20 20 20 20 20  |_taskh]....     |
000047b0  20 20 20 20 20 43 4d 50  20 20 20 20 20 52 34 2c  |     CMP     R4,|
000047c0  23 30 0d 18 a6 1a 20 20  20 20 20 20 20 20 20 20  |#0....          |
000047d0  42 4e 45 20 20 20 20 20  70 6f 6c 6c 0d 18 b0 21  |BNE     poll...!|
000047e0  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
000047f0  20 20 52 34 2c 74 61 73  6b 6e 61 6d 65 0d 18 ba  |  R4,taskname...|
00004800  20 20 20 20 20 20 20 20  20 20 20 41 44 44 20 20  |           ADD  |
00004810  20 20 20 52 35 2c 52 31  32 2c 23 32 38 0d 18 c4  |   R5,R12,#28...|
00004820  20 2e 6e 65 77 74 5f 63  68 6b 20 4c 44 52 42 20  | .newt_chk LDRB |
00004830  20 20 20 52 36 2c 5b 52  34 5d 2c 23 31 0d 18 ce  |   R6,[R4],#1...|
00004840  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 42 20  |           LDRB |
00004850  20 20 20 52 37 2c 5b 52  35 5d 2c 23 31 0d 18 d8  |   R7,[R5],#1...|
00004860  1b 20 20 20 20 20 20 20  20 20 20 43 4d 50 20 20  |.          CMP  |
00004870  20 20 20 52 36 2c 52 37  0d 18 e2 1a 20 20 20 20  |   R6,R7....    |
00004880  20 20 20 20 20 20 42 4e  45 20 20 20 20 20 70 6f  |      BNE     po|
00004890  6c 6c 0d 18 ec 1b 20 20  20 20 20 20 20 20 20 20  |ll....          |
000048a0  43 4d 50 20 20 20 20 20  52 36 2c 23 30 0d 18 f6  |CMP     R6,#0...|
000048b0  1e 20 20 20 20 20 20 20  20 20 20 42 4e 45 20 20  |.          BNE  |
000048c0  20 20 20 6e 65 77 74 5f  63 68 6b 0d 19 00 21 20  |   newt_chk...! |
000048d0  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
000048e0  20 52 33 2c 5b 52 31 32  2c 23 34 5d 0d 19 0a 29  | R3,[R12,#4]...)|
000048f0  20 20 20 20 20 20 20 20  20 20 53 54 52 20 20 20  |          STR   |
00004900  20 20 52 33 2c 5b 52 31  32 2c 23 68 69 73 5f 74  |  R3,[R12,#his_t|
00004910  61 73 6b 68 5d 0d 19 14  21 20 20 20 20 20 20 20  |askh]...!       |
00004920  20 20 20 41 44 52 20 20  20 20 20 52 30 2c 66 69  |   ADR     R0,fi|
00004930  6c 74 6e 61 6d 65 0d 19  1e 23 20 20 20 20 20 20  |ltname...#      |
00004940  20 20 20 20 41 44 52 20  20 20 20 20 52 31 2c 46  |    ADR     R1,F|
00004950  69 6c 74 65 72 43 6f 64  65 0d 19 28 1b 20 20 20  |ilterCode..(.   |
00004960  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00004970  32 2c 23 30 0d 19 32 21  20 20 20 20 20 20 20 20  |2,#0..2!        |
00004980  20 20 4c 44 52 20 20 20  20 20 52 34 2c 66 69 6c  |  LDR     R4,fil|
00004990  74 6d 61 73 6b 0d 19 3c  32 20 20 20 20 20 20 20  |tmask..<2       |
000049a0  20 20 20 53 57 49 20 20  20 20 20 22 58 46 69 6c  |   SWI     "XFil|
000049b0  74 65 72 5f 52 65 67 69  73 74 65 72 50 6f 73 74  |ter_RegisterPost|
000049c0  46 69 6c 74 65 72 22 0d  19 46 1a 20 20 20 20 20  |Filter"..F.     |
000049d0  20 20 20 20 20 42 20 20  20 20 20 20 20 70 6f 6c  |     B       pol|
000049e0  6c 0d 19 50 13 2e 74 61  73 6b 5f 63 6c 6f 73 65  |l..P..task_close|
000049f0  64 6f 77 6e 0d 19 5a 21  20 20 20 20 20 20 20 20  |down..Z!        |
00004a00  20 20 4c 44 52 20 20 20  20 20 52 34 2c 5b 52 31  |  LDR     R4,[R1|
00004a10  32 2c 23 34 5d 0d 19 64  29 20 20 20 20 20 20 20  |2,#4]..d)       |
00004a20  20 20 20 4c 44 52 20 20  20 20 20 52 35 2c 5b 52  |   LDR     R5,[R|
00004a30  31 32 2c 23 68 69 73 5f  74 61 73 6b 68 5d 0d 19  |12,#his_taskh]..|
00004a40  6e 1b 20 20 20 20 20 20  20 20 20 20 43 4d 50 20  |n.          CMP |
00004a50  20 20 20 20 52 34 2c 52  35 0d 19 78 1a 20 20 20  |    R4,R5..x.   |
00004a60  20 20 20 20 20 20 20 42  4e 45 20 20 20 20 20 70  |       BNE     p|
00004a70  6f 6c 6c 0d 19 82 21 20  20 20 20 20 20 20 20 20  |oll...!         |
00004a80  20 41 44 52 20 20 20 20  20 52 30 2c 66 69 6c 74  | ADR     R0,filt|
00004a90  6e 61 6d 65 0d 19 8c 23  20 20 20 20 20 20 20 20  |name...#        |
00004aa0  20 20 41 44 52 20 20 20  20 20 52 31 2c 46 69 6c  |  ADR     R1,Fil|
00004ab0  74 65 72 43 6f 64 65 0d  19 96 1b 20 20 20 20 20  |terCode....     |
00004ac0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 32 2c  |     MOV     R2,|
00004ad0  23 30 0d 19 a0 29 20 20  20 20 20 20 20 20 20 20  |#0...)          |
00004ae0  4c 44 52 20 20 20 20 20  52 33 2c 5b 52 31 32 2c  |LDR     R3,[R12,|
00004af0  23 68 69 73 5f 74 61 73  6b 68 5d 0d 19 aa 21 20  |#his_taskh]...! |
00004b00  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
00004b10  20 52 34 2c 66 69 6c 74  6d 61 73 6b 0d 19 b4 34  | R4,filtmask...4|
00004b20  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
00004b30  20 20 22 58 46 69 6c 74  65 72 5f 44 65 52 65 67  |  "XFilter_DeReg|
00004b40  69 73 74 65 72 50 6f 73  74 46 69 6c 74 65 72 22  |isterPostFilter"|
00004b50  0d 19 be 1b 20 20 20 20  20 20 20 20 20 20 4d 4f  |....          MO|
00004b60  56 20 20 20 20 20 52 30  2c 23 30 0d 19 c8 29 20  |V     R0,#0...) |
00004b70  20 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |         STR    |
00004b80  20 52 30 2c 5b 52 31 32  2c 23 68 69 73 5f 74 61  | R0,[R12,#his_ta|
00004b90  73 6b 68 5d 0d 19 d2 1a  20 20 20 20 20 20 20 20  |skh]....        |
00004ba0  20 20 42 20 20 20 20 20  20 20 70 6f 6c 6c 0d 19  |  B       poll..|
00004bb0  dc 0e 2e 46 69 6e 61 6c  43 6f 64 65 0d 19 e6 28  |...FinalCode...(|
00004bc0  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
00004bd0  20 20 28 73 70 29 21 2c  7b 52 37 2d 52 31 31 2c  |  (sp)!,{R7-R11,|
00004be0  52 31 34 7d 0d 19 f0 46  20 20 20 20 20 20 20 20  |R14}...F        |
00004bf0  20 20 4c 44 52 20 20 20  20 20 77 70 2c 5b 52 31  |  LDR     wp,[R1|
00004c00  32 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2]              |
00004c10  20 20 3b 20 6c 6f 61 64  20 77 6f 72 6b 73 70 61  |  ; load workspa|
00004c20  63 65 20 70 6f 69 6e 74  65 72 0d 19 fa 40 20 20  |ce pointer...@  |
00004c30  20 20 20 20 20 20 20 20  4c 44 52 20 20 20 20 20  |        LDR     |
00004c40  52 30 2c 5b 77 70 2c 23  74 61 73 6b 68 61 6e 64  |R0,[wp,#taskhand|
00004c50  6c 65 5d 20 20 20 20 20  3b 20 6c 6f 61 64 20 74  |le]     ; load t|
00004c60  61 73 6b 20 68 61 6e 64  6c 65 0d 1a 04 3d 20 20  |ask handle...=  |
00004c70  20 20 20 20 20 20 20 20  54 45 51 20 20 20 20 20  |        TEQ     |
00004c80  52 30 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R0,#0           |
00004c90  20 20 20 20 20 20 20 20  3b 20 61 6d 20 49 20 72  |        ; am I r|
00004ca0  75 6e 6e 69 6e 67 3f 0d  1a 0e 38 20 20 20 20 20  |unning?...8     |
00004cb0  20 20 20 20 20 4c 44 52  47 54 20 20 20 52 31 2c  |     LDRGT   R1,|
00004cc0  54 41 53 4b 20 20 20 20  20 20 20 20 20 20 20 20  |TASK            |
00004cd0  20 20 20 20 20 3b 20 69  66 20 73 6f 2e 2e 2e 0d  |     ; if so....|
00004ce0  1a 18 34 20 20 20 20 20  20 20 20 20 20 53 57 49  |..4          SWI|
00004cf0  47 54 20 20 20 22 58 57  69 6d 70 5f 43 6c 6f 73  |GT   "XWimp_Clos|
00004d00  65 44 6f 77 6e 22 20 20  20 20 20 20 20 3b 20 71  |eDown"       ; q|
00004d10  75 69 74 0d 1a 22 36 20  20 20 20 20 20 20 20 20  |uit.."6         |
00004d20  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 30 20 20  | MOV     R1,#0  |
00004d30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004d40  20 3b 20 61 6e 64 2e 2e  2e 0d 1a 2c 46 20 20 20  | ; and.....,F   |
00004d50  20 20 20 20 20 20 20 53  54 52 20 20 20 20 20 52  |       STR     R|
00004d60  31 2c 5b 77 70 2c 23 74  61 73 6b 68 61 6e 64 6c  |1,[wp,#taskhandl|
00004d70  65 5d 20 20 20 20 20 3b  20 73 74 6f 72 65 20 74  |e]     ; store t|
00004d80  61 73 6b 20 68 61 6e 64  6c 65 20 6f 66 20 30 0d  |ask handle of 0.|
00004d90  1a 36 28 20 20 20 20 20  20 20 20 20 20 4c 44 52  |.6(          LDR|
00004da0  20 20 20 20 20 52 30 2c  5b 77 70 2c 23 68 69 73  |     R0,[wp,#his|
00004db0  5f 74 61 73 6b 68 5d 0d  1a 40 1b 20 20 20 20 20  |_taskh]..@.     |
00004dc0  20 20 20 20 20 54 45 51  20 20 20 20 20 52 30 2c  |     TEQ     R0,|
00004dd0  23 30 0d 1a 4a 21 20 20  20 20 20 20 20 20 20 20  |#0..J!          |
00004de0  41 44 52 47 54 20 20 20  52 30 2c 66 69 6c 74 6e  |ADRGT   R0,filtn|
00004df0  61 6d 65 0d 1a 54 23 20  20 20 20 20 20 20 20 20  |ame..T#         |
00004e00  20 41 44 52 47 54 20 20  20 52 31 2c 46 69 6c 74  | ADRGT   R1,Filt|
00004e10  65 72 43 6f 64 65 0d 1a  5e 1b 20 20 20 20 20 20  |erCode..^.      |
00004e20  20 20 20 20 4d 4f 56 47  54 20 20 20 52 32 2c 23  |    MOVGT   R2,#|
00004e30  30 0d 1a 68 29 20 20 20  20 20 20 20 20 20 20 4c  |0..h)          L|
00004e40  44 52 47 54 20 20 20 52  33 2c 5b 52 31 32 2c 23  |DRGT   R3,[R12,#|
00004e50  68 69 73 5f 74 61 73 6b  68 5d 0d 1a 72 21 20 20  |his_taskh]..r!  |
00004e60  20 20 20 20 20 20 20 20  4c 44 52 47 54 20 20 20  |        LDRGT   |
00004e70  52 34 2c 66 69 6c 74 6d  61 73 6b 0d 1a 7c 34 20  |R4,filtmask..|4 |
00004e80  20 20 20 20 20 20 20 20  20 53 57 49 47 54 20 20  |         SWIGT  |
00004e90  20 22 58 46 69 6c 74 65  72 5f 44 65 52 65 67 69  | "XFilter_DeRegi|
00004ea0  73 74 65 72 50 6f 73 74  46 69 6c 74 65 72 22 0d  |sterPostFilter".|
00004eb0  1a 86 1b 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |...          MOV|
00004ec0  47 54 20 20 20 52 30 2c  23 30 0d 1a 90 29 20 20  |GT   R0,#0...)  |
00004ed0  20 20 20 20 20 20 20 20  53 54 52 47 54 20 20 20  |        STRGT   |
00004ee0  52 30 2c 5b 52 31 32 2c  23 68 69 73 5f 74 61 73  |R0,[R12,#his_tas|
00004ef0  6b 68 5d 0d 1a 9a 36 20  20 20 20 20 20 20 20 20  |kh]...6         |
00004f00  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 37 20 20  | MOV     R0,#7  |
00004f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004f20  20 3b 20 6e 6f 77 2e 2e  2e 0d 1a a4 33 20 20 20  | ; now......3   |
00004f30  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00004f40  32 2c 77 70 20 20 20 20  20 20 20 20 20 20 20 20  |2,wp            |
00004f50  20 20 20 20 20 20 20 3b  20 2e 2e 2e 0d 1a ae 42  |       ; ......B|
00004f60  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
00004f70  20 20 22 4f 53 5f 4d 6f  64 75 6c 65 22 20 20 20  |  "OS_Module"   |
00004f80  20 20 20 20 20 20 20 20  20 20 3b 20 66 72 65 65  |          ; free|
00004f90  20 74 68 65 20 77 6f 72  6b 73 70 61 63 65 0d 1a  | the workspace..|
00004fa0  b8 27 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |.'          LDMF|
00004fb0  44 20 20 20 28 73 70 29  21 2c 7b 52 37 2d 52 31  |D   (sp)!,{R7-R1|
00004fc0  31 2c 70 63 7d 0d 1a c2  10 2e 53 65 72 76 69 63  |1,pc}.....Servic|
00004fd0  65 43 6f 64 65 0d 1a cc  46 20 20 20 20 20 20 20  |eCode...F       |
00004fe0  20 20 20 4c 44 52 20 20  20 20 20 77 70 2c 5b 77  |   LDR     wp,[w|
00004ff0  70 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p]              |
00005000  20 20 20 3b 20 6c 6f 61  64 20 77 6f 72 6b 73 70  |   ; load worksp|
00005010  61 63 65 20 70 6f 69 6e  74 65 72 0d 1a d6 21 20  |ace pointer...! |
00005020  20 20 20 20 20 20 20 20  20 53 54 4d 46 44 20 20  |         STMFD  |
00005030  20 28 73 70 29 21 2c 7b  52 31 34 7d 0d 1a e0 3a  | (sp)!,{R14}...:|
00005040  20 20 20 20 20 20 20 20  20 20 54 45 51 20 20 20  |          TEQ   |
00005050  20 20 52 31 2c 23 26 34  39 20 20 20 20 20 20 20  |  R1,#&49       |
00005060  20 20 20 20 20 20 20 20  20 20 3b 20 53 74 61 72  |          ; Star|
00005070  74 57 69 6d 70 3f 0d 1a  ea 27 20 20 20 20 20 20  |tWimp?...'      |
00005080  20 20 20 20 42 45 51 20  20 20 20 20 53 65 72 76  |    BEQ     Serv|
00005090  69 63 65 5f 53 74 61 72  74 57 69 6d 70 0d 1a f4  |ice_StartWimp...|
000050a0  3c 20 20 20 20 20 20 20  20 20 20 54 45 51 20 20  |<          TEQ  |
000050b0  20 20 20 52 31 2c 23 26  34 41 20 20 20 20 20 20  |   R1,#&4A      |
000050c0  20 20 20 20 20 20 20 20  20 20 20 3b 20 53 74 61  |           ; Sta|
000050d0  72 74 65 64 57 69 6d 70  3f 0d 1a fe 29 20 20 20  |rtedWimp?...)   |
000050e0  20 20 20 20 20 20 20 42  45 51 20 20 20 20 20 53  |       BEQ     S|
000050f0  65 72 76 69 63 65 5f 53  74 61 72 74 65 64 57 69  |ervice_StartedWi|
00005100  6d 70 0d 1b 08 36 20 20  20 20 20 20 20 20 20 20  |mp...6          |
00005110  54 45 51 20 20 20 20 20  52 31 2c 23 26 32 37 20  |TEQ     R1,#&27 |
00005120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005130  3b 20 52 65 73 65 74 3f  0d 1b 12 19 20 20 20 20  |; Reset?....    |
00005140  20 20 20 20 20 20 ec 51  20 20 20 52 31 34 2c 23  |      .Q   R14,#|
00005150  30 0d 1b 1c 46 20 20 20  20 20 20 20 20 20 20 53  |0...F          S|
00005160  54 52 45 51 20 20 20 52  31 34 2c 5b 77 70 2c 23  |TREQ   R14,[wp,#|
00005170  74 61 73 6b 68 61 6e 64  6c 65 5d 20 20 20 20 3b  |taskhandle]    ;|
00005180  20 73 74 6f 72 65 20 74  61 73 6b 20 68 61 6e 64  | store task hand|
00005190  6c 65 20 6f 66 20 30 0d  1b 26 20 20 20 20 20 20  |le of 0..&      |
000051a0  20 20 20 20 20 4c 44 4d  46 44 20 20 20 28 73 70  |     LDMFD   (sp|
000051b0  29 21 2c 7b 70 63 7d 0d  1b 30 16 2e 53 65 72 76  |)!,{pc}..0..Serv|
000051c0  69 63 65 5f 53 74 61 72  74 57 69 6d 70 0d 1b 3a  |ice_StartWimp..:|
000051d0  3f 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |?          LDR  |
000051e0  20 20 20 52 31 34 2c 5b  77 70 2c 23 74 61 73 6b  |   R14,[wp,#task|
000051f0  68 61 6e 64 6c 65 5d 20  20 20 20 3b 20 67 65 74  |handle]    ; get|
00005200  20 74 61 73 6b 20 68 61  6e 64 6c 65 0d 1b 44 3d  | task handle..D=|
00005210  20 20 20 20 20 20 20 20  20 20 54 45 51 20 20 20  |          TEQ   |
00005220  20 20 52 31 34 2c 23 30  20 20 20 20 20 20 20 20  |  R14,#0        |
00005230  20 20 20 20 20 20 20 20  20 20 3b 20 61 6d 20 49  |          ; am I|
00005240  20 72 75 6e 6e 69 6e 67  3f 0d 1b 4e 45 20 20 20  | running?..NE   |
00005250  20 20 20 20 20 20 20 4d  56 4e 45 51 20 20 20 52  |       MVNEQ   R|
00005260  31 34 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |14,#0           |
00005270  20 20 20 20 20 20 20 3b  20 69 66 20 6e 6f 74 20  |       ; if not |
00005280  6d 61 6b 65 20 68 61 6e  64 6c 65 20 2d 31 0d 1b  |make handle -1..|
00005290  58 3c 20 20 20 20 20 20  20 20 20 20 53 54 52 45  |X<          STRE|
000052a0  51 20 20 20 52 31 34 2c  5b 77 70 2c 23 74 61 73  |Q   R14,[wp,#tas|
000052b0  6b 68 61 6e 64 6c 65 5d  20 20 20 20 3b 20 61 6e  |khandle]    ; an|
000052c0  64 20 73 74 6f 72 65 20  69 74 0d 1b 62 43 20 20  |d store it..bC  |
000052d0  20 20 20 20 20 20 20 20  41 44 52 45 51 20 20 20  |        ADREQ   |
000052e0  52 30 2c 48 65 6c 70 54  61 62 6c 65 20 20 20 20  |R0,HelpTable    |
000052f0  20 20 20 20 20 20 20 20  3b 20 52 30 20 74 6f 20  |        ; R0 to |
00005300  73 74 61 72 74 20 63 6f  6d 6d 61 6e 64 0d 1b 6c  |start command..l|
00005310  3e 20 20 20 20 20 20 20  20 20 20 ec 51 20 20 20  |>          .Q   |
00005320  52 31 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R1,#0           |
00005330  20 20 20 20 20 20 20 20  3b 20 61 6e 64 20 63 6c  |        ; and cl|
00005340  61 69 6d 20 73 65 72 76  69 63 65 0d 1b 76 20 20  |aim service..v  |
00005350  20 20 20 20 20 20 20 20  20 4c 44 4d 46 44 20 20  |         LDMFD  |
00005360  20 28 73 70 29 21 2c 7b  70 63 7d 0d 1b 80 18 2e  | (sp)!,{pc}.....|
00005370  53 65 72 76 69 63 65 5f  53 74 61 72 74 65 64 57  |Service_StartedW|
00005380  69 6d 70 0d 1b 8a 3f 20  20 20 20 20 20 20 20 20  |imp...?         |
00005390  20 4c 44 52 20 20 20 20  20 52 31 34 2c 5b 77 70  | LDR     R14,[wp|
000053a0  2c 23 74 61 73 6b 68 61  6e 64 6c 65 5d 20 20 20  |,#taskhandle]   |
000053b0  20 3b 20 67 65 74 20 74  61 73 6b 20 68 61 6e 64  | ; get task hand|
000053c0  6c 65 0d 1b 94 39 20 20  20 20 20 20 20 20 20 20  |le...9          |
000053d0  43 4d 4e 20 20 20 20 20  52 31 34 2c 23 31 20 20  |CMN     R14,#1  |
000053e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000053f0  3b 20 69 73 20 69 74 20  2d 31 3f 0d 1b 9e 3c 20  |; is it -1?...< |
00005400  20 20 20 20 20 20 20 20  20 ec 51 20 20 20 52 31  |         .Q   R1|
00005410  34 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |4,#0            |
00005420  20 20 20 20 20 20 3b 20  69 66 20 73 6f 20 6d 61  |      ; if so ma|
00005430  6b 65 20 69 74 20 30 0d  1b a8 3c 20 20 20 20 20  |ke it 0...<     |
00005440  20 20 20 20 20 53 54 52  45 51 20 20 20 52 31 34  |     STREQ   R14|
00005450  2c 5b 77 70 2c 23 74 61  73 6b 68 61 6e 64 6c 65  |,[wp,#taskhandle|
00005460  5d 20 20 20 20 3b 20 61  6e 64 20 73 74 6f 72 65  |]    ; and store|
00005470  20 69 74 0d 1b b2 20 20  20 20 20 20 20 20 20 20  | it...          |
00005480  20 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | LDMFD   (sp)!,{|
00005490  70 63 7d 0d 1b bc 0f 2e  46 69 6c 74 65 72 43 6f  |pc}.....FilterCo|
000054a0  64 65 0d 1b c6 1b 20 20  20 20 20 20 20 20 20 20  |de....          |
000054b0  43 4d 50 20 20 20 20 20  52 30 2c 23 38 0d 1b d0  |CMP     R0,#8...|
000054c0  1c 20 20 20 20 20 20 20  20 20 20 4d 4f 56 4e 45  |.          MOVNE|
000054d0  53 20 20 50 43 2c 52 31  34 0d 1b da 22 20 20 20  |S  PC,R14..."   |
000054e0  20 20 20 20 20 20 20 53  54 4d 46 44 20 20 20 52  |       STMFD   R|
000054f0  31 33 21 2c 7b 52 33 2c  52 34 7d 0d 1b e4 21 20  |13!,{R3,R4}...! |
00005500  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
00005510  20 52 33 2c 5b 52 31 2c  23 32 34 5d 0d 1b ee 1a  | R3,[R1,#24]....|
00005520  20 20 20 20 20 20 20 20  20 20 a4 66 69 6c 74 65  |          .filte|
00005530  72 5f 6b 65 79 73 0d 1b  f8 21 2e 66 69 6c 74 5f  |r_keys...!.filt_|
00005540  65 6e 64 20 53 54 52 20  20 20 20 20 52 33 2c 5b  |end STR     R3,[|
00005550  52 31 2c 23 32 34 5d 0d  1c 02 22 20 20 20 20 20  |R1,#24]..."     |
00005560  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00005570  21 2c 7b 52 33 2c 52 34  7d 0d 1c 0c 1c 20 20 20  |!,{R3,R4}....   |
00005580  20 20 20 20 20 20 20 4d  4f 56 53 20 20 20 20 50  |       MOVS    P|
00005590  43 2c 52 31 34 0d 1c 16  1a 20 20 20 20 20 20 20  |C,R14....       |
000055a0  20 20 20 a4 6d 65 6e 75  5f 62 6c 6f 63 6b 73 0d  |   .menu_blocks.|
000055b0  1c 20 1c 2e 54 41 53 4b  20 20 20 20 20 45 51 55  |. ..TASK     EQU|
000055c0  53 20 20 20 20 22 54 41  53 4b 22 0d 1c 2a 11 2e  |S    "TASK"..*..|
000055d0  6d 65 73 73 61 67 65 5f  6c 69 73 74 0d 1c 34 19  |message_list..4.|
000055e0  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 26  |          EQUD &|
000055f0  34 30 30 43 32 0d 1c 3e  19 20 20 20 20 20 20 20  |400C2..>.       |
00005600  20 20 20 45 51 55 44 20  26 34 30 30 43 33 0d 1c  |   EQUD &400C3..|
00005610  48 14 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |H.          EQUD|
00005620  20 30 0d 1c 52 2b 2e 6d  61 73 6b 20 20 20 20 20  | 0..R+.mask     |
00005630  45 51 55 44 20 20 20 20  25 31 30 30 30 30 30 30  |EQUD    %1000000|
00005640  31 31 30 30 30 30 30 31  31 30 30 30 31 0d 1c 5c  |1100000110001..\|
00005650  2b 2e 66 69 6c 74 6d 61  73 6b 20 45 51 55 44 20  |+.filtmask EQUD |
00005660  20 20 20 25 31 31 31 30  30 30 31 31 31 30 30 30  |   %111000111000|
00005670  30 31 31 31 30 30 31 31  0d 1c 66 1c 2e 66 69 6c  |01110011..f..fil|
00005680  74 6e 61 6d 65 20 45 51  55 53 20 66 69 6c 74 6e  |tname EQUS filtn|
00005690  61 6d 65 24 0d 1c 70 14  20 20 20 20 20 20 20 20  |ame$..p.        |
000056a0  20 20 45 51 55 42 20 30  0d 1c 7a 13 20 20 20 20  |  EQUB 0..z.    |
000056b0  20 20 20 20 20 20 41 4c  49 47 4e 0d 1c 84 1c 2e  |      ALIGN.....|
000056c0  74 61 73 6b 6e 61 6d 65  20 45 51 55 53 20 74 61  |taskname EQUS ta|
000056d0  73 6b 6e 61 6d 65 24 0d  1c 8e 14 20 20 20 20 20  |skname$....     |
000056e0  20 20 20 20 20 45 51 55  42 20 30 0d 1c 98 13 20  |     EQUB 0.... |
000056f0  20 20 20 20 20 20 20 20  20 41 4c 49 47 4e 0d 1c  |         ALIGN..|
00005700  a2 04 0d 1c ac 0c 5d ed  20 70 61 73 73 25 0d 1c  |......]. pass%..|
00005710  b6 2c c8 99 20 22 4f 53  5f 46 69 6c 65 22 2c 31  |.,.. "OS_File",1|
00005720  30 2c 66 69 6c 65 6e 61  6d 65 24 2c 26 46 46 41  |0,filename$,&FFA|
00005730  2c 2c 63 6f 64 65 25 2c  4f 25 0d 1c c0 05 e1 0d  |,,code%,O%......|
00005740  1c ca 05 3a 0d 1c d4 12  dd 20 a4 66 69 6c 74 65  |...:..... .filte|
00005750  72 5f 6b 65 79 73 0d 1c  de 19 ea 20 6c 6f 6f 70  |r_keys..... loop|
00005760  25 2c 66 72 6f 6d 25 2c  74 6f 25 2c 69 6e 24 0d  |%,from%,to%,in$.|
00005770  1c e8 17 e3 20 6c 6f 6f  70 25 3d 31 20 b8 20 72  |.... loop%=1 . r|
00005780  65 6d 61 70 73 25 0d 1c  f2 15 69 6e 24 3d 72 65  |emaps%....in$=re|
00005790  6d 61 70 24 28 6c 6f 6f  70 25 29 0d 1c fc 13 e7  |map$(loop%).....|
000057a0  20 c0 69 6e 24 2c 31 29  3d 22 4b 22 20 8c 0d 1d  | .in$,1)="K" ...|
000057b0  06 1c 20 20 66 72 6f 6d  25 3d a0 28 22 26 22 2b  |..  from%=.("&"+|
000057c0  c1 69 6e 24 2c 32 2c 33  29 29 0d 1d 10 17 20 20  |.in$,2,3))....  |
000057d0  e7 20 a4 6c 65 67 61 6c  28 66 72 6f 6d 25 29 20  |. .legal(from%) |
000057e0  8c 0d 1d 1a 24 20 20 20  20 5b 20 4f 50 54 20 70  |....$    [ OPT p|
000057f0  61 73 73 25 3a 43 4d 50  20 52 33 2c 23 66 72 6f  |ass%:CMP R3,#fro|
00005800  6d 25 20 3a 5d 0d 1d 24  07 20 20 cc 0d 1d 2e 45  |m% :]..$.  ....E|
00005810  20 20 20 20 5b 20 4f 50  54 20 70 61 73 73 25 3a  |    [ OPT pass%:|
00005820  4d 4f 56 20 52 34 2c 23  26 31 30 30 3a 41 44 44  |MOV R4,#&100:ADD|
00005830  20 52 34 2c 52 34 2c 23  28 66 72 6f 6d 25 2d 26  | R4,R4,#(from%-&|
00005840  31 30 30 29 3a 43 4d 50  20 52 33 2c 52 34 20 3a  |100):CMP R3,R4 :|
00005850  5d 0d 1d 38 07 20 20 cd  0d 1d 42 14 20 20 c8 8e  |]..8.  ...B.  ..|
00005860  20 c1 69 6e 24 2c 36 2c  31 29 20 ca 0d 1d 4c 0d  | .in$,6,1) ...L.|
00005870  20 20 20 20 c9 20 22 4b  22 0d 1d 56 1e 20 20 20  |    . "K"..V.   |
00005880  20 20 20 74 6f 25 3d a0  28 22 26 22 2b c1 69 6e  |   to%=.("&"+.in|
00005890  24 2c 37 2c 33 29 29 0d  1d 60 19 20 20 20 20 20  |$,7,3))..`.     |
000058a0  20 e7 20 a4 6c 65 67 61  6c 28 74 6f 25 29 20 8c  | . .legal(to%) .|
000058b0  0d 1d 6a 25 20 20 20 20  20 20 20 20 5b 20 4f 50  |..j%        [ OP|
000058c0  54 20 70 61 73 73 25 3a  ec 51 20 52 33 2c 23 74  |T pass%:.Q R3,#t|
000058d0  6f 25 20 3a 5d 0d 1d 74  0b 20 20 20 20 20 20 cc  |o% :]..t.      .|
000058e0  0d 1d 7e 3e 20 20 20 20  20 20 20 20 5b 20 4f 50  |..~>        [ OP|
000058f0  54 20 70 61 73 73 25 3a  ec 51 20 52 33 2c 23 26  |T pass%:.Q R3,#&|
00005900  31 30 30 3a 41 44 44 45  51 20 52 33 2c 52 33 2c  |100:ADDEQ R3,R3,|
00005910  23 28 74 6f 25 2d 26 31  30 30 29 20 3a 5d 0d 1d  |#(to%-&100) :]..|
00005920  88 0b 20 20 20 20 20 20  cd 0d 1d 92 25 20 20 20  |..      ....%   |
00005930  20 c9 20 22 4e 22 3a 5b  20 4f 50 54 20 70 61 73  | . "N":[ OPT pas|
00005940  73 25 3a ec 51 20 52 30  2c 23 30 20 3a 5d 0d 1d  |s%:.Q R0,#0 :]..|
00005950  9c 0d 20 20 20 20 c9 20  22 4d 22 0d 1d a6 46 20  |..    . "M"...F |
00005960  20 20 20 20 5b 4f 50 54  20 70 61 73 73 25 3a 42  |    [OPT pass%:B|
00005970  4e 45 20 6d 6c 6f 6f 70  65 25 28 6c 6f 6f 70 25  |NE mloope%(loop%|
00005980  29 3a 41 44 52 20 52 33  2c 6d 6c 61 62 65 6c 25  |):ADR R3,mlabel%|
00005990  28 6c 6f 6f 70 25 29 3a  4d 4f 56 20 52 34 2c 52  |(loop%):MOV R4,R|
000059a0  31 0d 1d b0 37 20 20 20  20 20 20 2e 6d 6c 6f 6f  |1...7      .mloo|
000059b0  70 73 25 28 6c 6f 6f 70  25 29 20 4c 44 52 20 52  |ps%(loop%) LDR R|
000059c0  30 2c 5b 52 33 5d 2c 23  34 3a 53 54 52 20 52 30  |0,[R3],#4:STR R0|
000059d0  2c 5b 52 34 5d 2c 23 34  0d 1d ba 42 20 20 20 20  |,[R4],#4...B    |
000059e0  20 20 43 4d 4e 20 52 30  2c 23 31 3a 42 4e 45 20  |  CMN R0,#1:BNE |
000059f0  6d 6c 6f 6f 70 73 25 28  6c 6f 6f 70 25 29 3a 4d  |mloops%(loop%):M|
00005a00  4f 56 20 52 30 2c 23 39  3a 2e 6d 6c 6f 6f 70 65  |OV R0,#9:.mloope|
00005a10  25 28 6c 6f 6f 70 25 29  3a 5d 0d 1d c4 07 20 20  |%(loop%):]....  |
00005a20  cb 0d 1d ce 33 20 20 e7  20 6c 6f 6f 70 25 3c 72  |....3  . loop%<r|
00005a30  65 6d 61 70 73 25 20 8c  20 5b 20 4f 50 54 20 70  |emaps% . [ OPT p|
00005a40  61 73 73 25 3a 42 45 51  20 66 69 6c 74 5f 65 6e  |ass%:BEQ filt_en|
00005a50  64 20 3a 5d 0d 1d d8 05  cd 0d 1d e2 0b ed 20 6c  |d :].......... l|
00005a60  6f 6f 70 25 0d 1d ec 06  3d 30 0d 1d f6 05 3a 0d  |oop%....=0....:.|
00005a70  1e 00 12 dd 20 a4 6d 65  6e 75 5f 62 6c 6f 63 6b  |.... .menu_block|
00005a80  73 0d 1e 0a 15 ea 20 6c  6f 6f 70 25 2c 66 72 6f  |s..... loop%,fro|
00005a90  6d 25 2c 74 6f 24 0d 1e  14 17 e3 20 6c 6f 6f 70  |m%,to$..... loop|
00005aa0  25 3d 31 20 b8 20 72 65  6d 61 70 73 25 0d 1e 1e  |%=1 . remaps%...|
00005ab0  21 20 20 e7 20 c1 72 65  6d 61 70 24 28 6c 6f 6f  |!  . .remap$(loo|
00005ac0  70 25 29 2c 36 2c 31 29  3d 22 4d 22 20 8c 0d 1e  |p%),6,1)="M" ...|
00005ad0  28 1d 20 20 20 20 74 6f  24 3d c1 72 65 6d 61 70  |(.    to$=.remap|
00005ae0  24 28 6c 6f 6f 70 25 29  2c 37 29 0d 1e 32 26 20  |$(loop%),7)..2& |
00005af0  20 20 20 5b 4f 50 54 20  70 61 73 73 25 3a 20 2e  |   [OPT pass%: .|
00005b00  6d 6c 61 62 65 6c 25 28  6c 6f 6f 70 25 29 20 3a  |mlabel%(loop%) :|
00005b10  5d 0d 1e 3c 09 20 20 20  20 f5 0d 1e 46 25 20 20  |]..<.    ...F%  |
00005b20  20 20 20 20 5b 20 4f 50  54 20 70 61 73 73 25 3a  |    [ OPT pass%:|
00005b30  20 45 51 55 44 20 bb 28  74 6f 24 29 20 3a 5d 0d  | EQUD .(to$) :].|
00005b40  1e 50 19 20 20 20 20 20  20 e7 20 a7 74 6f 24 2c  |.P.      . .to$,|
00005b50  22 2c 22 29 3e 30 20 8c  0d 1e 5a 21 20 20 20 20  |",")>0 ...Z!    |
00005b60  20 20 20 20 74 6f 24 3d  c1 74 6f 24 2c a7 74 6f  |    to$=.to$,.to|
00005b70  24 2c 22 2c 22 29 2b 31  29 0d 1e 64 12 20 20 20  |$,",")+1)..d.   |
00005b80  20 20 20 cc 3a 74 6f 24  3d 22 22 0d 1e 6e 0b 20  |   .:to$=""..n. |
00005b90  20 20 20 20 20 cd 0d 1e  78 10 20 20 20 20 fd 20  |     ...x.    . |
00005ba0  74 6f 24 3d 22 22 0d 1e  82 1e 20 20 20 20 5b 20  |to$=""....    [ |
00005bb0  4f 50 54 20 70 61 73 73  25 3a 45 51 55 44 20 2d  |OPT pass%:EQUD -|
00005bc0  31 20 3a 5d 0d 1e 8c 07  20 20 cd 0d 1e 96 0b ed  |1 :]....  ......|
00005bd0  20 6c 6f 6f 70 25 0d 1e  a0 06 3d 30 0d 1e aa 05  | loop%....=0....|
00005be0  3a 0d 1e b4 10 dd 20 a4  6c 65 67 61 6c 28 63 25  |:..... .legal(c%|
00005bf0  29 0d 1e be 13 ea 20 6c  65 67 61 6c 25 2c 73 68  |)..... legal%,sh|
00005c00  69 66 74 25 0d 1e c8 13  e3 20 73 68 69 66 74 25  |ift%..... shift%|
00005c10  3d 30 20 b8 20 31 35 0d  1e d2 29 20 20 41 25 3d  |=0 . 15...)  A%=|
00005c20  63 25 3a 42 25 3d 73 68  69 66 74 25 2a 32 3a 43  |c%:B%=shift%*2:C|
00005c30  25 3d ba 28 63 6f 6e 73  74 5f 63 6f 64 65 25 29  |%=.(const_code%)|
00005c40  0d 1e dc 1e 20 20 e7 20  28 43 25 80 2d 32 35 36  |....  . (C%.-256|
00005c50  29 3d 30 20 8c 20 6c 65  67 61 6c 25 3d b9 0d 1e  |)=0 . legal%=...|
00005c60  e6 0c ed 20 73 68 69 66  74 25 0d 1e f0 0b 3d 6c  |... shift%....=l|
00005c70  65 67 61 6c 25 0d 1e fa  05 3a 0d 1f 04 0b dd 20  |egal%....:..... |
00005c80  a4 64 61 74 65 0d 1f 0e  21 21 64 61 74 65 25 3d  |.date...!!date%=|
00005c90  33 3a c8 99 22 4f 53 5f  57 6f 72 64 22 2c 31 34  |3:.."OS_Word",14|
00005ca0  2c 64 61 74 65 25 0d 1f  18 4e c8 99 22 54 65 72  |,date%...N.."Ter|
00005cb0  72 69 74 6f 72 79 5f 43  6f 6e 76 65 72 74 44 61  |ritory_ConvertDa|
00005cc0  74 65 41 6e 64 54 69 6d  65 22 2c 2d 31 2c 64 61  |teAndTime",-1,da|
00005cd0  74 65 25 2c 64 61 74 65  25 2b 31 36 2c 32 34 30  |te%,date%+16,240|
00005ce0  2c 22 25 64 79 20 25 6d  33 20 25 63 65 25 79 72  |,"%dy %m3 %ce%yr|
00005cf0  22 2b bd 30 0d 1f 22 13  3d a4 63 74 73 28 64 61  |"+.0..".=.cts(da|
00005d00  74 65 25 2b 31 36 29 0d  1f 2c 05 3a 0d 1f 36 43  |te%+16)..,.:..6C|
00005d10  f4 20 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |. ==============|
00005d20  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00005d40  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 0d  |===============.|
00005d50  1f 40 05 3a 0d 1f 4a 1d  dd 20 a4 6d 61 6b 65 6d  |.@.:..J.. .makem|
00005d60  65 6e 75 28 74 69 74 6c  65 24 2c 6d 65 6e 75 24  |enu(title$,menu$|
00005d70  29 0d 1f 54 3c ea 20 62  25 2c 69 74 65 6d 73 25  |)..T<. b%,items%|
00005d80  2c 70 6f 73 25 2c 73 69  7a 65 25 2c 69 64 25 2c  |,pos%,size%,id%,|
00005d90  69 64 73 25 2c 69 24 2c  66 24 2c 66 25 2c 70 25  |ids%,i$,f$,f%,p%|
00005da0  2c 73 75 62 25 2c 6d 61  78 6c 65 6e 25 0d 1f 5e  |,sub%,maxlen%..^|
00005db0  17 6d 61 78 6c 65 6e 25  3d a9 28 74 69 74 6c 65  |.maxlen%=.(title|
00005dc0  24 29 2d 33 0d 1f 68 05  f5 0d 1f 72 1a 20 61 25  |$)-3..h....r. a%|
00005dd0  3d a7 6d 65 6e 75 24 2c  22 7c 22 2c 70 6f 73 25  |=.menu$,"|",pos%|
00005de0  2b 31 29 0d 1f 7c 20 20  69 24 3d c1 6d 65 6e 75  |+1)..|  i$=.menu|
00005df0  24 2c 70 6f 73 25 2b 31  2c 61 25 2d 70 6f 73 25  |$,pos%+1,a%-pos%|
00005e00  2d 31 29 0d 1f 86 24 20  e7 20 a7 69 24 2c 22 bb  |-1)...$ . .i$,".|
00005e10  22 29 20 8c 20 69 24 3d  c0 69 24 2c a7 69 24 2c  |") . i$=.i$,.i$,|
00005e20  22 bb 22 29 2d 31 29 0d  1f 90 2c 20 e7 20 a7 69  |".")-1)..., . .i|
00005e30  24 2c 22 5c 22 29 20 8c  20 66 24 3d c0 69 24 2c  |$,"\") . f$=.i$,|
00005e40  a7 69 24 2c 22 5c 22 29  2d 31 29 20 8b 20 66 24  |.i$,"\")-1) . f$|
00005e50  3d 22 22 0d 1f 9a 17 20  69 24 3d c1 69 24 2c a7  |="".... i$=.i$,.|
00005e60  69 24 2c 22 5c 22 29 2b  31 29 0d 1f a4 2a 20 e7  |i$,"\")+1)...* .|
00005e70  20 a9 28 69 24 29 3e 31  31 20 84 20 a7 66 24 2c  | .(i$)>11 . .f$,|
00005e80  22 49 22 29 20 8c 20 69  64 73 25 2b 3d a9 28 69  |"I") . ids%+=.(i|
00005e90  24 29 2b 31 0d 1f ae 21  20 70 6f 73 25 3d 61 25  |$)+1...! pos%=a%|
00005ea0  3a e7 20 70 6f 73 25 3e  30 20 8c 20 69 74 65 6d  |:. pos%>0 . item|
00005eb0  73 25 2b 3d 31 0d 1f b8  0a fd 20 61 25 3d 30 0d  |s%+=1..... a%=0.|
00005ec0  1f c2 16 73 69 7a 65 25  3d 32 34 2a 69 74 65 6d  |...size%=24*item|
00005ed0  73 25 2b 36 30 0d 1f cc  0e de 20 62 25 20 73 69  |s%+60..... b% si|
00005ee0  7a 65 25 0d 1f d6 2a e7  20 69 64 73 25 3e 30 20  |ze%...*. ids%>0 |
00005ef0  8c 20 69 64 73 25 2b 3d  38 3a de 20 69 64 25 20  |. ids%+=8:. id% |
00005f00  69 64 73 25 3a 69 64 73  25 3d 69 64 25 0d 1f e0  |ids%:ids%=id%...|
00005f10  2c 24 62 25 3d 74 69 74  6c 65 24 3a 62 25 21 31  |,$b%=title$:b%!1|
00005f20  32 3d 26 37 30 32 30 37  3a 62 25 21 32 30 3d 34  |2=&70207:b%!20=4|
00005f30  34 3a 62 25 21 32 34 3d  30 0d 1f ea 0a 70 6f 73  |4:b%!24=0....pos|
00005f40  25 3d 30 0d 1f f4 13 e3  20 6c 25 3d 30 20 b8 20  |%=0..... l%=0 . |
00005f50  69 74 65 6d 73 25 0d 1f  fe 11 20 66 25 3d 30 3a  |items%.... f%=0:|
00005f60  73 75 62 25 3d 2d 31 0d  20 08 19 20 e7 20 6c 25  |sub%=-1. .. . l%|
00005f70  3d 69 74 65 6d 73 25 20  8c 20 66 25 3d 26 38 30  |=items% . f%=&80|
00005f80  0d 20 12 1a 20 61 25 3d  a7 6d 65 6e 75 24 2c 22  |. .. a%=.menu$,"|
00005f90  7c 22 2c 70 6f 73 25 2b  31 29 0d 20 1c 1b 20 e7  ||",pos%+1). .. .|
00005fa0  20 61 25 3d 30 20 8c 20  61 25 3d a9 28 6d 65 6e  | a%=0 . a%=.(men|
00005fb0  75 24 29 2b 31 0d 20 26  20 20 69 24 3d c1 6d 65  |u$)+1. &  i$=.me|
00005fc0  6e 75 24 2c 70 6f 73 25  2b 31 2c 61 25 2d 70 6f  |nu$,pos%+1,a%-po|
00005fd0  73 25 2d 31 29 0d 20 30  11 20 e7 20 a7 69 24 2c  |s%-1). 0. . .i$,|
00005fe0  22 bb 22 29 20 8c 0d 20  3a 18 20 20 69 24 3d c0  |".") .. :.  i$=.|
00005ff0  69 24 2c a7 69 24 2c 22  bb 22 29 2d 31 29 0d 20  |i$,.i$,".")-1). |
00006000  44 32 20 20 73 75 62 25  3d a0 28 c1 6d 65 6e 75  |D2  sub%=.(.menu|
00006010  24 2c 70 6f 73 25 2b a9  28 69 24 29 2b 32 2c 61  |$,pos%+.(i$)+2,a|
00006020  25 2d 70 6f 73 25 2d a9  28 69 24 29 2d 32 29 29  |%-pos%-.(i$)-2))|
00006030  0d 20 4e 06 20 cd 0d 20  58 2c 20 e7 20 a7 69 24  |. N. .. X, . .i$|
00006040  2c 22 5c 22 29 20 8c 20  66 24 3d c0 69 24 2c a7  |,"\") . f$=.i$,.|
00006050  69 24 2c 22 5c 22 29 2d  31 29 20 8b 20 66 24 3d  |i$,"\")-1) . f$=|
00006060  22 22 0d 20 62 17 20 69  24 3d c1 69 24 2c a7 69  |"". b. i$=.i$,.i|
00006070  24 2c 22 5c 22 29 2b 31  29 0d 20 6c 17 20 e7 20  |$,"\")+1). l. . |
00006080  a7 66 24 2c 22 54 22 29  20 8c 20 66 25 2b 3d 31  |.f$,"T") . f%+=1|
00006090  0d 20 76 17 20 e7 20 a7  66 24 2c 22 5f 22 29 20  |. v. . .f$,"_") |
000060a0  8c 20 66 25 2b 3d 32 0d  20 80 17 20 e7 20 a7 66  |. f%+=2. .. . .f|
000060b0  24 2c 22 57 22 29 20 8c  20 66 25 2b 3d 34 0d 20  |$,"W") . f%+=4. |
000060c0  8a 17 20 e7 20 a7 66 24  2c 22 4d 22 29 20 8c 20  |.. . .f$,"M") . |
000060d0  66 25 2b 3d 38 0d 20 94  13 20 70 25 3d 62 25 2b  |f%+=8. .. p%=b%+|
000060e0  32 38 2b 32 34 2a 6c 25  0d 20 9e 23 20 21 70 25  |28+24*l%. .# !p%|
000060f0  3d 66 25 3a 70 25 21 34  3d 73 75 62 25 3a 70 25  |=f%:p%!4=sub%:p%|
00006100  21 38 3d 26 37 30 30 30  30 32 31 0d 20 a8 1c 20  |!8=&7000021. .. |
00006110  e7 20 a9 28 69 24 29 3e  31 31 20 84 20 a7 66 24  |. .(i$)>11 . .f$|
00006120  2c 22 49 22 29 20 8c 0d  20 b2 30 20 20 20 70 25  |,"I") .. .0   p%|
00006130  21 38 2b 3d 26 31 30 30  3a 70 25 21 31 32 3d 69  |!8+=&100:p%!12=i|
00006140  64 73 25 3a 70 25 21 31  36 3d 30 3a 70 25 21 32  |ds%:p%!16=0:p%!2|
00006150  30 3d a9 28 69 24 29 0d  20 bc 1d 20 20 20 24 69  |0=.(i$). ..   $i|
00006160  64 73 25 3d 69 24 3a 69  64 73 25 2b 3d a9 28 69  |ds%=i$:ids%+=.(i|
00006170  24 29 2b 31 0d 20 c6 08  20 20 cc 20 0d 20 d0 12  |$)+1. ..  . . ..|
00006180  20 20 20 24 28 70 25 2b  31 32 29 3d 69 24 0d 20  |   $(p%+12)=i$. |
00006190  da 06 20 cd 0d 20 e4 24  20 e7 20 a9 28 69 24 29  |.. .. .$ . .(i$)|
000061a0  3e 6d 61 78 6c 65 6e 25  20 8c 20 6d 61 78 6c 65  |>maxlen% . maxle|
000061b0  6e 25 3d a9 28 69 24 29  0d 20 ee 0c 20 70 6f 73  |n%=.(i$). .. pos|
000061c0  25 3d 61 25 0d 20 f8 08  ed 20 6c 25 0d 21 02 18  |%=a%. ... l%.!..|
000061d0  62 25 21 31 36 3d 28 6d  61 78 6c 65 6e 25 2b 31  |b%!16=(maxlen%+1|
000061e0  29 3c 3c 34 0d 21 0c 07  3d 62 25 0d 21 16 05 3a  |)<<4.!..=b%.!..:|
000061f0  0d 21 20 16 dd 20 a4 77  69 6e 64 6f 77 6f 70 65  |.! .. .windowope|
00006200  6e 28 77 68 25 29 0d 21  2a 2f 21 6d 69 73 63 62  |n(wh%).!*/!miscb|
00006210  25 3d 77 68 25 3a c8 99  22 57 69 6d 70 5f 47 65  |%=wh%:.."Wimp_Ge|
00006220  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 6d  |tWindowState",,m|
00006230  69 73 63 62 25 0d 21 34  1e e7 20 28 6d 69 73 63  |iscb%.!4.. (misc|
00006240  62 25 21 33 32 29 80 28  31 3c 3c 31 36 29 20 8c  |b%!32).(1<<16) .|
00006250  20 3d b9 0d 21 3e 06 3d  a3 0d 21 48 05 3a 0d 21  | =..!>.=..!H.:.!|
00006260  52 18 dd 20 f2 79 73 63  72 6f 6c 6c 5f 7a 65 72  |R.. .yscroll_zer|
00006270  6f 28 77 68 25 29 0d 21  5c 2f 21 6d 69 73 63 62  |o(wh%).!\/!miscb|
00006280  25 3d 77 68 25 3a c8 99  22 57 69 6d 70 5f 47 65  |%=wh%:.."Wimp_Ge|
00006290  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 6d  |tWindowState",,m|
000062a0  69 73 63 62 25 0d 21 66  3c e7 20 6d 69 73 63 62  |iscb%.!f<. miscb|
000062b0  25 21 32 34 3c 3e 30 20  8c 20 6d 69 73 63 62 25  |%!24<>0 . miscb%|
000062c0  21 32 34 3d 30 3a c8 99  22 57 69 6d 70 5f 4f 70  |!24=0:.."Wimp_Op|
000062d0  65 6e 57 69 6e 64 6f 77  22 2c 2c 6d 69 73 63 62  |enWindow",,miscb|
000062e0  25 0d 21 70 05 e1 0d 21  7a 05 3a 0d 21 84 17 dd  |%.!p...!z.:.!...|
000062f0  20 f2 63 65 6e 74 72 65  77 69 6e 64 6f 77 28 62  | .centrewindow(b|
00006300  25 29 0d 21 8e 1b ea 20  78 73 69 7a 65 25 2c 79  |%).!... xsize%,y|
00006310  73 69 7a 65 25 2c 77 78  25 2c 77 79 25 0d 21 98  |size%,wx%,wy%.!.|
00006320  32 78 73 69 7a 65 25 3d  28 a4 72 65 61 64 6d 6f  |2xsize%=(.readmo|
00006330  64 65 76 61 72 28 31 31  29 2b 31 29 3c 3c 28 a4  |devar(11)+1)<<(.|
00006340  72 65 61 64 6d 6f 64 65  76 61 72 28 34 29 29 0d  |readmodevar(4)).|
00006350  21 a2 32 79 73 69 7a 65  25 3d 28 a4 72 65 61 64  |!.2ysize%=(.read|
00006360  6d 6f 64 65 76 61 72 28  31 32 29 2b 31 29 3c 3c  |modevar(12)+1)<<|
00006370  28 a4 72 65 61 64 6d 6f  64 65 76 61 72 28 35 29  |(.readmodevar(5)|
00006380  29 0d 21 ac 1f 77 78 25  3d 62 25 21 38 2d 21 62  |).!..wx%=b%!8-!b|
00006390  25 3a 77 79 25 3d 62 25  21 31 32 2d 62 25 21 34  |%:wy%=b%!12-b%!4|
000063a0  0d 21 b6 1a 21 62 25 3d  28 78 73 69 7a 65 25 81  |.!..!b%=(xsize%.|
000063b0  32 29 2d 28 77 78 25 81  32 29 0d 21 c0 1b 62 25  |2)-(wx%.2).!..b%|
000063c0  21 34 3d 28 79 73 69 7a  65 25 81 32 29 2d 28 77  |!4=(ysize%.2)-(w|
000063d0  79 25 81 32 29 0d 21 ca  1f 62 25 21 38 3d 21 62  |y%.2).!..b%!8=!b|
000063e0  25 2b 77 78 25 3a 62 25  21 31 32 3d 62 25 21 34  |%+wx%:b%!12=b%!4|
000063f0  2b 77 79 25 0d 21 d4 05  e1 0d 21 de 05 3a 0d 21  |+wy%.!....!..:.!|
00006400  e8 18 dd 20 a4 72 65 61  64 6d 6f 64 65 76 61 72  |... .readmodevar|
00006410  28 76 61 72 25 29 0d 21  f2 0c ea 20 76 61 6c 75  |(var%).!... valu|
00006420  65 25 0d 21 fc 2e c8 99  22 4f 53 5f 52 65 61 64  |e%.!...."OS_Read|
00006430  4d 6f 64 65 56 61 72 69  61 62 6c 65 22 2c 2d 31  |ModeVariable",-1|
00006440  2c 76 61 72 25 20 b8 20  2c 2c 76 61 6c 75 65 25  |,var% . ,,value%|
00006450  0d 22 06 0b 3d 76 61 6c  75 65 25 0d 22 10 05 3a  |."..=value%."..:|
00006460  0d 22 1a 27 dd 20 f2 75  70 64 61 74 65 6c 69 6e  |.".'. .updatelin|
00006470  6b 28 77 62 6c 6f 63 6b  25 2c 6c 69 6e 6b 68 25  |k(wblock%,linkh%|
00006480  2c 69 63 6f 6e 25 29 0d  22 24 10 ea 20 62 25 2c  |,icon%)."$.. b%,|
00006490  42 45 48 49 4e 44 25 0d  22 2e 10 62 25 3d 6d 69  |BEHIND%."..b%=mi|
000064a0  73 63 62 25 2b 34 30 0d  22 38 30 21 6d 69 73 63  |scb%+40."80!misc|
000064b0  62 25 3d 6c 69 6e 6b 68  25 3a c8 99 22 57 69 6d  |b%=linkh%:.."Wim|
000064c0  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
000064d0  2c 6d 69 73 63 62 25 0d  22 42 28 62 65 68 69 6e  |,miscb%."B(behin|
000064e0  64 25 3d 77 62 6c 6f 63  6b 25 21 32 38 3a 77 62  |d%=wblock%!28:wb|
000064f0  6c 6f 63 6b 25 21 32 38  3d 6c 69 6e 6b 68 25 0d  |lock%!28=linkh%.|
00006500  22 4c 35 21 62 25 3d 21  77 62 6c 6f 63 6b 25 3a  |"L5!b%=!wblock%:|
00006510  62 25 21 34 3d 69 63 6f  6e 25 3a c8 99 22 57 69  |b%!4=icon%:.."Wi|
00006520  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00006530  2c 2c 62 25 0d 22 56 32  21 6d 69 73 63 62 25 3d  |,,b%."V2!miscb%=|
00006540  6c 69 6e 6b 68 25 3a c8  99 22 57 69 6d 70 5f 47  |linkh%:.."Wimp_G|
00006550  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00006560  6d 69 73 63 62 25 0d 22  60 15 6d 69 73 63 62 25  |miscb%."`.miscb%|
00006570  21 32 38 3d 62 65 68 69  6e 64 25 0d 22 6a 1d 6d  |!28=behind%."j.m|
00006580  69 73 63 62 25 21 34 3d  77 62 6c 6f 63 6b 25 21  |iscb%!4=wblock%!|
00006590  34 2b 62 25 21 38 2b 32  0d 22 74 1f 6d 69 73 63  |4+b%!8+2."t.misc|
000065a0  62 25 21 38 3d 77 62 6c  6f 63 6b 25 21 31 36 2b  |b%!8=wblock%!16+|
000065b0  62 25 21 31 32 2b 32 0d  22 7e 1f 6d 69 73 63 62  |b%!12+2."~.miscb|
000065c0  25 21 31 32 3d 77 62 6c  6f 63 6b 25 21 34 2b 62  |%!12=wblock%!4+b|
000065d0  25 21 31 36 2b 32 0d 22  88 20 6d 69 73 63 62 25  |%!16+2.". miscb%|
000065e0  21 31 36 3d 77 62 6c 6f  63 6b 25 21 31 36 2b 62  |!16=wblock%!16+b|
000065f0  25 21 32 30 2d 32 0d 22  92 1f c8 99 22 57 69 6d  |%!20-2."...."Wim|
00006600  70 5f 4f 70 65 6e 57 69  6e 64 6f 77 22 2c 2c 6d  |p_OpenWindow",,m|
00006610  69 73 63 62 25 0d 22 9c  20 c8 99 22 57 69 6d 70  |iscb%.". .."Wimp|
00006620  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 77 62  |_OpenWindow",,wb|
00006630  6c 6f 63 6b 25 0d 22 a6  05 e1 0d 22 b0 05 3a 0d  |lock%."...."..:.|
00006640  22 ba 1d dd 20 f2 73 65  74 69 63 6f 6e 28 77 68  |"... .seticon(wh|
00006650  25 2c 69 68 25 2c 65 25  2c 63 25 29 0d 22 c4 35  |%,ih%,e%,c%).".5|
00006660  21 6d 69 73 63 62 25 3d  77 68 25 3a 6d 69 73 63  |!miscb%=wh%:misc|
00006670  62 25 21 34 3d 69 68 25  3a 6d 69 73 63 62 25 21  |b%!4=ih%:miscb%!|
00006680  38 3d 65 25 3a 6d 69 73  63 62 25 21 31 32 3d 63  |8=e%:miscb%!12=c|
00006690  25 0d 22 ce 21 c8 99 22  57 69 6d 70 5f 53 65 74  |%.".!.."Wimp_Set|
000066a0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 6d 69 73 63  |IconState",,misc|
000066b0  62 25 0d 22 d8 05 e1 0d  22 e2 05 3a 0d 22 ec 1e  |b%."...."..:."..|
000066c0  dd 20 f2 75 70 64 61 74  65 77 69 28 77 68 25 2c  |. .updatewi(wh%,|
000066d0  69 68 25 2c 64 61 74 61  24 29 0d 22 f6 3a 21 6d  |ih%,data$).".:!m|
000066e0  69 73 63 62 25 3d 77 68  25 3a 6d 69 73 63 62 25  |iscb%=wh%:miscb%|
000066f0  21 34 3d 69 68 25 3a c8  99 22 57 69 6d 70 5f 47  |!4=ih%:.."Wimp_G|
00006700  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 6d 69  |etIconState",,mi|
00006710  73 63 62 25 0d 23 00 16  24 28 6d 69 73 63 62 25  |scb%.#..$(miscb%|
00006720  21 32 38 29 3d 64 61 74  61 24 0d 23 0a 25 c8 99  |!28)=data$.#.%..|
00006730  22 57 69 6d 70 5f 47 65  74 43 61 72 65 74 50 6f  |"Wimp_GetCaretPo|
00006740  73 69 74 69 6f 6e 22 2c  2c 6d 69 73 63 62 25 0d  |sition",,miscb%.|
00006750  23 14 22 e7 20 21 6d 69  73 63 62 25 3d 77 68 25  |#.". !miscb%=wh%|
00006760  20 80 20 6d 69 73 63 62  25 21 34 3d 69 68 25 20  | . miscb%!4=ih% |
00006770  8c 0d 23 1e 2d e7 20 28  6d 69 73 63 62 25 21 32  |..#.-. (miscb%!2|
00006780  30 29 3e a9 28 64 61 74  61 24 29 20 6d 69 73 63  |0)>.(data$) misc|
00006790  62 25 21 32 30 3d a9 28  64 61 74 61 24 29 0d 23  |b%!20=.(data$).#|
000067a0  28 4e c8 99 22 57 69 6d  70 5f 53 65 74 43 61 72  |(N.."Wimp_SetCar|
000067b0  65 74 50 6f 73 69 74 69  6f 6e 22 2c 21 6d 69 73  |etPosition",!mis|
000067c0  63 62 25 2c 6d 69 73 63  62 25 21 34 2c 6d 69 73  |cb%,miscb%!4,mis|
000067d0  63 62 25 21 38 2c 6d 69  73 63 62 25 21 31 32 2c  |cb%!8,miscb%!12,|
000067e0  2d 31 2c 6d 69 73 63 62  25 21 32 30 0d 23 32 05  |-1,miscb%!20.#2.|
000067f0  cd 0d 23 3c 19 f2 73 65  74 69 63 6f 6e 28 77 68  |..#<..seticon(wh|
00006800  25 2c 69 68 25 2c 30 2c  30 29 0d 23 46 05 e1 0d  |%,ih%,0,0).#F...|
00006810  23 50 05 3a 0d 23 5a 21  dd 20 f2 73 65 74 69 63  |#P.:.#Z!. .setic|
00006820  6f 6e 74 65 78 74 28 77  68 25 2c 69 68 25 2c 74  |ontext(wh%,ih%,t|
00006830  65 78 74 24 29 0d 23 64  1c 21 6d 69 73 63 62 25  |ext$).#d.!miscb%|
00006840  3d 77 68 25 3a 6d 69 73  63 62 25 21 34 3d 69 68  |=wh%:miscb%!4=ih|
00006850  25 0d 23 6e 21 c8 99 22  57 69 6d 70 5f 47 65 74  |%.#n!.."Wimp_Get|
00006860  49 63 6f 6e 53 74 61 74  65 22 2c 2c 6d 69 73 63  |IconState",,misc|
00006870  62 25 0d 23 78 1a e7 20  24 28 6d 69 73 63 62 25  |b%.#x.. $(miscb%|
00006880  21 32 38 29 3d 74 65 78  74 24 20 e1 0d 23 82 16  |!28)=text$ ..#..|
00006890  24 28 6d 69 73 63 62 25  21 32 38 29 3d 74 65 78  |$(miscb%!28)=tex|
000068a0  74 24 0d 23 8c 1a 6d 69  73 63 62 25 21 38 3d 30  |t$.#..miscb%!8=0|
000068b0  3a 6d 69 73 63 62 25 21  31 32 3d 30 0d 23 96 21  |:miscb%!12=0.#.!|
000068c0  c8 99 22 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |.."Wimp_SetIconS|
000068d0  74 61 74 65 22 2c 2c 6d  69 73 63 62 25 0d 23 a0  |tate",,miscb%.#.|
000068e0  05 e1 0d 23 aa 05 3a 0d  23 b4 17 dd 20 a4 73 65  |...#..:.#... .se|
000068f0  6c 69 63 6f 6e 28 77 68  25 2c 69 68 25 29 0d 23  |licon(wh%,ih%).#|
00006900  be 1c 21 6d 69 73 63 62  25 3d 77 68 25 3a 6d 69  |..!miscb%=wh%:mi|
00006910  73 63 62 25 21 34 3d 69  68 25 0d 23 c8 21 c8 99  |scb%!4=ih%.#.!..|
00006920  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
00006930  74 65 22 2c 2c 6d 69 73  63 62 25 0d 23 d2 23 e7  |te",,miscb%.#.#.|
00006940  20 28 6d 69 73 63 62 25  21 32 34 29 80 28 31 3c  | (miscb%!24).(1<|
00006950  3c 32 31 29 20 8c 20 3d  b9 20 8b 20 3d a3 0d 23  |<21) . =. . =..#|
00006960  dc 05 3a 0d 23 e6 15 dd  20 a4 69 6e 64 69 72 28  |..:.#... .indir(|
00006970  77 68 25 2c 69 68 25 29  0d 23 f0 1c 21 6d 69 73  |wh%,ih%).#..!mis|
00006980  63 62 25 3d 77 68 25 3a  6d 69 73 63 62 25 21 34  |cb%=wh%:miscb%!4|
00006990  3d 69 68 25 0d 23 fa 21  c8 99 22 57 69 6d 70 5f  |=ih%.#.!.."Wimp_|
000069a0  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 6d  |GetIconState",,m|
000069b0  69 73 63 62 25 0d 24 04  0e 3d 6d 69 73 63 62 25  |iscb%.$..=miscb%|
000069c0  21 32 38 0d 24 0e 05 3a  0d 24 18 18 dd 20 a4 73  |!28.$..:.$... .s|
000069d0  65 6c 5f 65 73 67 28 77  68 25 2c 65 73 67 25 29  |el_esg(wh%,esg%)|
000069e0  0d 24 22 3c c8 99 22 57  69 6d 70 5f 57 68 69 63  |.$"<.."Wimp_Whic|
000069f0  68 49 63 6f 6e 22 2c 77  68 25 2c 6d 69 73 63 62  |hIcon",wh%,miscb|
00006a00  25 2c 26 33 46 30 30 30  30 2c 28 31 3c 3c 32 31  |%,&3F0000,(1<<21|
00006a10  29 2b 28 65 73 67 25 3c  3c 31 36 29 0d 24 2c 0c  |)+(esg%<<16).$,.|
00006a20  3d 21 6d 69 73 63 62 25  0d 24 36 05 3a 0d 24 40  |=!miscb%.$6.:.$@|
00006a30  0e dd 20 a4 63 74 73 28  70 25 29 0d 24 4a 08 ea  |.. .cts(p%).$J..|
00006a40  20 6f 24 0d 24 54 19 c8  95 20 3f 70 25 3e 33 31  | o$.$T... ?p%>31|
00006a50  20 80 20 a9 28 6f 24 29  3c 32 35 35 0d 24 5e 12  | . .(o$)<255.$^.|
00006a60  6f 24 2b 3d bd 3f 70 25  3a 70 25 2b 3d 31 0d 24  |o$+=.?p%:p%+=1.$|
00006a70  68 05 ce 0d 24 72 07 3d  6f 24 0d 24 7c 05 3a 0d  |h...$r.=o$.$|.:.|
00006a80  24 86 1d dd 20 a4 72 65  70 6f 72 74 28 72 65 70  |$... .report(rep|
00006a90  6f 72 74 24 2c 66 6c 61  67 73 25 29 0d 24 90 29  |ort$,flags%).$.)|
00006aa0  21 65 72 72 62 6c 6f 63  6b 25 3d 32 35 35 3a 24  |!errblock%=255:$|
00006ab0  28 65 72 72 62 6c 6f 63  6b 25 2b 34 29 3d 72 65  |(errblock%+4)=re|
00006ac0  70 6f 72 74 24 0d 24 9a  3c c8 99 22 57 69 6d 70  |port$.$.<.."Wimp|
00006ad0  5f 52 65 70 6f 72 74 45  72 72 6f 72 22 2c 65 72  |_ReportError",er|
00006ae0  72 62 6c 6f 63 6b 25 2c  66 6c 61 67 73 25 2c 65  |rblock%,flags%,e|
00006af0  72 72 6e 61 6d 65 24 20  b8 20 2c 63 6c 69 63 6b  |rrname$ . ,click|
00006b00  25 0d 24 a4 0b 3d 63 6c  69 63 6b 25 0d 24 ae 05  |%.$..=click%.$..|
00006b10  3a 0d 24 b8 0c dd 20 f2  65 72 72 6f 72 0d 24 c2  |:.$... .error.$.|
00006b20  38 e7 20 a4 72 65 70 6f  72 74 28 f6 24 2b 22 20  |8. .report(.$+" |
00006b30  61 74 20 6c 69 6e 65 20  22 2b c3 9e 2b 22 20 2d  |at line "+..+" -|
00006b40  20 71 75 69 74 3f 22 2c  33 29 3d 31 20 71 75 69  | quit?",3)=1 qui|
00006b50  74 25 3d 2d 31 0d 24 cc  05 e1 0d 24 d6 04 0d ff  |t%=-1.$....$....|
00006b60