Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » Regulars » StarInfo/Whitehouse/Shared/!Browzer/!RunImage

StarInfo/Whitehouse/Shared/!Browzer/!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_199607.adf » Regulars
Filename: StarInfo/Whitehouse/Shared/!Browzer/!RunImage
Read OK:
File size: 3510 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >> text shower
   20REM
   30REM Copyright Stuart Whitehouse, 1994,5
   40REM
   50REM
   60REM
   70REM
   80ON ERROR ON ERROR OFF:PROCerror(REPORT$+" - "+STR$(ERL)):PROCclosedown:END
   90PROCinit
  100OSCLI("LOAD <Browzer$Dir>.Code "+STR$~(codemem%))
  110IF load% PROCdataloaddo
  120*UNSET Browzer$HelpFile
  130PROCloop
  140PROCclosedown
  150END
  160:
  170DEFPROCclosedown
  180SYS "Tempest_MiscOp",10,,tb%
  190SYS "Wimp_CloseDown"
  200ENDPROC
  210:
  220DEFPROCinit
  230DIM tb% 2048, b% 512, pb% 48
  240SYS "Wimp_Initialise",310,&4B534154,"Browzer",0 TO ,taskhandle%
  250
  260SYS "Tempest_Hello",,6+16,tb%,2048,"Browzer"
  270b=b%
  280DIM title 100, codemem% 1024, indirect% 2000
  290DIM stack%(7)
  300sptr%=0:destmark%=0:file$="":window%=FALSE:lastptr%=0
  310datamem%=0:ptrmem%=0:buttonmem%=0:sprmem%=0:markmem%=0
  320numbuttons%=0:nummarks%=0:icon%=0:endmem%=0:whandle%=0:scrollmax%=0
  330windfile$=STRING$(10,"*")
  340sprfile$=file$
  350delay%=10:go%=-1:menu%=-1:format%=TRUE:silly%=TRUE
  360sprite%=0:sillytime%=0:time%=0
  370:
  380extend%=HIMEM:topofmem%=HIMEM
  390quit%=FALSE:load%=TRUE
  400REM file$="<Browzer$HelpFile>"
  410SYS "OS_ReadVarVal","Browzer$HelpFile",b%,1000,0,0 TO ,,w%
  420b%?w%=13 : file$=$b%
  430start_mark%=0
  440w%=INSTR(file$,"\\\")
  450IF w%>0 THEN
  460  s$=MID$(file$,w%+3)
  470  file$=LEFT$(file$,w%-1)
  480  start_mark%=VALs$
  490ENDIF
  500:
  510REM >> makeicon
  520DIM iname 12, isprite 2650
  530!isprite=2650
  540OSCLI("LOAD <Browzer$Dir>.IconSpr "+STR$~(isprite+4))
  550:
  560!b=-1:b!4=0:b!8=0
  570b!12=68:b!16=68
  580b!20=&0000311A
  590$iname="Open!"
  600b!24=iname
  610b!28=isprite
  620b!32=5
  630SYS "Wimp_CreateIcon",,b TO ihandle%
  640:
  650$b="open!"
  660SYS "OS_SpriteOp",256+24,isprite,b TO ,,sprptr%
  670sprptr%+=sprptr%!32
  680:
  690SYS "Tempest_RegisterIndirectArea",indirect%,indirect%+2000,tb%
  700SYS "Tempest_OpenFile","<Browzer$Dir>.Templates",,tb%
  710SYS "Tempest_LoadObject","ProgInfo",b%,tb%,-1,0 TO inhandle%
  720SYS "Tempest_LoadObject","Speed",b%,tb%,-1,0 TO shandle%
  730speedstr=FNgettextmem(shandle%,0)
  740SYS "Tempest_LoadObject","IbarMenu",b%,tb%,-1,0 TO mb
  750SYS "Tempest_LoadObject","WindMenu",b%,tb%,-1,0 TO wb
  760SYS "Tempest_CloseFile",,,tb%
  770SYS "Tempest_LinkMenus",,0,tb%
  780ENDPROC
  790:
  800:
  810DEFPROCmakewindow
  820RESTORE+0
  830FOR w%=0 TO 84 STEP 4
  840  READ s$:b!w%=EVAL(s$)
  850NEXT
  860IF b!4<174 OR b!4>10000 b!4=174
  870$title="Browzer"
  880SYS "Wimp_CreateWindow",,b TO whandle%
  890scrollmax%=b!44
  900ENDPROC
  910DATA 0,800-lastptr%*32-2,(width%*16)+5,800
  920DATA 0,0,-1,&FF000002
  930DATA &00070207,&000C0103
  940DATA 0,0-lastptr%*32-2,width%*16+5,0
  950DATA &119,0<<12,1,1+(0<<12)
  960DATA title,-1,40,0
  970:
  980:
  990DEFPROCloop
 1000quit%=FALSE
 1010REPEAT
 1020  SYS "Wimp_Poll",&3830 AND tb%!1000,b TO reason%
 1030  SYS "Tempest_PreProcess",reason%,b%,tb% TO reason%
 1040  CASE reason% OF
 1050    WHEN 0 : IF go%>=0 AND TIME>time%+delay% PROCscroll
 1060    IF silly% AND TIME>sillytime%+8 PROCdosilly
 1070    WHEN 1 : PROCredraw
 1080    WHEN 2 : SYS "Tempest_OpenWindow",,b,tb%
 1090    WHEN 3 : PROCclosedata
 1100    WHEN 6 : PROCclick
 1110    WHEN 9 : PROCmenu
 1120    WHEN 17,18 : CASE b%!16 OF
 1130      WHEN 0 : quit%=TRUE
 1140      WHEN &4B483 : PROCchangedelay(-b%!28)
 1150    ENDCASE
 1160  ENDCASE
 1170UNTIL quit%
 1180ENDPROC
 1190:
 1200DEFPROCclick
 1210CASE b!12 OF
 1220  WHEN shandle% : PROCspeedclick
 1230  WHEN -2 : PROCibarclick
 1240  OTHERWISE : PROCmainclick
 1250ENDCASE
 1260ENDPROC
 1270:
 1280DEFPROCmainclick
 1290IF (b!8 AND 2)>0 THEN PROCtick(wb,1,TRUE,go%=0):SYS "Tempest_ShowMenu",1,,tb%,wb:menu%=0:ENDPROC
 1300
 1310w%=b!16
 1320CASE FNitype(w%) OF
 1330  WHEN 1 :
 1340  IF sptr%=8 THEN
 1350    FOR x%=0 TO 6:stack%(x%)=stack%(x%+1):NEXT
 1360    sptr%-=1
 1370  ENDIF
 1380  stack%(sptr%)=FNifrom(w%)
 1390  sptr%+=1
 1400  PROCmoveto(FNmark(FNidest(w%)))
 1410  WHEN 3 :
 1420  IF sptr%=0 THEN
 1430    PROCerror("Nowhere to go back to.")
 1440  ELSE
 1450    sptr%=sptr%-1
 1460    PROCmoveto(stack%(sptr%))
 1470  ENDIF
 1480ENDCASE
 1490ENDPROC
 1500:
 1510DEFFNidest(w%):=!(buttonmem%+w%*12+4)
 1520DEFFNitype(w%):=!(buttonmem%+w%*12)
 1530DEFFNifrom(w%):=!(buttonmem%+w%*12+8)
 1540DEFFNmark(w%):=!(markmem%+w%*4)
 1550:
 1560DEFPROCmoveto(x%)
 1570destmark%=x%
 1580!b=whandle%
 1590SYS "Wimp_GetWindowState",,b
 1600SYS "Wimp_CloseWindow",,b:REM to force redraw of EVERYTHING
 1610x%=-x%*32+((b!16-b!8)DIV2):REM puts target in middle
 1620b!24=x%
 1630SYS "Wimp_OpenWindow",,b
 1640ENDPROC
 1650:
 1660DEFPROCibarclick
 1670CASE b!8 OF
 1680  WHEN 4 :
 1690  WHEN 2 : SYS "Tempest_ShowMenu",0,,tb%,mb:menu%=-1
 1700  WHEN 1 :
 1710ENDCASE
 1720ENDPROC
 1730:
 1740DEFPROCspeedclick
 1750CASE b!16 OF
 1760  WHEN 3 : !pb%=shandle%:SYS "Tempest_CloseWindow",,pb%,tb%
 1770  WHEN 4 : delay%=olddelay%:!pb%=shandle%:SYS "Tempest_CloseWindow",,pb%,tb%
 1780ENDCASE
 1790ENDPROC
 1800:
 1810DEFPROCchangedelay(w%)
 1820IF delay%>25 w%=w%*2
 1830delay%=FNrange(delay%+w%,4,35)
 1840SYS "Tempest_SetIconText",shandle%,0,tb%,STR$(INT(1000/delay%))
 1850ENDPROC
 1860:
 1870DEFPROCmenu
 1880IF menu%=-1 THEN
 1890  CASE b!0 OF
 1900    WHEN 1 : quit%=TRUE
 1910  ENDCASE
 1920ELSE
 1930  CASE b!0 OF
 1940    WHEN 0 :   IF sptr%=0 THEN
 1950      PROCerror("Nowhere to go back to.")
 1960    ELSE
 1970      sptr%=sptr%-1
 1980      PROCmoveto(stack%(sptr%))
 1990    ENDIF
 2000    WHEN 1 : IF go%<>0 go%=0:time%=go%-100 ELSE go%=-1
 2010    PROCtick(wb,1,TRUE,go%=0)
 2020    WHEN 2 : $speedstr=STR$(INT(1000/delay%))
 2030    olddelay%=delay%:!pb%=shandle%:SYS "Tempest_ShowWindow",&33311,pb%,tb%
 2040    WHEN 3 : PROCclosedata:b!136=0
 2050  ENDCASE
 2060ENDIF
 2070SYS "Tempest_ShowMenu",7,,tb%,0
 2080ENDPROC
 2090:
 2100:
 2110DEFPROCdosilly
 2120SYS "Tempest_MiscOp",14,b,tb%,-2,ihandle% TO eyex%,eyey%
 2130eyex%+=16:eyey%+=34
 2140REM eye xy contains centre of left eyeball
 2150MOUSE mousex%,mousey%,j%
 2160
 2170A%=sprptr%
 2180CALL codemem%+12
 2190
 2200delx%=mousex%-eyex%
 2210dely%=mousey%-eyey%
 2220REM mouse xy contains the vector from centre eye to pointer
 2230sq=SQR(delx%*delx%+dely%*dely%)
 2240IF sq<6 sq=6
 2250x%=7*delx%/sq
 2260y%=7*dely%/sq
 2270PROCeyeset(x%,y%)
 2280
 2290REM other eye,old delY correct. X 34 out
 2300delx%-=34
 2310REM mouse xy contains the vector from centre eye to pointer
 2320sq=SQR(delx%*delx%+dely%*dely%)
 2330IF sq<6 sq=6
 2340x%=7*delx%/sq
 2350y%=7*dely%/sq
 2360PROCeyeset(x%+34,y%)
 2370
 2380PROCinvalid(-2,ihandle%)
 2390sillytime%=TIME
 2400ENDPROC
 2410:
 2420DEFPROCeyeset(x%,y%)
 2430REM coords right up from middle of left eye
 2440x%=(x% DIV 2)+7
 2450y%=8-(y% DIV 2)
 2460REM these coords are right,down, 0 based pixels from TL of sprite
 2470odd%=x% MOD 2:REM is it starting on high nibble
 2480B%=sprptr%+y%*16+(x% DIV 2)
 2490IF odd%>0 CALL (codemem%+20) ELSE CALL (codemem%+16)
 2500ENDPROC
 2510:
 2520DEFPROCscroll
 2530!b=whandle%
 2540SYS "Wimp_GetWindowState",,b
 2550b!24=b!24-4
 2560IF b!24<scrollmax%+(b!16-b!8) THEN go%=-1:ENDPROC
 2570SYS "Wimp_OpenWindow",,b
 2580time%=TIME
 2590ENDPROC
 2600:
 2610DEFPROCdataloaddo
 2620abort%=FALSE
 2630SYS "Hourglass_On"
 2640size%=FNfilesize(file$)
 2650datamem%=topofmem%
 2660PROCsetmem(topofmem%+size%+4-(size% MOD 4)+128):REM ******
 2670IF abort%=FALSE THEN
 2680  OSCLI("LOAD "+file$+" "+STR$~(datamem%))
 2690  windfile$=FNendname(file$):REMresets file$( )
 2700  width%=77
 2710  IF NOT abort% PROCmakeptrs
 2720  IF NOT abort% PROCmakewindow:PROCmakeicons
 2730  endmem%=topofmem%
 2740  IF NOT abort% THEN
 2750    sptr%=0:destmark%=-1:REM clear buttons stack and last dest
 2760    $title="Browzer"
 2770    window%=TRUE
 2780    !pb%=whandle%:SYS "Tempest_ShowWindow",1,pb%,tb%
 2790    IF start_mark%>0 THEN
 2800      PROCmoveto(FNmark(start_mark%))
 2810      start_mark%=0
 2820    ENDIF
 2830  ENDIF
 2840ENDIF
 2850SYS "Hourglass_Off"
 2860ENDPROC
 2870:
 2880DEFPROCsetmem(top%)
 2890LOCAL w%
 2900SYS "Wimp_SlotSize",top%-&8000,-1 TO w%
 2910IF w%<top%-&8000 THEN PROCerror("Not enough memory available"):abort%=TRUE:PROCclosedata:ENDPROC
 2920topofmem%=top%
 2930ENDPROC
 2940:
 2950DEFFNendname(s$)
 2960w%=1
 2970FOR enloop%=1 TO LEN(s$)
 2980  IF MID$(s$,enloop%,1)="." w%=enloop%+1
 2990NEXT
 3000file$=LEFT$(s$,w%-1)
 3010=RIGHT$(s$,LEN(s$)-w%+1)
 3020:
 3030:
 3040DEFPROCclosedata
 3050quit%=TRUE
 3060ENDPROC
 3070:
 3080DEFPROCredraw
 3090SYS "Wimp_RedrawWindow",,b TO flag%
 3100ox%=b!4-b!20
 3110oy%=b!16-b!24
 3120WHILE flag%<>0
 3130  starty%=b!24-(b!16-b!40):REM top redw rect work cd(-)
 3140  heighty%=(b!40-b!32)+1:REM h of redw in OS/scr cd
 3150  starty%=(-starty%)DIV 32
 3160  endy%=starty%+(heighty% DIV 32)+1
 3170  IF endy%>=lastptr% endy%=lastptr%-1
 3180  SYS "Wimp_SetColour",12
 3190  IF destmark%>starty%-5 AND destmark%<endy%+5 RECTANGLE FILL ox%+2,oy%-destmark%*32-33,1280,32
 3200  SYS "Wimp_SetColour",7
 3210  C%=starty%
 3220  B%=ptrmem%
 3230  WHILE C%<=endy%
 3240    MOVE ox%+2,oy%-C%*32-4
 3250    CALL (codemem%+28)
 3260    C%+=1
 3270  ENDWHILE
 3280  SYS "Wimp_GetRectangle",,b TO flag%
 3290  REM get next redraw area
 3300ENDWHILE
 3310ENDPROC
 3320:
 3330DEFPROCmakeptrs
 3340getptr%=datamem%:REM this can be reset by PROCheader
 3350ascii%=FALSE:replace%=32:user%=FALSE:form%=format%
 3360w$=FNpull
 3370IF LEFT$(w$,7)="�HEADER" THEN PROCheader ELSE getptr%=datamem%:header%=FALSE
 3380ptrmem%=topofmem%
 3390PROCsetmem(topofmem%+128)
 3400!ptrmem%=getptr%
 3410nextptr%=1
 3420B%=getptr%:C%=datamem%+size%+1:D%=width%:G%=replace%
 3430H%=(ascii% AND 128)+(form% AND 1)
 3440!codemem%=0
 3450REPEAT
 3460  B%=USR(codemem%+4)
 3470  !(ptrmem%+nextptr%*4)=B%
 3480  nextptr%+=1
 3490  PROCsetmem(topofmem%+4)
 3500UNTIL ?codemem%<>0 OR abort%
 3510lastptr%=nextptr%-1
 3520ENDPROC
 3530:
 3540DEFPROCheader
 3550header%=TRUE
 3560REPEAT
 3570  w$=FNpull
 3580  IF w$<>"�END" THEN
 3590    IF getptr%>datamem%+size% PROCerror("Bad header block."):getptr%=datamem%+1:w$="�END":header%=FALSE
 3600    IF w$="ASCII" THEN ascii%=TRUE
 3610    IF LEFT$(w$,7)="REPLACE" THEN
 3620      IF RIGHT$(w$,1)<"0" AND RIGHT$(w$,1)>"9" THEN replace%=ASC(RIGHT$(w$,1)) ELSE replace%=VALMID$(w$,8,250)
 3630    ENDIF
 3640    IF w$="USERBUTTONS" THEN user%=TRUE
 3650    IF w$="FORMAT ON" THEN form%=TRUE
 3660    IF w$="FORMAT OFF" THEN form%=FALSE
 3670  ENDIF
 3680UNTIL w$="�END"
 3690ENDPROC
 3700:
 3710DEFFNpull
 3720LOCAL w$
 3730w$=""
 3740REPEAT
 3750  IF ?getptr%<>&0A THEN w$=w$+CHR$(?getptr%)
 3760  getptr%+=1
 3770UNTIL ?(getptr%-1)=&0A OR LEN(w$)>250
 3780=w$
 3790:
 3800DEFPROCmakeicons
 3810B%=datamem%-1:C%=!(ptrmem%+lastptr%*4)-1
 3820CALL codemem%+24
 3830nummarks%=!codemem% DIV 65536
 3840numbuttons%=!codemem% AND 65535
 3850buttonmem%=topofmem%
 3860markmem%=topofmem%+(numbuttons%+1)*12
 3870PROCsetmem(markmem%+(nummarks%+1)*4 +1024)
 3880IF abort% ENDPROC
 3890sprmem%=topofmem%:REM if sprite file is loaded, it will be loaded here
 3900IF NOT header% ENDPROC
 3910:
 3920line%=0
 3930lett%=0
 3940icon%=0
 3950slost%=0
 3960midone%=FALSE
 3970sprite%=FALSE
 3980ctrl%=164
 3990B%=datamem%-1:C%=!(ptrmem%+lastptr%*4)-1
 4000F%=164:G%=ptrmem%
 4010REM (starts from beginning of file, not after the FNEND)
 4020IF header% !codemem%=-257 ELSE !codemem%=-1
 4030REM this contains mcode for lett%, line%
 4040REPEAT
 4050  B%=B%+1
 4060  !codemem%=!codemem%+1
 4070  B%=USR(codemem%+8)
 4080  IF ?B%=ctrl% THEN
 4090    lett%=?codemem%
 4100    line%=!codemem% DIV 256
 4110    CASE CHR$(B%?1) OF
 4120      WHEN "G" : !(buttonmem%+icon%*12+8)=line%
 4130      PROCaddicon("brgoto",1):$B%="    ":B%?4=32
 4140      WHEN "R" : PROCaddicon("brback",3):$B%="    ":B%?4=32
 4150      WHEN "M" : w%=(B%?4-48)+(B%?3-48)*10+(B%?2-48)*100
 4160      !(markmem%+w%*4)=line%:$B%="    ":B%?4=32
 4170      WHEN "S" : PROCaddsprite(0,&2E)
 4180      WHEN "V" :
 4190      !(buttonmem%+icon%*12)=1
 4200      !(buttonmem%+icon%*12+4)=(B%?4-48)+(B%?3-48)*10+(B%?2-48)*100
 4210      !(buttonmem%+icon%*12+8)=line%
 4220      $B%="   "
 4230      B%=B%+3
 4240      PROCaddsprite(3,&2E)
 4250      WHEN "U" : PROCusersprite:?B%=32:B%?1=32
 4260      WHEN "W" : PROCaddsprite(0,&400E9):REMPROCwimpsprite
 4270      WHEN "C" : ctrl%=B%?2:F%=ctrl%:$B%="  ":B%?2=32
 4280      WHEN CHR$(ctrl%) : ?B%=32
 4290    ENDCASE
 4300  ELSE
 4310    midone%=TRUE
 4320  ENDIF
 4330UNTIL midone% OR abort%
 4340IF slost%>0 PROCerror(STR$(slost%)+" of the sprites requested by the file could not be inserted.")
 4350ENDPROC
 4360:
 4370DEFPROCaddicon(s$,type%)
 4380IF user% x%=sprmem% ELSE x%=isprite
 4390$b=s$
 4400SYS "OS_SpriteOp",256+24,x%,b TO ,,w%
 4410b!0=whandle%
 4420b!4=lett%*16
 4430b!8=-line%*32-32
 4440b!12=lett%*16+80
 4450b!16=-line%*32
 4460b!20=&0000311A
 4470b!24=w%
 4480b!28=x%
 4490b!32=0
 4500SYS "Wimp_CreateIcon",,b
 4510!(buttonmem%+icon%*12)=type%
 4520w%=(B%?4-48)+(B%?3-48)*10+(B%?2-48)*100
 4530!(buttonmem%+icon%*12+4)=w%
 4540icon%=icon%+1
 4550ENDPROC
 4560:
 4570DEFPROCaddsprite(type%,sys%)
 4580w%=B%+2:s$=""
 4590WHILE ?w%>32
 4600  s$=s$+CHR$(?w%):?w%=32:w%+=1
 4610ENDWHILE
 4620?B%=32:B%?1=32
 4630:
 4640LOCAL ERROR
 4650ON ERROR LOCAL RESTORE ERROR:slost%+=1:ENDPROC
 4660IF (NOT sprite%) AND sys%<&100 ERROR
 4670REM first get info on sprite
 4680$b=s$
 4690SYS sys%,256+40,sprmem%,b TO ,,,swidth%,sheight%,,smode%
 4700IF smode%>=24 THEN
 4710  sx%=2:sy%=2
 4720ELSE
 4730  RESTORE+0
 4740  REPEAT
 4750    READ sx%,sy%
 4760    smode%-=1
 4770  UNTIL smode%<0
 4780ENDIF
 4790swidth%=swidth%*sx%
 4800sheight%=sheight%*sy%
 4810SYS sys%,256+24,sprmem%,b TO ,,sw%
 4820:
 4830b!0=whandle%
 4840b!4=lett%*16
 4850b!8=-line%*32-sheight%
 4860b!12=lett%*16+swidth%
 4870b!16=-line%*32
 4880IF sys%<&100 THEN
 4890  b!20=&0000011A+(type%<<12)
 4900  b!24=sw%
 4910  b!28=sprmem%
 4920  b!32=0
 4930ELSE
 4940  b!20=&0000001A+(type%<<12)
 4950  $(b+24)=s$
 4960ENDIF
 4970SYS "Wimp_CreateIcon",,b
 4980icon%=icon%+1
 4990RESTORE ERROR
 5000ENDPROC
 5010:
 5020DATA 2,4,4,4,8,4,0,0,4,4,8,4,0,0,0,0
 5030DATA 2,4,4,4,8,4,0,0,2,4,4,4,0,0,2,4
 5040DATA 0,0,0,0,2,2,2,2,2,2,2,2
 5050REM 22
 5060DATA 1,1,0,0
 5070:
 5080DEFPROCusersprite
 5090REM load in a sprite file into user sprite area
 5100w%=B%+2:REM first character in sprite name
 5110w$=""
 5120WHILE ?w%>32
 5130  w$=w$+CHR$(?w%):?w%=32:w%=w%+1
 5140ENDWHILE
 5150sprfile$=w$ :REM *****
 5160IF sprite% PROCus2:ENDPROC
 5170sprite%=TRUE
 5180sprsize%=FNfilesize(sprfile$)
 5190IF sprsize%=-1 PROCerror("Associated sprite file : "+sprfile$+" is not found."):ENDPROC
 5200sprsize%+=4-(sprsize% MOD 4)
 5210PROCsetmem(sprmem%+sprsize%+256)
 5220!sprmem%=sprsize%+32
 5230OSCLI("LOAD "+sprfile$+" "+STR$~(sprmem%+4))
 5240ENDPROC
 5250:
 5260DEFPROCus2
 5270REM load a second (or more) sprite file in
 5280sw%=FNfilesize(sprfile$)
 5290IF sw%=-1 PROCerror("Associated sprite file : "+sprfile$+" is not found."):ENDPROC
 5300sw%=sw%+4-(sw% MOD 4)
 5310sprsize%+=sw%
 5320PROCsetmem(sprmem%+sprsize%+256)
 5330$b=sprfile$
 5340!sprmem%=sprsize%+32
 5350SYS "OS_SpriteOp",256+11,sprmem%,b
 5360ENDPROC
 5370:
 5380DEFFNmax(a%,b%)
 5390IF a%>b% THEN =a% ELSE =b%
 5400:
 5410DEFFNmin(a%,b%)
 5420IF a%<b% THEN =a% ELSE =b%
 5430:
 5440DEFFNrange(w%,a%,b%)
 5450IF w%<a% THEN w%=a%
 5460IF w%>b% THEN w%=b%
 5470=w%
 5480:
 5490DEFPROCp(addr%,val%)
 5500?addr%=val%MOD256
 5510addr%?1=val%DIV256
 5520ENDPROC
 5530:
 5540DEFFNi(addr%):=?addr%+(addr%?1)*256
 5550:
 5560DEFFNfour(w%)
 5570IF (w%MOD4)=0 THEN =w%
 5580=w%+4-(w%MOD4)
 5590:
 5600DEFPROCerror(err$)
 5610!b%=255
 5620$(b%+4)=err$+CHR$0
 5630SYS "Wimp_ReportError",b%,3,"Browzer" TO ,err_result%
 5640ENDPROC
 5650:
 5660DEFPROCerror2(err$,w%)
 5670!b%=255
 5680$(b%+4)=err$+CHR$0
 5690SYS "Wimp_ReportError",b%,w%,"Browzer" TO ,err_result%
 5700ENDPROC
 5710:
 5720DEFFNfilesize(w$)
 5730LOCAL w%,x%
 5740x%=OPENIN(w$)
 5750REM IF x%=0 THEN ERROR 9002,"File "+w$+" not found (filesize)."
 5760IF x%=0 THEN =-1
 5770w%=EXT#x%
 5780CLOSE#x%
 5790=w%
 5800:
 5810:
 5820:
 5830:
 5840DEFPROCtick(ptr%,i%,clear%,eor%)
 5850LOCAL w%
 5860w%=ptr%+28+24*i%
 5870!w%=!w% AND (&FFFFFFFF+clear%)
 5880!w%=!w% EOR -eor%
 5890ENDPROC
 5900:
 5910DEFFNzero(w%):LOCAL s$:s$="":WHILE ?w%>13:s$+=CHR$?w%:w%+=1:ENDWHILE:=s$
 5920:
 5930DEFFNgettextmem(pb%!0,pb%!4)
 5940SYS "Wimp_GetIconState",,pb%
 5950=pb%!28
 5960:
 5970DEFPROCinvalid(pb%!0,pb%!4)
 5980pb%!8=0:pb%!12=0:SYS "Wimp_SetIconState",,pb%
 5990ENDPROC
 6000:
 6010:
 6020

� >> text shower
�
)� Copyright Stuart Whitehouse, 1994,5
(�
2�
<�
F�
P0� � � � �:�error(�$+" - "+�(�)):�closedown:�
Z	�init
d.�("LOAD <Browzer$Dir>.Code "+�~(codemem%))
n� load% �dataloaddo
x*UNSET Browzer$HelpFile
�	�loop
��closedown
��
�:
���closedown
�ș "Tempest_MiscOp",10,,tb%
�ș "Wimp_CloseDown"
��
�:
�
��init
�� tb% 2048, b% 512, pb% 48
�Aș "Wimp_Initialise",310,&4B534154,"Browzer",0 � ,taskhandle%
�
/ș "Tempest_Hello",,6+16,tb%,2048,"Browzer"
b=b%
.� title 100, codemem% 1024, indirect% 2000
"� stack%(7)
,5sptr%=0:destmark%=0:file$="":window%=�:lastptr%=0
6:datamem%=0:ptrmem%=0:buttonmem%=0:sprmem%=0:markmem%=0
@Gnumbuttons%=0:nummarks%=0:icon%=0:endmem%=0:whandle%=0:scrollmax%=0
Jwindfile$=�10,"*")
Tsprfile$=file$
^0delay%=10:go%=-1:menu%=-1:format%=�:silly%=�
h"sprite%=0:sillytime%=0:time%=0
r:
|extend%=�:topofmem%=�
�quit%=�:load%=�
� � file$="<Browzer$HelpFile>"
�<ș "OS_ReadVarVal","Browzer$HelpFile",b%,1000,0,0 � ,,w%
�b%?w%=13 : file$=$b%
�start_mark%=0
�w%=�file$,"\\\")
�� w%>0 �
�  s$=�file$,w%+3)
�  file$=�file$,w%-1)
�  start_mark%=�s$
��
�:
�� >> makeicon
� iname 12, isprite 2650
!isprite=2650
2�("LOAD <Browzer$Dir>.IconSpr "+�~(isprite+4))
&:
0!b=-1:b!4=0:b!8=0
:b!12=68:b!16=68
Db!20=&0000311A
N$iname="Open!"
Xb!24=iname
bb!28=isprite
l
b!32=5
v&ș "Wimp_CreateIcon",,b � ihandle%
�:
�$b="open!"
�1ș "OS_SpriteOp",256+24,isprite,b � ,,sprptr%
�sprptr%+=sprptr%!32
�:
�Bș "Tempest_RegisterIndirectArea",indirect%,indirect%+2000,tb%
�8ș "Tempest_OpenFile","<Browzer$Dir>.Templates",,tb%
�>ș "Tempest_LoadObject","ProgInfo",b%,tb%,-1,0 � inhandle%
�:ș "Tempest_LoadObject","Speed",b%,tb%,-1,0 � shandle%
�$speedstr=�gettextmem(shandle%,0)
�7ș "Tempest_LoadObject","IbarMenu",b%,tb%,-1,0 � mb
�7ș "Tempest_LoadObject","WindMenu",b%,tb%,-1,0 � wb
� ș "Tempest_CloseFile",,,tb%
!ș "Tempest_LinkMenus",,0,tb%
�
:
 :
