Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199609.adf » Regulars » StarInfo/Hammond/!ResSave/!RunImage

StarInfo/Hammond/!ResSave/!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_199609.adf » Regulars
Filename: StarInfo/Hammond/!ResSave/!RunImage
Read OK:
File size: 2994 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >!RunImage
   20REM LEN Epsilon 1995
   30REM Register program :
   40REM                  LEN BAU November 1992
   50REM                  By Dave Lawrence
   60REM                  Modifications by Mark Hammond
   70REM All main code by Mark Hammond
   80:
   90ON ERROR IF FNerror(ERR,REPORT$,ERL) THEN PROCclose:END
  100PROCinit
  110PROCcreate_iocn
  120REM ON ERROR IF FNerror(ERR,REPORT$,ERL) THEN PROCclose:END
  130:
  140REPEAT
  150 PROCpoll
  160UNTIL quit%
  170PROCclose
  180END
  190:
  200DEF PROCclose
  210 SYS "Wimp_CloseDown",tsk_handle%,&4B534154
  220 PROCclose_messages(file%)
  230ENDPROC
  240:
  250DEF PROCinit
  260 max%      = 3*1024
  270 buf_size% = 256
  280 DIM b% 600,ws% 600,menspc% 500,ind% 40
  290 DIM file% 16,mem% max%,buffer% buf_size%,s$(4)
  300 wsend%  = ws%+600
  310 menend% = menspc%+500
  320 b%!0  = 0
  330 b%!4  = 1
  340 b%!8  = 2
  350 b%!12 = 3
  360 b%!16 = 5
  370 b%!20 = 10
  380 b%!24 = &502
  390 b%!28 = 0
  400 SYS "Wimp_Initialise",300,&4B534154,"ResSave",b% TO wimp_version%,tsk_handle%
  410 menuptr% = menspc%
  420 menuend% = menspc%+&100
  430 quit%    = FALSE
  440 help%    = 1282
  450 save2%   = FALSE
  460 PROCopen_messages(file%,"<ResSave$Dir>.Messages",mem%,max%)
  470 PROCload_templates
  480 PROCmenu
  490 drag_stop%  = 1
  500 drag_start% = 1
  510 SYS "OS_Byte",161,28 TO ,,cmos
  520 IF (cmos AND 2)=0 drag_start%=-1:drag_stop%=-1
  530ENDPROC
  540:
  550DEF PROCload_templates
  560 SYS "Wimp_OpenTemplate",,"<ResSave$Dir>.Templates"
  570 SYS "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"ProgInfo",0 TO ,,ws%
  580 SYS "Wimp_CreateWindow",,b% TO info%
  590 version% = !(b%+88+32*4+20)
  600 $version%= "2.30 (04-Dec-95)"
  610 SYS "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"saveas",0 TO ,,ws%
  620 savestr% = !(b%+88+32*1+20)
  630 modstr%  = !(b%+88+32*4+20)
  640 SYS "Wimp_CreateWindow",,b% TO saveas%
  650 !b%=saveas%
  660 SYS "Wimp_GetWindowState",,b%
  670 SYS "Wimp_CloseTemplate"
  680ENDPROC
  690:
  700DEF PROCmenu
  710 mainmenu%   = menuptr%
  720 menumax%    = 7
  730 menuptr%!20 = 44
  740 $menuptr%   = "ResSave"
  750 menuptr%?12 = 7
  760 menuptr%?13 = 2
  770 menuptr%?14 = 7
  780 menuptr%?15 = 0
  790 maxaddr%    = menuptr%+16
  800 menuptr%!24 = 0
  810 menuptr%   += 28
  820 menu0$      = FNmessage(file%,"menu0")
  830 menu1$      = FNmessage(file%,"menu1")
  840 PROCadd_item(menu0$,info%)
  850 PROCadd_item(menu1$,-1)
  860 menuptr%!-24 = &80
  870 !maxaddr%    = menumax%*16+32
  880ENDPROC
  890:
  900DEF PROCadd_item(text$,submenu%)
  910 menuptr%!0     = 0
  920 menuptr%!4     = submenu%
  930 menuptr%!8     = &07000021
  940 $(menuptr%+12) = text$
  950 menuptr%      += 24
  960ENDPROC
  970:
  980DEF PROCcreate_iocn
  990 DIM icon% 32, itext% 12, isprite% 12
 1000 !icon%      = -1
 1010 icon%!4     = 0
 1020 icon%!8     = 0
 1030 icon%!12    = 68
 1040 icon%!16    = 68
 1050 icon%!20    = &3002
 1060 $(icon%+24) = "!ResSave"+CHR$(13)
 1070 SYS "Wimp_CreateIcon",,icon% TO bar_icon%
 1080ENDPROC
 1090:
 1100DEF PROCpoll
 1110 SYS "Wimp_Poll",,b% TO r%
 1120 CASE r% OF
 1130   WHEN 2:SYS "Wimp_OpenWindow",,b%
 1140   WHEN 3:SYS "Wimp_CloseWindow",,b%
 1150   WHEN 6:PROCmouse
 1160   WHEN 7:PROCdrag_end
 1170   WHEN 8:PROCkey
 1180   WHEN 9:PROCmenu_click
 1190   WHEN 17,18:PROCreceive
 1200 ENDCASE
 1210ENDPROC
 1220:
 1230DEF PROCreceive
 1240 LOCAL c%
 1250 c%=b%+400
 1260 CASE b%!16 OF
 1270   WHEN 0:quit%=TRUE
 1280   WHEN 2
 1290     CASE save2% OF
 1300       WHEN TRUE:PROCsave2
 1310       WHEN FALSE:PROCsave1
 1320     ENDCASE
 1330   WHEN 3:save2%=FALSE:PROCload
 1340   WHEN &502:PROCsend_help
 1350 ENDCASE
 1360ENDPROC
 1370:
 1380DEF PROCmouse
 1390 CASE b%!12 OF
 1400   WHEN -2:CASE b%!8 OF
 1410             WHEN 2:PROCshow_menu(mainmenu%,b%!0-64,96+2*44)
 1420           ENDCASE
 1430   WHEN saveas%:PROCsave_as_click
 1440 ENDCASE
 1450ENDPROC
 1460:
 1470DEF PROCshow_menu(menu%,x%,y%)
 1480 topmenu% = menu%
 1490 topx%    = x%
 1500 topy%    = y%
 1510 SYS "Wimp_CreateMenu",,menu%,x%,y%
 1520ENDPROC
 1530:
 1540DEF PROCmenu_click
 1550 LOCAL c%
 1560 c% = b%+400
 1570 SYS "Wimp_GetPointerInfo",,c%
 1580 adj% = (b%!8 AND 1)
 1590 SYS "Wimp_DecodeMenu",,topmenu%,b%,c%
 1600 CASE $c% OF
 1610   WHEN menu1$:quit%=TRUE
 1620 ENDCASE
 1630 IF adj% PROCshow_menu(topmenu%,topx%,topy%)
 1640ENDPROC
 1650:
 1660DEF PROCkey
 1670 key% = b%!24
 1680 SYS "Wimp_ProcessKey",key%
 1690ENDPROC
 1700:
 1710DEF PROCset_valid(window%,icon%,vald$)
 1720 !b%  = window%
 1730 b%!4 = icon%
 1740 SYS "Wimp_GetIconState",,b%
 1750 $b%!32 = vald$
 1760 b%!8   = 0
 1770 b%!12  = 0
 1780 SYS "Wimp_SetIconState",,b%
 1790ENDPROC
 1800:
 1810DEF PROCget_origin(handle%,RETURN xorig%,RETURN yorig%)
 1820 LOCAL c%
 1830 c%  = b%+400
 1840 !c% = handle%
 1850 SYS "Wimp_GetWindowState",,c%
 1860 xorig% = c%!4-c%!20
 1870 yorig% = c%!16-c%!24
 1880ENDPROC
 1890:
 1900DEF PROCterm(a%)
 1910 LOCAL i%
 1920 WHILE a%?i%>31
 1930   i%+=1
 1940 ENDWHILE
 1950 a%?i%=13
 1960ENDPROC
 1970:
 1980DEF PROCload
 1990 LOCAL i%
 2000 PROCgrey(saveas%,6)
 2010 PROCterm(b%+44)
 2020 type%          = b%!40
 2030 file_len%      = b%!36
 2040 full_pathname$ = $(b%+44)
 2050 lenpath%=LEN full_pathname$
 2060 co% = 0
 2070 WHILE LEFT$(RIGHT$(full_pathname$,i%),1)<>"."
 2080   i%+=1
 2090 ENDWHILE
 2100 pathname$=LEFT$(full_pathname$,lenpath%-i%)
 2110 b%!12 = b%!8
 2120 b%!16 = 4
 2130 SYS "Wimp_SendMessage",17,b%,b%!4
 2140 i%=0
 2150 WHILE LEFT$(RIGHT$(full_pathname$,i%),1)<>"."
 2160   i%+=1
 2170 ENDWHILE
 2180 icon$="":drag_icon$=""
 2190 file$=RIGHT$(full_pathname$,i%-1)
 2200 IF type%=&1000 THEN
 2210   icon$      = "SDirectory"
 2220   drag_icon$ = "Directory"
 2230 ENDIF
 2240 IF type%=&2000 THEN
 2250   icon$      = "S"+FNapp_sp(file$)
 2260   drag_icon$ = FNapp_sp(file$)
 2270 ENDIF
 2280 IF type%<&1000 THEN
 2290   icon$      = "S"+FNfile_sp(STR$~(type%))
 2300   drag_icon$ = FNfile_sp(STR$~(type%))
 2310 ENDIF
 2320 IF icon$="" THEN
 2330   icon$      = "SFile_xxx"
 2340   drag_icon$ = "File_xxx"
 2350 ENDIF
 2360 PROCset_valid(saveas%,0,icon$+CHR$(13))
 2370 $(savestr%) = file$
 2380 $(modstr%)  = file$+"Mod"
 2390 !b%         = saveas%
 2400 SYS "Wimp_GetWindowState",,b%
 2410 b%!32 = b%!32 OR 16
 2420 SYS "Wimp_OpenWindow",,b%
 2430 PROCredraw_and_to_top(saveas%)
 2440 $(savestr%) = file$
 2450ENDPROC
 2460:
 2470DEF PROCredraw_and_to_top(window%)
 2480 LOCAL c%
 2490 c%=b%+400
 2500 !c%=window%
 2510 SYS "Wimp_GetWindowState",,c%
 2520 SYS "Wimp_CloseWindow",,c%
 2530 SYS "Wimp_GetWindowState",,c%
 2540 b%!32 = b%!32 OR 16
 2550 SYS "Wimp_OpenWindow",,c%
 2560ENDPROC
 2570:
 2580DEF PROCsave_as_click
 2590 CASE b%!16 OF
 2600   WHEN 0:IF b%!8=16 OR b%!8=64 THEN PROCdrag(b%!12,0)
 2610   WHEN 6
 2620     IF save2% THEN
 2630       $(b%+44)="#not#"
 2640       PROCsave2
 2650     ENDIF
 2660   WHEN 7
 2670     !b%=saveas%
 2680     SYS "Wimp_GetWindowState",,b%
 2690     SYS "Wimp_CloseWindow",,b%
 2700 ENDCASE
 2710ENDPROC
 2720:
 2730DEF PROCdrag(window%,icon%)
 2740 LOCAL c%
 2750 c%=b%+400
 2760 PROCget_origin(window%,xorig%,yorig%)
 2770 !c%=window%:c%!4=icon%
 2780 SYS "Wimp_GetIconState",,c%
 2790 xmin% = xorig%+c%!8
 2800 ymin% = yorig%+c%!12
 2810 xmax% = xorig%+c%!16
 2820 ymax% = yorig%+c%!20
 2830 c%!4  = 5
 2840 c%!8  = xmin%
 2850 c%!12 = ymin%
 2860 c%!16 = xmax%
 2870 c%!20 = ymax%
 2880 c%!24 = 0
 2890 c%!28 = 0
 2900 c%!32 = 1280
 2910 c%!26 = 1024
 2920 IF drag_start%=-1 THEN
 2930    SYS "Wimp_DragBox",,c%
 2940  ELSE
 2950    SYS "DragASprite_Start",%11000101,1,drag_icon$,c%+8,c%+24
 2960 ENDIF
 2970ENDPROC
 2980:
 2990DEF PROCsave1
 3000 fileb$    = $savestr%
 3010 mod_name$ = $modstr%
 3020 PROCterm(b%+44)
 3030 destination$ = $(b%+44)
 3040 destination$ = destination$+fileb$
 3050 res%         = INSTR(destination$,"Resources:$")
 3060 IF res%=0 THEN
 3070   PROCnot_resources
 3080   ENDPROC
 3090 ENDIF
 3100 PROCsave_window("File_FFA")
 3110 save2%=TRUE
 3120 PROCungrey(saveas%,6)
 3130ENDPROC
 3140:
 3150DEF PROCsave2
 3160 PROCterm(b%+44)
 3170 savedest$=$(b%+44)
 3180 savedest$=savedest$+$savestr%
 3190 task$ = "<Register$Dir>.Register -"+mod_name$+" -"+pathname$+"."+file$+" -"+destination$+" -"+savedest$
 3200 SYS "Wimp_StartTask",task$
 3210 save2%=FALSE
 3220 !b%=saveas%
 3230 SYS "Wimp_GetWindowState",,b%
 3240 SYS "Wimp_CloseWindow",,b%
 3250ENDPROC
 3260:
 3270DEF PROCsave_window(filetype$)
 3280 icon$="S"+filetype$
 3290 drag_icon$=filetype$
 3300 PROCset_valid(saveas%,0,icon$+CHR$(13))
 3310 $savestr%="Outcome"
 3320 PROCredraw_and_to_top(saveas%)
 3330ENDPROC
 3340:
 3350DEF PROCdrag_end
 3360 SYS "Wimp_GetPointerInfo",,b%
 3370 b%!20 = b%!12
 3380 b%!24 = b%!16
 3390 b%!28 = b%!0
 3400 b%!32 = b%!4
 3410 a$    = $savestr%
 3420 !b%   = 44+((LEN file$+1) DIV 4)*4
 3430 IF ((LEN file$+1) MOD 4)<>0 !b%+=4
 3440 b%!12 = 0
 3450 b%!16 = 1
 3460 b%!44 = 0
 3470 SYS "Wimp_SendMessage",18,b%,b%!20
 3480ENDPROC
 3490:
 3500DEF PROCnot_resources
 3510 rep$ = FNmessage(file%,"NotRes")
 3520 d%   = FNerror(1<<31,rep$,100)
 3530ENDPROC
 3540:
 3550DEF FNerror(err%,rep$,erl%)
 3560 ON ERROR VDU 4:REPORT:PRINT " at line ";ERL:END
 3570 !b% = ERR
 3580 CASE err% OF
 3590   WHEN 1<<30:err_string$=" "
 3600              box% = %11
 3610   WHEN 1<<31:err_string$=" "
 3620              box% = %10
 3630   OTHERWISE :err_string$=" at line "+STR$ erl%
 3640              box% = %10
 3650 ENDCASE
 3660 $(b%+4) = rep$+err_string$+CHR$0
 3670 SYS "Wimp_ReportError",b%,box%,"ResSave" TO ,response%
 3680=(response%=2)
 3690:
 3700DEF PROCsend_help
 3710 b%!12  = b%!8
 3720 b%!16  = 1283
 3730 help%  = b%+20
 3740 help%  = FNhelp(b%!32,b%!36,help%)
 3750 ?help% = 0
 3760 !b%    = (help%+4-b%)AND NOT 3
 3770 SYS "Wimp_SendMessage",17,b%,b%!4
 3780ENDPROC
 3790:
 3800DEF FNhelp(window%,icon%,to%)
 3810 m$ = $modstr%
 3820 f$ = $savestr%
 3830 $to%=""
 3840 CASE window% OF
 3850   WHEN info%
 3860     $to%=FNmessage(file%,"Hinfo")
 3870   WHEN saveas%
 3880     CASE icon% OF
 3890       WHEN 0
 3900         CASE save2% OF
 3910           WHEN TRUE
 3920             $to% = FNmessage(file%,"Hmain0b:"+f$+":"+m$)
 3930           WHEN FALSE
 3940             $to% = FNmessage(file%,"Hmain0a:"+f$+":"+m$)
 3950         ENDCASE
 3960       WHEN 1
 3970         CASE save2% OF
 3980           WHEN TRUE
 3990             $to% = FNmessage(file%,"Hmain1b")
 4000           WHEN FALSE
 4010             $to% = FNmessage(file%,"Hmain1a")
 4020         ENDCASE
 4030       WHEN 4
 4040         $to% = FNmessage(file%,"Hmain4")
 4050       WHEN 6
 4060         CASE save2% OF
 4070           WHEN TRUE
 4080             $to% = FNmessage(file%,"Hmain6")
 4090         ENDCASE
 4100       WHEN 7
 4110         $to% = FNmessage(file%,"Hmain7")
 4120      OTHERWISE
 4130         $to% = FNmessage(file%,"Hmain")
 4140     ENDCASE
 4150   WHEN -2:$to% = FNmessage(file%,"Hbar")
 4160  OTHERWISE
 4170   IF wimp_version%>=218 AND icon%<>-1 THEN
 4180     SYS "Wimp_GetMenuState",1,b%+400,window%,icon%
 4190     CASE b%!400 OF
 4200       WHEN 0
 4210         IF b%!404=-1 $to% = FNmessage(file%,"Hmen0")
 4220       WHEN 1
 4230         $to% = FNmessage(file%,"Hmen1")
 4240     ENDCASE
 4250   ENDIF
 4260 ENDCASE
 4270=to%+LEN($to%)
 4280:
 4290DEF PROCgrey(win%,icon%)
 4300 LOCAL c%
 4310 c%=b%+400
 4320 !c%  =win%
 4330 c%!4 =icon%
 4340 c%!8 =1<<22
 4350 c%!12=1<<22
 4360 SYS "Wimp_SetIconState",,c%
 4370ENDPROC
 4380:
 4390DEF PROCungrey(win%,icon%)
 4400 LOCAL c%
 4410 c%=b%+400
 4420 !c%  =win%
 4430 c%!4 =icon%
 4440 c%!8 =0
 4450 c%!12=1<<22
 4460 SYS "Wimp_SetIconState",,c%
 4470ENDPROC
 4480:
 4490DEF FNapp_sp(sp$)
 4500 SYS "XWimp_SpriteOp",40,,sp$ TO err%;flags%
 4510 IF (flags% AND 1) <> 0 sp$="Application"
 4520=sp$
 4530:
 4540DEF FNfile_sp(sp$)
 4550 sp$="File_"+sp$
 4560 SYS "XWimp_SpriteOp",40,,sp$ TO err%;flags%
 4570 IF (flags% AND 1) <> 0 sp$="File_???"
 4580=sp$
 4590:
 4600DEF PROCopen_messages(wibble%,mesfile$,buffer%,size%)
 4610 SYS "MessageTrans_FileInfo",,mesfile$ TO flag%,,len%
 4620 IF flag% AND 1 THEN
 4630   len%=0
 4640   buffer%=0
 4650  ELSE
 4660   buffer%=mem%
 4670 ENDIF
 4680 IF len%>size% ERROR 1,"Please increase max%"
 4690 SYS "MessageTrans_OpenFile",wibble%,mesfile$,buffer%
 4700ENDPROC
 4710:
 4720DEF PROCclose_messages(wibble%)
 4730 SYS "MessageTrans_CloseFile",wibble%
 4740ENDPROC
 4750:
 4760DEF FNmessage(wibble%,mess$)
 4770 token$ = FNsplit(mess$)
 4780 SYS "MessageTrans_Lookup",wibble%,token$,buffer%,buf_size%,s$(1),s$(2),s$(3),s$(4) TO ,,,len%
 4790 buffer%?len% = 13
 4800=$buffer%
 4810:
 4820DEF FNsplit(str$)
 4830 LOCAL i%
 4840 i%   = 0
 4850 s$() = ""
 4860 WHILE str$<>""
 4870   col%   = INSTR(str$+":",":")
 4880   s$(i%) = LEFT$(str$,col%-1)
 4890   str$   = MID$(str$,col%+1)
 4900   i%    += 1
 4910 ENDWHILE
 4920=s$(0)