*��makewindow
4�+0
>� w%=0 � 84 � 4
H  � s$:b!w%=�(s$)
R�
\!� b!4<174 � b!4>10000 b!4=174
f$title="Browzer"
p(ș "Wimp_CreateWindow",,b � whandle%
zscrollmax%=b!44
��
�+� 0,800-lastptr%*32-2,(width%*16)+5,800
�� 0,0,-1,&FF000002
�� &00070207,&000C0103
�%� 0,0-lastptr%*32-2,width%*16+5,0
�� &119,0<<12,1,1+(0<<12)
�� title,-1,40,0
�:
�:
�
��loop
�quit%=�
��
�1  ș "Wimp_Poll",&3830 � tb%!1000,b � reason%
6  ș "Tempest_PreProcess",reason%,b%,tb% � reason%
  Ȏ reason% �
/    � 0 : � go%>=0 � �>time%+delay% �scroll
$*    � silly% � �>sillytime%+8 �dosilly
.    � 1 : �redraw
8,    � 2 : ș "Tempest_OpenWindow",,b,tb%
B    � 3 : �closedata
L    � 6 : �click
V    � 9 : �menu
`    � 17,18 : Ȏ b%!16 �
j      � 0 : quit%=�
t)      � &4B483 : �changedelay(-b%!28)
~	    �
�  �
�� quit%
��
�:
���click
�
Ȏ b!12 �
�  � shandle% : �speedclick
�  � -2 : �ibarclick
�   : �mainclick
��
��
�:
��mainclick

Q� (b!8 � 2)>0 � �tick(wb,1,�,go%=0):ș "Tempest_ShowMenu",1,,tb%,wb:menu%=0:�

w%=b!16
(Ȏ �itype(w%) �
2  � 1 :
<  � sptr%=8 �
F,    � x%=0 � 6:stack%(x%)=stack%(x%+1):�
P    sptr%-=1
Z  �
d  stack%(sptr%)=�ifrom(w%)
n  sptr%+=1
x   �moveto(�mark(�idest(w%)))
�  � 3 :
�  � sptr%=0 �
�(    �error("Nowhere to go back to.")
�  �
�    sptr%=sptr%-1
�    �moveto(stack%(sptr%))
�  �
��
��
�:
�&ݤidest(w%):=!(buttonmem%+w%*12+4)
�$ݤitype(w%):=!(buttonmem%+w%*12)
�&ݤifrom(w%):=!(buttonmem%+w%*12+8)
 ݤmark(w%):=!(markmem%+w%*4)
:
��moveto(x%)
"destmark%=x%
,!b=whandle%
6ș "Wimp_GetWindowState",,b
@<ș "Wimp_CloseWindow",,b:� to force redraw of EVERYTHING
J4x%=-x%*32+((b!16-b!8)�2):� puts target in middle
Tb!24=x%
^ș "Wimp_OpenWindow",,b
h�
r:
|��ibarclick
�Ȏ b!8 �
�  � 4 :
�4  � 2 : ș "Tempest_ShowMenu",0,,tb%,mb:menu%=-1
�  � 1 :
��
��
�:
���speedclick
�
Ȏ b!16 �
�;  � 3 : !pb%=shandle%:ș "Tempest_CloseWindow",,pb%,tb%
�L  � 4 : delay%=olddelay%:!pb%=shandle%:ș "Tempest_CloseWindow",,pb%,tb%
��
��
:
��changedelay(w%)
� delay%>25 w%=w%*2
&!delay%=�range(delay%+w%,4,35)
0=ș "Tempest_SetIconText",shandle%,0,tb%,�(�(1000/delay%))
:�
D:
N
��menu
X� menu%=-1 �
b  Ȏ b!0 �
l    � 1 : quit%=�
v  �
��
�  Ȏ b!0 �
�    � 0 :   � sptr%=0 �
�*      �error("Nowhere to go back to.")
�	    �
�      sptr%=sptr%-1
�       �moveto(stack%(sptr%))
�	    �
�3    � 1 : � go%<>0 go%=0:time%=go%-100 � go%=-1
�    �tick(wb,1,�,go%=0)
�)    � 2 : $speedstr=�(�(1000/delay%))
�M    olddelay%=delay%:!pb%=shandle%:ș "Tempest_ShowWindow",&33311,pb%,tb%
�     � 3 : �closedata:b!136=0
  �
�
"ș "Tempest_ShowMenu",7,,tb%,0
 �
*:
4:
>
��dosilly
H:ș "Tempest_MiscOp",14,b,tb%,-2,ihandle% � eyex%,eyey%
Reyex%+=16:eyey%+=34
\,� eye xy contains centre of left eyeball
fȗ mousex%,mousey%,j%
p
zA%=sprptr%
�� codemem%+12
�
�delx%=mousex%-eyex%
�dely%=mousey%-eyey%
�=� mouse xy contains the vector from centre eye to pointer
�!sq=�(delx%*delx%+dely%*dely%)
�� sq<6 sq=6
�x%=7*delx%/sq
�y%=7*dely%/sq
��eyeset(x%,y%)
�
�*� other eye,old delY correct. X 34 out
�
delx%-=34
	=� mouse xy contains the vector from centre eye to pointer
	!sq=�(delx%*delx%+dely%*dely%)
	� sq<6 sq=6
	$x%=7*delx%/sq
	.y%=7*dely%/sq
	8�eyeset(x%+34,y%)
	B
	L�invalid(-2,ihandle%)
	Vsillytime%=�
	`�
	j:
	t��eyeset(x%,y%)
	~-� coords right up from middle of left eye
	�x%=(x% � 2)+7
	�y%=8-(y% � 2)
	�C� these coords are right,down, 0 based pixels from TL of sprite
	�/odd%=x% � 2:� is it starting on high nibble
	�B%=sprptr%+y%*16+(x% � 2)
	�.� odd%>0 � (codemem%+20) � � (codemem%+16)
	��
	�:
	���scroll
	�!b=whandle%
	�ș "Wimp_GetWindowState",,b
	�b!24=b!24-4
+� b!24<scrollmax%+(b!16-b!8) � go%=-1:�

ș "Wimp_OpenWindow",,b
time%=�
�
(:
2��dataloaddo
<abort%=�
Fș "Hourglass_On"
Psize%=�filesize(file$)
Zdatamem%=topofmem%
d7�setmem(topofmem%+size%+4-(size% � 4)+128):� ******
n� abort%=� �
x'  �("LOAD "+file$+" "+�~(datamem%))
�0  windfile$=�endname(file$):�resets file$( )
�  width%=77
�  � � abort% �makeptrs
�'  � � abort% �makewindow:�makeicons
�  endmem%=topofmem%
�  � � abort% �
�@    sptr%=0:destmark%=-1:� clear buttons stack and last dest
�    $title="Browzer"
�    window%=�
�7    !pb%=whandle%:ș "Tempest_ShowWindow",1,pb%,tb%
�    � start_mark%>0 �
�%      �moveto(�mark(start_mark%))
�      start_mark%=0
	    �
  �
�
"ș "Hourglass_Off"
,�
6:
@��setmem(top%)
J� w%
T)ș "Wimp_SlotSize",top%-&8000,-1 � w%
^Q� w%<top%-&8000 � �error("Not enough memory available"):abort%=�:�closedata:�
htopofmem%=top%
r�
|:
�ݤendname(s$)
�w%=1
�� enloop%=1 � �(s$)
�'  � �s$,enloop%,1)="." w%=enloop%+1
��
�file$=�s$,w%-1)
�=�s$,�(s$)-w%+1)
�:
�:
���closedata
�quit%=�
��
�:
��redraw
%ș "Wimp_RedrawWindow",,b � flag%
ox%=b!4-b!20
&oy%=b!16-b!24
0ȕ flag%<>0
:9  starty%=b!24-(b!16-b!40):� top redw rect work cd(-)
D5  heighty%=(b!40-b!32)+1:� h of redw in OS/scr cd
N  starty%=(-starty%)� 32
X%  endy%=starty%+(heighty% � 32)+1
b(  � endy%>=lastptr% endy%=lastptr%-1
l  ș "Wimp_SetColour",12
vW  � destmark%>starty%-5 � destmark%<endy%+5 ȓ Ȑ ox%+2,oy%-destmark%*32-33,1280,32
�  ș "Wimp_SetColour",7
�  C%=starty%
�  B%=ptrmem%
�  ȕ C%<=endy%
�    � ox%+2,oy%-C%*32-4
�    � (codemem%+28)
�
    C%+=1
�  �
�'  ș "Wimp_GetRectangle",,b � flag%
�  � get next redraw area
��
��
�:

��makeptrs

6getptr%=datamem%:� this can be reset by PROCheader

.ascii%=�:replace%=32:user%=�:form%=format%

 w$=�pull

*=� �w$,7)="�HEADER" � �header � getptr%=datamem%:header%=�

4ptrmem%=topofmem%

>�setmem(topofmem%+128)

H!ptrmem%=getptr%

Rnextptr%=1

\8B%=getptr%:C%=datamem%+size%+1:D%=width%:G%=replace%

f!H%=(ascii% � 128)+(form% � 1)

p!codemem%=0

z�

�  B%=�(codemem%+4)

�  !(ptrmem%+nextptr%*4)=B%

�  nextptr%+=1

�  �setmem(topofmem%+4)

�� ?codemem%<>0 � abort%

�lastptr%=nextptr%-1

��

�:

���header

�
header%=�

��

�  w$=�pull

�  � w$<>"�END" �
c    � getptr%>datamem%+size% �error("Bad header block."):getptr%=datamem%+1:w$="�END":header%=�
    � w$="ASCII" � ascii%=�
    � �w$,7)="REPLACE" �
$O      � �w$,1)<"0" � �w$,1)>"9" � replace%=�(�w$,1)) � replace%=��w$,8,250)
.	    �
8$    � w$="USERBUTTONS" � user%=�
B"    � w$="FORMAT ON" � form%=�
L#    � w$="FORMAT OFF" � form%=�
V  �
`� w$="�END"
j�
t:
~
ݤpull
�� w$
�	w$=""
��
�)  � ?getptr%<>&0A � w$=w$+�(?getptr%)
�  getptr%+=1
�"� ?(getptr%-1)=&0A � �(w$)>250
�=w$
�:
���makeicons
�,B%=datamem%-1:C%=!(ptrmem%+lastptr%*4)-1
�� codemem%+24
�nummarks%=!codemem% � 65536
!numbuttons%=!codemem% � 65535

buttonmem%=topofmem%
)markmem%=topofmem%+(numbuttons%+1)*12
+�setmem(markmem%+(nummarks%+1)*4 +1024)
(� abort% �
2Hsprmem%=topofmem%:� if sprite file is loaded, it will be loaded here
<� � header% �
F:
Pline%=0
Zlett%=0
dicon%=0
nslost%=0
x
midone%=�
�
sprite%=�
�
ctrl%=164
�,B%=datamem%-1:C%=!(ptrmem%+lastptr%*4)-1
�F%=164:G%=ptrmem%
�9� (starts from beginning of file, not after the �END)
�+� header% !codemem%=-257 � !codemem%=-1
�*� this contains mcode for lett%, line%
��
�
  B%=B%+1
�  !codemem%=!codemem%+1
�  B%=�(codemem%+8)
�  � ?B%=ctrl% �
�    lett%=?codemem%
    line%=!codemem% � 256
    Ȏ �(B%?1) �
0      � "G" : !(buttonmem%+icon%*12+8)=line%
"1      �addicon("brgoto",1):$B%="    ":B%?4=32
,9      � "R" : �addicon("brback",3):$B%="    ":B%?4=32
69      � "M" : w%=(B%?4-48)+(B%?3-48)*10+(B%?2-48)*100
@3      !(markmem%+w%*4)=line%:$B%="    ":B%?4=32
J#      � "S" : �addsprite(0,&2E)
T      � "V" :
^"      !(buttonmem%+icon%*12)=1
hG      !(buttonmem%+icon%*12+4)=(B%?4-48)+(B%?3-48)*10+(B%?2-48)*100
r(      !(buttonmem%+icon%*12+8)=line%
|      $B%="   "
�      B%=B%+3
�      �addsprite(3,&2E)
�,      � "U" : �usersprite:?B%=32:B%?1=32
�6      � "W" : �addsprite(0,&400E9):�PROCwimpsprite
�6      � "C" : ctrl%=B%?2:F%=ctrl%:$B%="  ":B%?2=32
�      � �(ctrl%) : ?B%=32
�	    �
�  �
�    midone%=�
�  �
�� midone% � abort%
�_� slost%>0 �error(�(slost%)+" of the sprites requested by the file could not be inserted.")
��
:
��addicon(s$,type%)
#� user% x%=sprmem% � x%=isprite
&	$b=s$
0'ș "OS_SpriteOp",256+24,x%,b � ,,w%
:b!0=whandle%
Db!4=lett%*16
Nb!8=-line%*32-32
Xb!12=lett%*16+80
bb!16=-line%*32
lb!20=&0000311A
vb!24=w%
�b!28=x%
�
b!32=0
�ș "Wimp_CreateIcon",,b
� !(buttonmem%+icon%*12)=type%
�+w%=(B%?4-48)+(B%?3-48)*10+(B%?2-48)*100
�!(buttonmem%+icon%*12+4)=w%
�icon%=icon%+1
��
�:
���addsprite(type%,sys%)
�w%=B%+2:s$=""
�
ȕ ?w%>32
�  s$=s$+�(?w%):?w%=32:w%+=1
�
?B%=32:B%?1=32
:
 � �
*� � � � �:slost%+=1:�
4� (� sprite%) � sys%<&100 �
>� first get info on sprite
H	$b=s$
R:ș sys%,256+40,sprmem%,b � ,,,swidth%,sheight%,,smode%
\� smode%>=24 �
f  sx%=2:sy%=2
p�
z	  �+0
�  �
�    � sx%,sy%
�    smode%-=1
�  � smode%<0
��
�swidth%=swidth%*sx%
�sheight%=sheight%*sy%
�$ș sys%,256+24,sprmem%,b � ,,sw%
�:
�b!0=whandle%
�b!4=lett%*16
�b!8=-line%*32-sheight%
�b!12=lett%*16+swidth%
b!16=-line%*32
� sys%<&100 �
   b!20=&0000011A+(type%<<12)
$  b!24=sw%
.  b!28=sprmem%
8  b!32=0
B�
L   b!20=&0000001A+(type%<<12)
V  $(b+24)=s$
`�
jș "Wimp_CreateIcon",,b
ticon%=icon%+1
~� �
��
�:
�%� 2,4,4,4,8,4,0,0,4,4,8,4,0,0,0,0
�%� 2,4,4,4,8,4,0,0,2,4,4,4,0,0,2,4
�� 0,0,0,0,2,2,2,2,2,2,2,2
�� 22
�
� 1,1,0,0
�:
���usersprite
�1� load in a sprite file into user sprite area
�,w%=B%+2:� first character in sprite name
�	w$=""

ȕ ?w%>32

!  w$=w$+�(?w%):?w%=32:w%=w%+1
�
sprfile$=w$ :� *****
(� sprite% �us2:�
2
sprite%=�
< sprsize%=�filesize(sprfile$)
FQ� sprsize%=-1 �error("Associated sprite file : "+sprfile$+" is not found."):�
Psprsize%+=4-(sprsize% � 4)
Z!�setmem(sprmem%+sprsize%+256)
d!sprmem%=sprsize%+32
n)�("LOAD "+sprfile$+" "+�~(sprmem%+4))
x�
�:
�	��us2
�,� load a second (or more) sprite file in
�sw%=�filesize(sprfile$)
�L� sw%=-1 �error("Associated sprite file : "+sprfile$+" is not found."):�
�sw%=sw%+4-(sw% � 4)
�sprsize%+=sw%
�!�setmem(sprmem%+sprsize%+256)
�$b=sprfile$
�!sprmem%=sprsize%+32
�%ș "OS_SpriteOp",256+11,sprmem%,b
��
�:
ݤmax(a%,b%)
� a%>b% � =a% � =b%
:
"ݤmin(a%,b%)
,� a%<b% � =a% � =b%
6:
@ݤrange(w%,a%,b%)
J� w%<a% � w%=a%
T� w%>b% � w%=b%
^=w%
h:
r��p(addr%,val%)
|?addr%=val%�256
�addr%?1=val%�256
��
�:
�$ݤi(addr%):=?addr%+(addr%?1)*256
�:
�ݤfour(w%)
�� (w%�4)=0 � =w%
�=w%+4-(w%�4)
�:
���error(err$)
�!b%=255
�$(b%+4)=err$+�0
�7ș "Wimp_ReportError",b%,3,"Browzer" � ,err_result%
�
:
��error2(err$,w%)
&!b%=255
0$(b%+4)=err$+�0
:8ș "Wimp_ReportError",b%,w%,"Browzer" � ,err_result%
D�
N:
Xݤfilesize(w$)
b� w%,x%
lx%=�(w$)
vA� IF x%=0 THEN ERROR 9002,"File "+w$+" not found (filesize)."
�� x%=0 � =-1
�w%=�#x%
��#x%
�=w%
�:
�:
�:
�:
���tick(ptr%,i%,clear%,eor%)
�� w%
�w%=ptr%+28+24*i%
� !w%=!w% � (&FFFFFFFF+clear%)
�!w%=!w% � -eor%
�
:
8ݤzero(w%):� s$:s$="":ȕ ?w%>13:s$+=�?w%:w%+=1:�:=s$
 :