� >!RunImage
� � Epsilon 1995
� Register program :
(*�                  � BAU November 1992
2'�                  By Dave Lawrence
<4�                  Modifications by Mark Hammond
F#� All main code by Mark Hammond
P:
Z#� � � �error(�,�$,�) � �close:�
d	�init
n�create_iocn
x=� ON ERROR IF FNerror(ERR,REPORT$,ERL) THEN PROCclose:END
�:
��
�
 �poll
�� quit%
�
�close
��
�:
�� �close
�. ș "Wimp_CloseDown",tsk_handle%,&4B534154
� �close_messages(file%)
��
�:
�� �init
 max%      = 3*1024
 buf_size% = 256
) � b% 600,ws% 600,menspc% 500,ind% 40
"1 � file% 16,mem% max%,buffer% buf_size%,s$(4)
, wsend%  = ws%+600
6 menend% = menspc%+500
@ b%!0  = 0
J b%!4  = 1
T b%!8  = 2
^ b%!12 = 3
h b%!16 = 5
r b%!20 = 10
| b%!24 = &502
� b%!28 = 0
�P ș "Wimp_Initialise",300,&4B534154,"ResSave",b% � wimp_version%,tsk_handle%
� menuptr% = menspc%
� menuend% = menspc%+&100
� quit%    = �
� help%    = 1282
� save2%   = �
�= �open_messages(file%,"<ResSave$Dir>.Messages",mem%,max%)
� �load_templates
�
 �menu
� drag_stop%  = 1
� drag_start% = 1
�! ș "OS_Byte",161,28 � ,,cmos
0 � (cmos � 2)=0 drag_start%=-1:drag_stop%=-1
�
:
&� �load_templates
06 ș "Wimp_OpenTemplate",,"<ResSave$Dir>.Templates"
:B ș "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"ProgInfo",0 � ,,ws%
D' ș "Wimp_CreateWindow",,b% � info%
N  version% = !(b%+88+32*4+20)
X" $version%= "2.30 (04-Dec-95)"
b@ ș "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"saveas",0 � ,,ws%
l  savestr% = !(b%+88+32*1+20)
v  modstr%  = !(b%+88+32*4+20)
�) ș "Wimp_CreateWindow",,b% � saveas%
� !b%=saveas%
�! ș "Wimp_GetWindowState",,b%
� ș "Wimp_CloseTemplate"
��
�:
�� �menu
� mainmenu%   = menuptr%
� menumax%    = 7
� menuptr%!20 = 44
� $menuptr%   = "ResSave"
� menuptr%?12 = 7
� menuptr%?13 = 2
 menuptr%?14 = 7
 menuptr%?15 = 0
 maxaddr%    = menuptr%+16
  menuptr%!24 = 0
* menuptr%   += 28
4* menu0$      = �message(file%,"menu0")
>* menu1$      = �message(file%,"menu1")
H �add_item(menu0$,info%)
R �add_item(menu1$,-1)
\ menuptr%!-24 = &80
f" !maxaddr%    = menumax%*16+32
p�
z:
�� �add_item(text$,submenu%)
� menuptr%!0     = 0
� menuptr%!4     = submenu%
� menuptr%!8     = &07000021
� $(menuptr%+12) = text$
� menuptr%      += 24
��
�:
�� �create_iocn
�' � icon% 32, itext% 12, isprite% 12
� !icon%      = -1
� icon%!4     = 0
� icon%!8     = 0
 icon%!12    = 68
 icon%!16    = 68
 icon%!20    = &3002
$# $(icon%+24) = "!ResSave"+�(13)
., ș "Wimp_CreateIcon",,icon% � bar_icon%
8�
B:
L� �poll
V ș "Wimp_Poll",,b% � r%
` Ȏ r% �
j#   � 2:ș "Wimp_OpenWindow",,b%
t$   � 3:ș "Wimp_CloseWindow",,b%
~   � 6:�mouse
�   � 7:�drag_end
�   � 8:�key
�   � 9:�menu_click
�   � 17,18:�receive
� �
��
�:
�� �receive
�	 � c%
� c%=b%+400
� Ȏ b%!16 �
�   � 0:quit%=�

   � 2

     Ȏ save2% �
       � �:�save2
       � �:�save1
(
     �
2   � 3:save2%=�:�load
<   � &502:�send_help
F �
P�
Z:
d� �mouse
n Ȏ b%!12 �
x   � -2:Ȏ b%!8 �
�:             � 2:�show_menu(mainmenu%,b%!0-64,96+2*44)
�           �
�   � saveas%:�save_as_click
� �
��
�:
�� �show_menu(menu%,x%,y%)
� topmenu% = menu%
� topx%    = x%
� topy%    = y%
�& ș "Wimp_CreateMenu",,menu%,x%,y%
��
�:
� �menu_click
	 � c%
 c% = b%+400
"! ș "Wimp_GetPointerInfo",,c%
, adj% = (b%!8 � 1)
6) ș "Wimp_DecodeMenu",,topmenu%,b%,c%
@
 Ȏ $c% �
J   � menu1$:quit%=�
T �
^, � adj% �show_menu(topmenu%,topx%,topy%)
h�
r:
|
� �key
� key% = b%!24
� ș "Wimp_ProcessKey",key%
��
�:
�%� �set_valid(window%,icon%,vald$)
� !b%  = window%
� b%!4 = icon%
� ș "Wimp_GetIconState",,b%
� $b%!32 = vald$
� b%!8   = 0
� b%!12  = 0
� ș "Wimp_SetIconState",,b%
��
:
,� �get_origin(handle%,� xorig%,� yorig%)
	 � c%
& c%  = b%+400
0 !c% = handle%
:! ș "Wimp_GetWindowState",,c%
D xorig% = c%!4-c%!20
N yorig% = c%!16-c%!24
X�
b:
l� �term(a%)
v	 � i%
� ȕ a%?i%>31
�   i%+=1
� �
�
 a%?i%=13
��
�:
�� �load
�	 � i%
� �grey(saveas%,6)
� �term(b%+44)
� type%          = b%!40
� file_len%      = b%!36
� full_pathname$ = $(b%+44)
 lenpath%=� full_pathname$
 co% = 0
$ ȕ ��full_pathname$,i%),1)<>"."
    i%+=1
* �
4+ pathname$=�full_pathname$,lenpath%-i%)
> b%!12 = b%!8
H b%!16 = 4
R% ș "Wimp_SendMessage",17,b%,b%!4
\	 i%=0
f$ ȕ ��full_pathname$,i%),1)<>"."
p   i%+=1
z �
� icon$="":drag_icon$=""
�  file$=�full_pathname$,i%-1)
� � type%=&1000 �
�    icon$      = "SDirectory"
�   drag_icon$ = "Directory"
� �
� � type%=&2000 �
�&   icon$      = "S"+�app_sp(file$)
�"   drag_icon$ = �app_sp(file$)
� �
� � type%<&1000 �
�+   icon$      = "S"+�file_sp(�~(type%))
�'   drag_icon$ = �file_sp(�~(type%))
	 �
	 � icon$="" �
	   icon$      = "SFile_xxx"
	$   drag_icon$ = "File_xxx"
	. �
	8& �set_valid(saveas%,0,icon$+�(13))
	B $(savestr%) = file$
	L $(modstr%)  = file$+"Mod"
	V !b%         = saveas%
	`! ș "Wimp_GetWindowState",,b%
	j b%!32 = b%!32 � 16
	t ș "Wimp_OpenWindow",,b%
	~  �redraw_and_to_top(saveas%)
	� $(savestr%) = file$
	��
	�:
	�!� �redraw_and_to_top(window%)
	�	 � c%
	� c%=b%+400
	� !c%=window%
	�! ș "Wimp_GetWindowState",,c%
	� ș "Wimp_CloseWindow",,c%
	�! ș "Wimp_GetWindowState",,c%
	� b%!32 = b%!32 � 16
	� ș "Wimp_OpenWindow",,c%
�

:
� �save_as_click
 Ȏ b%!16 �
(/   � 0:� b%!8=16 � b%!8=64 � �drag(b%!12,0)
2
   � 6
<     � save2% �
F       $(b%+44)="#not#"
P       �save2
Z
     �
d
   � 7
n     !b%=saveas%
x%     ș "Wimp_GetWindowState",,b%
�"     ș "Wimp_CloseWindow",,b%
� �
��
�:
�� �drag(window%,icon%)
�	 � c%
� c%=b%+400
�' �get_origin(window%,xorig%,yorig%)
� !c%=window%:c%!4=icon%
� ș "Wimp_GetIconState",,c%
� xmin% = xorig%+c%!8
� ymin% = yorig%+c%!12
� xmax% = xorig%+c%!16
 ymax% = yorig%+c%!20
 c%!4  = 5
 c%!8  = xmin%
" c%!12 = ymin%
, c%!16 = xmax%
6 c%!20 = ymax%
@ c%!24 = 0
J c%!28 = 0
T c%!32 = 1280
^ c%!26 = 1024
h � drag_start%=-1 �
r    ș "Wimp_DragBox",,c%
|  �
�@    ș "DragASprite_Start",%11000101,1,drag_icon$,c%+8,c%+24
� �
��
�:
�� �save1
� fileb$    = $savestr%
� mod_name$ = $modstr%
� �term(b%+44)
� destination$ = $(b%+44)
�' destination$ = destination$+fileb$
�0 res%         = �destination$,"Resources:$")
� � res%=0 �
�   �not_resources
   �
 �
 �save_window("File_FFA")
&
 save2%=�
0 �ungrey(saveas%,6)
:�
D:
N� �save2
X �term(b%+44)
b savedest$=$(b%+44)
l" savedest$=savedest$+$savestr%
vl task$ = "<Register$Dir>.Register -"+mod_name$+" -"+pathname$+"."+file$+" -"+destination$+" -"+savedest$
� ș "Wimp_StartTask",task$
�
 save2%=�
� !b%=saveas%
�! ș "Wimp_GetWindowState",,b%
� ș "Wimp_CloseWindow",,b%
��
�:
�� �save_window(filetype$)
� icon$="S"+filetype$
� drag_icon$=filetype$
�& �set_valid(saveas%,0,icon$+�(13))
� $savestr%="Outcome"
�  �redraw_and_to_top(saveas%)

�

:

� �drag_end

 ! ș "Wimp_GetPointerInfo",,b%

* b%!20 = b%!12

4 b%!24 = b%!16

> b%!28 = b%!0

H b%!32 = b%!4

R a$    = $savestr%

\# !b%   = 44+((� file$+1) � 4)*4

f" � ((� file$+1) � 4)<>0 !b%+=4

p b%!12 = 0

z b%!16 = 1

� b%!44 = 0

�& ș "Wimp_SendMessage",18,b%,b%!20

��

�:

�� �not_resources

�$ rep$ = �message(file%,"NotRes")

�" d%   = �error(1<<31,rep$,100)

��

�:

�� �error(err%,rep$,erl%)

�  � � � 4:�:� " at line ";�:�

� !b% = �

� Ȏ err% �
   � 1<<30:err_string$=" "
              box% = %11
   � 1<<31:err_string$=" "
$              box% = %10
.(    :err_string$=" at line "+� erl%
8              box% = %10
B �
L" $(b%+4) = rep$+err_string$+�0
V9 ș "Wimp_ReportError",b%,box%,"ResSave" � ,response%
`=(response%=2)
j:
t� �send_help
~ b%!12  = b%!8
� b%!16  = 1283
� help%  = b%+20
�& help%  = �help(b%!32,b%!36,help%)
� ?help% = 0
� !b%    = (help%+4-b%)� � 3
�% ș "Wimp_SendMessage",17,b%,b%!4
��
�:
�� �help(window%,icon%,to%)
� m$ = $modstr%
� f$ = $savestr%
� $to%=""
 Ȏ window% �

   � info%
%     $to%=�message(file%,"Hinfo")
   � saveas%
(     Ȏ icon% �
2       � 0
<         Ȏ save2% �
F           � �
P<             $to% = �message(file%,"Hmain0b:"+f$+":"+m$)
Z           � �
d<             $to% = �message(file%,"Hmain0a:"+f$+":"+m$)
n         �
x       � 1
�         Ȏ save2% �
�           � �
�1             $to% = �message(file%,"Hmain1b")
�           � �
�1             $to% = �message(file%,"Hmain1a")
�         �
�       � 4
�,         $to% = �message(file%,"Hmain4")
�       � 6
�         Ȏ save2% �
�           � �
�0             $to% = �message(file%,"Hmain6")
�         �
       � 7
,         $to% = �message(file%,"Hmain7")
      
"+         $to% = �message(file%,"Hmain")
,
     �
6)   � -2:$to% = �message(file%,"Hbar")
@  
J)   � wimp_version%>=218 � icon%<>-1 �
T6     ș "Wimp_GetMenuState",1,b%+400,window%,icon%
^     Ȏ b%!400 �
h       � 0
r7         � b%!404=-1 $to% = �message(file%,"Hmen0")
|       � 1
�+         $to% = �message(file%,"Hmen1")
�
     �
�   �
� �
�=to%+�($to%)
�:
�� �grey(win%,icon%)
�	 � c%
� c%=b%+400
� !c%  =win%
� c%!4 =icon%
� c%!8 =1<<22
� c%!12=1<<22
 ș "Wimp_SetIconState",,c%
�
:
&� �ungrey(win%,icon%)
0	 � c%
: c%=b%+400
D !c%  =win%
N c%!4 =icon%
X c%!8 =0
b c%!12=1<<22
l ș "Wimp_SetIconState",,c%
v�
�:
�� �app_sp(sp$)
�. ș "XWimp_SpriteOp",40,,sp$ � err%;flags%
�* � (flags% � 1) <> 0 sp$="Application"
�=sp$
�:
�� �file_sp(sp$)
� sp$="File_"+sp$
�. ș "XWimp_SpriteOp",40,,sp$ � err%;flags%
�' � (flags% � 1) <> 0 sp$="File_???"
�=sp$
�:
�4� �open_messages(wibble%,mesfile$,buffer%,size%)
7 ș "MessageTrans_FileInfo",,mesfile$ � flag%,,len%
 � flag% � 1 �

   len%=0
    buffer%=0
*  �
4   buffer%=mem%
> �
H, � len%>size% � 1,"Please increase max%"
R8 ș "MessageTrans_OpenFile",wibble%,mesfile$,buffer%
\�
f:
p� �close_messages(wibble%)
z( ș "MessageTrans_CloseFile",wibble%
��
�:
�� �message(wibble%,mess$)
� token$ = �split(mess$)
�` ș "MessageTrans_Lookup",wibble%,token$,buffer%,buf_size%,s$(1),s$(2),s$(3),s$(4) � ,,,len%
� buffer%?len% = 13
�
=$buffer%
�:
�� �split(str$)
�	 � i%
�
 i%   = 0
� s$() = ""
� ȕ str$<>""
   col%   = �str$+":",":")
   s$(i%) = �str$,col%-1)
   str$   = �str$,col%+1)