*ݤgettextmem(pb%!0,pb%!4)
4ș "Wimp_GetIconState",,pb%
>=pb%!28
H:
R��invalid(pb%!0,pb%!4)
\0pb%!8=0:pb%!12=0:ș "Wimp_SetIconState",,pb%
f�
p:
z:
�
�
00000000  0d 00 0a 14 f4 20 3e 3e  20 74 65 78 74 20 73 68  |..... >> text sh|
00000010  6f 77 65 72 0d 00 14 05  f4 0d 00 1e 29 f4 20 43  |ower........). C|
00000020  6f 70 79 72 69 67 68 74  20 53 74 75 61 72 74 20  |opyright Stuart |
00000030  57 68 69 74 65 68 6f 75  73 65 2c 20 31 39 39 34  |Whitehouse, 1994|
00000040  2c 35 0d 00 28 05 f4 0d  00 32 05 f4 0d 00 3c 05  |,5..(....2....<.|
00000050  f4 0d 00 46 05 f4 0d 00  50 30 ee 20 85 20 ee 20  |...F....P0. . . |
00000060  85 20 87 3a f2 65 72 72  6f 72 28 f6 24 2b 22 20  |. .:.error(.$+" |
00000070  2d 20 22 2b c3 28 9e 29  29 3a f2 63 6c 6f 73 65  |- "+.(.)):.close|
00000080  64 6f 77 6e 3a e0 0d 00  5a 09 f2 69 6e 69 74 0d  |down:...Z..init.|
00000090  00 64 2e ff 28 22 4c 4f  41 44 20 3c 42 72 6f 77  |.d..("LOAD <Brow|
000000a0  7a 65 72 24 44 69 72 3e  2e 43 6f 64 65 20 22 2b  |zer$Dir>.Code "+|
000000b0  c3 7e 28 63 6f 64 65 6d  65 6d 25 29 29 0d 00 6e  |.~(codemem%))..n|
000000c0  17 e7 20 6c 6f 61 64 25  20 f2 64 61 74 61 6c 6f  |.. load% .datalo|
000000d0  61 64 64 6f 0d 00 78 1b  2a 55 4e 53 45 54 20 42  |addo..x.*UNSET B|
000000e0  72 6f 77 7a 65 72 24 48  65 6c 70 46 69 6c 65 0d  |rowzer$HelpFile.|
000000f0  00 82 09 f2 6c 6f 6f 70  0d 00 8c 0e f2 63 6c 6f  |....loop.....clo|
00000100  73 65 64 6f 77 6e 0d 00  96 05 e0 0d 00 a0 05 3a  |sedown.........:|
00000110  0d 00 aa 0f dd f2 63 6c  6f 73 65 64 6f 77 6e 0d  |......closedown.|
00000120  00 b4 1f c8 99 20 22 54  65 6d 70 65 73 74 5f 4d  |..... "Tempest_M|
00000130  69 73 63 4f 70 22 2c 31  30 2c 2c 74 62 25 0d 00  |iscOp",10,,tb%..|
00000140  be 17 c8 99 20 22 57 69  6d 70 5f 43 6c 6f 73 65  |.... "Wimp_Close|
00000150  44 6f 77 6e 22 0d 00 c8  05 e1 0d 00 d2 05 3a 0d  |Down".........:.|
00000160  00 dc 0a dd f2 69 6e 69  74 0d 00 e6 1e de 20 74  |.....init..... t|
00000170  62 25 20 32 30 34 38 2c  20 62 25 20 35 31 32 2c  |b% 2048, b% 512,|
00000180  20 70 62 25 20 34 38 0d  00 f0 41 c8 99 20 22 57  | pb% 48...A.. "W|
00000190  69 6d 70 5f 49 6e 69 74  69 61 6c 69 73 65 22 2c  |imp_Initialise",|
000001a0  33 31 30 2c 26 34 42 35  33 34 31 35 34 2c 22 42  |310,&4B534154,"B|
000001b0  72 6f 77 7a 65 72 22 2c  30 20 b8 20 2c 74 61 73  |rowzer",0 . ,tas|
000001c0  6b 68 61 6e 64 6c 65 25  0d 00 fa 04 0d 01 04 2f  |khandle%......./|
000001d0  c8 99 20 22 54 65 6d 70  65 73 74 5f 48 65 6c 6c  |.. "Tempest_Hell|
000001e0  6f 22 2c 2c 36 2b 31 36  2c 74 62 25 2c 32 30 34  |o",,6+16,tb%,204|
000001f0  38 2c 22 42 72 6f 77 7a  65 72 22 0d 01 0e 08 62  |8,"Browzer"....b|
00000200  3d 62 25 0d 01 18 2e de  20 74 69 74 6c 65 20 31  |=b%..... title 1|
00000210  30 30 2c 20 63 6f 64 65  6d 65 6d 25 20 31 30 32  |00, codemem% 102|
00000220  34 2c 20 69 6e 64 69 72  65 63 74 25 20 32 30 30  |4, indirect% 200|
00000230  30 0d 01 22 0f de 20 73  74 61 63 6b 25 28 37 29  |0..".. stack%(7)|
00000240  0d 01 2c 35 73 70 74 72  25 3d 30 3a 64 65 73 74  |..,5sptr%=0:dest|
00000250  6d 61 72 6b 25 3d 30 3a  66 69 6c 65 24 3d 22 22  |mark%=0:file$=""|
00000260  3a 77 69 6e 64 6f 77 25  3d a3 3a 6c 61 73 74 70  |:window%=.:lastp|
00000270  74 72 25 3d 30 0d 01 36  3a 64 61 74 61 6d 65 6d  |tr%=0..6:datamem|
00000280  25 3d 30 3a 70 74 72 6d  65 6d 25 3d 30 3a 62 75  |%=0:ptrmem%=0:bu|
00000290  74 74 6f 6e 6d 65 6d 25  3d 30 3a 73 70 72 6d 65  |ttonmem%=0:sprme|
000002a0  6d 25 3d 30 3a 6d 61 72  6b 6d 65 6d 25 3d 30 0d  |m%=0:markmem%=0.|
000002b0  01 40 47 6e 75 6d 62 75  74 74 6f 6e 73 25 3d 30  |.@Gnumbuttons%=0|
000002c0  3a 6e 75 6d 6d 61 72 6b  73 25 3d 30 3a 69 63 6f  |:nummarks%=0:ico|
000002d0  6e 25 3d 30 3a 65 6e 64  6d 65 6d 25 3d 30 3a 77  |n%=0:endmem%=0:w|
000002e0  68 61 6e 64 6c 65 25 3d  30 3a 73 63 72 6f 6c 6c  |handle%=0:scroll|
000002f0  6d 61 78 25 3d 30 0d 01  4a 16 77 69 6e 64 66 69  |max%=0..J.windfi|
00000300  6c 65 24 3d c4 31 30 2c  22 2a 22 29 0d 01 54 12  |le$=.10,"*")..T.|
00000310  73 70 72 66 69 6c 65 24  3d 66 69 6c 65 24 0d 01  |sprfile$=file$..|
00000320  5e 30 64 65 6c 61 79 25  3d 31 30 3a 67 6f 25 3d  |^0delay%=10:go%=|
00000330  2d 31 3a 6d 65 6e 75 25  3d 2d 31 3a 66 6f 72 6d  |-1:menu%=-1:form|
00000340  61 74 25 3d b9 3a 73 69  6c 6c 79 25 3d b9 0d 01  |at%=.:silly%=...|
00000350  68 22 73 70 72 69 74 65  25 3d 30 3a 73 69 6c 6c  |h"sprite%=0:sill|
00000360  79 74 69 6d 65 25 3d 30  3a 74 69 6d 65 25 3d 30  |ytime%=0:time%=0|
00000370  0d 01 72 05 3a 0d 01 7c  19 65 78 74 65 6e 64 25  |..r.:..|.extend%|
00000380  3d 93 3a 74 6f 70 6f 66  6d 65 6d 25 3d 93 0d 01  |=.:topofmem%=...|
00000390  86 13 71 75 69 74 25 3d  a3 3a 6c 6f 61 64 25 3d  |..quit%=.:load%=|
000003a0  b9 0d 01 90 20 f4 20 66  69 6c 65 24 3d 22 3c 42  |.... . file$="<B|
000003b0  72 6f 77 7a 65 72 24 48  65 6c 70 46 69 6c 65 3e  |rowzer$HelpFile>|
000003c0  22 0d 01 9a 3c c8 99 20  22 4f 53 5f 52 65 61 64  |"...<.. "OS_Read|
000003d0  56 61 72 56 61 6c 22 2c  22 42 72 6f 77 7a 65 72  |VarVal","Browzer|
000003e0  24 48 65 6c 70 46 69 6c  65 22 2c 62 25 2c 31 30  |$HelpFile",b%,10|
000003f0  30 30 2c 30 2c 30 20 b8  20 2c 2c 77 25 0d 01 a4  |00,0,0 . ,,w%...|
00000400  18 62 25 3f 77 25 3d 31  33 20 3a 20 66 69 6c 65  |.b%?w%=13 : file|
00000410  24 3d 24 62 25 0d 01 ae  11 73 74 61 72 74 5f 6d  |$=$b%....start_m|
00000420  61 72 6b 25 3d 30 0d 01  b8 14 77 25 3d a7 66 69  |ark%=0....w%=.fi|
00000430  6c 65 24 2c 22 5c 5c 5c  22 29 0d 01 c2 0c e7 20  |le$,"\\\")..... |
00000440  77 25 3e 30 20 8c 0d 01  cc 15 20 20 73 24 3d c1  |w%>0 .....  s$=.|
00000450  66 69 6c 65 24 2c 77 25  2b 33 29 0d 01 d6 18 20  |file$,w%+3).... |
00000460  20 66 69 6c 65 24 3d c0  66 69 6c 65 24 2c 77 25  | file$=.file$,w%|
00000470  2d 31 29 0d 01 e0 15 20  20 73 74 61 72 74 5f 6d  |-1)....  start_m|
00000480  61 72 6b 25 3d bb 73 24  0d 01 ea 05 cd 0d 01 f4  |ark%=.s$........|
00000490  05 3a 0d 01 fe 11 f4 20  3e 3e 20 6d 61 6b 65 69  |.:..... >> makei|
000004a0  63 6f 6e 0d 02 08 1c de  20 69 6e 61 6d 65 20 31  |con..... iname 1|
000004b0  32 2c 20 69 73 70 72 69  74 65 20 32 36 35 30 0d  |2, isprite 2650.|
000004c0  02 12 11 21 69 73 70 72  69 74 65 3d 32 36 35 30  |...!isprite=2650|
000004d0  0d 02 1c 32 ff 28 22 4c  4f 41 44 20 3c 42 72 6f  |...2.("LOAD <Bro|
000004e0  77 7a 65 72 24 44 69 72  3e 2e 49 63 6f 6e 53 70  |wzer$Dir>.IconSp|
000004f0  72 20 22 2b c3 7e 28 69  73 70 72 69 74 65 2b 34  |r "+.~(isprite+4|
00000500  29 29 0d 02 26 05 3a 0d  02 30 15 21 62 3d 2d 31  |))..&.:..0.!b=-1|
00000510  3a 62 21 34 3d 30 3a 62  21 38 3d 30 0d 02 3a 13  |:b!4=0:b!8=0..:.|
00000520  62 21 31 32 3d 36 38 3a  62 21 31 36 3d 36 38 0d  |b!12=68:b!16=68.|
00000530  02 44 12 62 21 32 30 3d  26 30 30 30 30 33 31 31  |.D.b!20=&0000311|
00000540  41 0d 02 4e 12 24 69 6e  61 6d 65 3d 22 4f 70 65  |A..N.$iname="Ope|
00000550  6e 21 22 0d 02 58 0e 62  21 32 34 3d 69 6e 61 6d  |n!"..X.b!24=inam|
00000560  65 0d 02 62 10 62 21 32  38 3d 69 73 70 72 69 74  |e..b.b!28=isprit|
00000570  65 0d 02 6c 0a 62 21 33  32 3d 35 0d 02 76 26 c8  |e..l.b!32=5..v&.|
00000580  99 20 22 57 69 6d 70 5f  43 72 65 61 74 65 49 63  |. "Wimp_CreateIc|
00000590  6f 6e 22 2c 2c 62 20 b8  20 69 68 61 6e 64 6c 65  |on",,b . ihandle|
000005a0  25 0d 02 80 05 3a 0d 02  8a 0e 24 62 3d 22 6f 70  |%....:....$b="op|
000005b0  65 6e 21 22 0d 02 94 31  c8 99 20 22 4f 53 5f 53  |en!"...1.. "OS_S|
000005c0  70 72 69 74 65 4f 70 22  2c 32 35 36 2b 32 34 2c  |priteOp",256+24,|
000005d0  69 73 70 72 69 74 65 2c  62 20 b8 20 2c 2c 73 70  |isprite,b . ,,sp|
000005e0  72 70 74 72 25 0d 02 9e  17 73 70 72 70 74 72 25  |rptr%....sprptr%|
000005f0  2b 3d 73 70 72 70 74 72  25 21 33 32 0d 02 a8 05  |+=sprptr%!32....|
00000600  3a 0d 02 b2 42 c8 99 20  22 54 65 6d 70 65 73 74  |:...B.. "Tempest|
00000610  5f 52 65 67 69 73 74 65  72 49 6e 64 69 72 65 63  |_RegisterIndirec|
00000620  74 41 72 65 61 22 2c 69  6e 64 69 72 65 63 74 25  |tArea",indirect%|
00000630  2c 69 6e 64 69 72 65 63  74 25 2b 32 30 30 30 2c  |,indirect%+2000,|
00000640  74 62 25 0d 02 bc 38 c8  99 20 22 54 65 6d 70 65  |tb%...8.. "Tempe|
00000650  73 74 5f 4f 70 65 6e 46  69 6c 65 22 2c 22 3c 42  |st_OpenFile","<B|
00000660  72 6f 77 7a 65 72 24 44  69 72 3e 2e 54 65 6d 70  |rowzer$Dir>.Temp|
00000670  6c 61 74 65 73 22 2c 2c  74 62 25 0d 02 c6 3e c8  |lates",,tb%...>.|
00000680  99 20 22 54 65 6d 70 65  73 74 5f 4c 6f 61 64 4f  |. "Tempest_LoadO|
00000690  62 6a 65 63 74 22 2c 22  50 72 6f 67 49 6e 66 6f  |bject","ProgInfo|
000006a0  22 2c 62 25 2c 74 62 25  2c 2d 31 2c 30 20 b8 20  |",b%,tb%,-1,0 . |
000006b0  69 6e 68 61 6e 64 6c 65  25 0d 02 d0 3a c8 99 20  |inhandle%...:.. |
000006c0  22 54 65 6d 70 65 73 74  5f 4c 6f 61 64 4f 62 6a  |"Tempest_LoadObj|
000006d0  65 63 74 22 2c 22 53 70  65 65 64 22 2c 62 25 2c  |ect","Speed",b%,|
000006e0  74 62 25 2c 2d 31 2c 30  20 b8 20 73 68 61 6e 64  |tb%,-1,0 . shand|
000006f0  6c 65 25 0d 02 da 24 73  70 65 65 64 73 74 72 3d  |le%...$speedstr=|
00000700  a4 67 65 74 74 65 78 74  6d 65 6d 28 73 68 61 6e  |.gettextmem(shan|
00000710  64 6c 65 25 2c 30 29 0d  02 e4 37 c8 99 20 22 54  |dle%,0)...7.. "T|
00000720  65 6d 70 65 73 74 5f 4c  6f 61 64 4f 62 6a 65 63  |empest_LoadObjec|
00000730  74 22 2c 22 49 62 61 72  4d 65 6e 75 22 2c 62 25  |t","IbarMenu",b%|
00000740  2c 74 62 25 2c 2d 31 2c  30 20 b8 20 6d 62 0d 02  |,tb%,-1,0 . mb..|
00000750  ee 37 c8 99 20 22 54 65  6d 70 65 73 74 5f 4c 6f  |.7.. "Tempest_Lo|
00000760  61 64 4f 62 6a 65 63 74  22 2c 22 57 69 6e 64 4d  |adObject","WindM|
00000770  65 6e 75 22 2c 62 25 2c  74 62 25 2c 2d 31 2c 30  |enu",b%,tb%,-1,0|
00000780  20 b8 20 77 62 0d 02 f8  20 c8 99 20 22 54 65 6d  | . wb... .. "Tem|
00000790  70 65 73 74 5f 43 6c 6f  73 65 46 69 6c 65 22 2c  |pest_CloseFile",|
000007a0  2c 2c 74 62 25 0d 03 02  21 c8 99 20 22 54 65 6d  |,,tb%...!.. "Tem|
000007b0  70 65 73 74 5f 4c 69 6e  6b 4d 65 6e 75 73 22 2c  |pest_LinkMenus",|
000007c0  2c 30 2c 74 62 25 0d 03  0c 05 e1 0d 03 16 05 3a  |,0,tb%.........:|
000007d0  0d 03 20 05 3a 0d 03 2a  10 dd f2 6d 61 6b 65 77  |.. .:..*...makew|
000007e0  69 6e 64 6f 77 0d 03 34  07 f7 2b 30 0d 03 3e 13  |indow..4..+0..>.|
000007f0  e3 20 77 25 3d 30 20 b8  20 38 34 20 88 20 34 0d  |. w%=0 . 84 . 4.|
00000800  03 48 15 20 20 f3 20 73  24 3a 62 21 77 25 3d a0  |.H.  . s$:b!w%=.|
00000810  28 73 24 29 0d 03 52 05  ed 0d 03 5c 21 e7 20 62  |(s$)..R....\!. b|
00000820  21 34 3c 31 37 34 20 84  20 62 21 34 3e 31 30 30  |!4<174 . b!4>100|
00000830  30 30 20 62 21 34 3d 31  37 34 0d 03 66 14 24 74  |00 b!4=174..f.$t|
00000840  69 74 6c 65 3d 22 42 72  6f 77 7a 65 72 22 0d 03  |itle="Browzer"..|
00000850  70 28 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |p(.. "Wimp_Creat|
00000860  65 57 69 6e 64 6f 77 22  2c 2c 62 20 b8 20 77 68  |eWindow",,b . wh|
00000870  61 6e 64 6c 65 25 0d 03  7a 13 73 63 72 6f 6c 6c  |andle%..z.scroll|
00000880  6d 61 78 25 3d 62 21 34  34 0d 03 84 05 e1 0d 03  |max%=b!44.......|
00000890  8e 2b dc 20 30 2c 38 30  30 2d 6c 61 73 74 70 74  |.+. 0,800-lastpt|
000008a0  72 25 2a 33 32 2d 32 2c  28 77 69 64 74 68 25 2a  |r%*32-2,(width%*|
000008b0  31 36 29 2b 35 2c 38 30  30 0d 03 98 16 dc 20 30  |16)+5,800..... 0|
000008c0  2c 30 2c 2d 31 2c 26 46  46 30 30 30 30 30 32 0d  |,0,-1,&FF000002.|
000008d0  03 a2 19 dc 20 26 30 30  30 37 30 32 30 37 2c 26  |.... &00070207,&|
000008e0  30 30 30 43 30 31 30 33  0d 03 ac 25 dc 20 30 2c  |000C0103...%. 0,|
000008f0  30 2d 6c 61 73 74 70 74  72 25 2a 33 32 2d 32 2c  |0-lastptr%*32-2,|
00000900  77 69 64 74 68 25 2a 31  36 2b 35 2c 30 0d 03 b6  |width%*16+5,0...|
00000910  1c dc 20 26 31 31 39 2c  30 3c 3c 31 32 2c 31 2c  |.. &119,0<<12,1,|
00000920  31 2b 28 30 3c 3c 31 32  29 0d 03 c0 13 dc 20 74  |1+(0<<12)..... t|
00000930  69 74 6c 65 2c 2d 31 2c  34 30 2c 30 0d 03 ca 05  |itle,-1,40,0....|
00000940  3a 0d 03 d4 05 3a 0d 03  de 0a dd f2 6c 6f 6f 70  |:....:......loop|
00000950  0d 03 e8 0b 71 75 69 74  25 3d a3 0d 03 f2 05 f5  |....quit%=......|
00000960  0d 03 fc 31 20 20 c8 99  20 22 57 69 6d 70 5f 50  |...1  .. "Wimp_P|
00000970  6f 6c 6c 22 2c 26 33 38  33 30 20 80 20 74 62 25  |oll",&3830 . tb%|
00000980  21 31 30 30 30 2c 62 20  b8 20 72 65 61 73 6f 6e  |!1000,b . reason|
00000990  25 0d 04 06 36 20 20 c8  99 20 22 54 65 6d 70 65  |%...6  .. "Tempe|
000009a0  73 74 5f 50 72 65 50 72  6f 63 65 73 73 22 2c 72  |st_PreProcess",r|
000009b0  65 61 73 6f 6e 25 2c 62  25 2c 74 62 25 20 b8 20  |eason%,b%,tb% . |
000009c0  72 65 61 73 6f 6e 25 0d  04 10 12 20 20 c8 8e 20  |reason%....  .. |
000009d0  72 65 61 73 6f 6e 25 20  ca 0d 04 1a 2f 20 20 20  |reason% ..../   |
000009e0  20 c9 20 30 20 3a 20 e7  20 67 6f 25 3e 3d 30 20  | . 0 : . go%>=0 |
000009f0  80 20 91 3e 74 69 6d 65  25 2b 64 65 6c 61 79 25  |. .>time%+delay%|
00000a00  20 f2 73 63 72 6f 6c 6c  0d 04 24 2a 20 20 20 20  | .scroll..$*    |
00000a10  e7 20 73 69 6c 6c 79 25  20 80 20 91 3e 73 69 6c  |. silly% . .>sil|
00000a20  6c 79 74 69 6d 65 25 2b  38 20 f2 64 6f 73 69 6c  |lytime%+8 .dosil|
00000a30  6c 79 0d 04 2e 15 20 20  20 20 c9 20 31 20 3a 20  |ly....    . 1 : |
00000a40  f2 72 65 64 72 61 77 0d  04 38 2c 20 20 20 20 c9  |.redraw..8,    .|
00000a50  20 32 20 3a 20 c8 99 20  22 54 65 6d 70 65 73 74  | 2 : .. "Tempest|
00000a60  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 62 2c  |_OpenWindow",,b,|
00000a70  74 62 25 0d 04 42 18 20  20 20 20 c9 20 33 20 3a  |tb%..B.    . 3 :|
00000a80  20 f2 63 6c 6f 73 65 64  61 74 61 0d 04 4c 14 20  | .closedata..L. |
00000a90  20 20 20 c9 20 36 20 3a  20 f2 63 6c 69 63 6b 0d  |   . 6 : .click.|
00000aa0  04 56 13 20 20 20 20 c9  20 39 20 3a 20 f2 6d 65  |.V.    . 9 : .me|
00000ab0  6e 75 0d 04 60 1c 20 20  20 20 c9 20 31 37 2c 31  |nu..`.    . 17,1|
00000ac0  38 20 3a 20 c8 8e 20 62  25 21 31 36 20 ca 0d 04  |8 : .. b%!16 ...|
00000ad0  6a 17 20 20 20 20 20 20  c9 20 30 20 3a 20 71 75  |j.      . 0 : qu|
00000ae0  69 74 25 3d b9 0d 04 74  29 20 20 20 20 20 20 c9  |it%=...t)      .|
00000af0  20 26 34 42 34 38 33 20  3a 20 f2 63 68 61 6e 67  | &4B483 : .chang|
00000b00  65 64 65 6c 61 79 28 2d  62 25 21 32 38 29 0d 04  |edelay(-b%!28)..|
00000b10  7e 09 20 20 20 20 cb 0d  04 88 07 20 20 cb 0d 04  |~.    .....  ...|
00000b20  92 0b fd 20 71 75 69 74  25 0d 04 9c 05 e1 0d 04  |... quit%.......|
00000b30  a6 05 3a 0d 04 b0 0b dd  f2 63 6c 69 63 6b 0d 04  |..:......click..|
00000b40  ba 0d c8 8e 20 62 21 31  32 20 ca 0d 04 c4 1e 20  |.... b!12 ..... |
00000b50  20 c9 20 73 68 61 6e 64  6c 65 25 20 3a 20 f2 73  | . shandle% : .s|
00000b60  70 65 65 64 63 6c 69 63  6b 0d 04 ce 17 20 20 c9  |peedclick....  .|
00000b70  20 2d 32 20 3a 20 f2 69  62 61 72 63 6c 69 63 6b  | -2 : .ibarclick|
00000b80  0d 04 d8 14 20 20 7f 20  3a 20 f2 6d 61 69 6e 63  |....  . : .mainc|
00000b90  6c 69 63 6b 0d 04 e2 05  cb 0d 04 ec 05 e1 0d 04  |lick............|
00000ba0  f6 05 3a 0d 05 00 0f dd  f2 6d 61 69 6e 63 6c 69  |..:......maincli|
00000bb0  63 6b 0d 05 0a 51 e7 20  28 62 21 38 20 80 20 32  |ck...Q. (b!8 . 2|
00000bc0  29 3e 30 20 8c 20 f2 74  69 63 6b 28 77 62 2c 31  |)>0 . .tick(wb,1|
00000bd0  2c b9 2c 67 6f 25 3d 30  29 3a c8 99 20 22 54 65  |,.,go%=0):.. "Te|
00000be0  6d 70 65 73 74 5f 53 68  6f 77 4d 65 6e 75 22 2c  |mpest_ShowMenu",|
00000bf0  31 2c 2c 74 62 25 2c 77  62 3a 6d 65 6e 75 25 3d  |1,,tb%,wb:menu%=|
00000c00  30 3a e1 0d 05 14 04 0d  05 1e 0b 77 25 3d 62 21  |0:.........w%=b!|
00000c10  31 36 0d 05 28 13 c8 8e  20 a4 69 74 79 70 65 28  |16..(... .itype(|
00000c20  77 25 29 20 ca 0d 05 32  0b 20 20 c9 20 31 20 3a  |w%) ...2.  . 1 :|
00000c30  0d 05 3c 11 20 20 e7 20  73 70 74 72 25 3d 38 20  |..<.  . sptr%=8 |
00000c40  8c 0d 05 46 2c 20 20 20  20 e3 20 78 25 3d 30 20  |...F,    . x%=0 |
00000c50  b8 20 36 3a 73 74 61 63  6b 25 28 78 25 29 3d 73  |. 6:stack%(x%)=s|
00000c60  74 61 63 6b 25 28 78 25  2b 31 29 3a ed 0d 05 50  |tack%(x%+1):...P|
00000c70  10 20 20 20 20 73 70 74  72 25 2d 3d 31 0d 05 5a  |.    sptr%-=1..Z|
00000c80  07 20 20 cd 0d 05 64 1e  20 20 73 74 61 63 6b 25  |.  ...d.  stack%|
00000c90  28 73 70 74 72 25 29 3d  a4 69 66 72 6f 6d 28 77  |(sptr%)=.ifrom(w|
00000ca0  25 29 0d 05 6e 0e 20 20  73 70 74 72 25 2b 3d 31  |%)..n.  sptr%+=1|
00000cb0  0d 05 78 20 20 20 f2 6d  6f 76 65 74 6f 28 a4 6d  |..x   .moveto(.m|
00000cc0  61 72 6b 28 a4 69 64 65  73 74 28 77 25 29 29 29  |ark(.idest(w%)))|
00000cd0  0d 05 82 0b 20 20 c9 20  33 20 3a 0d 05 8c 11 20  |....  . 3 :.... |
00000ce0  20 e7 20 73 70 74 72 25  3d 30 20 8c 0d 05 96 28  | . sptr%=0 ....(|
00000cf0  20 20 20 20 f2 65 72 72  6f 72 28 22 4e 6f 77 68  |    .error("Nowh|
00000d00  65 72 65 20 74 6f 20 67  6f 20 62 61 63 6b 20 74  |ere to go back t|
00000d10  6f 2e 22 29 0d 05 a0 07  20 20 cc 0d 05 aa 15 20  |o.")....  ..... |
00000d20  20 20 20 73 70 74 72 25  3d 73 70 74 72 25 2d 31  |   sptr%=sptr%-1|
00000d30  0d 05 b4 1e 20 20 20 20  f2 6d 6f 76 65 74 6f 28  |....    .moveto(|
00000d40  73 74 61 63 6b 25 28 73  70 74 72 25 29 29 0d 05  |stack%(sptr%))..|
00000d50  be 07 20 20 cd 0d 05 c8  05 cb 0d 05 d2 05 e1 0d  |..  ............|
00000d60  05 dc 05 3a 0d 05 e6 26  dd a4 69 64 65 73 74 28  |...:...&..idest(|
00000d70  77 25 29 3a 3d 21 28 62  75 74 74 6f 6e 6d 65 6d  |w%):=!(buttonmem|
00000d80  25 2b 77 25 2a 31 32 2b  34 29 0d 05 f0 24 dd a4  |%+w%*12+4)...$..|
00000d90  69 74 79 70 65 28 77 25  29 3a 3d 21 28 62 75 74  |itype(w%):=!(but|
00000da0  74 6f 6e 6d 65 6d 25 2b  77 25 2a 31 32 29 0d 05  |tonmem%+w%*12)..|
00000db0  fa 26 dd a4 69 66 72 6f  6d 28 77 25 29 3a 3d 21  |.&..ifrom(w%):=!|
00000dc0  28 62 75 74 74 6f 6e 6d  65 6d 25 2b 77 25 2a 31  |(buttonmem%+w%*1|
00000dd0  32 2b 38 29 0d 06 04 20  dd a4 6d 61 72 6b 28 77  |2+8)... ..mark(w|
00000de0  25 29 3a 3d 21 28 6d 61  72 6b 6d 65 6d 25 2b 77  |%):=!(markmem%+w|
00000df0  25 2a 34 29 0d 06 0e 05  3a 0d 06 18 10 dd f2 6d  |%*4)....:......m|
00000e00  6f 76 65 74 6f 28 78 25  29 0d 06 22 10 64 65 73  |oveto(x%)..".des|
00000e10  74 6d 61 72 6b 25 3d 78  25 0d 06 2c 0f 21 62 3d  |tmark%=x%..,.!b=|
00000e20  77 68 61 6e 64 6c 65 25  0d 06 36 1f c8 99 20 22  |whandle%..6... "|
00000e30  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 53 74  |Wimp_GetWindowSt|
00000e40  61 74 65 22 2c 2c 62 0d  06 40 3c c8 99 20 22 57  |ate",,b..@<.. "W|
00000e50  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
00000e60  2c 2c 62 3a f4 20 74 6f  20 66 6f 72 63 65 20 72  |,,b:. to force r|
00000e70  65 64 72 61 77 20 6f 66  20 45 56 45 52 59 54 48  |edraw of EVERYTH|
00000e80  49 4e 47 0d 06 4a 34 78  25 3d 2d 78 25 2a 33 32  |ING..J4x%=-x%*32|
00000e90  2b 28 28 62 21 31 36 2d  62 21 38 29 81 32 29 3a  |+((b!16-b!8).2):|
00000ea0  f4 20 70 75 74 73 20 74  61 72 67 65 74 20 69 6e  |. puts target in|
00000eb0  20 6d 69 64 64 6c 65 0d  06 54 0b 62 21 32 34 3d  | middle..T.b!24=|
00000ec0  78 25 0d 06 5e 1b c8 99  20 22 57 69 6d 70 5f 4f  |x%..^... "Wimp_O|
00000ed0  70 65 6e 57 69 6e 64 6f  77 22 2c 2c 62 0d 06 68  |penWindow",,b..h|
00000ee0  05 e1 0d 06 72 05 3a 0d  06 7c 0f dd f2 69 62 61  |....r.:..|...iba|
00000ef0  72 63 6c 69 63 6b 0d 06  86 0c c8 8e 20 62 21 38  |rclick...... b!8|
00000f00  20 ca 0d 06 90 0b 20 20  c9 20 34 20 3a 0d 06 9a  | .....  . 4 :...|
00000f10  34 20 20 c9 20 32 20 3a  20 c8 99 20 22 54 65 6d  |4  . 2 : .. "Tem|
00000f20  70 65 73 74 5f 53 68 6f  77 4d 65 6e 75 22 2c 30  |pest_ShowMenu",0|
00000f30  2c 2c 74 62 25 2c 6d 62  3a 6d 65 6e 75 25 3d 2d  |,,tb%,mb:menu%=-|
00000f40  31 0d 06 a4 0b 20 20 c9  20 31 20 3a 0d 06 ae 05  |1....  . 1 :....|
00000f50  cb 0d 06 b8 05 e1 0d 06  c2 05 3a 0d 06 cc 10 dd  |..........:.....|
00000f60  f2 73 70 65 65 64 63 6c  69 63 6b 0d 06 d6 0d c8  |.speedclick.....|
00000f70  8e 20 62 21 31 36 20 ca  0d 06 e0 3b 20 20 c9 20  |. b!16 ....;  . |
00000f80  33 20 3a 20 21 70 62 25  3d 73 68 61 6e 64 6c 65  |3 : !pb%=shandle|
00000f90  25 3a c8 99 20 22 54 65  6d 70 65 73 74 5f 43 6c  |%:.. "Tempest_Cl|
00000fa0  6f 73 65 57 69 6e 64 6f  77 22 2c 2c 70 62 25 2c  |oseWindow",,pb%,|
00000fb0  74 62 25 0d 06 ea 4c 20  20 c9 20 34 20 3a 20 64  |tb%...L  . 4 : d|
00000fc0  65 6c 61 79 25 3d 6f 6c  64 64 65 6c 61 79 25 3a  |elay%=olddelay%:|
00000fd0  21 70 62 25 3d 73 68 61  6e 64 6c 65 25 3a c8 99  |!pb%=shandle%:..|
00000fe0  20 22 54 65 6d 70 65 73  74 5f 43 6c 6f 73 65 57  | "Tempest_CloseW|
00000ff0  69 6e 64 6f 77 22 2c 2c  70 62 25 2c 74 62 25 0d  |indow",,pb%,tb%.|
00001000  06 f4 05 cb 0d 06 fe 05  e1 0d 07 08 05 3a 0d 07  |.............:..|
00001010  12 15 dd f2 63 68 61 6e  67 65 64 65 6c 61 79 28  |....changedelay(|
00001020  77 25 29 0d 07 1c 17 e7  20 64 65 6c 61 79 25 3e  |w%)..... delay%>|
00001030  32 35 20 77 25 3d 77 25  2a 32 0d 07 26 21 64 65  |25 w%=w%*2..&!de|
00001040  6c 61 79 25 3d a4 72 61  6e 67 65 28 64 65 6c 61  |lay%=.range(dela|
00001050  79 25 2b 77 25 2c 34 2c  33 35 29 0d 07 30 3d c8  |y%+w%,4,35)..0=.|
00001060  99 20 22 54 65 6d 70 65  73 74 5f 53 65 74 49 63  |. "Tempest_SetIc|
00001070  6f 6e 54 65 78 74 22 2c  73 68 61 6e 64 6c 65 25  |onText",shandle%|
00001080  2c 30 2c 74 62 25 2c c3  28 a8 28 31 30 30 30 2f  |,0,tb%,.(.(1000/|
00001090  64 65 6c 61 79 25 29 29  0d 07 3a 05 e1 0d 07 44  |delay%))..:....D|
000010a0  05 3a 0d 07 4e 0a dd f2  6d 65 6e 75 0d 07 58 10  |.:..N...menu..X.|
000010b0  e7 20 6d 65 6e 75 25 3d  2d 31 20 8c 0d 07 62 0e  |. menu%=-1 ...b.|
000010c0  20 20 c8 8e 20 62 21 30  20 ca 0d 07 6c 15 20 20  |  .. b!0 ...l.  |
000010d0  20 20 c9 20 31 20 3a 20  71 75 69 74 25 3d b9 0d  |  . 1 : quit%=..|
000010e0  07 76 07 20 20 cb 0d 07  80 05 cc 0d 07 8a 0e 20  |.v.  .......... |
000010f0  20 c8 8e 20 62 21 30 20  ca 0d 07 94 1b 20 20 20  | .. b!0 .....   |
00001100  20 c9 20 30 20 3a 20 20  20 e7 20 73 70 74 72 25  | . 0 :   . sptr%|
00001110  3d 30 20 8c 0d 07 9e 2a  20 20 20 20 20 20 f2 65  |=0 ....*      .e|
00001120  72 72 6f 72 28 22 4e 6f  77 68 65 72 65 20 74 6f  |rror("Nowhere to|
00001130  20 67 6f 20 62 61 63 6b  20 74 6f 2e 22 29 0d 07  | go back to.")..|
00001140  a8 09 20 20 20 20 cc 0d  07 b2 17 20 20 20 20 20  |..    .....     |
00001150  20 73 70 74 72 25 3d 73  70 74 72 25 2d 31 0d 07  | sptr%=sptr%-1..|
00001160  bc 20 20 20 20 20 20 20  f2 6d 6f 76 65 74 6f 28  |.       .moveto(|
00001170  73 74 61 63 6b 25 28 73  70 74 72 25 29 29 0d 07  |stack%(sptr%))..|
00001180  c6 09 20 20 20 20 cd 0d  07 d0 33 20 20 20 20 c9  |..    ....3    .|
00001190  20 31 20 3a 20 e7 20 67  6f 25 3c 3e 30 20 67 6f  | 1 : . go%<>0 go|
000011a0  25 3d 30 3a 74 69 6d 65  25 3d 67 6f 25 2d 31 30  |%=0:time%=go%-10|
000011b0  30 20 8b 20 67 6f 25 3d  2d 31 0d 07 da 1b 20 20  |0 . go%=-1....  |
000011c0  20 20 f2 74 69 63 6b 28  77 62 2c 31 2c b9 2c 67  |  .tick(wb,1,.,g|
000011d0  6f 25 3d 30 29 0d 07 e4  29 20 20 20 20 c9 20 32  |o%=0)...)    . 2|
000011e0  20 3a 20 24 73 70 65 65  64 73 74 72 3d c3 28 a8  | : $speedstr=.(.|
000011f0  28 31 30 30 30 2f 64 65  6c 61 79 25 29 29 0d 07  |(1000/delay%))..|
00001200  ee 4d 20 20 20 20 6f 6c  64 64 65 6c 61 79 25 3d  |.M    olddelay%=|
00001210  64 65 6c 61 79 25 3a 21  70 62 25 3d 73 68 61 6e  |delay%:!pb%=shan|
00001220  64 6c 65 25 3a c8 99 20  22 54 65 6d 70 65 73 74  |dle%:.. "Tempest|
00001230  5f 53 68 6f 77 57 69 6e  64 6f 77 22 2c 26 33 33  |_ShowWindow",&33|
00001240  33 31 31 2c 70 62 25 2c  74 62 25 0d 07 f8 20 20  |311,pb%,tb%...  |
00001250  20 20 20 c9 20 33 20 3a  20 f2 63 6c 6f 73 65 64  |   . 3 : .closed|
00001260  61 74 61 3a 62 21 31 33  36 3d 30 0d 08 02 07 20  |ata:b!136=0.... |
00001270  20 cb 0d 08 0c 05 cd 0d  08 16 22 c8 99 20 22 54  | .........".. "T|
00001280  65 6d 70 65 73 74 5f 53  68 6f 77 4d 65 6e 75 22  |empest_ShowMenu"|
00001290  2c 37 2c 2c 74 62 25 2c  30 0d 08 20 05 e1 0d 08  |,7,,tb%,0.. ....|
000012a0  2a 05 3a 0d 08 34 05 3a  0d 08 3e 0d dd f2 64 6f  |*.:..4.:..>...do|
000012b0  73 69 6c 6c 79 0d 08 48  3a c8 99 20 22 54 65 6d  |silly..H:.. "Tem|
000012c0  70 65 73 74 5f 4d 69 73  63 4f 70 22 2c 31 34 2c  |pest_MiscOp",14,|
000012d0  62 2c 74 62 25 2c 2d 32  2c 69 68 61 6e 64 6c 65  |b,tb%,-2,ihandle|
000012e0  25 20 b8 20 65 79 65 78  25 2c 65 79 65 79 25 0d  |% . eyex%,eyey%.|
000012f0  08 52 17 65 79 65 78 25  2b 3d 31 36 3a 65 79 65  |.R.eyex%+=16:eye|
00001300  79 25 2b 3d 33 34 0d 08  5c 2c f4 20 65 79 65 20  |y%+=34..\,. eye |
00001310  78 79 20 63 6f 6e 74 61  69 6e 73 20 63 65 6e 74  |xy contains cent|
00001320  72 65 20 6f 66 20 6c 65  66 74 20 65 79 65 62 61  |re of left eyeba|
00001330  6c 6c 0d 08 66 19 c8 97  20 6d 6f 75 73 65 78 25  |ll..f... mousex%|
00001340  2c 6d 6f 75 73 65 79 25  2c 6a 25 0d 08 70 04 0d  |,mousey%,j%..p..|
00001350  08 7a 0e 41 25 3d 73 70  72 70 74 72 25 0d 08 84  |.z.A%=sprptr%...|
00001360  11 d6 20 63 6f 64 65 6d  65 6d 25 2b 31 32 0d 08  |.. codemem%+12..|
00001370  8e 04 0d 08 98 17 64 65  6c 78 25 3d 6d 6f 75 73  |......delx%=mous|
00001380  65 78 25 2d 65 79 65 78  25 0d 08 a2 17 64 65 6c  |ex%-eyex%....del|
00001390  79 25 3d 6d 6f 75 73 65  79 25 2d 65 79 65 79 25  |y%=mousey%-eyey%|
000013a0  0d 08 ac 3d f4 20 6d 6f  75 73 65 20 78 79 20 63  |...=. mouse xy c|
000013b0  6f 6e 74 61 69 6e 73 20  74 68 65 20 76 65 63 74  |ontains the vect|
000013c0  6f 72 20 66 72 6f 6d 20  63 65 6e 74 72 65 20 65  |or from centre e|
000013d0  79 65 20 74 6f 20 70 6f  69 6e 74 65 72 0d 08 b6  |ye to pointer...|
000013e0  21 73 71 3d b6 28 64 65  6c 78 25 2a 64 65 6c 78  |!sq=.(delx%*delx|
000013f0  25 2b 64 65 6c 79 25 2a  64 65 6c 79 25 29 0d 08  |%+dely%*dely%)..|
00001400  c0 0f e7 20 73 71 3c 36  20 73 71 3d 36 0d 08 ca  |... sq<6 sq=6...|
00001410  11 78 25 3d 37 2a 64 65  6c 78 25 2f 73 71 0d 08  |.x%=7*delx%/sq..|
00001420  d4 11 79 25 3d 37 2a 64  65 6c 79 25 2f 73 71 0d  |..y%=7*dely%/sq.|
00001430  08 de 12 f2 65 79 65 73  65 74 28 78 25 2c 79 25  |....eyeset(x%,y%|
00001440  29 0d 08 e8 04 0d 08 f2  2a f4 20 6f 74 68 65 72  |).......*. other|
00001450  20 65 79 65 2c 6f 6c 64  20 64 65 6c 59 20 63 6f  | eye,old delY co|
00001460  72 72 65 63 74 2e 20 58  20 33 34 20 6f 75 74 0d  |rrect. X 34 out.|
00001470  08 fc 0d 64 65 6c 78 25  2d 3d 33 34 0d 09 06 3d  |...delx%-=34...=|
00001480  f4 20 6d 6f 75 73 65 20  78 79 20 63 6f 6e 74 61  |. mouse xy conta|
00001490  69 6e 73 20 74 68 65 20  76 65 63 74 6f 72 20 66  |ins the vector f|
000014a0  72 6f 6d 20 63 65 6e 74  72 65 20 65 79 65 20 74  |rom centre eye t|
000014b0  6f 20 70 6f 69 6e 74 65  72 0d 09 10 21 73 71 3d  |o pointer...!sq=|
000014c0  b6 28 64 65 6c 78 25 2a  64 65 6c 78 25 2b 64 65  |.(delx%*delx%+de|
000014d0  6c 79 25 2a 64 65 6c 79  25 29 0d 09 1a 0f e7 20  |ly%*dely%)..... |
000014e0  73 71 3c 36 20 73 71 3d  36 0d 09 24 11 78 25 3d  |sq<6 sq=6..$.x%=|
000014f0  37 2a 64 65 6c 78 25 2f  73 71 0d 09 2e 11 79 25  |7*delx%/sq....y%|
00001500  3d 37 2a 64 65 6c 79 25  2f 73 71 0d 09 38 15 f2  |=7*dely%/sq..8..|
00001510  65 79 65 73 65 74 28 78  25 2b 33 34 2c 79 25 29  |eyeset(x%+34,y%)|
00001520  0d 09 42 04 0d 09 4c 19  f2 69 6e 76 61 6c 69 64  |..B...L..invalid|
00001530  28 2d 32 2c 69 68 61 6e  64 6c 65 25 29 0d 09 56  |(-2,ihandle%)..V|
00001540  10 73 69 6c 6c 79 74 69  6d 65 25 3d 91 0d 09 60  |.sillytime%=...`|
00001550  05 e1 0d 09 6a 05 3a 0d  09 74 13 dd f2 65 79 65  |....j.:..t...eye|
00001560  73 65 74 28 78 25 2c 79  25 29 0d 09 7e 2d f4 20  |set(x%,y%)..~-. |
00001570  63 6f 6f 72 64 73 20 72  69 67 68 74 20 75 70 20  |coords right up |
00001580  66 72 6f 6d 20 6d 69 64  64 6c 65 20 6f 66 20 6c  |from middle of l|
00001590  65 66 74 20 65 79 65 0d  09 88 11 78 25 3d 28 78  |eft eye....x%=(x|
000015a0  25 20 81 20 32 29 2b 37  0d 09 92 11 79 25 3d 38  |% . 2)+7....y%=8|
000015b0  2d 28 79 25 20 81 20 32  29 0d 09 9c 43 f4 20 74  |-(y% . 2)...C. t|
000015c0  68 65 73 65 20 63 6f 6f  72 64 73 20 61 72 65 20  |hese coords are |
000015d0  72 69 67 68 74 2c 64 6f  77 6e 2c 20 30 20 62 61  |right,down, 0 ba|
000015e0  73 65 64 20 70 69 78 65  6c 73 20 66 72 6f 6d 20  |sed pixels from |
000015f0  54 4c 20 6f 66 20 73 70  72 69 74 65 0d 09 a6 2f  |TL of sprite.../|
00001600  6f 64 64 25 3d 78 25 20  83 20 32 3a f4 20 69 73  |odd%=x% . 2:. is|
00001610  20 69 74 20 73 74 61 72  74 69 6e 67 20 6f 6e 20  | it starting on |
00001620  68 69 67 68 20 6e 69 62  62 6c 65 0d 09 b0 1d 42  |high nibble....B|
00001630  25 3d 73 70 72 70 74 72  25 2b 79 25 2a 31 36 2b  |%=sprptr%+y%*16+|
00001640  28 78 25 20 81 20 32 29  0d 09 ba 2e e7 20 6f 64  |(x% . 2)..... od|
00001650  64 25 3e 30 20 d6 20 28  63 6f 64 65 6d 65 6d 25  |d%>0 . (codemem%|
00001660  2b 32 30 29 20 8b 20 d6  20 28 63 6f 64 65 6d 65  |+20) . . (codeme|
00001670  6d 25 2b 31 36 29 0d 09  c4 05 e1 0d 09 ce 05 3a  |m%+16).........:|
00001680  0d 09 d8 0c dd f2 73 63  72 6f 6c 6c 0d 09 e2 0f  |......scroll....|
00001690  21 62 3d 77 68 61 6e 64  6c 65 25 0d 09 ec 1f c8  |!b=whandle%.....|
000016a0  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
000016b0  77 53 74 61 74 65 22 2c  2c 62 0d 09 f6 0f 62 21  |wState",,b....b!|
000016c0  32 34 3d 62 21 32 34 2d  34 0d 0a 00 2b e7 20 62  |24=b!24-4...+. b|
000016d0  21 32 34 3c 73 63 72 6f  6c 6c 6d 61 78 25 2b 28  |!24<scrollmax%+(|
000016e0  62 21 31 36 2d 62 21 38  29 20 8c 20 67 6f 25 3d  |b!16-b!8) . go%=|
000016f0  2d 31 3a e1 0d 0a 0a 1b  c8 99 20 22 57 69 6d 70  |-1:....... "Wimp|
00001700  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 62 0d  |_OpenWindow",,b.|
00001710  0a 14 0b 74 69 6d 65 25  3d 91 0d 0a 1e 05 e1 0d  |...time%=.......|
00001720  0a 28 05 3a 0d 0a 32 10  dd f2 64 61 74 61 6c 6f  |.(.:..2...datalo|
00001730  61 64 64 6f 0d 0a 3c 0c  61 62 6f 72 74 25 3d a3  |addo..<.abort%=.|
00001740  0d 0a 46 15 c8 99 20 22  48 6f 75 72 67 6c 61 73  |..F... "Hourglas|
00001750  73 5f 4f 6e 22 0d 0a 50  1a 73 69 7a 65 25 3d a4  |s_On"..P.size%=.|
00001760  66 69 6c 65 73 69 7a 65  28 66 69 6c 65 24 29 0d  |filesize(file$).|
00001770  0a 5a 16 64 61 74 61 6d  65 6d 25 3d 74 6f 70 6f  |.Z.datamem%=topo|
00001780  66 6d 65 6d 25 0d 0a 64  37 f2 73 65 74 6d 65 6d  |fmem%..d7.setmem|
00001790  28 74 6f 70 6f 66 6d 65  6d 25 2b 73 69 7a 65 25  |(topofmem%+size%|
000017a0  2b 34 2d 28 73 69 7a 65  25 20 83 20 34 29 2b 31  |+4-(size% . 4)+1|
000017b0  32 38 29 3a f4 20 2a 2a  2a 2a 2a 2a 0d 0a 6e 10  |28):. ******..n.|
000017c0  e7 20 61 62 6f 72 74 25  3d a3 20 8c 0d 0a 78 27  |. abort%=. ...x'|
000017d0  20 20 ff 28 22 4c 4f 41  44 20 22 2b 66 69 6c 65  |  .("LOAD "+file|
000017e0  24 2b 22 20 22 2b c3 7e  28 64 61 74 61 6d 65 6d  |$+" "+.~(datamem|
000017f0  25 29 29 0d 0a 82 30 20  20 77 69 6e 64 66 69 6c  |%))...0  windfil|
00001800  65 24 3d a4 65 6e 64 6e  61 6d 65 28 66 69 6c 65  |e$=.endname(file|
00001810  24 29 3a f4 72 65 73 65  74 73 20 66 69 6c 65 24  |$):.resets file$|
00001820  28 20 29 0d 0a 8c 0f 20  20 77 69 64 74 68 25 3d  |( )....  width%=|
00001830  37 37 0d 0a 96 1a 20 20  e7 20 ac 20 61 62 6f 72  |77....  . . abor|
00001840  74 25 20 f2 6d 61 6b 65  70 74 72 73 0d 0a a0 27  |t% .makeptrs...'|
00001850  20 20 e7 20 ac 20 61 62  6f 72 74 25 20 f2 6d 61  |  . . abort% .ma|
00001860  6b 65 77 69 6e 64 6f 77  3a f2 6d 61 6b 65 69 63  |kewindow:.makeic|
00001870  6f 6e 73 0d 0a aa 17 20  20 65 6e 64 6d 65 6d 25  |ons....  endmem%|
00001880  3d 74 6f 70 6f 66 6d 65  6d 25 0d 0a b4 12 20 20  |=topofmem%....  |
00001890  e7 20 ac 20 61 62 6f 72  74 25 20 8c 0d 0a be 40  |. . abort% ....@|
000018a0  20 20 20 20 73 70 74 72  25 3d 30 3a 64 65 73 74  |    sptr%=0:dest|
000018b0  6d 61 72 6b 25 3d 2d 31  3a f4 20 63 6c 65 61 72  |mark%=-1:. clear|
000018c0  20 62 75 74 74 6f 6e 73  20 73 74 61 63 6b 20 61  | buttons stack a|
000018d0  6e 64 20 6c 61 73 74 20  64 65 73 74 0d 0a c8 18  |nd last dest....|
000018e0  20 20 20 20 24 74 69 74  6c 65 3d 22 42 72 6f 77  |    $title="Brow|
000018f0  7a 65 72 22 0d 0a d2 11  20 20 20 20 77 69 6e 64  |zer"....    wind|
00001900  6f 77 25 3d b9 0d 0a dc  37 20 20 20 20 21 70 62  |ow%=....7    !pb|
00001910  25 3d 77 68 61 6e 64 6c  65 25 3a c8 99 20 22 54  |%=whandle%:.. "T|
00001920  65 6d 70 65 73 74 5f 53  68 6f 77 57 69 6e 64 6f  |empest_ShowWindo|
00001930  77 22 2c 31 2c 70 62 25  2c 74 62 25 0d 0a e6 19  |w",1,pb%,tb%....|
00001940  20 20 20 20 e7 20 73 74  61 72 74 5f 6d 61 72 6b  |    . start_mark|
00001950  25 3e 30 20 8c 0d 0a f0  25 20 20 20 20 20 20 f2  |%>0 ....%      .|
00001960  6d 6f 76 65 74 6f 28 a4  6d 61 72 6b 28 73 74 61  |moveto(.mark(sta|
00001970  72 74 5f 6d 61 72 6b 25  29 29 0d 0a fa 17 20 20  |rt_mark%))....  |
00001980  20 20 20 20 73 74 61 72  74 5f 6d 61 72 6b 25 3d  |    start_mark%=|
00001990  30 0d 0b 04 09 20 20 20  20 cd 0d 0b 0e 07 20 20  |0....    .....  |
000019a0  cd 0d 0b 18 05 cd 0d 0b  22 16 c8 99 20 22 48 6f  |........"... "Ho|
000019b0  75 72 67 6c 61 73 73 5f  4f 66 66 22 0d 0b 2c 05  |urglass_Off"..,.|
000019c0  e1 0d 0b 36 05 3a 0d 0b  40 12 dd f2 73 65 74 6d  |...6.:..@...setm|
000019d0  65 6d 28 74 6f 70 25 29  0d 0b 4a 08 ea 20 77 25  |em(top%)..J.. w%|
000019e0  0d 0b 54 29 c8 99 20 22  57 69 6d 70 5f 53 6c 6f  |..T).. "Wimp_Slo|
000019f0  74 53 69 7a 65 22 2c 74  6f 70 25 2d 26 38 30 30  |tSize",top%-&800|
00001a00  30 2c 2d 31 20 b8 20 77  25 0d 0b 5e 51 e7 20 77  |0,-1 . w%..^Q. w|
00001a10  25 3c 74 6f 70 25 2d 26  38 30 30 30 20 8c 20 f2  |%<top%-&8000 . .|
00001a20  65 72 72 6f 72 28 22 4e  6f 74 20 65 6e 6f 75 67  |error("Not enoug|
00001a30  68 20 6d 65 6d 6f 72 79  20 61 76 61 69 6c 61 62  |h memory availab|
00001a40  6c 65 22 29 3a 61 62 6f  72 74 25 3d b9 3a f2 63  |le"):abort%=.:.c|
00001a50  6c 6f 73 65 64 61 74 61  3a e1 0d 0b 68 12 74 6f  |losedata:...h.to|
00001a60  70 6f 66 6d 65 6d 25 3d  74 6f 70 25 0d 0b 72 05  |pofmem%=top%..r.|
00001a70  e1 0d 0b 7c 05 3a 0d 0b  86 11 dd a4 65 6e 64 6e  |...|.:......endn|
00001a80  61 6d 65 28 73 24 29 0d  0b 90 08 77 25 3d 31 0d  |ame(s$)....w%=1.|
00001a90  0b 9a 17 e3 20 65 6e 6c  6f 6f 70 25 3d 31 20 b8  |.... enloop%=1 .|
00001aa0  20 a9 28 73 24 29 0d 0b  a4 27 20 20 e7 20 c1 73  | .(s$)...'  . .s|
00001ab0  24 2c 65 6e 6c 6f 6f 70  25 2c 31 29 3d 22 2e 22  |$,enloop%,1)="."|
00001ac0  20 77 25 3d 65 6e 6c 6f  6f 70 25 2b 31 0d 0b ae  | w%=enloop%+1...|
00001ad0  05 ed 0d 0b b8 13 66 69  6c 65 24 3d c0 73 24 2c  |......file$=.s$,|
00001ae0  77 25 2d 31 29 0d 0b c2  14 3d c2 73 24 2c a9 28  |w%-1)....=.s$,.(|
00001af0  73 24 29 2d 77 25 2b 31  29 0d 0b cc 05 3a 0d 0b  |s$)-w%+1)....:..|
00001b00  d6 05 3a 0d 0b e0 0f dd  f2 63 6c 6f 73 65 64 61  |..:......closeda|
00001b10  74 61 0d 0b ea 0b 71 75  69 74 25 3d b9 0d 0b f4  |ta....quit%=....|
00001b20  05 e1 0d 0b fe 05 3a 0d  0c 08 0c dd f2 72 65 64  |......:......red|
00001b30  72 61 77 0d 0c 12 25 c8  99 20 22 57 69 6d 70 5f  |raw...%.. "Wimp_|
00001b40  52 65 64 72 61 77 57 69  6e 64 6f 77 22 2c 2c 62  |RedrawWindow",,b|
00001b50  20 b8 20 66 6c 61 67 25  0d 0c 1c 10 6f 78 25 3d  | . flag%....ox%=|
00001b60  62 21 34 2d 62 21 32 30  0d 0c 26 11 6f 79 25 3d  |b!4-b!20..&.oy%=|
00001b70  62 21 31 36 2d 62 21 32  34 0d 0c 30 0f c8 95 20  |b!16-b!24..0... |
00001b80  66 6c 61 67 25 3c 3e 30  0d 0c 3a 39 20 20 73 74  |flag%<>0..:9  st|
00001b90  61 72 74 79 25 3d 62 21  32 34 2d 28 62 21 31 36  |arty%=b!24-(b!16|
00001ba0  2d 62 21 34 30 29 3a f4  20 74 6f 70 20 72 65 64  |-b!40):. top red|
00001bb0  77 20 72 65 63 74 20 77  6f 72 6b 20 63 64 28 2d  |w rect work cd(-|
00001bc0  29 0d 0c 44 35 20 20 68  65 69 67 68 74 79 25 3d  |)..D5  heighty%=|
00001bd0  28 62 21 34 30 2d 62 21  33 32 29 2b 31 3a f4 20  |(b!40-b!32)+1:. |
00001be0  68 20 6f 66 20 72 65 64  77 20 69 6e 20 4f 53 2f  |h of redw in OS/|
00001bf0  73 63 72 20 63 64 0d 0c  4e 1c 20 20 73 74 61 72  |scr cd..N.  star|
00001c00  74 79 25 3d 28 2d 73 74  61 72 74 79 25 29 81 20  |ty%=(-starty%). |
00001c10  33 32 0d 0c 58 25 20 20  65 6e 64 79 25 3d 73 74  |32..X%  endy%=st|
00001c20  61 72 74 79 25 2b 28 68  65 69 67 68 74 79 25 20  |arty%+(heighty% |
00001c30  81 20 33 32 29 2b 31 0d  0c 62 28 20 20 e7 20 65  |. 32)+1..b(  . e|
00001c40  6e 64 79 25 3e 3d 6c 61  73 74 70 74 72 25 20 65  |ndy%>=lastptr% e|
00001c50  6e 64 79 25 3d 6c 61 73  74 70 74 72 25 2d 31 0d  |ndy%=lastptr%-1.|
00001c60  0c 6c 1c 20 20 c8 99 20  22 57 69 6d 70 5f 53 65  |.l.  .. "Wimp_Se|
00001c70  74 43 6f 6c 6f 75 72 22  2c 31 32 0d 0c 76 57 20  |tColour",12..vW |
00001c80  20 e7 20 64 65 73 74 6d  61 72 6b 25 3e 73 74 61  | . destmark%>sta|
00001c90  72 74 79 25 2d 35 20 80  20 64 65 73 74 6d 61 72  |rty%-5 . destmar|
00001ca0  6b 25 3c 65 6e 64 79 25  2b 35 20 c8 93 20 c8 90  |k%<endy%+5 .. ..|
00001cb0  20 6f 78 25 2b 32 2c 6f  79 25 2d 64 65 73 74 6d  | ox%+2,oy%-destm|
00001cc0  61 72 6b 25 2a 33 32 2d  33 33 2c 31 32 38 30 2c  |ark%*32-33,1280,|
00001cd0  33 32 0d 0c 80 1b 20 20  c8 99 20 22 57 69 6d 70  |32....  .. "Wimp|
00001ce0  5f 53 65 74 43 6f 6c 6f  75 72 22 2c 37 0d 0c 8a  |_SetColour",7...|
00001cf0  10 20 20 43 25 3d 73 74  61 72 74 79 25 0d 0c 94  |.  C%=starty%...|
00001d00  10 20 20 42 25 3d 70 74  72 6d 65 6d 25 0d 0c 9e  |.  B%=ptrmem%...|
00001d10  12 20 20 c8 95 20 43 25  3c 3d 65 6e 64 79 25 0d  |.  .. C%<=endy%.|
00001d20  0c a8 1b 20 20 20 20 ec  20 6f 78 25 2b 32 2c 6f  |...    . ox%+2,o|
00001d30  79 25 2d 43 25 2a 33 32  2d 34 0d 0c b2 17 20 20  |y%-C%*32-4....  |
00001d40  20 20 d6 20 28 63 6f 64  65 6d 65 6d 25 2b 32 38  |  . (codemem%+28|
00001d50  29 0d 0c bc 0d 20 20 20  20 43 25 2b 3d 31 0d 0c  |)....    C%+=1..|
00001d60  c6 07 20 20 ce 0d 0c d0  27 20 20 c8 99 20 22 57  |..  ....'  .. "W|
00001d70  69 6d 70 5f 47 65 74 52  65 63 74 61 6e 67 6c 65  |imp_GetRectangle|
00001d80  22 2c 2c 62 20 b8 20 66  6c 61 67 25 0d 0c da 1c  |",,b . flag%....|
00001d90  20 20 f4 20 67 65 74 20  6e 65 78 74 20 72 65 64  |  . get next red|
00001da0  72 61 77 20 61 72 65 61  0d 0c e4 05 ce 0d 0c ee  |raw area........|
00001db0  05 e1 0d 0c f8 05 3a 0d  0d 02 0e dd f2 6d 61 6b  |......:......mak|
00001dc0  65 70 74 72 73 0d 0d 0c  36 67 65 74 70 74 72 25  |eptrs...6getptr%|
00001dd0  3d 64 61 74 61 6d 65 6d  25 3a f4 20 74 68 69 73  |=datamem%:. this|
00001de0  20 63 61 6e 20 62 65 20  72 65 73 65 74 20 62 79  | can be reset by|
00001df0  20 50 52 4f 43 68 65 61  64 65 72 0d 0d 16 2e 61  | PROCheader....a|
00001e00  73 63 69 69 25 3d a3 3a  72 65 70 6c 61 63 65 25  |scii%=.:replace%|
00001e10  3d 33 32 3a 75 73 65 72  25 3d a3 3a 66 6f 72 6d  |=32:user%=.:form|
00001e20  25 3d 66 6f 72 6d 61 74  25 0d 0d 20 0c 77 24 3d  |%=format%.. .w$=|
00001e30  a4 70 75 6c 6c 0d 0d 2a  3d e7 20 c0 77 24 2c 37  |.pull..*=. .w$,7|
00001e40  29 3d 22 a4 48 45 41 44  45 52 22 20 8c 20 f2 68  |)=".HEADER" . .h|
00001e50  65 61 64 65 72 20 8b 20  67 65 74 70 74 72 25 3d  |eader . getptr%=|
00001e60  64 61 74 61 6d 65 6d 25  3a 68 65 61 64 65 72 25  |datamem%:header%|
00001e70  3d a3 0d 0d 34 15 70 74  72 6d 65 6d 25 3d 74 6f  |=...4.ptrmem%=to|
00001e80  70 6f 66 6d 65 6d 25 0d  0d 3e 1a f2 73 65 74 6d  |pofmem%..>..setm|
00001e90  65 6d 28 74 6f 70 6f 66  6d 65 6d 25 2b 31 32 38  |em(topofmem%+128|
00001ea0  29 0d 0d 48 14 21 70 74  72 6d 65 6d 25 3d 67 65  |)..H.!ptrmem%=ge|
00001eb0  74 70 74 72 25 0d 0d 52  0e 6e 65 78 74 70 74 72  |tptr%..R.nextptr|
00001ec0  25 3d 31 0d 0d 5c 38 42  25 3d 67 65 74 70 74 72  |%=1..\8B%=getptr|
00001ed0  25 3a 43 25 3d 64 61 74  61 6d 65 6d 25 2b 73 69  |%:C%=datamem%+si|
00001ee0  7a 65 25 2b 31 3a 44 25  3d 77 69 64 74 68 25 3a  |ze%+1:D%=width%:|
00001ef0  47 25 3d 72 65 70 6c 61  63 65 25 0d 0d 66 21 48  |G%=replace%..f!H|
00001f00  25 3d 28 61 73 63 69 69  25 20 80 20 31 32 38 29  |%=(ascii% . 128)|
00001f10  2b 28 66 6f 72 6d 25 20  80 20 31 29 0d 0d 70 0f  |+(form% . 1)..p.|
00001f20  21 63 6f 64 65 6d 65 6d  25 3d 30 0d 0d 7a 05 f5  |!codemem%=0..z..|
00001f30  0d 0d 84 16 20 20 42 25  3d ba 28 63 6f 64 65 6d  |....  B%=.(codem|
00001f40  65 6d 25 2b 34 29 0d 0d  8e 1e 20 20 21 28 70 74  |em%+4)....  !(pt|
00001f50  72 6d 65 6d 25 2b 6e 65  78 74 70 74 72 25 2a 34  |rmem%+nextptr%*4|
00001f60  29 3d 42 25 0d 0d 98 11  20 20 6e 65 78 74 70 74  |)=B%....  nextpt|
00001f70  72 25 2b 3d 31 0d 0d a2  1a 20 20 f2 73 65 74 6d  |r%+=1....  .setm|
00001f80  65 6d 28 74 6f 70 6f 66  6d 65 6d 25 2b 34 29 0d  |em(topofmem%+4).|
00001f90  0d ac 1b fd 20 3f 63 6f  64 65 6d 65 6d 25 3c 3e  |.... ?codemem%<>|
00001fa0  30 20 84 20 61 62 6f 72  74 25 0d 0d b6 17 6c 61  |0 . abort%....la|
00001fb0  73 74 70 74 72 25 3d 6e  65 78 74 70 74 72 25 2d  |stptr%=nextptr%-|
00001fc0  31 0d 0d c0 05 e1 0d 0d  ca 05 3a 0d 0d d4 0c dd  |1.........:.....|
00001fd0  f2 68 65 61 64 65 72 0d  0d de 0d 68 65 61 64 65  |.header....heade|
00001fe0  72 25 3d b9 0d 0d e8 05  f5 0d 0d f2 0e 20 20 77  |r%=..........  w|
00001ff0  24 3d a4 70 75 6c 6c 0d  0d fc 14 20 20 e7 20 77  |$=.pull....  . w|
00002000  24 3c 3e 22 a4 45 4e 44  22 20 8c 0d 0e 06 63 20  |$<>".END" ....c |
00002010  20 20 20 e7 20 67 65 74  70 74 72 25 3e 64 61 74  |   . getptr%>dat|
00002020  61 6d 65 6d 25 2b 73 69  7a 65 25 20 f2 65 72 72  |amem%+size% .err|
00002030  6f 72 28 22 42 61 64 20  68 65 61 64 65 72 20 62  |or("Bad header b|
00002040  6c 6f 63 6b 2e 22 29 3a  67 65 74 70 74 72 25 3d  |lock."):getptr%=|
00002050  64 61 74 61 6d 65 6d 25  2b 31 3a 77 24 3d 22 a4  |datamem%+1:w$=".|
00002060  45 4e 44 22 3a 68 65 61  64 65 72 25 3d a3 0d 0e  |END":header%=...|
00002070  10 1f 20 20 20 20 e7 20  77 24 3d 22 41 53 43 49  |..    . w$="ASCI|
00002080  49 22 20 8c 20 61 73 63  69 69 25 3d b9 0d 0e 1a  |I" . ascii%=....|
00002090  1c 20 20 20 20 e7 20 c0  77 24 2c 37 29 3d 22 52  |.    . .w$,7)="R|
000020a0  45 50 4c 41 43 45 22 20  8c 0d 0e 24 4f 20 20 20  |EPLACE" ...$O   |
000020b0  20 20 20 e7 20 c2 77 24  2c 31 29 3c 22 30 22 20  |   . .w$,1)<"0" |
000020c0  80 20 c2 77 24 2c 31 29  3e 22 39 22 20 8c 20 72  |. .w$,1)>"9" . r|
000020d0  65 70 6c 61 63 65 25 3d  97 28 c2 77 24 2c 31 29  |eplace%=.(.w$,1)|
000020e0  29 20 8b 20 72 65 70 6c  61 63 65 25 3d bb c1 77  |) . replace%=..w|
000020f0  24 2c 38 2c 32 35 30 29  0d 0e 2e 09 20 20 20 20  |$,8,250)....    |
00002100  cd 0d 0e 38 24 20 20 20  20 e7 20 77 24 3d 22 55  |...8$    . w$="U|
00002110  53 45 52 42 55 54 54 4f  4e 53 22 20 8c 20 75 73  |SERBUTTONS" . us|
00002120  65 72 25 3d b9 0d 0e 42  22 20 20 20 20 e7 20 77  |er%=...B"    . w|
00002130  24 3d 22 46 4f 52 4d 41  54 20 4f 4e 22 20 8c 20  |$="FORMAT ON" . |
00002140  66 6f 72 6d 25 3d b9 0d  0e 4c 23 20 20 20 20 e7  |form%=...L#    .|
00002150  20 77 24 3d 22 46 4f 52  4d 41 54 20 4f 46 46 22  | w$="FORMAT OFF"|
00002160  20 8c 20 66 6f 72 6d 25  3d a3 0d 0e 56 07 20 20  | . form%=...V.  |
00002170  cd 0d 0e 60 0f fd 20 77  24 3d 22 a4 45 4e 44 22  |...`.. w$=".END"|
00002180  0d 0e 6a 05 e1 0d 0e 74  05 3a 0d 0e 7e 0a dd a4  |..j....t.:..~...|
00002190  70 75 6c 6c 0d 0e 88 08  ea 20 77 24 0d 0e 92 09  |pull..... w$....|
000021a0  77 24 3d 22 22 0d 0e 9c  05 f5 0d 0e a6 29 20 20  |w$=""........)  |
000021b0  e7 20 3f 67 65 74 70 74  72 25 3c 3e 26 30 41 20  |. ?getptr%<>&0A |
000021c0  8c 20 77 24 3d 77 24 2b  bd 28 3f 67 65 74 70 74  |. w$=w$+.(?getpt|
000021d0  72 25 29 0d 0e b0 10 20  20 67 65 74 70 74 72 25  |r%)....  getptr%|
000021e0  2b 3d 31 0d 0e ba 22 fd  20 3f 28 67 65 74 70 74  |+=1...". ?(getpt|
000021f0  72 25 2d 31 29 3d 26 30  41 20 84 20 a9 28 77 24  |r%-1)=&0A . .(w$|
00002200  29 3e 32 35 30 0d 0e c4  07 3d 77 24 0d 0e ce 05  |)>250....=w$....|
00002210  3a 0d 0e d8 0f dd f2 6d  61 6b 65 69 63 6f 6e 73  |:......makeicons|
00002220  0d 0e e2 2c 42 25 3d 64  61 74 61 6d 65 6d 25 2d  |...,B%=datamem%-|
00002230  31 3a 43 25 3d 21 28 70  74 72 6d 65 6d 25 2b 6c  |1:C%=!(ptrmem%+l|
00002240  61 73 74 70 74 72 25 2a  34 29 2d 31 0d 0e ec 11  |astptr%*4)-1....|
00002250  d6 20 63 6f 64 65 6d 65  6d 25 2b 32 34 0d 0e f6  |. codemem%+24...|
00002260  1f 6e 75 6d 6d 61 72 6b  73 25 3d 21 63 6f 64 65  |.nummarks%=!code|
00002270  6d 65 6d 25 20 81 20 36  35 35 33 36 0d 0f 00 21  |mem% . 65536...!|
00002280  6e 75 6d 62 75 74 74 6f  6e 73 25 3d 21 63 6f 64  |numbuttons%=!cod|
00002290  65 6d 65 6d 25 20 80 20  36 35 35 33 35 0d 0f 0a  |emem% . 65535...|
000022a0  18 62 75 74 74 6f 6e 6d  65 6d 25 3d 74 6f 70 6f  |.buttonmem%=topo|
000022b0  66 6d 65 6d 25 0d 0f 14  29 6d 61 72 6b 6d 65 6d  |fmem%...)markmem|
000022c0  25 3d 74 6f 70 6f 66 6d  65 6d 25 2b 28 6e 75 6d  |%=topofmem%+(num|
000022d0  62 75 74 74 6f 6e 73 25  2b 31 29 2a 31 32 0d 0f  |buttons%+1)*12..|
000022e0  1e 2b f2 73 65 74 6d 65  6d 28 6d 61 72 6b 6d 65  |.+.setmem(markme|
000022f0  6d 25 2b 28 6e 75 6d 6d  61 72 6b 73 25 2b 31 29  |m%+(nummarks%+1)|
00002300  2a 34 20 2b 31 30 32 34  29 0d 0f 28 0e e7 20 61  |*4 +1024)..(.. a|
00002310  62 6f 72 74 25 20 e1 0d  0f 32 48 73 70 72 6d 65  |bort% ...2Hsprme|
00002320  6d 25 3d 74 6f 70 6f 66  6d 65 6d 25 3a f4 20 69  |m%=topofmem%:. i|
00002330  66 20 73 70 72 69 74 65  20 66 69 6c 65 20 69 73  |f sprite file is|
00002340  20 6c 6f 61 64 65 64 2c  20 69 74 20 77 69 6c 6c  | loaded, it will|
00002350  20 62 65 20 6c 6f 61 64  65 64 20 68 65 72 65 0d  | be loaded here.|
00002360  0f 3c 11 e7 20 ac 20 68  65 61 64 65 72 25 20 e1  |.<.. . header% .|
00002370  0d 0f 46 05 3a 0d 0f 50  0b 6c 69 6e 65 25 3d 30  |..F.:..P.line%=0|
00002380  0d 0f 5a 0b 6c 65 74 74  25 3d 30 0d 0f 64 0b 69  |..Z.lett%=0..d.i|
00002390  63 6f 6e 25 3d 30 0d 0f  6e 0c 73 6c 6f 73 74 25  |con%=0..n.slost%|
000023a0  3d 30 0d 0f 78 0d 6d 69  64 6f 6e 65 25 3d a3 0d  |=0..x.midone%=..|
000023b0  0f 82 0d 73 70 72 69 74  65 25 3d a3 0d 0f 8c 0d  |...sprite%=.....|
000023c0  63 74 72 6c 25 3d 31 36  34 0d 0f 96 2c 42 25 3d  |ctrl%=164...,B%=|
000023d0  64 61 74 61 6d 65 6d 25  2d 31 3a 43 25 3d 21 28  |datamem%-1:C%=!(|
000023e0  70 74 72 6d 65 6d 25 2b  6c 61 73 74 70 74 72 25  |ptrmem%+lastptr%|
000023f0  2a 34 29 2d 31 0d 0f a0  15 46 25 3d 31 36 34 3a  |*4)-1....F%=164:|
00002400  47 25 3d 70 74 72 6d 65  6d 25 0d 0f aa 39 f4 20  |G%=ptrmem%...9. |
00002410  28 73 74 61 72 74 73 20  66 72 6f 6d 20 62 65 67  |(starts from beg|
00002420  69 6e 6e 69 6e 67 20 6f  66 20 66 69 6c 65 2c 20  |inning of file, |
00002430  6e 6f 74 20 61 66 74 65  72 20 74 68 65 20 a4 45  |not after the .E|
00002440  4e 44 29 0d 0f b4 2b e7  20 68 65 61 64 65 72 25  |ND)...+. header%|
00002450  20 21 63 6f 64 65 6d 65  6d 25 3d 2d 32 35 37 20  | !codemem%=-257 |
00002460  8b 20 21 63 6f 64 65 6d  65 6d 25 3d 2d 31 0d 0f  |. !codemem%=-1..|
00002470  be 2a f4 20 74 68 69 73  20 63 6f 6e 74 61 69 6e  |.*. this contain|
00002480  73 20 6d 63 6f 64 65 20  66 6f 72 20 6c 65 74 74  |s mcode for lett|
00002490  25 2c 20 6c 69 6e 65 25  0d 0f c8 05 f5 0d 0f d2  |%, line%........|
000024a0  0d 20 20 42 25 3d 42 25  2b 31 0d 0f dc 1b 20 20  |.  B%=B%+1....  |
000024b0  21 63 6f 64 65 6d 65 6d  25 3d 21 63 6f 64 65 6d  |!codemem%=!codem|
000024c0  65 6d 25 2b 31 0d 0f e6  16 20 20 42 25 3d ba 28  |em%+1....  B%=.(|
000024d0  63 6f 64 65 6d 65 6d 25  2b 38 29 0d 0f f0 13 20  |codemem%+8).... |
000024e0  20 e7 20 3f 42 25 3d 63  74 72 6c 25 20 8c 0d 0f  | . ?B%=ctrl% ...|
000024f0  fa 17 20 20 20 20 6c 65  74 74 25 3d 3f 63 6f 64  |..    lett%=?cod|
00002500  65 6d 65 6d 25 0d 10 04  1d 20 20 20 20 6c 69 6e  |emem%....    lin|
00002510  65 25 3d 21 63 6f 64 65  6d 65 6d 25 20 81 20 32  |e%=!codemem% . 2|
00002520  35 36 0d 10 0e 14 20 20  20 20 c8 8e 20 bd 28 42  |56....    .. .(B|
00002530  25 3f 31 29 20 ca 0d 10  18 30 20 20 20 20 20 20  |%?1) ....0      |
00002540  c9 20 22 47 22 20 3a 20  21 28 62 75 74 74 6f 6e  |. "G" : !(button|
00002550  6d 65 6d 25 2b 69 63 6f  6e 25 2a 31 32 2b 38 29  |mem%+icon%*12+8)|
00002560  3d 6c 69 6e 65 25 0d 10  22 31 20 20 20 20 20 20  |=line%.."1      |
00002570  f2 61 64 64 69 63 6f 6e  28 22 62 72 67 6f 74 6f  |.addicon("brgoto|
00002580  22 2c 31 29 3a 24 42 25  3d 22 20 20 20 20 22 3a  |",1):$B%="    ":|
00002590  42 25 3f 34 3d 33 32 0d  10 2c 39 20 20 20 20 20  |B%?4=32..,9     |
000025a0  20 c9 20 22 52 22 20 3a  20 f2 61 64 64 69 63 6f  | . "R" : .addico|
000025b0  6e 28 22 62 72 62 61 63  6b 22 2c 33 29 3a 24 42  |n("brback",3):$B|
000025c0  25 3d 22 20 20 20 20 22  3a 42 25 3f 34 3d 33 32  |%="    ":B%?4=32|
000025d0  0d 10 36 39 20 20 20 20  20 20 c9 20 22 4d 22 20  |..69      . "M" |
000025e0  3a 20 77 25 3d 28 42 25  3f 34 2d 34 38 29 2b 28  |: w%=(B%?4-48)+(|
000025f0  42 25 3f 33 2d 34 38 29  2a 31 30 2b 28 42 25 3f  |B%?3-48)*10+(B%?|
00002600  32 2d 34 38 29 2a 31 30  30 0d 10 40 33 20 20 20  |2-48)*100..@3   |
00002610  20 20 20 21 28 6d 61 72  6b 6d 65 6d 25 2b 77 25  |   !(markmem%+w%|
00002620  2a 34 29 3d 6c 69 6e 65  25 3a 24 42 25 3d 22 20  |*4)=line%:$B%=" |
00002630  20 20 20 22 3a 42 25 3f  34 3d 33 32 0d 10 4a 23  |   ":B%?4=32..J#|
00002640  20 20 20 20 20 20 c9 20  22 53 22 20 3a 20 f2 61  |      . "S" : .a|
00002650  64 64 73 70 72 69 74 65  28 30 2c 26 32 45 29 0d  |ddsprite(0,&2E).|
00002660  10 54 11 20 20 20 20 20  20 c9 20 22 56 22 20 3a  |.T.      . "V" :|
00002670  0d 10 5e 22 20 20 20 20  20 20 21 28 62 75 74 74  |..^"      !(butt|
00002680  6f 6e 6d 65 6d 25 2b 69  63 6f 6e 25 2a 31 32 29  |onmem%+icon%*12)|
00002690  3d 31 0d 10 68 47 20 20  20 20 20 20 21 28 62 75  |=1..hG      !(bu|
000026a0  74 74 6f 6e 6d 65 6d 25  2b 69 63 6f 6e 25 2a 31  |ttonmem%+icon%*1|
000026b0  32 2b 34 29 3d 28 42 25  3f 34 2d 34 38 29 2b 28  |2+4)=(B%?4-48)+(|
000026c0  42 25 3f 33 2d 34 38 29  2a 31 30 2b 28 42 25 3f  |B%?3-48)*10+(B%?|
000026d0  32 2d 34 38 29 2a 31 30  30 0d 10 72 28 20 20 20  |2-48)*100..r(   |
000026e0  20 20 20 21 28 62 75 74  74 6f 6e 6d 65 6d 25 2b  |   !(buttonmem%+|
000026f0  69 63 6f 6e 25 2a 31 32  2b 38 29 3d 6c 69 6e 65  |icon%*12+8)=line|
00002700  25 0d 10 7c 13 20 20 20  20 20 20 24 42 25 3d 22  |%..|.      $B%="|
00002710  20 20 20 22 0d 10 86 11  20 20 20 20 20 20 42 25  |   "....      B%|
00002720  3d 42 25 2b 33 0d 10 90  1b 20 20 20 20 20 20 f2  |=B%+3....      .|
00002730  61 64 64 73 70 72 69 74  65 28 33 2c 26 32 45 29  |addsprite(3,&2E)|
00002740  0d 10 9a 2c 20 20 20 20  20 20 c9 20 22 55 22 20  |...,      . "U" |
00002750  3a 20 f2 75 73 65 72 73  70 72 69 74 65 3a 3f 42  |: .usersprite:?B|
00002760  25 3d 33 32 3a 42 25 3f  31 3d 33 32 0d 10 a4 36  |%=32:B%?1=32...6|
00002770  20 20 20 20 20 20 c9 20  22 57 22 20 3a 20 f2 61  |      . "W" : .a|
00002780  64 64 73 70 72 69 74 65  28 30 2c 26 34 30 30 45  |ddsprite(0,&400E|
00002790  39 29 3a f4 50 52 4f 43  77 69 6d 70 73 70 72 69  |9):.PROCwimpspri|
000027a0  74 65 0d 10 ae 36 20 20  20 20 20 20 c9 20 22 43  |te...6      . "C|
000027b0  22 20 3a 20 63 74 72 6c  25 3d 42 25 3f 32 3a 46  |" : ctrl%=B%?2:F|
000027c0  25 3d 63 74 72 6c 25 3a  24 42 25 3d 22 20 20 22  |%=ctrl%:$B%="  "|
000027d0  3a 42 25 3f 32 3d 33 32  0d 10 b8 1d 20 20 20 20  |:B%?2=32....    |
000027e0  20 20 c9 20 bd 28 63 74  72 6c 25 29 20 3a 20 3f  |  . .(ctrl%) : ?|
000027f0  42 25 3d 33 32 0d 10 c2  09 20 20 20 20 cb 0d 10  |B%=32....    ...|
00002800  cc 07 20 20 cc 0d 10 d6  11 20 20 20 20 6d 69 64  |..  .....    mid|
00002810  6f 6e 65 25 3d b9 0d 10  e0 07 20 20 cd 0d 10 ea  |one%=.....  ....|
00002820  16 fd 20 6d 69 64 6f 6e  65 25 20 84 20 61 62 6f  |.. midone% . abo|
00002830  72 74 25 0d 10 f4 5f e7  20 73 6c 6f 73 74 25 3e  |rt%..._. slost%>|
00002840  30 20 f2 65 72 72 6f 72  28 c3 28 73 6c 6f 73 74  |0 .error(.(slost|
00002850  25 29 2b 22 20 6f 66 20  74 68 65 20 73 70 72 69  |%)+" of the spri|
00002860  74 65 73 20 72 65 71 75  65 73 74 65 64 20 62 79  |tes requested by|
00002870  20 74 68 65 20 66 69 6c  65 20 63 6f 75 6c 64 20  | the file could |
00002880  6e 6f 74 20 62 65 20 69  6e 73 65 72 74 65 64 2e  |not be inserted.|
00002890  22 29 0d 10 fe 05 e1 0d  11 08 05 3a 0d 11 12 17  |").........:....|
000028a0  dd f2 61 64 64 69 63 6f  6e 28 73 24 2c 74 79 70  |..addicon(s$,typ|
000028b0  65 25 29 0d 11 1c 23 e7  20 75 73 65 72 25 20 78  |e%)...#. user% x|
000028c0  25 3d 73 70 72 6d 65 6d  25 20 8b 20 78 25 3d 69  |%=sprmem% . x%=i|
000028d0  73 70 72 69 74 65 0d 11  26 09 24 62 3d 73 24 0d  |sprite..&.$b=s$.|
000028e0  11 30 27 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |.0'.. "OS_Sprite|
000028f0  4f 70 22 2c 32 35 36 2b  32 34 2c 78 25 2c 62 20  |Op",256+24,x%,b |
00002900  b8 20 2c 2c 77 25 0d 11  3a 10 62 21 30 3d 77 68  |. ,,w%..:.b!0=wh|
00002910  61 6e 64 6c 65 25 0d 11  44 10 62 21 34 3d 6c 65  |andle%..D.b!4=le|
00002920  74 74 25 2a 31 36 0d 11  4e 14 62 21 38 3d 2d 6c  |tt%*16..N.b!8=-l|
00002930  69 6e 65 25 2a 33 32 2d  33 32 0d 11 58 14 62 21  |ine%*32-32..X.b!|
00002940  31 32 3d 6c 65 74 74 25  2a 31 36 2b 38 30 0d 11  |12=lett%*16+80..|
00002950  62 12 62 21 31 36 3d 2d  6c 69 6e 65 25 2a 33 32  |b.b!16=-line%*32|
00002960  0d 11 6c 12 62 21 32 30  3d 26 30 30 30 30 33 31  |..l.b!20=&000031|
00002970  31 41 0d 11 76 0b 62 21  32 34 3d 77 25 0d 11 80  |1A..v.b!24=w%...|
00002980  0b 62 21 32 38 3d 78 25  0d 11 8a 0a 62 21 33 32  |.b!28=x%....b!32|
00002990  3d 30 0d 11 94 1b c8 99  20 22 57 69 6d 70 5f 43  |=0...... "Wimp_C|
000029a0  72 65 61 74 65 49 63 6f  6e 22 2c 2c 62 0d 11 9e  |reateIcon",,b...|
000029b0  20 21 28 62 75 74 74 6f  6e 6d 65 6d 25 2b 69 63  | !(buttonmem%+ic|
000029c0  6f 6e 25 2a 31 32 29 3d  74 79 70 65 25 0d 11 a8  |on%*12)=type%...|
000029d0  2b 77 25 3d 28 42 25 3f  34 2d 34 38 29 2b 28 42  |+w%=(B%?4-48)+(B|
000029e0  25 3f 33 2d 34 38 29 2a  31 30 2b 28 42 25 3f 32  |%?3-48)*10+(B%?2|
000029f0  2d 34 38 29 2a 31 30 30  0d 11 b2 1f 21 28 62 75  |-48)*100....!(bu|
00002a00  74 74 6f 6e 6d 65 6d 25  2b 69 63 6f 6e 25 2a 31  |ttonmem%+icon%*1|
00002a10  32 2b 34 29 3d 77 25 0d  11 bc 11 69 63 6f 6e 25  |2+4)=w%....icon%|
00002a20  3d 69 63 6f 6e 25 2b 31  0d 11 c6 05 e1 0d 11 d0  |=icon%+1........|
00002a30  05 3a 0d 11 da 1b dd f2  61 64 64 73 70 72 69 74  |.:......addsprit|
00002a40  65 28 74 79 70 65 25 2c  73 79 73 25 29 0d 11 e4  |e(type%,sys%)...|
00002a50  11 77 25 3d 42 25 2b 32  3a 73 24 3d 22 22 0d 11  |.w%=B%+2:s$=""..|
00002a60  ee 0d c8 95 20 3f 77 25  3e 33 32 0d 11 f8 1f 20  |.... ?w%>32.... |
00002a70  20 73 24 3d 73 24 2b bd  28 3f 77 25 29 3a 3f 77  | s$=s$+.(?w%):?w|
00002a80  25 3d 33 32 3a 77 25 2b  3d 31 0d 12 02 05 ce 0d  |%=32:w%+=1......|
00002a90  12 0c 12 3f 42 25 3d 33  32 3a 42 25 3f 31 3d 33  |...?B%=32:B%?1=3|
00002aa0  32 0d 12 16 05 3a 0d 12  20 07 ea 20 85 0d 12 2a  |2....:.. .. ...*|
00002ab0  19 ee 20 85 20 ea 20 f7  20 85 3a 73 6c 6f 73 74  |.. . . . .:slost|
00002ac0  25 2b 3d 31 3a e1 0d 12  34 1f e7 20 28 ac 20 73  |%+=1:...4.. (. s|
00002ad0  70 72 69 74 65 25 29 20  80 20 73 79 73 25 3c 26  |prite%) . sys%<&|
00002ae0  31 30 30 20 85 0d 12 3e  1e f4 20 66 69 72 73 74  |100 ...>.. first|
00002af0  20 67 65 74 20 69 6e 66  6f 20 6f 6e 20 73 70 72  | get info on spr|
00002b00  69 74 65 0d 12 48 09 24  62 3d 73 24 0d 12 52 3a  |ite..H.$b=s$..R:|
00002b10  c8 99 20 73 79 73 25 2c  32 35 36 2b 34 30 2c 73  |.. sys%,256+40,s|
00002b20  70 72 6d 65 6d 25 2c 62  20 b8 20 2c 2c 2c 73 77  |prmem%,b . ,,,sw|
00002b30  69 64 74 68 25 2c 73 68  65 69 67 68 74 25 2c 2c  |idth%,sheight%,,|
00002b40  73 6d 6f 64 65 25 0d 12  5c 12 e7 20 73 6d 6f 64  |smode%..\.. smod|
00002b50  65 25 3e 3d 32 34 20 8c  0d 12 66 11 20 20 73 78  |e%>=24 ...f.  sx|
00002b60  25 3d 32 3a 73 79 25 3d  32 0d 12 70 05 cc 0d 12  |%=2:sy%=2..p....|
00002b70  7a 09 20 20 f7 2b 30 0d  12 84 07 20 20 f5 0d 12  |z.  .+0....  ...|
00002b80  8e 11 20 20 20 20 f3 20  73 78 25 2c 73 79 25 0d  |..    . sx%,sy%.|
00002b90  12 98 11 20 20 20 20 73  6d 6f 64 65 25 2d 3d 31  |...    smode%-=1|
00002ba0  0d 12 a2 10 20 20 fd 20  73 6d 6f 64 65 25 3c 30  |....  . smode%<0|
00002bb0  0d 12 ac 05 cd 0d 12 b6  17 73 77 69 64 74 68 25  |.........swidth%|
00002bc0  3d 73 77 69 64 74 68 25  2a 73 78 25 0d 12 c0 19  |=swidth%*sx%....|
00002bd0  73 68 65 69 67 68 74 25  3d 73 68 65 69 67 68 74  |sheight%=sheight|
00002be0  25 2a 73 79 25 0d 12 ca  24 c8 99 20 73 79 73 25  |%*sy%...$.. sys%|
00002bf0  2c 32 35 36 2b 32 34 2c  73 70 72 6d 65 6d 25 2c  |,256+24,sprmem%,|
00002c00  62 20 b8 20 2c 2c 73 77  25 0d 12 d4 05 3a 0d 12  |b . ,,sw%....:..|
00002c10  de 10 62 21 30 3d 77 68  61 6e 64 6c 65 25 0d 12  |..b!0=whandle%..|
00002c20  e8 10 62 21 34 3d 6c 65  74 74 25 2a 31 36 0d 12  |..b!4=lett%*16..|
00002c30  f2 1a 62 21 38 3d 2d 6c  69 6e 65 25 2a 33 32 2d  |..b!8=-line%*32-|
00002c40  73 68 65 69 67 68 74 25  0d 12 fc 19 62 21 31 32  |sheight%....b!12|
00002c50  3d 6c 65 74 74 25 2a 31  36 2b 73 77 69 64 74 68  |=lett%*16+swidth|
00002c60  25 0d 13 06 12 62 21 31  36 3d 2d 6c 69 6e 65 25  |%....b!16=-line%|
00002c70  2a 33 32 0d 13 10 11 e7  20 73 79 73 25 3c 26 31  |*32..... sys%<&1|
00002c80  30 30 20 8c 0d 13 1a 20  20 20 62 21 32 30 3d 26  |00 ....   b!20=&|
00002c90  30 30 30 30 30 31 31 41  2b 28 74 79 70 65 25 3c  |0000011A+(type%<|
00002ca0  3c 31 32 29 0d 13 24 0e  20 20 62 21 32 34 3d 73  |<12)..$.  b!24=s|
00002cb0  77 25 0d 13 2e 12 20 20  62 21 32 38 3d 73 70 72  |w%....  b!28=spr|
00002cc0  6d 65 6d 25 0d 13 38 0c  20 20 62 21 33 32 3d 30  |mem%..8.  b!32=0|
00002cd0  0d 13 42 05 cc 0d 13 4c  20 20 20 62 21 32 30 3d  |..B....L   b!20=|
00002ce0  26 30 30 30 30 30 30 31  41 2b 28 74 79 70 65 25  |&0000001A+(type%|
00002cf0  3c 3c 31 32 29 0d 13 56  10 20 20 24 28 62 2b 32  |<<12)..V.  $(b+2|
00002d00  34 29 3d 73 24 0d 13 60  05 cd 0d 13 6a 1b c8 99  |4)=s$..`....j...|
00002d10  20 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  | "Wimp_CreateIco|
00002d20  6e 22 2c 2c 62 0d 13 74  11 69 63 6f 6e 25 3d 69  |n",,b..t.icon%=i|
00002d30  63 6f 6e 25 2b 31 0d 13  7e 07 f7 20 85 0d 13 88  |con%+1..~.. ....|
00002d40  05 e1 0d 13 92 05 3a 0d  13 9c 25 dc 20 32 2c 34  |......:...%. 2,4|
00002d50  2c 34 2c 34 2c 38 2c 34  2c 30 2c 30 2c 34 2c 34  |,4,4,8,4,0,0,4,4|
00002d60  2c 38 2c 34 2c 30 2c 30  2c 30 2c 30 0d 13 a6 25  |,8,4,0,0,0,0...%|
00002d70  dc 20 32 2c 34 2c 34 2c  34 2c 38 2c 34 2c 30 2c  |. 2,4,4,4,8,4,0,|
00002d80  30 2c 32 2c 34 2c 34 2c  34 2c 30 2c 30 2c 32 2c  |0,2,4,4,4,0,0,2,|
00002d90  34 0d 13 b0 1d dc 20 30  2c 30 2c 30 2c 30 2c 32  |4..... 0,0,0,0,2|
00002da0  2c 32 2c 32 2c 32 2c 32  2c 32 2c 32 2c 32 0d 13  |,2,2,2,2,2,2,2..|
00002db0  ba 08 f4 20 32 32 0d 13  c4 0d dc 20 31 2c 31 2c  |... 22..... 1,1,|
00002dc0  30 2c 30 0d 13 ce 05 3a  0d 13 d8 10 dd f2 75 73  |0,0....:......us|
00002dd0  65 72 73 70 72 69 74 65  0d 13 e2 31 f4 20 6c 6f  |ersprite...1. lo|
00002de0  61 64 20 69 6e 20 61 20  73 70 72 69 74 65 20 66  |ad in a sprite f|
00002df0  69 6c 65 20 69 6e 74 6f  20 75 73 65 72 20 73 70  |ile into user sp|
00002e00  72 69 74 65 20 61 72 65  61 0d 13 ec 2c 77 25 3d  |rite area...,w%=|
00002e10  42 25 2b 32 3a f4 20 66  69 72 73 74 20 63 68 61  |B%+2:. first cha|
00002e20  72 61 63 74 65 72 20 69  6e 20 73 70 72 69 74 65  |racter in sprite|
00002e30  20 6e 61 6d 65 0d 13 f6  09 77 24 3d 22 22 0d 14  | name....w$=""..|
00002e40  00 0d c8 95 20 3f 77 25  3e 33 32 0d 14 0a 21 20  |.... ?w%>32...! |
00002e50  20 77 24 3d 77 24 2b bd  28 3f 77 25 29 3a 3f 77  | w$=w$+.(?w%):?w|
00002e60  25 3d 33 32 3a 77 25 3d  77 25 2b 31 0d 14 14 05  |%=32:w%=w%+1....|
00002e70  ce 0d 14 1e 18 73 70 72  66 69 6c 65 24 3d 77 24  |.....sprfile$=w$|
00002e80  20 3a f4 20 2a 2a 2a 2a  2a 0d 14 28 14 e7 20 73  | :. *****..(.. s|
00002e90  70 72 69 74 65 25 20 f2  75 73 32 3a e1 0d 14 32  |prite% .us2:...2|
00002ea0  0d 73 70 72 69 74 65 25  3d b9 0d 14 3c 20 73 70  |.sprite%=...< sp|
00002eb0  72 73 69 7a 65 25 3d a4  66 69 6c 65 73 69 7a 65  |rsize%=.filesize|
00002ec0  28 73 70 72 66 69 6c 65  24 29 0d 14 46 51 e7 20  |(sprfile$)..FQ. |
00002ed0  73 70 72 73 69 7a 65 25  3d 2d 31 20 f2 65 72 72  |sprsize%=-1 .err|
00002ee0  6f 72 28 22 41 73 73 6f  63 69 61 74 65 64 20 73  |or("Associated s|
00002ef0  70 72 69 74 65 20 66 69  6c 65 20 3a 20 22 2b 73  |prite file : "+s|
00002f00  70 72 66 69 6c 65 24 2b  22 20 69 73 20 6e 6f 74  |prfile$+" is not|
00002f10  20 66 6f 75 6e 64 2e 22  29 3a e1 0d 14 50 1e 73  | found."):...P.s|
00002f20  70 72 73 69 7a 65 25 2b  3d 34 2d 28 73 70 72 73  |prsize%+=4-(sprs|
00002f30  69 7a 65 25 20 83 20 34  29 0d 14 5a 21 f2 73 65  |ize% . 4)..Z!.se|
00002f40  74 6d 65 6d 28 73 70 72  6d 65 6d 25 2b 73 70 72  |tmem(sprmem%+spr|
00002f50  73 69 7a 65 25 2b 32 35  36 29 0d 14 64 18 21 73  |size%+256)..d.!s|
00002f60  70 72 6d 65 6d 25 3d 73  70 72 73 69 7a 65 25 2b  |prmem%=sprsize%+|
00002f70  33 32 0d 14 6e 29 ff 28  22 4c 4f 41 44 20 22 2b  |32..n).("LOAD "+|
00002f80  73 70 72 66 69 6c 65 24  2b 22 20 22 2b c3 7e 28  |sprfile$+" "+.~(|
00002f90  73 70 72 6d 65 6d 25 2b  34 29 29 0d 14 78 05 e1  |sprmem%+4))..x..|
00002fa0  0d 14 82 05 3a 0d 14 8c  09 dd f2 75 73 32 0d 14  |....:......us2..|
00002fb0  96 2c f4 20 6c 6f 61 64  20 61 20 73 65 63 6f 6e  |.,. load a secon|
00002fc0  64 20 28 6f 72 20 6d 6f  72 65 29 20 73 70 72 69  |d (or more) spri|
00002fd0  74 65 20 66 69 6c 65 20  69 6e 0d 14 a0 1b 73 77  |te file in....sw|
00002fe0  25 3d a4 66 69 6c 65 73  69 7a 65 28 73 70 72 66  |%=.filesize(sprf|
00002ff0  69 6c 65 24 29 0d 14 aa  4c e7 20 73 77 25 3d 2d  |ile$)...L. sw%=-|
00003000  31 20 f2 65 72 72 6f 72  28 22 41 73 73 6f 63 69  |1 .error("Associ|
00003010  61 74 65 64 20 73 70 72  69 74 65 20 66 69 6c 65  |ated sprite file|
00003020  20 3a 20 22 2b 73 70 72  66 69 6c 65 24 2b 22 20  | : "+sprfile$+" |
00003030  69 73 20 6e 6f 74 20 66  6f 75 6e 64 2e 22 29 3a  |is not found."):|
00003040  e1 0d 14 b4 17 73 77 25  3d 73 77 25 2b 34 2d 28  |.....sw%=sw%+4-(|
00003050  73 77 25 20 83 20 34 29  0d 14 be 11 73 70 72 73  |sw% . 4)....sprs|
00003060  69 7a 65 25 2b 3d 73 77  25 0d 14 c8 21 f2 73 65  |ize%+=sw%...!.se|
00003070  74 6d 65 6d 28 73 70 72  6d 65 6d 25 2b 73 70 72  |tmem(sprmem%+spr|
00003080  73 69 7a 65 25 2b 32 35  36 29 0d 14 d2 0f 24 62  |size%+256)....$b|
00003090  3d 73 70 72 66 69 6c 65  24 0d 14 dc 18 21 73 70  |=sprfile$....!sp|
000030a0  72 6d 65 6d 25 3d 73 70  72 73 69 7a 65 25 2b 33  |rmem%=sprsize%+3|
000030b0  32 0d 14 e6 25 c8 99 20  22 4f 53 5f 53 70 72 69  |2...%.. "OS_Spri|
000030c0  74 65 4f 70 22 2c 32 35  36 2b 31 31 2c 73 70 72  |teOp",256+11,spr|
000030d0  6d 65 6d 25 2c 62 0d 14  f0 05 e1 0d 14 fa 05 3a  |mem%,b.........:|
000030e0  0d 15 04 10 dd a4 6d 61  78 28 61 25 2c 62 25 29  |......max(a%,b%)|
000030f0  0d 15 0e 17 e7 20 61 25  3e 62 25 20 8c 20 3d 61  |..... a%>b% . =a|
00003100  25 20 8b 20 3d 62 25 0d  15 18 05 3a 0d 15 22 10  |% . =b%....:..".|
00003110  dd a4 6d 69 6e 28 61 25  2c 62 25 29 0d 15 2c 17  |..min(a%,b%)..,.|
00003120  e7 20 61 25 3c 62 25 20  8c 20 3d 61 25 20 8b 20  |. a%<b% . =a% . |
00003130  3d 62 25 0d 15 36 05 3a  0d 15 40 15 dd a4 72 61  |=b%..6.:..@...ra|
00003140  6e 67 65 28 77 25 2c 61  25 2c 62 25 29 0d 15 4a  |nge(w%,a%,b%)..J|
00003150  13 e7 20 77 25 3c 61 25  20 8c 20 77 25 3d 61 25  |.. w%<a% . w%=a%|
00003160  0d 15 54 13 e7 20 77 25  3e 62 25 20 8c 20 77 25  |..T.. w%>b% . w%|
00003170  3d 62 25 0d 15 5e 07 3d  77 25 0d 15 68 05 3a 0d  |=b%..^.=w%..h.:.|
00003180  15 72 13 dd f2 70 28 61  64 64 72 25 2c 76 61 6c  |.r...p(addr%,val|
00003190  25 29 0d 15 7c 13 3f 61  64 64 72 25 3d 76 61 6c  |%)..|.?addr%=val|
000031a0  25 83 32 35 36 0d 15 86  14 61 64 64 72 25 3f 31  |%.256....addr%?1|
000031b0  3d 76 61 6c 25 81 32 35  36 0d 15 90 05 e1 0d 15  |=val%.256.......|
000031c0  9a 05 3a 0d 15 a4 24 dd  a4 69 28 61 64 64 72 25  |..:...$..i(addr%|
000031d0  29 3a 3d 3f 61 64 64 72  25 2b 28 61 64 64 72 25  |):=?addr%+(addr%|
000031e0  3f 31 29 2a 32 35 36 0d  15 ae 05 3a 0d 15 b8 0e  |?1)*256....:....|
000031f0  dd a4 66 6f 75 72 28 77  25 29 0d 15 c2 14 e7 20  |..four(w%)..... |
00003200  28 77 25 83 34 29 3d 30  20 8c 20 3d 77 25 0d 15  |(w%.4)=0 . =w%..|
00003210  cc 10 3d 77 25 2b 34 2d  28 77 25 83 34 29 0d 15  |..=w%+4-(w%.4)..|
00003220  d6 05 3a 0d 15 e0 11 dd  f2 65 72 72 6f 72 28 65  |..:......error(e|
00003230  72 72 24 29 0d 15 ea 0b  21 62 25 3d 32 35 35 0d  |rr$)....!b%=255.|
00003240  15 f4 13 24 28 62 25 2b  34 29 3d 65 72 72 24 2b  |...$(b%+4)=err$+|
00003250  bd 30 0d 15 fe 37 c8 99  20 22 57 69 6d 70 5f 52  |.0...7.. "Wimp_R|
00003260  65 70 6f 72 74 45 72 72  6f 72 22 2c 62 25 2c 33  |eportError",b%,3|
00003270  2c 22 42 72 6f 77 7a 65  72 22 20 b8 20 2c 65 72  |,"Browzer" . ,er|
00003280  72 5f 72 65 73 75 6c 74  25 0d 16 08 05 e1 0d 16  |r_result%.......|
00003290  12 05 3a 0d 16 1c 15 dd  f2 65 72 72 6f 72 32 28  |..:......error2(|
000032a0  65 72 72 24 2c 77 25 29  0d 16 26 0b 21 62 25 3d  |err$,w%)..&.!b%=|
000032b0  32 35 35 0d 16 30 13 24  28 62 25 2b 34 29 3d 65  |255..0.$(b%+4)=e|
000032c0  72 72 24 2b bd 30 0d 16  3a 38 c8 99 20 22 57 69  |rr$+.0..:8.. "Wi|
000032d0  6d 70 5f 52 65 70 6f 72  74 45 72 72 6f 72 22 2c  |mp_ReportError",|
000032e0  62 25 2c 77 25 2c 22 42  72 6f 77 7a 65 72 22 20  |b%,w%,"Browzer" |
000032f0  b8 20 2c 65 72 72 5f 72  65 73 75 6c 74 25 0d 16  |. ,err_result%..|
00003300  44 05 e1 0d 16 4e 05 3a  0d 16 58 12 dd a4 66 69  |D....N.:..X...fi|
00003310  6c 65 73 69 7a 65 28 77  24 29 0d 16 62 0b ea 20  |lesize(w$)..b.. |
00003320  77 25 2c 78 25 0d 16 6c  0c 78 25 3d 8e 28 77 24  |w%,x%..l.x%=.(w$|
00003330  29 0d 16 76 41 f4 20 49  46 20 78 25 3d 30 20 54  |)..vA. IF x%=0 T|
00003340  48 45 4e 20 45 52 52 4f  52 20 39 30 30 32 2c 22  |HEN ERROR 9002,"|
00003350  46 69 6c 65 20 22 2b 77  24 2b 22 20 6e 6f 74 20  |File "+w$+" not |
00003360  66 6f 75 6e 64 20 28 66  69 6c 65 73 69 7a 65 29  |found (filesize)|
00003370  2e 22 0d 16 80 10 e7 20  78 25 3d 30 20 8c 20 3d  |."..... x%=0 . =|
00003380  2d 31 0d 16 8a 0b 77 25  3d a2 23 78 25 0d 16 94  |-1....w%=.#x%...|
00003390  08 d9 23 78 25 0d 16 9e  07 3d 77 25 0d 16 a8 05  |..#x%....=w%....|
000033a0  3a 0d 16 b2 05 3a 0d 16  bc 05 3a 0d 16 c6 05 3a  |:....:....:....:|
000033b0  0d 16 d0 1f dd f2 74 69  63 6b 28 70 74 72 25 2c  |......tick(ptr%,|
000033c0  69 25 2c 63 6c 65 61 72  25 2c 65 6f 72 25 29 0d  |i%,clear%,eor%).|
000033d0  16 da 08 ea 20 77 25 0d  16 e4 14 77 25 3d 70 74  |.... w%....w%=pt|
000033e0  72 25 2b 32 38 2b 32 34  2a 69 25 0d 16 ee 20 21  |r%+28+24*i%... !|
000033f0  77 25 3d 21 77 25 20 80  20 28 26 46 46 46 46 46  |w%=!w% . (&FFFFF|
00003400  46 46 46 2b 63 6c 65 61  72 25 29 0d 16 f8 13 21  |FFF+clear%)....!|
00003410  77 25 3d 21 77 25 20 82  20 2d 65 6f 72 25 0d 17  |w%=!w% . -eor%..|
00003420  02 05 e1 0d 17 0c 05 3a  0d 17 16 38 dd a4 7a 65  |.......:...8..ze|
00003430  72 6f 28 77 25 29 3a ea  20 73 24 3a 73 24 3d 22  |ro(w%):. s$:s$="|
00003440  22 3a c8 95 20 3f 77 25  3e 31 33 3a 73 24 2b 3d  |":.. ?w%>13:s$+=|
00003450  bd 3f 77 25 3a 77 25 2b  3d 31 3a ce 3a 3d 73 24  |.?w%:w%+=1:.:=s$|
00003460  0d 17 20 05 3a 0d 17 2a  1d dd a4 67 65 74 74 65  |.. .:..*...gette|
00003470  78 74 6d 65 6d 28 70 62  25 21 30 2c 70 62 25 21  |xtmem(pb%!0,pb%!|
00003480  34 29 0d 17 34 1f c8 99  20 22 57 69 6d 70 5f 47  |4)..4... "Wimp_G|
00003490  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 70 62  |etIconState",,pb|
000034a0  25 0d 17 3e 0b 3d 70 62  25 21 32 38 0d 17 48 05  |%..>.=pb%!28..H.|
000034b0  3a 0d 17 52 1a dd f2 69  6e 76 61 6c 69 64 28 70  |:..R...invalid(p|
000034c0  62 25 21 30 2c 70 62 25  21 34 29 0d 17 5c 30 70  |b%!0,pb%!4)..\0p|
000034d0  62 25 21 38 3d 30 3a 70  62 25 21 31 32 3d 30 3a  |b%!8=0:pb%!12=0:|
000034e0  c8 99 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |.. "Wimp_SetIcon|
000034f0  53 74 61 74 65 22 2c 2c  70 62 25 0d 17 66 05 e1  |State",,pb%..f..|
00003500  0d 17 70 05 3a 0d 17 7a  05 3a 0d 17 84 04 0d ff  |..p.:..z.:......|
00003510