$   i%    += 1
. �
8
=s$(0)
�
00000000  0d 00 0a 10 f4 20 3e 21  52 75 6e 49 6d 61 67 65  |..... >!RunImage|
00000010  0d 00 14 14 f4 20 a9 20  45 70 73 69 6c 6f 6e 20  |..... . Epsilon |
00000020  31 39 39 35 0d 00 1e 18  f4 20 52 65 67 69 73 74  |1995..... Regist|
00000030  65 72 20 70 72 6f 67 72  61 6d 20 3a 0d 00 28 2a  |er program :..(*|
00000040  f4 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000050  20 20 20 a9 20 42 41 55  20 4e 6f 76 65 6d 62 65  |   . BAU Novembe|
00000060  72 20 31 39 39 32 0d 00  32 27 f4 20 20 20 20 20  |r 1992..2'.     |
00000070  20 20 20 20 20 20 20 20  20 20 20 20 20 42 79 20  |             By |
00000080  44 61 76 65 20 4c 61 77  72 65 6e 63 65 0d 00 3c  |Dave Lawrence..<|
00000090  34 f4 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4.              |
000000a0  20 20 20 20 4d 6f 64 69  66 69 63 61 74 69 6f 6e  |    Modification|
000000b0  73 20 62 79 20 4d 61 72  6b 20 48 61 6d 6d 6f 6e  |s by Mark Hammon|
000000c0  64 0d 00 46 23 f4 20 41  6c 6c 20 6d 61 69 6e 20  |d..F#. All main |
000000d0  63 6f 64 65 20 62 79 20  4d 61 72 6b 20 48 61 6d  |code by Mark Ham|
000000e0  6d 6f 6e 64 0d 00 50 05  3a 0d 00 5a 23 ee 20 85  |mond..P.:..Z#. .|
000000f0  20 e7 20 a4 65 72 72 6f  72 28 9f 2c f6 24 2c 9e  | . .error(.,.$,.|
00000100  29 20 8c 20 f2 63 6c 6f  73 65 3a e0 0d 00 64 09  |) . .close:...d.|
00000110  f2 69 6e 69 74 0d 00 6e  10 f2 63 72 65 61 74 65  |.init..n..create|
00000120  5f 69 6f 63 6e 0d 00 78  3d f4 20 4f 4e 20 45 52  |_iocn..x=. ON ER|
00000130  52 4f 52 20 49 46 20 46  4e 65 72 72 6f 72 28 45  |ROR IF FNerror(E|
00000140  52 52 2c 52 45 50 4f 52  54 24 2c 45 52 4c 29 20  |RR,REPORT$,ERL) |
00000150  54 48 45 4e 20 50 52 4f  43 63 6c 6f 73 65 3a 45  |THEN PROCclose:E|
00000160  4e 44 0d 00 82 05 3a 0d  00 8c 05 f5 0d 00 96 0a  |ND....:.........|
00000170  20 f2 70 6f 6c 6c 0d 00  a0 0b fd 20 71 75 69 74  | .poll..... quit|
00000180  25 0d 00 aa 0a f2 63 6c  6f 73 65 0d 00 b4 05 e0  |%.....close.....|
00000190  0d 00 be 05 3a 0d 00 c8  0c dd 20 f2 63 6c 6f 73  |....:..... .clos|
000001a0  65 0d 00 d2 2e 20 c8 99  20 22 57 69 6d 70 5f 43  |e.... .. "Wimp_C|
000001b0  6c 6f 73 65 44 6f 77 6e  22 2c 74 73 6b 5f 68 61  |loseDown",tsk_ha|
000001c0  6e 64 6c 65 25 2c 26 34  42 35 33 34 31 35 34 0d  |ndle%,&4B534154.|
000001d0  00 dc 1b 20 f2 63 6c 6f  73 65 5f 6d 65 73 73 61  |... .close_messa|
000001e0  67 65 73 28 66 69 6c 65  25 29 0d 00 e6 05 e1 0d  |ges(file%)......|
000001f0  00 f0 05 3a 0d 00 fa 0b  dd 20 f2 69 6e 69 74 0d  |...:..... .init.|
00000200  01 04 17 20 6d 61 78 25  20 20 20 20 20 20 3d 20  |... max%      = |
00000210  33 2a 31 30 32 34 0d 01  0e 14 20 62 75 66 5f 73  |3*1024.... buf_s|
00000220  69 7a 65 25 20 3d 20 32  35 36 0d 01 18 29 20 de  |ize% = 256...) .|
00000230  20 62 25 20 36 30 30 2c  77 73 25 20 36 30 30 2c  | b% 600,ws% 600,|
00000240  6d 65 6e 73 70 63 25 20  35 30 30 2c 69 6e 64 25  |menspc% 500,ind%|
00000250  20 34 30 0d 01 22 31 20  de 20 66 69 6c 65 25 20  | 40.."1 . file% |
00000260  31 36 2c 6d 65 6d 25 20  6d 61 78 25 2c 62 75 66  |16,mem% max%,buf|
00000270  66 65 72 25 20 62 75 66  5f 73 69 7a 65 25 2c 73  |fer% buf_size%,s|
00000280  24 28 34 29 0d 01 2c 16  20 77 73 65 6e 64 25 20  |$(4)..,. wsend% |
00000290  20 3d 20 77 73 25 2b 36  30 30 0d 01 36 1a 20 6d  | = ws%+600..6. m|
000002a0  65 6e 65 6e 64 25 20 3d  20 6d 65 6e 73 70 63 25  |enend% = menspc%|
000002b0  2b 35 30 30 0d 01 40 0e  20 62 25 21 30 20 20 3d  |+500..@. b%!0  =|
000002c0  20 30 0d 01 4a 0e 20 62  25 21 34 20 20 3d 20 31  | 0..J. b%!4  = 1|
000002d0  0d 01 54 0e 20 62 25 21  38 20 20 3d 20 32 0d 01  |..T. b%!8  = 2..|
000002e0  5e 0e 20 62 25 21 31 32  20 3d 20 33 0d 01 68 0e  |^. b%!12 = 3..h.|
000002f0  20 62 25 21 31 36 20 3d  20 35 0d 01 72 0f 20 62  | b%!16 = 5..r. b|
00000300  25 21 32 30 20 3d 20 31  30 0d 01 7c 11 20 62 25  |%!20 = 10..|. b%|
00000310  21 32 34 20 3d 20 26 35  30 32 0d 01 86 0e 20 62  |!24 = &502.... b|
00000320  25 21 32 38 20 3d 20 30  0d 01 90 50 20 c8 99 20  |%!28 = 0...P .. |
00000330  22 57 69 6d 70 5f 49 6e  69 74 69 61 6c 69 73 65  |"Wimp_Initialise|
00000340  22 2c 33 30 30 2c 26 34  42 35 33 34 31 35 34 2c  |",300,&4B534154,|
00000350  22 52 65 73 53 61 76 65  22 2c 62 25 20 b8 20 77  |"ResSave",b% . w|
00000360  69 6d 70 5f 76 65 72 73  69 6f 6e 25 2c 74 73 6b  |imp_version%,tsk|
00000370  5f 68 61 6e 64 6c 65 25  0d 01 9a 17 20 6d 65 6e  |_handle%.... men|
00000380  75 70 74 72 25 20 3d 20  6d 65 6e 73 70 63 25 0d  |uptr% = menspc%.|
00000390  01 a4 1c 20 6d 65 6e 75  65 6e 64 25 20 3d 20 6d  |... menuend% = m|
000003a0  65 6e 73 70 63 25 2b 26  31 30 30 0d 01 ae 11 20  |enspc%+&100.... |
000003b0  71 75 69 74 25 20 20 20  20 3d 20 a3 0d 01 b8 14  |quit%    = .....|
000003c0  20 68 65 6c 70 25 20 20  20 20 3d 20 31 32 38 32  | help%    = 1282|
000003d0  0d 01 c2 11 20 73 61 76  65 32 25 20 20 20 3d 20  |.... save2%   = |
000003e0  a3 0d 01 cc 3d 20 f2 6f  70 65 6e 5f 6d 65 73 73  |....= .open_mess|
000003f0  61 67 65 73 28 66 69 6c  65 25 2c 22 3c 52 65 73  |ages(file%,"<Res|
00000400  53 61 76 65 24 44 69 72  3e 2e 4d 65 73 73 61 67  |Save$Dir>.Messag|
00000410  65 73 22 2c 6d 65 6d 25  2c 6d 61 78 25 29 0d 01  |es",mem%,max%)..|
00000420  d6 14 20 f2 6c 6f 61 64  5f 74 65 6d 70 6c 61 74  |.. .load_templat|
00000430  65 73 0d 01 e0 0a 20 f2  6d 65 6e 75 0d 01 ea 14  |es.... .menu....|
00000440  20 64 72 61 67 5f 73 74  6f 70 25 20 20 3d 20 31  | drag_stop%  = 1|
00000450  0d 01 f4 14 20 64 72 61  67 5f 73 74 61 72 74 25  |.... drag_start%|
00000460  20 3d 20 31 0d 01 fe 21  20 c8 99 20 22 4f 53 5f  | = 1...! .. "OS_|
00000470  42 79 74 65 22 2c 31 36  31 2c 32 38 20 b8 20 2c  |Byte",161,28 . ,|
00000480  2c 63 6d 6f 73 0d 02 08  30 20 e7 20 28 63 6d 6f  |,cmos...0 . (cmo|
00000490  73 20 80 20 32 29 3d 30  20 64 72 61 67 5f 73 74  |s . 2)=0 drag_st|
000004a0  61 72 74 25 3d 2d 31 3a  64 72 61 67 5f 73 74 6f  |art%=-1:drag_sto|
000004b0  70 25 3d 2d 31 0d 02 12  05 e1 0d 02 1c 05 3a 0d  |p%=-1.........:.|
000004c0  02 26 15 dd 20 f2 6c 6f  61 64 5f 74 65 6d 70 6c  |.&.. .load_templ|
000004d0  61 74 65 73 0d 02 30 36  20 c8 99 20 22 57 69 6d  |ates..06 .. "Wim|
000004e0  70 5f 4f 70 65 6e 54 65  6d 70 6c 61 74 65 22 2c  |p_OpenTemplate",|
000004f0  2c 22 3c 52 65 73 53 61  76 65 24 44 69 72 3e 2e  |,"<ResSave$Dir>.|
00000500  54 65 6d 70 6c 61 74 65  73 22 0d 02 3a 42 20 c8  |Templates"..:B .|
00000510  99 20 22 57 69 6d 70 5f  4c 6f 61 64 54 65 6d 70  |. "Wimp_LoadTemp|
00000520  6c 61 74 65 22 2c 2c 62  25 2c 77 73 25 2c 77 73  |late",,b%,ws%,ws|
00000530  65 6e 64 25 2c 2d 31 2c  22 50 72 6f 67 49 6e 66  |end%,-1,"ProgInf|
00000540  6f 22 2c 30 20 b8 20 2c  2c 77 73 25 0d 02 44 27  |o",0 . ,,ws%..D'|
00000550  20 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  | .. "Wimp_Create|
00000560  57 69 6e 64 6f 77 22 2c  2c 62 25 20 b8 20 69 6e  |Window",,b% . in|
00000570  66 6f 25 0d 02 4e 20 20  76 65 72 73 69 6f 6e 25  |fo%..N  version%|
00000580  20 3d 20 21 28 62 25 2b  38 38 2b 33 32 2a 34 2b  | = !(b%+88+32*4+|
00000590  32 30 29 0d 02 58 22 20  24 76 65 72 73 69 6f 6e  |20)..X" $version|
000005a0  25 3d 20 22 32 2e 33 30  20 28 30 34 2d 44 65 63  |%= "2.30 (04-Dec|
000005b0  2d 39 35 29 22 0d 02 62  40 20 c8 99 20 22 57 69  |-95)"..b@ .. "Wi|
000005c0  6d 70 5f 4c 6f 61 64 54  65 6d 70 6c 61 74 65 22  |mp_LoadTemplate"|
000005d0  2c 2c 62 25 2c 77 73 25  2c 77 73 65 6e 64 25 2c  |,,b%,ws%,wsend%,|
000005e0  2d 31 2c 22 73 61 76 65  61 73 22 2c 30 20 b8 20  |-1,"saveas",0 . |
000005f0  2c 2c 77 73 25 0d 02 6c  20 20 73 61 76 65 73 74  |,,ws%..l  savest|
00000600  72 25 20 3d 20 21 28 62  25 2b 38 38 2b 33 32 2a  |r% = !(b%+88+32*|
00000610  31 2b 32 30 29 0d 02 76  20 20 6d 6f 64 73 74 72  |1+20)..v  modstr|
00000620  25 20 20 3d 20 21 28 62  25 2b 38 38 2b 33 32 2a  |%  = !(b%+88+32*|
00000630  34 2b 32 30 29 0d 02 80  29 20 c8 99 20 22 57 69  |4+20)...) .. "Wi|
00000640  6d 70 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 22  |mp_CreateWindow"|
00000650  2c 2c 62 25 20 b8 20 73  61 76 65 61 73 25 0d 02  |,,b% . saveas%..|
00000660  8a 10 20 21 62 25 3d 73  61 76 65 61 73 25 0d 02  |.. !b%=saveas%..|
00000670  94 21 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |.! .. "Wimp_GetW|
00000680  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 62 25 0d  |indowState",,b%.|
00000690  02 9e 1c 20 c8 99 20 22  57 69 6d 70 5f 43 6c 6f  |... .. "Wimp_Clo|
000006a0  73 65 54 65 6d 70 6c 61  74 65 22 0d 02 a8 05 e1  |seTemplate".....|
000006b0  0d 02 b2 05 3a 0d 02 bc  0b dd 20 f2 6d 65 6e 75  |....:..... .menu|
000006c0  0d 02 c6 1b 20 6d 61 69  6e 6d 65 6e 75 25 20 20  |.... mainmenu%  |
000006d0  20 3d 20 6d 65 6e 75 70  74 72 25 0d 02 d0 14 20  | = menuptr%.... |
000006e0  6d 65 6e 75 6d 61 78 25  20 20 20 20 3d 20 37 0d  |menumax%    = 7.|
000006f0  02 da 15 20 6d 65 6e 75  70 74 72 25 21 32 30 20  |... menuptr%!20 |
00000700  3d 20 34 34 0d 02 e4 1c  20 24 6d 65 6e 75 70 74  |= 44.... $menupt|
00000710  72 25 20 20 20 3d 20 22  52 65 73 53 61 76 65 22  |r%   = "ResSave"|
00000720  0d 02 ee 14 20 6d 65 6e  75 70 74 72 25 3f 31 32  |.... menuptr%?12|
00000730  20 3d 20 37 0d 02 f8 14  20 6d 65 6e 75 70 74 72  | = 7.... menuptr|
00000740  25 3f 31 33 20 3d 20 32  0d 03 02 14 20 6d 65 6e  |%?13 = 2.... men|
00000750  75 70 74 72 25 3f 31 34  20 3d 20 37 0d 03 0c 14  |uptr%?14 = 7....|
00000760  20 6d 65 6e 75 70 74 72  25 3f 31 35 20 3d 20 30  | menuptr%?15 = 0|
00000770  0d 03 16 1e 20 6d 61 78  61 64 64 72 25 20 20 20  |.... maxaddr%   |
00000780  20 3d 20 6d 65 6e 75 70  74 72 25 2b 31 36 0d 03  | = menuptr%+16..|
00000790  20 14 20 6d 65 6e 75 70  74 72 25 21 32 34 20 3d  | . menuptr%!24 =|
000007a0  20 30 0d 03 2a 15 20 6d  65 6e 75 70 74 72 25 20  | 0..*. menuptr% |
000007b0  20 20 2b 3d 20 32 38 0d  03 34 2a 20 6d 65 6e 75  |  += 28..4* menu|
000007c0  30 24 20 20 20 20 20 20  3d 20 a4 6d 65 73 73 61  |0$      = .messa|
000007d0  67 65 28 66 69 6c 65 25  2c 22 6d 65 6e 75 30 22  |ge(file%,"menu0"|
000007e0  29 0d 03 3e 2a 20 6d 65  6e 75 31 24 20 20 20 20  |)..>* menu1$    |
000007f0  20 20 3d 20 a4 6d 65 73  73 61 67 65 28 66 69 6c  |  = .message(fil|
00000800  65 25 2c 22 6d 65 6e 75  31 22 29 0d 03 48 1c 20  |e%,"menu1")..H. |
00000810  f2 61 64 64 5f 69 74 65  6d 28 6d 65 6e 75 30 24  |.add_item(menu0$|
00000820  2c 69 6e 66 6f 25 29 0d  03 52 19 20 f2 61 64 64  |,info%)..R. .add|
00000830  5f 69 74 65 6d 28 6d 65  6e 75 31 24 2c 2d 31 29  |_item(menu1$,-1)|
00000840  0d 03 5c 17 20 6d 65 6e  75 70 74 72 25 21 2d 32  |..\. menuptr%!-2|
00000850  34 20 3d 20 26 38 30 0d  03 66 22 20 21 6d 61 78  |4 = &80..f" !max|
00000860  61 64 64 72 25 20 20 20  20 3d 20 6d 65 6e 75 6d  |addr%    = menum|
00000870  61 78 25 2a 31 36 2b 33  32 0d 03 70 05 e1 0d 03  |ax%*16+32..p....|
00000880  7a 05 3a 0d 03 84 1f dd  20 f2 61 64 64 5f 69 74  |z.:..... .add_it|
00000890  65 6d 28 74 65 78 74 24  2c 73 75 62 6d 65 6e 75  |em(text$,submenu|
000008a0  25 29 0d 03 8e 17 20 6d  65 6e 75 70 74 72 25 21  |%).... menuptr%!|
000008b0  30 20 20 20 20 20 3d 20  30 0d 03 98 1e 20 6d 65  |0     = 0.... me|
000008c0  6e 75 70 74 72 25 21 34  20 20 20 20 20 3d 20 73  |nuptr%!4     = s|
000008d0  75 62 6d 65 6e 75 25 0d  03 a2 1f 20 6d 65 6e 75  |ubmenu%.... menu|
000008e0  70 74 72 25 21 38 20 20  20 20 20 3d 20 26 30 37  |ptr%!8     = &07|
000008f0  30 30 30 30 32 31 0d 03  ac 1b 20 24 28 6d 65 6e  |000021.... $(men|
00000900  75 70 74 72 25 2b 31 32  29 20 3d 20 74 65 78 74  |uptr%+12) = text|
00000910  24 0d 03 b6 18 20 6d 65  6e 75 70 74 72 25 20 20  |$.... menuptr%  |
00000920  20 20 20 20 2b 3d 20 32  34 0d 03 c0 05 e1 0d 03  |    += 24.......|
00000930  ca 05 3a 0d 03 d4 12 dd  20 f2 63 72 65 61 74 65  |..:..... .create|
00000940  5f 69 6f 63 6e 0d 03 de  27 20 de 20 69 63 6f 6e  |_iocn...' . icon|
00000950  25 20 33 32 2c 20 69 74  65 78 74 25 20 31 32 2c  |% 32, itext% 12,|
00000960  20 69 73 70 72 69 74 65  25 20 31 32 0d 03 e8 15  | isprite% 12....|
00000970  20 21 69 63 6f 6e 25 20  20 20 20 20 20 3d 20 2d  | !icon%      = -|
00000980  31 0d 03 f2 14 20 69 63  6f 6e 25 21 34 20 20 20  |1.... icon%!4   |
00000990  20 20 3d 20 30 0d 03 fc  14 20 69 63 6f 6e 25 21  |  = 0.... icon%!|
000009a0  38 20 20 20 20 20 3d 20  30 0d 04 06 15 20 69 63  |8     = 0.... ic|
000009b0  6f 6e 25 21 31 32 20 20  20 20 3d 20 36 38 0d 04  |on%!12    = 68..|
000009c0  10 15 20 69 63 6f 6e 25  21 31 36 20 20 20 20 3d  |.. icon%!16    =|
000009d0  20 36 38 0d 04 1a 18 20  69 63 6f 6e 25 21 32 30  | 68.... icon%!20|
000009e0  20 20 20 20 3d 20 26 33  30 30 32 0d 04 24 23 20  |    = &3002..$# |
000009f0  24 28 69 63 6f 6e 25 2b  32 34 29 20 3d 20 22 21  |$(icon%+24) = "!|
00000a00  52 65 73 53 61 76 65 22  2b bd 28 31 33 29 0d 04  |ResSave"+.(13)..|
00000a10  2e 2c 20 c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |., .. "Wimp_Crea|
00000a20  74 65 49 63 6f 6e 22 2c  2c 69 63 6f 6e 25 20 b8  |teIcon",,icon% .|
00000a30  20 62 61 72 5f 69 63 6f  6e 25 0d 04 38 05 e1 0d  | bar_icon%..8...|
00000a40  04 42 05 3a 0d 04 4c 0b  dd 20 f2 70 6f 6c 6c 0d  |.B.:..L.. .poll.|
00000a50  04 56 1c 20 c8 99 20 22  57 69 6d 70 5f 50 6f 6c  |.V. .. "Wimp_Pol|
00000a60  6c 22 2c 2c 62 25 20 b8  20 72 25 0d 04 60 0c 20  |l",,b% . r%..`. |
00000a70  c8 8e 20 72 25 20 ca 0d  04 6a 23 20 20 20 c9 20  |.. r% ...j#   . |
00000a80  32 3a c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 57  |2:.. "Wimp_OpenW|
00000a90  69 6e 64 6f 77 22 2c 2c  62 25 0d 04 74 24 20 20  |indow",,b%..t$  |
00000aa0  20 c9 20 33 3a c8 99 20  22 57 69 6d 70 5f 43 6c  | . 3:.. "Wimp_Cl|
00000ab0  6f 73 65 57 69 6e 64 6f  77 22 2c 2c 62 25 0d 04  |oseWindow",,b%..|
00000ac0  7e 11 20 20 20 c9 20 36  3a f2 6d 6f 75 73 65 0d  |~.   . 6:.mouse.|
00000ad0  04 88 14 20 20 20 c9 20  37 3a f2 64 72 61 67 5f  |...   . 7:.drag_|
00000ae0  65 6e 64 0d 04 92 0f 20  20 20 c9 20 38 3a f2 6b  |end....   . 8:.k|
00000af0  65 79 0d 04 9c 16 20 20  20 c9 20 39 3a f2 6d 65  |ey....   . 9:.me|
00000b00  6e 75 5f 63 6c 69 63 6b  0d 04 a6 17 20 20 20 c9  |nu_click....   .|
00000b10  20 31 37 2c 31 38 3a f2  72 65 63 65 69 76 65 0d  | 17,18:.receive.|
00000b20  04 b0 06 20 cb 0d 04 ba  05 e1 0d 04 c4 05 3a 0d  |... ..........:.|
00000b30  04 ce 0e dd 20 f2 72 65  63 65 69 76 65 0d 04 d8  |.... .receive...|
00000b40  09 20 ea 20 63 25 0d 04  e2 0e 20 63 25 3d 62 25  |. . c%.... c%=b%|
00000b50  2b 34 30 30 0d 04 ec 0f  20 c8 8e 20 62 25 21 31  |+400.... .. b%!1|
00000b60  36 20 ca 0d 04 f6 12 20  20 20 c9 20 30 3a 71 75  |6 .....   . 0:qu|
00000b70  69 74 25 3d b9 0d 05 00  0a 20 20 20 c9 20 32 0d  |it%=.....   . 2.|
00000b80  05 0a 14 20 20 20 20 20  c8 8e 20 73 61 76 65 32  |...     .. save2|
00000b90  25 20 ca 0d 05 14 15 20  20 20 20 20 20 20 c9 20  |% .....       . |
00000ba0  b9 3a f2 73 61 76 65 32  0d 05 1e 15 20 20 20 20  |.:.save2....    |
00000bb0  20 20 20 c9 20 a3 3a f2  73 61 76 65 31 0d 05 28  |   . .:.save1..(|
00000bc0  0a 20 20 20 20 20 cb 0d  05 32 19 20 20 20 c9 20  |.     ...2.   . |
00000bd0  33 3a 73 61 76 65 32 25  3d a3 3a f2 6c 6f 61 64  |3:save2%=.:.load|
00000be0  0d 05 3c 18 20 20 20 c9  20 26 35 30 32 3a f2 73  |..<.   . &502:.s|
00000bf0  65 6e 64 5f 68 65 6c 70  0d 05 46 06 20 cb 0d 05  |end_help..F. ...|
00000c00  50 05 e1 0d 05 5a 05 3a  0d 05 64 0c dd 20 f2 6d  |P....Z.:..d.. .m|
00000c10  6f 75 73 65 0d 05 6e 0f  20 c8 8e 20 62 25 21 31  |ouse..n. .. b%!1|
00000c20  32 20 ca 0d 05 78 15 20  20 20 c9 20 2d 32 3a c8  |2 ...x.   . -2:.|
00000c30  8e 20 62 25 21 38 20 ca  0d 05 82 3a 20 20 20 20  |. b%!8 ....:    |
00000c40  20 20 20 20 20 20 20 20  20 c9 20 32 3a f2 73 68  |         . 2:.sh|
00000c50  6f 77 5f 6d 65 6e 75 28  6d 61 69 6e 6d 65 6e 75  |ow_menu(mainmenu|
00000c60  25 2c 62 25 21 30 2d 36  34 2c 39 36 2b 32 2a 34  |%,b%!0-64,96+2*4|
00000c70  34 29 0d 05 8c 10 20 20  20 20 20 20 20 20 20 20  |4)....          |
00000c80  20 cb 0d 05 96 1f 20 20  20 c9 20 73 61 76 65 61  | .....   . savea|
00000c90  73 25 3a f2 73 61 76 65  5f 61 73 5f 63 6c 69 63  |s%:.save_as_clic|
00000ca0  6b 0d 05 a0 06 20 cb 0d  05 aa 05 e1 0d 05 b4 05  |k.... ..........|
00000cb0  3a 0d 05 be 1d dd 20 f2  73 68 6f 77 5f 6d 65 6e  |:..... .show_men|
00000cc0  75 28 6d 65 6e 75 25 2c  78 25 2c 79 25 29 0d 05  |u(menu%,x%,y%)..|
00000cd0  c8 15 20 74 6f 70 6d 65  6e 75 25 20 3d 20 6d 65  |.. topmenu% = me|
00000ce0  6e 75 25 0d 05 d2 12 20  74 6f 70 78 25 20 20 20  |nu%.... topx%   |
00000cf0  20 3d 20 78 25 0d 05 dc  12 20 74 6f 70 79 25 20  | = x%.... topy% |
00000d00  20 20 20 3d 20 79 25 0d  05 e6 26 20 c8 99 20 22  |   = y%...& .. "|
00000d10  57 69 6d 70 5f 43 72 65  61 74 65 4d 65 6e 75 22  |Wimp_CreateMenu"|
00000d20  2c 2c 6d 65 6e 75 25 2c  78 25 2c 79 25 0d 05 f0  |,,menu%,x%,y%...|
00000d30  05 e1 0d 05 fa 05 3a 0d  06 04 11 dd 20 f2 6d 65  |......:..... .me|
00000d40  6e 75 5f 63 6c 69 63 6b  0d 06 0e 09 20 ea 20 63  |nu_click.... . c|
00000d50  25 0d 06 18 10 20 63 25  20 3d 20 62 25 2b 34 30  |%.... c% = b%+40|
00000d60  30 0d 06 22 21 20 c8 99  20 22 57 69 6d 70 5f 47  |0.."! .. "Wimp_G|
00000d70  65 74 50 6f 69 6e 74 65  72 49 6e 66 6f 22 2c 2c  |etPointerInfo",,|
00000d80  63 25 0d 06 2c 16 20 61  64 6a 25 20 3d 20 28 62  |c%..,. adj% = (b|
00000d90  25 21 38 20 80 20 31 29  0d 06 36 29 20 c8 99 20  |%!8 . 1)..6) .. |
00000da0  22 57 69 6d 70 5f 44 65  63 6f 64 65 4d 65 6e 75  |"Wimp_DecodeMenu|
00000db0  22 2c 2c 74 6f 70 6d 65  6e 75 25 2c 62 25 2c 63  |",,topmenu%,b%,c|
00000dc0  25 0d 06 40 0d 20 c8 8e  20 24 63 25 20 ca 0d 06  |%..@. .. $c% ...|
00000dd0  4a 17 20 20 20 c9 20 6d  65 6e 75 31 24 3a 71 75  |J.   . menu1$:qu|
00000de0  69 74 25 3d b9 0d 06 54  06 20 cb 0d 06 5e 2c 20  |it%=...T. ...^, |
00000df0  e7 20 61 64 6a 25 20 f2  73 68 6f 77 5f 6d 65 6e  |. adj% .show_men|
00000e00  75 28 74 6f 70 6d 65 6e  75 25 2c 74 6f 70 78 25  |u(topmenu%,topx%|
00000e10  2c 74 6f 70 79 25 29 0d  06 68 05 e1 0d 06 72 05  |,topy%)..h....r.|
00000e20  3a 0d 06 7c 0a dd 20 f2  6b 65 79 0d 06 86 11 20  |:..|.. .key.... |
00000e30  6b 65 79 25 20 3d 20 62  25 21 32 34 0d 06 90 1e  |key% = b%!24....|
00000e40  20 c8 99 20 22 57 69 6d  70 5f 50 72 6f 63 65 73  | .. "Wimp_Proces|
00000e50  73 4b 65 79 22 2c 6b 65  79 25 0d 06 9a 05 e1 0d  |sKey",key%......|
00000e60  06 a4 05 3a 0d 06 ae 25  dd 20 f2 73 65 74 5f 76  |...:...%. .set_v|
00000e70  61 6c 69 64 28 77 69 6e  64 6f 77 25 2c 69 63 6f  |alid(window%,ico|
00000e80  6e 25 2c 76 61 6c 64 24  29 0d 06 b8 13 20 21 62  |n%,vald$).... !b|
00000e90  25 20 20 3d 20 77 69 6e  64 6f 77 25 0d 06 c2 11  |%  = window%....|
00000ea0  20 62 25 21 34 20 3d 20  69 63 6f 6e 25 0d 06 cc  | b%!4 = icon%...|
00000eb0  1f 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |. .. "Wimp_GetIc|
00000ec0  6f 6e 53 74 61 74 65 22  2c 2c 62 25 0d 06 d6 13  |onState",,b%....|
00000ed0  20 24 62 25 21 33 32 20  3d 20 76 61 6c 64 24 0d  | $b%!32 = vald$.|
00000ee0  06 e0 0f 20 62 25 21 38  20 20 20 3d 20 30 0d 06  |... b%!8   = 0..|
00000ef0  ea 0f 20 62 25 21 31 32  20 20 3d 20 30 0d 06 f4  |.. b%!12  = 0...|
00000f00  1f 20 c8 99 20 22 57 69  6d 70 5f 53 65 74 49 63  |. .. "Wimp_SetIc|
00000f10  6f 6e 53 74 61 74 65 22  2c 2c 62 25 0d 06 fe 05  |onState",,b%....|
00000f20  e1 0d 07 08 05 3a 0d 07  12 2c dd 20 f2 67 65 74  |.....:...,. .get|
00000f30  5f 6f 72 69 67 69 6e 28  68 61 6e 64 6c 65 25 2c  |_origin(handle%,|
00000f40  f8 20 78 6f 72 69 67 25  2c f8 20 79 6f 72 69 67  |. xorig%,. yorig|
00000f50  25 29 0d 07 1c 09 20 ea  20 63 25 0d 07 26 11 20  |%).... . c%..&. |
00000f60  63 25 20 20 3d 20 62 25  2b 34 30 30 0d 07 30 12  |c%  = b%+400..0.|
00000f70  20 21 63 25 20 3d 20 68  61 6e 64 6c 65 25 0d 07  | !c% = handle%..|
00000f80  3a 21 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |:! .. "Wimp_GetW|
00000f90  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 63 25 0d  |indowState",,c%.|
00000fa0  07 44 18 20 78 6f 72 69  67 25 20 3d 20 63 25 21  |.D. xorig% = c%!|
00000fb0  34 2d 63 25 21 32 30 0d  07 4e 19 20 79 6f 72 69  |4-c%!20..N. yori|
00000fc0  67 25 20 3d 20 63 25 21  31 36 2d 63 25 21 32 34  |g% = c%!16-c%!24|
00000fd0  0d 07 58 05 e1 0d 07 62  05 3a 0d 07 6c 0f dd 20  |..X....b.:..l.. |
00000fe0  f2 74 65 72 6d 28 61 25  29 0d 07 76 09 20 ea 20  |.term(a%)..v. . |
00000ff0  69 25 0d 07 80 10 20 c8  95 20 61 25 3f 69 25 3e  |i%.... .. a%?i%>|
00001000  33 31 0d 07 8a 0c 20 20  20 69 25 2b 3d 31 0d 07  |31....   i%+=1..|
00001010  94 06 20 ce 0d 07 9e 0d  20 61 25 3f 69 25 3d 31  |.. ..... a%?i%=1|
00001020  33 0d 07 a8 05 e1 0d 07  b2 05 3a 0d 07 bc 0b dd  |3.........:.....|
00001030  20 f2 6c 6f 61 64 0d 07  c6 09 20 ea 20 69 25 0d  | .load.... . i%.|
00001040  07 d0 15 20 f2 67 72 65  79 28 73 61 76 65 61 73  |... .grey(saveas|
00001050  25 2c 36 29 0d 07 da 11  20 f2 74 65 72 6d 28 62  |%,6).... .term(b|
00001060  25 2b 34 34 29 0d 07 e4  1b 20 74 79 70 65 25 20  |%+44).... type% |
00001070  20 20 20 20 20 20 20 20  20 3d 20 62 25 21 34 30  |         = b%!40|
00001080  0d 07 ee 1b 20 66 69 6c  65 5f 6c 65 6e 25 20 20  |.... file_len%  |
00001090  20 20 20 20 3d 20 62 25  21 33 36 0d 07 f8 1e 20  |    = b%!36.... |
000010a0  66 75 6c 6c 5f 70 61 74  68 6e 61 6d 65 24 20 3d  |full_pathname$ =|
000010b0  20 24 28 62 25 2b 34 34  29 0d 08 02 1e 20 6c 65  | $(b%+44).... le|
000010c0  6e 70 61 74 68 25 3d a9  20 66 75 6c 6c 5f 70 61  |npath%=. full_pa|
000010d0  74 68 6e 61 6d 65 24 0d  08 0c 0c 20 63 6f 25 20  |thname$.... co% |
000010e0  3d 20 30 0d 08 16 24 20  c8 95 20 c0 c2 66 75 6c  |= 0...$ .. ..ful|
000010f0  6c 5f 70 61 74 68 6e 61  6d 65 24 2c 69 25 29 2c  |l_pathname$,i%),|
00001100  31 29 3c 3e 22 2e 22 0d  08 20 0c 20 20 20 69 25  |1)<>".".. .   i%|
00001110  2b 3d 31 0d 08 2a 06 20  ce 0d 08 34 2b 20 70 61  |+=1..*. ...4+ pa|
00001120  74 68 6e 61 6d 65 24 3d  c0 66 75 6c 6c 5f 70 61  |thname$=.full_pa|
00001130  74 68 6e 61 6d 65 24 2c  6c 65 6e 70 61 74 68 25  |thname$,lenpath%|
00001140  2d 69 25 29 0d 08 3e 11  20 62 25 21 31 32 20 3d  |-i%)..>. b%!12 =|
00001150  20 62 25 21 38 0d 08 48  0e 20 62 25 21 31 36 20  | b%!8..H. b%!16 |
00001160  3d 20 34 0d 08 52 25 20  c8 99 20 22 57 69 6d 70  |= 4..R% .. "Wimp|
00001170  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 31 37  |_SendMessage",17|
00001180  2c 62 25 2c 62 25 21 34  0d 08 5c 09 20 69 25 3d  |,b%,b%!4..\. i%=|
00001190  30 0d 08 66 24 20 c8 95  20 c0 c2 66 75 6c 6c 5f  |0..f$ .. ..full_|
000011a0  70 61 74 68 6e 61 6d 65  24 2c 69 25 29 2c 31 29  |pathname$,i%),1)|
000011b0  3c 3e 22 2e 22 0d 08 70  0c 20 20 20 69 25 2b 3d  |<>"."..p.   i%+=|
000011c0  31 0d 08 7a 06 20 ce 0d  08 84 1b 20 69 63 6f 6e  |1..z. ..... icon|
000011d0  24 3d 22 22 3a 64 72 61  67 5f 69 63 6f 6e 24 3d  |$="":drag_icon$=|
000011e0  22 22 0d 08 8e 20 20 66  69 6c 65 24 3d c2 66 75  |""...  file$=.fu|
000011f0  6c 6c 5f 70 61 74 68 6e  61 6d 65 24 2c 69 25 2d  |ll_pathname$,i%-|
00001200  31 29 0d 08 98 14 20 e7  20 74 79 70 65 25 3d 26  |1).... . type%=&|
00001210  31 30 30 30 20 8c 0d 08  a2 20 20 20 20 69 63 6f  |1000 ....    ico|
00001220  6e 24 20 20 20 20 20 20  3d 20 22 53 44 69 72 65  |n$      = "SDire|
00001230  63 74 6f 72 79 22 0d 08  ac 1f 20 20 20 64 72 61  |ctory"....   dra|
00001240  67 5f 69 63 6f 6e 24 20  3d 20 22 44 69 72 65 63  |g_icon$ = "Direc|
00001250  74 6f 72 79 22 0d 08 b6  06 20 cd 0d 08 c0 14 20  |tory".... ..... |
00001260  e7 20 74 79 70 65 25 3d  26 32 30 30 30 20 8c 0d  |. type%=&2000 ..|
00001270  08 ca 26 20 20 20 69 63  6f 6e 24 20 20 20 20 20  |..&   icon$     |
00001280  20 3d 20 22 53 22 2b a4  61 70 70 5f 73 70 28 66  | = "S"+.app_sp(f|
00001290  69 6c 65 24 29 0d 08 d4  22 20 20 20 64 72 61 67  |ile$)..."   drag|
000012a0  5f 69 63 6f 6e 24 20 3d  20 a4 61 70 70 5f 73 70  |_icon$ = .app_sp|
000012b0  28 66 69 6c 65 24 29 0d  08 de 06 20 cd 0d 08 e8  |(file$).... ....|
000012c0  14 20 e7 20 74 79 70 65  25 3c 26 31 30 30 30 20  |. . type%<&1000 |
000012d0  8c 0d 08 f2 2b 20 20 20  69 63 6f 6e 24 20 20 20  |....+   icon$   |
000012e0  20 20 20 3d 20 22 53 22  2b a4 66 69 6c 65 5f 73  |   = "S"+.file_s|
000012f0  70 28 c3 7e 28 74 79 70  65 25 29 29 0d 08 fc 27  |p(.~(type%))...'|
00001300  20 20 20 64 72 61 67 5f  69 63 6f 6e 24 20 3d 20  |   drag_icon$ = |
00001310  a4 66 69 6c 65 5f 73 70  28 c3 7e 28 74 79 70 65  |.file_sp(.~(type|
00001320  25 29 29 0d 09 06 06 20  cd 0d 09 10 11 20 e7 20  |%)).... ..... . |
00001330  69 63 6f 6e 24 3d 22 22  20 8c 0d 09 1a 1f 20 20  |icon$="" .....  |
00001340  20 69 63 6f 6e 24 20 20  20 20 20 20 3d 20 22 53  | icon$      = "S|
00001350  46 69 6c 65 5f 78 78 78  22 0d 09 24 1e 20 20 20  |File_xxx"..$.   |
00001360  64 72 61 67 5f 69 63 6f  6e 24 20 3d 20 22 46 69  |drag_icon$ = "Fi|
00001370  6c 65 5f 78 78 78 22 0d  09 2e 06 20 cd 0d 09 38  |le_xxx".... ...8|
00001380  26 20 f2 73 65 74 5f 76  61 6c 69 64 28 73 61 76  |& .set_valid(sav|
00001390  65 61 73 25 2c 30 2c 69  63 6f 6e 24 2b bd 28 31  |eas%,0,icon$+.(1|
000013a0  33 29 29 0d 09 42 18 20  24 28 73 61 76 65 73 74  |3))..B. $(savest|
000013b0  72 25 29 20 3d 20 66 69  6c 65 24 0d 09 4c 1e 20  |r%) = file$..L. |
000013c0  24 28 6d 6f 64 73 74 72  25 29 20 20 3d 20 66 69  |$(modstr%)  = fi|
000013d0  6c 65 24 2b 22 4d 6f 64  22 0d 09 56 1a 20 21 62  |le$+"Mod"..V. !b|
000013e0  25 20 20 20 20 20 20 20  20 20 3d 20 73 61 76 65  |%         = save|
000013f0  61 73 25 0d 09 60 21 20  c8 99 20 22 57 69 6d 70  |as%..`! .. "Wimp|
00001400  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
00001410  2c 2c 62 25 0d 09 6a 17  20 62 25 21 33 32 20 3d  |,,b%..j. b%!32 =|
00001420  20 62 25 21 33 32 20 84  20 31 36 0d 09 74 1d 20  | b%!32 . 16..t. |
00001430  c8 99 20 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  |.. "Wimp_OpenWin|
00001440  64 6f 77 22 2c 2c 62 25  0d 09 7e 20 20 f2 72 65  |dow",,b%..~  .re|
00001450  64 72 61 77 5f 61 6e 64  5f 74 6f 5f 74 6f 70 28  |draw_and_to_top(|
00001460  73 61 76 65 61 73 25 29  0d 09 88 18 20 24 28 73  |saveas%).... $(s|
00001470  61 76 65 73 74 72 25 29  20 3d 20 66 69 6c 65 24  |avestr%) = file$|
00001480  0d 09 92 05 e1 0d 09 9c  05 3a 0d 09 a6 21 dd 20  |.........:...!. |
00001490  f2 72 65 64 72 61 77 5f  61 6e 64 5f 74 6f 5f 74  |.redraw_and_to_t|
000014a0  6f 70 28 77 69 6e 64 6f  77 25 29 0d 09 b0 09 20  |op(window%).... |
000014b0  ea 20 63 25 0d 09 ba 0e  20 63 25 3d 62 25 2b 34  |. c%.... c%=b%+4|
000014c0  30 30 0d 09 c4 10 20 21  63 25 3d 77 69 6e 64 6f  |00.... !c%=windo|
000014d0  77 25 0d 09 ce 21 20 c8  99 20 22 57 69 6d 70 5f  |w%...! .. "Wimp_|
000014e0  47 65 74 57 69 6e 64 6f  77 53 74 61 74 65 22 2c  |GetWindowState",|
000014f0  2c 63 25 0d 09 d8 1e 20  c8 99 20 22 57 69 6d 70  |,c%.... .. "Wimp|
00001500  5f 43 6c 6f 73 65 57 69  6e 64 6f 77 22 2c 2c 63  |_CloseWindow",,c|
00001510  25 0d 09 e2 21 20 c8 99  20 22 57 69 6d 70 5f 47  |%...! .. "Wimp_G|
00001520  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00001530  63 25 0d 09 ec 17 20 62  25 21 33 32 20 3d 20 62  |c%.... b%!32 = b|
00001540  25 21 33 32 20 84 20 31  36 0d 09 f6 1d 20 c8 99  |%!32 . 16.... ..|
00001550  20 22 57 69 6d 70 5f 4f  70 65 6e 57 69 6e 64 6f  | "Wimp_OpenWindo|
00001560  77 22 2c 2c 63 25 0d 0a  00 05 e1 0d 0a 0a 05 3a  |w",,c%.........:|
00001570  0d 0a 14 14 dd 20 f2 73  61 76 65 5f 61 73 5f 63  |..... .save_as_c|
00001580  6c 69 63 6b 0d 0a 1e 0f  20 c8 8e 20 62 25 21 31  |lick.... .. b%!1|
00001590  36 20 ca 0d 0a 28 2f 20  20 20 c9 20 30 3a e7 20  |6 ...(/   . 0:. |
000015a0  62 25 21 38 3d 31 36 20  84 20 62 25 21 38 3d 36  |b%!8=16 . b%!8=6|
000015b0  34 20 8c 20 f2 64 72 61  67 28 62 25 21 31 32 2c  |4 . .drag(b%!12,|
000015c0  30 29 0d 0a 32 0a 20 20  20 c9 20 36 0d 0a 3c 13  |0)..2.   . 6..<.|
000015d0  20 20 20 20 20 e7 20 73  61 76 65 32 25 20 8c 0d  |     . save2% ..|
000015e0  0a 46 1b 20 20 20 20 20  20 20 24 28 62 25 2b 34  |.F.       $(b%+4|
000015f0  34 29 3d 22 23 6e 6f 74  23 22 0d 0a 50 11 20 20  |4)="#not#"..P.  |
00001600  20 20 20 20 20 f2 73 61  76 65 32 0d 0a 5a 0a 20  |     .save2..Z. |
00001610  20 20 20 20 cd 0d 0a 64  0a 20 20 20 c9 20 37 0d  |    ...d.   . 7.|
00001620  0a 6e 14 20 20 20 20 20  21 62 25 3d 73 61 76 65  |.n.     !b%=save|
00001630  61 73 25 0d 0a 78 25 20  20 20 20 20 c8 99 20 22  |as%..x%     .. "|
00001640  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 53 74  |Wimp_GetWindowSt|
00001650  61 74 65 22 2c 2c 62 25  0d 0a 82 22 20 20 20 20  |ate",,b%..."    |
00001660  20 c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 57  | .. "Wimp_CloseW|
00001670  69 6e 64 6f 77 22 2c 2c  62 25 0d 0a 8c 06 20 cb  |indow",,b%.... .|
00001680  0d 0a 96 05 e1 0d 0a a0  05 3a 0d 0a aa 1a dd 20  |.........:..... |
00001690  f2 64 72 61 67 28 77 69  6e 64 6f 77 25 2c 69 63  |.drag(window%,ic|
000016a0  6f 6e 25 29 0d 0a b4 09  20 ea 20 63 25 0d 0a be  |on%).... . c%...|
000016b0  0e 20 63 25 3d 62 25 2b  34 30 30 0d 0a c8 27 20  |. c%=b%+400...' |
000016c0  f2 67 65 74 5f 6f 72 69  67 69 6e 28 77 69 6e 64  |.get_origin(wind|
000016d0  6f 77 25 2c 78 6f 72 69  67 25 2c 79 6f 72 69 67  |ow%,xorig%,yorig|
000016e0  25 29 0d 0a d2 1b 20 21  63 25 3d 77 69 6e 64 6f  |%).... !c%=windo|
000016f0  77 25 3a 63 25 21 34 3d  69 63 6f 6e 25 0d 0a dc  |w%:c%!4=icon%...|
00001700  1f 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |. .. "Wimp_GetIc|
00001710  6f 6e 53 74 61 74 65 22  2c 2c 63 25 0d 0a e6 18  |onState",,c%....|
00001720  20 78 6d 69 6e 25 20 3d  20 78 6f 72 69 67 25 2b  | xmin% = xorig%+|
00001730  63 25 21 38 0d 0a f0 19  20 79 6d 69 6e 25 20 3d  |c%!8.... ymin% =|
00001740  20 79 6f 72 69 67 25 2b  63 25 21 31 32 0d 0a fa  | yorig%+c%!12...|
00001750  19 20 78 6d 61 78 25 20  3d 20 78 6f 72 69 67 25  |. xmax% = xorig%|
00001760  2b 63 25 21 31 36 0d 0b  04 19 20 79 6d 61 78 25  |+c%!16.... ymax%|
00001770  20 3d 20 79 6f 72 69 67  25 2b 63 25 21 32 30 0d  | = yorig%+c%!20.|
00001780  0b 0e 0e 20 63 25 21 34  20 20 3d 20 35 0d 0b 18  |... c%!4  = 5...|
00001790  12 20 63 25 21 38 20 20  3d 20 78 6d 69 6e 25 0d  |. c%!8  = xmin%.|
000017a0  0b 22 12 20 63 25 21 31  32 20 3d 20 79 6d 69 6e  |.". c%!12 = ymin|
000017b0  25 0d 0b 2c 12 20 63 25  21 31 36 20 3d 20 78 6d  |%..,. c%!16 = xm|
000017c0  61 78 25 0d 0b 36 12 20  63 25 21 32 30 20 3d 20  |ax%..6. c%!20 = |
000017d0  79 6d 61 78 25 0d 0b 40  0e 20 63 25 21 32 34 20  |ymax%..@. c%!24 |
000017e0  3d 20 30 0d 0b 4a 0e 20  63 25 21 32 38 20 3d 20  |= 0..J. c%!28 = |
000017f0  30 0d 0b 54 11 20 63 25  21 33 32 20 3d 20 31 32  |0..T. c%!32 = 12|
00001800  38 30 0d 0b 5e 11 20 63  25 21 32 36 20 3d 20 31  |80..^. c%!26 = 1|
00001810  30 32 34 0d 0b 68 17 20  e7 20 64 72 61 67 5f 73  |024..h. . drag_s|
00001820  74 61 72 74 25 3d 2d 31  20 8c 0d 0b 72 1d 20 20  |tart%=-1 ...r.  |
00001830  20 20 c8 99 20 22 57 69  6d 70 5f 44 72 61 67 42  |  .. "Wimp_DragB|
00001840  6f 78 22 2c 2c 63 25 0d  0b 7c 07 20 20 cc 0d 0b  |ox",,c%..|.  ...|
00001850  86 40 20 20 20 20 c8 99  20 22 44 72 61 67 41 53  |.@    .. "DragAS|
00001860  70 72 69 74 65 5f 53 74  61 72 74 22 2c 25 31 31  |prite_Start",%11|
00001870  30 30 30 31 30 31 2c 31  2c 64 72 61 67 5f 69 63  |000101,1,drag_ic|
00001880  6f 6e 24 2c 63 25 2b 38  2c 63 25 2b 32 34 0d 0b  |on$,c%+8,c%+24..|
00001890  90 06 20 cd 0d 0b 9a 05  e1 0d 0b a4 05 3a 0d 0b  |.. ..........:..|
000018a0  ae 0c dd 20 f2 73 61 76  65 31 0d 0b b8 1a 20 66  |... .save1.... f|
000018b0  69 6c 65 62 24 20 20 20  20 3d 20 24 73 61 76 65  |ileb$    = $save|
000018c0  73 74 72 25 0d 0b c2 19  20 6d 6f 64 5f 6e 61 6d  |str%.... mod_nam|
000018d0  65 24 20 3d 20 24 6d 6f  64 73 74 72 25 0d 0b cc  |e$ = $modstr%...|
000018e0  11 20 f2 74 65 72 6d 28  62 25 2b 34 34 29 0d 0b  |. .term(b%+44)..|
000018f0  d6 1c 20 64 65 73 74 69  6e 61 74 69 6f 6e 24 20  |.. destination$ |
00001900  3d 20 24 28 62 25 2b 34  34 29 0d 0b e0 27 20 64  |= $(b%+44)...' d|
00001910  65 73 74 69 6e 61 74 69  6f 6e 24 20 3d 20 64 65  |estination$ = de|
00001920  73 74 69 6e 61 74 69 6f  6e 24 2b 66 69 6c 65 62  |stination$+fileb|
00001930  24 0d 0b ea 30 20 72 65  73 25 20 20 20 20 20 20  |$...0 res%      |
00001940  20 20 20 3d 20 a7 64 65  73 74 69 6e 61 74 69 6f  |   = .destinatio|
00001950  6e 24 2c 22 52 65 73 6f  75 72 63 65 73 3a 24 22  |n$,"Resources:$"|
00001960  29 0d 0b f4 0f 20 e7 20  72 65 73 25 3d 30 20 8c  |).... . res%=0 .|
00001970  0d 0b fe 15 20 20 20 f2  6e 6f 74 5f 72 65 73 6f  |....   .not_reso|
00001980  75 72 63 65 73 0d 0c 08  08 20 20 20 e1 0d 0c 12  |urces....   ....|
00001990  06 20 cd 0d 0c 1c 1d 20  f2 73 61 76 65 5f 77 69  |. ..... .save_wi|
000019a0  6e 64 6f 77 28 22 46 69  6c 65 5f 46 46 41 22 29  |ndow("File_FFA")|
000019b0  0d 0c 26 0d 20 73 61 76  65 32 25 3d b9 0d 0c 30  |..&. save2%=...0|
000019c0  17 20 f2 75 6e 67 72 65  79 28 73 61 76 65 61 73  |. .ungrey(saveas|
000019d0  25 2c 36 29 0d 0c 3a 05  e1 0d 0c 44 05 3a 0d 0c  |%,6)..:....D.:..|
000019e0  4e 0c dd 20 f2 73 61 76  65 32 0d 0c 58 11 20 f2  |N.. .save2..X. .|
000019f0  74 65 72 6d 28 62 25 2b  34 34 29 0d 0c 62 17 20  |term(b%+44)..b. |
00001a00  73 61 76 65 64 65 73 74  24 3d 24 28 62 25 2b 34  |savedest$=$(b%+4|
00001a10  34 29 0d 0c 6c 22 20 73  61 76 65 64 65 73 74 24  |4)..l" savedest$|
00001a20  3d 73 61 76 65 64 65 73  74 24 2b 24 73 61 76 65  |=savedest$+$save|
00001a30  73 74 72 25 0d 0c 76 6c  20 74 61 73 6b 24 20 3d  |str%..vl task$ =|
00001a40  20 22 3c 52 65 67 69 73  74 65 72 24 44 69 72 3e  | "<Register$Dir>|
00001a50  2e 52 65 67 69 73 74 65  72 20 2d 22 2b 6d 6f 64  |.Register -"+mod|
00001a60  5f 6e 61 6d 65 24 2b 22  20 2d 22 2b 70 61 74 68  |_name$+" -"+path|
00001a70  6e 61 6d 65 24 2b 22 2e  22 2b 66 69 6c 65 24 2b  |name$+"."+file$+|
00001a80  22 20 2d 22 2b 64 65 73  74 69 6e 61 74 69 6f 6e  |" -"+destination|
00001a90  24 2b 22 20 2d 22 2b 73  61 76 65 64 65 73 74 24  |$+" -"+savedest$|
00001aa0  0d 0c 80 1e 20 c8 99 20  22 57 69 6d 70 5f 53 74  |.... .. "Wimp_St|
00001ab0  61 72 74 54 61 73 6b 22  2c 74 61 73 6b 24 0d 0c  |artTask",task$..|
00001ac0  8a 0d 20 73 61 76 65 32  25 3d a3 0d 0c 94 10 20  |.. save2%=..... |
00001ad0  21 62 25 3d 73 61 76 65  61 73 25 0d 0c 9e 21 20  |!b%=saveas%...! |
00001ae0  c8 99 20 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |.. "Wimp_GetWind|
00001af0  6f 77 53 74 61 74 65 22  2c 2c 62 25 0d 0c a8 1e  |owState",,b%....|
00001b00  20 c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 57  | .. "Wimp_CloseW|
00001b10  69 6e 64 6f 77 22 2c 2c  62 25 0d 0c b2 05 e1 0d  |indow",,b%......|
00001b20  0c bc 05 3a 0d 0c c6 1d  dd 20 f2 73 61 76 65 5f  |...:..... .save_|
00001b30  77 69 6e 64 6f 77 28 66  69 6c 65 74 79 70 65 24  |window(filetype$|
00001b40  29 0d 0c d0 18 20 69 63  6f 6e 24 3d 22 53 22 2b  |).... icon$="S"+|
00001b50  66 69 6c 65 74 79 70 65  24 0d 0c da 19 20 64 72  |filetype$.... dr|
00001b60  61 67 5f 69 63 6f 6e 24  3d 66 69 6c 65 74 79 70  |ag_icon$=filetyp|
00001b70  65 24 0d 0c e4 26 20 f2  73 65 74 5f 76 61 6c 69  |e$...& .set_vali|
00001b80  64 28 73 61 76 65 61 73  25 2c 30 2c 69 63 6f 6e  |d(saveas%,0,icon|
00001b90  24 2b bd 28 31 33 29 29  0d 0c ee 18 20 24 73 61  |$+.(13)).... $sa|
00001ba0  76 65 73 74 72 25 3d 22  4f 75 74 63 6f 6d 65 22  |vestr%="Outcome"|
00001bb0  0d 0c f8 20 20 f2 72 65  64 72 61 77 5f 61 6e 64  |...  .redraw_and|
00001bc0  5f 74 6f 5f 74 6f 70 28  73 61 76 65 61 73 25 29  |_to_top(saveas%)|
00001bd0  0d 0d 02 05 e1 0d 0d 0c  05 3a 0d 0d 16 0f dd 20  |.........:..... |
00001be0  f2 64 72 61 67 5f 65 6e  64 0d 0d 20 21 20 c8 99  |.drag_end.. ! ..|
00001bf0  20 22 57 69 6d 70 5f 47  65 74 50 6f 69 6e 74 65  | "Wimp_GetPointe|
00001c00  72 49 6e 66 6f 22 2c 2c  62 25 0d 0d 2a 12 20 62  |rInfo",,b%..*. b|
00001c10  25 21 32 30 20 3d 20 62  25 21 31 32 0d 0d 34 12  |%!20 = b%!12..4.|
00001c20  20 62 25 21 32 34 20 3d  20 62 25 21 31 36 0d 0d  | b%!24 = b%!16..|
00001c30  3e 11 20 62 25 21 32 38  20 3d 20 62 25 21 30 0d  |>. b%!28 = b%!0.|
00001c40  0d 48 11 20 62 25 21 33  32 20 3d 20 62 25 21 34  |.H. b%!32 = b%!4|
00001c50  0d 0d 52 16 20 61 24 20  20 20 20 3d 20 24 73 61  |..R. a$    = $sa|
00001c60  76 65 73 74 72 25 0d 0d  5c 23 20 21 62 25 20 20  |vestr%..\# !b%  |
00001c70  20 3d 20 34 34 2b 28 28  a9 20 66 69 6c 65 24 2b  | = 44+((. file$+|
00001c80  31 29 20 81 20 34 29 2a  34 0d 0d 66 22 20 e7 20  |1) . 4)*4..f" . |
00001c90  28 28 a9 20 66 69 6c 65  24 2b 31 29 20 83 20 34  |((. file$+1) . 4|
00001ca0  29 3c 3e 30 20 21 62 25  2b 3d 34 0d 0d 70 0e 20  |)<>0 !b%+=4..p. |
00001cb0  62 25 21 31 32 20 3d 20  30 0d 0d 7a 0e 20 62 25  |b%!12 = 0..z. b%|
00001cc0  21 31 36 20 3d 20 31 0d  0d 84 0e 20 62 25 21 34  |!16 = 1.... b%!4|
00001cd0  34 20 3d 20 30 0d 0d 8e  26 20 c8 99 20 22 57 69  |4 = 0...& .. "Wi|
00001ce0  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
00001cf0  31 38 2c 62 25 2c 62 25  21 32 30 0d 0d 98 05 e1  |18,b%,b%!20.....|
00001d00  0d 0d a2 05 3a 0d 0d ac  14 dd 20 f2 6e 6f 74 5f  |....:..... .not_|
00001d10  72 65 73 6f 75 72 63 65  73 0d 0d b6 24 20 72 65  |resources...$ re|
00001d20  70 24 20 3d 20 a4 6d 65  73 73 61 67 65 28 66 69  |p$ = .message(fi|
00001d30  6c 65 25 2c 22 4e 6f 74  52 65 73 22 29 0d 0d c0  |le%,"NotRes")...|
00001d40  22 20 64 25 20 20 20 3d  20 a4 65 72 72 6f 72 28  |" d%   = .error(|
00001d50  31 3c 3c 33 31 2c 72 65  70 24 2c 31 30 30 29 0d  |1<<31,rep$,100).|
00001d60  0d ca 05 e1 0d 0d d4 05  3a 0d 0d de 1c dd 20 a4  |........:..... .|
00001d70  65 72 72 6f 72 28 65 72  72 25 2c 72 65 70 24 2c  |error(err%,rep$,|
00001d80  65 72 6c 25 29 0d 0d e8  20 20 ee 20 85 20 ef 20  |erl%)...  . . . |
00001d90  34 3a f6 3a f1 20 22 20  61 74 20 6c 69 6e 65 20  |4:.:. " at line |
00001da0  22 3b 9e 3a e0 0d 0d f2  0c 20 21 62 25 20 3d 20  |";.:..... !b% = |
00001db0  9f 0d 0d fc 0e 20 c8 8e  20 65 72 72 25 20 ca 0d  |..... .. err% ..|
00001dc0  0e 06 1e 20 20 20 c9 20  31 3c 3c 33 30 3a 65 72  |...   . 1<<30:er|
00001dd0  72 5f 73 74 72 69 6e 67  24 3d 22 20 22 0d 0e 10  |r_string$=" "...|
00001de0  1c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 62  |.              b|
00001df0  6f 78 25 20 3d 20 25 31  31 0d 0e 1a 1e 20 20 20  |ox% = %11....   |
00001e00  c9 20 31 3c 3c 33 31 3a  65 72 72 5f 73 74 72 69  |. 1<<31:err_stri|
00001e10  6e 67 24 3d 22 20 22 0d  0e 24 1c 20 20 20 20 20  |ng$=" "..$.     |
00001e20  20 20 20 20 20 20 20 20  20 62 6f 78 25 20 3d 20  |         box% = |
00001e30  25 31 30 0d 0e 2e 28 20  20 20 7f 20 3a 65 72 72  |%10...(   . :err|
00001e40  5f 73 74 72 69 6e 67 24  3d 22 20 61 74 20 6c 69  |_string$=" at li|
00001e50  6e 65 20 22 2b c3 20 65  72 6c 25 0d 0e 38 1c 20  |ne "+. erl%..8. |
00001e60  20 20 20 20 20 20 20 20  20 20 20 20 20 62 6f 78  |             box|
00001e70  25 20 3d 20 25 31 30 0d  0e 42 06 20 cb 0d 0e 4c  |% = %10..B. ...L|
00001e80  22 20 24 28 62 25 2b 34  29 20 3d 20 72 65 70 24  |" $(b%+4) = rep$|
00001e90  2b 65 72 72 5f 73 74 72  69 6e 67 24 2b bd 30 0d  |+err_string$+.0.|
00001ea0  0e 56 39 20 c8 99 20 22  57 69 6d 70 5f 52 65 70  |.V9 .. "Wimp_Rep|
00001eb0  6f 72 74 45 72 72 6f 72  22 2c 62 25 2c 62 6f 78  |ortError",b%,box|
00001ec0  25 2c 22 52 65 73 53 61  76 65 22 20 b8 20 2c 72  |%,"ResSave" . ,r|
00001ed0  65 73 70 6f 6e 73 65 25  0d 0e 60 12 3d 28 72 65  |esponse%..`.=(re|
00001ee0  73 70 6f 6e 73 65 25 3d  32 29 0d 0e 6a 05 3a 0d  |sponse%=2)..j.:.|
00001ef0  0e 74 10 dd 20 f2 73 65  6e 64 5f 68 65 6c 70 0d  |.t.. .send_help.|
00001f00  0e 7e 12 20 62 25 21 31  32 20 20 3d 20 62 25 21  |.~. b%!12  = b%!|
00001f10  38 0d 0e 88 12 20 62 25  21 31 36 20 20 3d 20 31  |8.... b%!16  = 1|
00001f20  32 38 33 0d 0e 92 13 20  68 65 6c 70 25 20 20 3d  |283.... help%  =|
00001f30  20 62 25 2b 32 30 0d 0e  9c 26 20 68 65 6c 70 25  | b%+20...& help%|
00001f40  20 20 3d 20 a4 68 65 6c  70 28 62 25 21 33 32 2c  |  = .help(b%!32,|
00001f50  62 25 21 33 36 2c 68 65  6c 70 25 29 0d 0e a6 0f  |b%!36,help%)....|
00001f60  20 3f 68 65 6c 70 25 20  3d 20 30 0d 0e b0 1f 20  | ?help% = 0.... |
00001f70  21 62 25 20 20 20 20 3d  20 28 68 65 6c 70 25 2b  |!b%    = (help%+|
00001f80  34 2d 62 25 29 80 20 ac  20 33 0d 0e ba 25 20 c8  |4-b%). . 3...% .|
00001f90  99 20 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |. "Wimp_SendMess|
00001fa0  61 67 65 22 2c 31 37 2c  62 25 2c 62 25 21 34 0d  |age",17,b%,b%!4.|
00001fb0  0e c4 05 e1 0d 0e ce 05  3a 0d 0e d8 1e dd 20 a4  |........:..... .|
00001fc0  68 65 6c 70 28 77 69 6e  64 6f 77 25 2c 69 63 6f  |help(window%,ico|
00001fd0  6e 25 2c 74 6f 25 29 0d  0e e2 12 20 6d 24 20 3d  |n%,to%).... m$ =|
00001fe0  20 24 6d 6f 64 73 74 72  25 0d 0e ec 13 20 66 24  | $modstr%.... f$|
00001ff0  20 3d 20 24 73 61 76 65  73 74 72 25 0d 0e f6 0c  | = $savestr%....|
00002000  20 24 74 6f 25 3d 22 22  0d 0f 00 11 20 c8 8e 20  | $to%="".... .. |
00002010  77 69 6e 64 6f 77 25 20  ca 0d 0f 0a 0e 20 20 20  |window% .....   |
00002020  c9 20 69 6e 66 6f 25 0d  0f 14 25 20 20 20 20 20  |. info%...%     |
00002030  24 74 6f 25 3d a4 6d 65  73 73 61 67 65 28 66 69  |$to%=.message(fi|
00002040  6c 65 25 2c 22 48 69 6e  66 6f 22 29 0d 0f 1e 10  |le%,"Hinfo")....|
00002050  20 20 20 c9 20 73 61 76  65 61 73 25 0d 0f 28 13  |   . saveas%..(.|
00002060  20 20 20 20 20 c8 8e 20  69 63 6f 6e 25 20 ca 0d  |     .. icon% ..|
00002070  0f 32 0e 20 20 20 20 20  20 20 c9 20 30 0d 0f 3c  |.2.       . 0..<|
00002080  18 20 20 20 20 20 20 20  20 20 c8 8e 20 73 61 76  |.         .. sav|
00002090  65 32 25 20 ca 0d 0f 46  12 20 20 20 20 20 20 20  |e2% ...F.       |
000020a0  20 20 20 20 c9 20 b9 0d  0f 50 3c 20 20 20 20 20  |    . ...P<     |
000020b0  20 20 20 20 20 20 20 20  24 74 6f 25 20 3d 20 a4  |        $to% = .|
000020c0  6d 65 73 73 61 67 65 28  66 69 6c 65 25 2c 22 48  |message(file%,"H|
000020d0  6d 61 69 6e 30 62 3a 22  2b 66 24 2b 22 3a 22 2b  |main0b:"+f$+":"+|
000020e0  6d 24 29 0d 0f 5a 12 20  20 20 20 20 20 20 20 20  |m$)..Z.         |
000020f0  20 20 c9 20 a3 0d 0f 64  3c 20 20 20 20 20 20 20  |  . ...d<       |
00002100  20 20 20 20 20 20 24 74  6f 25 20 3d 20 a4 6d 65  |      $to% = .me|
00002110  73 73 61 67 65 28 66 69  6c 65 25 2c 22 48 6d 61  |ssage(file%,"Hma|
00002120  69 6e 30 61 3a 22 2b 66  24 2b 22 3a 22 2b 6d 24  |in0a:"+f$+":"+m$|
00002130  29 0d 0f 6e 0e 20 20 20  20 20 20 20 20 20 cb 0d  |)..n.         ..|
00002140  0f 78 0e 20 20 20 20 20  20 20 c9 20 31 0d 0f 82  |.x.       . 1...|
00002150  18 20 20 20 20 20 20 20  20 20 c8 8e 20 73 61 76  |.         .. sav|
00002160  65 32 25 20 ca 0d 0f 8c  12 20 20 20 20 20 20 20  |e2% .....       |
00002170  20 20 20 20 c9 20 b9 0d  0f 96 31 20 20 20 20 20  |    . ....1     |
00002180  20 20 20 20 20 20 20 20  24 74 6f 25 20 3d 20 a4  |        $to% = .|
00002190  6d 65 73 73 61 67 65 28  66 69 6c 65 25 2c 22 48  |message(file%,"H|
000021a0  6d 61 69 6e 31 62 22 29  0d 0f a0 12 20 20 20 20  |main1b")....    |
000021b0  20 20 20 20 20 20 20 c9  20 a3 0d 0f aa 31 20 20  |       . ....1  |
000021c0  20 20 20 20 20 20 20 20  20 20 20 24 74 6f 25 20  |           $to% |
000021d0  3d 20 a4 6d 65 73 73 61  67 65 28 66 69 6c 65 25  |= .message(file%|
000021e0  2c 22 48 6d 61 69 6e 31  61 22 29 0d 0f b4 0e 20  |,"Hmain1a").... |
000021f0  20 20 20 20 20 20 20 20  cb 0d 0f be 0e 20 20 20  |        .....   |
00002200  20 20 20 20 c9 20 34 0d  0f c8 2c 20 20 20 20 20  |    . 4...,     |
00002210  20 20 20 20 24 74 6f 25  20 3d 20 a4 6d 65 73 73  |    $to% = .mess|
00002220  61 67 65 28 66 69 6c 65  25 2c 22 48 6d 61 69 6e  |age(file%,"Hmain|
00002230  34 22 29 0d 0f d2 0e 20  20 20 20 20 20 20 c9 20  |4")....       . |
00002240  36 0d 0f dc 18 20 20 20  20 20 20 20 20 20 c8 8e  |6....         ..|
00002250  20 73 61 76 65 32 25 20  ca 0d 0f e6 12 20 20 20  | save2% .....   |
00002260  20 20 20 20 20 20 20 20  c9 20 b9 0d 0f f0 30 20  |        . ....0 |
00002270  20 20 20 20 20 20 20 20  20 20 20 20 24 74 6f 25  |            $to%|
00002280  20 3d 20 a4 6d 65 73 73  61 67 65 28 66 69 6c 65  | = .message(file|
00002290  25 2c 22 48 6d 61 69 6e  36 22 29 0d 0f fa 0e 20  |%,"Hmain6").... |
000022a0  20 20 20 20 20 20 20 20  cb 0d 10 04 0e 20 20 20  |        .....   |
000022b0  20 20 20 20 c9 20 37 0d  10 0e 2c 20 20 20 20 20  |    . 7...,     |
000022c0  20 20 20 20 24 74 6f 25  20 3d 20 a4 6d 65 73 73  |    $to% = .mess|
000022d0  61 67 65 28 66 69 6c 65  25 2c 22 48 6d 61 69 6e  |age(file%,"Hmain|
000022e0  37 22 29 0d 10 18 0b 20  20 20 20 20 20 7f 0d 10  |7")....      ...|
000022f0  22 2b 20 20 20 20 20 20  20 20 20 24 74 6f 25 20  |"+         $to% |
00002300  3d 20 a4 6d 65 73 73 61  67 65 28 66 69 6c 65 25  |= .message(file%|
00002310  2c 22 48 6d 61 69 6e 22  29 0d 10 2c 0a 20 20 20  |,"Hmain")..,.   |
00002320  20 20 cb 0d 10 36 29 20  20 20 c9 20 2d 32 3a 24  |  ...6)   . -2:$|
00002330  74 6f 25 20 3d 20 a4 6d  65 73 73 61 67 65 28 66  |to% = .message(f|
00002340  69 6c 65 25 2c 22 48 62  61 72 22 29 0d 10 40 07  |ile%,"Hbar")..@.|
00002350  20 20 7f 0d 10 4a 29 20  20 20 e7 20 77 69 6d 70  |  ...J)   . wimp|
00002360  5f 76 65 72 73 69 6f 6e  25 3e 3d 32 31 38 20 80  |_version%>=218 .|
00002370  20 69 63 6f 6e 25 3c 3e  2d 31 20 8c 0d 10 54 36  | icon%<>-1 ...T6|
00002380  20 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 47 65  |     .. "Wimp_Ge|
00002390  74 4d 65 6e 75 53 74 61  74 65 22 2c 31 2c 62 25  |tMenuState",1,b%|
000023a0  2b 34 30 30 2c 77 69 6e  64 6f 77 25 2c 69 63 6f  |+400,window%,ico|
000023b0  6e 25 0d 10 5e 14 20 20  20 20 20 c8 8e 20 62 25  |n%..^.     .. b%|
000023c0  21 34 30 30 20 ca 0d 10  68 0e 20 20 20 20 20 20  |!400 ...h.      |
000023d0  20 c9 20 30 0d 10 72 37  20 20 20 20 20 20 20 20  | . 0..r7        |
000023e0  20 e7 20 62 25 21 34 30  34 3d 2d 31 20 24 74 6f  | . b%!404=-1 $to|
000023f0  25 20 3d 20 a4 6d 65 73  73 61 67 65 28 66 69 6c  |% = .message(fil|
00002400  65 25 2c 22 48 6d 65 6e  30 22 29 0d 10 7c 0e 20  |e%,"Hmen0")..|. |
00002410  20 20 20 20 20 20 c9 20  31 0d 10 86 2b 20 20 20  |      . 1...+   |
00002420  20 20 20 20 20 20 24 74  6f 25 20 3d 20 a4 6d 65  |      $to% = .me|
00002430  73 73 61 67 65 28 66 69  6c 65 25 2c 22 48 6d 65  |ssage(file%,"Hme|
00002440  6e 31 22 29 0d 10 90 0a  20 20 20 20 20 cb 0d 10  |n1")....     ...|
00002450  9a 08 20 20 20 cd 0d 10  a4 06 20 cb 0d 10 ae 10  |..   ..... .....|
00002460  3d 74 6f 25 2b a9 28 24  74 6f 25 29 0d 10 b8 05  |=to%+.($to%)....|
00002470  3a 0d 10 c2 17 dd 20 f2  67 72 65 79 28 77 69 6e  |:..... .grey(win|
00002480  25 2c 69 63 6f 6e 25 29  0d 10 cc 09 20 ea 20 63  |%,icon%).... . c|
00002490  25 0d 10 d6 0e 20 63 25  3d 62 25 2b 34 30 30 0d  |%.... c%=b%+400.|
000024a0  10 e0 0f 20 21 63 25 20  20 3d 77 69 6e 25 0d 10  |... !c%  =win%..|
000024b0  ea 10 20 63 25 21 34 20  3d 69 63 6f 6e 25 0d 10  |.. c%!4 =icon%..|
000024c0  f4 10 20 63 25 21 38 20  3d 31 3c 3c 32 32 0d 10  |.. c%!8 =1<<22..|
000024d0  fe 10 20 63 25 21 31 32  3d 31 3c 3c 32 32 0d 11  |.. c%!12=1<<22..|
000024e0  08 1f 20 c8 99 20 22 57  69 6d 70 5f 53 65 74 49  |.. .. "Wimp_SetI|
000024f0  63 6f 6e 53 74 61 74 65  22 2c 2c 63 25 0d 11 12  |conState",,c%...|
00002500  05 e1 0d 11 1c 05 3a 0d  11 26 19 dd 20 f2 75 6e  |......:..&.. .un|
00002510  67 72 65 79 28 77 69 6e  25 2c 69 63 6f 6e 25 29  |grey(win%,icon%)|
00002520  0d 11 30 09 20 ea 20 63  25 0d 11 3a 0e 20 63 25  |..0. . c%..:. c%|
00002530  3d 62 25 2b 34 30 30 0d  11 44 0f 20 21 63 25 20  |=b%+400..D. !c% |
00002540  20 3d 77 69 6e 25 0d 11  4e 10 20 63 25 21 34 20  | =win%..N. c%!4 |
00002550  3d 69 63 6f 6e 25 0d 11  58 0c 20 63 25 21 38 20  |=icon%..X. c%!8 |
00002560  3d 30 0d 11 62 10 20 63  25 21 31 32 3d 31 3c 3c  |=0..b. c%!12=1<<|
00002570  32 32 0d 11 6c 1f 20 c8  99 20 22 57 69 6d 70 5f  |22..l. .. "Wimp_|
00002580  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 63  |SetIconState",,c|
00002590  25 0d 11 76 05 e1 0d 11  80 05 3a 0d 11 8a 12 dd  |%..v......:.....|
000025a0  20 a4 61 70 70 5f 73 70  28 73 70 24 29 0d 11 94  | .app_sp(sp$)...|
000025b0  2e 20 c8 99 20 22 58 57  69 6d 70 5f 53 70 72 69  |. .. "XWimp_Spri|
000025c0  74 65 4f 70 22 2c 34 30  2c 2c 73 70 24 20 b8 20  |teOp",40,,sp$ . |
000025d0  65 72 72 25 3b 66 6c 61  67 73 25 0d 11 9e 2a 20  |err%;flags%...* |
000025e0  e7 20 28 66 6c 61 67 73  25 20 80 20 31 29 20 3c  |. (flags% . 1) <|
000025f0  3e 20 30 20 73 70 24 3d  22 41 70 70 6c 69 63 61  |> 0 sp$="Applica|
00002600  74 69 6f 6e 22 0d 11 a8  08 3d 73 70 24 0d 11 b2  |tion"....=sp$...|
00002610  05 3a 0d 11 bc 13 dd 20  a4 66 69 6c 65 5f 73 70  |.:..... .file_sp|
00002620  28 73 70 24 29 0d 11 c6  14 20 73 70 24 3d 22 46  |(sp$).... sp$="F|
00002630  69 6c 65 5f 22 2b 73 70  24 0d 11 d0 2e 20 c8 99  |ile_"+sp$.... ..|
00002640  20 22 58 57 69 6d 70 5f  53 70 72 69 74 65 4f 70  | "XWimp_SpriteOp|
00002650  22 2c 34 30 2c 2c 73 70  24 20 b8 20 65 72 72 25  |",40,,sp$ . err%|
00002660  3b 66 6c 61 67 73 25 0d  11 da 27 20 e7 20 28 66  |;flags%...' . (f|
00002670  6c 61 67 73 25 20 80 20  31 29 20 3c 3e 20 30 20  |lags% . 1) <> 0 |
00002680  73 70 24 3d 22 46 69 6c  65 5f 3f 3f 3f 22 0d 11  |sp$="File_???"..|
00002690  e4 08 3d 73 70 24 0d 11  ee 05 3a 0d 11 f8 34 dd  |..=sp$....:...4.|
000026a0  20 f2 6f 70 65 6e 5f 6d  65 73 73 61 67 65 73 28  | .open_messages(|
000026b0  77 69 62 62 6c 65 25 2c  6d 65 73 66 69 6c 65 24  |wibble%,mesfile$|
000026c0  2c 62 75 66 66 65 72 25  2c 73 69 7a 65 25 29 0d  |,buffer%,size%).|
000026d0  12 02 37 20 c8 99 20 22  4d 65 73 73 61 67 65 54  |..7 .. "MessageT|
000026e0  72 61 6e 73 5f 46 69 6c  65 49 6e 66 6f 22 2c 2c  |rans_FileInfo",,|
000026f0  6d 65 73 66 69 6c 65 24  20 b8 20 66 6c 61 67 25  |mesfile$ . flag%|
00002700  2c 2c 6c 65 6e 25 0d 12  0c 12 20 e7 20 66 6c 61  |,,len%.... . fla|
00002710  67 25 20 80 20 31 20 8c  0d 12 16 0d 20 20 20 6c  |g% . 1 .....   l|
00002720  65 6e 25 3d 30 0d 12 20  10 20 20 20 62 75 66 66  |en%=0.. .   buff|
00002730  65 72 25 3d 30 0d 12 2a  07 20 20 cc 0d 12 34 13  |er%=0..*.  ...4.|
00002740  20 20 20 62 75 66 66 65  72 25 3d 6d 65 6d 25 0d  |   buffer%=mem%.|
00002750  12 3e 06 20 cd 0d 12 48  2c 20 e7 20 6c 65 6e 25  |.>. ...H, . len%|
00002760  3e 73 69 7a 65 25 20 85  20 31 2c 22 50 6c 65 61  |>size% . 1,"Plea|
00002770  73 65 20 69 6e 63 72 65  61 73 65 20 6d 61 78 25  |se increase max%|
00002780  22 0d 12 52 38 20 c8 99  20 22 4d 65 73 73 61 67  |"..R8 .. "Messag|
00002790  65 54 72 61 6e 73 5f 4f  70 65 6e 46 69 6c 65 22  |eTrans_OpenFile"|
000027a0  2c 77 69 62 62 6c 65 25  2c 6d 65 73 66 69 6c 65  |,wibble%,mesfile|
000027b0  24 2c 62 75 66 66 65 72  25 0d 12 5c 05 e1 0d 12  |$,buffer%..\....|
000027c0  66 05 3a 0d 12 70 1e dd  20 f2 63 6c 6f 73 65 5f  |f.:..p.. .close_|
000027d0  6d 65 73 73 61 67 65 73  28 77 69 62 62 6c 65 25  |messages(wibble%|
000027e0  29 0d 12 7a 28 20 c8 99  20 22 4d 65 73 73 61 67  |)..z( .. "Messag|
000027f0  65 54 72 61 6e 73 5f 43  6c 6f 73 65 46 69 6c 65  |eTrans_CloseFile|
00002800  22 2c 77 69 62 62 6c 65  25 0d 12 84 05 e1 0d 12  |",wibble%.......|
00002810  8e 05 3a 0d 12 98 1d dd  20 a4 6d 65 73 73 61 67  |..:..... .messag|
00002820  65 28 77 69 62 62 6c 65  25 2c 6d 65 73 73 24 29  |e(wibble%,mess$)|
00002830  0d 12 a2 1b 20 74 6f 6b  65 6e 24 20 3d 20 a4 73  |.... token$ = .s|
00002840  70 6c 69 74 28 6d 65 73  73 24 29 0d 12 ac 60 20  |plit(mess$)...` |
00002850  c8 99 20 22 4d 65 73 73  61 67 65 54 72 61 6e 73  |.. "MessageTrans|
00002860  5f 4c 6f 6f 6b 75 70 22  2c 77 69 62 62 6c 65 25  |_Lookup",wibble%|
00002870  2c 74 6f 6b 65 6e 24 2c  62 75 66 66 65 72 25 2c  |,token$,buffer%,|
00002880  62 75 66 5f 73 69 7a 65  25 2c 73 24 28 31 29 2c  |buf_size%,s$(1),|
00002890  73 24 28 32 29 2c 73 24  28 33 29 2c 73 24 28 34  |s$(2),s$(3),s$(4|
000028a0  29 20 b8 20 2c 2c 2c 6c  65 6e 25 0d 12 b6 16 20  |) . ,,,len%.... |
000028b0  62 75 66 66 65 72 25 3f  6c 65 6e 25 20 3d 20 31  |buffer%?len% = 1|
000028c0  33 0d 12 c0 0d 3d 24 62  75 66 66 65 72 25 0d 12  |3....=$buffer%..|
000028d0  ca 05 3a 0d 12 d4 12 dd  20 a4 73 70 6c 69 74 28  |..:..... .split(|
000028e0  73 74 72 24 29 0d 12 de  09 20 ea 20 69 25 0d 12  |str$).... . i%..|
000028f0  e8 0d 20 69 25 20 20 20  3d 20 30 0d 12 f2 0e 20  |.. i%   = 0.... |
00002900  73 24 28 29 20 3d 20 22  22 0d 12 fc 10 20 c8 95  |s$() = "".... ..|
00002910  20 73 74 72 24 3c 3e 22  22 0d 13 06 1e 20 20 20  | str$<>""....   |
00002920  63 6f 6c 25 20 20 20 3d  20 a7 73 74 72 24 2b 22  |col%   = .str$+"|
00002930  3a 22 2c 22 3a 22 29 0d  13 10 1d 20 20 20 73 24  |:",":")....   s$|
00002940  28 69 25 29 20 3d 20 c0  73 74 72 24 2c 63 6f 6c  |(i%) = .str$,col|
00002950  25 2d 31 29 0d 13 1a 1d  20 20 20 73 74 72 24 20  |%-1)....   str$ |
00002960  20 20 3d 20 c1 73 74 72  24 2c 63 6f 6c 25 2b 31  |  = .str$,col%+1|
00002970  29 0d 13 24 11 20 20 20  69 25 20 20 20 20 2b 3d  |)..$.   i%    +=|
00002980  20 31 0d 13 2e 06 20 ce  0d 13 38 0a 3d 73 24 28  | 1.... ...8.=s$(|
00002990  30 29 0d ff                                       |0)..|
00002994